From 3bd885eaf37d955218303669e0eab2b77232019f Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Sat, 24 Apr 2021 19:05:20 -0700 Subject: [PATCH] 4.0.0 --- .../js/waveform-playlist.var.js | 10452 ++++++++++++++++ .../js/waveform-playlist.var.js.map | 1 + package-lock.json | 2 +- package.json | 2 +- 4 files changed, 10455 insertions(+), 2 deletions(-) create mode 100644 dist/waveform-playlist/js/waveform-playlist.var.js create mode 100644 dist/waveform-playlist/js/waveform-playlist.var.js.map diff --git a/dist/waveform-playlist/js/waveform-playlist.var.js b/dist/waveform-playlist/js/waveform-playlist.var.js new file mode 100644 index 00000000..b1d2281a --- /dev/null +++ b/dist/waveform-playlist/js/waveform-playlist.var.js @@ -0,0 +1,10452 @@ +var WaveformPlaylist = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/waveform-playlist/js/"; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.init = init; + + exports.default = function () { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var ee = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _eventEmitter2.default)(); + + return init(options, ee); + }; + + var _lodash = __webpack_require__(1); + + var _lodash2 = _interopRequireDefault(_lodash); + + var _createElement = __webpack_require__(3); + + var _createElement2 = _interopRequireDefault(_createElement); + + var _eventEmitter = __webpack_require__(16); + + var _eventEmitter2 = _interopRequireDefault(_eventEmitter); + + var _Playlist = __webpack_require__(37); + + var _Playlist2 = _interopRequireDefault(_Playlist); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function init() { + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + var ee = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0, _eventEmitter2.default)(); + + if (options.container === undefined) { + throw new Error('DOM element container must be given.'); + } + + window.OfflineAudioContext = window.OfflineAudioContext || window.webkitOfflineAudioContext; + window.AudioContext = window.AudioContext || window.webkitAudioContext; + + var audioContext = new window.AudioContext(); + + var defaults = { + ac: audioContext, + sampleRate: audioContext.sampleRate, + samplesPerPixel: 4096, + mono: true, + fadeType: 'logarithmic', + exclSolo: false, + timescale: false, + controls: { + show: false, + width: 150, + widgets: { + muteOrSolo: true, + volume: true, + stereoPan: true, + collapse: true, + remove: true + } + }, + colors: { + waveOutlineColor: 'white', + timeColor: 'grey', + fadeColor: 'black' + }, + seekStyle: 'line', + waveHeight: 128, + collapsedWaveHeight: 30, + state: 'cursor', + zoomLevels: [512, 1024, 2048, 4096], + annotationList: { + annotations: [], + controls: [], + editable: false, + linkEndpoints: false, + isContinuousPlay: false + }, + isAutomaticScroll: false + }; + + var config = (0, _lodash2.default)({}, options, defaults); + var zoomIndex = config.zoomLevels.indexOf(config.samplesPerPixel); + + if (zoomIndex === -1) { + throw new Error('initial samplesPerPixel must be included in array zoomLevels'); + } + + var playlist = new _Playlist2.default(); + playlist.setSampleRate(config.sampleRate); + playlist.setSamplesPerPixel(config.samplesPerPixel); + playlist.setAudioContext(config.ac); + playlist.setEventEmitter(ee); + playlist.setUpEventEmitter(); + playlist.setTimeSelection(0, 0); + playlist.setState(config.state); + playlist.setControlOptions(config.controls); + playlist.setWaveHeight(config.waveHeight); + playlist.setCollapsedWaveHeight(config.collapsedWaveHeight); + playlist.setColors(config.colors); + playlist.setZoomLevels(config.zoomLevels); + playlist.setZoomIndex(zoomIndex); + playlist.setMono(config.mono); + playlist.setExclSolo(config.exclSolo); + playlist.setShowTimeScale(config.timescale); + playlist.setSeekStyle(config.seekStyle); + playlist.setAnnotations(config.annotationList); + playlist.isAutomaticScroll = config.isAutomaticScroll; + playlist.isContinuousPlay = config.isContinuousPlay; + playlist.linkedEndpoints = config.linkedEndpoints; + + // take care of initial virtual dom rendering. + var tree = playlist.render(); + var rootNode = (0, _createElement2.default)(tree); + + config.container.appendChild(rootNode); + playlist.tree = tree; + playlist.rootNode = rootNode; + + return playlist; + } + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global, module) {/** + * Lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright OpenJS Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; + + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; + + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 800, + HOT_SPAN = 16; + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + asyncTag = '[object AsyncFunction]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + nullTag = '[object Null]', + objectTag = '[object Object]', + proxyTag = '[object Proxy]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + undefinedTag = '[object Undefined]', + weakMapTag = '[object WeakMap]'; + + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; + + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + + /** Detect free variable `exports`. */ + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + + /** Detect free variable `module`. */ + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = freeModule && freeModule.exports === freeExports; + + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; + + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + // Use `util.types` for Node.js 10+. + var types = freeModule && freeModule.require && freeModule.require('util').types; + + if (types) { + return types; + } + + // Legacy `process.binding('util')` for Node.js < 10. + return freeProcess && freeProcess.binding && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * 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); + }; + } + + /** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function getValue(object, key) { + return object == null ? undefined : object[key]; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** Used for built-in method references. */ + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + + /** Used to detect overreaching core-js shims. */ + var coreJsData = root['__core-js_shared__']; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = funcProto.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to detect methods masquerading as native. */ + var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; + }()); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var nativeObjectToString = objectProto.toString; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + symToStringTag = Symbol ? Symbol.toStringTag : undefined; + + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeMax = Math.max, + nativeNow = Date.now; + + /* Built-in method references that are verified to be native. */ + var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + + /** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Hash(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; + } + + /** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(key) { + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ + function hashSet(key, value) { + var data = this.__data__; + this.size += this.has(key) ? 0 : 1; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; + } + + // Add methods to `Hash`. + Hash.prototype.clear = hashClear; + Hash.prototype['delete'] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + + /** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function ListCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ + function listCacheClear() { + this.__data__ = []; + this.size = 0; + } + + /** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + --this.size; + return true; + } + + /** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; + } + + /** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; + } + + /** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ + function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + ++this.size; + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; + } + + // Add methods to `ListCache`. + ListCache.prototype.clear = listCacheClear; + ListCache.prototype['delete'] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function MapCache(entries) { + var index = -1, + length = entries == null ? 0 : entries.length; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapCacheClear() { + this.size = 0; + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapCacheDelete(key) { + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapCacheGet(key) { + return getMapData(this, key).get(key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapCacheSet(key, value) { + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype['delete'] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ + function Stack(entries) { + var data = this.__data__ = new ListCache(entries); + this.size = data.size; + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = new ListCache; + this.size = 0; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + return this.__data__.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + return this.__data__.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + this.size = ++data.size; + return this; + } + data = this.__data__ = new MapCache(pairs); + } + data.set(key, value); + this.size = data.size; + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { + result.push(key); + } + } + return result; + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); + } + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `getTag` without fallbacks for buggy environments. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + if (value == null) { + return value === undefined ? undefinedTag : nullTag; + } + return (symToStringTag && symToStringTag in Object(value)) + ? getRawTag(value) + : objectToString(value); + } + + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && baseGetTag(value) == argsTag; + } + + /** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ + function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; + } + + /** + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; + + for (var key in object) { + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + baseFor(source, function(srcValue, key) { + stack || (stack = new Stack); + if (isObject(srcValue)) { + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }, keysIn); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = safeGet(object, key), + srcValue = safeGet(source, key), + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + + newValue = srcValue; + if (isArr || isBuff || isTyped) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else if (isBuff) { + isCommon = false; + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || isFunction(objValue)) { + newValue = initCloneObject(srcValue); + } + } + else { + isCommon = false; + } + } + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); + } + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + return setToString(overRest(func, start, identity), func + ''); + } + + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * 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; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + var isNew = !object; + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source + * objects into destination objects that are passed thru. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); + stack['delete'](srcValue); + } + return objValue; + } + + /** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; + } + + /** + * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the raw `toStringTag`. + */ + function getRawTag(value) { + var isOwn = hasOwnProperty.call(value, symToStringTag), + tag = value[symToStringTag]; + + try { + value[symToStringTag] = undefined; + var unmasked = true; + } catch (e) {} + + var result = nativeObjectToString.call(value); + if (unmasked) { + if (isOwn) { + value[symToStringTag] = tag; + } else { + delete value[symToStringTag]; + } + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + var type = typeof value; + length = length == null ? MAX_SAFE_INTEGER : length; + + return !!length && + (type == 'number' || + (type != 'symbol' && reIsUint.test(value))) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); + } + + /** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ + function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); + } + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + + /** + * Converts `value` to a string using `Object.prototype.toString`. + * + * @private + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. + */ + function objectToString(value) { + return nativeObjectToString.call(value); + } + + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + + /** + * Gets the value at `key`, unless `key` is "__proto__" or "constructor". + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ + function safeGet(object, key) { + if (key === 'constructor' && typeof object[key] === 'function') { + return; + } + + if (key == '__proto__') { + return; + } + + return object[key]; + } + + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to convert. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = nativeIsBuffer || stubFalse; + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + if (!isObject(value)) { + return false; + } + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 9 which returns 'object' for typed arrays and other constructors. + var tag = baseGetTag(value); + return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return value != null && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return value != null && typeof value == 'object'; + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || baseGetTag(value) != objectTag) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return typeof Ctor == 'function' && Ctor instanceof Ctor && + funcToString.call(Ctor) == objectCtorString; + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.defaults + * @example + * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } + */ + var defaultsDeep = baseRest(function(args) { + args.push(undefined, customDefaultsMerge); + return apply(mergeWith, undefined, args); + }); + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); + } + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with six arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; + * + * _.mergeWith(object, other, customizer); + * // => { 'a': [1, 3], 'b': [2, 4] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * Creates a function that returns `value`. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Util + * @param {*} value The value to return from the new function. + * @returns {Function} Returns the new constant function. + * @example + * + * var objects = _.times(2, _.constant({ 'a': 1 })); + * + * console.log(objects); + * // => [{ 'a': 1 }, { 'a': 1 }] + * + * console.log(objects[0] === objects[1]); + * // => true + */ + function constant(value) { + return function() { + return value; + }; + } + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + /** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ + function stubFalse() { + return false; + } + + module.exports = defaultsDeep; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()), __webpack_require__(2)(module))) + +/***/ }), +/* 2 */ +/***/ (function(module, exports) { + + module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + module.children = []; + module.webpackPolyfill = 1; + } + return module; + } + + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + + var createElement = __webpack_require__(4) + + module.exports = createElement + + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + + var document = __webpack_require__(5) + + var applyProperties = __webpack_require__(7) + + var isVNode = __webpack_require__(10) + var isVText = __webpack_require__(12) + var isWidget = __webpack_require__(13) + var handleThunk = __webpack_require__(14) + + module.exports = createElement + + function createElement(vnode, opts) { + var doc = opts ? opts.document || document : document + var warn = opts ? opts.warn : null + + vnode = handleThunk(vnode).a + + if (isWidget(vnode)) { + return vnode.init() + } else if (isVText(vnode)) { + return doc.createTextNode(vnode.text) + } else if (!isVNode(vnode)) { + if (warn) { + warn("Item is not a valid virtual dom node", vnode) + } + return null + } + + var node = (vnode.namespace === null) ? + doc.createElement(vnode.tagName) : + doc.createElementNS(vnode.namespace, vnode.tagName) + + var props = vnode.properties + applyProperties(node, props) + + var children = vnode.children + + for (var i = 0; i < children.length; i++) { + var childNode = createElement(children[i], opts) + if (childNode) { + node.appendChild(childNode) + } + } + + return node + } + + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + + /* WEBPACK VAR INJECTION */(function(global) {var topLevel = typeof global !== 'undefined' ? global : + typeof window !== 'undefined' ? window : {} + var minDoc = __webpack_require__(6); + + var doccy; + + if (typeof document !== 'undefined') { + doccy = document; + } else { + doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4']; + + if (!doccy) { + doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc; + } + } + + module.exports = doccy; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }), +/* 6 */ +/***/ (function(module, exports) { + + /* (ignored) */ + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(8) + var isHook = __webpack_require__(9) + + module.exports = applyProperties + + function applyProperties(node, props, previous) { + for (var propName in props) { + var propValue = props[propName] + + if (propValue === undefined) { + removeProperty(node, propName, propValue, previous); + } else if (isHook(propValue)) { + removeProperty(node, propName, propValue, previous) + if (propValue.hook) { + propValue.hook(node, + propName, + previous ? previous[propName] : undefined) + } + } else { + if (isObject(propValue)) { + patchObject(node, props, previous, propName, propValue); + } else { + node[propName] = propValue + } + } + } + } + + function removeProperty(node, propName, propValue, previous) { + if (previous) { + var previousValue = previous[propName] + + if (!isHook(previousValue)) { + if (propName === "attributes") { + for (var attrName in previousValue) { + node.removeAttribute(attrName) + } + } else if (propName === "style") { + for (var i in previousValue) { + node.style[i] = "" + } + } else if (typeof previousValue === "string") { + node[propName] = "" + } else { + node[propName] = null + } + } else if (previousValue.unhook) { + previousValue.unhook(node, propName, propValue) + } + } + } + + function patchObject(node, props, previous, propName, propValue) { + var previousValue = previous ? previous[propName] : undefined + + // Set attributes + if (propName === "attributes") { + for (var attrName in propValue) { + var attrValue = propValue[attrName] + + if (attrValue === undefined) { + node.removeAttribute(attrName) + } else { + node.setAttribute(attrName, attrValue) + } + } + + return + } + + if(previousValue && isObject(previousValue) && + getPrototype(previousValue) !== getPrototype(propValue)) { + node[propName] = propValue + return + } + + if (!isObject(node[propName])) { + node[propName] = {} + } + + var replacer = propName === "style" ? "" : undefined + + for (var k in propValue) { + var value = propValue[k] + node[propName][k] = (value === undefined) ? replacer : value + } + } + + function getPrototype(value) { + if (Object.getPrototypeOf) { + return Object.getPrototypeOf(value) + } else if (value.__proto__) { + return value.__proto__ + } else if (value.constructor) { + return value.constructor.prototype + } + } + + +/***/ }), +/* 8 */ +/***/ (function(module, exports) { + + "use strict"; + + module.exports = function isObject(x) { + return typeof x === "object" && x !== null; + }; + + +/***/ }), +/* 9 */ +/***/ (function(module, exports) { + + module.exports = isHook + + function isHook(hook) { + return hook && + (typeof hook.hook === "function" && !hook.hasOwnProperty("hook") || + typeof hook.unhook === "function" && !hook.hasOwnProperty("unhook")) + } + + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + + var version = __webpack_require__(11) + + module.exports = isVirtualNode + + function isVirtualNode(x) { + return x && x.type === "VirtualNode" && x.version === version + } + + +/***/ }), +/* 11 */ +/***/ (function(module, exports) { + + module.exports = "2" + + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + + var version = __webpack_require__(11) + + module.exports = isVirtualText + + function isVirtualText(x) { + return x && x.type === "VirtualText" && x.version === version + } + + +/***/ }), +/* 13 */ +/***/ (function(module, exports) { + + module.exports = isWidget + + function isWidget(w) { + return w && w.type === "Widget" + } + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + + var isVNode = __webpack_require__(10) + var isVText = __webpack_require__(12) + var isWidget = __webpack_require__(13) + var isThunk = __webpack_require__(15) + + module.exports = handleThunk + + function handleThunk(a, b) { + var renderedA = a + var renderedB = b + + if (isThunk(b)) { + renderedB = renderThunk(b, a) + } + + if (isThunk(a)) { + renderedA = renderThunk(a, null) + } + + return { + a: renderedA, + b: renderedB + } + } + + function renderThunk(thunk, previous) { + var renderedThunk = thunk.vnode + + if (!renderedThunk) { + renderedThunk = thunk.vnode = thunk.render(previous) + } + + if (!(isVNode(renderedThunk) || + isVText(renderedThunk) || + isWidget(renderedThunk))) { + throw new Error("thunk did not return a valid node"); + } + + return renderedThunk + } + + +/***/ }), +/* 15 */ +/***/ (function(module, exports) { + + module.exports = isThunk + + function isThunk(t) { + return t && t.type === "Thunk" + } + + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var d = __webpack_require__(17) + , callable = __webpack_require__(36) + + , apply = Function.prototype.apply, call = Function.prototype.call + , create = Object.create, defineProperty = Object.defineProperty + , defineProperties = Object.defineProperties + , hasOwnProperty = Object.prototype.hasOwnProperty + , descriptor = { configurable: true, enumerable: false, writable: true } + + , on, once, off, emit, methods, descriptors, base; + + on = function (type, listener) { + var data; + + callable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) { + data = descriptor.value = create(null); + defineProperty(this, '__ee__', descriptor); + descriptor.value = null; + } else { + data = this.__ee__; + } + if (!data[type]) data[type] = listener; + else if (typeof data[type] === 'object') data[type].push(listener); + else data[type] = [data[type], listener]; + + return this; + }; + + once = function (type, listener) { + var once, self; + + callable(listener); + self = this; + on.call(this, type, once = function () { + off.call(self, type, once); + apply.call(listener, this, arguments); + }); + + once.__eeOnceListener__ = listener; + return this; + }; + + off = function (type, listener) { + var data, listeners, candidate, i; + + callable(listener); + + if (!hasOwnProperty.call(this, '__ee__')) return this; + data = this.__ee__; + if (!data[type]) return this; + listeners = data[type]; + + if (typeof listeners === 'object') { + for (i = 0; (candidate = listeners[i]); ++i) { + if ((candidate === listener) || + (candidate.__eeOnceListener__ === listener)) { + if (listeners.length === 2) data[type] = listeners[i ? 0 : 1]; + else listeners.splice(i, 1); + } + } + } else { + if ((listeners === listener) || + (listeners.__eeOnceListener__ === listener)) { + delete data[type]; + } + } + + return this; + }; + + emit = function (type) { + var i, l, listener, listeners, args; + + if (!hasOwnProperty.call(this, '__ee__')) return; + listeners = this.__ee__[type]; + if (!listeners) return; + + if (typeof listeners === 'object') { + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) args[i - 1] = arguments[i]; + + listeners = listeners.slice(); + for (i = 0; (listener = listeners[i]); ++i) { + apply.call(listener, this, args); + } + } else { + switch (arguments.length) { + case 1: + call.call(listeners, this); + break; + case 2: + call.call(listeners, this, arguments[1]); + break; + case 3: + call.call(listeners, this, arguments[1], arguments[2]); + break; + default: + l = arguments.length; + args = new Array(l - 1); + for (i = 1; i < l; ++i) { + args[i - 1] = arguments[i]; + } + apply.call(listeners, this, args); + } + } + }; + + methods = { + on: on, + once: once, + off: off, + emit: emit + }; + + descriptors = { + on: d(on), + once: d(once), + off: d(off), + emit: d(emit) + }; + + base = defineProperties({}, descriptors); + + module.exports = exports = function (o) { + return (o == null) ? create(base) : defineProperties(Object(o), descriptors); + }; + exports.methods = methods; + + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var isValue = __webpack_require__(18) + , isPlainFunction = __webpack_require__(19) + , assign = __webpack_require__(23) + , normalizeOpts = __webpack_require__(32) + , contains = __webpack_require__(33); + + var d = (module.exports = function (dscr, value/*, options*/) { + var c, e, w, options, desc; + if (arguments.length < 2 || typeof dscr !== "string") { + options = value; + value = dscr; + dscr = null; + } else { + options = arguments[2]; + } + if (isValue(dscr)) { + c = contains.call(dscr, "c"); + e = contains.call(dscr, "e"); + w = contains.call(dscr, "w"); + } else { + c = w = true; + e = false; + } + + desc = { value: value, configurable: c, enumerable: e, writable: w }; + return !options ? desc : assign(normalizeOpts(options), desc); + }); + + d.gs = function (dscr, get, set/*, options*/) { + var c, e, options, desc; + if (typeof dscr !== "string") { + options = set; + set = get; + get = dscr; + dscr = null; + } else { + options = arguments[3]; + } + if (!isValue(get)) { + get = undefined; + } else if (!isPlainFunction(get)) { + options = get; + get = set = undefined; + } else if (!isValue(set)) { + set = undefined; + } else if (!isPlainFunction(set)) { + options = set; + set = undefined; + } + if (isValue(dscr)) { + c = contains.call(dscr, "c"); + e = contains.call(dscr, "e"); + } else { + c = true; + e = false; + } + + desc = { get: get, set: set, configurable: c, enumerable: e }; + return !options ? desc : assign(normalizeOpts(options), desc); + }; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports) { + + "use strict"; + + // ES3 safe + var _undefined = void 0; + + module.exports = function (value) { return value !== _undefined && value !== null; }; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var isFunction = __webpack_require__(20); + + var classRe = /^\s*class[\s{/}]/, functionToString = Function.prototype.toString; + + module.exports = function (value) { + if (!isFunction(value)) return false; + if (classRe.test(functionToString.call(value))) return false; + return true; + }; + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var isPrototype = __webpack_require__(21); + + module.exports = function (value) { + if (typeof value !== "function") return false; + + if (!hasOwnProperty.call(value, "length")) return false; + + try { + if (typeof value.length !== "number") return false; + if (typeof value.call !== "function") return false; + if (typeof value.apply !== "function") return false; + } catch (error) { + return false; + } + + return !isPrototype(value); + }; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var isObject = __webpack_require__(22); + + module.exports = function (value) { + if (!isObject(value)) return false; + try { + if (!value.constructor) return false; + return value.constructor.prototype === value; + } catch (error) { + return false; + } + }; + + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var isValue = __webpack_require__(18); + + // prettier-ignore + var possibleTypes = { "object": true, "function": true, "undefined": true /* document.all */ }; + + module.exports = function (value) { + if (!isValue(value)) return false; + return hasOwnProperty.call(possibleTypes, typeof value); + }; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + module.exports = __webpack_require__(24)() ? Object.assign : __webpack_require__(25); + + +/***/ }), +/* 24 */ +/***/ (function(module, exports) { + + "use strict"; + + module.exports = function () { + var assign = Object.assign, obj; + if (typeof assign !== "function") return false; + obj = { foo: "raz" }; + assign(obj, { bar: "dwa" }, { trzy: "trzy" }); + return obj.foo + obj.bar + obj.trzy === "razdwatrzy"; + }; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var keys = __webpack_require__(26) + , value = __webpack_require__(31) + , max = Math.max; + + module.exports = function (dest, src/*, …srcn*/) { + var error, i, length = max(arguments.length, 2), assign; + dest = Object(value(dest)); + assign = function (key) { + try { + dest[key] = src[key]; + } catch (e) { + if (!error) error = e; + } + }; + for (i = 1; i < length; ++i) { + src = arguments[i]; + keys(src).forEach(assign); + } + if (error !== undefined) throw error; + return dest; + }; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + module.exports = __webpack_require__(27)() ? Object.keys : __webpack_require__(28); + + +/***/ }), +/* 27 */ +/***/ (function(module, exports) { + + "use strict"; + + module.exports = function () { + try { + Object.keys("primitive"); + return true; + } catch (e) { + return false; + } + }; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var isValue = __webpack_require__(29); + + var keys = Object.keys; + + module.exports = function (object) { return keys(isValue(object) ? Object(object) : object); }; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var _undefined = __webpack_require__(30)(); // Support ES3 engines + + module.exports = function (val) { return val !== _undefined && val !== null; }; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports) { + + "use strict"; + + // eslint-disable-next-line no-empty-function + module.exports = function () {}; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var isValue = __webpack_require__(29); + + module.exports = function (value) { + if (!isValue(value)) throw new TypeError("Cannot use null or undefined"); + return value; + }; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + var isValue = __webpack_require__(29); + + var forEach = Array.prototype.forEach, create = Object.create; + + var process = function (src, obj) { + var key; + for (key in src) obj[key] = src[key]; + }; + + // eslint-disable-next-line no-unused-vars + module.exports = function (opts1/*, …options*/) { + var result = create(null); + forEach.call(arguments, function (options) { + if (!isValue(options)) return; + process(Object(options), result); + }); + return result; + }; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + + "use strict"; + + module.exports = __webpack_require__(34)() ? String.prototype.contains : __webpack_require__(35); + + +/***/ }), +/* 34 */ +/***/ (function(module, exports) { + + "use strict"; + + var str = "razdwatrzy"; + + module.exports = function () { + if (typeof str.contains !== "function") return false; + return str.contains("dwa") === true && str.contains("foo") === false; + }; + + +/***/ }), +/* 35 */ +/***/ (function(module, exports) { + + "use strict"; + + var indexOf = String.prototype.indexOf; + + module.exports = function (searchString/*, position*/) { + return indexOf.call(this, searchString, arguments[1]) > -1; + }; + + +/***/ }), +/* 36 */ +/***/ (function(module, exports) { + + "use strict"; + + module.exports = function (fn) { + if (typeof fn !== "function") throw new TypeError(fn + " is not a function"); + return fn; + }; + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _lodash = __webpack_require__(1); + + var _lodash2 = _interopRequireDefault(_lodash); + + var _h = __webpack_require__(38); + + var _h2 = _interopRequireDefault(_h); + + var _diff = __webpack_require__(50); + + var _diff2 = _interopRequireDefault(_diff); + + var _patch = __webpack_require__(54); + + var _patch2 = _interopRequireDefault(_patch); + + var _inlineWorker = __webpack_require__(59); + + var _inlineWorker2 = _interopRequireDefault(_inlineWorker); + + var _conversions = __webpack_require__(60); + + var _LoaderFactory = __webpack_require__(61); + + var _LoaderFactory2 = _interopRequireDefault(_LoaderFactory); + + var _ScrollHook = __webpack_require__(66); + + var _ScrollHook2 = _interopRequireDefault(_ScrollHook); + + var _TimeScale = __webpack_require__(67); + + var _TimeScale2 = _interopRequireDefault(_TimeScale); + + var _Track = __webpack_require__(69); + + var _Track2 = _interopRequireDefault(_Track); + + var _Playout = __webpack_require__(87); + + var _Playout2 = _interopRequireDefault(_Playout); + + var _AnnotationList = __webpack_require__(88); + + var _AnnotationList2 = _interopRequireDefault(_AnnotationList); + + var _recorderWorker = __webpack_require__(94); + + var _recorderWorker2 = _interopRequireDefault(_recorderWorker); + + var _exportWavWorker = __webpack_require__(95); + + var _exportWavWorker2 = _interopRequireDefault(_exportWavWorker); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class() { + _classCallCheck(this, _class); + + this.tracks = []; + this.soloedTracks = []; + this.mutedTracks = []; + this.collapsedTracks = []; + this.playoutPromises = []; + + this.cursor = 0; + this.playbackSeconds = 0; + this.duration = 0; + this.scrollLeft = 0; + this.scrollTimer = undefined; + this.showTimescale = false; + // whether a user is scrolling the waveform + this.isScrolling = false; + + this.fadeType = 'logarithmic'; + this.masterGain = 1; + this.annotations = []; + this.durationFormat = 'hh:mm:ss.uuu'; + this.isAutomaticScroll = false; + this.resetDrawTimer = undefined; + } + + // TODO extract into a plugin + + + _createClass(_class, [{ + key: 'initExporter', + value: function initExporter() { + this.exportWorker = new _inlineWorker2.default(_exportWavWorker2.default); + } + + // TODO extract into a plugin + + }, { + key: 'initRecorder', + value: function initRecorder(stream) { + var _this = this; + + this.mediaRecorder = new window.MediaRecorder(stream); + + this.mediaRecorder.onstart = function () { + var track = new _Track2.default(); + track.setName('Recording'); + track.setEnabledStates(); + track.setEventEmitter(_this.ee); + + _this.recordingTrack = track; + _this.tracks.push(track); + + _this.chunks = []; + _this.working = false; + }; + + this.mediaRecorder.ondataavailable = function (e) { + _this.chunks.push(e.data); + + // throttle peaks calculation + if (!_this.working) { + var recording = new Blob(_this.chunks, { type: 'audio/ogg; codecs=opus' }); + var loader = _LoaderFactory2.default.createLoader(recording, _this.ac); + loader.load().then(function (audioBuffer) { + // ask web worker for peaks. + _this.recorderWorker.postMessage({ + samples: audioBuffer.getChannelData(0), + samplesPerPixel: _this.samplesPerPixel + }); + _this.recordingTrack.setCues(0, audioBuffer.duration); + _this.recordingTrack.setBuffer(audioBuffer); + _this.recordingTrack.setPlayout(new _Playout2.default(_this.ac, audioBuffer)); + _this.adjustDuration(); + }).catch(function () { + _this.working = false; + }); + _this.working = true; + } + }; + + this.mediaRecorder.onstop = function () { + _this.chunks = []; + _this.working = false; + }; + + this.recorderWorker = new _inlineWorker2.default(_recorderWorker2.default); + // use a worker for calculating recording peaks. + this.recorderWorker.onmessage = function (e) { + _this.recordingTrack.setPeaks(e.data); + _this.working = false; + _this.drawRequest(); + }; + } + }, { + key: 'setShowTimeScale', + value: function setShowTimeScale(show) { + this.showTimescale = show; + } + }, { + key: 'setMono', + value: function setMono(mono) { + this.mono = mono; + } + }, { + key: 'setExclSolo', + value: function setExclSolo(exclSolo) { + this.exclSolo = exclSolo; + } + }, { + key: 'setSeekStyle', + value: function setSeekStyle(style) { + this.seekStyle = style; + } + }, { + key: 'getSeekStyle', + value: function getSeekStyle() { + return this.seekStyle; + } + }, { + key: 'setSampleRate', + value: function setSampleRate(sampleRate) { + this.sampleRate = sampleRate; + } + }, { + key: 'setSamplesPerPixel', + value: function setSamplesPerPixel(samplesPerPixel) { + this.samplesPerPixel = samplesPerPixel; + } + }, { + key: 'setAudioContext', + value: function setAudioContext(ac) { + this.ac = ac; + } + }, { + key: 'setControlOptions', + value: function setControlOptions(controlOptions) { + this.controls = controlOptions; + } + }, { + key: 'setWaveHeight', + value: function setWaveHeight(height) { + this.waveHeight = height; + } + }, { + key: 'setCollapsedWaveHeight', + value: function setCollapsedWaveHeight(height) { + this.collapsedWaveHeight = height; + } + }, { + key: 'setColors', + value: function setColors(colors) { + this.colors = colors; + } + }, { + key: 'setAnnotations', + value: function setAnnotations(config) { + this.annotationList = new _AnnotationList2.default(this, config.annotations, config.controls, config.editable, config.linkEndpoints, config.isContinuousPlay); + } + }, { + key: 'setEventEmitter', + value: function setEventEmitter(ee) { + this.ee = ee; + } + }, { + key: 'getEventEmitter', + value: function getEventEmitter() { + return this.ee; + } + }, { + key: 'setUpEventEmitter', + value: function setUpEventEmitter() { + var _this2 = this; + + var ee = this.ee; + + ee.on('automaticscroll', function (val) { + _this2.isAutomaticScroll = val; + }); + + ee.on('durationformat', function (format) { + _this2.durationFormat = format; + _this2.drawRequest(); + }); + + ee.on('select', function (start, end, track) { + if (_this2.isPlaying()) { + _this2.lastSeeked = start; + _this2.pausedAt = undefined; + _this2.restartPlayFrom(start); + } else { + // reset if it was paused. + _this2.seek(start, end, track); + _this2.ee.emit('timeupdate', start); + _this2.drawRequest(); + } + }); + + ee.on('startaudiorendering', function (type) { + _this2.startOfflineRender(type); + }); + + ee.on('statechange', function (state) { + _this2.setState(state); + _this2.drawRequest(); + }); + + ee.on('shift', function (deltaTime, track) { + track.setStartTime(track.getStartTime() + deltaTime); + _this2.adjustDuration(); + _this2.drawRequest(); + }); + + ee.on('record', function () { + _this2.record(); + }); + + ee.on('play', function (start, end) { + _this2.play(start, end); + }); + + ee.on('pause', function () { + _this2.pause(); + }); + + ee.on('stop', function () { + _this2.stop(); + }); + + ee.on('rewind', function () { + _this2.rewind(); + }); + + ee.on('fastforward', function () { + _this2.fastForward(); + }); + + ee.on('clear', function () { + _this2.clear().then(function () { + _this2.drawRequest(); + }); + }); + + ee.on('solo', function (track) { + _this2.soloTrack(track); + _this2.adjustTrackPlayout(); + _this2.drawRequest(); + }); + + ee.on('mute', function (track) { + _this2.muteTrack(track); + _this2.adjustTrackPlayout(); + _this2.drawRequest(); + }); + + ee.on('removeTrack', function (track) { + _this2.removeTrack(track); + _this2.adjustTrackPlayout(); + _this2.drawRequest(); + }); + + ee.on('changeTrackView', function (track, opts) { + _this2.collapseTrack(track, opts); + _this2.drawRequest(); + }); + + ee.on('volumechange', function (volume, track) { + track.setGainLevel(volume / 100); + _this2.drawRequest(); + }); + + ee.on('mastervolumechange', function (volume) { + _this2.masterGain = volume / 100; + _this2.tracks.forEach(function (track) { + track.setMasterGainLevel(_this2.masterGain); + }); + }); + + ee.on('fadein', function (duration, track) { + track.setFadeIn(duration, _this2.fadeType); + _this2.drawRequest(); + }); + + ee.on('fadeout', function (duration, track) { + track.setFadeOut(duration, _this2.fadeType); + _this2.drawRequest(); + }); + + ee.on('stereopan', function (panvalue, track) { + track.setStereoPanValue(panvalue); + _this2.drawRequest(); + }); + + ee.on('fadetype', function (type) { + _this2.fadeType = type; + }); + + ee.on('newtrack', function (file) { + _this2.load([{ + src: file, + name: file.name + }]); + }); + + ee.on('trim', function () { + var track = _this2.getActiveTrack(); + var timeSelection = _this2.getTimeSelection(); + + track.trim(timeSelection.start, timeSelection.end); + track.calculatePeaks(_this2.samplesPerPixel, _this2.sampleRate); + + _this2.setTimeSelection(0, 0); + _this2.drawRequest(); + }); + + ee.on('zoomin', function () { + var zoomIndex = Math.max(0, _this2.zoomIndex - 1); + var zoom = _this2.zoomLevels[zoomIndex]; + + if (zoom !== _this2.samplesPerPixel) { + _this2.setZoom(zoom); + _this2.drawRequest(); + } + }); + + ee.on('zoomout', function () { + var zoomIndex = Math.min(_this2.zoomLevels.length - 1, _this2.zoomIndex + 1); + var zoom = _this2.zoomLevels[zoomIndex]; + + if (zoom !== _this2.samplesPerPixel) { + _this2.setZoom(zoom); + _this2.drawRequest(); + } + }); + + ee.on('scroll', function () { + _this2.isScrolling = true; + _this2.drawRequest(); + clearTimeout(_this2.scrollTimer); + _this2.scrollTimer = setTimeout(function () { + _this2.isScrolling = false; + }, 200); + }); + } + }, { + key: 'load', + value: function load(trackList) { + var _this3 = this; + + var loadPromises = trackList.map(function (trackInfo) { + var loader = _LoaderFactory2.default.createLoader(trackInfo.src, _this3.ac, _this3.ee); + return loader.load(); + }); + + return Promise.all(loadPromises).then(function (audioBuffers) { + _this3.ee.emit('audiosourcesloaded'); + + var tracks = audioBuffers.map(function (audioBuffer, index) { + var info = trackList[index]; + var name = info.name || 'Untitled'; + var start = info.start || 0; + var states = info.states || {}; + var fadeIn = info.fadeIn; + var fadeOut = info.fadeOut; + var cueIn = info.cuein || 0; + var cueOut = info.cueout || audioBuffer.duration; + var gain = info.gain || 1; + var muted = info.muted || false; + var soloed = info.soloed || false; + var selection = info.selected; + var peaks = info.peaks || { type: 'WebAudio', mono: _this3.mono }; + var customClass = info.customClass || undefined; + var waveOutlineColor = info.waveOutlineColor || undefined; + var stereoPan = info.stereoPan || 0; + + // webaudio specific playout for now. + var playout = new _Playout2.default(_this3.ac, audioBuffer); + + var track = new _Track2.default(); + track.src = info.src; + track.setBuffer(audioBuffer); + track.setName(name); + track.setEventEmitter(_this3.ee); + track.setEnabledStates(states); + track.setCues(cueIn, cueOut); + track.setCustomClass(customClass); + track.setWaveOutlineColor(waveOutlineColor); + + if (fadeIn !== undefined) { + track.setFadeIn(fadeIn.duration, fadeIn.shape); + } + + if (fadeOut !== undefined) { + track.setFadeOut(fadeOut.duration, fadeOut.shape); + } + + if (selection !== undefined) { + _this3.setActiveTrack(track); + _this3.setTimeSelection(selection.start, selection.end); + } + + if (peaks !== undefined) { + track.setPeakData(peaks); + } + + track.setState(_this3.getState()); + track.setStartTime(start); + track.setPlayout(playout); + + track.setGainLevel(gain); + track.setStereoPanValue(stereoPan); + + if (muted) { + _this3.muteTrack(track); + } + + if (soloed) { + _this3.soloTrack(track); + } + + // extract peaks with AudioContext for now. + track.calculatePeaks(_this3.samplesPerPixel, _this3.sampleRate); + + return track; + }); + + _this3.tracks = _this3.tracks.concat(tracks); + _this3.adjustDuration(); + _this3.draw(_this3.render()); + + _this3.ee.emit('audiosourcesrendered'); + }).catch(function (e) { + _this3.ee.emit('audiosourceserror', e); + }); + } + + /* + track instance of Track. + */ + + }, { + key: 'setActiveTrack', + value: function setActiveTrack(track) { + this.activeTrack = track; + } + }, { + key: 'getActiveTrack', + value: function getActiveTrack() { + return this.activeTrack; + } + }, { + key: 'isSegmentSelection', + value: function isSegmentSelection() { + return this.timeSelection.start !== this.timeSelection.end; + } + + /* + start, end in seconds. + */ + + }, { + key: 'setTimeSelection', + value: function setTimeSelection() { + var start = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + var end = arguments[1]; + + this.timeSelection = { + start: start, + end: end === undefined ? start : end + }; + + this.cursor = start; + } + }, { + key: 'startOfflineRender', + value: function startOfflineRender(type) { + var _this4 = this; + + if (this.isRendering) { + return; + } + + this.isRendering = true; + this.offlineAudioContext = new OfflineAudioContext(2, 44100 * this.duration, 44100); + + var currentTime = this.offlineAudioContext.currentTime; + + this.tracks.forEach(function (track) { + track.setOfflinePlayout(new _Playout2.default(_this4.offlineAudioContext, track.buffer)); + track.schedulePlay(currentTime, 0, 0, { + shouldPlay: _this4.shouldTrackPlay(track), + masterGain: 1, + isOffline: true + }); + }); + + /* + TODO cleanup of different audio playouts handling. + */ + this.offlineAudioContext.startRendering().then(function (audioBuffer) { + if (type === 'buffer') { + _this4.ee.emit('audiorenderingfinished', type, audioBuffer); + _this4.isRendering = false; + return; + } + + if (type === 'wav') { + _this4.exportWorker.postMessage({ + command: 'init', + config: { + sampleRate: 44100 + } + }); + + // callback for `exportWAV` + _this4.exportWorker.onmessage = function (e) { + _this4.ee.emit('audiorenderingfinished', type, e.data); + _this4.isRendering = false; + + // clear out the buffer for next renderings. + _this4.exportWorker.postMessage({ + command: 'clear' + }); + }; + + // send the channel data from our buffer to the worker + _this4.exportWorker.postMessage({ + command: 'record', + buffer: [audioBuffer.getChannelData(0), audioBuffer.getChannelData(1)] + }); + + // ask the worker for a WAV + _this4.exportWorker.postMessage({ + command: 'exportWAV', + type: 'audio/wav' + }); + } + }).catch(function (e) { + throw e; + }); + } + }, { + key: 'getTimeSelection', + value: function getTimeSelection() { + return this.timeSelection; + } + }, { + key: 'setState', + value: function setState(state) { + this.state = state; + + this.tracks.forEach(function (track) { + track.setState(state); + }); + } + }, { + key: 'getState', + value: function getState() { + return this.state; + } + }, { + key: 'setZoomIndex', + value: function setZoomIndex(index) { + this.zoomIndex = index; + } + }, { + key: 'setZoomLevels', + value: function setZoomLevels(levels) { + this.zoomLevels = levels; + } + }, { + key: 'setZoom', + value: function setZoom(zoom) { + var _this5 = this; + + this.samplesPerPixel = zoom; + this.zoomIndex = this.zoomLevels.indexOf(zoom); + this.tracks.forEach(function (track) { + track.calculatePeaks(zoom, _this5.sampleRate); + }); + } + }, { + key: 'muteTrack', + value: function muteTrack(track) { + var index = this.mutedTracks.indexOf(track); + + if (index > -1) { + this.mutedTracks.splice(index, 1); + } else { + this.mutedTracks.push(track); + } + } + }, { + key: 'soloTrack', + value: function soloTrack(track) { + var index = this.soloedTracks.indexOf(track); + + if (index > -1) { + this.soloedTracks.splice(index, 1); + } else if (this.exclSolo) { + this.soloedTracks = [track]; + } else { + this.soloedTracks.push(track); + } + } + }, { + key: 'collapseTrack', + value: function collapseTrack(track, opts) { + if (opts.collapsed) { + this.collapsedTracks.push(track); + } else { + var index = this.collapsedTracks.indexOf(track); + + if (index > -1) { + this.collapsedTracks.splice(index, 1); + } + } + } + }, { + key: 'removeTrack', + value: function removeTrack(track) { + if (track.isPlaying()) { + track.scheduleStop(); + } + + var trackLists = [this.mutedTracks, this.soloedTracks, this.collapsedTracks, this.tracks]; + trackLists.forEach(function (list) { + var index = list.indexOf(track); + if (index > -1) { + list.splice(index, 1); + } + }); + } + }, { + key: 'adjustTrackPlayout', + value: function adjustTrackPlayout() { + var _this6 = this; + + this.tracks.forEach(function (track) { + track.setShouldPlay(_this6.shouldTrackPlay(track)); + }); + } + }, { + key: 'adjustDuration', + value: function adjustDuration() { + this.duration = this.tracks.reduce(function (duration, track) { + return Math.max(duration, track.getEndTime()); + }, 0); + } + }, { + key: 'shouldTrackPlay', + value: function shouldTrackPlay(track) { + var shouldPlay = void 0; + // if there are solo tracks, only they should play. + if (this.soloedTracks.length > 0) { + shouldPlay = false; + if (this.soloedTracks.indexOf(track) > -1) { + shouldPlay = true; + } + } else { + // play all tracks except any muted tracks. + shouldPlay = true; + if (this.mutedTracks.indexOf(track) > -1) { + shouldPlay = false; + } + } + + return shouldPlay; + } + }, { + key: 'isPlaying', + value: function isPlaying() { + return this.tracks.reduce(function (isPlaying, track) { + return isPlaying || track.isPlaying(); + }, false); + } + + /* + * returns the current point of time in the playlist in seconds. + */ + + }, { + key: 'getCurrentTime', + value: function getCurrentTime() { + var cursorPos = this.lastSeeked || this.pausedAt || this.cursor; + + return cursorPos + this.getElapsedTime(); + } + }, { + key: 'getElapsedTime', + value: function getElapsedTime() { + return this.ac.currentTime - this.lastPlay; + } + }, { + key: 'setMasterGain', + value: function setMasterGain(gain) { + this.ee.emit('mastervolumechange', gain); + } + }, { + key: 'restartPlayFrom', + value: function restartPlayFrom(start, end) { + this.stopAnimation(); + + this.tracks.forEach(function (editor) { + editor.scheduleStop(); + }); + + return Promise.all(this.playoutPromises).then(this.play.bind(this, start, end)); + } + }, { + key: 'play', + value: function play(startTime, endTime) { + var _this7 = this; + + clearTimeout(this.resetDrawTimer); + + var currentTime = this.ac.currentTime; + var selected = this.getTimeSelection(); + var playoutPromises = []; + + var start = startTime || this.pausedAt || this.cursor; + var end = endTime; + + if (!end && selected.end !== selected.start && selected.end > start) { + end = selected.end; + } + + if (this.isPlaying()) { + return this.restartPlayFrom(start, end); + } + + this.tracks.forEach(function (track) { + track.setState('cursor'); + playoutPromises.push(track.schedulePlay(currentTime, start, end, { + shouldPlay: _this7.shouldTrackPlay(track), + masterGain: _this7.masterGain + })); + }); + + this.lastPlay = currentTime; + // use these to track when the playlist has fully stopped. + this.playoutPromises = playoutPromises; + this.startAnimation(start); + + return Promise.all(this.playoutPromises); + } + }, { + key: 'pause', + value: function pause() { + if (!this.isPlaying()) { + return Promise.all(this.playoutPromises); + } + + this.pausedAt = this.getCurrentTime(); + return this.playbackReset(); + } + }, { + key: 'stop', + value: function stop() { + if (this.mediaRecorder && this.mediaRecorder.state === 'recording') { + this.mediaRecorder.stop(); + } + + this.pausedAt = undefined; + this.playbackSeconds = 0; + return this.playbackReset(); + } + }, { + key: 'playbackReset', + value: function playbackReset() { + var _this8 = this; + + this.lastSeeked = undefined; + this.stopAnimation(); + + this.tracks.forEach(function (track) { + track.scheduleStop(); + track.setState(_this8.getState()); + }); + + this.drawRequest(); + return Promise.all(this.playoutPromises); + } + }, { + key: 'rewind', + value: function rewind() { + var _this9 = this; + + return this.stop().then(function () { + _this9.scrollLeft = 0; + _this9.ee.emit('select', 0, 0); + }); + } + }, { + key: 'fastForward', + value: function fastForward() { + var _this10 = this; + + return this.stop().then(function () { + if (_this10.viewDuration < _this10.duration) { + _this10.scrollLeft = _this10.duration - _this10.viewDuration; + } else { + _this10.scrollLeft = 0; + } + + _this10.ee.emit('select', _this10.duration, _this10.duration); + }); + } + }, { + key: 'clear', + value: function clear() { + var _this11 = this; + + return this.stop().then(function () { + _this11.tracks = []; + _this11.soloedTracks = []; + _this11.mutedTracks = []; + _this11.playoutPromises = []; + + _this11.cursor = 0; + _this11.playbackSeconds = 0; + _this11.duration = 0; + _this11.scrollLeft = 0; + + _this11.seek(0, 0, undefined); + }); + } + }, { + key: 'record', + value: function record() { + var _this12 = this; + + var playoutPromises = []; + this.mediaRecorder.start(300); + + this.tracks.forEach(function (track) { + track.setState('none'); + playoutPromises.push(track.schedulePlay(_this12.ac.currentTime, 0, undefined, { + shouldPlay: _this12.shouldTrackPlay(track) + })); + }); + + this.playoutPromises = playoutPromises; + } + }, { + key: 'startAnimation', + value: function startAnimation(startTime) { + var _this13 = this; + + this.lastDraw = this.ac.currentTime; + this.animationRequest = window.requestAnimationFrame(function () { + _this13.updateEditor(startTime); + }); + } + }, { + key: 'stopAnimation', + value: function stopAnimation() { + window.cancelAnimationFrame(this.animationRequest); + this.lastDraw = undefined; + } + }, { + key: 'seek', + value: function seek(start, end, track) { + if (this.isPlaying()) { + this.lastSeeked = start; + this.pausedAt = undefined; + this.restartPlayFrom(start); + } else { + // reset if it was paused. + this.setActiveTrack(track || this.tracks[0]); + this.pausedAt = start; + this.setTimeSelection(start, end); + if (this.getSeekStyle() === 'fill') { + this.playbackSeconds = start; + } + } + } + + /* + * Animation function for the playlist. + * Keep under 16.7 milliseconds based on a typical screen refresh rate of 60fps. + */ + + }, { + key: 'updateEditor', + value: function updateEditor(cursor) { + var _this14 = this; + + var currentTime = this.ac.currentTime; + var selection = this.getTimeSelection(); + var cursorPos = cursor || this.cursor; + var elapsed = currentTime - this.lastDraw; + + if (this.isPlaying()) { + var playbackSeconds = cursorPos + elapsed; + this.ee.emit('timeupdate', playbackSeconds); + this.animationRequest = window.requestAnimationFrame(function () { + _this14.updateEditor(playbackSeconds); + }); + + this.playbackSeconds = playbackSeconds; + this.draw(this.render()); + this.lastDraw = currentTime; + } else { + if (cursorPos + elapsed >= (this.isSegmentSelection() ? selection.end : this.duration)) { + this.ee.emit('finished'); + } + + this.stopAnimation(); + + this.resetDrawTimer = setTimeout(function () { + _this14.pausedAt = undefined; + _this14.lastSeeked = undefined; + _this14.setState(_this14.getState()); + + _this14.playbackSeconds = 0; + _this14.draw(_this14.render()); + }, 0); + } + } + }, { + key: 'drawRequest', + value: function drawRequest() { + var _this15 = this; + + window.requestAnimationFrame(function () { + _this15.draw(_this15.render()); + }); + } + }, { + key: 'draw', + value: function draw(newTree) { + var patches = (0, _diff2.default)(this.tree, newTree); + this.rootNode = (0, _patch2.default)(this.rootNode, patches); + this.tree = newTree; + + // use for fast forwarding. + this.viewDuration = (0, _conversions.pixelsToSeconds)(this.rootNode.clientWidth - this.controls.width, this.samplesPerPixel, this.sampleRate); + } + }, { + key: 'getTrackRenderData', + value: function getTrackRenderData() { + var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var defaults = { + height: this.waveHeight, + resolution: this.samplesPerPixel, + sampleRate: this.sampleRate, + controls: this.controls, + isActive: false, + timeSelection: this.getTimeSelection(), + playlistLength: this.duration, + playbackSeconds: this.playbackSeconds, + colors: this.colors + }; + + return (0, _lodash2.default)({}, data, defaults); + } + }, { + key: 'isActiveTrack', + value: function isActiveTrack(track) { + var activeTrack = this.getActiveTrack(); + + if (this.isSegmentSelection()) { + return activeTrack === track; + } + + return true; + } + }, { + key: 'renderAnnotations', + value: function renderAnnotations() { + return this.annotationList.render(); + } + }, { + key: 'renderTimeScale', + value: function renderTimeScale() { + var controlWidth = this.controls.show ? this.controls.width : 0; + var timeScale = new _TimeScale2.default(this.duration, this.scrollLeft, this.samplesPerPixel, this.sampleRate, controlWidth, this.colors); + + return timeScale.render(); + } + }, { + key: 'renderTrackSection', + value: function renderTrackSection() { + var _this16 = this; + + var trackElements = this.tracks.map(function (track) { + var collapsed = _this16.collapsedTracks.indexOf(track) > -1; + return track.render(_this16.getTrackRenderData({ + isActive: _this16.isActiveTrack(track), + shouldPlay: _this16.shouldTrackPlay(track), + soloed: _this16.soloedTracks.indexOf(track) > -1, + muted: _this16.mutedTracks.indexOf(track) > -1, + collapsed: collapsed, + height: collapsed ? _this16.collapsedWaveHeight : _this16.waveHeight + })); + }); + + return (0, _h2.default)('div.playlist-tracks', { + attributes: { + style: 'overflow: auto;' + }, + onscroll: function onscroll(e) { + _this16.scrollLeft = (0, _conversions.pixelsToSeconds)(e.target.scrollLeft, _this16.samplesPerPixel, _this16.sampleRate); + + _this16.ee.emit('scroll'); + }, + hook: new _ScrollHook2.default(this) + }, trackElements); + } + }, { + key: 'render', + value: function render() { + var containerChildren = []; + + if (this.showTimescale) { + containerChildren.push(this.renderTimeScale()); + } + + containerChildren.push(this.renderTrackSection()); + + if (this.annotationList.length) { + containerChildren.push(this.renderAnnotations()); + } + + return (0, _h2.default)('div.playlist', { + attributes: { + style: 'overflow: hidden; position: relative;' + } + }, containerChildren); + } + }, { + key: 'getInfo', + value: function getInfo() { + var info = []; + + this.tracks.forEach(function (track) { + info.push(track.getTrackDetails()); + }); + + return info; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + + var h = __webpack_require__(39) + + module.exports = h + + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var isArray = __webpack_require__(40); + + var VNode = __webpack_require__(41); + var VText = __webpack_require__(42); + var isVNode = __webpack_require__(10); + var isVText = __webpack_require__(12); + var isWidget = __webpack_require__(13); + var isHook = __webpack_require__(9); + var isVThunk = __webpack_require__(15); + + var parseTag = __webpack_require__(43); + var softSetHook = __webpack_require__(45); + var evHook = __webpack_require__(46); + + module.exports = h; + + function h(tagName, properties, children) { + var childNodes = []; + var tag, props, key, namespace; + + if (!children && isChildren(properties)) { + children = properties; + props = {}; + } + + props = props || properties || {}; + tag = parseTag(tagName, props); + + // support keys + if (props.hasOwnProperty('key')) { + key = props.key; + props.key = undefined; + } + + // support namespace + if (props.hasOwnProperty('namespace')) { + namespace = props.namespace; + props.namespace = undefined; + } + + // fix cursor bug + if (tag === 'INPUT' && + !namespace && + props.hasOwnProperty('value') && + props.value !== undefined && + !isHook(props.value) + ) { + props.value = softSetHook(props.value); + } + + transformProperties(props); + + if (children !== undefined && children !== null) { + addChild(children, childNodes, tag, props); + } + + + return new VNode(tag, props, childNodes, key, namespace); + } + + function addChild(c, childNodes, tag, props) { + if (typeof c === 'string') { + childNodes.push(new VText(c)); + } else if (typeof c === 'number') { + childNodes.push(new VText(String(c))); + } else if (isChild(c)) { + childNodes.push(c); + } else if (isArray(c)) { + for (var i = 0; i < c.length; i++) { + addChild(c[i], childNodes, tag, props); + } + } else if (c === null || c === undefined) { + return; + } else { + throw UnexpectedVirtualElement({ + foreignObject: c, + parentVnode: { + tagName: tag, + properties: props + } + }); + } + } + + function transformProperties(props) { + for (var propName in props) { + if (props.hasOwnProperty(propName)) { + var value = props[propName]; + + if (isHook(value)) { + continue; + } + + if (propName.substr(0, 3) === 'ev-') { + // add ev-foo support + props[propName] = evHook(value); + } + } + } + } + + function isChild(x) { + return isVNode(x) || isVText(x) || isWidget(x) || isVThunk(x); + } + + function isChildren(x) { + return typeof x === 'string' || isArray(x) || isChild(x); + } + + function UnexpectedVirtualElement(data) { + var err = new Error(); + + err.type = 'virtual-hyperscript.unexpected.virtual-element'; + err.message = 'Unexpected virtual child passed to h().\n' + + 'Expected a VNode / Vthunk / VWidget / string but:\n' + + 'got:\n' + + errorString(data.foreignObject) + + '.\n' + + 'The parent vnode is:\n' + + errorString(data.parentVnode) + '\n' + + 'Suggested fix: change your `h(..., [ ... ])` callsite.'; + err.foreignObject = data.foreignObject; + err.parentVnode = data.parentVnode; + + return err; + } + + function errorString(obj) { + try { + return JSON.stringify(obj, null, ' '); + } catch (e) { + return String(obj); + } + } + + +/***/ }), +/* 40 */ +/***/ (function(module, exports) { + + var nativeIsArray = Array.isArray + var toString = Object.prototype.toString + + module.exports = nativeIsArray || isArray + + function isArray(obj) { + return toString.call(obj) === "[object Array]" + } + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + + var version = __webpack_require__(11) + var isVNode = __webpack_require__(10) + var isWidget = __webpack_require__(13) + var isThunk = __webpack_require__(15) + var isVHook = __webpack_require__(9) + + module.exports = VirtualNode + + var noProperties = {} + var noChildren = [] + + function VirtualNode(tagName, properties, children, key, namespace) { + this.tagName = tagName + this.properties = properties || noProperties + this.children = children || noChildren + this.key = key != null ? String(key) : undefined + this.namespace = (typeof namespace === "string") ? namespace : null + + var count = (children && children.length) || 0 + var descendants = 0 + var hasWidgets = false + var hasThunks = false + var descendantHooks = false + var hooks + + for (var propName in properties) { + if (properties.hasOwnProperty(propName)) { + var property = properties[propName] + if (isVHook(property) && property.unhook) { + if (!hooks) { + hooks = {} + } + + hooks[propName] = property + } + } + } + + for (var i = 0; i < count; i++) { + var child = children[i] + if (isVNode(child)) { + descendants += child.count || 0 + + if (!hasWidgets && child.hasWidgets) { + hasWidgets = true + } + + if (!hasThunks && child.hasThunks) { + hasThunks = true + } + + if (!descendantHooks && (child.hooks || child.descendantHooks)) { + descendantHooks = true + } + } else if (!hasWidgets && isWidget(child)) { + if (typeof child.destroy === "function") { + hasWidgets = true + } + } else if (!hasThunks && isThunk(child)) { + hasThunks = true; + } + } + + this.count = count + descendants + this.hasWidgets = hasWidgets + this.hasThunks = hasThunks + this.hooks = hooks + this.descendantHooks = descendantHooks + } + + VirtualNode.prototype.version = version + VirtualNode.prototype.type = "VirtualNode" + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + + var version = __webpack_require__(11) + + module.exports = VirtualText + + function VirtualText(text) { + this.text = String(text) + } + + VirtualText.prototype.version = version + VirtualText.prototype.type = "VirtualText" + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var split = __webpack_require__(44); + + var classIdSplit = /([\.#]?[a-zA-Z0-9\u007F-\uFFFF_:-]+)/; + var notClassId = /^\.|#/; + + module.exports = parseTag; + + function parseTag(tag, props) { + if (!tag) { + return 'DIV'; + } + + var noId = !(props.hasOwnProperty('id')); + + var tagParts = split(tag, classIdSplit); + var tagName = null; + + if (notClassId.test(tagParts[1])) { + tagName = 'DIV'; + } + + var classes, part, type, i; + + for (i = 0; i < tagParts.length; i++) { + part = tagParts[i]; + + if (!part) { + continue; + } + + type = part.charAt(0); + + if (!tagName) { + tagName = part; + } else if (type === '.') { + classes = classes || []; + classes.push(part.substring(1, part.length)); + } else if (type === '#' && noId) { + props.id = part.substring(1, part.length); + } + } + + if (classes) { + if (props.className) { + classes.push(props.className); + } + + props.className = classes.join(' '); + } + + return props.namespace ? tagName : tagName.toUpperCase(); + } + + +/***/ }), +/* 44 */ +/***/ (function(module, exports) { + + /*! + * Cross-Browser Split 1.1.1 + * Copyright 2007-2012 Steven Levithan + * Available under the MIT License + * ECMAScript compliant, uniform cross-browser split method + */ + + /** + * Splits a string into an array of strings using a regex or string separator. Matches of the + * separator are not included in the result array. However, if `separator` is a regex that contains + * capturing groups, backreferences are spliced into the result each time `separator` is matched. + * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably + * cross-browser. + * @param {String} str String to split. + * @param {RegExp|String} separator Regex or string to use for separating the string. + * @param {Number} [limit] Maximum number of items to include in the result array. + * @returns {Array} Array of substrings. + * @example + * + * // Basic use + * split('a b c d', ' '); + * // -> ['a', 'b', 'c', 'd'] + * + * // With limit + * split('a b c d', ' ', 2); + * // -> ['a', 'b'] + * + * // Backreferences in result array + * split('..word1 word2..', /([a-z]+)(\d+)/i); + * // -> ['..', 'word', '1', ' ', 'word', '2', '..'] + */ + module.exports = (function split(undef) { + + var nativeSplit = String.prototype.split, + compliantExecNpcg = /()??/.exec("")[1] === undef, + // NPCG: nonparticipating capturing group + self; + + self = function(str, separator, limit) { + // If `separator` is not a regex, use `nativeSplit` + if (Object.prototype.toString.call(separator) !== "[object RegExp]") { + return nativeSplit.call(str, separator, limit); + } + var output = [], + flags = (separator.ignoreCase ? "i" : "") + (separator.multiline ? "m" : "") + (separator.extended ? "x" : "") + // Proposed for ES6 + (separator.sticky ? "y" : ""), + // Firefox 3+ + lastLastIndex = 0, + // Make `global` and avoid `lastIndex` issues by working with a copy + separator = new RegExp(separator.source, flags + "g"), + separator2, match, lastIndex, lastLength; + str += ""; // Type-convert + if (!compliantExecNpcg) { + // Doesn't need flags gy, but they don't hurt + separator2 = new RegExp("^" + separator.source + "$(?!\\s)", flags); + } + /* Values for `limit`, per the spec: + * If undefined: 4294967295 // Math.pow(2, 32) - 1 + * If 0, Infinity, or NaN: 0 + * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296; + * If negative number: 4294967296 - Math.floor(Math.abs(limit)) + * If other: Type-convert, then use the above rules + */ + limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1 + limit >>> 0; // ToUint32(limit) + while (match = separator.exec(str)) { + // `separator.lastIndex` is not reliable cross-browser + lastIndex = match.index + match[0].length; + if (lastIndex > lastLastIndex) { + output.push(str.slice(lastLastIndex, match.index)); + // Fix browsers whose `exec` methods don't consistently return `undefined` for + // nonparticipating capturing groups + if (!compliantExecNpcg && match.length > 1) { + match[0].replace(separator2, function() { + for (var i = 1; i < arguments.length - 2; i++) { + if (arguments[i] === undef) { + match[i] = undef; + } + } + }); + } + if (match.length > 1 && match.index < str.length) { + Array.prototype.push.apply(output, match.slice(1)); + } + lastLength = match[0].length; + lastLastIndex = lastIndex; + if (output.length >= limit) { + break; + } + } + if (separator.lastIndex === match.index) { + separator.lastIndex++; // Avoid an infinite loop + } + } + if (lastLastIndex === str.length) { + if (lastLength || !separator.test("")) { + output.push(""); + } + } else { + output.push(str.slice(lastLastIndex)); + } + return output.length > limit ? output.slice(0, limit) : output; + }; + + return self; + })(); + + +/***/ }), +/* 45 */ +/***/ (function(module, exports) { + + 'use strict'; + + module.exports = SoftSetHook; + + function SoftSetHook(value) { + if (!(this instanceof SoftSetHook)) { + return new SoftSetHook(value); + } + + this.value = value; + } + + SoftSetHook.prototype.hook = function (node, propertyName) { + if (node[propertyName] !== this.value) { + node[propertyName] = this.value; + } + }; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var EvStore = __webpack_require__(47); + + module.exports = EvHook; + + function EvHook(value) { + if (!(this instanceof EvHook)) { + return new EvHook(value); + } + + this.value = value; + } + + EvHook.prototype.hook = function (node, propertyName) { + var es = EvStore(node); + var propName = propertyName.substr(3); + + es[propName] = this.value; + }; + + EvHook.prototype.unhook = function(node, propertyName) { + var es = EvStore(node); + var propName = propertyName.substr(3); + + es[propName] = undefined; + }; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var OneVersionConstraint = __webpack_require__(48); + + var MY_VERSION = '7'; + OneVersionConstraint('ev-store', MY_VERSION); + + var hashKey = '__EV_STORE_KEY@' + MY_VERSION; + + module.exports = EvStore; + + function EvStore(elem) { + var hash = elem[hashKey]; + + if (!hash) { + hash = elem[hashKey] = {}; + } + + return hash; + } + + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + var Individual = __webpack_require__(49); + + module.exports = OneVersion; + + function OneVersion(moduleName, version, defaultValue) { + var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName; + var enforceKey = key + '_ENFORCE_SINGLETON'; + + var versionValue = Individual(enforceKey, version); + + if (versionValue !== version) { + throw new Error('Can only have one copy of ' + + moduleName + '.\n' + + 'You already have version ' + versionValue + + ' installed.\n' + + 'This means you cannot install version ' + version); + } + + return Individual(key, defaultValue); + } + + +/***/ }), +/* 49 */ +/***/ (function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {'use strict'; + + /*global window, global*/ + + var root = typeof window !== 'undefined' ? + window : typeof global !== 'undefined' ? + global : {}; + + module.exports = Individual; + + function Individual(key, value) { + if (key in root) { + return root[key]; + } + + root[key] = value; + + return value; + } + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + + var diff = __webpack_require__(51) + + module.exports = diff + + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + + var isArray = __webpack_require__(40) + + var VPatch = __webpack_require__(52) + var isVNode = __webpack_require__(10) + var isVText = __webpack_require__(12) + var isWidget = __webpack_require__(13) + var isThunk = __webpack_require__(15) + var handleThunk = __webpack_require__(14) + + var diffProps = __webpack_require__(53) + + module.exports = diff + + function diff(a, b) { + var patch = { a: a } + walk(a, b, patch, 0) + return patch + } + + function walk(a, b, patch, index) { + if (a === b) { + return + } + + var apply = patch[index] + var applyClear = false + + if (isThunk(a) || isThunk(b)) { + thunks(a, b, patch, index) + } else if (b == null) { + + // If a is a widget we will add a remove patch for it + // Otherwise any child widgets/hooks must be destroyed. + // This prevents adding two remove patches for a widget. + if (!isWidget(a)) { + clearState(a, patch, index) + apply = patch[index] + } + + apply = appendPatch(apply, new VPatch(VPatch.REMOVE, a, b)) + } else if (isVNode(b)) { + if (isVNode(a)) { + if (a.tagName === b.tagName && + a.namespace === b.namespace && + a.key === b.key) { + var propsPatch = diffProps(a.properties, b.properties) + if (propsPatch) { + apply = appendPatch(apply, + new VPatch(VPatch.PROPS, a, propsPatch)) + } + apply = diffChildren(a, b, patch, apply, index) + } else { + apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b)) + applyClear = true + } + } else { + apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b)) + applyClear = true + } + } else if (isVText(b)) { + if (!isVText(a)) { + apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b)) + applyClear = true + } else if (a.text !== b.text) { + apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b)) + } + } else if (isWidget(b)) { + if (!isWidget(a)) { + applyClear = true + } + + apply = appendPatch(apply, new VPatch(VPatch.WIDGET, a, b)) + } + + if (apply) { + patch[index] = apply + } + + if (applyClear) { + clearState(a, patch, index) + } + } + + function diffChildren(a, b, patch, apply, index) { + var aChildren = a.children + var orderedSet = reorder(aChildren, b.children) + var bChildren = orderedSet.children + + var aLen = aChildren.length + var bLen = bChildren.length + var len = aLen > bLen ? aLen : bLen + + for (var i = 0; i < len; i++) { + var leftNode = aChildren[i] + var rightNode = bChildren[i] + index += 1 + + if (!leftNode) { + if (rightNode) { + // Excess nodes in b need to be added + apply = appendPatch(apply, + new VPatch(VPatch.INSERT, null, rightNode)) + } + } else { + walk(leftNode, rightNode, patch, index) + } + + if (isVNode(leftNode) && leftNode.count) { + index += leftNode.count + } + } + + if (orderedSet.moves) { + // Reorder nodes last + apply = appendPatch(apply, new VPatch( + VPatch.ORDER, + a, + orderedSet.moves + )) + } + + return apply + } + + function clearState(vNode, patch, index) { + // TODO: Make this a single walk, not two + unhook(vNode, patch, index) + destroyWidgets(vNode, patch, index) + } + + // Patch records for all destroyed widgets must be added because we need + // a DOM node reference for the destroy function + function destroyWidgets(vNode, patch, index) { + if (isWidget(vNode)) { + if (typeof vNode.destroy === "function") { + patch[index] = appendPatch( + patch[index], + new VPatch(VPatch.REMOVE, vNode, null) + ) + } + } else if (isVNode(vNode) && (vNode.hasWidgets || vNode.hasThunks)) { + var children = vNode.children + var len = children.length + for (var i = 0; i < len; i++) { + var child = children[i] + index += 1 + + destroyWidgets(child, patch, index) + + if (isVNode(child) && child.count) { + index += child.count + } + } + } else if (isThunk(vNode)) { + thunks(vNode, null, patch, index) + } + } + + // Create a sub-patch for thunks + function thunks(a, b, patch, index) { + var nodes = handleThunk(a, b) + var thunkPatch = diff(nodes.a, nodes.b) + if (hasPatches(thunkPatch)) { + patch[index] = new VPatch(VPatch.THUNK, null, thunkPatch) + } + } + + function hasPatches(patch) { + for (var index in patch) { + if (index !== "a") { + return true + } + } + + return false + } + + // Execute hooks when two nodes are identical + function unhook(vNode, patch, index) { + if (isVNode(vNode)) { + if (vNode.hooks) { + patch[index] = appendPatch( + patch[index], + new VPatch( + VPatch.PROPS, + vNode, + undefinedKeys(vNode.hooks) + ) + ) + } + + if (vNode.descendantHooks || vNode.hasThunks) { + var children = vNode.children + var len = children.length + for (var i = 0; i < len; i++) { + var child = children[i] + index += 1 + + unhook(child, patch, index) + + if (isVNode(child) && child.count) { + index += child.count + } + } + } + } else if (isThunk(vNode)) { + thunks(vNode, null, patch, index) + } + } + + function undefinedKeys(obj) { + var result = {} + + for (var key in obj) { + result[key] = undefined + } + + return result + } + + // List diff, naive left to right reordering + function reorder(aChildren, bChildren) { + // O(M) time, O(M) memory + var bChildIndex = keyIndex(bChildren) + var bKeys = bChildIndex.keys + var bFree = bChildIndex.free + + if (bFree.length === bChildren.length) { + return { + children: bChildren, + moves: null + } + } + + // O(N) time, O(N) memory + var aChildIndex = keyIndex(aChildren) + var aKeys = aChildIndex.keys + var aFree = aChildIndex.free + + if (aFree.length === aChildren.length) { + return { + children: bChildren, + moves: null + } + } + + // O(MAX(N, M)) memory + var newChildren = [] + + var freeIndex = 0 + var freeCount = bFree.length + var deletedItems = 0 + + // Iterate through a and match a node in b + // O(N) time, + for (var i = 0 ; i < aChildren.length; i++) { + var aItem = aChildren[i] + var itemIndex + + if (aItem.key) { + if (bKeys.hasOwnProperty(aItem.key)) { + // Match up the old keys + itemIndex = bKeys[aItem.key] + newChildren.push(bChildren[itemIndex]) + + } else { + // Remove old keyed items + itemIndex = i - deletedItems++ + newChildren.push(null) + } + } else { + // Match the item in a with the next free item in b + if (freeIndex < freeCount) { + itemIndex = bFree[freeIndex++] + newChildren.push(bChildren[itemIndex]) + } else { + // There are no free items in b to match with + // the free items in a, so the extra free nodes + // are deleted. + itemIndex = i - deletedItems++ + newChildren.push(null) + } + } + } + + var lastFreeIndex = freeIndex >= bFree.length ? + bChildren.length : + bFree[freeIndex] + + // Iterate through b and append any new keys + // O(M) time + for (var j = 0; j < bChildren.length; j++) { + var newItem = bChildren[j] + + if (newItem.key) { + if (!aKeys.hasOwnProperty(newItem.key)) { + // Add any new keyed items + // We are adding new items to the end and then sorting them + // in place. In future we should insert new items in place. + newChildren.push(newItem) + } + } else if (j >= lastFreeIndex) { + // Add any leftover non-keyed items + newChildren.push(newItem) + } + } + + var simulate = newChildren.slice() + var simulateIndex = 0 + var removes = [] + var inserts = [] + var simulateItem + + for (var k = 0; k < bChildren.length;) { + var wantedItem = bChildren[k] + simulateItem = simulate[simulateIndex] + + // remove items + while (simulateItem === null && simulate.length) { + removes.push(remove(simulate, simulateIndex, null)) + simulateItem = simulate[simulateIndex] + } + + if (!simulateItem || simulateItem.key !== wantedItem.key) { + // if we need a key in this position... + if (wantedItem.key) { + if (simulateItem && simulateItem.key) { + // if an insert doesn't put this key in place, it needs to move + if (bKeys[simulateItem.key] !== k + 1) { + removes.push(remove(simulate, simulateIndex, simulateItem.key)) + simulateItem = simulate[simulateIndex] + // if the remove didn't put the wanted item in place, we need to insert it + if (!simulateItem || simulateItem.key !== wantedItem.key) { + inserts.push({key: wantedItem.key, to: k}) + } + // items are matching, so skip ahead + else { + simulateIndex++ + } + } + else { + inserts.push({key: wantedItem.key, to: k}) + } + } + else { + inserts.push({key: wantedItem.key, to: k}) + } + k++ + } + // a key in simulate has no matching wanted key, remove it + else if (simulateItem && simulateItem.key) { + removes.push(remove(simulate, simulateIndex, simulateItem.key)) + } + } + else { + simulateIndex++ + k++ + } + } + + // remove all the remaining nodes from simulate + while(simulateIndex < simulate.length) { + simulateItem = simulate[simulateIndex] + removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key)) + } + + // If the only moves we have are deletes then we can just + // let the delete patch remove these items. + if (removes.length === deletedItems && !inserts.length) { + return { + children: newChildren, + moves: null + } + } + + return { + children: newChildren, + moves: { + removes: removes, + inserts: inserts + } + } + } + + function remove(arr, index, key) { + arr.splice(index, 1) + + return { + from: index, + key: key + } + } + + function keyIndex(children) { + var keys = {} + var free = [] + var length = children.length + + for (var i = 0; i < length; i++) { + var child = children[i] + + if (child.key) { + keys[child.key] = i + } else { + free.push(i) + } + } + + return { + keys: keys, // A hash of key name to index + free: free // An array of unkeyed item indices + } + } + + function appendPatch(apply, patch) { + if (apply) { + if (isArray(apply)) { + apply.push(patch) + } else { + apply = [apply, patch] + } + + return apply + } else { + return patch + } + } + + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + + var version = __webpack_require__(11) + + VirtualPatch.NONE = 0 + VirtualPatch.VTEXT = 1 + VirtualPatch.VNODE = 2 + VirtualPatch.WIDGET = 3 + VirtualPatch.PROPS = 4 + VirtualPatch.ORDER = 5 + VirtualPatch.INSERT = 6 + VirtualPatch.REMOVE = 7 + VirtualPatch.THUNK = 8 + + module.exports = VirtualPatch + + function VirtualPatch(type, vNode, patch) { + this.type = Number(type) + this.vNode = vNode + this.patch = patch + } + + VirtualPatch.prototype.version = version + VirtualPatch.prototype.type = "VirtualPatch" + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + + var isObject = __webpack_require__(8) + var isHook = __webpack_require__(9) + + module.exports = diffProps + + function diffProps(a, b) { + var diff + + for (var aKey in a) { + if (!(aKey in b)) { + diff = diff || {} + diff[aKey] = undefined + } + + var aValue = a[aKey] + var bValue = b[aKey] + + if (aValue === bValue) { + continue + } else if (isObject(aValue) && isObject(bValue)) { + if (getPrototype(bValue) !== getPrototype(aValue)) { + diff = diff || {} + diff[aKey] = bValue + } else if (isHook(bValue)) { + diff = diff || {} + diff[aKey] = bValue + } else { + var objectDiff = diffProps(aValue, bValue) + if (objectDiff) { + diff = diff || {} + diff[aKey] = objectDiff + } + } + } else { + diff = diff || {} + diff[aKey] = bValue + } + } + + for (var bKey in b) { + if (!(bKey in a)) { + diff = diff || {} + diff[bKey] = b[bKey] + } + } + + return diff + } + + function getPrototype(value) { + if (Object.getPrototypeOf) { + return Object.getPrototypeOf(value) + } else if (value.__proto__) { + return value.__proto__ + } else if (value.constructor) { + return value.constructor.prototype + } + } + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + + var patch = __webpack_require__(55) + + module.exports = patch + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + + var document = __webpack_require__(5) + var isArray = __webpack_require__(40) + + var render = __webpack_require__(4) + var domIndex = __webpack_require__(56) + var patchOp = __webpack_require__(57) + module.exports = patch + + function patch(rootNode, patches, renderOptions) { + renderOptions = renderOptions || {} + renderOptions.patch = renderOptions.patch && renderOptions.patch !== patch + ? renderOptions.patch + : patchRecursive + renderOptions.render = renderOptions.render || render + + return renderOptions.patch(rootNode, patches, renderOptions) + } + + function patchRecursive(rootNode, patches, renderOptions) { + var indices = patchIndices(patches) + + if (indices.length === 0) { + return rootNode + } + + var index = domIndex(rootNode, patches.a, indices) + var ownerDocument = rootNode.ownerDocument + + if (!renderOptions.document && ownerDocument !== document) { + renderOptions.document = ownerDocument + } + + for (var i = 0; i < indices.length; i++) { + var nodeIndex = indices[i] + rootNode = applyPatch(rootNode, + index[nodeIndex], + patches[nodeIndex], + renderOptions) + } + + return rootNode + } + + function applyPatch(rootNode, domNode, patchList, renderOptions) { + if (!domNode) { + return rootNode + } + + var newNode + + if (isArray(patchList)) { + for (var i = 0; i < patchList.length; i++) { + newNode = patchOp(patchList[i], domNode, renderOptions) + + if (domNode === rootNode) { + rootNode = newNode + } + } + } else { + newNode = patchOp(patchList, domNode, renderOptions) + + if (domNode === rootNode) { + rootNode = newNode + } + } + + return rootNode + } + + function patchIndices(patches) { + var indices = [] + + for (var key in patches) { + if (key !== "a") { + indices.push(Number(key)) + } + } + + return indices + } + + +/***/ }), +/* 56 */ +/***/ (function(module, exports) { + + // Maps a virtual DOM tree onto a real DOM tree in an efficient manner. + // We don't want to read all of the DOM nodes in the tree so we use + // the in-order tree indexing to eliminate recursion down certain branches. + // We only recurse into a DOM node if we know that it contains a child of + // interest. + + var noChild = {} + + module.exports = domIndex + + function domIndex(rootNode, tree, indices, nodes) { + if (!indices || indices.length === 0) { + return {} + } else { + indices.sort(ascending) + return recurse(rootNode, tree, indices, nodes, 0) + } + } + + function recurse(rootNode, tree, indices, nodes, rootIndex) { + nodes = nodes || {} + + + if (rootNode) { + if (indexInRange(indices, rootIndex, rootIndex)) { + nodes[rootIndex] = rootNode + } + + var vChildren = tree.children + + if (vChildren) { + + var childNodes = rootNode.childNodes + + for (var i = 0; i < tree.children.length; i++) { + rootIndex += 1 + + var vChild = vChildren[i] || noChild + var nextIndex = rootIndex + (vChild.count || 0) + + // skip recursion down the tree if there are no nodes down here + if (indexInRange(indices, rootIndex, nextIndex)) { + recurse(childNodes[i], vChild, indices, nodes, rootIndex) + } + + rootIndex = nextIndex + } + } + } + + return nodes + } + + // Binary search for an index in the interval [left, right] + function indexInRange(indices, left, right) { + if (indices.length === 0) { + return false + } + + var minIndex = 0 + var maxIndex = indices.length - 1 + var currentIndex + var currentItem + + while (minIndex <= maxIndex) { + currentIndex = ((maxIndex + minIndex) / 2) >> 0 + currentItem = indices[currentIndex] + + if (minIndex === maxIndex) { + return currentItem >= left && currentItem <= right + } else if (currentItem < left) { + minIndex = currentIndex + 1 + } else if (currentItem > right) { + maxIndex = currentIndex - 1 + } else { + return true + } + } + + return false; + } + + function ascending(a, b) { + return a > b ? 1 : -1 + } + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + + var applyProperties = __webpack_require__(7) + + var isWidget = __webpack_require__(13) + var VPatch = __webpack_require__(52) + + var updateWidget = __webpack_require__(58) + + module.exports = applyPatch + + function applyPatch(vpatch, domNode, renderOptions) { + var type = vpatch.type + var vNode = vpatch.vNode + var patch = vpatch.patch + + switch (type) { + case VPatch.REMOVE: + return removeNode(domNode, vNode) + case VPatch.INSERT: + return insertNode(domNode, patch, renderOptions) + case VPatch.VTEXT: + return stringPatch(domNode, vNode, patch, renderOptions) + case VPatch.WIDGET: + return widgetPatch(domNode, vNode, patch, renderOptions) + case VPatch.VNODE: + return vNodePatch(domNode, vNode, patch, renderOptions) + case VPatch.ORDER: + reorderChildren(domNode, patch) + return domNode + case VPatch.PROPS: + applyProperties(domNode, patch, vNode.properties) + return domNode + case VPatch.THUNK: + return replaceRoot(domNode, + renderOptions.patch(domNode, patch, renderOptions)) + default: + return domNode + } + } + + function removeNode(domNode, vNode) { + var parentNode = domNode.parentNode + + if (parentNode) { + parentNode.removeChild(domNode) + } + + destroyWidget(domNode, vNode); + + return null + } + + function insertNode(parentNode, vNode, renderOptions) { + var newNode = renderOptions.render(vNode, renderOptions) + + if (parentNode) { + parentNode.appendChild(newNode) + } + + return parentNode + } + + function stringPatch(domNode, leftVNode, vText, renderOptions) { + var newNode + + if (domNode.nodeType === 3) { + domNode.replaceData(0, domNode.length, vText.text) + newNode = domNode + } else { + var parentNode = domNode.parentNode + newNode = renderOptions.render(vText, renderOptions) + + if (parentNode && newNode !== domNode) { + parentNode.replaceChild(newNode, domNode) + } + } + + return newNode + } + + function widgetPatch(domNode, leftVNode, widget, renderOptions) { + var updating = updateWidget(leftVNode, widget) + var newNode + + if (updating) { + newNode = widget.update(leftVNode, domNode) || domNode + } else { + newNode = renderOptions.render(widget, renderOptions) + } + + var parentNode = domNode.parentNode + + if (parentNode && newNode !== domNode) { + parentNode.replaceChild(newNode, domNode) + } + + if (!updating) { + destroyWidget(domNode, leftVNode) + } + + return newNode + } + + function vNodePatch(domNode, leftVNode, vNode, renderOptions) { + var parentNode = domNode.parentNode + var newNode = renderOptions.render(vNode, renderOptions) + + if (parentNode && newNode !== domNode) { + parentNode.replaceChild(newNode, domNode) + } + + return newNode + } + + function destroyWidget(domNode, w) { + if (typeof w.destroy === "function" && isWidget(w)) { + w.destroy(domNode) + } + } + + function reorderChildren(domNode, moves) { + var childNodes = domNode.childNodes + var keyMap = {} + var node + var remove + var insert + + for (var i = 0; i < moves.removes.length; i++) { + remove = moves.removes[i] + node = childNodes[remove.from] + if (remove.key) { + keyMap[remove.key] = node + } + domNode.removeChild(node) + } + + var length = childNodes.length + for (var j = 0; j < moves.inserts.length; j++) { + insert = moves.inserts[j] + node = keyMap[insert.key] + // this is the weirdest bug i've ever seen in webkit + domNode.insertBefore(node, insert.to >= length++ ? null : childNodes[insert.to]) + } + } + + function replaceRoot(oldRoot, newRoot) { + if (oldRoot && newRoot && oldRoot !== newRoot && oldRoot.parentNode) { + oldRoot.parentNode.replaceChild(newRoot, oldRoot) + } + + return newRoot; + } + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + + var isWidget = __webpack_require__(13) + + module.exports = updateWidget + + function updateWidget(a, b) { + if (isWidget(a) && isWidget(b)) { + if ("name" in a && "name" in b) { + return a.id === b.id + } else { + return a.init === b.init + } + } + + return false + } + + +/***/ }), +/* 59 */ +/***/ (function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) {var WORKER_ENABLED = !!(global === global.window && global.URL && global.Blob && global.Worker); + + function InlineWorker(func, self) { + var _this = this; + var functionBody; + + self = self || {}; + + if (WORKER_ENABLED) { + functionBody = func.toString().trim().match( + /^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/ + )[1]; + + return new global.Worker(global.URL.createObjectURL( + new global.Blob([ functionBody ], { type: "text/javascript" }) + )); + } + + function postMessage(data) { + setTimeout(function() { + _this.onmessage({ data: data }); + }, 0); + } + + this.self = self; + this.self.postMessage = postMessage; + + setTimeout(func.bind(self, self), 0); + } + + InlineWorker.prototype.postMessage = function postMessage(data) { + var _this = this; + + setTimeout(function() { + _this.self.onmessage({ data: data }); + }, 0); + }; + + module.exports = InlineWorker; + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }), +/* 60 */ +/***/ (function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.samplesToSeconds = samplesToSeconds; + exports.secondsToSamples = secondsToSamples; + exports.samplesToPixels = samplesToPixels; + exports.pixelsToSamples = pixelsToSamples; + exports.pixelsToSeconds = pixelsToSeconds; + exports.secondsToPixels = secondsToPixels; + function samplesToSeconds(samples, sampleRate) { + return samples / sampleRate; + } + + function secondsToSamples(seconds, sampleRate) { + return Math.ceil(seconds * sampleRate); + } + + function samplesToPixels(samples, resolution) { + return Math.floor(samples / resolution); + } + + function pixelsToSamples(pixels, resolution) { + return Math.floor(pixels * resolution); + } + + function pixelsToSeconds(pixels, resolution, sampleRate) { + return pixels * resolution / sampleRate; + } + + function secondsToPixels(seconds, resolution, sampleRate) { + return Math.ceil(seconds * sampleRate / resolution); + } + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _BlobLoader = __webpack_require__(62); + + var _BlobLoader2 = _interopRequireDefault(_BlobLoader); + + var _IdentityLoader = __webpack_require__(64); + + var _IdentityLoader2 = _interopRequireDefault(_IdentityLoader); + + var _XHRLoader = __webpack_require__(65); + + var _XHRLoader2 = _interopRequireDefault(_XHRLoader); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class() { + _classCallCheck(this, _class); + } + + _createClass(_class, null, [{ + key: 'createLoader', + value: function createLoader(src, audioContext, ee) { + if (src instanceof Blob) { + return new _BlobLoader2.default(src, audioContext, ee); + } else if (src instanceof AudioBuffer) { + return new _IdentityLoader2.default(src, audioContext, ee); + } else if (typeof src === 'string') { + return new _XHRLoader2.default(src, audioContext, ee); + } + + throw new Error('Unsupported src type'); + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _Loader2 = __webpack_require__(63); + + var _Loader3 = _interopRequireDefault(_Loader2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var _class = function (_Loader) { + _inherits(_class, _Loader); + + function _class() { + _classCallCheck(this, _class); + + return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); + } + + _createClass(_class, [{ + key: 'load', + + + /* + * Loads an audio file via a FileReader + */ + value: function load() { + var _this2 = this; + + return new Promise(function (resolve, reject) { + if (_this2.src.type.match(/audio.*/) || + // added for problems with Firefox mime types + ogg. + _this2.src.type.match(/video\/ogg/)) { + var fr = new FileReader(); + + fr.readAsArrayBuffer(_this2.src); + + fr.addEventListener('progress', function (e) { + _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'fileProgress', _this2).call(_this2, e); + }); + + fr.addEventListener('load', function (e) { + var decoderPromise = _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'fileLoad', _this2).call(_this2, e); + + decoderPromise.then(function (audioBuffer) { + resolve(audioBuffer); + }).catch(reject); + }); + + fr.addEventListener('error', reject); + } else { + reject(Error('Unsupported file type ' + _this2.src.type)); + } + }); + } + }]); + + return _class; + }(_Loader3.default); + + exports.default = _class; + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.STATE_FINISHED = exports.STATE_DECODING = exports.STATE_LOADING = exports.STATE_UNINITIALIZED = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _eventEmitter = __webpack_require__(16); + + var _eventEmitter2 = _interopRequireDefault(_eventEmitter); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var STATE_UNINITIALIZED = exports.STATE_UNINITIALIZED = 0; + var STATE_LOADING = exports.STATE_LOADING = 1; + var STATE_DECODING = exports.STATE_DECODING = 2; + var STATE_FINISHED = exports.STATE_FINISHED = 3; + + var _class = function () { + function _class(src, audioContext) { + var ee = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : (0, _eventEmitter2.default)(); + + _classCallCheck(this, _class); + + this.src = src; + this.ac = audioContext; + this.audioRequestState = STATE_UNINITIALIZED; + this.ee = ee; + } + + _createClass(_class, [{ + key: 'setStateChange', + value: function setStateChange(state) { + this.audioRequestState = state; + this.ee.emit('audiorequeststatechange', this.audioRequestState, this.src); + } + }, { + key: 'fileProgress', + value: function fileProgress(e) { + var percentComplete = 0; + + if (this.audioRequestState === STATE_UNINITIALIZED) { + this.setStateChange(STATE_LOADING); + } + + if (e.lengthComputable) { + percentComplete = e.loaded / e.total * 100; + } + + this.ee.emit('loadprogress', percentComplete, this.src); + } + }, { + key: 'fileLoad', + value: function fileLoad(e) { + var _this = this; + + var audioData = e.target.response || e.target.result; + + this.setStateChange(STATE_DECODING); + + return new Promise(function (resolve, reject) { + _this.ac.decodeAudioData(audioData, function (audioBuffer) { + _this.audioBuffer = audioBuffer; + _this.setStateChange(STATE_FINISHED); + + resolve(audioBuffer); + }, function (err) { + if (err === null) { + // Safari issues with null error + reject(Error('MediaDecodeAudioDataUnknownContentType')); + } else { + reject(err); + } + }); + }); + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _Loader2 = __webpack_require__(63); + + var _Loader3 = _interopRequireDefault(_Loader2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var IdentityLoader = function (_Loader) { + _inherits(IdentityLoader, _Loader); + + function IdentityLoader() { + _classCallCheck(this, IdentityLoader); + + return _possibleConstructorReturn(this, (IdentityLoader.__proto__ || Object.getPrototypeOf(IdentityLoader)).apply(this, arguments)); + } + + _createClass(IdentityLoader, [{ + key: 'load', + value: function load() { + return Promise.resolve(this.src); + } + }]); + + return IdentityLoader; + }(_Loader3.default); + + exports.default = IdentityLoader; + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } }; + + var _Loader2 = __webpack_require__(63); + + var _Loader3 = _interopRequireDefault(_Loader2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + var _class = function (_Loader) { + _inherits(_class, _Loader); + + function _class() { + _classCallCheck(this, _class); + + return _possibleConstructorReturn(this, (_class.__proto__ || Object.getPrototypeOf(_class)).apply(this, arguments)); + } + + _createClass(_class, [{ + key: 'load', + + + /** + * Loads an audio file via XHR. + */ + value: function load() { + var _this2 = this; + + return new Promise(function (resolve, reject) { + var xhr = new XMLHttpRequest(); + + xhr.open('GET', _this2.src, true); + xhr.responseType = 'arraybuffer'; + xhr.send(); + + xhr.addEventListener('progress', function (e) { + _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'fileProgress', _this2).call(_this2, e); + }); + + xhr.addEventListener('load', function (e) { + var decoderPromise = _get(_class.prototype.__proto__ || Object.getPrototypeOf(_class.prototype), 'fileLoad', _this2).call(_this2, e); + + decoderPromise.then(function (audioBuffer) { + resolve(audioBuffer); + }).catch(reject); + }); + + xhr.addEventListener('error', function () { + reject(Error('Track ' + _this2.src + ' failed to load')); + }); + }); + } + }]); + + return _class; + }(_Loader3.default); + + exports.default = _class; + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _conversions = __webpack_require__(60); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + /* + * virtual-dom hook for scrolling the track container. + */ + var _class = function () { + function _class(playlist) { + _classCallCheck(this, _class); + + this.playlist = playlist; + } + + _createClass(_class, [{ + key: 'hook', + value: function hook(node) { + var playlist = this.playlist; + if (!playlist.isScrolling) { + var el = node; + + if (playlist.isAutomaticScroll) { + var rect = node.getBoundingClientRect(); + var controlWidth = playlist.controls.show ? playlist.controls.width : 0; + var width = (0, _conversions.pixelsToSeconds)(rect.width - controlWidth, playlist.samplesPerPixel, playlist.sampleRate); + + var timePoint = playlist.isPlaying() ? playlist.playbackSeconds : playlist.getTimeSelection().start; + + if (timePoint < playlist.scrollLeft || timePoint >= playlist.scrollLeft + width) { + playlist.scrollLeft = Math.min(timePoint, playlist.duration - width); + } + } + + var left = (0, _conversions.secondsToPixels)(playlist.scrollLeft, playlist.samplesPerPixel, playlist.sampleRate); + + el.scrollLeft = left; + } + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _h = __webpack_require__(38); + + var _h2 = _interopRequireDefault(_h); + + var _conversions = __webpack_require__(60); + + var _TimeScaleHook = __webpack_require__(68); + + var _TimeScaleHook2 = _interopRequireDefault(_TimeScaleHook); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var TimeScale = function () { + function TimeScale(duration, offset, samplesPerPixel, sampleRate) { + var marginLeft = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0; + var colors = arguments[5]; + + _classCallCheck(this, TimeScale); + + this.duration = duration; + this.offset = offset; + this.samplesPerPixel = samplesPerPixel; + this.sampleRate = sampleRate; + this.marginLeft = marginLeft; + this.colors = colors; + + this.timeinfo = { + 20000: { + marker: 30000, + bigStep: 10000, + smallStep: 5000, + secondStep: 5 + }, + 12000: { + marker: 15000, + bigStep: 5000, + smallStep: 1000, + secondStep: 1 + }, + 10000: { + marker: 10000, + bigStep: 5000, + smallStep: 1000, + secondStep: 1 + }, + 5000: { + marker: 5000, + bigStep: 1000, + smallStep: 500, + secondStep: 1 / 2 + }, + 2500: { + marker: 2000, + bigStep: 1000, + smallStep: 500, + secondStep: 1 / 2 + }, + 1500: { + marker: 2000, + bigStep: 1000, + smallStep: 200, + secondStep: 1 / 5 + }, + 700: { + marker: 1000, + bigStep: 500, + smallStep: 100, + secondStep: 1 / 10 + } + }; + } + + _createClass(TimeScale, [{ + key: 'getScaleInfo', + value: function getScaleInfo(resolution) { + var keys = Object.keys(this.timeinfo).map(function (item) { + return parseInt(item, 10); + }); + + // make sure keys are numerically sorted. + keys = keys.sort(function (a, b) { + return a - b; + }); + + for (var i = 0; i < keys.length; i += 1) { + if (resolution <= keys[i]) { + return this.timeinfo[keys[i]]; + } + } + + return this.timeinfo[keys[0]]; + } + + /* + Return time in format mm:ss + */ + + }, { + key: 'render', + value: function render() { + var widthX = (0, _conversions.secondsToPixels)(this.duration, this.samplesPerPixel, this.sampleRate); + var pixPerSec = this.sampleRate / this.samplesPerPixel; + var pixOffset = (0, _conversions.secondsToPixels)(this.offset, this.samplesPerPixel, this.sampleRate); + var scaleInfo = this.getScaleInfo(this.samplesPerPixel); + var canvasInfo = {}; + var timeMarkers = []; + var end = widthX + pixOffset; + var counter = 0; + + for (var i = 0; i < end; i += pixPerSec * scaleInfo.secondStep) { + var pixIndex = Math.floor(i); + var pix = pixIndex - pixOffset; + + if (pixIndex >= pixOffset) { + // put a timestamp every 30 seconds. + if (scaleInfo.marker && counter % scaleInfo.marker === 0) { + timeMarkers.push((0, _h2.default)('div.time', { + attributes: { + style: 'position: absolute; left: ' + pix + 'px;' + } + }, [TimeScale.formatTime(counter)])); + + canvasInfo[pix] = 10; + } else if (scaleInfo.bigStep && counter % scaleInfo.bigStep === 0) { + canvasInfo[pix] = 5; + } else if (scaleInfo.smallStep && counter % scaleInfo.smallStep === 0) { + canvasInfo[pix] = 2; + } + } + + counter += 1000 * scaleInfo.secondStep; + } + + return (0, _h2.default)('div.playlist-time-scale', { + attributes: { + style: 'position: relative; left: 0; right: 0; margin-left: ' + this.marginLeft + 'px;' + } + }, [timeMarkers, (0, _h2.default)('canvas', { + attributes: { + width: widthX, + height: 30, + style: 'position: absolute; left: 0; right: 0; top: 0; bottom: 0;' + }, + hook: new _TimeScaleHook2.default(canvasInfo, this.offset, this.samplesPerPixel, this.duration, this.colors) + })]); + } + }], [{ + key: 'formatTime', + value: function formatTime(milliseconds) { + var seconds = milliseconds / 1000; + var s = seconds % 60; + var m = (seconds - s) / 60; + + if (s < 10) { + s = '0' + s; + } + + return m + ':' + s; + } + }]); + + return TimeScale; + }(); + + exports.default = TimeScale; + +/***/ }), +/* 68 */ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + /* + * virtual-dom hook for rendering the time scale canvas. + */ + var _class = function () { + function _class(tickInfo, offset, samplesPerPixel, duration, colors) { + _classCallCheck(this, _class); + + this.tickInfo = tickInfo; + this.offset = offset; + this.samplesPerPixel = samplesPerPixel; + this.duration = duration; + this.colors = colors; + } + + _createClass(_class, [{ + key: 'hook', + value: function hook(canvas, prop, prev) { + var _this = this; + + // canvas is up to date + if (prev !== undefined && prev.offset === this.offset && prev.duration === this.duration && prev.samplesPerPixel === this.samplesPerPixel) { + return; + } + + var width = canvas.width; + var height = canvas.height; + var ctx = canvas.getContext('2d'); + + ctx.clearRect(0, 0, width, height); + ctx.fillStyle = this.colors.timeColor; + + Object.keys(this.tickInfo).forEach(function (x) { + var scaleHeight = _this.tickInfo[x]; + var scaleY = height - scaleHeight; + ctx.fillRect(x, scaleY, 1, scaleHeight); + }); + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _lodash = __webpack_require__(70); + + var _lodash2 = _interopRequireDefault(_lodash); + + var _lodash3 = __webpack_require__(71); + + var _lodash4 = _interopRequireDefault(_lodash3); + + var _uuid = __webpack_require__(72); + + var _uuid2 = _interopRequireDefault(_uuid); + + var _h = __webpack_require__(38); + + var _h2 = _interopRequireDefault(_h); + + var _webaudioPeaks = __webpack_require__(74); + + var _webaudioPeaks2 = _interopRequireDefault(_webaudioPeaks); + + var _fadeMaker = __webpack_require__(75); + + var _conversions = __webpack_require__(60); + + var _states = __webpack_require__(77); + + var _states2 = _interopRequireDefault(_states); + + var _CanvasHook = __webpack_require__(83); + + var _CanvasHook2 = _interopRequireDefault(_CanvasHook); + + var _FadeCanvasHook = __webpack_require__(84); + + var _FadeCanvasHook2 = _interopRequireDefault(_FadeCanvasHook); + + var _VolumeSliderHook = __webpack_require__(85); + + var _VolumeSliderHook2 = _interopRequireDefault(_VolumeSliderHook); + + var _StereoPanSliderHook = __webpack_require__(86); + + var _StereoPanSliderHook2 = _interopRequireDefault(_StereoPanSliderHook); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var MAX_CANVAS_WIDTH = 1000; + + var _class = function () { + function _class() { + _classCallCheck(this, _class); + + this.name = 'Untitled'; + this.customClass = undefined; + this.waveOutlineColor = undefined; + this.gain = 1; + this.fades = {}; + this.peakData = { + type: 'WebAudio', + mono: false + }; + + this.cueIn = 0; + this.cueOut = 0; + this.duration = 0; + this.startTime = 0; + this.endTime = 0; + this.stereoPan = 0; + } + + _createClass(_class, [{ + key: 'setEventEmitter', + value: function setEventEmitter(ee) { + this.ee = ee; + } + }, { + key: 'setName', + value: function setName(name) { + this.name = name; + } + }, { + key: 'setCustomClass', + value: function setCustomClass(className) { + this.customClass = className; + } + }, { + key: 'setWaveOutlineColor', + value: function setWaveOutlineColor(color) { + this.waveOutlineColor = color; + } + }, { + key: 'setCues', + value: function setCues(cueIn, cueOut) { + if (cueOut < cueIn) { + throw new Error('cue out cannot be less than cue in'); + } + + this.cueIn = cueIn; + this.cueOut = cueOut; + this.duration = this.cueOut - this.cueIn; + this.endTime = this.startTime + this.duration; + } + + /* + * start, end in seconds relative to the entire playlist. + */ + + }, { + key: 'trim', + value: function trim(start, end) { + var trackStart = this.getStartTime(); + var trackEnd = this.getEndTime(); + var offset = this.cueIn - trackStart; + + if (trackStart <= start && trackEnd >= start || trackStart <= end && trackEnd >= end) { + var cueIn = start < trackStart ? trackStart : start; + var cueOut = end > trackEnd ? trackEnd : end; + + this.setCues(cueIn + offset, cueOut + offset); + if (start > trackStart) { + this.setStartTime(start); + } + } + } + }, { + key: 'setStartTime', + value: function setStartTime(start) { + this.startTime = start; + this.endTime = start + this.duration; + } + }, { + key: 'setPlayout', + value: function setPlayout(playout) { + this.playout = playout; + } + }, { + key: 'setOfflinePlayout', + value: function setOfflinePlayout(playout) { + this.offlinePlayout = playout; + } + }, { + key: 'setEnabledStates', + value: function setEnabledStates() { + var enabledStates = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + var defaultStatesEnabled = { + cursor: true, + fadein: true, + fadeout: true, + select: true, + shift: true + }; + + this.enabledStates = (0, _lodash2.default)({}, defaultStatesEnabled, enabledStates); + } + }, { + key: 'setFadeIn', + value: function setFadeIn(duration) { + var shape = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'logarithmic'; + + if (duration > this.duration) { + throw new Error('Invalid Fade In'); + } + + var fade = { + shape: shape, + start: 0, + end: duration + }; + + if (this.fadeIn) { + this.removeFade(this.fadeIn); + this.fadeIn = undefined; + } + + this.fadeIn = this.saveFade(_fadeMaker.FADEIN, fade.shape, fade.start, fade.end); + } + }, { + key: 'setFadeOut', + value: function setFadeOut(duration) { + var shape = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'logarithmic'; + + if (duration > this.duration) { + throw new Error('Invalid Fade Out'); + } + + var fade = { + shape: shape, + start: this.duration - duration, + end: this.duration + }; + + if (this.fadeOut) { + this.removeFade(this.fadeOut); + this.fadeOut = undefined; + } + + this.fadeOut = this.saveFade(_fadeMaker.FADEOUT, fade.shape, fade.start, fade.end); + } + }, { + key: 'saveFade', + value: function saveFade(type, shape, start, end) { + var id = _uuid2.default.v4(); + + this.fades[id] = { + type: type, + shape: shape, + start: start, + end: end + }; + + return id; + } + }, { + key: 'removeFade', + value: function removeFade(id) { + delete this.fades[id]; + } + }, { + key: 'setBuffer', + value: function setBuffer(buffer) { + this.buffer = buffer; + } + }, { + key: 'setPeakData', + value: function setPeakData(data) { + this.peakData = data; + } + }, { + key: 'calculatePeaks', + value: function calculatePeaks(samplesPerPixel, sampleRate) { + var cueIn = (0, _conversions.secondsToSamples)(this.cueIn, sampleRate); + var cueOut = (0, _conversions.secondsToSamples)(this.cueOut, sampleRate); + + this.setPeaks((0, _webaudioPeaks2.default)(this.buffer, samplesPerPixel, this.peakData.mono, cueIn, cueOut)); + } + }, { + key: 'setPeaks', + value: function setPeaks(peaks) { + this.peaks = peaks; + } + }, { + key: 'setState', + value: function setState(state) { + this.state = state; + + if (this.state && this.enabledStates[this.state]) { + var StateClass = _states2.default[this.state]; + this.stateObj = new StateClass(this); + } else { + this.stateObj = undefined; + } + } + }, { + key: 'getStartTime', + value: function getStartTime() { + return this.startTime; + } + }, { + key: 'getEndTime', + value: function getEndTime() { + return this.endTime; + } + }, { + key: 'getDuration', + value: function getDuration() { + return this.duration; + } + }, { + key: 'isPlaying', + value: function isPlaying() { + return this.playout.isPlaying(); + } + }, { + key: 'setShouldPlay', + value: function setShouldPlay(bool) { + this.playout.setShouldPlay(bool); + } + }, { + key: 'setGainLevel', + value: function setGainLevel(level) { + this.gain = level; + this.playout.setVolumeGainLevel(level); + } + }, { + key: 'setMasterGainLevel', + value: function setMasterGainLevel(level) { + this.playout.setMasterGainLevel(level); + } + }, { + key: 'setStereoPanValue', + value: function setStereoPanValue(value) { + this.stereoPan = value; + this.playout.setStereoPanValue(value); + } + + /* + startTime, endTime in seconds (float). + segment is for a highlighted section in the UI. + returns a Promise that will resolve when the AudioBufferSource + is either stopped or plays out naturally. + */ + + }, { + key: 'schedulePlay', + value: function schedulePlay(now, startTime, endTime, config) { + var start = void 0; + var duration = void 0; + var when = now; + var segment = endTime ? endTime - startTime : undefined; + + var defaultOptions = { + shouldPlay: true, + masterGain: 1, + isOffline: false + }; + + var options = (0, _lodash2.default)({}, defaultOptions, config); + var playoutSystem = options.isOffline ? this.offlinePlayout : this.playout; + + // 1) track has no content to play. + // 2) track does not play in this selection. + if (this.endTime <= startTime || segment && startTime + segment < this.startTime) { + // return a resolved promise since this track is technically "stopped". + return Promise.resolve(); + } + + // track should have something to play if it gets here. + + // the track starts in the future or on the cursor position + if (this.startTime >= startTime) { + start = 0; + // schedule additional delay for this audio node. + when += this.startTime - startTime; + + if (endTime) { + segment -= this.startTime - startTime; + duration = Math.min(segment, this.duration); + } else { + duration = this.duration; + } + } else { + start = startTime - this.startTime; + + if (endTime) { + duration = Math.min(segment, this.duration - start); + } else { + duration = this.duration - start; + } + } + + start += this.cueIn; + var relPos = startTime - this.startTime; + var sourcePromise = playoutSystem.setUpSource(); + + // param relPos: cursor position in seconds relative to this track. + // can be negative if the cursor is placed before the start of this track etc. + (0, _lodash4.default)(this.fades, function (fade) { + var fadeStart = void 0; + var fadeDuration = void 0; + + // only apply fade if it's ahead of the cursor. + if (relPos < fade.end) { + if (relPos <= fade.start) { + fadeStart = now + (fade.start - relPos); + fadeDuration = fade.end - fade.start; + } else if (relPos > fade.start && relPos < fade.end) { + fadeStart = now - (relPos - fade.start); + fadeDuration = fade.end - fade.start; + } + + switch (fade.type) { + case _fadeMaker.FADEIN: + { + playoutSystem.applyFadeIn(fadeStart, fadeDuration, fade.shape); + break; + } + case _fadeMaker.FADEOUT: + { + playoutSystem.applyFadeOut(fadeStart, fadeDuration, fade.shape); + break; + } + default: + { + throw new Error('Invalid fade type saved on track.'); + } + } + } + }); + + playoutSystem.setVolumeGainLevel(this.gain); + playoutSystem.setShouldPlay(options.shouldPlay); + playoutSystem.setMasterGainLevel(options.masterGain); + playoutSystem.setStereoPanValue(this.stereoPan); + playoutSystem.play(when, start, duration); + + return sourcePromise; + } + }, { + key: 'scheduleStop', + value: function scheduleStop() { + var when = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + this.playout.stop(when); + } + }, { + key: 'renderOverlay', + value: function renderOverlay(data) { + var _this = this; + + var channelPixels = (0, _conversions.secondsToPixels)(data.playlistLength, data.resolution, data.sampleRate); + + var config = { + attributes: { + style: 'position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: ' + channelPixels + 'px; z-index: 9;' + } + }; + + var overlayClass = ''; + + if (this.stateObj) { + this.stateObj.setup(data.resolution, data.sampleRate); + var StateClass = _states2.default[this.state]; + var events = StateClass.getEvents(); + + events.forEach(function (event) { + config['on' + event] = _this.stateObj[event].bind(_this.stateObj); + }); + + overlayClass = StateClass.getClass(); + } + // use this overlay for track event cursor position calculations. + return (0, _h2.default)('div.playlist-overlay' + overlayClass, config); + } + }, { + key: 'renderControls', + value: function renderControls(data) { + var _this2 = this; + + var muteClass = data.muted ? '.active' : ''; + var soloClass = data.soloed ? '.active' : ''; + var isCollapsed = data.collapsed; + var numChan = this.peaks.data.length; + var widgets = data.controls.widgets; + + var removeTrack = (0, _h2.default)('button.btn.btn-danger.btn-sm.track-remove', { + attributes: { + type: 'button', + title: 'Remove track' + }, + onclick: function onclick() { + _this2.ee.emit('removeTrack', _this2); + } + }, [(0, _h2.default)('i.fas.fa-times')]); + + var trackName = (0, _h2.default)('span', [this.name]); + + var collapseTrack = (0, _h2.default)('button.btn.btn-info.btn-sm.track-collapse', { + attributes: { + type: 'button', + title: isCollapsed ? 'Expand track' : 'Collapse track' + }, + onclick: function onclick() { + _this2.ee.emit('changeTrackView', _this2, { + collapsed: !isCollapsed + }); + } + }, [(0, _h2.default)('i.fas.' + (isCollapsed ? 'fa-caret-down' : 'fa-caret-up'))]); + + var headerChildren = []; + + if (widgets.remove) { + headerChildren.push(removeTrack); + } + headerChildren.push(trackName); + if (widgets.collapse) { + headerChildren.push(collapseTrack); + } + + var controls = [(0, _h2.default)('div.track-header', headerChildren)]; + + if (!isCollapsed) { + if (widgets.muteOrSolo) { + controls.push((0, _h2.default)('div.btn-group', [(0, _h2.default)('button.btn.btn-outline-dark.btn-xs.btn-mute' + muteClass, { + attributes: { + type: 'button' + }, + onclick: function onclick() { + _this2.ee.emit('mute', _this2); + } + }, ['Mute']), (0, _h2.default)('button.btn.btn-outline-dark.btn-xs.btn-solo' + soloClass, { + onclick: function onclick() { + _this2.ee.emit('solo', _this2); + } + }, ['Solo'])])); + } + + if (widgets.volume) { + controls.push((0, _h2.default)('label.volume', [(0, _h2.default)('input.volume-slider', { + attributes: { + 'aria-label': 'Track volume control', + type: 'range', + min: 0, + max: 100, + value: 100 + }, + hook: new _VolumeSliderHook2.default(this.gain), + oninput: function oninput(e) { + _this2.ee.emit('volumechange', e.target.value, _this2); + } + })])); + } + + if (widgets.stereoPan) { + controls.push((0, _h2.default)('label.stereopan', [(0, _h2.default)('input.stereopan-slider', { + attributes: { + 'aria-label': 'Track stereo pan control', + type: 'range', + min: -100, + max: 100, + value: 100 + }, + hook: new _StereoPanSliderHook2.default(this.stereoPan), + oninput: function oninput(e) { + _this2.ee.emit('stereopan', e.target.value / 100, _this2); + } + })])); + } + } + + return (0, _h2.default)('div.controls', { + attributes: { + style: 'height: ' + numChan * data.height + 'px; width: ' + data.controls.width + 'px; position: absolute; left: 0; z-index: 10;' + } + }, controls); + } + }, { + key: 'render', + value: function render(data) { + var _this3 = this; + + var width = this.peaks.length; + var playbackX = (0, _conversions.secondsToPixels)(data.playbackSeconds, data.resolution, data.sampleRate); + var startX = (0, _conversions.secondsToPixels)(this.startTime, data.resolution, data.sampleRate); + var endX = (0, _conversions.secondsToPixels)(this.endTime, data.resolution, data.sampleRate); + var progressWidth = 0; + var numChan = this.peaks.data.length; + var scale = Math.floor(window.devicePixelRatio); + + if (playbackX > 0 && playbackX > startX) { + if (playbackX < endX) { + progressWidth = playbackX - startX; + } else { + progressWidth = width; + } + } + + var waveformChildren = [(0, _h2.default)('div.cursor', { + attributes: { + style: 'position: absolute; width: 1px; margin: 0; padding: 0; top: 0; left: ' + playbackX + 'px; bottom: 0; z-index: 5;' + } + })]; + + var channels = Object.keys(this.peaks.data).map(function (channelNum) { + var channelChildren = [(0, _h2.default)('div.channel-progress', { + attributes: { + style: 'position: absolute; width: ' + progressWidth + 'px; height: ' + data.height + 'px; z-index: 2;' + } + })]; + var offset = 0; + var totalWidth = width; + var peaks = _this3.peaks.data[channelNum]; + + while (totalWidth > 0) { + var currentWidth = Math.min(totalWidth, MAX_CANVAS_WIDTH); + var canvasColor = _this3.waveOutlineColor ? _this3.waveOutlineColor : data.colors.waveOutlineColor; + + channelChildren.push((0, _h2.default)('canvas', { + attributes: { + width: currentWidth * scale, + height: data.height * scale, + style: 'float: left; position: relative; margin: 0; padding: 0; z-index: 3; width: ' + currentWidth + 'px; height: ' + data.height + 'px;' + }, + hook: new _CanvasHook2.default(peaks, offset, _this3.peaks.bits, canvasColor, scale, data.height) + })); + + totalWidth -= currentWidth; + offset += MAX_CANVAS_WIDTH; + } + + // if there are fades, display them. + if (_this3.fadeIn) { + var fadeIn = _this3.fades[_this3.fadeIn]; + var fadeWidth = (0, _conversions.secondsToPixels)(fadeIn.end - fadeIn.start, data.resolution, data.sampleRate); + + channelChildren.push((0, _h2.default)('div.wp-fade.wp-fadein', { + attributes: { + style: 'position: absolute; height: ' + data.height + 'px; width: ' + fadeWidth + 'px; top: 0; left: 0; z-index: 4;' + } + }, [(0, _h2.default)('canvas', { + attributes: { + width: fadeWidth, + height: data.height + }, + hook: new _FadeCanvasHook2.default(fadeIn.type, fadeIn.shape, fadeIn.end - fadeIn.start, data.resolution) + })])); + } + + if (_this3.fadeOut) { + var fadeOut = _this3.fades[_this3.fadeOut]; + var _fadeWidth = (0, _conversions.secondsToPixels)(fadeOut.end - fadeOut.start, data.resolution, data.sampleRate); + + channelChildren.push((0, _h2.default)('div.wp-fade.wp-fadeout', { + attributes: { + style: 'position: absolute; height: ' + data.height + 'px; width: ' + _fadeWidth + 'px; top: 0; right: 0; z-index: 4;' + } + }, [(0, _h2.default)('canvas', { + attributes: { + width: _fadeWidth, + height: data.height + }, + hook: new _FadeCanvasHook2.default(fadeOut.type, fadeOut.shape, fadeOut.end - fadeOut.start, data.resolution) + })])); + } + + return (0, _h2.default)('div.channel.channel-' + channelNum, { + attributes: { + style: 'height: ' + data.height + 'px; width: ' + width + 'px; top: ' + channelNum * data.height + 'px; left: ' + startX + 'px; position: absolute; margin: 0; padding: 0; z-index: 1;' + } + }, channelChildren); + }); + + waveformChildren.push(channels); + waveformChildren.push(this.renderOverlay(data)); + + // draw cursor selection on active track. + if (data.isActive === true) { + var cStartX = (0, _conversions.secondsToPixels)(data.timeSelection.start, data.resolution, data.sampleRate); + var cEndX = (0, _conversions.secondsToPixels)(data.timeSelection.end, data.resolution, data.sampleRate); + var cWidth = cEndX - cStartX + 1; + var cClassName = cWidth > 1 ? '.segment' : '.point'; + + waveformChildren.push((0, _h2.default)('div.selection' + cClassName, { + attributes: { + style: 'position: absolute; width: ' + cWidth + 'px; bottom: 0; top: 0; left: ' + cStartX + 'px; z-index: 4;' + } + })); + } + + var waveform = (0, _h2.default)('div.waveform', { + attributes: { + style: 'height: ' + numChan * data.height + 'px; position: relative;' + } + }, waveformChildren); + + var channelChildren = []; + var channelMargin = 0; + + if (data.controls.show) { + channelChildren.push(this.renderControls(data)); + channelMargin = data.controls.width; + } + + channelChildren.push(waveform); + + var audibleClass = data.shouldPlay ? '' : '.silent'; + var customClass = this.customClass === undefined ? '' : '.' + this.customClass; + + return (0, _h2.default)('div.channel-wrapper' + audibleClass + customClass, { + attributes: { + style: 'margin-left: ' + channelMargin + 'px; height: ' + data.height * numChan + 'px;' + } + }, channelChildren); + } + }, { + key: 'getTrackDetails', + value: function getTrackDetails() { + var info = { + src: this.src, + start: this.startTime, + end: this.endTime, + name: this.name, + customClass: this.customClass, + cuein: this.cueIn, + cueout: this.cueOut, + stereoPan: this.stereoPan, + gain: this.gain + }; + + if (this.fadeIn) { + var fadeIn = this.fades[this.fadeIn]; + + info.fadeIn = { + shape: fadeIn.shape, + duration: fadeIn.end - fadeIn.start + }; + } + + if (this.fadeOut) { + var fadeOut = this.fades[this.fadeOut]; + + info.fadeOut = { + shape: fadeOut.shape, + duration: fadeOut.end - fadeOut.start + }; + } + + return info; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 70 */ +/***/ (function(module, exports) { + + /** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = overArg(Object.keys, Object), + nativeMax = Math.max; + + /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ + var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return baseRest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = (assigner.length > 3 && typeof customizer == 'function') + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @see _.assignIn + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * function Bar() { + * this.c = 3; + * } + * + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; + * + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } + */ + var assign = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + module.exports = assign; + + +/***/ }), +/* 71 */ +/***/ (function(module, exports) { + + /** + * lodash (Custom Build) + * Build: `lodash modularize exports="npm" -o ./` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ + + /** Used as references for various `Number` constants. */ + var MAX_SAFE_INTEGER = 9007199254740991; + + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + + /** Used for built-in method references. */ + var objectProto = Object.prototype; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Built-in value references. */ + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeKeys = overArg(Object.keys, Object); + + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` and invokes `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); + } + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Iterates over own enumerable string keyed properties of an object and + * invokes `iteratee` for each property. The iteratee is invoked with three + * arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @see _.forOwnRight + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, typeof iteratee == 'function' ? iteratee : identity); + } + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + + /** + * This method returns the first argument it receives. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Util + * @param {*} value Any value. + * @returns {*} Returns `value`. + * @example + * + * var object = { 'a': 1 }; + * + * console.log(_.identity(object) === object); + * // => true + */ + function identity(value) { + return value; + } + + module.exports = forOwn; + + +/***/ }), +/* 72 */ +/***/ (function(module, exports, __webpack_require__) { + + // uuid.js + // + // Copyright (c) 2010-2012 Robert Kieffer + // MIT License - http://opensource.org/licenses/mit-license.php + + // Unique ID creation requires a high quality random # generator. We feature + // detect to determine the best RNG source, normalizing to a function that + // returns 128-bits of randomness, since that's what's usually required + var _rng = __webpack_require__(73); + + // Maps for number <-> hex string conversion + var _byteToHex = []; + var _hexToByte = {}; + for (var i = 0; i < 256; i++) { + _byteToHex[i] = (i + 0x100).toString(16).substr(1); + _hexToByte[_byteToHex[i]] = i; + } + + // **`parse()` - Parse a UUID into it's component bytes** + function parse(s, buf, offset) { + var i = (buf && offset) || 0, ii = 0; + + buf = buf || []; + s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) { + if (ii < 16) { // Don't overflow! + buf[i + ii++] = _hexToByte[oct]; + } + }); + + // Zero out remaining bytes if string was short + while (ii < 16) { + buf[i + ii++] = 0; + } + + return buf; + } + + // **`unparse()` - Convert UUID byte array (ala parse()) into a string** + function unparse(buf, offset) { + var i = offset || 0, bth = _byteToHex; + return bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + '-' + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]] + + bth[buf[i++]] + bth[buf[i++]]; + } + + // **`v1()` - Generate time-based UUID** + // + // Inspired by https://github.com/LiosK/UUID.js + // and http://docs.python.org/library/uuid.html + + // random #'s we need to init node and clockseq + var _seedBytes = _rng(); + + // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) + var _nodeId = [ + _seedBytes[0] | 0x01, + _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] + ]; + + // Per 4.2.2, randomize (14 bit) clockseq + var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; + + // Previous uuid creation time + var _lastMSecs = 0, _lastNSecs = 0; + + // See https://github.com/broofa/node-uuid for API details + function v1(options, buf, offset) { + var i = buf && offset || 0; + var b = buf || []; + + options = options || {}; + + var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq; + + // UUID timestamps are 100 nano-second units since the Gregorian epoch, + // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so + // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' + // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. + var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime(); + + // Per 4.2.1.2, use count of uuid's generated during the current clock + // cycle to simulate higher resolution clock + var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1; + + // Time since last uuid creation (in msecs) + var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; + + // Per 4.2.1.2, Bump clockseq on clock regression + if (dt < 0 && options.clockseq === undefined) { + clockseq = clockseq + 1 & 0x3fff; + } + + // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new + // time interval + if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) { + nsecs = 0; + } + + // Per 4.2.1.2 Throw error if too many uuids are requested + if (nsecs >= 10000) { + throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); + } + + _lastMSecs = msecs; + _lastNSecs = nsecs; + _clockseq = clockseq; + + // Per 4.1.4 - Convert from unix epoch to Gregorian epoch + msecs += 12219292800000; + + // `time_low` + var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; + b[i++] = tl >>> 24 & 0xff; + b[i++] = tl >>> 16 & 0xff; + b[i++] = tl >>> 8 & 0xff; + b[i++] = tl & 0xff; + + // `time_mid` + var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; + b[i++] = tmh >>> 8 & 0xff; + b[i++] = tmh & 0xff; + + // `time_high_and_version` + b[i++] = tmh >>> 24 & 0xf | 0x10; // include version + b[i++] = tmh >>> 16 & 0xff; + + // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) + b[i++] = clockseq >>> 8 | 0x80; + + // `clock_seq_low` + b[i++] = clockseq & 0xff; + + // `node` + var node = options.node || _nodeId; + for (var n = 0; n < 6; n++) { + b[i + n] = node[n]; + } + + return buf ? buf : unparse(b); + } + + // **`v4()` - Generate random UUID** + + // See https://github.com/broofa/node-uuid for API details + function v4(options, buf, offset) { + // Deprecated - 'format' argument, as supported in v1.2 + var i = buf && offset || 0; + + if (typeof(options) == 'string') { + buf = options == 'binary' ? new Array(16) : null; + options = null; + } + options = options || {}; + + var rnds = options.random || (options.rng || _rng)(); + + // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` + rnds[6] = (rnds[6] & 0x0f) | 0x40; + rnds[8] = (rnds[8] & 0x3f) | 0x80; + + // Copy bytes to buffer, if provided + if (buf) { + for (var ii = 0; ii < 16; ii++) { + buf[i + ii] = rnds[ii]; + } + } + + return buf || unparse(rnds); + } + + // Export public API + var uuid = v4; + uuid.v1 = v1; + uuid.v4 = v4; + uuid.parse = parse; + uuid.unparse = unparse; + + module.exports = uuid; + + +/***/ }), +/* 73 */ +/***/ (function(module, exports) { + + /* WEBPACK VAR INJECTION */(function(global) { + var rng; + + var crypto = global.crypto || global.msCrypto; // for IE 11 + if (crypto && crypto.getRandomValues) { + // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto + // Moderately fast, high quality + var _rnds8 = new Uint8Array(16); + rng = function whatwgRNG() { + crypto.getRandomValues(_rnds8); + return _rnds8; + }; + } + + if (!rng) { + // Math.random()-based (RNG) + // + // If all else fails, use Math.random(). It's fast, but is of unspecified + // quality. + var _rnds = new Array(16); + rng = function() { + for (var i = 0, r; i < 16; i++) { + if ((i & 0x03) === 0) r = Math.random() * 0x100000000; + _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff; + } + + return _rnds; + }; + } + + module.exports = rng; + + + /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }()))) + +/***/ }), +/* 74 */ +/***/ (function(module, exports) { + + 'use strict'; + + //http://jsperf.com/typed-array-min-max/2 + //plain for loop for finding min/max is way faster than anything else. + /** + * @param {TypedArray} array - Subarray of audio to calculate peaks from. + */ + function findMinMax(array) { + var min = Infinity; + var max = -Infinity; + var i = 0; + var len = array.length; + var curr; + + for(; i < len; i++) { + curr = array[i]; + if (min > curr) { + min = curr; + } + if (max < curr) { + max = curr; + } + } + + return { + min: min, + max: max + }; + } + + /** + * @param {Number} n - peak to convert from float to Int8, Int16 etc. + * @param {Number} bits - convert to #bits two's complement signed integer + */ + function convert(n, bits) { + var max = Math.pow(2, bits-1); + var v = n < 0 ? n * max : n * max - 1; + return Math.max(-max, Math.min(max-1, v)); + } + + /** + * @param {TypedArray} channel - Audio track frames to calculate peaks from. + * @param {Number} samplesPerPixel - Audio frames per peak + */ + function extractPeaks(channel, samplesPerPixel, bits) { + var i; + var chanLength = channel.length; + var numPeaks = Math.ceil(chanLength / samplesPerPixel); + var start; + var end; + var segment; + var max; + var min; + var extrema; + + //create interleaved array of min,max + var peaks = new (new Function(`return Int${bits}Array`)())(numPeaks*2); + + for (i = 0; i < numPeaks; i++) { + + start = i * samplesPerPixel; + end = (i + 1) * samplesPerPixel > chanLength ? chanLength : (i + 1) * samplesPerPixel; + + segment = channel.subarray(start, end); + extrema = findMinMax(segment); + min = convert(extrema.min, bits); + max = convert(extrema.max, bits); + + peaks[i*2] = min; + peaks[i*2+1] = max; + } + + return peaks; + } + + function makeMono(channelPeaks, bits) { + var numChan = channelPeaks.length; + var weight = 1 / numChan; + var numPeaks = channelPeaks[0].length / 2; + var c = 0; + var i = 0; + var min; + var max; + var peaks = new (new Function(`return Int${bits}Array`)())(numPeaks*2); + + + for (i = 0; i < numPeaks; i++) { + min = 0; + max = 0; + + for (c = 0; c < numChan; c++) { + min += weight * channelPeaks[c][i*2]; + max += weight * channelPeaks[c][i*2+1]; + } + + peaks[i*2] = min; + peaks[i*2+1] = max; + } + + //return in array so channel number counts still work. + return [peaks]; + } + + /** + * @param {AudioBuffer,TypedArray} source - Source of audio samples for peak calculations. + * @param {Number} samplesPerPixel - Number of audio samples per peak. + * @param {Number} cueIn - index in channel to start peak calculations from. + * @param {Number} cueOut - index in channel to end peak calculations from (non-inclusive). + */ + module.exports = function(source, samplesPerPixel, isMono, cueIn, cueOut, bits) { + samplesPerPixel = samplesPerPixel || 10000; + bits = bits || 8; + + if (isMono === null || isMono === undefined) { + isMono = true; + } + + if ([8, 16, 32].indexOf(bits) < 0) { + throw new Error("Invalid number of bits specified for peaks."); + } + + var numChan = source.numberOfChannels; + var peaks = []; + var c; + var numPeaks; + var channel; + var slice; + + if (typeof source.subarray === "undefined") { + for (c = 0; c < numChan; c++) { + channel = source.getChannelData(c); + cueIn = cueIn || 0; + cueOut = cueOut || channel.length; + slice = channel.subarray(cueIn, cueOut); + peaks.push(extractPeaks(slice, samplesPerPixel, bits)); + } + } + else { + cueIn = cueIn || 0; + cueOut = cueOut || source.length; + peaks.push(extractPeaks(source.subarray(cueIn, cueOut), samplesPerPixel, bits)); + } + + if (isMono && peaks.length > 1) { + peaks = makeMono(peaks, bits); + } + + numPeaks = peaks[0].length / 2; + + return { + length: numPeaks, + data: peaks, + bits: bits + }; + }; + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.FADEOUT = exports.FADEIN = exports.LOGARITHMIC = exports.EXPONENTIAL = exports.LINEAR = exports.SCURVE = undefined; + exports.createFadeIn = createFadeIn; + exports.createFadeOut = createFadeOut; + + var _fadeCurves = __webpack_require__(76); + + var SCURVE = exports.SCURVE = "sCurve"; + var LINEAR = exports.LINEAR = "linear"; + var EXPONENTIAL = exports.EXPONENTIAL = "exponential"; + var LOGARITHMIC = exports.LOGARITHMIC = "logarithmic"; + + var FADEIN = exports.FADEIN = "FadeIn"; + var FADEOUT = exports.FADEOUT = "FadeOut"; + + function sCurveFadeIn(start, duration) { + var curve = (0, _fadeCurves.sCurve)(10000, 1); + this.setValueCurveAtTime(curve, start, duration); + } + + function sCurveFadeOut(start, duration) { + var curve = (0, _fadeCurves.sCurve)(10000, -1); + this.setValueCurveAtTime(curve, start, duration); + } + + function linearFadeIn(start, duration) { + this.linearRampToValueAtTime(0, start); + this.linearRampToValueAtTime(1, start + duration); + } + + function linearFadeOut(start, duration) { + this.linearRampToValueAtTime(1, start); + this.linearRampToValueAtTime(0, start + duration); + } + + function exponentialFadeIn(start, duration) { + this.exponentialRampToValueAtTime(0.01, start); + this.exponentialRampToValueAtTime(1, start + duration); + } + + function exponentialFadeOut(start, duration) { + this.exponentialRampToValueAtTime(1, start); + this.exponentialRampToValueAtTime(0.01, start + duration); + } + + function logarithmicFadeIn(start, duration) { + var curve = (0, _fadeCurves.logarithmic)(10000, 10, 1); + this.setValueCurveAtTime(curve, start, duration); + } + + function logarithmicFadeOut(start, duration) { + var curve = (0, _fadeCurves.logarithmic)(10000, 10, -1); + this.setValueCurveAtTime(curve, start, duration); + } + + function createFadeIn(gain, shape, start, duration) { + switch (shape) { + case SCURVE: + sCurveFadeIn.call(gain, start, duration); + break; + case LINEAR: + linearFadeIn.call(gain, start, duration); + break; + case EXPONENTIAL: + exponentialFadeIn.call(gain, start, duration); + break; + case LOGARITHMIC: + logarithmicFadeIn.call(gain, start, duration); + break; + default: + throw new Error("Unsupported Fade type"); + } + } + + function createFadeOut(gain, shape, start, duration) { + switch (shape) { + case SCURVE: + sCurveFadeOut.call(gain, start, duration); + break; + case LINEAR: + linearFadeOut.call(gain, start, duration); + break; + case EXPONENTIAL: + exponentialFadeOut.call(gain, start, duration); + break; + case LOGARITHMIC: + logarithmicFadeOut.call(gain, start, duration); + break; + default: + throw new Error("Unsupported Fade type"); + } + } + + +/***/ }), +/* 76 */ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.linear = linear; + exports.exponential = exponential; + exports.sCurve = sCurve; + exports.logarithmic = logarithmic; + function linear(length, rotation) { + var curve = new Float32Array(length), + i, + x, + scale = length - 1; + + for (i = 0; i < length; i++) { + x = i / scale; + + if (rotation > 0) { + curve[i] = x; + } else { + curve[i] = 1 - x; + } + } + + return curve; + } + + function exponential(length, rotation) { + var curve = new Float32Array(length), + i, + x, + scale = length - 1, + index; + + for (i = 0; i < length; i++) { + x = i / scale; + index = rotation > 0 ? i : length - 1 - i; + + curve[index] = Math.exp(2 * x - 1) / Math.exp(1); + } + + return curve; + } + + //creating a curve to simulate an S-curve with setValueCurveAtTime. + function sCurve(length, rotation) { + var curve = new Float32Array(length), + i, + phase = rotation > 0 ? Math.PI / 2 : -(Math.PI / 2); + + for (i = 0; i < length; ++i) { + curve[i] = Math.sin(Math.PI * i / length - phase) / 2 + 0.5; + } + return curve; + } + + //creating a curve to simulate a logarithmic curve with setValueCurveAtTime. + function logarithmic(length, base, rotation) { + var curve = new Float32Array(length), + index, + x = 0, + i; + + for (i = 0; i < length; i++) { + //index for the curve array. + index = rotation > 0 ? i : length - 1 - i; + + x = i / length; + curve[index] = Math.log(1 + base * x) / Math.log(1 + base); + } + + return curve; + } + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _CursorState = __webpack_require__(78); + + var _CursorState2 = _interopRequireDefault(_CursorState); + + var _SelectState = __webpack_require__(79); + + var _SelectState2 = _interopRequireDefault(_SelectState); + + var _ShiftState = __webpack_require__(80); + + var _ShiftState2 = _interopRequireDefault(_ShiftState); + + var _FadeInState = __webpack_require__(81); + + var _FadeInState2 = _interopRequireDefault(_FadeInState); + + var _FadeOutState = __webpack_require__(82); + + var _FadeOutState2 = _interopRequireDefault(_FadeOutState); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + exports.default = { + cursor: _CursorState2.default, + select: _SelectState2.default, + shift: _ShiftState2.default, + fadein: _FadeInState2.default, + fadeout: _FadeOutState2.default + }; + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _conversions = __webpack_require__(60); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class(track) { + _classCallCheck(this, _class); + + this.track = track; + } + + _createClass(_class, [{ + key: 'setup', + value: function setup(samplesPerPixel, sampleRate) { + this.samplesPerPixel = samplesPerPixel; + this.sampleRate = sampleRate; + } + }, { + key: 'click', + value: function click(e) { + e.preventDefault(); + + var startX = e.offsetX; + var startTime = (0, _conversions.pixelsToSeconds)(startX, this.samplesPerPixel, this.sampleRate); + + this.track.ee.emit('select', startTime, startTime, this.track); + } + }], [{ + key: 'getClass', + value: function getClass() { + return '.state-cursor'; + } + }, { + key: 'getEvents', + value: function getEvents() { + return ['click']; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _conversions = __webpack_require__(60); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class(track) { + _classCallCheck(this, _class); + + this.track = track; + this.active = false; + } + + _createClass(_class, [{ + key: 'setup', + value: function setup(samplesPerPixel, sampleRate) { + this.samplesPerPixel = samplesPerPixel; + this.sampleRate = sampleRate; + } + }, { + key: 'emitSelection', + value: function emitSelection(x) { + var minX = Math.min(x, this.startX); + var maxX = Math.max(x, this.startX); + var startTime = (0, _conversions.pixelsToSeconds)(minX, this.samplesPerPixel, this.sampleRate); + var endTime = (0, _conversions.pixelsToSeconds)(maxX, this.samplesPerPixel, this.sampleRate); + + this.track.ee.emit('select', startTime, endTime, this.track); + } + }, { + key: 'complete', + value: function complete(x) { + this.emitSelection(x); + this.active = false; + } + }, { + key: 'mousedown', + value: function mousedown(e) { + e.preventDefault(); + this.active = true; + + this.startX = e.offsetX; + var startTime = (0, _conversions.pixelsToSeconds)(this.startX, this.samplesPerPixel, this.sampleRate); + + this.track.ee.emit('select', startTime, startTime, this.track); + } + }, { + key: 'mousemove', + value: function mousemove(e) { + if (this.active) { + e.preventDefault(); + this.emitSelection(e.offsetX); + } + } + }, { + key: 'mouseup', + value: function mouseup(e) { + if (this.active) { + e.preventDefault(); + this.complete(e.offsetX); + } + } + }, { + key: 'mouseleave', + value: function mouseleave(e) { + if (this.active) { + e.preventDefault(); + this.complete(e.offsetX); + } + } + }], [{ + key: 'getClass', + value: function getClass() { + return '.state-select'; + } + }, { + key: 'getEvents', + value: function getEvents() { + return ['mousedown', 'mousemove', 'mouseup', 'mouseleave']; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _conversions = __webpack_require__(60); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class(track) { + _classCallCheck(this, _class); + + this.track = track; + this.active = false; + } + + _createClass(_class, [{ + key: 'setup', + value: function setup(samplesPerPixel, sampleRate) { + this.samplesPerPixel = samplesPerPixel; + this.sampleRate = sampleRate; + } + }, { + key: 'emitShift', + value: function emitShift(x) { + var deltaX = x - this.prevX; + var deltaTime = (0, _conversions.pixelsToSeconds)(deltaX, this.samplesPerPixel, this.sampleRate); + this.prevX = x; + this.track.ee.emit('shift', deltaTime, this.track); + } + }, { + key: 'complete', + value: function complete(x) { + this.emitShift(x); + this.active = false; + } + }, { + key: 'mousedown', + value: function mousedown(e) { + e.preventDefault(); + + this.active = true; + this.el = e.target; + this.prevX = e.offsetX; + } + }, { + key: 'mousemove', + value: function mousemove(e) { + if (this.active) { + e.preventDefault(); + this.emitShift(e.offsetX); + } + } + }, { + key: 'mouseup', + value: function mouseup(e) { + if (this.active) { + e.preventDefault(); + this.complete(e.offsetX); + } + } + }, { + key: 'mouseleave', + value: function mouseleave(e) { + if (this.active) { + e.preventDefault(); + this.complete(e.offsetX); + } + } + }], [{ + key: 'getClass', + value: function getClass() { + return '.state-shift'; + } + }, { + key: 'getEvents', + value: function getEvents() { + return ['mousedown', 'mousemove', 'mouseup', 'mouseleave']; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _conversions = __webpack_require__(60); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class(track) { + _classCallCheck(this, _class); + + this.track = track; + } + + _createClass(_class, [{ + key: 'setup', + value: function setup(samplesPerPixel, sampleRate) { + this.samplesPerPixel = samplesPerPixel; + this.sampleRate = sampleRate; + } + }, { + key: 'click', + value: function click(e) { + var startX = e.offsetX; + var time = (0, _conversions.pixelsToSeconds)(startX, this.samplesPerPixel, this.sampleRate); + + if (time > this.track.getStartTime() && time < this.track.getEndTime()) { + this.track.ee.emit('fadein', time - this.track.getStartTime(), this.track); + } + } + }], [{ + key: 'getClass', + value: function getClass() { + return '.state-fadein'; + } + }, { + key: 'getEvents', + value: function getEvents() { + return ['click']; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _conversions = __webpack_require__(60); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class(track) { + _classCallCheck(this, _class); + + this.track = track; + } + + _createClass(_class, [{ + key: 'setup', + value: function setup(samplesPerPixel, sampleRate) { + this.samplesPerPixel = samplesPerPixel; + this.sampleRate = sampleRate; + } + }, { + key: 'click', + value: function click(e) { + var startX = e.offsetX; + var time = (0, _conversions.pixelsToSeconds)(startX, this.samplesPerPixel, this.sampleRate); + + if (time > this.track.getStartTime() && time < this.track.getEndTime()) { + this.track.ee.emit('fadeout', this.track.getEndTime() - time, this.track); + } + } + }], [{ + key: 'getClass', + value: function getClass() { + return '.state-fadeout'; + } + }, { + key: 'getEvents', + value: function getEvents() { + return ['click']; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 83 */ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + /* + * virtual-dom hook for drawing to the canvas element. + */ + var CanvasHook = function () { + function CanvasHook(peaks, offset, bits, color, scale, height) { + _classCallCheck(this, CanvasHook); + + this.peaks = peaks; + // http://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element + this.offset = offset; + this.color = color; + this.bits = bits; + this.scale = scale; + this.height = height; + } + + _createClass(CanvasHook, [{ + key: 'hook', + value: function hook(canvas, prop, prev) { + // canvas is up to date + if (prev !== undefined && prev.peaks === this.peaks && prev.scale === this.scale && prev.height === this.height) { + return; + } + + var scale = this.scale; + var len = canvas.width / scale; + var cc = canvas.getContext('2d'); + var h2 = canvas.height / scale / 2; + var maxValue = Math.pow(2, this.bits - 1); + + cc.clearRect(0, 0, canvas.width, canvas.height); + + cc.save(); + cc.fillStyle = this.color; + cc.scale(scale, scale); + + for (var i = 0; i < len; i += 1) { + var minPeak = this.peaks[(i + this.offset) * 2] / maxValue; + var maxPeak = this.peaks[(i + this.offset) * 2 + 1] / maxValue; + CanvasHook.drawFrame(cc, h2, i, minPeak, maxPeak); + } + + cc.restore(); + } + }], [{ + key: 'drawFrame', + value: function drawFrame(cc, h2, x, minPeak, maxPeak) { + var min = Math.abs(minPeak * h2); + var max = Math.abs(maxPeak * h2); + + // draw max + cc.fillRect(x, 0, 1, h2 - max); + // draw min + cc.fillRect(x, h2 + min, 1, h2 - min); + } + }]); + + return CanvasHook; + }(); + + exports.default = CanvasHook; + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _fadeMaker = __webpack_require__(75); + + var _fadeCurves = __webpack_require__(76); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + /* + * virtual-dom hook for drawing the fade curve to the canvas element. + */ + var FadeCanvasHook = function () { + function FadeCanvasHook(type, shape, duration, samplesPerPixel) { + _classCallCheck(this, FadeCanvasHook); + + this.type = type; + this.shape = shape; + this.duration = duration; + this.samplesPerPixel = samplesPerPixel; + } + + _createClass(FadeCanvasHook, [{ + key: 'hook', + value: function hook(canvas, prop, prev) { + // node is up to date. + if (prev !== undefined && prev.shape === this.shape && prev.type === this.type && prev.duration === this.duration && prev.samplesPerPixel === this.samplesPerPixel) { + return; + } + + var ctx = canvas.getContext('2d'); + var width = canvas.width; + var height = canvas.height; + var curve = FadeCanvasHook.createCurve(this.shape, this.type, width); + var len = curve.length; + var y = height - curve[0] * height; + + ctx.clearRect(0, 0, canvas.width, canvas.height); + ctx.save(); + + ctx.strokeStyle = 'black'; + ctx.beginPath(); + ctx.moveTo(0, y); + + for (var i = 1; i < len; i += 1) { + y = height - curve[i] * height; + ctx.lineTo(i, y); + } + ctx.stroke(); + ctx.restore(); + } + }], [{ + key: 'createCurve', + value: function createCurve(shape, type, width) { + var reflection = void 0; + var curve = void 0; + + switch (type) { + case _fadeMaker.FADEIN: + { + reflection = 1; + break; + } + case _fadeMaker.FADEOUT: + { + reflection = -1; + break; + } + default: + { + throw new Error('Unsupported fade type.'); + } + } + + switch (shape) { + case _fadeMaker.SCURVE: + { + curve = (0, _fadeCurves.sCurve)(width, reflection); + break; + } + case _fadeMaker.LINEAR: + { + curve = (0, _fadeCurves.linear)(width, reflection); + break; + } + case _fadeMaker.EXPONENTIAL: + { + curve = (0, _fadeCurves.exponential)(width, reflection); + break; + } + case _fadeMaker.LOGARITHMIC: + { + curve = (0, _fadeCurves.logarithmic)(width, 10, reflection); + break; + } + default: + { + throw new Error('Unsupported fade shape'); + } + } + + return curve; + } + }]); + + return FadeCanvasHook; + }(); + + exports.default = FadeCanvasHook; + +/***/ }), +/* 85 */ +/***/ (function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + /* eslint-disable no-param-reassign */ + /* + * virtual-dom hook for setting the volume input programmatically. + */ + var _class = function () { + function _class(gain) { + _classCallCheck(this, _class); + + this.gain = gain; + } + + _createClass(_class, [{ + key: "hook", + value: function hook(volumeInput) { + volumeInput.value = this.gain * 100; + volumeInput.title = this.gain * 100 + "% volume"; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 86 */ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + /* eslint-disable no-param-reassign */ + /* + * virtual-dom hook for setting the stereoPan input programmatically. + */ + var _class = function () { + function _class(stereoPan) { + _classCallCheck(this, _class); + + this.stereoPan = stereoPan; + } + + _createClass(_class, [{ + key: 'hook', + value: function hook(stereoPanInput) { + stereoPanInput.value = this.stereoPan * 100; + + var panOrientation = void 0; + if (this.stereoPan === 0) { + panOrientation = 'Center'; + } else if (this.stereoPan < 0) { + panOrientation = 'Left'; + } else { + panOrientation = 'Right'; + } + var percentage = Math.abs(this.stereoPan * 100) + '% '; + stereoPanInput.title = 'Pan: ' + (this.stereoPan !== 0 ? percentage : '') + panOrientation; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _fadeMaker = __webpack_require__(75); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class(ac, buffer) { + _classCallCheck(this, _class); + + this.ac = ac; + this.gain = 1; + this.buffer = buffer; + this.destination = this.ac.destination; + this.ac.createStereoPanner = ac.createStereoPanner || ac.createPanner; + } + + _createClass(_class, [{ + key: 'applyFade', + value: function applyFade(type, start, duration) { + var shape = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'logarithmic'; + + if (type === _fadeMaker.FADEIN) { + (0, _fadeMaker.createFadeIn)(this.fadeGain.gain, shape, start, duration); + } else if (type === _fadeMaker.FADEOUT) { + (0, _fadeMaker.createFadeOut)(this.fadeGain.gain, shape, start, duration); + } else { + throw new Error('Unsupported fade type'); + } + } + }, { + key: 'applyFadeIn', + value: function applyFadeIn(start, duration) { + var shape = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'logarithmic'; + + this.applyFade(_fadeMaker.FADEIN, start, duration, shape); + } + }, { + key: 'applyFadeOut', + value: function applyFadeOut(start, duration) { + var shape = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'logarithmic'; + + this.applyFade(_fadeMaker.FADEOUT, start, duration, shape); + } + }, { + key: 'isPlaying', + value: function isPlaying() { + return this.source !== undefined; + } + }, { + key: 'getDuration', + value: function getDuration() { + return this.buffer.duration; + } + }, { + key: 'setAudioContext', + value: function setAudioContext(ac) { + this.ac = ac; + this.ac.createStereoPanner = ac.createStereoPanner || ac.createPanner; + this.destination = this.ac.destination; + } + }, { + key: 'setUpSource', + value: function setUpSource() { + var _this = this; + + this.source = this.ac.createBufferSource(); + this.source.buffer = this.buffer; + + var sourcePromise = new Promise(function (resolve) { + // keep track of the buffer state. + _this.source.onended = function () { + _this.source.disconnect(); + _this.fadeGain.disconnect(); + _this.volumeGain.disconnect(); + _this.shouldPlayGain.disconnect(); + _this.panner.disconnect(); + _this.masterGain.disconnect(); + + _this.source = undefined; + _this.fadeGain = undefined; + _this.volumeGain = undefined; + _this.shouldPlayGain = undefined; + _this.panner = undefined; + _this.masterGain = undefined; + + resolve(); + }; + }); + + this.fadeGain = this.ac.createGain(); + // used for track volume slider + this.volumeGain = this.ac.createGain(); + // used for solo/mute + this.shouldPlayGain = this.ac.createGain(); + this.masterGain = this.ac.createGain(); + + this.panner = this.ac.createStereoPanner(); + + this.source.connect(this.fadeGain); + this.fadeGain.connect(this.volumeGain); + this.volumeGain.connect(this.shouldPlayGain); + this.shouldPlayGain.connect(this.masterGain); + this.masterGain.connect(this.panner); + this.panner.connect(this.destination); + + return sourcePromise; + } + }, { + key: 'setVolumeGainLevel', + value: function setVolumeGainLevel(level) { + if (this.volumeGain) { + this.volumeGain.gain.value = level; + } + } + }, { + key: 'setShouldPlay', + value: function setShouldPlay(bool) { + if (this.shouldPlayGain) { + this.shouldPlayGain.gain.value = bool ? 1 : 0; + } + } + }, { + key: 'setMasterGainLevel', + value: function setMasterGainLevel(level) { + if (this.masterGain) { + this.masterGain.gain.value = level; + } + } + }, { + key: 'setStereoPanValue', + value: function setStereoPanValue(value) { + var pan = value === undefined ? 0 : value; + + if (this.panner) { + if (this.panner.pan !== undefined) { + this.panner.pan.value = pan; + } else { + this.panner.panningModel = 'equalpower'; + this.panner.setPosition(pan, 0, 1 - Math.abs(pan)); + } + } + } + + /* + source.start is picky when passing the end time. + If rounding error causes a number to make the source think + it is playing slightly more samples than it has it won't play at all. + Unfortunately it doesn't seem to work if you just give it a start time. + */ + + }, { + key: 'play', + value: function play(when, start, duration) { + this.source.start(when, start, duration); + } + }, { + key: 'stop', + value: function stop() { + var when = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; + + if (this.source) { + this.source.stop(when); + } + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _h = __webpack_require__(38); + + var _h2 = _interopRequireDefault(_h); + + var _aeneas = __webpack_require__(89); + + var _aeneas2 = _interopRequireDefault(_aeneas); + + var _aeneas3 = __webpack_require__(90); + + var _aeneas4 = _interopRequireDefault(_aeneas3); + + var _conversions = __webpack_require__(60); + + var _DragInteraction = __webpack_require__(91); + + var _DragInteraction2 = _interopRequireDefault(_DragInteraction); + + var _ScrollTopHook = __webpack_require__(92); + + var _ScrollTopHook2 = _interopRequireDefault(_ScrollTopHook); + + var _timeformat = __webpack_require__(93); + + var _timeformat2 = _interopRequireDefault(_timeformat); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var AnnotationList = function () { + function AnnotationList(playlist, annotations) { + var controls = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; + var editable = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + var linkEndpoints = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; + var isContinuousPlay = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false; + + _classCallCheck(this, AnnotationList); + + this.playlist = playlist; + this.resizeHandlers = []; + this.editable = editable; + this.annotations = annotations.map(function (a) { + return ( + // TODO support different formats later on. + (0, _aeneas2.default)(a) + ); + }); + this.setupInteractions(); + + this.controls = controls; + this.setupEE(playlist.ee); + + // TODO actually make a real plugin system that's not terrible. + this.playlist.isContinuousPlay = isContinuousPlay; + this.playlist.linkEndpoints = linkEndpoints; + this.length = this.annotations.length; + } + + _createClass(AnnotationList, [{ + key: 'setupInteractions', + value: function setupInteractions() { + var _this = this; + + this.annotations.forEach(function (a, i) { + var leftShift = new _DragInteraction2.default(_this.playlist, { + direction: 'left', + index: i + }); + var rightShift = new _DragInteraction2.default(_this.playlist, { + direction: 'right', + index: i + }); + + _this.resizeHandlers.push(leftShift); + _this.resizeHandlers.push(rightShift); + }); + } + }, { + key: 'setupEE', + value: function setupEE(ee) { + var _this2 = this; + + ee.on('dragged', function (deltaTime, data) { + var annotationIndex = data.index; + var annotations = _this2.annotations; + var note = annotations[annotationIndex]; + + // resizing to the left + if (data.direction === 'left') { + var originalVal = note.start; + note.start += deltaTime; + + if (note.start < 0) { + note.start = 0; + } + + if (annotationIndex && annotations[annotationIndex - 1].end > note.start) { + annotations[annotationIndex - 1].end = note.start; + } + + if (_this2.playlist.linkEndpoints && annotationIndex && annotations[annotationIndex - 1].end === originalVal) { + annotations[annotationIndex - 1].end = note.start; + } + } else { + // resizing to the right + var _originalVal = note.end; + note.end += deltaTime; + + if (note.end > _this2.playlist.duration) { + note.end = _this2.playlist.duration; + } + + if (annotationIndex < annotations.length - 1 && annotations[annotationIndex + 1].start < note.end) { + annotations[annotationIndex + 1].start = note.end; + } + + if (_this2.playlist.linkEndpoints && annotationIndex < annotations.length - 1 && annotations[annotationIndex + 1].start === _originalVal) { + annotations[annotationIndex + 1].start = note.end; + } + } + + _this2.playlist.drawRequest(); + }); + + ee.on('continuousplay', function (val) { + _this2.playlist.isContinuousPlay = val; + }); + + ee.on('linkendpoints', function (val) { + _this2.playlist.linkEndpoints = val; + }); + + ee.on('annotationsrequest', function () { + _this2.export(); + }); + + return ee; + } + }, { + key: 'export', + value: function _export() { + var output = this.annotations.map(function (a) { + return (0, _aeneas4.default)(a); + }); + var dataStr = 'data:text/json;charset=utf-8,' + encodeURIComponent(JSON.stringify(output)); + var a = document.createElement('a'); + + document.body.appendChild(a); + a.href = dataStr; + a.download = 'annotations.json'; + a.click(); + document.body.removeChild(a); + } + }, { + key: 'renderResizeLeft', + value: function renderResizeLeft(i) { + var events = _DragInteraction2.default.getEvents(); + var config = { + attributes: { + style: 'position: absolute; height: 30px; width: 10px; top: 0; left: -2px', + draggable: true + } + }; + var handler = this.resizeHandlers[i * 2]; + + events.forEach(function (event) { + config['on' + event] = handler[event].bind(handler); + }); + + return (0, _h2.default)('div.resize-handle.resize-w', config); + } + }, { + key: 'renderResizeRight', + value: function renderResizeRight(i) { + var events = _DragInteraction2.default.getEvents(); + var config = { + attributes: { + style: 'position: absolute; height: 30px; width: 10px; top: 0; right: -2px', + draggable: true + } + }; + var handler = this.resizeHandlers[i * 2 + 1]; + + events.forEach(function (event) { + config['on' + event] = handler[event].bind(handler); + }); + + return (0, _h2.default)('div.resize-handle.resize-e', config); + } + }, { + key: 'renderControls', + value: function renderControls(note, i) { + var _this3 = this; + + // seems to be a bug with references, or I'm missing something. + var that = this; + return this.controls.map(function (ctrl) { + return (0, _h2.default)('i.' + ctrl.class, { + attributes: { + title: ctrl.title + }, + onclick: function onclick() { + ctrl.action(note, i, that.annotations, { + linkEndpoints: that.playlist.linkEndpoints + }); + _this3.setupInteractions(); + that.playlist.drawRequest(); + } + }); + }); + } + }, { + key: 'render', + value: function render() { + var _this4 = this; + + var boxes = (0, _h2.default)('div.annotations-boxes', { + attributes: { + style: 'height: 30px;' + } + }, this.annotations.map(function (note, i) { + var samplesPerPixel = _this4.playlist.samplesPerPixel; + var sampleRate = _this4.playlist.sampleRate; + var pixPerSec = sampleRate / samplesPerPixel; + var pixOffset = (0, _conversions.secondsToPixels)(_this4.playlist.scrollLeft, samplesPerPixel, sampleRate); + var left = Math.floor(note.start * pixPerSec - pixOffset); + var width = Math.ceil(note.end * pixPerSec - note.start * pixPerSec); + + return (0, _h2.default)('div.annotation-box', { + attributes: { + style: 'position: absolute; height: 30px; width: ' + width + 'px; left: ' + left + 'px', + 'data-id': note.id + } + }, [_this4.renderResizeLeft(i), (0, _h2.default)('span.id', { + onclick: function onclick() { + var start = _this4.annotations[i].start; + var end = _this4.annotations[i].end; + + if (_this4.playlist.isContinuousPlay) { + _this4.playlist.seek(start, start); + _this4.playlist.ee.emit('play', start); + } else { + _this4.playlist.seek(start, end); + _this4.playlist.ee.emit('play', start, end); + } + } + }, [note.id]), _this4.renderResizeRight(i)]); + })); + + var boxesWrapper = (0, _h2.default)('div.annotations-boxes-wrapper', { + attributes: { + style: 'overflow: hidden;' + } + }, [boxes]); + + var text = (0, _h2.default)('div.annotations-text', { + hook: new _ScrollTopHook2.default() + }, this.annotations.map(function (note, i) { + var format = (0, _timeformat2.default)(_this4.playlist.durationFormat); + var start = format(note.start); + var end = format(note.end); + + var segmentClass = ''; + if (_this4.playlist.isPlaying() && _this4.playlist.playbackSeconds >= note.start && _this4.playlist.playbackSeconds <= note.end) { + segmentClass = '.current'; + } + + var editableConfig = { + attributes: { + contenteditable: true + }, + oninput: function oninput(e) { + // needed currently for references + // eslint-disable-next-line no-param-reassign + note.lines = [e.target.innerText]; + }, + onkeypress: function onkeypress(e) { + if (e.which === 13 || e.keyCode === 13) { + e.target.blur(); + e.preventDefault(); + } + } + }; + + var linesConfig = _this4.editable ? editableConfig : {}; + + return (0, _h2.default)('div.annotation' + segmentClass, [(0, _h2.default)('span.annotation-id', [note.id]), (0, _h2.default)('span.annotation-start', [start]), (0, _h2.default)('span.annotation-end', [end]), (0, _h2.default)('span.annotation-lines', linesConfig, [note.lines]), (0, _h2.default)('span.annotation-actions', _this4.renderControls(note, i))]); + })); + + return (0, _h2.default)('div.annotations', [boxesWrapper, text]); + } + }]); + + return AnnotationList; + }(); + + exports.default = AnnotationList; + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (aeneas) { + var annotation = { + id: aeneas.id || _uuid2.default.v4(), + start: Number(aeneas.begin) || 0, + end: Number(aeneas.end) || 0, + lines: aeneas.lines || [''], + lang: aeneas.language || 'en' + }; + + return annotation; + }; + + var _uuid = __webpack_require__(72); + + var _uuid2 = _interopRequireDefault(_uuid); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/***/ }), +/* 90 */ +/***/ (function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (annotation) { + return { + begin: String(annotation.start.toFixed(3)), + end: String(annotation.end.toFixed(3)), + id: String(annotation.id), + language: annotation.lang, + lines: annotation.lines + }; + }; + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _conversions = __webpack_require__(60); + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + var _class = function () { + function _class(playlist) { + var _this = this; + + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + _classCallCheck(this, _class); + + this.playlist = playlist; + this.data = data; + this.active = false; + + this.ondragover = function (e) { + if (_this.active) { + e.preventDefault(); + _this.emitDrag(e.clientX); + } + }; + } + + _createClass(_class, [{ + key: 'emitDrag', + value: function emitDrag(x) { + var deltaX = x - this.prevX; + + // emit shift event if not 0 + if (deltaX) { + var deltaTime = (0, _conversions.pixelsToSeconds)(deltaX, this.playlist.samplesPerPixel, this.playlist.sampleRate); + this.prevX = x; + this.playlist.ee.emit('dragged', deltaTime, this.data); + } + } + }, { + key: 'complete', + value: function complete() { + this.active = false; + document.removeEventListener('dragover', this.ondragover); + } + }, { + key: 'dragstart', + value: function dragstart(e) { + var ev = e; + this.active = true; + this.prevX = e.clientX; + + ev.dataTransfer.dropEffect = 'move'; + ev.dataTransfer.effectAllowed = 'move'; + ev.dataTransfer.setData('text/plain', ''); + document.addEventListener('dragover', this.ondragover); + } + }, { + key: 'dragend', + value: function dragend(e) { + if (this.active) { + e.preventDefault(); + this.complete(); + } + } + }], [{ + key: 'getClass', + value: function getClass() { + return '.shift'; + } + }, { + key: 'getEvents', + value: function getEvents() { + return ['dragstart', 'dragend']; + } + }]); + + return _class; + }(); + + exports.default = _class; + +/***/ }), +/* 92 */ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + /* + * virtual-dom hook for scrolling to the text annotation. + */ + var Hook = function ScrollTopHook() {}; + Hook.prototype.hook = function hook(node) { + var el = node.querySelector('.current'); + if (el) { + var box = node.getBoundingClientRect(); + var row = el.getBoundingClientRect(); + var diff = row.top - box.top; + var list = node; + list.scrollTop += diff; + } + }; + + exports.default = Hook; + +/***/ }), +/* 93 */ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function (format) { + function clockFormat(seconds, decimals) { + var hours = parseInt(seconds / 3600, 10) % 24; + var minutes = parseInt(seconds / 60, 10) % 60; + var secs = (seconds % 60).toFixed(decimals); + + var sHours = hours < 10 ? '0' + hours : hours; + var sMinutes = minutes < 10 ? '0' + minutes : minutes; + var sSeconds = secs < 10 ? '0' + secs : secs; + + return sHours + ':' + sMinutes + ':' + sSeconds; + } + + var formats = { + seconds: function seconds(_seconds) { + return _seconds.toFixed(0); + }, + thousandths: function thousandths(seconds) { + return seconds.toFixed(3); + }, + + 'hh:mm:ss': function hhmmss(seconds) { + return clockFormat(seconds, 0); + }, + 'hh:mm:ss.u': function hhmmssu(seconds) { + return clockFormat(seconds, 1); + }, + 'hh:mm:ss.uu': function hhmmssuu(seconds) { + return clockFormat(seconds, 2); + }, + 'hh:mm:ss.uuu': function hhmmssuuu(seconds) { + return clockFormat(seconds, 3); + } + }; + + return formats[format]; + }; + +/***/ }), +/* 94 */ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function () { + // http://jsperf.com/typed-array-min-max/2 + // plain for loop for finding min/max is way faster than anything else. + /** + * @param {TypedArray} array - Subarray of audio to calculate peaks from. + */ + function findMinMax(array) { + var min = Infinity; + var max = -Infinity; + var curr = void 0; + + for (var i = 0; i < array.length; i += 1) { + curr = array[i]; + if (min > curr) { + min = curr; + } + if (max < curr) { + max = curr; + } + } + + return { + min: min, + max: max + }; + } + + /** + * @param {Number} n - peak to convert from float to Int8, Int16 etc. + * @param {Number} bits - convert to #bits two's complement signed integer + */ + function convert(n, bits) { + var max = Math.pow(2, bits - 1); + var v = n < 0 ? n * max : n * max - 1; + return Math.max(-max, Math.min(max - 1, v)); + } + + /** + * @param {TypedArray} channel - Audio track frames to calculate peaks from. + * @param {Number} samplesPerPixel - Audio frames per peak + */ + function extractPeaks(channel, samplesPerPixel, bits) { + var chanLength = channel.length; + var numPeaks = Math.ceil(chanLength / samplesPerPixel); + var start = void 0; + var end = void 0; + var segment = void 0; + var max = void 0; + var min = void 0; + var extrema = void 0; + + // create interleaved array of min,max + var peaks = new self['Int' + bits + 'Array'](numPeaks * 2); + + for (var i = 0; i < numPeaks; i += 1) { + start = i * samplesPerPixel; + end = (i + 1) * samplesPerPixel > chanLength ? chanLength : (i + 1) * samplesPerPixel; + + segment = channel.subarray(start, end); + extrema = findMinMax(segment); + min = convert(extrema.min, bits); + max = convert(extrema.max, bits); + + peaks[i * 2] = min; + peaks[i * 2 + 1] = max; + } + + return peaks; + } + + /** + * @param {TypedArray} source - Source of audio samples for peak calculations. + * @param {Number} samplesPerPixel - Number of audio samples per peak. + * @param {Number} cueIn - index in channel to start peak calculations from. + * @param {Number} cueOut - index in channel to end peak calculations from (non-inclusive). + */ + function audioPeaks(source) { + var samplesPerPixel = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 10000; + var bits = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 8; + + if ([8, 16, 32].indexOf(bits) < 0) { + throw new Error('Invalid number of bits specified for peaks.'); + } + + var peaks = []; + var start = 0; + var end = source.length; + peaks.push(extractPeaks(source.subarray(start, end), samplesPerPixel, bits)); + + var length = peaks[0].length / 2; + + return { + bits: bits, + length: length, + data: peaks + }; + } + + onmessage = function onmessage(e) { + var peaks = audioPeaks(e.data.samples, e.data.samplesPerPixel); + + postMessage(peaks); + }; + }; + +/***/ }), +/* 95 */ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + exports.default = function () { + var recLength = 0; + var recBuffersL = []; + var recBuffersR = []; + var sampleRate = void 0; + + function init(config) { + sampleRate = config.sampleRate; + } + + function record(inputBuffer) { + recBuffersL.push(inputBuffer[0]); + recBuffersR.push(inputBuffer[1]); + recLength += inputBuffer[0].length; + } + + function writeString(view, offset, string) { + for (var i = 0; i < string.length; i += 1) { + view.setUint8(offset + i, string.charCodeAt(i)); + } + } + + function floatTo16BitPCM(output, offset, input) { + var writeOffset = offset; + for (var i = 0; i < input.length; i += 1, writeOffset += 2) { + var s = Math.max(-1, Math.min(1, input[i])); + output.setInt16(writeOffset, s < 0 ? s * 0x8000 : s * 0x7FFF, true); + } + } + + function encodeWAV(samples) { + var mono = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + + var buffer = new ArrayBuffer(44 + samples.length * 2); + var view = new DataView(buffer); + + /* RIFF identifier */ + writeString(view, 0, 'RIFF'); + /* file length */ + view.setUint32(4, 32 + samples.length * 2, true); + /* RIFF type */ + writeString(view, 8, 'WAVE'); + /* format chunk identifier */ + writeString(view, 12, 'fmt '); + /* format chunk length */ + view.setUint32(16, 16, true); + /* sample format (raw) */ + view.setUint16(20, 1, true); + /* channel count */ + view.setUint16(22, mono ? 1 : 2, true); + /* sample rate */ + view.setUint32(24, sampleRate, true); + /* byte rate (sample rate * block align) */ + view.setUint32(28, sampleRate * 4, true); + /* block align (channel count * bytes per sample) */ + view.setUint16(32, 4, true); + /* bits per sample */ + view.setUint16(34, 16, true); + /* data chunk identifier */ + writeString(view, 36, 'data'); + /* data chunk length */ + view.setUint32(40, samples.length * 2, true); + + floatTo16BitPCM(view, 44, samples); + + return view; + } + + function mergeBuffers(recBuffers, length) { + var result = new Float32Array(length); + var offset = 0; + + for (var i = 0; i < recBuffers.length; i += 1) { + result.set(recBuffers[i], offset); + offset += recBuffers[i].length; + } + return result; + } + + function interleave(inputL, inputR) { + var length = inputL.length + inputR.length; + var result = new Float32Array(length); + + var index = 0; + var inputIndex = 0; + + while (index < length) { + result[index += 1] = inputL[inputIndex]; + result[index += 1] = inputR[inputIndex]; + inputIndex += 1; + } + + return result; + } + + function exportWAV(type) { + var bufferL = mergeBuffers(recBuffersL, recLength); + var bufferR = mergeBuffers(recBuffersR, recLength); + var interleaved = interleave(bufferL, bufferR); + var dataview = encodeWAV(interleaved); + var audioBlob = new Blob([dataview], { type: type }); + + postMessage(audioBlob); + } + + function clear() { + recLength = 0; + recBuffersL = []; + recBuffersR = []; + } + + onmessage = function onmessage(e) { + switch (e.data.command) { + case 'init': + { + init(e.data.config); + break; + } + case 'record': + { + record(e.data.buffer); + break; + } + case 'exportWAV': + { + exportWAV(e.data.type); + break; + } + case 'clear': + { + clear(); + break; + } + default: + { + throw new Error('Unknown export worker command'); + } + } + }; + }; + +/***/ }) +/******/ ]); +//# sourceMappingURL=waveform-playlist.var.js.map \ No newline at end of file diff --git a/dist/waveform-playlist/js/waveform-playlist.var.js.map b/dist/waveform-playlist/js/waveform-playlist.var.js.map new file mode 100644 index 00000000..aaf03f11 --- /dev/null +++ b/dist/waveform-playlist/js/waveform-playlist.var.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap 08ec2b81ea5f7a7ee369","webpack:///./src/app.js","webpack:///./~/lodash.defaultsdeep/index.js","webpack:///(webpack)/buildin/module.js","webpack:///./~/virtual-dom/create-element.js","webpack:///./~/virtual-dom/vdom/create-element.js","webpack:///./~/global/document.js","webpack:///min-document (ignored)","webpack:///./~/virtual-dom/vdom/apply-properties.js","webpack:///./~/is-object/index.js","webpack:///./~/virtual-dom/vnode/is-vhook.js","webpack:///./~/virtual-dom/vnode/is-vnode.js","webpack:///./~/virtual-dom/vnode/version.js","webpack:///./~/virtual-dom/vnode/is-vtext.js","webpack:///./~/virtual-dom/vnode/is-widget.js","webpack:///./~/virtual-dom/vnode/handle-thunk.js","webpack:///./~/virtual-dom/vnode/is-thunk.js","webpack:///./~/event-emitter/index.js","webpack:///./~/d/index.js","webpack:///./~/type/value/is.js","webpack:///./~/type/plain-function/is.js","webpack:///./~/type/function/is.js","webpack:///./~/type/prototype/is.js","webpack:///./~/type/object/is.js","webpack:///./~/es5-ext/object/assign/index.js","webpack:///./~/es5-ext/object/assign/is-implemented.js","webpack:///./~/es5-ext/object/assign/shim.js","webpack:///./~/es5-ext/object/keys/index.js","webpack:///./~/es5-ext/object/keys/is-implemented.js","webpack:///./~/es5-ext/object/keys/shim.js","webpack:///./~/es5-ext/object/is-value.js","webpack:///./~/es5-ext/function/noop.js","webpack:///./~/es5-ext/object/valid-value.js","webpack:///./~/es5-ext/object/normalize-options.js","webpack:///./~/es5-ext/string/#/contains/index.js","webpack:///./~/es5-ext/string/#/contains/is-implemented.js","webpack:///./~/es5-ext/string/#/contains/shim.js","webpack:///./~/es5-ext/object/valid-callable.js","webpack:///./src/Playlist.js","webpack:///./~/virtual-dom/h.js","webpack:///./~/virtual-dom/virtual-hyperscript/index.js","webpack:///./~/x-is-array/index.js","webpack:///./~/virtual-dom/vnode/vnode.js","webpack:///./~/virtual-dom/vnode/vtext.js","webpack:///./~/virtual-dom/virtual-hyperscript/parse-tag.js","webpack:///./~/browser-split/index.js","webpack:///./~/virtual-dom/virtual-hyperscript/hooks/soft-set-hook.js","webpack:///./~/virtual-dom/virtual-hyperscript/hooks/ev-hook.js","webpack:///./~/ev-store/index.js","webpack:///./~/individual/one-version.js","webpack:///./~/individual/index.js","webpack:///./~/virtual-dom/diff.js","webpack:///./~/virtual-dom/vtree/diff.js","webpack:///./~/virtual-dom/vnode/vpatch.js","webpack:///./~/virtual-dom/vtree/diff-props.js","webpack:///./~/virtual-dom/patch.js","webpack:///./~/virtual-dom/vdom/patch.js","webpack:///./~/virtual-dom/vdom/dom-index.js","webpack:///./~/virtual-dom/vdom/patch-op.js","webpack:///./~/virtual-dom/vdom/update-widget.js","webpack:///./~/inline-worker/index.js","webpack:///./src/utils/conversions.js","webpack:///./src/track/loader/LoaderFactory.js","webpack:///./src/track/loader/BlobLoader.js","webpack:///./src/track/loader/Loader.js","webpack:///./src/track/loader/IdentityLoader.js","webpack:///./src/track/loader/XHRLoader.js","webpack:///./src/render/ScrollHook.js","webpack:///./src/TimeScale.js","webpack:///./src/render/TimeScaleHook.js","webpack:///./src/Track.js","webpack:///./~/lodash.assign/index.js","webpack:///./~/lodash.forown/index.js","webpack:///./~/uuid/uuid.js","webpack:///./~/uuid/rng-browser.js","webpack:///./~/webaudio-peaks/index.js","webpack:///./~/fade-maker/index.js","webpack:///./~/fade-curves/index.js","webpack:///./src/track/states.js","webpack:///./src/track/states/CursorState.js","webpack:///./src/track/states/SelectState.js","webpack:///./src/track/states/ShiftState.js","webpack:///./src/track/states/FadeInState.js","webpack:///./src/track/states/FadeOutState.js","webpack:///./src/render/CanvasHook.js","webpack:///./src/render/FadeCanvasHook.js","webpack:///./src/render/VolumeSliderHook.js","webpack:///./src/render/StereoPanSliderHook.js","webpack:///./src/Playout.js","webpack:///./src/annotation/AnnotationList.js","webpack:///./src/annotation/input/aeneas.js","webpack:///./src/annotation/output/aeneas.js","webpack:///./src/interaction/DragInteraction.js","webpack:///./src/annotation/render/ScrollTopHook.js","webpack:///./src/utils/timeformat.js","webpack:///./src/utils/recorderWorker.js","webpack:///./src/utils/exportWavWorker.js"],"names":["init","options","ee","container","undefined","Error","window","OfflineAudioContext","webkitOfflineAudioContext","AudioContext","webkitAudioContext","audioContext","defaults","ac","sampleRate","samplesPerPixel","mono","fadeType","exclSolo","timescale","controls","show","width","widgets","muteOrSolo","volume","stereoPan","collapse","remove","colors","waveOutlineColor","timeColor","fadeColor","seekStyle","waveHeight","collapsedWaveHeight","state","zoomLevels","annotationList","annotations","editable","linkEndpoints","isContinuousPlay","isAutomaticScroll","config","zoomIndex","indexOf","playlist","Playlist","setSampleRate","setSamplesPerPixel","setAudioContext","setEventEmitter","setUpEventEmitter","setTimeSelection","setState","setControlOptions","setWaveHeight","setCollapsedWaveHeight","setColors","setZoomLevels","setZoomIndex","setMono","setExclSolo","setShowTimeScale","setSeekStyle","setAnnotations","linkedEndpoints","tree","render","rootNode","appendChild","tracks","soloedTracks","mutedTracks","collapsedTracks","playoutPromises","cursor","playbackSeconds","duration","scrollLeft","scrollTimer","showTimescale","isScrolling","masterGain","durationFormat","resetDrawTimer","exportWorker","InlineWorker","ExportWavWorkerFunction","stream","mediaRecorder","MediaRecorder","onstart","track","Track","setName","setEnabledStates","recordingTrack","push","chunks","working","ondataavailable","e","data","recording","Blob","type","loader","LoaderFactory","createLoader","load","then","audioBuffer","recorderWorker","postMessage","samples","getChannelData","setCues","setBuffer","setPlayout","Playout","adjustDuration","catch","onstop","RecorderWorkerFunction","onmessage","setPeaks","drawRequest","style","controlOptions","height","AnnotationList","on","val","format","start","end","isPlaying","lastSeeked","pausedAt","restartPlayFrom","seek","emit","startOfflineRender","deltaTime","setStartTime","getStartTime","record","play","pause","stop","rewind","fastForward","clear","soloTrack","adjustTrackPlayout","muteTrack","removeTrack","opts","collapseTrack","setGainLevel","forEach","setMasterGainLevel","setFadeIn","setFadeOut","panvalue","setStereoPanValue","file","src","name","getActiveTrack","timeSelection","getTimeSelection","trim","calculatePeaks","Math","max","zoom","setZoom","min","length","clearTimeout","setTimeout","trackList","loadPromises","map","trackInfo","Promise","all","audioBuffers","index","info","states","fadeIn","fadeOut","cueIn","cuein","cueOut","cueout","gain","muted","soloed","selection","selected","peaks","customClass","playout","setCustomClass","setWaveOutlineColor","shape","setActiveTrack","setPeakData","getState","concat","draw","activeTrack","isRendering","offlineAudioContext","currentTime","setOfflinePlayout","buffer","schedulePlay","shouldPlay","shouldTrackPlay","isOffline","startRendering","command","levels","splice","collapsed","scheduleStop","trackLists","list","setShouldPlay","reduce","getEndTime","cursorPos","getElapsedTime","lastPlay","stopAnimation","editor","bind","startTime","endTime","startAnimation","getCurrentTime","playbackReset","viewDuration","lastDraw","animationRequest","requestAnimationFrame","updateEditor","cancelAnimationFrame","getSeekStyle","elapsed","isSegmentSelection","newTree","patches","clientWidth","resolution","isActive","playlistLength","controlWidth","timeScale","TimeScale","trackElements","getTrackRenderData","isActiveTrack","attributes","onscroll","target","hook","ScrollHook","containerChildren","renderTimeScale","renderTrackSection","renderAnnotations","getTrackDetails","samplesToSeconds","secondsToSamples","samplesToPixels","pixelsToSamples","pixelsToSeconds","secondsToPixels","seconds","ceil","floor","pixels","BlobLoader","AudioBuffer","IdentityLoader","XHRLoader","resolve","reject","match","fr","FileReader","readAsArrayBuffer","addEventListener","decoderPromise","Loader","STATE_UNINITIALIZED","STATE_LOADING","STATE_DECODING","STATE_FINISHED","audioRequestState","percentComplete","setStateChange","lengthComputable","loaded","total","audioData","response","result","decodeAudioData","err","xhr","XMLHttpRequest","open","responseType","send","node","el","rect","getBoundingClientRect","timePoint","left","offset","marginLeft","timeinfo","marker","bigStep","smallStep","secondStep","keys","Object","parseInt","item","sort","a","b","i","widthX","pixPerSec","pixOffset","scaleInfo","getScaleInfo","canvasInfo","timeMarkers","counter","pixIndex","pix","formatTime","TimeScaleHook","milliseconds","s","m","tickInfo","canvas","prop","prev","ctx","getContext","clearRect","fillStyle","x","scaleHeight","scaleY","fillRect","MAX_CANVAS_WIDTH","fades","peakData","className","color","trackStart","trackEnd","offlinePlayout","enabledStates","defaultStatesEnabled","fadein","fadeout","select","shift","fade","removeFade","saveFade","FADEIN","FADEOUT","id","uuid","v4","StateClass","stateClasses","stateObj","bool","level","setVolumeGainLevel","value","now","when","segment","defaultOptions","playoutSystem","relPos","sourcePromise","setUpSource","fadeStart","fadeDuration","applyFadeIn","applyFadeOut","channelPixels","overlayClass","setup","events","getEvents","event","getClass","muteClass","soloClass","isCollapsed","numChan","title","onclick","trackName","headerChildren","VolumeSliderHook","oninput","StereoPanSliderHook","playbackX","startX","endX","progressWidth","scale","devicePixelRatio","waveformChildren","channels","channelNum","channelChildren","totalWidth","currentWidth","canvasColor","CanvasHook","bits","fadeWidth","FadeCanvasHook","renderOverlay","cStartX","cEndX","cWidth","cClassName","waveform","channelMargin","renderControls","audibleClass","preventDefault","offsetX","active","minX","maxX","emitSelection","complete","deltaX","prevX","emitShift","time","len","cc","h2","maxValue","save","minPeak","maxPeak","drawFrame","restore","abs","curve","createCurve","y","strokeStyle","beginPath","moveTo","lineTo","stroke","reflection","SCURVE","LINEAR","EXPONENTIAL","LOGARITHMIC","volumeInput","stereoPanInput","panOrientation","percentage","destination","createStereoPanner","createPanner","fadeGain","applyFade","source","createBufferSource","onended","disconnect","volumeGain","shouldPlayGain","panner","createGain","connect","pan","panningModel","setPosition","resizeHandlers","setupInteractions","setupEE","leftShift","DragInteraction","direction","rightShift","annotationIndex","note","originalVal","export","output","dataStr","encodeURIComponent","JSON","stringify","document","createElement","body","href","download","click","removeChild","draggable","handler","that","ctrl","class","action","boxes","renderResizeLeft","renderResizeRight","boxesWrapper","text","ScrollTopHook","segmentClass","editableConfig","contenteditable","lines","innerText","onkeypress","which","keyCode","blur","linesConfig","aeneas","annotation","Number","begin","lang","language","String","toFixed","ondragover","emitDrag","clientX","removeEventListener","ev","dataTransfer","dropEffect","effectAllowed","setData","Hook","prototype","querySelector","box","row","diff","top","scrollTop","clockFormat","decimals","hours","minutes","secs","sHours","sMinutes","sSeconds","formats","thousandths","hhmmss","hhmmssu","hhmmssuu","hhmmssuuu","findMinMax","array","Infinity","curr","convert","n","v","extractPeaks","channel","chanLength","numPeaks","extrema","self","subarray","audioPeaks","recLength","recBuffersL","recBuffersR","inputBuffer","writeString","view","string","setUint8","charCodeAt","floatTo16BitPCM","input","writeOffset","setInt16","encodeWAV","ArrayBuffer","DataView","setUint32","setUint16","mergeBuffers","recBuffers","Float32Array","set","interleave","inputL","inputR","inputIndex","exportWAV","bufferL","bufferR","interleaved","dataview","audioBlob"],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;SChCgBA,I,GAAAA,I;;mBA0FD,YAA6C;AAAA,OAAnCC,OAAmC,uEAAzB,EAAyB;AAAA,OAArBC,EAAqB,uEAAhB,6BAAgB;;AAC1D,UAAOF,KAAKC,OAAL,EAAcC,EAAd,CAAP;AACD,E;;AAlGD;;;;AACA;;;;AACA;;;;AACA;;;;;;AAGO,UAASF,IAAT,GAAiD;AAAA,OAAnCC,OAAmC,uEAAzB,EAAyB;AAAA,OAArBC,EAAqB,uEAAhB,6BAAgB;;AACtD,OAAID,QAAQE,SAAR,KAAsBC,SAA1B,EAAqC;AACnC,WAAM,IAAIC,KAAJ,CAAU,sCAAV,CAAN;AACD;;AAEDC,UAAOC,mBAAP,GAA6BD,OAAOC,mBAAP,IAA8BD,OAAOE,yBAAlE;AACAF,UAAOG,YAAP,GAAsBH,OAAOG,YAAP,IAAuBH,OAAOI,kBAApD;;AAEA,OAAMC,eAAe,IAAIL,OAAOG,YAAX,EAArB;;AAEA,OAAMG,WAAW;AACfC,SAAIF,YADW;AAE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ACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAG;AACH,EAAC;;AAED;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,EAAE;AACb,YAAW,MAAM;AACjB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,YAAW,QAAQ;AACnB;AACA,IAAG;AACH,EAAC;;AAED;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,QAAQ;AACnB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,YAAY;AACvB,cAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,QAAQ;AACnB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,MAAM;AACjB,YAAW,MAAM;AACjB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB,YAAW,OAAO,WAAW;AAC7B,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA,yBAAwB;;AAExB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,YAAW,QAAQ;AACnB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,EAAE;AACb,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB;AACA,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,EAAE;AACb,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,kBAAiB;AACjB,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA,8BAA6B,kBAAkB,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA,+CAA8C,kBAAkB,EAAE;AAClE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAoB,iBAAiB;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,SAAS;AACtB,WAAU;AACV;AACA,cAAa,SAAS;AACtB,WAAU;AACV;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,UAAU;AACrB,cAAa,OAAO;AACpB;AACA;AACA;AACA,oBAAmB,OAAO,SAAS,EAAE,GAAG,OAAO,iBAAiB,EAAE;AAClE,WAAU,OAAO,iBAAiB;AAClC;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,UAAU;AACrB,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAiB;AACjB,iBAAgB;AAChB;AACA;AACA,WAAU;AACV;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,SAAS;AACtB;AACA;AACA,yCAAwC,SAAS;AACjD;AACA;AACA,YAAW,SAAS,GAAG,SAAS;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,EAAE;AACf;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;ACx+DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;ACTA;;AAEA;;;;;;;ACFA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA,oBAAmB,qBAAqB;AACxC;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;AC7CA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,EAAC;AACD;;AAEA;AACA;AACA;AACA;;AAEA;;;;;;;;AChBA,gB;;;;;;ACAA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,cAAa;AACb;AACA,cAAa;AACb;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,cAAa;AACb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;;;;;;;AChGA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;ACNA;;AAEA;;AAEA;AACA;AACA;;;;;;;ACNA;;;;;;;ACAA;;AAEA;;AAEA;AACA;AACA;;;;;;;ACNA;;AAEA;AACA;AACA;;;;;;;ACJA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;ACvCA;;AAEA;AACA;AACA;;;;;;;ACJA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAkB;;AAElB;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAE;;AAEF;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAa,4BAA4B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,cAAa,OAAO;;AAEpB;AACA,cAAa,2BAA2B;AACxC;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,2BAA0B;;AAE1B;AACA;AACA;AACA;;;;;;;ACnIA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;;AAEA,UAAS;AACT;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA,GAAE;AACF;AACA,GAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;;AAEA,UAAS;AACT;AACA;;;;;;;AC7DA;;AAEA;AACA;;AAEA,oCAAmC,+CAA+C;;;;;;;ACLlF;;AAEA;;AAEA,6BAA4B,EAAE;;AAE9B;AACA;AACA;AACA;AACA;;;;;;;ACVA;;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;;AAEDD,yBAAkB/K,IAAlB,CAAuB,KAAKiL,kBAAL,EAAvB;;AAEA,WAAI,KAAK9O,cAAL,CAAoB+I,MAAxB,EAAgC;AAC9B6F,2BAAkB/K,IAAlB,CAAuB,KAAKkL,iBAAL,EAAvB;AACD;;AAED,cAAO,iBAAE,cAAF,EACL;AACER,qBAAY;AACV5I,kBAAO;AADG;AADd,QADK,EAMLiJ,iBANK,CAAP;AAQD;;;+BAES;AACR,WAAMlF,OAAO,EAAb;;AAEA,YAAKxH,MAAL,CAAY0F,OAAZ,CAAoB,UAACpE,KAAD,EAAW;AAC7BkG,cAAK7F,IAAL,CAAUL,MAAMwL,eAAN,EAAV;AACD,QAFD;;AAIA,cAAOtF,IAAP;AACD;;;;;;;;;;;;AC98BH;;AAEA;;;;;;;ACFA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA,MAAK;AACL,wBAAuB,cAAc;AACrC;AACA;AACA,MAAK;AACL;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;;;;;;ACxIA;AACA;;AAEA;;AAEA;AACA;AACA;;;;;;;ACPA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAmB,WAAW;AAC9B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;ACvEA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;ACTA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA,gBAAe,qBAAqB;AACpC;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;ACrDA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,cAAc;AACzB,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAqD;AACrD;AACA;AACA;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA2B,0BAA0B;AACrD;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA8B;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA,EAAC;;;;;;;ACzGD;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;;;;;;AChBA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;AC1BA;;AAEA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;ACnBA;;AAEA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;ACrBA;;AAEA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;;;;;;;AClBA;;AAEA;;;;;;;ACFA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA,kBAAiB;AACjB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,MAAK;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA,UAAS;AACT;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAmB,SAAS;AAC5B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA,wBAAuB,SAAS;AAChC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,4BAA2B,SAAS;AACpC;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,sBAAsB;AAC1C;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,cAAa;AACb;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,oBAAmB,sBAAsB;AACzC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAmB,sBAAsB;AACzC;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2CAA0C,2BAA2B;AACrE;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAsC,2BAA2B;AACjE;AACA;AACA;AACA,mCAAkC,2BAA2B;AAC7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,oBAAmB,YAAY;AAC/B;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA,MAAK;AACL;AACA;AACA;;;;;;;AC1aA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;ACrBA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA,cAAa;AACb;AACA;AACA,cAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,IAAG;AACH;AACA,IAAG;AACH;AACA;AACA;;;;;;;ACzDA;;AAEA;;;;;;;ACFA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA,oBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,wBAAuB,sBAAsB;AAC7C;;AAEA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;AC/EA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;;;AAGA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;AAEA,4BAA2B,0BAA0B;AACrD;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;;;;;ACpFA;;AAEA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,MAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,oBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAmB,0BAA0B;AAC7C;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;ACtJA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;;;;;;;ACdA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,0CAAyC,WAAW;AACpD;;AAEA;AACA,0CAAyC,0BAA0B;AACnE;AACA;;AAEA;AACA;AACA,wBAAuB,aAAa;AACpC,M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AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,EAAE;AACb,YAAW,MAAM;AACjB,cAAa,EAAE;AACf;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,kDAAiD,eAAe;;AAEhE;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,QAAQ;AACnB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,EAAE;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,OAAO;AAClB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,MAAM;AACjB,YAAW,OAAO,WAAW;AAC7B,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA,yBAAwB;;AAExB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,IAAG;AACH;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,EAAE;AACb,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,kBAAiB;AACjB,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA,8BAA6B,kBAAkB,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,UAAU;AACrB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,SAAS;AACtB,WAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,EAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;AC5nBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,cAAa,MAAM;AACnB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,QAAQ;AACnB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,QAAQ;AACnB,cAAa,SAAS;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,YAAW,OAAO;AAClB,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA,8BAA6B,kBAAkB,EAAE;AACjD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,iBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,QAAQ;AACrB;AACA;AACA,qBAAoB;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,SAAS;AACpB,cAAa,OAAO;AACpB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAI;AACJ;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,cAAa,MAAM;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW,EAAE;AACb,cAAa,EAAE;AACf;AACA;AACA,kBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;ACrfA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,gBAAe,SAAS;AACxB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qCAAoC,EAAE;AACtC,mBAAkB;AAClB;AACA;AACA,IAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,oCAAmC;AACnC;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,kBAAiB,OAAO;AACxB;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,qBAAoB,SAAS;AAC7B;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;ACrLA;;AAEA,+CAA8C;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAsB,QAAQ;AAC9B;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;;;;;;;;AC9BA;;AAEA;AACA;AACA;AACA,WAAU,WAAW;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,UAAS,SAAS;AAClB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAU,OAAO;AACjB,WAAU,OAAO;AACjB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAU,WAAW;AACrB,WAAU,OAAO;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,a;AACA;AACA;;AAEA;AACA,gDAA+C,KAAK;;AAEpD,gBAAe,cAAc;;AAE7B;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gDAA+C,KAAK;;;AAGpD,gBAAe,cAAc;AAC7B;AACA;;AAEA,oBAAmB,aAAa;AAChC;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,WAAU,uBAAuB;AACjC,WAAU,OAAO;AACjB,WAAU,OAAO;AACjB,WAAU,OAAO;AACjB;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,oBAAmB,aAAa;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,G;;;;;;AC1JA;;AAEA;AACA;AACA,EAAC;AACD;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;AC/FA;;AAEA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAe,YAAY;AAC3B;;AAEA;AACA;AACA,UAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAe,YAAY;AAC3B;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,gBAAe,YAAY;AAC3B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,gBAAe,YAAY;AAC3B;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;;;;;;;;;;;;ACzEA;;;;AACA;;;;AACA;;;;AACA;;;;AACA;;;;;;mBAEe;AACbnH,gCADa;AAEbiT,gCAFa;AAGbC,8BAHa;AAI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AAd;AACD;;AAEDre,eAAY,SAASA,SAAT,CAAmBvB,CAAnB,EAAsB;AAChC,aAAQA,EAAEC,IAAF,CAAO2H,OAAf;AACE,YAAK,MAAL;AAAa;AACXnO,gBAAKuG,EAAEC,IAAF,CAAO5D,MAAZ;AACA;AACD;AACD,YAAK,QAAL;AAAe;AACbwG,kBAAO7C,EAAEC,IAAF,CAAOqH,MAAd;AACA;AACD;AACD,YAAK,WAAL;AAAkB;AAChB8Z,qBAAUphB,EAAEC,IAAF,CAAOG,IAAjB;AACA;AACD;AACD,YAAK,OAAL;AAAc;AACZ+C;AACA;AACD;AACD;AAAS;AACP,iBAAM,IAAIrJ,KAAJ,CAAU,+BAAV,CAAN;AACD;AAnBH;AAqBD,IAtBD;AAuBD,E","file":"waveform-playlist.var.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/waveform-playlist/js/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 08ec2b81ea5f7a7ee369","import _defaults from 'lodash.defaultsdeep';\nimport createElement from 'virtual-dom/create-element';\nimport EventEmitter from 'event-emitter';\nimport Playlist from './Playlist';\n\n\nexport function init(options = {}, ee = EventEmitter()) {\n if (options.container === undefined) {\n throw new Error('DOM element container must be given.');\n }\n\n window.OfflineAudioContext = window.OfflineAudioContext || window.webkitOfflineAudioContext;\n window.AudioContext = window.AudioContext || window.webkitAudioContext;\n\n const audioContext = new window.AudioContext();\n\n const defaults = {\n ac: audioContext,\n sampleRate: audioContext.sampleRate,\n samplesPerPixel: 4096,\n mono: true,\n fadeType: 'logarithmic',\n exclSolo: false,\n timescale: false,\n controls: {\n show: false,\n width: 150,\n widgets: {\n muteOrSolo: true,\n volume: true,\n stereoPan: true,\n collapse: true,\n remove: true,\n },\n },\n colors: {\n waveOutlineColor: 'white',\n timeColor: 'grey',\n fadeColor: 'black',\n },\n seekStyle: 'line',\n waveHeight: 128,\n collapsedWaveHeight: 30,\n state: 'cursor',\n zoomLevels: [512, 1024, 2048, 4096],\n annotationList: {\n annotations: [],\n controls: [],\n editable: false,\n linkEndpoints: false,\n isContinuousPlay: false,\n },\n isAutomaticScroll: false,\n };\n\n const config = _defaults({}, options, defaults);\n const zoomIndex = config.zoomLevels.indexOf(config.samplesPerPixel);\n\n if (zoomIndex === -1) {\n throw new Error('initial samplesPerPixel must be included in array zoomLevels');\n }\n\n const playlist = new Playlist();\n playlist.setSampleRate(config.sampleRate);\n playlist.setSamplesPerPixel(config.samplesPerPixel);\n playlist.setAudioContext(config.ac);\n playlist.setEventEmitter(ee);\n playlist.setUpEventEmitter();\n playlist.setTimeSelection(0, 0);\n playlist.setState(config.state);\n playlist.setControlOptions(config.controls);\n playlist.setWaveHeight(config.waveHeight);\n playlist.setCollapsedWaveHeight(config.collapsedWaveHeight);\n playlist.setColors(config.colors);\n playlist.setZoomLevels(config.zoomLevels);\n playlist.setZoomIndex(zoomIndex);\n playlist.setMono(config.mono);\n playlist.setExclSolo(config.exclSolo);\n playlist.setShowTimeScale(config.timescale);\n playlist.setSeekStyle(config.seekStyle);\n playlist.setAnnotations(config.annotationList);\n playlist.isAutomaticScroll = config.isAutomaticScroll;\n playlist.isContinuousPlay = config.isContinuousPlay;\n playlist.linkedEndpoints = config.linkedEndpoints;\n\n // take care of initial virtual dom rendering.\n const tree = playlist.render();\n const rootNode = createElement(tree);\n\n config.container.appendChild(rootNode);\n playlist.tree = tree;\n playlist.rootNode = rootNode;\n\n return playlist;\n}\n\nexport default function (options = {}, ee = EventEmitter()) {\n return init(options, ee);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/app.js","/**\n * Lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright OpenJS Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n asyncTag = '[object AsyncFunction]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n nullTag = '[object Null]',\n objectTag = '[object Object]',\n proxyTag = '[object Proxy]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n undefinedTag = '[object Undefined]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n Symbol = root.Symbol,\n Uint8Array = root.Uint8Array,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined,\n getPrototype = overArg(Object.getPrototypeOf, Object),\n objectCreate = Object.create,\n propertyIsEnumerable = objectProto.propertyIsEnumerable,\n splice = arrayProto.splice,\n symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined,\n nativeMax = Math.max,\n nativeNow = Date.now;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\n/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\n/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\n/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\n/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source\n * objects into destination objects that are passed thru.\n *\n * @private\n * @param {*} objValue The destination value.\n * @param {*} srcValue The source value.\n * @param {string} key The key of the property to merge.\n * @param {Object} object The parent object of `objValue`.\n * @param {Object} source The parent object of `srcValue`.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n * @returns {*} Returns the value to assign.\n */\nfunction customDefaultsMerge(objValue, srcValue, key, object, source, stack) {\n if (isObject(objValue) && isObject(srcValue)) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, objValue);\n baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack);\n stack['delete'](srcValue);\n }\n return objValue;\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\n/**\n * This method is like `_.defaults` except that it recursively assigns\n * default properties.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 3.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.defaults\n * @example\n *\n * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } });\n * // => { 'a': { 'b': 2, 'c': 3 } }\n */\nvar defaultsDeep = baseRest(function(args) {\n args.push(undefined, customDefaultsMerge);\n return apply(mergeWith, undefined, args);\n});\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\n/**\n * This method is like `_.merge` except that it accepts `customizer` which\n * is invoked to produce the merged values of the destination and source\n * properties. If `customizer` returns `undefined`, merging is handled by the\n * method instead. The `customizer` is invoked with six arguments:\n * (objValue, srcValue, key, object, source, stack).\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} sources The source objects.\n * @param {Function} customizer The function to customize assigned values.\n * @returns {Object} Returns `object`.\n * @example\n *\n * function customizer(objValue, srcValue) {\n * if (_.isArray(objValue)) {\n * return objValue.concat(srcValue);\n * }\n * }\n *\n * var object = { 'a': [1], 'b': [2] };\n * var other = { 'a': [3], 'b': [4] };\n *\n * _.mergeWith(object, other, customizer);\n * // => { 'a': [1, 3], 'b': [2, 4] }\n */\nvar mergeWith = createAssigner(function(object, source, srcIndex, customizer) {\n baseMerge(object, source, srcIndex, customizer);\n});\n\n/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\n/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = defaultsDeep;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.defaultsdeep/index.js\n// module id = 1\n// module chunks = 0","module.exports = function(module) {\r\n\tif(!module.webpackPolyfill) {\r\n\t\tmodule.deprecate = function() {};\r\n\t\tmodule.paths = [];\r\n\t\t// module.parent = undefined by default\r\n\t\tmodule.children = [];\r\n\t\tmodule.webpackPolyfill = 1;\r\n\t}\r\n\treturn module;\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// (webpack)/buildin/module.js\n// module id = 2\n// module chunks = 0","var createElement = require(\"./vdom/create-element.js\")\n\nmodule.exports = createElement\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/create-element.js\n// module id = 3\n// module chunks = 0","var document = require(\"global/document\")\n\nvar applyProperties = require(\"./apply-properties\")\n\nvar isVNode = require(\"../vnode/is-vnode.js\")\nvar isVText = require(\"../vnode/is-vtext.js\")\nvar isWidget = require(\"../vnode/is-widget.js\")\nvar handleThunk = require(\"../vnode/handle-thunk.js\")\n\nmodule.exports = createElement\n\nfunction createElement(vnode, opts) {\n var doc = opts ? opts.document || document : document\n var warn = opts ? opts.warn : null\n\n vnode = handleThunk(vnode).a\n\n if (isWidget(vnode)) {\n return vnode.init()\n } else if (isVText(vnode)) {\n return doc.createTextNode(vnode.text)\n } else if (!isVNode(vnode)) {\n if (warn) {\n warn(\"Item is not a valid virtual dom node\", vnode)\n }\n return null\n }\n\n var node = (vnode.namespace === null) ?\n doc.createElement(vnode.tagName) :\n doc.createElementNS(vnode.namespace, vnode.tagName)\n\n var props = vnode.properties\n applyProperties(node, props)\n\n var children = vnode.children\n\n for (var i = 0; i < children.length; i++) {\n var childNode = createElement(children[i], opts)\n if (childNode) {\n node.appendChild(childNode)\n }\n }\n\n return node\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vdom/create-element.js\n// module id = 4\n// module chunks = 0","var topLevel = typeof global !== 'undefined' ? global :\n typeof window !== 'undefined' ? window : {}\nvar minDoc = require('min-document');\n\nvar doccy;\n\nif (typeof document !== 'undefined') {\n doccy = document;\n} else {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'];\n\n if (!doccy) {\n doccy = topLevel['__GLOBAL_DOCUMENT_CACHE@4'] = minDoc;\n }\n}\n\nmodule.exports = doccy;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/global/document.js\n// module id = 5\n// module chunks = 0","/* (ignored) */\n\n\n//////////////////\n// WEBPACK FOOTER\n// min-document (ignored)\n// module id = 6\n// module chunks = 0","var isObject = require(\"is-object\")\nvar isHook = require(\"../vnode/is-vhook.js\")\n\nmodule.exports = applyProperties\n\nfunction applyProperties(node, props, previous) {\n for (var propName in props) {\n var propValue = props[propName]\n\n if (propValue === undefined) {\n removeProperty(node, propName, propValue, previous);\n } else if (isHook(propValue)) {\n removeProperty(node, propName, propValue, previous)\n if (propValue.hook) {\n propValue.hook(node,\n propName,\n previous ? previous[propName] : undefined)\n }\n } else {\n if (isObject(propValue)) {\n patchObject(node, props, previous, propName, propValue);\n } else {\n node[propName] = propValue\n }\n }\n }\n}\n\nfunction removeProperty(node, propName, propValue, previous) {\n if (previous) {\n var previousValue = previous[propName]\n\n if (!isHook(previousValue)) {\n if (propName === \"attributes\") {\n for (var attrName in previousValue) {\n node.removeAttribute(attrName)\n }\n } else if (propName === \"style\") {\n for (var i in previousValue) {\n node.style[i] = \"\"\n }\n } else if (typeof previousValue === \"string\") {\n node[propName] = \"\"\n } else {\n node[propName] = null\n }\n } else if (previousValue.unhook) {\n previousValue.unhook(node, propName, propValue)\n }\n }\n}\n\nfunction patchObject(node, props, previous, propName, propValue) {\n var previousValue = previous ? previous[propName] : undefined\n\n // Set attributes\n if (propName === \"attributes\") {\n for (var attrName in propValue) {\n var attrValue = propValue[attrName]\n\n if (attrValue === undefined) {\n node.removeAttribute(attrName)\n } else {\n node.setAttribute(attrName, attrValue)\n }\n }\n\n return\n }\n\n if(previousValue && isObject(previousValue) &&\n getPrototype(previousValue) !== getPrototype(propValue)) {\n node[propName] = propValue\n return\n }\n\n if (!isObject(node[propName])) {\n node[propName] = {}\n }\n\n var replacer = propName === \"style\" ? \"\" : undefined\n\n for (var k in propValue) {\n var value = propValue[k]\n node[propName][k] = (value === undefined) ? replacer : value\n }\n}\n\nfunction getPrototype(value) {\n if (Object.getPrototypeOf) {\n return Object.getPrototypeOf(value)\n } else if (value.__proto__) {\n return value.__proto__\n } else if (value.constructor) {\n return value.constructor.prototype\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vdom/apply-properties.js\n// module id = 7\n// module chunks = 0","\"use strict\";\n\nmodule.exports = function isObject(x) {\n\treturn typeof x === \"object\" && x !== null;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-object/index.js\n// module id = 8\n// module chunks = 0","module.exports = isHook\n\nfunction isHook(hook) {\n return hook &&\n (typeof hook.hook === \"function\" && !hook.hasOwnProperty(\"hook\") ||\n typeof hook.unhook === \"function\" && !hook.hasOwnProperty(\"unhook\"))\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/is-vhook.js\n// module id = 9\n// module chunks = 0","var version = require(\"./version\")\n\nmodule.exports = isVirtualNode\n\nfunction isVirtualNode(x) {\n return x && x.type === \"VirtualNode\" && x.version === version\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/is-vnode.js\n// module id = 10\n// module chunks = 0","module.exports = \"2\"\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/version.js\n// module id = 11\n// module chunks = 0","var version = require(\"./version\")\n\nmodule.exports = isVirtualText\n\nfunction isVirtualText(x) {\n return x && x.type === \"VirtualText\" && x.version === version\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/is-vtext.js\n// module id = 12\n// module chunks = 0","module.exports = isWidget\n\nfunction isWidget(w) {\n return w && w.type === \"Widget\"\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/is-widget.js\n// module id = 13\n// module chunks = 0","var isVNode = require(\"./is-vnode\")\nvar isVText = require(\"./is-vtext\")\nvar isWidget = require(\"./is-widget\")\nvar isThunk = require(\"./is-thunk\")\n\nmodule.exports = handleThunk\n\nfunction handleThunk(a, b) {\n var renderedA = a\n var renderedB = b\n\n if (isThunk(b)) {\n renderedB = renderThunk(b, a)\n }\n\n if (isThunk(a)) {\n renderedA = renderThunk(a, null)\n }\n\n return {\n a: renderedA,\n b: renderedB\n }\n}\n\nfunction renderThunk(thunk, previous) {\n var renderedThunk = thunk.vnode\n\n if (!renderedThunk) {\n renderedThunk = thunk.vnode = thunk.render(previous)\n }\n\n if (!(isVNode(renderedThunk) ||\n isVText(renderedThunk) ||\n isWidget(renderedThunk))) {\n throw new Error(\"thunk did not return a valid node\");\n }\n\n return renderedThunk\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/handle-thunk.js\n// module id = 14\n// module chunks = 0","module.exports = isThunk\r\n\r\nfunction isThunk(t) {\r\n return t && t.type === \"Thunk\"\r\n}\r\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/is-thunk.js\n// module id = 15\n// module chunks = 0","'use strict';\n\nvar d = require('d')\n , callable = require('es5-ext/object/valid-callable')\n\n , apply = Function.prototype.apply, call = Function.prototype.call\n , create = Object.create, defineProperty = Object.defineProperty\n , defineProperties = Object.defineProperties\n , hasOwnProperty = Object.prototype.hasOwnProperty\n , descriptor = { configurable: true, enumerable: false, writable: true }\n\n , on, once, off, emit, methods, descriptors, base;\n\non = function (type, listener) {\n\tvar data;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) {\n\t\tdata = descriptor.value = create(null);\n\t\tdefineProperty(this, '__ee__', descriptor);\n\t\tdescriptor.value = null;\n\t} else {\n\t\tdata = this.__ee__;\n\t}\n\tif (!data[type]) data[type] = listener;\n\telse if (typeof data[type] === 'object') data[type].push(listener);\n\telse data[type] = [data[type], listener];\n\n\treturn this;\n};\n\nonce = function (type, listener) {\n\tvar once, self;\n\n\tcallable(listener);\n\tself = this;\n\ton.call(this, type, once = function () {\n\t\toff.call(self, type, once);\n\t\tapply.call(listener, this, arguments);\n\t});\n\n\tonce.__eeOnceListener__ = listener;\n\treturn this;\n};\n\noff = function (type, listener) {\n\tvar data, listeners, candidate, i;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return this;\n\tdata = this.__ee__;\n\tif (!data[type]) return this;\n\tlisteners = data[type];\n\n\tif (typeof listeners === 'object') {\n\t\tfor (i = 0; (candidate = listeners[i]); ++i) {\n\t\t\tif ((candidate === listener) ||\n\t\t\t\t\t(candidate.__eeOnceListener__ === listener)) {\n\t\t\t\tif (listeners.length === 2) data[type] = listeners[i ? 0 : 1];\n\t\t\t\telse listeners.splice(i, 1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ((listeners === listener) ||\n\t\t\t\t(listeners.__eeOnceListener__ === listener)) {\n\t\t\tdelete data[type];\n\t\t}\n\t}\n\n\treturn this;\n};\n\nemit = function (type) {\n\tvar i, l, listener, listeners, args;\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return;\n\tlisteners = this.__ee__[type];\n\tif (!listeners) return;\n\n\tif (typeof listeners === 'object') {\n\t\tl = arguments.length;\n\t\targs = new Array(l - 1);\n\t\tfor (i = 1; i < l; ++i) args[i - 1] = arguments[i];\n\n\t\tlisteners = listeners.slice();\n\t\tfor (i = 0; (listener = listeners[i]); ++i) {\n\t\t\tapply.call(listener, this, args);\n\t\t}\n\t} else {\n\t\tswitch (arguments.length) {\n\t\tcase 1:\n\t\t\tcall.call(listeners, this);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcall.call(listeners, this, arguments[1]);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcall.call(listeners, this, arguments[1], arguments[2]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tl = arguments.length;\n\t\t\targs = new Array(l - 1);\n\t\t\tfor (i = 1; i < l; ++i) {\n\t\t\t\targs[i - 1] = arguments[i];\n\t\t\t}\n\t\t\tapply.call(listeners, this, args);\n\t\t}\n\t}\n};\n\nmethods = {\n\ton: on,\n\tonce: once,\n\toff: off,\n\temit: emit\n};\n\ndescriptors = {\n\ton: d(on),\n\tonce: d(once),\n\toff: d(off),\n\temit: d(emit)\n};\n\nbase = defineProperties({}, descriptors);\n\nmodule.exports = exports = function (o) {\n\treturn (o == null) ? create(base) : defineProperties(Object(o), descriptors);\n};\nexports.methods = methods;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/event-emitter/index.js\n// module id = 16\n// module chunks = 0","\"use strict\";\n\nvar isValue = require(\"type/value/is\")\n , isPlainFunction = require(\"type/plain-function/is\")\n , assign = require(\"es5-ext/object/assign\")\n , normalizeOpts = require(\"es5-ext/object/normalize-options\")\n , contains = require(\"es5-ext/string/#/contains\");\n\nvar d = (module.exports = function (dscr, value/*, options*/) {\n\tvar c, e, w, options, desc;\n\tif (arguments.length < 2 || typeof dscr !== \"string\") {\n\t\toptions = value;\n\t\tvalue = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[2];\n\t}\n\tif (isValue(dscr)) {\n\t\tc = contains.call(dscr, \"c\");\n\t\te = contains.call(dscr, \"e\");\n\t\tw = contains.call(dscr, \"w\");\n\t} else {\n\t\tc = w = true;\n\t\te = false;\n\t}\n\n\tdesc = { value: value, configurable: c, enumerable: e, writable: w };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n});\n\nd.gs = function (dscr, get, set/*, options*/) {\n\tvar c, e, options, desc;\n\tif (typeof dscr !== \"string\") {\n\t\toptions = set;\n\t\tset = get;\n\t\tget = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[3];\n\t}\n\tif (!isValue(get)) {\n\t\tget = undefined;\n\t} else if (!isPlainFunction(get)) {\n\t\toptions = get;\n\t\tget = set = undefined;\n\t} else if (!isValue(set)) {\n\t\tset = undefined;\n\t} else if (!isPlainFunction(set)) {\n\t\toptions = set;\n\t\tset = undefined;\n\t}\n\tif (isValue(dscr)) {\n\t\tc = contains.call(dscr, \"c\");\n\t\te = contains.call(dscr, \"e\");\n\t} else {\n\t\tc = true;\n\t\te = false;\n\t}\n\n\tdesc = { get: get, set: set, configurable: c, enumerable: e };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/d/index.js\n// module id = 17\n// module chunks = 0","\"use strict\";\n\n// ES3 safe\nvar _undefined = void 0;\n\nmodule.exports = function (value) { return value !== _undefined && value !== null; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/type/value/is.js\n// module id = 18\n// module chunks = 0","\"use strict\";\n\nvar isFunction = require(\"../function/is\");\n\nvar classRe = /^\\s*class[\\s{/}]/, functionToString = Function.prototype.toString;\n\nmodule.exports = function (value) {\n\tif (!isFunction(value)) return false;\n\tif (classRe.test(functionToString.call(value))) return false;\n\treturn true;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/type/plain-function/is.js\n// module id = 19\n// module chunks = 0","\"use strict\";\n\nvar isPrototype = require(\"../prototype/is\");\n\nmodule.exports = function (value) {\n\tif (typeof value !== \"function\") return false;\n\n\tif (!hasOwnProperty.call(value, \"length\")) return false;\n\n\ttry {\n\t\tif (typeof value.length !== \"number\") return false;\n\t\tif (typeof value.call !== \"function\") return false;\n\t\tif (typeof value.apply !== \"function\") return false;\n\t} catch (error) {\n\t\treturn false;\n\t}\n\n\treturn !isPrototype(value);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/type/function/is.js\n// module id = 20\n// module chunks = 0","\"use strict\";\n\nvar isObject = require(\"../object/is\");\n\nmodule.exports = function (value) {\n\tif (!isObject(value)) return false;\n\ttry {\n\t\tif (!value.constructor) return false;\n\t\treturn value.constructor.prototype === value;\n\t} catch (error) {\n\t\treturn false;\n\t}\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/type/prototype/is.js\n// module id = 21\n// module chunks = 0","\"use strict\";\n\nvar isValue = require(\"../value/is\");\n\n// prettier-ignore\nvar possibleTypes = { \"object\": true, \"function\": true, \"undefined\": true /* document.all */ };\n\nmodule.exports = function (value) {\n\tif (!isValue(value)) return false;\n\treturn hasOwnProperty.call(possibleTypes, typeof value);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/type/object/is.js\n// module id = 22\n// module chunks = 0","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Object.assign : require(\"./shim\");\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/assign/index.js\n// module id = 23\n// module chunks = 0","\"use strict\";\n\nmodule.exports = function () {\n\tvar assign = Object.assign, obj;\n\tif (typeof assign !== \"function\") return false;\n\tobj = { foo: \"raz\" };\n\tassign(obj, { bar: \"dwa\" }, { trzy: \"trzy\" });\n\treturn obj.foo + obj.bar + obj.trzy === \"razdwatrzy\";\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/assign/is-implemented.js\n// module id = 24\n// module chunks = 0","\"use strict\";\n\nvar keys = require(\"../keys\")\n , value = require(\"../valid-value\")\n , max = Math.max;\n\nmodule.exports = function (dest, src/*, …srcn*/) {\n\tvar error, i, length = max(arguments.length, 2), assign;\n\tdest = Object(value(dest));\n\tassign = function (key) {\n\t\ttry {\n\t\t\tdest[key] = src[key];\n\t\t} catch (e) {\n\t\t\tif (!error) error = e;\n\t\t}\n\t};\n\tfor (i = 1; i < length; ++i) {\n\t\tsrc = arguments[i];\n\t\tkeys(src).forEach(assign);\n\t}\n\tif (error !== undefined) throw error;\n\treturn dest;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/assign/shim.js\n// module id = 25\n// module chunks = 0","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? Object.keys : require(\"./shim\");\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/keys/index.js\n// module id = 26\n// module chunks = 0","\"use strict\";\n\nmodule.exports = function () {\n\ttry {\n\t\tObject.keys(\"primitive\");\n\t\treturn true;\n\t} catch (e) {\n\t\treturn false;\n\t}\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/keys/is-implemented.js\n// module id = 27\n// module chunks = 0","\"use strict\";\n\nvar isValue = require(\"../is-value\");\n\nvar keys = Object.keys;\n\nmodule.exports = function (object) { return keys(isValue(object) ? Object(object) : object); };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/keys/shim.js\n// module id = 28\n// module chunks = 0","\"use strict\";\n\nvar _undefined = require(\"../function/noop\")(); // Support ES3 engines\n\nmodule.exports = function (val) { return val !== _undefined && val !== null; };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/is-value.js\n// module id = 29\n// module chunks = 0","\"use strict\";\n\n// eslint-disable-next-line no-empty-function\nmodule.exports = function () {};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/function/noop.js\n// module id = 30\n// module chunks = 0","\"use strict\";\n\nvar isValue = require(\"./is-value\");\n\nmodule.exports = function (value) {\n\tif (!isValue(value)) throw new TypeError(\"Cannot use null or undefined\");\n\treturn value;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/valid-value.js\n// module id = 31\n// module chunks = 0","\"use strict\";\n\nvar isValue = require(\"./is-value\");\n\nvar forEach = Array.prototype.forEach, create = Object.create;\n\nvar process = function (src, obj) {\n\tvar key;\n\tfor (key in src) obj[key] = src[key];\n};\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function (opts1/*, …options*/) {\n\tvar result = create(null);\n\tforEach.call(arguments, function (options) {\n\t\tif (!isValue(options)) return;\n\t\tprocess(Object(options), result);\n\t});\n\treturn result;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/normalize-options.js\n// module id = 32\n// module chunks = 0","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")() ? String.prototype.contains : require(\"./shim\");\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/string/#/contains/index.js\n// module id = 33\n// module chunks = 0","\"use strict\";\n\nvar str = \"razdwatrzy\";\n\nmodule.exports = function () {\n\tif (typeof str.contains !== \"function\") return false;\n\treturn str.contains(\"dwa\") === true && str.contains(\"foo\") === false;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/string/#/contains/is-implemented.js\n// module id = 34\n// module chunks = 0","\"use strict\";\n\nvar indexOf = String.prototype.indexOf;\n\nmodule.exports = function (searchString/*, position*/) {\n\treturn indexOf.call(this, searchString, arguments[1]) > -1;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/string/#/contains/shim.js\n// module id = 35\n// module chunks = 0","\"use strict\";\n\nmodule.exports = function (fn) {\n\tif (typeof fn !== \"function\") throw new TypeError(fn + \" is not a function\");\n\treturn fn;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/es5-ext/object/valid-callable.js\n// module id = 36\n// module chunks = 0","import _defaults from 'lodash.defaultsdeep';\n\nimport h from 'virtual-dom/h';\nimport diff from 'virtual-dom/diff';\nimport patch from 'virtual-dom/patch';\nimport InlineWorker from 'inline-worker';\n\nimport { pixelsToSeconds } from './utils/conversions';\nimport LoaderFactory from './track/loader/LoaderFactory';\nimport ScrollHook from './render/ScrollHook';\nimport TimeScale from './TimeScale';\nimport Track from './Track';\nimport Playout from './Playout';\nimport AnnotationList from './annotation/AnnotationList';\n\nimport RecorderWorkerFunction from './utils/recorderWorker';\nimport ExportWavWorkerFunction from './utils/exportWavWorker';\n\nexport default class {\n constructor() {\n this.tracks = [];\n this.soloedTracks = [];\n this.mutedTracks = [];\n this.collapsedTracks = [];\n this.playoutPromises = [];\n\n this.cursor = 0;\n this.playbackSeconds = 0;\n this.duration = 0;\n this.scrollLeft = 0;\n this.scrollTimer = undefined;\n this.showTimescale = false;\n // whether a user is scrolling the waveform\n this.isScrolling = false;\n\n this.fadeType = 'logarithmic';\n this.masterGain = 1;\n this.annotations = [];\n this.durationFormat = 'hh:mm:ss.uuu';\n this.isAutomaticScroll = false;\n this.resetDrawTimer = undefined;\n }\n\n // TODO extract into a plugin\n initExporter() {\n this.exportWorker = new InlineWorker(ExportWavWorkerFunction);\n }\n\n // TODO extract into a plugin\n initRecorder(stream) {\n this.mediaRecorder = new window.MediaRecorder(stream);\n\n this.mediaRecorder.onstart = () => {\n const track = new Track();\n track.setName('Recording');\n track.setEnabledStates();\n track.setEventEmitter(this.ee);\n\n this.recordingTrack = track;\n this.tracks.push(track);\n\n this.chunks = [];\n this.working = false;\n };\n\n this.mediaRecorder.ondataavailable = (e) => {\n this.chunks.push(e.data);\n\n // throttle peaks calculation\n if (!this.working) {\n const recording = new Blob(this.chunks, { type: 'audio/ogg; codecs=opus' });\n const loader = LoaderFactory.createLoader(recording, this.ac);\n loader.load().then((audioBuffer) => {\n // ask web worker for peaks.\n this.recorderWorker.postMessage({\n samples: audioBuffer.getChannelData(0),\n samplesPerPixel: this.samplesPerPixel,\n });\n this.recordingTrack.setCues(0, audioBuffer.duration);\n this.recordingTrack.setBuffer(audioBuffer);\n this.recordingTrack.setPlayout(new Playout(this.ac, audioBuffer));\n this.adjustDuration();\n }).catch(() => {\n this.working = false;\n });\n this.working = true;\n }\n };\n\n this.mediaRecorder.onstop = () => {\n this.chunks = [];\n this.working = false;\n };\n\n this.recorderWorker = new InlineWorker(RecorderWorkerFunction);\n // use a worker for calculating recording peaks.\n this.recorderWorker.onmessage = (e) => {\n this.recordingTrack.setPeaks(e.data);\n this.working = false;\n this.drawRequest();\n };\n }\n\n setShowTimeScale(show) {\n this.showTimescale = show;\n }\n\n setMono(mono) {\n this.mono = mono;\n }\n\n setExclSolo(exclSolo) {\n this.exclSolo = exclSolo;\n }\n\n setSeekStyle(style) {\n this.seekStyle = style;\n }\n\n getSeekStyle() {\n return this.seekStyle;\n }\n\n setSampleRate(sampleRate) {\n this.sampleRate = sampleRate;\n }\n\n setSamplesPerPixel(samplesPerPixel) {\n this.samplesPerPixel = samplesPerPixel;\n }\n\n setAudioContext(ac) {\n this.ac = ac;\n }\n\n setControlOptions(controlOptions) {\n this.controls = controlOptions;\n }\n\n setWaveHeight(height) {\n this.waveHeight = height;\n }\n\n setCollapsedWaveHeight(height) {\n this.collapsedWaveHeight = height;\n }\n\n setColors(colors) {\n this.colors = colors;\n }\n\n setAnnotations(config) {\n this.annotationList = new AnnotationList(\n this,\n config.annotations,\n config.controls,\n config.editable,\n config.linkEndpoints,\n config.isContinuousPlay,\n );\n }\n\n setEventEmitter(ee) {\n this.ee = ee;\n }\n\n getEventEmitter() {\n return this.ee;\n }\n\n setUpEventEmitter() {\n const ee = this.ee;\n\n ee.on('automaticscroll', (val) => {\n this.isAutomaticScroll = val;\n });\n\n ee.on('durationformat', (format) => {\n this.durationFormat = format;\n this.drawRequest();\n });\n\n ee.on('select', (start, end, track) => {\n if (this.isPlaying()) {\n this.lastSeeked = start;\n this.pausedAt = undefined;\n this.restartPlayFrom(start);\n } else {\n // reset if it was paused.\n this.seek(start, end, track);\n this.ee.emit('timeupdate', start);\n this.drawRequest();\n }\n });\n\n ee.on('startaudiorendering', (type) => {\n this.startOfflineRender(type);\n });\n\n ee.on('statechange', (state) => {\n this.setState(state);\n this.drawRequest();\n });\n\n ee.on('shift', (deltaTime, track) => {\n track.setStartTime(track.getStartTime() + deltaTime);\n this.adjustDuration();\n this.drawRequest();\n });\n\n ee.on('record', () => {\n this.record();\n });\n\n ee.on('play', (start, end) => {\n this.play(start, end);\n });\n\n ee.on('pause', () => {\n this.pause();\n });\n\n ee.on('stop', () => {\n this.stop();\n });\n\n ee.on('rewind', () => {\n this.rewind();\n });\n\n ee.on('fastforward', () => {\n this.fastForward();\n });\n\n ee.on('clear', () => {\n this.clear().then(() => {\n this.drawRequest();\n });\n });\n\n ee.on('solo', (track) => {\n this.soloTrack(track);\n this.adjustTrackPlayout();\n this.drawRequest();\n });\n\n ee.on('mute', (track) => {\n this.muteTrack(track);\n this.adjustTrackPlayout();\n this.drawRequest();\n });\n\n ee.on('removeTrack', (track) => {\n this.removeTrack(track);\n this.adjustTrackPlayout();\n this.drawRequest();\n });\n\n ee.on('changeTrackView', (track, opts) => {\n this.collapseTrack(track, opts);\n this.drawRequest();\n });\n\n ee.on('volumechange', (volume, track) => {\n track.setGainLevel(volume / 100);\n this.drawRequest();\n });\n\n ee.on('mastervolumechange', (volume) => {\n this.masterGain = volume / 100;\n this.tracks.forEach((track) => {\n track.setMasterGainLevel(this.masterGain);\n });\n });\n\n ee.on('fadein', (duration, track) => {\n track.setFadeIn(duration, this.fadeType);\n this.drawRequest();\n });\n\n ee.on('fadeout', (duration, track) => {\n track.setFadeOut(duration, this.fadeType);\n this.drawRequest();\n });\n\n ee.on('stereopan', (panvalue, track) => {\n track.setStereoPanValue(panvalue);\n this.drawRequest();\n });\n\n ee.on('fadetype', (type) => {\n this.fadeType = type;\n });\n\n ee.on('newtrack', (file) => {\n this.load([{\n src: file,\n name: file.name,\n }]);\n });\n\n ee.on('trim', () => {\n const track = this.getActiveTrack();\n const timeSelection = this.getTimeSelection();\n\n track.trim(timeSelection.start, timeSelection.end);\n track.calculatePeaks(this.samplesPerPixel, this.sampleRate);\n\n this.setTimeSelection(0, 0);\n this.drawRequest();\n });\n\n ee.on('zoomin', () => {\n const zoomIndex = Math.max(0, this.zoomIndex - 1);\n const zoom = this.zoomLevels[zoomIndex];\n\n if (zoom !== this.samplesPerPixel) {\n this.setZoom(zoom);\n this.drawRequest();\n }\n });\n\n ee.on('zoomout', () => {\n const zoomIndex = Math.min(this.zoomLevels.length - 1, this.zoomIndex + 1);\n const zoom = this.zoomLevels[zoomIndex];\n\n if (zoom !== this.samplesPerPixel) {\n this.setZoom(zoom);\n this.drawRequest();\n }\n });\n\n ee.on('scroll', () => {\n this.isScrolling = true;\n this.drawRequest();\n clearTimeout(this.scrollTimer);\n this.scrollTimer = setTimeout(() => {\n this.isScrolling = false;\n }, 200);\n });\n }\n\n load(trackList) {\n const loadPromises = trackList.map((trackInfo) => {\n const loader = LoaderFactory.createLoader(trackInfo.src, this.ac, this.ee);\n return loader.load();\n });\n\n return Promise.all(loadPromises).then((audioBuffers) => {\n this.ee.emit('audiosourcesloaded');\n\n const tracks = audioBuffers.map((audioBuffer, index) => {\n const info = trackList[index];\n const name = info.name || 'Untitled';\n const start = info.start || 0;\n const states = info.states || {};\n const fadeIn = info.fadeIn;\n const fadeOut = info.fadeOut;\n const cueIn = info.cuein || 0;\n const cueOut = info.cueout || audioBuffer.duration;\n const gain = info.gain || 1;\n const muted = info.muted || false;\n const soloed = info.soloed || false;\n const selection = info.selected;\n const peaks = info.peaks || { type: 'WebAudio', mono: this.mono };\n const customClass = info.customClass || undefined;\n const waveOutlineColor = info.waveOutlineColor || undefined;\n const stereoPan = info.stereoPan || 0;\n\n // webaudio specific playout for now.\n const playout = new Playout(this.ac, audioBuffer);\n\n const track = new Track();\n track.src = info.src;\n track.setBuffer(audioBuffer);\n track.setName(name);\n track.setEventEmitter(this.ee);\n track.setEnabledStates(states);\n track.setCues(cueIn, cueOut);\n track.setCustomClass(customClass);\n track.setWaveOutlineColor(waveOutlineColor);\n\n if (fadeIn !== undefined) {\n track.setFadeIn(fadeIn.duration, fadeIn.shape);\n }\n\n if (fadeOut !== undefined) {\n track.setFadeOut(fadeOut.duration, fadeOut.shape);\n }\n\n if (selection !== undefined) {\n this.setActiveTrack(track);\n this.setTimeSelection(selection.start, selection.end);\n }\n\n if (peaks !== undefined) {\n track.setPeakData(peaks);\n }\n\n track.setState(this.getState());\n track.setStartTime(start);\n track.setPlayout(playout);\n\n track.setGainLevel(gain);\n track.setStereoPanValue(stereoPan);\n\n if (muted) {\n this.muteTrack(track);\n }\n\n if (soloed) {\n this.soloTrack(track);\n }\n\n // extract peaks with AudioContext for now.\n track.calculatePeaks(this.samplesPerPixel, this.sampleRate);\n\n return track;\n });\n\n this.tracks = this.tracks.concat(tracks);\n this.adjustDuration();\n this.draw(this.render());\n\n this.ee.emit('audiosourcesrendered');\n }).catch((e) => {\n this.ee.emit('audiosourceserror', e);\n });\n }\n\n /*\n track instance of Track.\n */\n setActiveTrack(track) {\n this.activeTrack = track;\n }\n\n getActiveTrack() {\n return this.activeTrack;\n }\n\n isSegmentSelection() {\n return this.timeSelection.start !== this.timeSelection.end;\n }\n\n /*\n start, end in seconds.\n */\n setTimeSelection(start = 0, end) {\n this.timeSelection = {\n start,\n end: (end === undefined) ? start : end,\n };\n\n this.cursor = start;\n }\n\n startOfflineRender(type) {\n if (this.isRendering) {\n return;\n }\n\n this.isRendering = true;\n this.offlineAudioContext = new OfflineAudioContext(2, 44100 * this.duration, 44100);\n\n const currentTime = this.offlineAudioContext.currentTime;\n\n this.tracks.forEach((track) => {\n track.setOfflinePlayout(new Playout(this.offlineAudioContext, track.buffer));\n track.schedulePlay(currentTime, 0, 0, {\n shouldPlay: this.shouldTrackPlay(track),\n masterGain: 1,\n isOffline: true,\n });\n });\n\n /*\n TODO cleanup of different audio playouts handling.\n */\n this.offlineAudioContext.startRendering().then((audioBuffer) => {\n if (type === 'buffer') {\n this.ee.emit('audiorenderingfinished', type, audioBuffer);\n this.isRendering = false;\n return;\n }\n\n if (type === 'wav') {\n this.exportWorker.postMessage({\n command: 'init',\n config: {\n sampleRate: 44100,\n },\n });\n\n // callback for `exportWAV`\n this.exportWorker.onmessage = (e) => {\n this.ee.emit('audiorenderingfinished', type, e.data);\n this.isRendering = false;\n\n // clear out the buffer for next renderings.\n this.exportWorker.postMessage({\n command: 'clear',\n });\n };\n\n // send the channel data from our buffer to the worker\n this.exportWorker.postMessage({\n command: 'record',\n buffer: [\n audioBuffer.getChannelData(0),\n audioBuffer.getChannelData(1),\n ],\n });\n\n // ask the worker for a WAV\n this.exportWorker.postMessage({\n command: 'exportWAV',\n type: 'audio/wav',\n });\n }\n }).catch((e) => {\n throw e;\n });\n }\n\n getTimeSelection() {\n return this.timeSelection;\n }\n\n setState(state) {\n this.state = state;\n\n this.tracks.forEach((track) => {\n track.setState(state);\n });\n }\n\n getState() {\n return this.state;\n }\n\n setZoomIndex(index) {\n this.zoomIndex = index;\n }\n\n setZoomLevels(levels) {\n this.zoomLevels = levels;\n }\n\n setZoom(zoom) {\n this.samplesPerPixel = zoom;\n this.zoomIndex = this.zoomLevels.indexOf(zoom);\n this.tracks.forEach((track) => {\n track.calculatePeaks(zoom, this.sampleRate);\n });\n }\n\n muteTrack(track) {\n const index = this.mutedTracks.indexOf(track);\n\n if (index > -1) {\n this.mutedTracks.splice(index, 1);\n } else {\n this.mutedTracks.push(track);\n }\n }\n\n soloTrack(track) {\n const index = this.soloedTracks.indexOf(track);\n\n if (index > -1) {\n this.soloedTracks.splice(index, 1);\n } else if (this.exclSolo) {\n this.soloedTracks = [track];\n } else {\n this.soloedTracks.push(track);\n }\n }\n\n collapseTrack(track, opts) {\n if (opts.collapsed) {\n this.collapsedTracks.push(track);\n } else {\n const index = this.collapsedTracks.indexOf(track);\n\n if (index > -1) {\n this.collapsedTracks.splice(index, 1);\n }\n }\n }\n\n removeTrack(track) {\n if (track.isPlaying()) {\n track.scheduleStop();\n }\n\n const trackLists = [this.mutedTracks, this.soloedTracks, this.collapsedTracks, this.tracks];\n trackLists.forEach((list) => {\n const index = list.indexOf(track);\n if (index > -1) {\n list.splice(index, 1);\n }\n });\n }\n\n adjustTrackPlayout() {\n this.tracks.forEach((track) => {\n track.setShouldPlay(this.shouldTrackPlay(track));\n });\n }\n\n adjustDuration() {\n this.duration = this.tracks.reduce(\n (duration, track) => Math.max(duration, track.getEndTime()),\n 0,\n );\n }\n\n shouldTrackPlay(track) {\n let shouldPlay;\n // if there are solo tracks, only they should play.\n if (this.soloedTracks.length > 0) {\n shouldPlay = false;\n if (this.soloedTracks.indexOf(track) > -1) {\n shouldPlay = true;\n }\n } else {\n // play all tracks except any muted tracks.\n shouldPlay = true;\n if (this.mutedTracks.indexOf(track) > -1) {\n shouldPlay = false;\n }\n }\n\n return shouldPlay;\n }\n\n isPlaying() {\n return this.tracks.reduce(\n (isPlaying, track) => isPlaying || track.isPlaying(),\n false,\n );\n }\n\n /*\n * returns the current point of time in the playlist in seconds.\n */\n getCurrentTime() {\n const cursorPos = this.lastSeeked || this.pausedAt || this.cursor;\n\n return cursorPos + this.getElapsedTime();\n }\n\n getElapsedTime() {\n return this.ac.currentTime - this.lastPlay;\n }\n\n setMasterGain(gain) {\n this.ee.emit('mastervolumechange', gain);\n }\n\n restartPlayFrom(start, end) {\n this.stopAnimation();\n\n this.tracks.forEach((editor) => {\n editor.scheduleStop();\n });\n\n return Promise.all(this.playoutPromises).then(this.play.bind(this, start, end));\n }\n\n play(startTime, endTime) {\n clearTimeout(this.resetDrawTimer);\n\n const currentTime = this.ac.currentTime;\n const selected = this.getTimeSelection();\n const playoutPromises = [];\n\n const start = startTime || this.pausedAt || this.cursor;\n let end = endTime;\n\n if (!end && selected.end !== selected.start && selected.end > start) {\n end = selected.end;\n }\n\n if (this.isPlaying()) {\n return this.restartPlayFrom(start, end);\n }\n\n this.tracks.forEach((track) => {\n track.setState('cursor');\n playoutPromises.push(track.schedulePlay(currentTime, start, end, {\n shouldPlay: this.shouldTrackPlay(track),\n masterGain: this.masterGain,\n }));\n });\n\n this.lastPlay = currentTime;\n // use these to track when the playlist has fully stopped.\n this.playoutPromises = playoutPromises;\n this.startAnimation(start);\n\n return Promise.all(this.playoutPromises);\n }\n\n pause() {\n if (!this.isPlaying()) {\n return Promise.all(this.playoutPromises);\n }\n\n this.pausedAt = this.getCurrentTime();\n return this.playbackReset();\n }\n\n stop() {\n if (this.mediaRecorder && this.mediaRecorder.state === 'recording') {\n this.mediaRecorder.stop();\n }\n\n this.pausedAt = undefined;\n this.playbackSeconds = 0;\n return this.playbackReset();\n }\n\n playbackReset() {\n this.lastSeeked = undefined;\n this.stopAnimation();\n\n this.tracks.forEach((track) => {\n track.scheduleStop();\n track.setState(this.getState());\n });\n\n this.drawRequest();\n return Promise.all(this.playoutPromises);\n }\n\n rewind() {\n return this.stop().then(() => {\n this.scrollLeft = 0;\n this.ee.emit('select', 0, 0);\n });\n }\n\n fastForward() {\n return this.stop().then(() => {\n if (this.viewDuration < this.duration) {\n this.scrollLeft = this.duration - this.viewDuration;\n } else {\n this.scrollLeft = 0;\n }\n\n this.ee.emit('select', this.duration, this.duration);\n });\n }\n\n clear() {\n return this.stop().then(() => {\n this.tracks = [];\n this.soloedTracks = [];\n this.mutedTracks = [];\n this.playoutPromises = [];\n\n this.cursor = 0;\n this.playbackSeconds = 0;\n this.duration = 0;\n this.scrollLeft = 0;\n\n this.seek(0, 0, undefined);\n });\n }\n\n record() {\n const playoutPromises = [];\n this.mediaRecorder.start(300);\n\n this.tracks.forEach((track) => {\n track.setState('none');\n playoutPromises.push(track.schedulePlay(this.ac.currentTime, 0, undefined, {\n shouldPlay: this.shouldTrackPlay(track),\n }));\n });\n\n this.playoutPromises = playoutPromises;\n }\n\n startAnimation(startTime) {\n this.lastDraw = this.ac.currentTime;\n this.animationRequest = window.requestAnimationFrame(() => {\n this.updateEditor(startTime);\n });\n }\n\n stopAnimation() {\n window.cancelAnimationFrame(this.animationRequest);\n this.lastDraw = undefined;\n }\n\n seek(start, end, track) {\n if (this.isPlaying()) {\n this.lastSeeked = start;\n this.pausedAt = undefined;\n this.restartPlayFrom(start);\n } else {\n // reset if it was paused.\n this.setActiveTrack(track || this.tracks[0]);\n this.pausedAt = start;\n this.setTimeSelection(start, end);\n if (this.getSeekStyle() === 'fill') {\n this.playbackSeconds = start;\n }\n }\n }\n\n /*\n * Animation function for the playlist.\n * Keep under 16.7 milliseconds based on a typical screen refresh rate of 60fps.\n */\n updateEditor(cursor) {\n const currentTime = this.ac.currentTime;\n const selection = this.getTimeSelection();\n const cursorPos = cursor || this.cursor;\n const elapsed = currentTime - this.lastDraw;\n\n if (this.isPlaying()) {\n const playbackSeconds = cursorPos + elapsed;\n this.ee.emit('timeupdate', playbackSeconds);\n this.animationRequest = window.requestAnimationFrame(() => {\n this.updateEditor(playbackSeconds);\n });\n\n this.playbackSeconds = playbackSeconds;\n this.draw(this.render());\n this.lastDraw = currentTime;\n } else {\n if ((cursorPos + elapsed) >=\n (this.isSegmentSelection() ? selection.end : this.duration)) {\n this.ee.emit('finished');\n }\n\n this.stopAnimation();\n\n this.resetDrawTimer = setTimeout(() => {\n this.pausedAt = undefined;\n this.lastSeeked = undefined;\n this.setState(this.getState());\n\n this.playbackSeconds = 0;\n this.draw(this.render());\n }, 0);\n }\n }\n\n drawRequest() {\n window.requestAnimationFrame(() => {\n this.draw(this.render());\n });\n }\n\n draw(newTree) {\n const patches = diff(this.tree, newTree);\n this.rootNode = patch(this.rootNode, patches);\n this.tree = newTree;\n\n // use for fast forwarding.\n this.viewDuration = pixelsToSeconds(\n this.rootNode.clientWidth - this.controls.width,\n this.samplesPerPixel,\n this.sampleRate,\n );\n }\n\n getTrackRenderData(data = {}) {\n const defaults = {\n height: this.waveHeight,\n resolution: this.samplesPerPixel,\n sampleRate: this.sampleRate,\n controls: this.controls,\n isActive: false,\n timeSelection: this.getTimeSelection(),\n playlistLength: this.duration,\n playbackSeconds: this.playbackSeconds,\n colors: this.colors,\n };\n\n return _defaults({}, data, defaults);\n }\n\n isActiveTrack(track) {\n const activeTrack = this.getActiveTrack();\n\n if (this.isSegmentSelection()) {\n return activeTrack === track;\n }\n\n return true;\n }\n\n renderAnnotations() {\n return this.annotationList.render();\n }\n\n renderTimeScale() {\n const controlWidth = this.controls.show ? this.controls.width : 0;\n const timeScale = new TimeScale(this.duration, this.scrollLeft,\n this.samplesPerPixel, this.sampleRate, controlWidth, this.colors);\n\n return timeScale.render();\n }\n\n renderTrackSection() {\n const trackElements = this.tracks.map((track) => {\n const collapsed = this.collapsedTracks.indexOf(track) > -1;\n return track.render(this.getTrackRenderData({\n isActive: this.isActiveTrack(track),\n shouldPlay: this.shouldTrackPlay(track),\n soloed: this.soloedTracks.indexOf(track) > -1,\n muted: this.mutedTracks.indexOf(track) > -1,\n collapsed,\n height: collapsed ? this.collapsedWaveHeight : this.waveHeight,\n }));\n });\n\n return h('div.playlist-tracks',\n {\n attributes: {\n style: 'overflow: auto;',\n },\n onscroll: (e) => {\n this.scrollLeft = pixelsToSeconds(\n e.target.scrollLeft,\n this.samplesPerPixel,\n this.sampleRate,\n );\n\n this.ee.emit('scroll');\n },\n hook: new ScrollHook(this),\n },\n trackElements,\n );\n }\n\n render() {\n const containerChildren = [];\n\n if (this.showTimescale) {\n containerChildren.push(this.renderTimeScale());\n }\n\n containerChildren.push(this.renderTrackSection());\n\n if (this.annotationList.length) {\n containerChildren.push(this.renderAnnotations());\n }\n\n return h('div.playlist',\n {\n attributes: {\n style: 'overflow: hidden; position: relative;',\n },\n },\n containerChildren,\n );\n }\n\n getInfo() {\n const info = [];\n\n this.tracks.forEach((track) => {\n info.push(track.getTrackDetails());\n });\n\n return info;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Playlist.js","var h = require(\"./virtual-hyperscript/index.js\")\n\nmodule.exports = h\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/h.js\n// module id = 38\n// module chunks = 0","'use strict';\n\nvar isArray = require('x-is-array');\n\nvar VNode = require('../vnode/vnode.js');\nvar VText = require('../vnode/vtext.js');\nvar isVNode = require('../vnode/is-vnode');\nvar isVText = require('../vnode/is-vtext');\nvar isWidget = require('../vnode/is-widget');\nvar isHook = require('../vnode/is-vhook');\nvar isVThunk = require('../vnode/is-thunk');\n\nvar parseTag = require('./parse-tag.js');\nvar softSetHook = require('./hooks/soft-set-hook.js');\nvar evHook = require('./hooks/ev-hook.js');\n\nmodule.exports = h;\n\nfunction h(tagName, properties, children) {\n var childNodes = [];\n var tag, props, key, namespace;\n\n if (!children && isChildren(properties)) {\n children = properties;\n props = {};\n }\n\n props = props || properties || {};\n tag = parseTag(tagName, props);\n\n // support keys\n if (props.hasOwnProperty('key')) {\n key = props.key;\n props.key = undefined;\n }\n\n // support namespace\n if (props.hasOwnProperty('namespace')) {\n namespace = props.namespace;\n props.namespace = undefined;\n }\n\n // fix cursor bug\n if (tag === 'INPUT' &&\n !namespace &&\n props.hasOwnProperty('value') &&\n props.value !== undefined &&\n !isHook(props.value)\n ) {\n props.value = softSetHook(props.value);\n }\n\n transformProperties(props);\n\n if (children !== undefined && children !== null) {\n addChild(children, childNodes, tag, props);\n }\n\n\n return new VNode(tag, props, childNodes, key, namespace);\n}\n\nfunction addChild(c, childNodes, tag, props) {\n if (typeof c === 'string') {\n childNodes.push(new VText(c));\n } else if (typeof c === 'number') {\n childNodes.push(new VText(String(c)));\n } else if (isChild(c)) {\n childNodes.push(c);\n } else if (isArray(c)) {\n for (var i = 0; i < c.length; i++) {\n addChild(c[i], childNodes, tag, props);\n }\n } else if (c === null || c === undefined) {\n return;\n } else {\n throw UnexpectedVirtualElement({\n foreignObject: c,\n parentVnode: {\n tagName: tag,\n properties: props\n }\n });\n }\n}\n\nfunction transformProperties(props) {\n for (var propName in props) {\n if (props.hasOwnProperty(propName)) {\n var value = props[propName];\n\n if (isHook(value)) {\n continue;\n }\n\n if (propName.substr(0, 3) === 'ev-') {\n // add ev-foo support\n props[propName] = evHook(value);\n }\n }\n }\n}\n\nfunction isChild(x) {\n return isVNode(x) || isVText(x) || isWidget(x) || isVThunk(x);\n}\n\nfunction isChildren(x) {\n return typeof x === 'string' || isArray(x) || isChild(x);\n}\n\nfunction UnexpectedVirtualElement(data) {\n var err = new Error();\n\n err.type = 'virtual-hyperscript.unexpected.virtual-element';\n err.message = 'Unexpected virtual child passed to h().\\n' +\n 'Expected a VNode / Vthunk / VWidget / string but:\\n' +\n 'got:\\n' +\n errorString(data.foreignObject) +\n '.\\n' +\n 'The parent vnode is:\\n' +\n errorString(data.parentVnode)\n '\\n' +\n 'Suggested fix: change your `h(..., [ ... ])` callsite.';\n err.foreignObject = data.foreignObject;\n err.parentVnode = data.parentVnode;\n\n return err;\n}\n\nfunction errorString(obj) {\n try {\n return JSON.stringify(obj, null, ' ');\n } catch (e) {\n return String(obj);\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/virtual-hyperscript/index.js\n// module id = 39\n// module chunks = 0","var nativeIsArray = Array.isArray\nvar toString = Object.prototype.toString\n\nmodule.exports = nativeIsArray || isArray\n\nfunction isArray(obj) {\n return toString.call(obj) === \"[object Array]\"\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/x-is-array/index.js\n// module id = 40\n// module chunks = 0","var version = require(\"./version\")\nvar isVNode = require(\"./is-vnode\")\nvar isWidget = require(\"./is-widget\")\nvar isThunk = require(\"./is-thunk\")\nvar isVHook = require(\"./is-vhook\")\n\nmodule.exports = VirtualNode\n\nvar noProperties = {}\nvar noChildren = []\n\nfunction VirtualNode(tagName, properties, children, key, namespace) {\n this.tagName = tagName\n this.properties = properties || noProperties\n this.children = children || noChildren\n this.key = key != null ? String(key) : undefined\n this.namespace = (typeof namespace === \"string\") ? namespace : null\n\n var count = (children && children.length) || 0\n var descendants = 0\n var hasWidgets = false\n var hasThunks = false\n var descendantHooks = false\n var hooks\n\n for (var propName in properties) {\n if (properties.hasOwnProperty(propName)) {\n var property = properties[propName]\n if (isVHook(property) && property.unhook) {\n if (!hooks) {\n hooks = {}\n }\n\n hooks[propName] = property\n }\n }\n }\n\n for (var i = 0; i < count; i++) {\n var child = children[i]\n if (isVNode(child)) {\n descendants += child.count || 0\n\n if (!hasWidgets && child.hasWidgets) {\n hasWidgets = true\n }\n\n if (!hasThunks && child.hasThunks) {\n hasThunks = true\n }\n\n if (!descendantHooks && (child.hooks || child.descendantHooks)) {\n descendantHooks = true\n }\n } else if (!hasWidgets && isWidget(child)) {\n if (typeof child.destroy === \"function\") {\n hasWidgets = true\n }\n } else if (!hasThunks && isThunk(child)) {\n hasThunks = true;\n }\n }\n\n this.count = count + descendants\n this.hasWidgets = hasWidgets\n this.hasThunks = hasThunks\n this.hooks = hooks\n this.descendantHooks = descendantHooks\n}\n\nVirtualNode.prototype.version = version\nVirtualNode.prototype.type = \"VirtualNode\"\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/vnode.js\n// module id = 41\n// module chunks = 0","var version = require(\"./version\")\n\nmodule.exports = VirtualText\n\nfunction VirtualText(text) {\n this.text = String(text)\n}\n\nVirtualText.prototype.version = version\nVirtualText.prototype.type = \"VirtualText\"\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/vtext.js\n// module id = 42\n// module chunks = 0","'use strict';\n\nvar split = require('browser-split');\n\nvar classIdSplit = /([\\.#]?[a-zA-Z0-9\\u007F-\\uFFFF_:-]+)/;\nvar notClassId = /^\\.|#/;\n\nmodule.exports = parseTag;\n\nfunction parseTag(tag, props) {\n if (!tag) {\n return 'DIV';\n }\n\n var noId = !(props.hasOwnProperty('id'));\n\n var tagParts = split(tag, classIdSplit);\n var tagName = null;\n\n if (notClassId.test(tagParts[1])) {\n tagName = 'DIV';\n }\n\n var classes, part, type, i;\n\n for (i = 0; i < tagParts.length; i++) {\n part = tagParts[i];\n\n if (!part) {\n continue;\n }\n\n type = part.charAt(0);\n\n if (!tagName) {\n tagName = part;\n } else if (type === '.') {\n classes = classes || [];\n classes.push(part.substring(1, part.length));\n } else if (type === '#' && noId) {\n props.id = part.substring(1, part.length);\n }\n }\n\n if (classes) {\n if (props.className) {\n classes.push(props.className);\n }\n\n props.className = classes.join(' ');\n }\n\n return props.namespace ? tagName : tagName.toUpperCase();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/virtual-hyperscript/parse-tag.js\n// module id = 43\n// module chunks = 0","/*!\n * Cross-Browser Split 1.1.1\n * Copyright 2007-2012 Steven Levithan \n * Available under the MIT License\n * ECMAScript compliant, uniform cross-browser split method\n */\n\n/**\n * Splits a string into an array of strings using a regex or string separator. Matches of the\n * separator are not included in the result array. However, if `separator` is a regex that contains\n * capturing groups, backreferences are spliced into the result each time `separator` is matched.\n * Fixes browser bugs compared to the native `String.prototype.split` and can be used reliably\n * cross-browser.\n * @param {String} str String to split.\n * @param {RegExp|String} separator Regex or string to use for separating the string.\n * @param {Number} [limit] Maximum number of items to include in the result array.\n * @returns {Array} Array of substrings.\n * @example\n *\n * // Basic use\n * split('a b c d', ' ');\n * // -> ['a', 'b', 'c', 'd']\n *\n * // With limit\n * split('a b c d', ' ', 2);\n * // -> ['a', 'b']\n *\n * // Backreferences in result array\n * split('..word1 word2..', /([a-z]+)(\\d+)/i);\n * // -> ['..', 'word', '1', ' ', 'word', '2', '..']\n */\nmodule.exports = (function split(undef) {\n\n var nativeSplit = String.prototype.split,\n compliantExecNpcg = /()??/.exec(\"\")[1] === undef,\n // NPCG: nonparticipating capturing group\n self;\n\n self = function(str, separator, limit) {\n // If `separator` is not a regex, use `nativeSplit`\n if (Object.prototype.toString.call(separator) !== \"[object RegExp]\") {\n return nativeSplit.call(str, separator, limit);\n }\n var output = [],\n flags = (separator.ignoreCase ? \"i\" : \"\") + (separator.multiline ? \"m\" : \"\") + (separator.extended ? \"x\" : \"\") + // Proposed for ES6\n (separator.sticky ? \"y\" : \"\"),\n // Firefox 3+\n lastLastIndex = 0,\n // Make `global` and avoid `lastIndex` issues by working with a copy\n separator = new RegExp(separator.source, flags + \"g\"),\n separator2, match, lastIndex, lastLength;\n str += \"\"; // Type-convert\n if (!compliantExecNpcg) {\n // Doesn't need flags gy, but they don't hurt\n separator2 = new RegExp(\"^\" + separator.source + \"$(?!\\\\s)\", flags);\n }\n /* Values for `limit`, per the spec:\n * If undefined: 4294967295 // Math.pow(2, 32) - 1\n * If 0, Infinity, or NaN: 0\n * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;\n * If negative number: 4294967296 - Math.floor(Math.abs(limit))\n * If other: Type-convert, then use the above rules\n */\n limit = limit === undef ? -1 >>> 0 : // Math.pow(2, 32) - 1\n limit >>> 0; // ToUint32(limit)\n while (match = separator.exec(str)) {\n // `separator.lastIndex` is not reliable cross-browser\n lastIndex = match.index + match[0].length;\n if (lastIndex > lastLastIndex) {\n output.push(str.slice(lastLastIndex, match.index));\n // Fix browsers whose `exec` methods don't consistently return `undefined` for\n // nonparticipating capturing groups\n if (!compliantExecNpcg && match.length > 1) {\n match[0].replace(separator2, function() {\n for (var i = 1; i < arguments.length - 2; i++) {\n if (arguments[i] === undef) {\n match[i] = undef;\n }\n }\n });\n }\n if (match.length > 1 && match.index < str.length) {\n Array.prototype.push.apply(output, match.slice(1));\n }\n lastLength = match[0].length;\n lastLastIndex = lastIndex;\n if (output.length >= limit) {\n break;\n }\n }\n if (separator.lastIndex === match.index) {\n separator.lastIndex++; // Avoid an infinite loop\n }\n }\n if (lastLastIndex === str.length) {\n if (lastLength || !separator.test(\"\")) {\n output.push(\"\");\n }\n } else {\n output.push(str.slice(lastLastIndex));\n }\n return output.length > limit ? output.slice(0, limit) : output;\n };\n\n return self;\n})();\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/browser-split/index.js\n// module id = 44\n// module chunks = 0","'use strict';\n\nmodule.exports = SoftSetHook;\n\nfunction SoftSetHook(value) {\n if (!(this instanceof SoftSetHook)) {\n return new SoftSetHook(value);\n }\n\n this.value = value;\n}\n\nSoftSetHook.prototype.hook = function (node, propertyName) {\n if (node[propertyName] !== this.value) {\n node[propertyName] = this.value;\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/virtual-hyperscript/hooks/soft-set-hook.js\n// module id = 45\n// module chunks = 0","'use strict';\n\nvar EvStore = require('ev-store');\n\nmodule.exports = EvHook;\n\nfunction EvHook(value) {\n if (!(this instanceof EvHook)) {\n return new EvHook(value);\n }\n\n this.value = value;\n}\n\nEvHook.prototype.hook = function (node, propertyName) {\n var es = EvStore(node);\n var propName = propertyName.substr(3);\n\n es[propName] = this.value;\n};\n\nEvHook.prototype.unhook = function(node, propertyName) {\n var es = EvStore(node);\n var propName = propertyName.substr(3);\n\n es[propName] = undefined;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/virtual-hyperscript/hooks/ev-hook.js\n// module id = 46\n// module chunks = 0","'use strict';\n\nvar OneVersionConstraint = require('individual/one-version');\n\nvar MY_VERSION = '7';\nOneVersionConstraint('ev-store', MY_VERSION);\n\nvar hashKey = '__EV_STORE_KEY@' + MY_VERSION;\n\nmodule.exports = EvStore;\n\nfunction EvStore(elem) {\n var hash = elem[hashKey];\n\n if (!hash) {\n hash = elem[hashKey] = {};\n }\n\n return hash;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/ev-store/index.js\n// module id = 47\n// module chunks = 0","'use strict';\n\nvar Individual = require('./index.js');\n\nmodule.exports = OneVersion;\n\nfunction OneVersion(moduleName, version, defaultValue) {\n var key = '__INDIVIDUAL_ONE_VERSION_' + moduleName;\n var enforceKey = key + '_ENFORCE_SINGLETON';\n\n var versionValue = Individual(enforceKey, version);\n\n if (versionValue !== version) {\n throw new Error('Can only have one copy of ' +\n moduleName + '.\\n' +\n 'You already have version ' + versionValue +\n ' installed.\\n' +\n 'This means you cannot install version ' + version);\n }\n\n return Individual(key, defaultValue);\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/individual/one-version.js\n// module id = 48\n// module chunks = 0","'use strict';\n\n/*global window, global*/\n\nvar root = typeof window !== 'undefined' ?\n window : typeof global !== 'undefined' ?\n global : {};\n\nmodule.exports = Individual;\n\nfunction Individual(key, value) {\n if (key in root) {\n return root[key];\n }\n\n root[key] = value;\n\n return value;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/individual/index.js\n// module id = 49\n// module chunks = 0","var diff = require(\"./vtree/diff.js\")\n\nmodule.exports = diff\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/diff.js\n// module id = 50\n// module chunks = 0","var isArray = require(\"x-is-array\")\n\nvar VPatch = require(\"../vnode/vpatch\")\nvar isVNode = require(\"../vnode/is-vnode\")\nvar isVText = require(\"../vnode/is-vtext\")\nvar isWidget = require(\"../vnode/is-widget\")\nvar isThunk = require(\"../vnode/is-thunk\")\nvar handleThunk = require(\"../vnode/handle-thunk\")\n\nvar diffProps = require(\"./diff-props\")\n\nmodule.exports = diff\n\nfunction diff(a, b) {\n var patch = { a: a }\n walk(a, b, patch, 0)\n return patch\n}\n\nfunction walk(a, b, patch, index) {\n if (a === b) {\n return\n }\n\n var apply = patch[index]\n var applyClear = false\n\n if (isThunk(a) || isThunk(b)) {\n thunks(a, b, patch, index)\n } else if (b == null) {\n\n // If a is a widget we will add a remove patch for it\n // Otherwise any child widgets/hooks must be destroyed.\n // This prevents adding two remove patches for a widget.\n if (!isWidget(a)) {\n clearState(a, patch, index)\n apply = patch[index]\n }\n\n apply = appendPatch(apply, new VPatch(VPatch.REMOVE, a, b))\n } else if (isVNode(b)) {\n if (isVNode(a)) {\n if (a.tagName === b.tagName &&\n a.namespace === b.namespace &&\n a.key === b.key) {\n var propsPatch = diffProps(a.properties, b.properties)\n if (propsPatch) {\n apply = appendPatch(apply,\n new VPatch(VPatch.PROPS, a, propsPatch))\n }\n apply = diffChildren(a, b, patch, apply, index)\n } else {\n apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b))\n applyClear = true\n }\n } else {\n apply = appendPatch(apply, new VPatch(VPatch.VNODE, a, b))\n applyClear = true\n }\n } else if (isVText(b)) {\n if (!isVText(a)) {\n apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b))\n applyClear = true\n } else if (a.text !== b.text) {\n apply = appendPatch(apply, new VPatch(VPatch.VTEXT, a, b))\n }\n } else if (isWidget(b)) {\n if (!isWidget(a)) {\n applyClear = true\n }\n\n apply = appendPatch(apply, new VPatch(VPatch.WIDGET, a, b))\n }\n\n if (apply) {\n patch[index] = apply\n }\n\n if (applyClear) {\n clearState(a, patch, index)\n }\n}\n\nfunction diffChildren(a, b, patch, apply, index) {\n var aChildren = a.children\n var orderedSet = reorder(aChildren, b.children)\n var bChildren = orderedSet.children\n\n var aLen = aChildren.length\n var bLen = bChildren.length\n var len = aLen > bLen ? aLen : bLen\n\n for (var i = 0; i < len; i++) {\n var leftNode = aChildren[i]\n var rightNode = bChildren[i]\n index += 1\n\n if (!leftNode) {\n if (rightNode) {\n // Excess nodes in b need to be added\n apply = appendPatch(apply,\n new VPatch(VPatch.INSERT, null, rightNode))\n }\n } else {\n walk(leftNode, rightNode, patch, index)\n }\n\n if (isVNode(leftNode) && leftNode.count) {\n index += leftNode.count\n }\n }\n\n if (orderedSet.moves) {\n // Reorder nodes last\n apply = appendPatch(apply, new VPatch(\n VPatch.ORDER,\n a,\n orderedSet.moves\n ))\n }\n\n return apply\n}\n\nfunction clearState(vNode, patch, index) {\n // TODO: Make this a single walk, not two\n unhook(vNode, patch, index)\n destroyWidgets(vNode, patch, index)\n}\n\n// Patch records for all destroyed widgets must be added because we need\n// a DOM node reference for the destroy function\nfunction destroyWidgets(vNode, patch, index) {\n if (isWidget(vNode)) {\n if (typeof vNode.destroy === \"function\") {\n patch[index] = appendPatch(\n patch[index],\n new VPatch(VPatch.REMOVE, vNode, null)\n )\n }\n } else if (isVNode(vNode) && (vNode.hasWidgets || vNode.hasThunks)) {\n var children = vNode.children\n var len = children.length\n for (var i = 0; i < len; i++) {\n var child = children[i]\n index += 1\n\n destroyWidgets(child, patch, index)\n\n if (isVNode(child) && child.count) {\n index += child.count\n }\n }\n } else if (isThunk(vNode)) {\n thunks(vNode, null, patch, index)\n }\n}\n\n// Create a sub-patch for thunks\nfunction thunks(a, b, patch, index) {\n var nodes = handleThunk(a, b)\n var thunkPatch = diff(nodes.a, nodes.b)\n if (hasPatches(thunkPatch)) {\n patch[index] = new VPatch(VPatch.THUNK, null, thunkPatch)\n }\n}\n\nfunction hasPatches(patch) {\n for (var index in patch) {\n if (index !== \"a\") {\n return true\n }\n }\n\n return false\n}\n\n// Execute hooks when two nodes are identical\nfunction unhook(vNode, patch, index) {\n if (isVNode(vNode)) {\n if (vNode.hooks) {\n patch[index] = appendPatch(\n patch[index],\n new VPatch(\n VPatch.PROPS,\n vNode,\n undefinedKeys(vNode.hooks)\n )\n )\n }\n\n if (vNode.descendantHooks || vNode.hasThunks) {\n var children = vNode.children\n var len = children.length\n for (var i = 0; i < len; i++) {\n var child = children[i]\n index += 1\n\n unhook(child, patch, index)\n\n if (isVNode(child) && child.count) {\n index += child.count\n }\n }\n }\n } else if (isThunk(vNode)) {\n thunks(vNode, null, patch, index)\n }\n}\n\nfunction undefinedKeys(obj) {\n var result = {}\n\n for (var key in obj) {\n result[key] = undefined\n }\n\n return result\n}\n\n// List diff, naive left to right reordering\nfunction reorder(aChildren, bChildren) {\n // O(M) time, O(M) memory\n var bChildIndex = keyIndex(bChildren)\n var bKeys = bChildIndex.keys\n var bFree = bChildIndex.free\n\n if (bFree.length === bChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(N) time, O(N) memory\n var aChildIndex = keyIndex(aChildren)\n var aKeys = aChildIndex.keys\n var aFree = aChildIndex.free\n\n if (aFree.length === aChildren.length) {\n return {\n children: bChildren,\n moves: null\n }\n }\n\n // O(MAX(N, M)) memory\n var newChildren = []\n\n var freeIndex = 0\n var freeCount = bFree.length\n var deletedItems = 0\n\n // Iterate through a and match a node in b\n // O(N) time,\n for (var i = 0 ; i < aChildren.length; i++) {\n var aItem = aChildren[i]\n var itemIndex\n\n if (aItem.key) {\n if (bKeys.hasOwnProperty(aItem.key)) {\n // Match up the old keys\n itemIndex = bKeys[aItem.key]\n newChildren.push(bChildren[itemIndex])\n\n } else {\n // Remove old keyed items\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n } else {\n // Match the item in a with the next free item in b\n if (freeIndex < freeCount) {\n itemIndex = bFree[freeIndex++]\n newChildren.push(bChildren[itemIndex])\n } else {\n // There are no free items in b to match with\n // the free items in a, so the extra free nodes\n // are deleted.\n itemIndex = i - deletedItems++\n newChildren.push(null)\n }\n }\n }\n\n var lastFreeIndex = freeIndex >= bFree.length ?\n bChildren.length :\n bFree[freeIndex]\n\n // Iterate through b and append any new keys\n // O(M) time\n for (var j = 0; j < bChildren.length; j++) {\n var newItem = bChildren[j]\n\n if (newItem.key) {\n if (!aKeys.hasOwnProperty(newItem.key)) {\n // Add any new keyed items\n // We are adding new items to the end and then sorting them\n // in place. In future we should insert new items in place.\n newChildren.push(newItem)\n }\n } else if (j >= lastFreeIndex) {\n // Add any leftover non-keyed items\n newChildren.push(newItem)\n }\n }\n\n var simulate = newChildren.slice()\n var simulateIndex = 0\n var removes = []\n var inserts = []\n var simulateItem\n\n for (var k = 0; k < bChildren.length;) {\n var wantedItem = bChildren[k]\n simulateItem = simulate[simulateIndex]\n\n // remove items\n while (simulateItem === null && simulate.length) {\n removes.push(remove(simulate, simulateIndex, null))\n simulateItem = simulate[simulateIndex]\n }\n\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n // if we need a key in this position...\n if (wantedItem.key) {\n if (simulateItem && simulateItem.key) {\n // if an insert doesn't put this key in place, it needs to move\n if (bKeys[simulateItem.key] !== k + 1) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n simulateItem = simulate[simulateIndex]\n // if the remove didn't put the wanted item in place, we need to insert it\n if (!simulateItem || simulateItem.key !== wantedItem.key) {\n inserts.push({key: wantedItem.key, to: k})\n }\n // items are matching, so skip ahead\n else {\n simulateIndex++\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n }\n else {\n inserts.push({key: wantedItem.key, to: k})\n }\n k++\n }\n // a key in simulate has no matching wanted key, remove it\n else if (simulateItem && simulateItem.key) {\n removes.push(remove(simulate, simulateIndex, simulateItem.key))\n }\n }\n else {\n simulateIndex++\n k++\n }\n }\n\n // remove all the remaining nodes from simulate\n while(simulateIndex < simulate.length) {\n simulateItem = simulate[simulateIndex]\n removes.push(remove(simulate, simulateIndex, simulateItem && simulateItem.key))\n }\n\n // If the only moves we have are deletes then we can just\n // let the delete patch remove these items.\n if (removes.length === deletedItems && !inserts.length) {\n return {\n children: newChildren,\n moves: null\n }\n }\n\n return {\n children: newChildren,\n moves: {\n removes: removes,\n inserts: inserts\n }\n }\n}\n\nfunction remove(arr, index, key) {\n arr.splice(index, 1)\n\n return {\n from: index,\n key: key\n }\n}\n\nfunction keyIndex(children) {\n var keys = {}\n var free = []\n var length = children.length\n\n for (var i = 0; i < length; i++) {\n var child = children[i]\n\n if (child.key) {\n keys[child.key] = i\n } else {\n free.push(i)\n }\n }\n\n return {\n keys: keys, // A hash of key name to index\n free: free // An array of unkeyed item indices\n }\n}\n\nfunction appendPatch(apply, patch) {\n if (apply) {\n if (isArray(apply)) {\n apply.push(patch)\n } else {\n apply = [apply, patch]\n }\n\n return apply\n } else {\n return patch\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vtree/diff.js\n// module id = 51\n// module chunks = 0","var version = require(\"./version\")\n\nVirtualPatch.NONE = 0\nVirtualPatch.VTEXT = 1\nVirtualPatch.VNODE = 2\nVirtualPatch.WIDGET = 3\nVirtualPatch.PROPS = 4\nVirtualPatch.ORDER = 5\nVirtualPatch.INSERT = 6\nVirtualPatch.REMOVE = 7\nVirtualPatch.THUNK = 8\n\nmodule.exports = VirtualPatch\n\nfunction VirtualPatch(type, vNode, patch) {\n this.type = Number(type)\n this.vNode = vNode\n this.patch = patch\n}\n\nVirtualPatch.prototype.version = version\nVirtualPatch.prototype.type = \"VirtualPatch\"\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vnode/vpatch.js\n// module id = 52\n// module chunks = 0","var isObject = require(\"is-object\")\nvar isHook = require(\"../vnode/is-vhook\")\n\nmodule.exports = diffProps\n\nfunction diffProps(a, b) {\n var diff\n\n for (var aKey in a) {\n if (!(aKey in b)) {\n diff = diff || {}\n diff[aKey] = undefined\n }\n\n var aValue = a[aKey]\n var bValue = b[aKey]\n\n if (aValue === bValue) {\n continue\n } else if (isObject(aValue) && isObject(bValue)) {\n if (getPrototype(bValue) !== getPrototype(aValue)) {\n diff = diff || {}\n diff[aKey] = bValue\n } else if (isHook(bValue)) {\n diff = diff || {}\n diff[aKey] = bValue\n } else {\n var objectDiff = diffProps(aValue, bValue)\n if (objectDiff) {\n diff = diff || {}\n diff[aKey] = objectDiff\n }\n }\n } else {\n diff = diff || {}\n diff[aKey] = bValue\n }\n }\n\n for (var bKey in b) {\n if (!(bKey in a)) {\n diff = diff || {}\n diff[bKey] = b[bKey]\n }\n }\n\n return diff\n}\n\nfunction getPrototype(value) {\n if (Object.getPrototypeOf) {\n return Object.getPrototypeOf(value)\n } else if (value.__proto__) {\n return value.__proto__\n } else if (value.constructor) {\n return value.constructor.prototype\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vtree/diff-props.js\n// module id = 53\n// module chunks = 0","var patch = require(\"./vdom/patch.js\")\n\nmodule.exports = patch\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/patch.js\n// module id = 54\n// module chunks = 0","var document = require(\"global/document\")\nvar isArray = require(\"x-is-array\")\n\nvar render = require(\"./create-element\")\nvar domIndex = require(\"./dom-index\")\nvar patchOp = require(\"./patch-op\")\nmodule.exports = patch\n\nfunction patch(rootNode, patches, renderOptions) {\n renderOptions = renderOptions || {}\n renderOptions.patch = renderOptions.patch && renderOptions.patch !== patch\n ? renderOptions.patch\n : patchRecursive\n renderOptions.render = renderOptions.render || render\n\n return renderOptions.patch(rootNode, patches, renderOptions)\n}\n\nfunction patchRecursive(rootNode, patches, renderOptions) {\n var indices = patchIndices(patches)\n\n if (indices.length === 0) {\n return rootNode\n }\n\n var index = domIndex(rootNode, patches.a, indices)\n var ownerDocument = rootNode.ownerDocument\n\n if (!renderOptions.document && ownerDocument !== document) {\n renderOptions.document = ownerDocument\n }\n\n for (var i = 0; i < indices.length; i++) {\n var nodeIndex = indices[i]\n rootNode = applyPatch(rootNode,\n index[nodeIndex],\n patches[nodeIndex],\n renderOptions)\n }\n\n return rootNode\n}\n\nfunction applyPatch(rootNode, domNode, patchList, renderOptions) {\n if (!domNode) {\n return rootNode\n }\n\n var newNode\n\n if (isArray(patchList)) {\n for (var i = 0; i < patchList.length; i++) {\n newNode = patchOp(patchList[i], domNode, renderOptions)\n\n if (domNode === rootNode) {\n rootNode = newNode\n }\n }\n } else {\n newNode = patchOp(patchList, domNode, renderOptions)\n\n if (domNode === rootNode) {\n rootNode = newNode\n }\n }\n\n return rootNode\n}\n\nfunction patchIndices(patches) {\n var indices = []\n\n for (var key in patches) {\n if (key !== \"a\") {\n indices.push(Number(key))\n }\n }\n\n return indices\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vdom/patch.js\n// module id = 55\n// module chunks = 0","// Maps a virtual DOM tree onto a real DOM tree in an efficient manner.\n// We don't want to read all of the DOM nodes in the tree so we use\n// the in-order tree indexing to eliminate recursion down certain branches.\n// We only recurse into a DOM node if we know that it contains a child of\n// interest.\n\nvar noChild = {}\n\nmodule.exports = domIndex\n\nfunction domIndex(rootNode, tree, indices, nodes) {\n if (!indices || indices.length === 0) {\n return {}\n } else {\n indices.sort(ascending)\n return recurse(rootNode, tree, indices, nodes, 0)\n }\n}\n\nfunction recurse(rootNode, tree, indices, nodes, rootIndex) {\n nodes = nodes || {}\n\n\n if (rootNode) {\n if (indexInRange(indices, rootIndex, rootIndex)) {\n nodes[rootIndex] = rootNode\n }\n\n var vChildren = tree.children\n\n if (vChildren) {\n\n var childNodes = rootNode.childNodes\n\n for (var i = 0; i < tree.children.length; i++) {\n rootIndex += 1\n\n var vChild = vChildren[i] || noChild\n var nextIndex = rootIndex + (vChild.count || 0)\n\n // skip recursion down the tree if there are no nodes down here\n if (indexInRange(indices, rootIndex, nextIndex)) {\n recurse(childNodes[i], vChild, indices, nodes, rootIndex)\n }\n\n rootIndex = nextIndex\n }\n }\n }\n\n return nodes\n}\n\n// Binary search for an index in the interval [left, right]\nfunction indexInRange(indices, left, right) {\n if (indices.length === 0) {\n return false\n }\n\n var minIndex = 0\n var maxIndex = indices.length - 1\n var currentIndex\n var currentItem\n\n while (minIndex <= maxIndex) {\n currentIndex = ((maxIndex + minIndex) / 2) >> 0\n currentItem = indices[currentIndex]\n\n if (minIndex === maxIndex) {\n return currentItem >= left && currentItem <= right\n } else if (currentItem < left) {\n minIndex = currentIndex + 1\n } else if (currentItem > right) {\n maxIndex = currentIndex - 1\n } else {\n return true\n }\n }\n\n return false;\n}\n\nfunction ascending(a, b) {\n return a > b ? 1 : -1\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vdom/dom-index.js\n// module id = 56\n// module chunks = 0","var applyProperties = require(\"./apply-properties\")\n\nvar isWidget = require(\"../vnode/is-widget.js\")\nvar VPatch = require(\"../vnode/vpatch.js\")\n\nvar updateWidget = require(\"./update-widget\")\n\nmodule.exports = applyPatch\n\nfunction applyPatch(vpatch, domNode, renderOptions) {\n var type = vpatch.type\n var vNode = vpatch.vNode\n var patch = vpatch.patch\n\n switch (type) {\n case VPatch.REMOVE:\n return removeNode(domNode, vNode)\n case VPatch.INSERT:\n return insertNode(domNode, patch, renderOptions)\n case VPatch.VTEXT:\n return stringPatch(domNode, vNode, patch, renderOptions)\n case VPatch.WIDGET:\n return widgetPatch(domNode, vNode, patch, renderOptions)\n case VPatch.VNODE:\n return vNodePatch(domNode, vNode, patch, renderOptions)\n case VPatch.ORDER:\n reorderChildren(domNode, patch)\n return domNode\n case VPatch.PROPS:\n applyProperties(domNode, patch, vNode.properties)\n return domNode\n case VPatch.THUNK:\n return replaceRoot(domNode,\n renderOptions.patch(domNode, patch, renderOptions))\n default:\n return domNode\n }\n}\n\nfunction removeNode(domNode, vNode) {\n var parentNode = domNode.parentNode\n\n if (parentNode) {\n parentNode.removeChild(domNode)\n }\n\n destroyWidget(domNode, vNode);\n\n return null\n}\n\nfunction insertNode(parentNode, vNode, renderOptions) {\n var newNode = renderOptions.render(vNode, renderOptions)\n\n if (parentNode) {\n parentNode.appendChild(newNode)\n }\n\n return parentNode\n}\n\nfunction stringPatch(domNode, leftVNode, vText, renderOptions) {\n var newNode\n\n if (domNode.nodeType === 3) {\n domNode.replaceData(0, domNode.length, vText.text)\n newNode = domNode\n } else {\n var parentNode = domNode.parentNode\n newNode = renderOptions.render(vText, renderOptions)\n\n if (parentNode && newNode !== domNode) {\n parentNode.replaceChild(newNode, domNode)\n }\n }\n\n return newNode\n}\n\nfunction widgetPatch(domNode, leftVNode, widget, renderOptions) {\n var updating = updateWidget(leftVNode, widget)\n var newNode\n\n if (updating) {\n newNode = widget.update(leftVNode, domNode) || domNode\n } else {\n newNode = renderOptions.render(widget, renderOptions)\n }\n\n var parentNode = domNode.parentNode\n\n if (parentNode && newNode !== domNode) {\n parentNode.replaceChild(newNode, domNode)\n }\n\n if (!updating) {\n destroyWidget(domNode, leftVNode)\n }\n\n return newNode\n}\n\nfunction vNodePatch(domNode, leftVNode, vNode, renderOptions) {\n var parentNode = domNode.parentNode\n var newNode = renderOptions.render(vNode, renderOptions)\n\n if (parentNode && newNode !== domNode) {\n parentNode.replaceChild(newNode, domNode)\n }\n\n return newNode\n}\n\nfunction destroyWidget(domNode, w) {\n if (typeof w.destroy === \"function\" && isWidget(w)) {\n w.destroy(domNode)\n }\n}\n\nfunction reorderChildren(domNode, moves) {\n var childNodes = domNode.childNodes\n var keyMap = {}\n var node\n var remove\n var insert\n\n for (var i = 0; i < moves.removes.length; i++) {\n remove = moves.removes[i]\n node = childNodes[remove.from]\n if (remove.key) {\n keyMap[remove.key] = node\n }\n domNode.removeChild(node)\n }\n\n var length = childNodes.length\n for (var j = 0; j < moves.inserts.length; j++) {\n insert = moves.inserts[j]\n node = keyMap[insert.key]\n // this is the weirdest bug i've ever seen in webkit\n domNode.insertBefore(node, insert.to >= length++ ? null : childNodes[insert.to])\n }\n}\n\nfunction replaceRoot(oldRoot, newRoot) {\n if (oldRoot && newRoot && oldRoot !== newRoot && oldRoot.parentNode) {\n oldRoot.parentNode.replaceChild(newRoot, oldRoot)\n }\n\n return newRoot;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vdom/patch-op.js\n// module id = 57\n// module chunks = 0","var isWidget = require(\"../vnode/is-widget.js\")\n\nmodule.exports = updateWidget\n\nfunction updateWidget(a, b) {\n if (isWidget(a) && isWidget(b)) {\n if (\"name\" in a && \"name\" in b) {\n return a.id === b.id\n } else {\n return a.init === b.init\n }\n }\n\n return false\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/virtual-dom/vdom/update-widget.js\n// module id = 58\n// module chunks = 0","var WORKER_ENABLED = !!(global === global.window && global.URL && global.Blob && global.Worker);\n\nfunction InlineWorker(func, self) {\n var _this = this;\n var functionBody;\n\n self = self || {};\n\n if (WORKER_ENABLED) {\n functionBody = func.toString().trim().match(\n /^function\\s*\\w*\\s*\\([\\w\\s,]*\\)\\s*{([\\w\\W]*?)}$/\n )[1];\n\n return new global.Worker(global.URL.createObjectURL(\n new global.Blob([ functionBody ], { type: \"text/javascript\" })\n ));\n }\n\n function postMessage(data) {\n setTimeout(function() {\n _this.onmessage({ data: data });\n }, 0);\n }\n\n this.self = self;\n this.self.postMessage = postMessage;\n\n setTimeout(func.bind(self, self), 0);\n}\n\nInlineWorker.prototype.postMessage = function postMessage(data) {\n var _this = this;\n\n setTimeout(function() {\n _this.self.onmessage({ data: data });\n }, 0);\n};\n\nmodule.exports = InlineWorker;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/inline-worker/index.js\n// module id = 59\n// module chunks = 0","export function samplesToSeconds(samples, sampleRate) {\n return samples / sampleRate;\n}\n\nexport function secondsToSamples(seconds, sampleRate) {\n return Math.ceil(seconds * sampleRate);\n}\n\nexport function samplesToPixels(samples, resolution) {\n return Math.floor(samples / resolution);\n}\n\nexport function pixelsToSamples(pixels, resolution) {\n return Math.floor(pixels * resolution);\n}\n\nexport function pixelsToSeconds(pixels, resolution, sampleRate) {\n return (pixels * resolution) / sampleRate;\n}\n\nexport function secondsToPixels(seconds, resolution, sampleRate) {\n return Math.ceil((seconds * sampleRate) / resolution);\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/conversions.js","import BlobLoader from './BlobLoader';\nimport IdentityLoader from './IdentityLoader';\nimport XHRLoader from './XHRLoader';\n\nexport default class {\n static createLoader(src, audioContext, ee) {\n if (src instanceof Blob) {\n return new BlobLoader(src, audioContext, ee);\n } else if (src instanceof AudioBuffer) {\n return new IdentityLoader(src, audioContext, ee);\n } else if (typeof (src) === 'string') {\n return new XHRLoader(src, audioContext, ee);\n }\n\n throw new Error('Unsupported src type');\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/loader/LoaderFactory.js","import Loader from './Loader';\n\nexport default class extends Loader {\n\n /*\n * Loads an audio file via a FileReader\n */\n load() {\n return new Promise((resolve, reject) => {\n if (this.src.type.match(/audio.*/) ||\n // added for problems with Firefox mime types + ogg.\n this.src.type.match(/video\\/ogg/)) {\n const fr = new FileReader();\n\n fr.readAsArrayBuffer(this.src);\n\n fr.addEventListener('progress', (e) => {\n super.fileProgress(e);\n });\n\n fr.addEventListener('load', (e) => {\n const decoderPromise = super.fileLoad(e);\n\n decoderPromise.then((audioBuffer) => {\n resolve(audioBuffer);\n }).catch(reject);\n });\n\n fr.addEventListener('error', reject);\n } else {\n reject(Error(`Unsupported file type ${this.src.type}`));\n }\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/loader/BlobLoader.js","import EventEmitter from 'event-emitter';\n\nexport const STATE_UNINITIALIZED = 0;\nexport const STATE_LOADING = 1;\nexport const STATE_DECODING = 2;\nexport const STATE_FINISHED = 3;\n\n\nexport default class {\n constructor(src, audioContext, ee = EventEmitter()) {\n this.src = src;\n this.ac = audioContext;\n this.audioRequestState = STATE_UNINITIALIZED;\n this.ee = ee;\n }\n\n setStateChange(state) {\n this.audioRequestState = state;\n this.ee.emit('audiorequeststatechange', this.audioRequestState, this.src);\n }\n\n fileProgress(e) {\n let percentComplete = 0;\n\n if (this.audioRequestState === STATE_UNINITIALIZED) {\n this.setStateChange(STATE_LOADING);\n }\n\n if (e.lengthComputable) {\n percentComplete = (e.loaded / e.total) * 100;\n }\n\n this.ee.emit('loadprogress', percentComplete, this.src);\n }\n\n fileLoad(e) {\n const audioData = e.target.response || e.target.result;\n\n this.setStateChange(STATE_DECODING);\n\n return new Promise((resolve, reject) => {\n this.ac.decodeAudioData(\n audioData,\n (audioBuffer) => {\n this.audioBuffer = audioBuffer;\n this.setStateChange(STATE_FINISHED);\n\n resolve(audioBuffer);\n },\n (err) => {\n if (err === null) {\n // Safari issues with null error\n reject(Error('MediaDecodeAudioDataUnknownContentType'));\n } else {\n reject(err);\n }\n },\n );\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/loader/Loader.js","import Loader from './Loader';\n\nexport default class IdentityLoader extends Loader {\n load() {\n return Promise.resolve(this.src);\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/loader/IdentityLoader.js","import Loader from './Loader';\n\nexport default class extends Loader {\n\n /**\n * Loads an audio file via XHR.\n */\n load() {\n return new Promise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n\n xhr.open('GET', this.src, true);\n xhr.responseType = 'arraybuffer';\n xhr.send();\n\n xhr.addEventListener('progress', (e) => {\n super.fileProgress(e);\n });\n\n xhr.addEventListener('load', (e) => {\n const decoderPromise = super.fileLoad(e);\n\n decoderPromise.then((audioBuffer) => {\n resolve(audioBuffer);\n }).catch(reject);\n });\n\n xhr.addEventListener('error', () => {\n reject(Error(`Track ${this.src} failed to load`));\n });\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/loader/XHRLoader.js","import { secondsToPixels, pixelsToSeconds } from '../utils/conversions';\n\n/*\n * virtual-dom hook for scrolling the track container.\n */\nexport default class {\n constructor(playlist) {\n this.playlist = playlist;\n }\n\n hook(node) {\n const playlist = this.playlist;\n if (!playlist.isScrolling) {\n const el = node;\n\n if (playlist.isAutomaticScroll) {\n const rect = node.getBoundingClientRect();\n const controlWidth = playlist.controls.show\n ? playlist.controls.width\n : 0;\n const width = pixelsToSeconds(\n rect.width - controlWidth,\n playlist.samplesPerPixel,\n playlist.sampleRate,\n );\n\n const timePoint = playlist.isPlaying()\n ? playlist.playbackSeconds\n : playlist.getTimeSelection().start;\n\n if (\n timePoint < playlist.scrollLeft ||\n timePoint >= playlist.scrollLeft + width\n ) {\n playlist.scrollLeft = Math.min(timePoint, playlist.duration - width);\n }\n }\n\n const left = secondsToPixels(\n playlist.scrollLeft,\n playlist.samplesPerPixel,\n playlist.sampleRate,\n );\n\n el.scrollLeft = left;\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/render/ScrollHook.js","import h from 'virtual-dom/h';\n\nimport { secondsToPixels } from './utils/conversions';\nimport TimeScaleHook from './render/TimeScaleHook';\n\nclass TimeScale {\n constructor(duration, offset, samplesPerPixel, sampleRate, marginLeft = 0, colors) {\n this.duration = duration;\n this.offset = offset;\n this.samplesPerPixel = samplesPerPixel;\n this.sampleRate = sampleRate;\n this.marginLeft = marginLeft;\n this.colors = colors;\n\n this.timeinfo = {\n 20000: {\n marker: 30000,\n bigStep: 10000,\n smallStep: 5000,\n secondStep: 5,\n },\n 12000: {\n marker: 15000,\n bigStep: 5000,\n smallStep: 1000,\n secondStep: 1,\n },\n 10000: {\n marker: 10000,\n bigStep: 5000,\n smallStep: 1000,\n secondStep: 1,\n },\n 5000: {\n marker: 5000,\n bigStep: 1000,\n smallStep: 500,\n secondStep: 1 / 2,\n },\n 2500: {\n marker: 2000,\n bigStep: 1000,\n smallStep: 500,\n secondStep: 1 / 2,\n },\n 1500: {\n marker: 2000,\n bigStep: 1000,\n smallStep: 200,\n secondStep: 1 / 5,\n },\n 700: {\n marker: 1000,\n bigStep: 500,\n smallStep: 100,\n secondStep: 1 / 10,\n },\n };\n }\n\n getScaleInfo(resolution) {\n let keys = Object.keys(this.timeinfo).map(item => parseInt(item, 10));\n\n // make sure keys are numerically sorted.\n keys = keys.sort((a, b) => a - b);\n\n for (let i = 0; i < keys.length; i += 1) {\n if (resolution <= keys[i]) {\n return this.timeinfo[keys[i]];\n }\n }\n\n return this.timeinfo[keys[0]];\n }\n\n /*\n Return time in format mm:ss\n */\n static formatTime(milliseconds) {\n const seconds = milliseconds / 1000;\n let s = seconds % 60;\n const m = (seconds - s) / 60;\n\n if (s < 10) {\n s = `0${s}`;\n }\n\n return `${m}:${s}`;\n }\n\n render() {\n const widthX = secondsToPixels(this.duration, this.samplesPerPixel, this.sampleRate);\n const pixPerSec = this.sampleRate / this.samplesPerPixel;\n const pixOffset = secondsToPixels(this.offset, this.samplesPerPixel, this.sampleRate);\n const scaleInfo = this.getScaleInfo(this.samplesPerPixel);\n const canvasInfo = {};\n const timeMarkers = [];\n const end = widthX + pixOffset;\n let counter = 0;\n\n for (let i = 0; i < end; i += (pixPerSec * scaleInfo.secondStep)) {\n const pixIndex = Math.floor(i);\n const pix = pixIndex - pixOffset;\n\n if (pixIndex >= pixOffset) {\n // put a timestamp every 30 seconds.\n if (scaleInfo.marker && (counter % scaleInfo.marker === 0)) {\n timeMarkers.push(h('div.time',\n {\n attributes: {\n style: `position: absolute; left: ${pix}px;`,\n },\n },\n [TimeScale.formatTime(counter)],\n ));\n\n canvasInfo[pix] = 10;\n } else if (scaleInfo.bigStep && (counter % scaleInfo.bigStep === 0)) {\n canvasInfo[pix] = 5;\n } else if (scaleInfo.smallStep && (counter % scaleInfo.smallStep === 0)) {\n canvasInfo[pix] = 2;\n }\n }\n\n counter += (1000 * scaleInfo.secondStep);\n }\n\n return h('div.playlist-time-scale',\n {\n attributes: {\n style: `position: relative; left: 0; right: 0; margin-left: ${this.marginLeft}px;`,\n },\n },\n [\n timeMarkers,\n h('canvas',\n {\n attributes: {\n width: widthX,\n height: 30,\n style: 'position: absolute; left: 0; right: 0; top: 0; bottom: 0;',\n },\n hook: new TimeScaleHook(canvasInfo, this.offset, this.samplesPerPixel,\n this.duration, this.colors),\n },\n ),\n ],\n );\n }\n}\n\nexport default TimeScale;\n\n\n\n// WEBPACK FOOTER //\n// ./src/TimeScale.js","/*\n* virtual-dom hook for rendering the time scale canvas.\n*/\nexport default class {\n constructor(tickInfo, offset, samplesPerPixel, duration, colors) {\n this.tickInfo = tickInfo;\n this.offset = offset;\n this.samplesPerPixel = samplesPerPixel;\n this.duration = duration;\n this.colors = colors;\n }\n\n hook(canvas, prop, prev) {\n // canvas is up to date\n if (prev !== undefined\n && (prev.offset === this.offset)\n && (prev.duration === this.duration)\n && (prev.samplesPerPixel === this.samplesPerPixel)) {\n return;\n }\n\n const width = canvas.width;\n const height = canvas.height;\n const ctx = canvas.getContext('2d');\n\n ctx.clearRect(0, 0, width, height);\n ctx.fillStyle = this.colors.timeColor;\n\n Object.keys(this.tickInfo).forEach((x) => {\n const scaleHeight = this.tickInfo[x];\n const scaleY = height - scaleHeight;\n ctx.fillRect(x, scaleY, 1, scaleHeight);\n });\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/render/TimeScaleHook.js","import _assign from 'lodash.assign';\nimport _forOwn from 'lodash.forown';\n\nimport uuid from 'uuid';\nimport h from 'virtual-dom/h';\n\nimport extractPeaks from 'webaudio-peaks';\nimport { FADEIN, FADEOUT } from 'fade-maker';\n\nimport { secondsToPixels, secondsToSamples } from './utils/conversions';\nimport stateClasses from './track/states';\n\nimport CanvasHook from './render/CanvasHook';\nimport FadeCanvasHook from './render/FadeCanvasHook';\nimport VolumeSliderHook from './render/VolumeSliderHook';\nimport StereoPanSliderHook from './render/StereoPanSliderHook';\n\nconst MAX_CANVAS_WIDTH = 1000;\n\nexport default class {\n constructor() {\n this.name = 'Untitled';\n this.customClass = undefined;\n this.waveOutlineColor = undefined;\n this.gain = 1;\n this.fades = {};\n this.peakData = {\n type: 'WebAudio',\n mono: false,\n };\n\n this.cueIn = 0;\n this.cueOut = 0;\n this.duration = 0;\n this.startTime = 0;\n this.endTime = 0;\n this.stereoPan = 0;\n }\n\n setEventEmitter(ee) {\n this.ee = ee;\n }\n\n setName(name) {\n this.name = name;\n }\n\n setCustomClass(className) {\n this.customClass = className;\n }\n\n setWaveOutlineColor(color) {\n this.waveOutlineColor = color;\n }\n\n setCues(cueIn, cueOut) {\n if (cueOut < cueIn) {\n throw new Error('cue out cannot be less than cue in');\n }\n\n this.cueIn = cueIn;\n this.cueOut = cueOut;\n this.duration = this.cueOut - this.cueIn;\n this.endTime = this.startTime + this.duration;\n }\n\n /*\n * start, end in seconds relative to the entire playlist.\n */\n trim(start, end) {\n const trackStart = this.getStartTime();\n const trackEnd = this.getEndTime();\n const offset = this.cueIn - trackStart;\n\n if (\n (trackStart <= start && trackEnd >= start) ||\n (trackStart <= end && trackEnd >= end)\n ) {\n const cueIn = start < trackStart ? trackStart : start;\n const cueOut = end > trackEnd ? trackEnd : end;\n\n this.setCues(cueIn + offset, cueOut + offset);\n if (start > trackStart) {\n this.setStartTime(start);\n }\n }\n }\n\n setStartTime(start) {\n this.startTime = start;\n this.endTime = start + this.duration;\n }\n\n setPlayout(playout) {\n this.playout = playout;\n }\n\n setOfflinePlayout(playout) {\n this.offlinePlayout = playout;\n }\n\n setEnabledStates(enabledStates = {}) {\n const defaultStatesEnabled = {\n cursor: true,\n fadein: true,\n fadeout: true,\n select: true,\n shift: true,\n };\n\n this.enabledStates = _assign({}, defaultStatesEnabled, enabledStates);\n }\n\n setFadeIn(duration, shape = 'logarithmic') {\n if (duration > this.duration) {\n throw new Error('Invalid Fade In');\n }\n\n const fade = {\n shape,\n start: 0,\n end: duration,\n };\n\n if (this.fadeIn) {\n this.removeFade(this.fadeIn);\n this.fadeIn = undefined;\n }\n\n this.fadeIn = this.saveFade(FADEIN, fade.shape, fade.start, fade.end);\n }\n\n setFadeOut(duration, shape = 'logarithmic') {\n if (duration > this.duration) {\n throw new Error('Invalid Fade Out');\n }\n\n const fade = {\n shape,\n start: this.duration - duration,\n end: this.duration,\n };\n\n if (this.fadeOut) {\n this.removeFade(this.fadeOut);\n this.fadeOut = undefined;\n }\n\n this.fadeOut = this.saveFade(FADEOUT, fade.shape, fade.start, fade.end);\n }\n\n saveFade(type, shape, start, end) {\n const id = uuid.v4();\n\n this.fades[id] = {\n type,\n shape,\n start,\n end,\n };\n\n return id;\n }\n\n removeFade(id) {\n delete this.fades[id];\n }\n\n setBuffer(buffer) {\n this.buffer = buffer;\n }\n\n setPeakData(data) {\n this.peakData = data;\n }\n\n calculatePeaks(samplesPerPixel, sampleRate) {\n const cueIn = secondsToSamples(this.cueIn, sampleRate);\n const cueOut = secondsToSamples(this.cueOut, sampleRate);\n\n this.setPeaks(\n extractPeaks(\n this.buffer,\n samplesPerPixel,\n this.peakData.mono,\n cueIn,\n cueOut,\n ),\n );\n }\n\n setPeaks(peaks) {\n this.peaks = peaks;\n }\n\n setState(state) {\n this.state = state;\n\n if (this.state && this.enabledStates[this.state]) {\n const StateClass = stateClasses[this.state];\n this.stateObj = new StateClass(this);\n } else {\n this.stateObj = undefined;\n }\n }\n\n getStartTime() {\n return this.startTime;\n }\n\n getEndTime() {\n return this.endTime;\n }\n\n getDuration() {\n return this.duration;\n }\n\n isPlaying() {\n return this.playout.isPlaying();\n }\n\n setShouldPlay(bool) {\n this.playout.setShouldPlay(bool);\n }\n\n setGainLevel(level) {\n this.gain = level;\n this.playout.setVolumeGainLevel(level);\n }\n\n setMasterGainLevel(level) {\n this.playout.setMasterGainLevel(level);\n }\n\n setStereoPanValue(value) {\n this.stereoPan = value;\n this.playout.setStereoPanValue(value);\n }\n\n /*\n startTime, endTime in seconds (float).\n segment is for a highlighted section in the UI.\n\n returns a Promise that will resolve when the AudioBufferSource\n is either stopped or plays out naturally.\n */\n schedulePlay(now, startTime, endTime, config) {\n let start;\n let duration;\n let when = now;\n let segment = endTime ? endTime - startTime : undefined;\n\n const defaultOptions = {\n shouldPlay: true,\n masterGain: 1,\n isOffline: false,\n };\n\n const options = _assign({}, defaultOptions, config);\n const playoutSystem = options.isOffline\n ? this.offlinePlayout\n : this.playout;\n\n // 1) track has no content to play.\n // 2) track does not play in this selection.\n if (\n this.endTime <= startTime ||\n (segment && startTime + segment < this.startTime)\n ) {\n // return a resolved promise since this track is technically \"stopped\".\n return Promise.resolve();\n }\n\n // track should have something to play if it gets here.\n\n // the track starts in the future or on the cursor position\n if (this.startTime >= startTime) {\n start = 0;\n // schedule additional delay for this audio node.\n when += this.startTime - startTime;\n\n if (endTime) {\n segment -= this.startTime - startTime;\n duration = Math.min(segment, this.duration);\n } else {\n duration = this.duration;\n }\n } else {\n start = startTime - this.startTime;\n\n if (endTime) {\n duration = Math.min(segment, this.duration - start);\n } else {\n duration = this.duration - start;\n }\n }\n\n start += this.cueIn;\n const relPos = startTime - this.startTime;\n const sourcePromise = playoutSystem.setUpSource();\n\n // param relPos: cursor position in seconds relative to this track.\n // can be negative if the cursor is placed before the start of this track etc.\n _forOwn(this.fades, (fade) => {\n let fadeStart;\n let fadeDuration;\n\n // only apply fade if it's ahead of the cursor.\n if (relPos < fade.end) {\n if (relPos <= fade.start) {\n fadeStart = now + (fade.start - relPos);\n fadeDuration = fade.end - fade.start;\n } else if (relPos > fade.start && relPos < fade.end) {\n fadeStart = now - (relPos - fade.start);\n fadeDuration = fade.end - fade.start;\n }\n\n switch (fade.type) {\n case FADEIN: {\n playoutSystem.applyFadeIn(fadeStart, fadeDuration, fade.shape);\n break;\n }\n case FADEOUT: {\n playoutSystem.applyFadeOut(fadeStart, fadeDuration, fade.shape);\n break;\n }\n default: {\n throw new Error('Invalid fade type saved on track.');\n }\n }\n }\n });\n\n playoutSystem.setVolumeGainLevel(this.gain);\n playoutSystem.setShouldPlay(options.shouldPlay);\n playoutSystem.setMasterGainLevel(options.masterGain);\n playoutSystem.setStereoPanValue(this.stereoPan);\n playoutSystem.play(when, start, duration);\n\n return sourcePromise;\n }\n\n scheduleStop(when = 0) {\n this.playout.stop(when);\n }\n\n renderOverlay(data) {\n const channelPixels = secondsToPixels(\n data.playlistLength,\n data.resolution,\n data.sampleRate,\n );\n\n const config = {\n attributes: {\n style: `position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: ${channelPixels}px; z-index: 9;`,\n },\n };\n\n let overlayClass = '';\n\n if (this.stateObj) {\n this.stateObj.setup(data.resolution, data.sampleRate);\n const StateClass = stateClasses[this.state];\n const events = StateClass.getEvents();\n\n events.forEach((event) => {\n config[`on${event}`] = this.stateObj[event].bind(this.stateObj);\n });\n\n overlayClass = StateClass.getClass();\n }\n // use this overlay for track event cursor position calculations.\n return h(`div.playlist-overlay${overlayClass}`, config);\n }\n\n renderControls(data) {\n const muteClass = data.muted ? '.active' : '';\n const soloClass = data.soloed ? '.active' : '';\n const isCollapsed = data.collapsed;\n const numChan = this.peaks.data.length;\n const widgets = data.controls.widgets;\n\n const removeTrack = h(\n 'button.btn.btn-danger.btn-sm.track-remove',\n {\n attributes: {\n type: 'button',\n title: 'Remove track',\n },\n onclick: () => {\n this.ee.emit('removeTrack', this);\n },\n },\n [h('i.fas.fa-times')],\n );\n\n const trackName = h(\n 'span',\n [this.name],\n );\n\n const collapseTrack = h(\n 'button.btn.btn-info.btn-sm.track-collapse',\n {\n attributes: {\n type: 'button',\n title: isCollapsed ? 'Expand track' : 'Collapse track',\n },\n onclick: () => {\n this.ee.emit('changeTrackView', this, {\n collapsed: !isCollapsed,\n });\n },\n },\n [h(`i.fas.${isCollapsed ? 'fa-caret-down' : 'fa-caret-up'}`)],\n );\n\n const headerChildren = [];\n\n if (widgets.remove) {\n headerChildren.push(removeTrack);\n }\n headerChildren.push(trackName);\n if (widgets.collapse) {\n headerChildren.push(collapseTrack);\n }\n\n const controls = [\n h('div.track-header', headerChildren),\n ];\n\n if (!isCollapsed) {\n if (widgets.muteOrSolo) {\n controls.push(\n h('div.btn-group', [\n h(\n `button.btn.btn-outline-dark.btn-xs.btn-mute${muteClass}`,\n {\n attributes: {\n type: 'button',\n },\n onclick: () => {\n this.ee.emit('mute', this);\n },\n },\n ['Mute'],\n ),\n h(\n `button.btn.btn-outline-dark.btn-xs.btn-solo${soloClass}`,\n {\n onclick: () => {\n this.ee.emit('solo', this);\n },\n },\n ['Solo'],\n ),\n ]),\n );\n }\n\n if (widgets.volume) {\n controls.push(\n h('label.volume', [\n h('input.volume-slider', {\n attributes: {\n 'aria-label': 'Track volume control',\n type: 'range',\n min: 0,\n max: 100,\n value: 100,\n },\n hook: new VolumeSliderHook(this.gain),\n oninput: (e) => {\n this.ee.emit('volumechange', e.target.value, this);\n },\n }),\n ]),\n );\n }\n\n if (widgets.stereoPan) {\n controls.push(\n h('label.stereopan', [\n h('input.stereopan-slider', {\n attributes: {\n 'aria-label': 'Track stereo pan control',\n type: 'range',\n min: -100,\n max: 100,\n value: 100,\n },\n hook: new StereoPanSliderHook(this.stereoPan),\n oninput: (e) => {\n this.ee.emit('stereopan', e.target.value / 100, this);\n },\n }),\n ]),\n );\n }\n }\n\n return h(\n 'div.controls',\n {\n attributes: {\n style: `height: ${numChan * data.height}px; width: ${\n data.controls.width\n }px; position: absolute; left: 0; z-index: 10;`,\n },\n },\n controls,\n );\n }\n\n render(data) {\n const width = this.peaks.length;\n const playbackX = secondsToPixels(\n data.playbackSeconds,\n data.resolution,\n data.sampleRate,\n );\n const startX = secondsToPixels(\n this.startTime,\n data.resolution,\n data.sampleRate,\n );\n const endX = secondsToPixels(\n this.endTime,\n data.resolution,\n data.sampleRate,\n );\n let progressWidth = 0;\n const numChan = this.peaks.data.length;\n const scale = Math.floor(window.devicePixelRatio);\n\n if (playbackX > 0 && playbackX > startX) {\n if (playbackX < endX) {\n progressWidth = playbackX - startX;\n } else {\n progressWidth = width;\n }\n }\n\n const waveformChildren = [\n h('div.cursor', {\n attributes: {\n style: `position: absolute; width: 1px; margin: 0; padding: 0; top: 0; left: ${playbackX}px; bottom: 0; z-index: 5;`,\n },\n }),\n ];\n\n const channels = Object.keys(this.peaks.data).map((channelNum) => {\n const channelChildren = [\n h('div.channel-progress', {\n attributes: {\n style: `position: absolute; width: ${progressWidth}px; height: ${data.height}px; z-index: 2;`,\n },\n }),\n ];\n let offset = 0;\n let totalWidth = width;\n const peaks = this.peaks.data[channelNum];\n\n while (totalWidth > 0) {\n const currentWidth = Math.min(totalWidth, MAX_CANVAS_WIDTH);\n const canvasColor = this.waveOutlineColor\n ? this.waveOutlineColor\n : data.colors.waveOutlineColor;\n\n channelChildren.push(\n h('canvas', {\n attributes: {\n width: currentWidth * scale,\n height: data.height * scale,\n style: `float: left; position: relative; margin: 0; padding: 0; z-index: 3; width: ${currentWidth}px; height: ${data.height}px;`,\n },\n hook: new CanvasHook(\n peaks,\n offset,\n this.peaks.bits,\n canvasColor,\n scale,\n data.height,\n ),\n }),\n );\n\n totalWidth -= currentWidth;\n offset += MAX_CANVAS_WIDTH;\n }\n\n // if there are fades, display them.\n if (this.fadeIn) {\n const fadeIn = this.fades[this.fadeIn];\n const fadeWidth = secondsToPixels(\n fadeIn.end - fadeIn.start,\n data.resolution,\n data.sampleRate,\n );\n\n channelChildren.push(\n h(\n 'div.wp-fade.wp-fadein',\n {\n attributes: {\n style: `position: absolute; height: ${data.height}px; width: ${fadeWidth}px; top: 0; left: 0; z-index: 4;`,\n },\n },\n [\n h('canvas', {\n attributes: {\n width: fadeWidth,\n height: data.height,\n },\n hook: new FadeCanvasHook(\n fadeIn.type,\n fadeIn.shape,\n fadeIn.end - fadeIn.start,\n data.resolution,\n ),\n }),\n ],\n ),\n );\n }\n\n if (this.fadeOut) {\n const fadeOut = this.fades[this.fadeOut];\n const fadeWidth = secondsToPixels(\n fadeOut.end - fadeOut.start,\n data.resolution,\n data.sampleRate,\n );\n\n channelChildren.push(\n h(\n 'div.wp-fade.wp-fadeout',\n {\n attributes: {\n style: `position: absolute; height: ${data.height}px; width: ${fadeWidth}px; top: 0; right: 0; z-index: 4;`,\n },\n },\n [\n h('canvas', {\n attributes: {\n width: fadeWidth,\n height: data.height,\n },\n hook: new FadeCanvasHook(\n fadeOut.type,\n fadeOut.shape,\n fadeOut.end - fadeOut.start,\n data.resolution,\n ),\n }),\n ],\n ),\n );\n }\n\n return h(\n `div.channel.channel-${channelNum}`,\n {\n attributes: {\n style: `height: ${data.height}px; width: ${width}px; top: ${\n channelNum * data.height\n }px; left: ${startX}px; position: absolute; margin: 0; padding: 0; z-index: 1;`,\n },\n },\n channelChildren,\n );\n });\n\n waveformChildren.push(channels);\n waveformChildren.push(this.renderOverlay(data));\n\n // draw cursor selection on active track.\n if (data.isActive === true) {\n const cStartX = secondsToPixels(\n data.timeSelection.start,\n data.resolution,\n data.sampleRate,\n );\n const cEndX = secondsToPixels(\n data.timeSelection.end,\n data.resolution,\n data.sampleRate,\n );\n const cWidth = (cEndX - cStartX) + 1;\n const cClassName = cWidth > 1 ? '.segment' : '.point';\n\n waveformChildren.push(\n h(`div.selection${cClassName}`, {\n attributes: {\n style: `position: absolute; width: ${cWidth}px; bottom: 0; top: 0; left: ${cStartX}px; z-index: 4;`,\n },\n }),\n );\n }\n\n const waveform = h(\n 'div.waveform',\n {\n attributes: {\n style: `height: ${numChan * data.height}px; position: relative;`,\n },\n },\n waveformChildren,\n );\n\n const channelChildren = [];\n let channelMargin = 0;\n\n if (data.controls.show) {\n channelChildren.push(this.renderControls(data));\n channelMargin = data.controls.width;\n }\n\n channelChildren.push(waveform);\n\n const audibleClass = data.shouldPlay ? '' : '.silent';\n const customClass =\n this.customClass === undefined ? '' : `.${this.customClass}`;\n\n return h(\n `div.channel-wrapper${audibleClass}${customClass}`,\n {\n attributes: {\n style: `margin-left: ${channelMargin}px; height: ${\n data.height * numChan\n }px;`,\n },\n },\n channelChildren,\n );\n }\n\n getTrackDetails() {\n const info = {\n src: this.src,\n start: this.startTime,\n end: this.endTime,\n name: this.name,\n customClass: this.customClass,\n cuein: this.cueIn,\n cueout: this.cueOut,\n stereoPan: this.stereoPan,\n gain: this.gain,\n };\n\n if (this.fadeIn) {\n const fadeIn = this.fades[this.fadeIn];\n\n info.fadeIn = {\n shape: fadeIn.shape,\n duration: fadeIn.end - fadeIn.start,\n };\n }\n\n if (this.fadeOut) {\n const fadeOut = this.fades[this.fadeOut];\n\n info.fadeOut = {\n shape: fadeOut.shape,\n duration: fadeOut.end - fadeOut.start,\n };\n }\n\n return info;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Track.js","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */\nvar nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = assign;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.assign/index.js\n// module id = 70\n// module chunks = 0","/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\n/**\n * The base implementation of `_.forOwn` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Object} Returns `object`.\n */\nfunction baseForOwn(object, iteratee) {\n return object && baseFor(object, iteratee, keys);\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Iterates over own enumerable string keyed properties of an object and\n * invokes `iteratee` for each property. The iteratee is invoked with three\n * arguments: (value, key, object). Iteratee functions may exit iteration\n * early by explicitly returning `false`.\n *\n * @static\n * @memberOf _\n * @since 0.3.0\n * @category Object\n * @param {Object} object The object to iterate over.\n * @param {Function} [iteratee=_.identity] The function invoked per iteration.\n * @returns {Object} Returns `object`.\n * @see _.forOwnRight\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.forOwn(new Foo, function(value, key) {\n * console.log(key);\n * });\n * // => Logs 'a' then 'b' (iteration order is not guaranteed).\n */\nfunction forOwn(object, iteratee) {\n return object && baseForOwn(object, typeof iteratee == 'function' ? iteratee : identity);\n}\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\n/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = forOwn;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/lodash.forown/index.js\n// module id = 71\n// module chunks = 0","// uuid.js\n//\n// Copyright (c) 2010-2012 Robert Kieffer\n// MIT License - http://opensource.org/licenses/mit-license.php\n\n// Unique ID creation requires a high quality random # generator. We feature\n// detect to determine the best RNG source, normalizing to a function that\n// returns 128-bits of randomness, since that's what's usually required\nvar _rng = require('./rng');\n\n// Maps for number <-> hex string conversion\nvar _byteToHex = [];\nvar _hexToByte = {};\nfor (var i = 0; i < 256; i++) {\n _byteToHex[i] = (i + 0x100).toString(16).substr(1);\n _hexToByte[_byteToHex[i]] = i;\n}\n\n// **`parse()` - Parse a UUID into it's component bytes**\nfunction parse(s, buf, offset) {\n var i = (buf && offset) || 0, ii = 0;\n\n buf = buf || [];\n s.toLowerCase().replace(/[0-9a-f]{2}/g, function(oct) {\n if (ii < 16) { // Don't overflow!\n buf[i + ii++] = _hexToByte[oct];\n }\n });\n\n // Zero out remaining bytes if string was short\n while (ii < 16) {\n buf[i + ii++] = 0;\n }\n\n return buf;\n}\n\n// **`unparse()` - Convert UUID byte array (ala parse()) into a string**\nfunction unparse(buf, offset) {\n var i = offset || 0, bth = _byteToHex;\n return bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] + '-' +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]] +\n bth[buf[i++]] + bth[buf[i++]];\n}\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\n// random #'s we need to init node and clockseq\nvar _seedBytes = _rng();\n\n// Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\nvar _nodeId = [\n _seedBytes[0] | 0x01,\n _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5]\n];\n\n// Per 4.2.2, randomize (14 bit) clockseq\nvar _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff;\n\n// Previous uuid creation time\nvar _lastMSecs = 0, _lastNSecs = 0;\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n var node = options.node || _nodeId;\n for (var n = 0; n < 6; n++) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : unparse(b);\n}\n\n// **`v4()` - Generate random UUID**\n\n// See https://github.com/broofa/node-uuid for API details\nfunction v4(options, buf, offset) {\n // Deprecated - 'format' argument, as supported in v1.2\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options == 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || _rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ii++) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || unparse(rnds);\n}\n\n// Export public API\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\nuuid.parse = parse;\nuuid.unparse = unparse;\n\nmodule.exports = uuid;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/uuid/uuid.js\n// module id = 72\n// module chunks = 0","\nvar rng;\n\nvar crypto = global.crypto || global.msCrypto; // for IE 11\nif (crypto && crypto.getRandomValues) {\n // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto\n // Moderately fast, high quality\n var _rnds8 = new Uint8Array(16);\n rng = function whatwgRNG() {\n crypto.getRandomValues(_rnds8);\n return _rnds8;\n };\n}\n\nif (!rng) {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var _rnds = new Array(16);\n rng = function() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n _rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return _rnds;\n };\n}\n\nmodule.exports = rng;\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/uuid/rng-browser.js\n// module id = 73\n// module chunks = 0","'use strict';\n\n//http://jsperf.com/typed-array-min-max/2\n//plain for loop for finding min/max is way faster than anything else.\n/**\n* @param {TypedArray} array - Subarray of audio to calculate peaks from.\n*/\nfunction findMinMax(array) {\n var min = Infinity;\n var max = -Infinity;\n var i = 0;\n var len = array.length;\n var curr;\n\n for(; i < len; i++) {\n curr = array[i];\n if (min > curr) {\n min = curr;\n }\n if (max < curr) {\n max = curr;\n }\n }\n\n return {\n min: min,\n max: max\n };\n}\n\n/**\n* @param {Number} n - peak to convert from float to Int8, Int16 etc.\n* @param {Number} bits - convert to #bits two's complement signed integer\n*/\nfunction convert(n, bits) {\n var max = Math.pow(2, bits-1);\n var v = n < 0 ? n * max : n * max - 1;\n return Math.max(-max, Math.min(max-1, v));\n}\n\n/**\n* @param {TypedArray} channel - Audio track frames to calculate peaks from.\n* @param {Number} samplesPerPixel - Audio frames per peak\n*/\nfunction extractPeaks(channel, samplesPerPixel, bits) {\n var i;\n var chanLength = channel.length;\n var numPeaks = Math.ceil(chanLength / samplesPerPixel);\n var start;\n var end;\n var segment;\n var max; \n var min;\n var extrema;\n\n //create interleaved array of min,max\n var peaks = new (new Function(`return Int${bits}Array`)())(numPeaks*2);\n\n for (i = 0; i < numPeaks; i++) {\n\n start = i * samplesPerPixel;\n end = (i + 1) * samplesPerPixel > chanLength ? chanLength : (i + 1) * samplesPerPixel;\n\n segment = channel.subarray(start, end);\n extrema = findMinMax(segment);\n min = convert(extrema.min, bits);\n max = convert(extrema.max, bits);\n\n peaks[i*2] = min;\n peaks[i*2+1] = max;\n }\n\n return peaks;\n}\n\nfunction makeMono(channelPeaks, bits) {\n var numChan = channelPeaks.length;\n var weight = 1 / numChan;\n var numPeaks = channelPeaks[0].length / 2;\n var c = 0;\n var i = 0;\n var min;\n var max;\n var peaks = new (new Function(`return Int${bits}Array`)())(numPeaks*2);\n \n\n for (i = 0; i < numPeaks; i++) {\n min = 0;\n max = 0;\n\n for (c = 0; c < numChan; c++) {\n min += weight * channelPeaks[c][i*2];\n max += weight * channelPeaks[c][i*2+1];\n }\n\n peaks[i*2] = min;\n peaks[i*2+1] = max;\n }\n\n //return in array so channel number counts still work.\n return [peaks];\n}\n\n/**\n* @param {AudioBuffer,TypedArray} source - Source of audio samples for peak calculations.\n* @param {Number} samplesPerPixel - Number of audio samples per peak.\n* @param {Number} cueIn - index in channel to start peak calculations from.\n* @param {Number} cueOut - index in channel to end peak calculations from (non-inclusive).\n*/\nmodule.exports = function(source, samplesPerPixel, isMono, cueIn, cueOut, bits) {\n samplesPerPixel = samplesPerPixel || 10000;\n bits = bits || 8;\n \n if (isMono === null || isMono === undefined) {\n isMono = true;\n }\n\n if ([8, 16, 32].indexOf(bits) < 0) {\n throw new Error(\"Invalid number of bits specified for peaks.\");\n }\n\n var numChan = source.numberOfChannels;\n var peaks = [];\n var c;\n var numPeaks;\n var channel;\n var slice;\n\n if (typeof source.subarray === \"undefined\") {\n for (c = 0; c < numChan; c++) {\n channel = source.getChannelData(c);\n cueIn = cueIn || 0;\n cueOut = cueOut || channel.length;\n slice = channel.subarray(cueIn, cueOut);\n peaks.push(extractPeaks(slice, samplesPerPixel, bits));\n }\n }\n else {\n cueIn = cueIn || 0;\n cueOut = cueOut || source.length;\n peaks.push(extractPeaks(source.subarray(cueIn, cueOut), samplesPerPixel, bits));\n }\n\n if (isMono && peaks.length > 1) {\n peaks = makeMono(peaks, bits);\n }\n\n numPeaks = peaks[0].length / 2;\n\n return {\n length: numPeaks,\n data: peaks,\n bits: bits\n };\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/webaudio-peaks/index.js\n// module id = 74\n// module chunks = 0","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.FADEOUT = exports.FADEIN = exports.LOGARITHMIC = exports.EXPONENTIAL = exports.LINEAR = exports.SCURVE = undefined;\nexports.createFadeIn = createFadeIn;\nexports.createFadeOut = createFadeOut;\n\nvar _fadeCurves = require('fade-curves');\n\nvar SCURVE = exports.SCURVE = \"sCurve\";\nvar LINEAR = exports.LINEAR = \"linear\";\nvar EXPONENTIAL = exports.EXPONENTIAL = \"exponential\";\nvar LOGARITHMIC = exports.LOGARITHMIC = \"logarithmic\";\n\nvar FADEIN = exports.FADEIN = \"FadeIn\";\nvar FADEOUT = exports.FADEOUT = \"FadeOut\";\n\nfunction sCurveFadeIn(start, duration) {\n var curve = (0, _fadeCurves.sCurve)(10000, 1);\n this.setValueCurveAtTime(curve, start, duration);\n}\n\nfunction sCurveFadeOut(start, duration) {\n var curve = (0, _fadeCurves.sCurve)(10000, -1);\n this.setValueCurveAtTime(curve, start, duration);\n}\n\nfunction linearFadeIn(start, duration) {\n this.linearRampToValueAtTime(0, start);\n this.linearRampToValueAtTime(1, start + duration);\n}\n\nfunction linearFadeOut(start, duration) {\n this.linearRampToValueAtTime(1, start);\n this.linearRampToValueAtTime(0, start + duration);\n}\n\nfunction exponentialFadeIn(start, duration) {\n this.exponentialRampToValueAtTime(0.01, start);\n this.exponentialRampToValueAtTime(1, start + duration);\n}\n\nfunction exponentialFadeOut(start, duration) {\n this.exponentialRampToValueAtTime(1, start);\n this.exponentialRampToValueAtTime(0.01, start + duration);\n}\n\nfunction logarithmicFadeIn(start, duration) {\n var curve = (0, _fadeCurves.logarithmic)(10000, 10, 1);\n this.setValueCurveAtTime(curve, start, duration);\n}\n\nfunction logarithmicFadeOut(start, duration) {\n var curve = (0, _fadeCurves.logarithmic)(10000, 10, -1);\n this.setValueCurveAtTime(curve, start, duration);\n}\n\nfunction createFadeIn(gain, shape, start, duration) {\n switch (shape) {\n case SCURVE:\n sCurveFadeIn.call(gain, start, duration);\n break;\n case LINEAR:\n linearFadeIn.call(gain, start, duration);\n break;\n case EXPONENTIAL:\n exponentialFadeIn.call(gain, start, duration);\n break;\n case LOGARITHMIC:\n logarithmicFadeIn.call(gain, start, duration);\n break;\n default:\n throw new Error(\"Unsupported Fade type\");\n }\n}\n\nfunction createFadeOut(gain, shape, start, duration) {\n switch (shape) {\n case SCURVE:\n sCurveFadeOut.call(gain, start, duration);\n break;\n case LINEAR:\n linearFadeOut.call(gain, start, duration);\n break;\n case EXPONENTIAL:\n exponentialFadeOut.call(gain, start, duration);\n break;\n case LOGARITHMIC:\n logarithmicFadeOut.call(gain, start, duration);\n break;\n default:\n throw new Error(\"Unsupported Fade type\");\n }\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fade-maker/index.js\n// module id = 75\n// module chunks = 0","'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.linear = linear;\nexports.exponential = exponential;\nexports.sCurve = sCurve;\nexports.logarithmic = logarithmic;\nfunction linear(length, rotation) {\n var curve = new Float32Array(length),\n i,\n x,\n scale = length - 1;\n\n for (i = 0; i < length; i++) {\n x = i / scale;\n\n if (rotation > 0) {\n curve[i] = x;\n } else {\n curve[i] = 1 - x;\n }\n }\n\n return curve;\n}\n\nfunction exponential(length, rotation) {\n var curve = new Float32Array(length),\n i,\n x,\n scale = length - 1,\n index;\n\n for (i = 0; i < length; i++) {\n x = i / scale;\n index = rotation > 0 ? i : length - 1 - i;\n\n curve[index] = Math.exp(2 * x - 1) / Math.exp(1);\n }\n\n return curve;\n}\n\n//creating a curve to simulate an S-curve with setValueCurveAtTime.\nfunction sCurve(length, rotation) {\n var curve = new Float32Array(length),\n i,\n phase = rotation > 0 ? Math.PI / 2 : -(Math.PI / 2);\n\n for (i = 0; i < length; ++i) {\n curve[i] = Math.sin(Math.PI * i / length - phase) / 2 + 0.5;\n }\n return curve;\n}\n\n//creating a curve to simulate a logarithmic curve with setValueCurveAtTime.\nfunction logarithmic(length, base, rotation) {\n var curve = new Float32Array(length),\n index,\n x = 0,\n i;\n\n for (i = 0; i < length; i++) {\n //index for the curve array.\n index = rotation > 0 ? i : length - 1 - i;\n\n x = i / length;\n curve[index] = Math.log(1 + base * x) / Math.log(1 + base);\n }\n\n return curve;\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fade-curves/index.js\n// module id = 76\n// module chunks = 0","import cursor from './states/CursorState';\nimport select from './states/SelectState';\nimport shift from './states/ShiftState';\nimport fadein from './states/FadeInState';\nimport fadeout from './states/FadeOutState';\n\nexport default {\n cursor,\n select,\n shift,\n fadein,\n fadeout,\n};\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/states.js","import { pixelsToSeconds } from '../../utils/conversions';\n\nexport default class {\n constructor(track) {\n this.track = track;\n }\n\n setup(samplesPerPixel, sampleRate) {\n this.samplesPerPixel = samplesPerPixel;\n this.sampleRate = sampleRate;\n }\n\n click(e) {\n e.preventDefault();\n\n const startX = e.offsetX;\n const startTime = pixelsToSeconds(startX, this.samplesPerPixel, this.sampleRate);\n\n this.track.ee.emit('select', startTime, startTime, this.track);\n }\n\n static getClass() {\n return '.state-cursor';\n }\n\n static getEvents() {\n return ['click'];\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/states/CursorState.js","import { pixelsToSeconds } from '../../utils/conversions';\n\nexport default class {\n constructor(track) {\n this.track = track;\n this.active = false;\n }\n\n setup(samplesPerPixel, sampleRate) {\n this.samplesPerPixel = samplesPerPixel;\n this.sampleRate = sampleRate;\n }\n\n emitSelection(x) {\n const minX = Math.min(x, this.startX);\n const maxX = Math.max(x, this.startX);\n const startTime = pixelsToSeconds(minX, this.samplesPerPixel, this.sampleRate);\n const endTime = pixelsToSeconds(maxX, this.samplesPerPixel, this.sampleRate);\n\n this.track.ee.emit('select', startTime, endTime, this.track);\n }\n\n complete(x) {\n this.emitSelection(x);\n this.active = false;\n }\n\n mousedown(e) {\n e.preventDefault();\n this.active = true;\n\n this.startX = e.offsetX;\n const startTime = pixelsToSeconds(this.startX, this.samplesPerPixel, this.sampleRate);\n\n this.track.ee.emit('select', startTime, startTime, this.track);\n }\n\n mousemove(e) {\n if (this.active) {\n e.preventDefault();\n this.emitSelection(e.offsetX);\n }\n }\n\n mouseup(e) {\n if (this.active) {\n e.preventDefault();\n this.complete(e.offsetX);\n }\n }\n\n mouseleave(e) {\n if (this.active) {\n e.preventDefault();\n this.complete(e.offsetX);\n }\n }\n\n static getClass() {\n return '.state-select';\n }\n\n static getEvents() {\n return ['mousedown', 'mousemove', 'mouseup', 'mouseleave'];\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/states/SelectState.js","import { pixelsToSeconds } from '../../utils/conversions';\n\nexport default class {\n constructor(track) {\n this.track = track;\n this.active = false;\n }\n\n setup(samplesPerPixel, sampleRate) {\n this.samplesPerPixel = samplesPerPixel;\n this.sampleRate = sampleRate;\n }\n\n emitShift(x) {\n const deltaX = x - this.prevX;\n const deltaTime = pixelsToSeconds(deltaX, this.samplesPerPixel, this.sampleRate);\n this.prevX = x;\n this.track.ee.emit('shift', deltaTime, this.track);\n }\n\n complete(x) {\n this.emitShift(x);\n this.active = false;\n }\n\n mousedown(e) {\n e.preventDefault();\n\n this.active = true;\n this.el = e.target;\n this.prevX = e.offsetX;\n }\n\n mousemove(e) {\n if (this.active) {\n e.preventDefault();\n this.emitShift(e.offsetX);\n }\n }\n\n mouseup(e) {\n if (this.active) {\n e.preventDefault();\n this.complete(e.offsetX);\n }\n }\n\n mouseleave(e) {\n if (this.active) {\n e.preventDefault();\n this.complete(e.offsetX);\n }\n }\n\n static getClass() {\n return '.state-shift';\n }\n\n static getEvents() {\n return ['mousedown', 'mousemove', 'mouseup', 'mouseleave'];\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/states/ShiftState.js","import { pixelsToSeconds } from '../../utils/conversions';\n\nexport default class {\n constructor(track) {\n this.track = track;\n }\n\n setup(samplesPerPixel, sampleRate) {\n this.samplesPerPixel = samplesPerPixel;\n this.sampleRate = sampleRate;\n }\n\n click(e) {\n const startX = e.offsetX;\n const time = pixelsToSeconds(startX, this.samplesPerPixel, this.sampleRate);\n\n if (time > this.track.getStartTime() && time < this.track.getEndTime()) {\n this.track.ee.emit('fadein', time - this.track.getStartTime(), this.track);\n }\n }\n\n static getClass() {\n return '.state-fadein';\n }\n\n static getEvents() {\n return ['click'];\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/states/FadeInState.js","import { pixelsToSeconds } from '../../utils/conversions';\n\nexport default class {\n constructor(track) {\n this.track = track;\n }\n\n setup(samplesPerPixel, sampleRate) {\n this.samplesPerPixel = samplesPerPixel;\n this.sampleRate = sampleRate;\n }\n\n click(e) {\n const startX = e.offsetX;\n const time = pixelsToSeconds(startX, this.samplesPerPixel, this.sampleRate);\n\n if (time > this.track.getStartTime() && time < this.track.getEndTime()) {\n this.track.ee.emit('fadeout', this.track.getEndTime() - time, this.track);\n }\n }\n\n static getClass() {\n return '.state-fadeout';\n }\n\n static getEvents() {\n return ['click'];\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/track/states/FadeOutState.js","/*\n * virtual-dom hook for drawing to the canvas element.\n */\nclass CanvasHook {\n constructor(peaks, offset, bits, color, scale, height) {\n this.peaks = peaks;\n // http://stackoverflow.com/questions/6081483/maximum-size-of-a-canvas-element\n this.offset = offset;\n this.color = color;\n this.bits = bits;\n this.scale = scale;\n this.height = height;\n }\n\n static drawFrame(cc, h2, x, minPeak, maxPeak) {\n const min = Math.abs(minPeak * h2);\n const max = Math.abs(maxPeak * h2);\n\n // draw max\n cc.fillRect(x, 0, 1, h2 - max);\n // draw min\n cc.fillRect(x, h2 + min, 1, h2 - min);\n }\n\n hook(canvas, prop, prev) {\n // canvas is up to date\n if (\n prev !== undefined &&\n prev.peaks === this.peaks &&\n prev.scale === this.scale &&\n prev.height === this.height\n ) {\n return;\n }\n\n const scale = this.scale;\n const len = canvas.width / scale;\n const cc = canvas.getContext('2d');\n const h2 = canvas.height / scale / 2;\n const maxValue = 2 ** (this.bits - 1);\n\n cc.clearRect(0, 0, canvas.width, canvas.height);\n\n cc.save();\n cc.fillStyle = this.color;\n cc.scale(scale, scale);\n\n for (let i = 0; i < len; i += 1) {\n const minPeak = this.peaks[(i + this.offset) * 2] / maxValue;\n const maxPeak = this.peaks[((i + this.offset) * 2) + 1] / maxValue;\n CanvasHook.drawFrame(cc, h2, i, minPeak, maxPeak);\n }\n\n cc.restore();\n }\n}\n\nexport default CanvasHook;\n\n\n\n// WEBPACK FOOTER //\n// ./src/render/CanvasHook.js","import { FADEIN, FADEOUT, SCURVE, LINEAR, EXPONENTIAL, LOGARITHMIC } from 'fade-maker';\nimport { sCurve, logarithmic, linear, exponential } from 'fade-curves';\n\n/*\n* virtual-dom hook for drawing the fade curve to the canvas element.\n*/\nclass FadeCanvasHook {\n constructor(type, shape, duration, samplesPerPixel) {\n this.type = type;\n this.shape = shape;\n this.duration = duration;\n this.samplesPerPixel = samplesPerPixel;\n }\n\n static createCurve(shape, type, width) {\n let reflection;\n let curve;\n\n switch (type) {\n case FADEIN: {\n reflection = 1;\n break;\n }\n case FADEOUT: {\n reflection = -1;\n break;\n }\n default: {\n throw new Error('Unsupported fade type.');\n }\n }\n\n switch (shape) {\n case SCURVE: {\n curve = sCurve(width, reflection);\n break;\n }\n case LINEAR: {\n curve = linear(width, reflection);\n break;\n }\n case EXPONENTIAL: {\n curve = exponential(width, reflection);\n break;\n }\n case LOGARITHMIC: {\n curve = logarithmic(width, 10, reflection);\n break;\n }\n default: {\n throw new Error('Unsupported fade shape');\n }\n }\n\n return curve;\n }\n\n hook(canvas, prop, prev) {\n // node is up to date.\n if (prev !== undefined &&\n prev.shape === this.shape &&\n prev.type === this.type &&\n prev.duration === this.duration &&\n prev.samplesPerPixel === this.samplesPerPixel) {\n return;\n }\n\n const ctx = canvas.getContext('2d');\n const width = canvas.width;\n const height = canvas.height;\n const curve = FadeCanvasHook.createCurve(this.shape, this.type, width);\n const len = curve.length;\n let y = height - (curve[0] * height);\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n\n ctx.strokeStyle = 'black';\n ctx.beginPath();\n ctx.moveTo(0, y);\n\n for (let i = 1; i < len; i += 1) {\n y = height - (curve[i] * height);\n ctx.lineTo(i, y);\n }\n ctx.stroke();\n ctx.restore();\n }\n}\n\nexport default FadeCanvasHook;\n\n\n\n// WEBPACK FOOTER //\n// ./src/render/FadeCanvasHook.js","/* eslint-disable no-param-reassign */\n/*\n* virtual-dom hook for setting the volume input programmatically.\n*/\nexport default class {\n constructor(gain) {\n this.gain = gain;\n }\n\n hook(volumeInput) {\n volumeInput.value = this.gain * 100;\n volumeInput.title = `${this.gain * 100}% volume`;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/render/VolumeSliderHook.js","/* eslint-disable no-param-reassign */\n/*\n * virtual-dom hook for setting the stereoPan input programmatically.\n */\nexport default class {\n constructor(stereoPan) {\n this.stereoPan = stereoPan;\n }\n\n hook(stereoPanInput) {\n stereoPanInput.value = this.stereoPan * 100;\n\n let panOrientation;\n if (this.stereoPan === 0) {\n panOrientation = 'Center';\n } else if (this.stereoPan < 0) {\n panOrientation = 'Left';\n } else {\n panOrientation = 'Right';\n }\n const percentage = `${Math.abs(this.stereoPan * 100)}% `;\n stereoPanInput.title = `Pan: ${this.stereoPan !== 0 ? percentage : ''}${panOrientation}`;\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/render/StereoPanSliderHook.js","import { FADEIN, FADEOUT, createFadeIn, createFadeOut } from 'fade-maker';\n\nexport default class {\n\n constructor(ac, buffer) {\n this.ac = ac;\n this.gain = 1;\n this.buffer = buffer;\n this.destination = this.ac.destination;\n this.ac.createStereoPanner = ac.createStereoPanner || ac.createPanner;\n }\n\n applyFade(type, start, duration, shape = 'logarithmic') {\n if (type === FADEIN) {\n createFadeIn(this.fadeGain.gain, shape, start, duration);\n } else if (type === FADEOUT) {\n createFadeOut(this.fadeGain.gain, shape, start, duration);\n } else {\n throw new Error('Unsupported fade type');\n }\n }\n\n applyFadeIn(start, duration, shape = 'logarithmic') {\n this.applyFade(FADEIN, start, duration, shape);\n }\n\n applyFadeOut(start, duration, shape = 'logarithmic') {\n this.applyFade(FADEOUT, start, duration, shape);\n }\n\n isPlaying() {\n return this.source !== undefined;\n }\n\n getDuration() {\n return this.buffer.duration;\n }\n\n setAudioContext(ac) {\n this.ac = ac;\n this.ac.createStereoPanner = ac.createStereoPanner || ac.createPanner;\n this.destination = this.ac.destination;\n }\n\n setUpSource() {\n this.source = this.ac.createBufferSource();\n this.source.buffer = this.buffer;\n\n const sourcePromise = new Promise((resolve) => {\n // keep track of the buffer state.\n this.source.onended = () => {\n this.source.disconnect();\n this.fadeGain.disconnect();\n this.volumeGain.disconnect();\n this.shouldPlayGain.disconnect();\n this.panner.disconnect();\n this.masterGain.disconnect();\n\n\n this.source = undefined;\n this.fadeGain = undefined;\n this.volumeGain = undefined;\n this.shouldPlayGain = undefined;\n this.panner = undefined;\n this.masterGain = undefined;\n\n resolve();\n };\n });\n\n this.fadeGain = this.ac.createGain();\n // used for track volume slider\n this.volumeGain = this.ac.createGain();\n // used for solo/mute\n this.shouldPlayGain = this.ac.createGain();\n this.masterGain = this.ac.createGain();\n\n this.panner = this.ac.createStereoPanner();\n\n this.source.connect(this.fadeGain);\n this.fadeGain.connect(this.volumeGain);\n this.volumeGain.connect(this.shouldPlayGain);\n this.shouldPlayGain.connect(this.masterGain);\n this.masterGain.connect(this.panner);\n this.panner.connect(this.destination);\n\n return sourcePromise;\n }\n\n setVolumeGainLevel(level) {\n if (this.volumeGain) {\n this.volumeGain.gain.value = level;\n }\n }\n\n setShouldPlay(bool) {\n if (this.shouldPlayGain) {\n this.shouldPlayGain.gain.value = bool ? 1 : 0;\n }\n }\n\n setMasterGainLevel(level) {\n if (this.masterGain) {\n this.masterGain.gain.value = level;\n }\n }\n\n setStereoPanValue(value) {\n const pan = value === undefined ? 0 : value;\n\n if (this.panner) {\n if (this.panner.pan !== undefined) {\n this.panner.pan.value = pan;\n } else {\n this.panner.panningModel = 'equalpower';\n this.panner.setPosition(pan, 0, 1 - Math.abs(pan));\n }\n }\n }\n\n /*\n source.start is picky when passing the end time.\n If rounding error causes a number to make the source think\n it is playing slightly more samples than it has it won't play at all.\n Unfortunately it doesn't seem to work if you just give it a start time.\n */\n play(when, start, duration) {\n this.source.start(when, start, duration);\n }\n\n stop(when = 0) {\n if (this.source) {\n this.source.stop(when);\n }\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/Playout.js","import h from 'virtual-dom/h';\n\nimport inputAeneas from './input/aeneas';\nimport outputAeneas from './output/aeneas';\nimport { secondsToPixels } from '../utils/conversions';\nimport DragInteraction from '../interaction/DragInteraction';\nimport ScrollTopHook from './render/ScrollTopHook';\nimport timeformat from '../utils/timeformat';\n\nclass AnnotationList {\n constructor(playlist, annotations, controls = [], editable = false,\n linkEndpoints = false, isContinuousPlay = false) {\n this.playlist = playlist;\n this.resizeHandlers = [];\n this.editable = editable;\n this.annotations = annotations.map(a =>\n // TODO support different formats later on.\n inputAeneas(a),\n );\n this.setupInteractions();\n\n this.controls = controls;\n this.setupEE(playlist.ee);\n\n // TODO actually make a real plugin system that's not terrible.\n this.playlist.isContinuousPlay = isContinuousPlay;\n this.playlist.linkEndpoints = linkEndpoints;\n this.length = this.annotations.length;\n }\n\n setupInteractions() {\n this.annotations.forEach((a, i) => {\n const leftShift = new DragInteraction(this.playlist, {\n direction: 'left',\n index: i,\n });\n const rightShift = new DragInteraction(this.playlist, {\n direction: 'right',\n index: i,\n });\n\n this.resizeHandlers.push(leftShift);\n this.resizeHandlers.push(rightShift);\n });\n }\n\n setupEE(ee) {\n ee.on('dragged', (deltaTime, data) => {\n const annotationIndex = data.index;\n const annotations = this.annotations;\n const note = annotations[annotationIndex];\n\n // resizing to the left\n if (data.direction === 'left') {\n const originalVal = note.start;\n note.start += deltaTime;\n\n if (note.start < 0) {\n note.start = 0;\n }\n\n if (annotationIndex &&\n (annotations[annotationIndex - 1].end > note.start)) {\n annotations[annotationIndex - 1].end = note.start;\n }\n\n if (this.playlist.linkEndpoints &&\n annotationIndex &&\n (annotations[annotationIndex - 1].end === originalVal)) {\n annotations[annotationIndex - 1].end = note.start;\n }\n } else {\n // resizing to the right\n const originalVal = note.end;\n note.end += deltaTime;\n\n if (note.end > this.playlist.duration) {\n note.end = this.playlist.duration;\n }\n\n if (annotationIndex < (annotations.length - 1) &&\n (annotations[annotationIndex + 1].start < note.end)) {\n annotations[annotationIndex + 1].start = note.end;\n }\n\n if (this.playlist.linkEndpoints &&\n (annotationIndex < (annotations.length - 1)) &&\n (annotations[annotationIndex + 1].start === originalVal)) {\n annotations[annotationIndex + 1].start = note.end;\n }\n }\n\n this.playlist.drawRequest();\n });\n\n ee.on('continuousplay', (val) => {\n this.playlist.isContinuousPlay = val;\n });\n\n ee.on('linkendpoints', (val) => {\n this.playlist.linkEndpoints = val;\n });\n\n ee.on('annotationsrequest', () => {\n this.export();\n });\n\n return ee;\n }\n\n export() {\n const output = this.annotations.map(a => outputAeneas(a));\n const dataStr = `data:text/json;charset=utf-8,${encodeURIComponent(JSON.stringify(output))}`;\n const a = document.createElement('a');\n\n document.body.appendChild(a);\n a.href = dataStr;\n a.download = 'annotations.json';\n a.click();\n document.body.removeChild(a);\n }\n\n renderResizeLeft(i) {\n const events = DragInteraction.getEvents();\n const config = {\n attributes: {\n style: 'position: absolute; height: 30px; width: 10px; top: 0; left: -2px',\n draggable: true,\n },\n };\n const handler = this.resizeHandlers[i * 2];\n\n events.forEach((event) => {\n config[`on${event}`] = handler[event].bind(handler);\n });\n\n return h('div.resize-handle.resize-w', config);\n }\n\n renderResizeRight(i) {\n const events = DragInteraction.getEvents();\n const config = {\n attributes: {\n style: 'position: absolute; height: 30px; width: 10px; top: 0; right: -2px',\n draggable: true,\n },\n };\n const handler = this.resizeHandlers[(i * 2) + 1];\n\n events.forEach((event) => {\n config[`on${event}`] = handler[event].bind(handler);\n });\n\n return h('div.resize-handle.resize-e', config);\n }\n\n renderControls(note, i) {\n // seems to be a bug with references, or I'm missing something.\n const that = this;\n return this.controls.map(ctrl =>\n h(`i.${ctrl.class}`, {\n attributes: {\n title: ctrl.title,\n },\n onclick: () => {\n ctrl.action(note, i, that.annotations, {\n linkEndpoints: that.playlist.linkEndpoints,\n });\n this.setupInteractions();\n that.playlist.drawRequest();\n },\n }),\n );\n }\n\n render() {\n const boxes = h('div.annotations-boxes',\n {\n attributes: {\n style: 'height: 30px;',\n },\n },\n this.annotations.map((note, i) => {\n const samplesPerPixel = this.playlist.samplesPerPixel;\n const sampleRate = this.playlist.sampleRate;\n const pixPerSec = sampleRate / samplesPerPixel;\n const pixOffset = secondsToPixels(this.playlist.scrollLeft, samplesPerPixel, sampleRate);\n const left = Math.floor((note.start * pixPerSec) - pixOffset);\n const width = Math.ceil((note.end * pixPerSec) - (note.start * pixPerSec));\n\n return h('div.annotation-box',\n {\n attributes: {\n style: `position: absolute; height: 30px; width: ${width}px; left: ${left}px`,\n 'data-id': note.id,\n },\n },\n [\n this.renderResizeLeft(i),\n h('span.id',\n {\n onclick: () => {\n const start = this.annotations[i].start;\n const end = this.annotations[i].end;\n\n if (this.playlist.isContinuousPlay) {\n this.playlist.seek(start, start);\n this.playlist.ee.emit('play', start);\n } else {\n this.playlist.seek(start, end);\n this.playlist.ee.emit('play', start, end);\n }\n },\n },\n [\n note.id,\n ],\n ),\n this.renderResizeRight(i),\n ],\n );\n }),\n );\n\n const boxesWrapper = h('div.annotations-boxes-wrapper',\n {\n attributes: {\n style: 'overflow: hidden;',\n },\n },\n [\n boxes,\n ],\n );\n\n const text = h('div.annotations-text',\n {\n hook: new ScrollTopHook(),\n },\n this.annotations.map((note, i) => {\n const format = timeformat(this.playlist.durationFormat);\n const start = format(note.start);\n const end = format(note.end);\n\n\n let segmentClass = '';\n if (this.playlist.isPlaying() &&\n (this.playlist.playbackSeconds >= note.start) &&\n (this.playlist.playbackSeconds <= note.end)) {\n segmentClass = '.current';\n }\n\n const editableConfig = {\n attributes: {\n contenteditable: true,\n },\n oninput: (e) => {\n // needed currently for references\n // eslint-disable-next-line no-param-reassign\n note.lines = [e.target.innerText];\n },\n onkeypress: (e) => {\n if (e.which === 13 || e.keyCode === 13) {\n e.target.blur();\n e.preventDefault();\n }\n },\n };\n\n const linesConfig = this.editable ? editableConfig : {};\n\n return h(`div.annotation${segmentClass}`,\n [\n h('span.annotation-id', [\n note.id,\n ]),\n h('span.annotation-start', [\n start,\n ]),\n h('span.annotation-end', [\n end,\n ]),\n h('span.annotation-lines',\n linesConfig,\n [\n note.lines,\n ],\n ),\n h('span.annotation-actions',\n this.renderControls(note, i),\n ),\n ],\n );\n }),\n );\n\n return h('div.annotations',\n [\n boxesWrapper,\n text,\n ],\n );\n }\n}\n\nexport default AnnotationList;\n\n\n\n// WEBPACK FOOTER //\n// ./src/annotation/AnnotationList.js","/*\n{\n \"begin\": \"5.759\",\n \"end\": \"9.155\",\n \"id\": \"002\",\n \"language\": \"en\",\n \"lines\": [\n \"I just wanted to hold\"\n ]\n},\n */\n\nimport uuid from 'uuid';\n\nexport default function (aeneas) {\n const annotation = {\n id: aeneas.id || uuid.v4(),\n start: Number(aeneas.begin) || 0,\n end: Number(aeneas.end) || 0,\n lines: aeneas.lines || [''],\n lang: aeneas.language || 'en',\n };\n\n return annotation;\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/annotation/input/aeneas.js","/*\n{\n \"begin\": \"5.759\",\n \"end\": \"9.155\",\n \"id\": \"002\",\n \"language\": \"en\",\n \"lines\": [\n \"I just wanted to hold\"\n ]\n},\n */\n\nexport default function (annotation) {\n return {\n begin: String(annotation.start.toFixed(3)),\n end: String(annotation.end.toFixed(3)),\n id: String(annotation.id),\n language: annotation.lang,\n lines: annotation.lines,\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/annotation/output/aeneas.js","import { pixelsToSeconds } from '../utils/conversions';\n\nexport default class {\n constructor(playlist, data = {}) {\n this.playlist = playlist;\n this.data = data;\n this.active = false;\n\n this.ondragover = (e) => {\n if (this.active) {\n e.preventDefault();\n this.emitDrag(e.clientX);\n }\n };\n }\n\n emitDrag(x) {\n const deltaX = x - this.prevX;\n\n // emit shift event if not 0\n if (deltaX) {\n const deltaTime = pixelsToSeconds(\n deltaX,\n this.playlist.samplesPerPixel,\n this.playlist.sampleRate,\n );\n this.prevX = x;\n this.playlist.ee.emit('dragged', deltaTime, this.data);\n }\n }\n\n complete() {\n this.active = false;\n document.removeEventListener('dragover', this.ondragover);\n }\n\n dragstart(e) {\n const ev = e;\n this.active = true;\n this.prevX = e.clientX;\n\n ev.dataTransfer.dropEffect = 'move';\n ev.dataTransfer.effectAllowed = 'move';\n ev.dataTransfer.setData('text/plain', '');\n document.addEventListener('dragover', this.ondragover);\n }\n\n dragend(e) {\n if (this.active) {\n e.preventDefault();\n this.complete();\n }\n }\n\n static getClass() {\n return '.shift';\n }\n\n static getEvents() {\n return ['dragstart', 'dragend'];\n }\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/interaction/DragInteraction.js","/*\n* virtual-dom hook for scrolling to the text annotation.\n*/\nconst Hook = function ScrollTopHook() {};\nHook.prototype.hook = function hook(node) {\n const el = node.querySelector('.current');\n if (el) {\n const box = node.getBoundingClientRect();\n const row = el.getBoundingClientRect();\n const diff = row.top - box.top;\n const list = node;\n list.scrollTop += diff;\n }\n};\n\nexport default Hook;\n\n\n\n// WEBPACK FOOTER //\n// ./src/annotation/render/ScrollTopHook.js","export default function (format) {\n function clockFormat(seconds, decimals) {\n const hours = parseInt(seconds / 3600, 10) % 24;\n const minutes = parseInt(seconds / 60, 10) % 60;\n const secs = (seconds % 60).toFixed(decimals);\n\n const sHours = (hours < 10) ? `0${hours}` : hours;\n const sMinutes = (minutes < 10) ? `0${minutes}` : minutes;\n const sSeconds = (secs < 10) ? `0${secs}` : secs;\n\n return `${sHours}:${sMinutes}:${sSeconds}`;\n }\n\n const formats = {\n seconds(seconds) {\n return seconds.toFixed(0);\n },\n thousandths(seconds) {\n return seconds.toFixed(3);\n },\n 'hh:mm:ss': function hhmmss(seconds) {\n return clockFormat(seconds, 0);\n },\n 'hh:mm:ss.u': function hhmmssu(seconds) {\n return clockFormat(seconds, 1);\n },\n 'hh:mm:ss.uu': function hhmmssuu(seconds) {\n return clockFormat(seconds, 2);\n },\n 'hh:mm:ss.uuu': function hhmmssuuu(seconds) {\n return clockFormat(seconds, 3);\n },\n };\n\n return formats[format];\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/timeformat.js","export default function () {\n // http://jsperf.com/typed-array-min-max/2\n // plain for loop for finding min/max is way faster than anything else.\n /**\n * @param {TypedArray} array - Subarray of audio to calculate peaks from.\n */\n function findMinMax(array) {\n let min = Infinity;\n let max = -Infinity;\n let curr;\n\n for (let i = 0; i < array.length; i += 1) {\n curr = array[i];\n if (min > curr) {\n min = curr;\n }\n if (max < curr) {\n max = curr;\n }\n }\n\n return {\n min,\n max,\n };\n }\n\n /**\n * @param {Number} n - peak to convert from float to Int8, Int16 etc.\n * @param {Number} bits - convert to #bits two's complement signed integer\n */\n function convert(n, bits) {\n const max = 2 ** (bits - 1);\n const v = n < 0 ? (n * max) : (n * max) - 1;\n return Math.max(-max, Math.min(max - 1, v));\n }\n\n /**\n * @param {TypedArray} channel - Audio track frames to calculate peaks from.\n * @param {Number} samplesPerPixel - Audio frames per peak\n */\n function extractPeaks(channel, samplesPerPixel, bits) {\n const chanLength = channel.length;\n const numPeaks = Math.ceil(chanLength / samplesPerPixel);\n let start;\n let end;\n let segment;\n let max;\n let min;\n let extrema;\n\n // create interleaved array of min,max\n const peaks = new self[`Int${bits}Array`](numPeaks * 2);\n\n for (let i = 0; i < numPeaks; i += 1) {\n start = i * samplesPerPixel;\n end = (i + 1) * samplesPerPixel > chanLength ? chanLength : (i + 1) * samplesPerPixel;\n\n segment = channel.subarray(start, end);\n extrema = findMinMax(segment);\n min = convert(extrema.min, bits);\n max = convert(extrema.max, bits);\n\n peaks[i * 2] = min;\n peaks[(i * 2) + 1] = max;\n }\n\n return peaks;\n }\n\n /**\n * @param {TypedArray} source - Source of audio samples for peak calculations.\n * @param {Number} samplesPerPixel - Number of audio samples per peak.\n * @param {Number} cueIn - index in channel to start peak calculations from.\n * @param {Number} cueOut - index in channel to end peak calculations from (non-inclusive).\n */\n function audioPeaks(source, samplesPerPixel = 10000, bits = 8) {\n if ([8, 16, 32].indexOf(bits) < 0) {\n throw new Error('Invalid number of bits specified for peaks.');\n }\n\n const peaks = [];\n const start = 0;\n const end = source.length;\n peaks.push(extractPeaks(source.subarray(start, end), samplesPerPixel, bits));\n\n const length = peaks[0].length / 2;\n\n return {\n bits,\n length,\n data: peaks,\n };\n }\n\n onmessage = function onmessage(e) {\n const peaks = audioPeaks(e.data.samples, e.data.samplesPerPixel);\n\n postMessage(peaks);\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/recorderWorker.js","export default function () {\n let recLength = 0;\n let recBuffersL = [];\n let recBuffersR = [];\n let sampleRate;\n\n function init(config) {\n sampleRate = config.sampleRate;\n }\n\n function record(inputBuffer) {\n recBuffersL.push(inputBuffer[0]);\n recBuffersR.push(inputBuffer[1]);\n recLength += inputBuffer[0].length;\n }\n\n function writeString(view, offset, string) {\n for (let i = 0; i < string.length; i += 1) {\n view.setUint8(offset + i, string.charCodeAt(i));\n }\n }\n\n function floatTo16BitPCM(output, offset, input) {\n let writeOffset = offset;\n for (let i = 0; i < input.length; i += 1, writeOffset += 2) {\n const s = Math.max(-1, Math.min(1, input[i]));\n output.setInt16(writeOffset, s < 0 ? s * 0x8000 : s * 0x7FFF, true);\n }\n }\n\n function encodeWAV(samples, mono = false) {\n const buffer = new ArrayBuffer(44 + (samples.length * 2));\n const view = new DataView(buffer);\n\n /* RIFF identifier */\n writeString(view, 0, 'RIFF');\n /* file length */\n view.setUint32(4, 32 + (samples.length * 2), true);\n /* RIFF type */\n writeString(view, 8, 'WAVE');\n /* format chunk identifier */\n writeString(view, 12, 'fmt ');\n /* format chunk length */\n view.setUint32(16, 16, true);\n /* sample format (raw) */\n view.setUint16(20, 1, true);\n /* channel count */\n view.setUint16(22, mono ? 1 : 2, true);\n /* sample rate */\n view.setUint32(24, sampleRate, true);\n /* byte rate (sample rate * block align) */\n view.setUint32(28, sampleRate * 4, true);\n /* block align (channel count * bytes per sample) */\n view.setUint16(32, 4, true);\n /* bits per sample */\n view.setUint16(34, 16, true);\n /* data chunk identifier */\n writeString(view, 36, 'data');\n /* data chunk length */\n view.setUint32(40, samples.length * 2, true);\n\n floatTo16BitPCM(view, 44, samples);\n\n return view;\n }\n\n function mergeBuffers(recBuffers, length) {\n const result = new Float32Array(length);\n let offset = 0;\n\n for (let i = 0; i < recBuffers.length; i += 1) {\n result.set(recBuffers[i], offset);\n offset += recBuffers[i].length;\n }\n return result;\n }\n\n function interleave(inputL, inputR) {\n const length = inputL.length + inputR.length;\n const result = new Float32Array(length);\n\n let index = 0;\n let inputIndex = 0;\n\n while (index < length) {\n result[index += 1] = inputL[inputIndex];\n result[index += 1] = inputR[inputIndex];\n inputIndex += 1;\n }\n\n return result;\n }\n\n function exportWAV(type) {\n const bufferL = mergeBuffers(recBuffersL, recLength);\n const bufferR = mergeBuffers(recBuffersR, recLength);\n const interleaved = interleave(bufferL, bufferR);\n const dataview = encodeWAV(interleaved);\n const audioBlob = new Blob([dataview], { type });\n\n postMessage(audioBlob);\n }\n\n function clear() {\n recLength = 0;\n recBuffersL = [];\n recBuffersR = [];\n }\n\n onmessage = function onmessage(e) {\n switch (e.data.command) {\n case 'init': {\n init(e.data.config);\n break;\n }\n case 'record': {\n record(e.data.buffer);\n break;\n }\n case 'exportWAV': {\n exportWAV(e.data.type);\n break;\n }\n case 'clear': {\n clear();\n break;\n }\n default: {\n throw new Error('Unknown export worker command');\n }\n }\n };\n}\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils/exportWavWorker.js"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index b765d845..9917ed81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "waveform-playlist", - "version": "3.3.0", + "version": "4.0.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index b3b31a4a..5e6c90da 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "waveform-playlist", "description": "Multiple track web audio editor and player with waveform preview", - "version": "3.3.0", + "version": "4.0.0", "main": "lib/app.js", "author": "Naomi Aro", "license": "MIT",