diff --git a/README.md b/README.md new file mode 100644 index 0000000..3d01374 --- /dev/null +++ b/README.md @@ -0,0 +1,11 @@ + +Populate player name (from most used one) after database is fully populated: +```SQL +UPDATE `player` SET `name`=( + SELECT `name` + FROM `player_names` + WHERE `player_names`.guid = `player`.guid + GROUP BY guid, name + ORDER BY MAX(`time`) DESC LIMIT 1 +); +``` diff --git a/demweb/app.py b/demweb/app.py index 1dc56a4..761a8d2 100644 --- a/demweb/app.py +++ b/demweb/app.py @@ -1,5 +1,5 @@ from contextlib import nullcontext -from datetime import datetime +from datetime import datetime, timedelta from flask import Flask, g, has_app_context, request from .extensions import default_config @@ -17,6 +17,21 @@ def register_jinja2_filters(app): def to_json(value): return orjson.dumps(value).decode('utf-8') + @app.template_filter('to_duration') + def to_duration(seconds): + out = '' + (days, remainder) = divmod(seconds, 86400) + (hours, remainder) = divmod(remainder, 3600) + (minutes, seconds) = divmod(remainder, 60) + if days: + out += f'{days:.0f}d ' + if hours: + out += f'{hours:.0f}h ' + if minutes: + out += f'{minutes:.0f}m ' + out += f'{seconds:.0f}s' + return out + def register_blueprints(app): with app.app_context(): diff --git a/demweb/models.py b/demweb/models.py index 50f6334..5e0a0ef 100644 --- a/demweb/models.py +++ b/demweb/models.py @@ -44,15 +44,19 @@ class Player(db.Model): class PlayerNames(db.Model): - guid = db.Column(db.String(32), primary_key=True) + guid = db.Column(db.String(32), db.ForeignKey('player.guid'), primary_key=True) name = db.Column(db.String(32), primary_key=True) time = db.Column(db.Float) + player = db.relationship('Player', backref='names', foreign_keys=[guid]) + class PlayerSprays(db.Model): - guid = db.Column(db.String(32), primary_key=True) + guid = db.Column(db.String(32), db.ForeignKey('player.guid'), primary_key=True) spray = db.Column(db.String(32), primary_key=True) + player = db.relationship('Player', backref='sprays', foreign_keys=[guid]) + class PlayerSession(db.Model): player_guid = db.Column(db.String(32), db.ForeignKey('player.guid'), primary_key=True) @@ -63,6 +67,9 @@ class PlayerSession(db.Model): kills = db.Column(db.Integer) voicetime = db.Column(db.Float) + session = db.relationship('Session', foreign_keys=[session_id]) + player = db.relationship('Player', backref='sessions', foreign_keys=[player_guid]) + class Chat(db.Model): id = db.Column(db.Integer, primary_key=True) diff --git a/demweb/static/css/main.css b/demweb/static/css/main.css index be0302b..37c6934 100644 --- a/demweb/static/css/main.css +++ b/demweb/static/css/main.css @@ -1,8 +1,7 @@ +main { display: flex; flex-wrap: nowrap; height: 100vh; height: -webkit-fill-available; max-height: 100vh; overflow-x: auto; overflow-y: hidden; } .btn-group-xs > .btn, .btn-xs { padding: .25rem .4rem; font-size: .875rem; line-height: .5; border-radius: .2rem; } -.playlist { margin: 2em 0; } - .playlist .playlist-time-scale { height: 30px; } .playlist .playlist-tracks { background: #e0eff1; } @@ -31,10 +30,12 @@ .playlist .controls { background: white; text-align: center; border: 1px solid black; border-radius: 0.2rem; } -.playlist .controls .track-header { overflow: hidden; color: black; height: 26px; display: flex; align-items: center; justify-content: space-between; padding: 0 0.2rem; font-size: 0.65rem; margin-bottom: -10px; } +.playlist .controls .track-header { overflow: hidden; color: black; height: 18px; display: flex; align-items: center; justify-content: space-between; padding: 0 0.2rem; font-size: 0.65rem; margin-bottom: -10px; } .playlist .controls .track-header button { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; } +.playlist .controls .track-header span { margin-top: -8px; } + .playlist .controls input[type="range"] { display: inline-block; width: 90%; } -.playlist .controls .user-info { word-break: break-word; color: black; align-items: center; justify-content: space-between; padding: 0 0.2rem; font-size: 0.65rem; margin-top: -5px; } +.playlist .controls .info { word-break: break-word; color: black; align-items: center; justify-content: space-between; padding: 0 0.2rem; font-size: 0.65rem; margin-top: -10px; } diff --git a/demweb/static/js/main.js b/demweb/static/js/main.js index b327901..1ecf0a4 100644 --- a/demweb/static/js/main.js +++ b/demweb/static/js/main.js @@ -1,7 +1,7 @@ var playlist = WaveformPlaylist.init({ container: document.getElementById("playlist"), timescale: true, - state: 'cursor', + state: 'select', samplesPerPixel: 16384, zoomLevels: [2048, 4096, 8192, 16384], @@ -12,23 +12,58 @@ var playlist = WaveformPlaylist.init({ stereoPan: false, } }, - waveHeight: 96, + waveHeight: 80, }); +function onFinishedLoading() { + //initialize the WAV exporter. + playlist.initExporter(); + + const tracks = playlist.tracks; + for (var i = 0; i < tracks.length; i++) { + playlist.collapseTrack(tracks[i], {collapsed: true}); + } + + const highlight = window.location.hash.split('#').filter(Boolean); + for(var i = 0; i < highlight.length; i++) { + const guid = highlight[i]; + + for (var j = 0; j < tracks.length; j++) { + if (tracks[j].name == guid) { + tracks[j].setWaveOutlineColor('#d1e7dd'); + } + } + + for (var j = 0; j < g_chats.length; j++) { + if (g_chats[j].player_guid == guid) { + chatRows[j].classList.add("table-active"); + } + } + } + + playlist.drawRequest(); +} + +function collapseTrack(guid, collapse) { + const tracks = playlist.tracks; + for (var i = 0; i < tracks.length; i++) { + if (guid === null || tracks[i].name == guid) { + playlist.collapseTrack(tracks[i], {collapsed: collapse}); + if (guid != null) { + break; + } + } + } +} function updateTrackInfo(guid, info) { - var tracks = $(".playlist-tracks").children(); + const tracks = playlist.tracks; for (var i = 0; i < tracks.length; i++) { - var track = tracks[i].firstChild; - var trackGuid = track.firstChild.getElementsByTagName('span')[0].innerText; - var userInfoElem = track.lastChild; - if (userInfoElem.className != 'user-info') { - userInfoElem = document.createElement('label'); - userInfoElem.className = 'user-info'; - track.appendChild(userInfoElem); - } - if (guid === null || trackGuid == guid) { - userInfoElem.innerText = info; + if (guid === null || tracks[i].name == guid) { + tracks[i].setInfo(info); + if (guid != null) { + break; + } } } } @@ -56,25 +91,144 @@ function clockFormat(seconds, decimals) { return result; } +var lastChunkIdx = 0; +var lastUpdateTime = 0; function updateTime(time) { $time.html(clockFormat(time, 3)); audioPos = time; + if (time < lastUpdateTime) { + lastChunkIdx = 0; + } + var tick = time / g_session.tickinterval; var silenceTicks = 0; - for (var i = 0; i < g_session.silence_chunks.length; i++) { - var chunk = g_session.silence_chunks[i]; + for (; lastChunkIdx < g_session.silence_chunks.length; lastChunkIdx++) { + var chunk = g_session.silence_chunks[lastChunkIdx]; if (tick > chunk[0]) { - silenceTicks += chunk[1]; + silenceTicks = chunk[1]; } else { break; } } - var tickedTime = (tick + silenceTicks) * g_session.tickinterval; + + tick += silenceTicks; + var tickedTime = tick * g_session.tickinterval; $time_.html(clockFormat(tickedTime, 3)); + + lastUpdateTime = time; + if (lastChunkIdx > 0) { + lastChunkIdx -= 1; + } + + onTick(tick, tickedTime); +} +updateTime(audioPos); + +function onEvent(idx, event) { + var update = 0; + if (event.event == "player_connect") { + collapseTrack(event.player_guid, false); + updateTrackInfo(event.player_guid, event.data.name); + update += 1; + } + else if (event.event == "player_disconnect") { + collapseTrack(event.player_guid, true); + update += 1; + } + else if (event.event == "player_changename") { + updateTrackInfo(event.player_guid, event.data.newname); + update += 1; + } + return update; } -updateTime(audioPos); +var chatBox = $("div#chat"); +var chatRows = $("div#chat>table>tbody").children(); +var lastPrimaryRow = undefined; +function onChat(idx, chat) { + if (idx == lastPrimaryRow) { + return 0; + } + + if (lastPrimaryRow != undefined) { + chatRows[lastPrimaryRow].classList.remove("table-primary"); + } + + chatRows[idx].classList.add("table-primary"); + if (autoScrollChat) { + chatRows[idx].scrollIntoViewIfNeeded(); + } + + lastPrimaryRow = idx; + return 1; +} + +var lastTick = undefined; +var lastChatIdx = 0; +var lastEventIdx = 0; +function onTick(tick, time) { + var update = 0; + if (tick == lastTick) { + return; + } + + if (tick < lastTick) { + lastChatIdx = 0; + lastEventIdx = 0; + } + + for (; lastEventIdx < g_events.length; lastEventIdx++) { + const event = g_events[lastEventIdx]; + if (tick > event.tick) { + update += onEvent(lastEventIdx, event); + } else { + break; + } + } + if (lastEventIdx > 0) { + lastEventIdx -= 1; + } + + for (; lastChatIdx < g_chats.length; lastChatIdx++) { + const chat = g_chats[lastChatIdx]; + if (tick < chat.tick) { + if (lastChatIdx > 0) { + lastChatIdx -= 1; + } + update += onChat(lastChatIdx, chat); + break; + } + } + + lastTick = tick; + + if (update) { + playlist.drawRequest(); + } +} + +function gameTimeToAudio(tick) { + tick += 1; + var silenceTicks = 0; + for (var i = 0; i < g_session.silence_chunks.length; i++) { + const chunk = g_session.silence_chunks[i]; + if ((tick - chunk[1]) > chunk[0]) { + silenceTicks = chunk[1]; + } else { + break; + } + } + + return (tick - silenceTicks) * g_session.tickinterval; +} + +function jumpToGameTick(tick) { + var audioTime = gameTimeToAudio(tick); + playlist.seek(audioTime); + playlist.drawRequest(); + updateTime(audioTime); +} $container.on("click", ".btn-play", function() { ee.emit("play"); @@ -100,7 +254,7 @@ $container.on("click", ".btn-fast-forward", function() { ee.emit("fastforward"); }); -//zoom buttons +// zoom buttons $container.on("click", ".btn-zoom-in", function() { ee.emit("zoomin"); }); @@ -109,21 +263,102 @@ $container.on("click", ".btn-zoom-out", function() { ee.emit("zoomout"); }); +// download +var downloadUrl = undefined; +var downloadName = undefined; +$container.on("click", ".btn-download", function () { + if (downloadName) { + return; + } + + downloadName = g_session.demoname; + if (playlist.isSegmentSelection()) { + const segment = playlist.getTimeSelection(); + downloadName += "-" + clockFormat(segment.start).replaceAll(':', '-') + "_" + clockFormat(segment.end).replaceAll(':', '-'); + } + downloadName += ".wav"; + + ee.emit('startaudiorendering', 'wav'); +}); + +ee.on('audiorenderingfinished', function (type, data) { + if (type != 'wav') { + return; + } + if (downloadUrl) { + window.URL.revokeObjectURL(downloadUrl); + } + + downloadUrl = window.URL.createObjectURL(data); + + const tempLink = document.createElement('a'); + tempLink.style.display = 'none'; + tempLink.href = downloadUrl; + tempLink.setAttribute('download', downloadName); + document.body.appendChild(tempLink); + tempLink.click(); + document.body.removeChild(tempLink); + + downloadName = undefined; +}); + $container.on("input change", ".master-gain", function(e){ ee.emit("mastervolumechange", e.target.value); }); $container.find(".master-gain").change(); -$container.on("change", ".automatic-scroll", function(e){ - ee.emit("automaticscroll", $(e.target).is(':checked')); +var autoScrollVoice = false; +$container.on("change", "#autoscroll_voice", function(e){ + autoScrollVoice = $(e.target).is(':checked'); + ee.emit("automaticscroll", autoScrollVoice); }); -$container.find(".automatic-scroll").change(); +$container.find("#autoscroll_voice").change(); +var autoScrollChat = false; +$container.on("change", "#autoscroll_chat", function(e){ + autoScrollChat = $(e.target).is(':checked'); +}); +$container.find("#autoscroll_chat").change(); ee.on("timeupdate", updateTime); -function onFinishedLoading() { - updateTrackInfo(null, "name"); +function getParent(el) { + var parent = el.parentNode; + + if (parent === document) { + return document; + } else if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) { + return parent; + } else { + return getParent(parent); + } } +if (!Element.prototype.scrollIntoViewIfNeeded) { + Element.prototype.scrollIntoViewIfNeeded = function (centerIfNeeded) { + centerIfNeeded = arguments.length === 0 ? true : !!centerIfNeeded; + + var parent = getParent(this), + parentComputedStyle = window.getComputedStyle(parent, null), + parentBorderTopWidth = parseInt(parentComputedStyle.getPropertyValue('border-top-width')), + parentBorderLeftWidth = parseInt(parentComputedStyle.getPropertyValue('border-left-width')), + overTop = this.offsetTop - parent.offsetTop < parent.scrollTop, + overBottom = (this.offsetTop - parent.offsetTop + this.clientHeight - parentBorderTopWidth) > (parent.scrollTop + parent.clientHeight), + overLeft = this.offsetLeft - parent.offsetLeft < parent.scrollLeft, + overRight = (this.offsetLeft - parent.offsetLeft + this.clientWidth - parentBorderLeftWidth) > (parent.scrollLeft + parent.clientWidth), + alignWithTop = overTop && !overBottom; + + if ((overTop || overBottom) && centerIfNeeded) { + parent.scrollTop = this.offsetTop - parent.offsetTop - parent.clientHeight / 2 - parentBorderTopWidth + this.clientHeight / 2; + } + + if ((overLeft || overRight) && centerIfNeeded) { + parent.scrollLeft = this.offsetLeft - parent.offsetLeft - parent.clientWidth / 2 - parentBorderLeftWidth + this.clientWidth / 2; + } + + if ((overTop || overBottom || overLeft || overRight) && !centerIfNeeded) { + this.scrollIntoView(alignWithTop); + } + }; +} \ No newline at end of file diff --git a/demweb/static/js/waveform-playlist.var.js b/demweb/static/js/waveform-playlist.var.js index 79777d9..1424948 100644 --- a/demweb/static/js/waveform-playlist.var.js +++ b/demweb/static/js/waveform-playlist.var.js @@ -106,7 +106,8 @@ var WaveformPlaylist = volume: true, stereoPan: true, collapse: true, - remove: true + remove: true, + info: true } }, colors: { @@ -3465,6 +3466,7 @@ var WaveformPlaylist = var tracks = audioBuffers.map(function (audioBuffer, index) { var info = trackList[index]; var name = info.name || 'Untitled'; + var infostr = info.info || undefined; var start = info.start || 0; var states = info.states || {}; var fadeIn = info.fadeIn; @@ -3487,6 +3489,7 @@ var WaveformPlaylist = track.src = info.src; track.setBuffer(audioBuffer); track.setName(name); + track.setInfo(infostr); track.setEventEmitter(_this3.ee); track.setEnabledStates(states); track.setCues(cueIn, cueOut); @@ -3586,15 +3589,24 @@ var WaveformPlaylist = if (this.isRendering) { return; } - this.isRendering = true; - this.offlineAudioContext = new OfflineAudioContext(2, 44100 * this.duration, 44100); + var duration = this.duration; + var startTime = 0; + var endTime = 0; + if (this.isSegmentSelection()) { + var segment = this.getTimeSelection(); + startTime = segment.start; + endTime = segment.end; + duration = endTime - startTime; + } + + this.offlineAudioContext = new OfflineAudioContext(1, 44100 * 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, { + track.schedulePlay(currentTime, startTime, endTime, { shouldPlay: _this4.shouldTrackPlay(track), masterGain: 1, isOffline: true @@ -3615,7 +3627,8 @@ var WaveformPlaylist = _this4.exportWorker.postMessage({ command: 'init', config: { - sampleRate: 44100 + sampleRate: 44100, + stereo: false } }); @@ -3633,7 +3646,7 @@ var WaveformPlaylist = // send the channel data from our buffer to the worker _this4.exportWorker.postMessage({ command: 'record', - buffer: [audioBuffer.getChannelData(0), audioBuffer.getChannelData(1)] + buffer: [audioBuffer.getChannelData(0)] }); // ask the worker for a WAV @@ -5905,7 +5918,7 @@ var WaveformPlaylist = if (audioData.byteLength > 16) { var view = new DataView(audioData); - var wanted = "DEMOPUSHEADER_V1"; + var wanted = "DEMOPUSHEADER_V2"; var success = true; for (var i = 0, n = 16; i < n; i++) { var c = view.getUint8(i); @@ -5942,74 +5955,54 @@ var WaveformPlaylist = var _this2 = this; this.setStateChange(STATE_DECODING); - - var parsed = []; - var sampleRate = 0; - var numSamples = 0; - var channels = 1; + var promises = []; var view = new DataView(demopusData); var ofs = 16; // skip header + var channels = 1; + var sampleRate = view.getUint32(ofs, true); + ofs += 4; + var numSamples = Number(view.getBigUint64(ofs, true)); + ofs += 8; + + // output sample rate != input sample rate + numSamples *= this.ac.sampleRate / sampleRate; + var audioBuffer = this.ac.createBuffer(channels, numSamples, this.ac.sampleRate); + while (ofs < demopusData.byteLength) { - var header = view.getUint8(ofs); - ofs += 1; + var samplesOfs = Number(view.getBigUint64(ofs, true)); + ofs += 8; + samplesOfs *= this.ac.sampleRate / sampleRate; - if (header == 0x02) { - // opus - var dataLen = Number(view.getBigUint64(ofs, true)); - ofs += 8; - var opusData = demopusData.slice(ofs, ofs + dataLen); - ofs += dataLen; - - var promise = this.ac.decodeAudioData(opusData, function (audioBuffer) { - return audioBuffer; - }, function (err) { - if (err === null) { - // Safari issues with null error - return Error('MediaDecodeAudioDataUnknownContentType'); - } else { - return err; - } - }); - - parsed.push(promise); - } else if (header == 0x03) { - // silence - var samples = Number(view.getBigUint64(ofs, true)); - ofs += 8; - parsed.push(samples); - } else if (header == 0x01) { - // info - sampleRate = view.getUint32(ofs, true); - ofs += 4; - numSamples = Number(view.getBigUint64(ofs, true)); - ofs += 8; - } else if (header == 0x04) { - // done + if (ofs >= demopusData.byteLength) { break; } + + var dataLen = view.getUint32(ofs, true); + ofs += 4; + + var opusData = demopusData.slice(ofs, ofs + dataLen); + ofs += dataLen; + + var promise = this.ac.decodeAudioData(opusData, function (decoded) { + var buf = decoded.getChannelData(0); + audioBuffer.copyToChannel(buf, 0, this); + return decoded.length; + }.bind(samplesOfs), function (err) { + if (err === null) { + // Safari issues with null error + return Error('MediaDecodeAudioDataUnknownContentType'); + } else { + return err; + } + }); + + promises.push(promise); } return new Promise(function (resolve, reject) { - // output sample rate != input sample rate - numSamples *= _this2.ac.sampleRate / sampleRate; - var audioBuffer = _this2.ac.createBuffer(channels, numSamples, _this2.ac.sampleRate); - - return Promise.all(parsed).then(function (result) { - var curSamples = 0; - - for (var i = 0; i < result.length; i++) { - var elem = result[i]; - if (typeof elem == "number") { - curSamples += elem * (_this2.ac.sampleRate / sampleRate); - } else { - var buf = elem.getChannelData(0); - audioBuffer.copyToChannel(buf, 0, curSamples); - curSamples += elem.length; - } - } - + Promise.all(promises).then(function (result) { _this2.setStateChange(STATE_FINISHED); resolve(audioBuffer); }); @@ -6505,6 +6498,7 @@ var WaveformPlaylist = _classCallCheck(this, _class); this.name = 'Untitled'; + this.info = undefined; this.customClass = undefined; this.waveOutlineColor = undefined; this.gain = 1; @@ -6532,6 +6526,11 @@ var WaveformPlaylist = value: function setName(name) { this.name = name; } + }, { + key: 'setInfo', + value: function setInfo(info) { + this.info = info; + } }, { key: 'setCustomClass', value: function setCustomClass(className) { @@ -6980,6 +6979,10 @@ var WaveformPlaylist = } })])); } + + if (widgets.info) { + controls.push((0, _h2.default)('label.info', [this.info])); + } } return (0, _h2.default)('div.controls', { @@ -7134,6 +7137,7 @@ var WaveformPlaylist = start: this.startTime, end: this.endTime, name: this.name, + info: this.info, customClass: this.customClass, cuein: this.cueIn, cueout: this.cueOut, @@ -10408,14 +10412,18 @@ var WaveformPlaylist = var recBuffersL = []; var recBuffersR = []; var sampleRate = void 0; + var stereo = void 0; function init(config) { sampleRate = config.sampleRate; + stereo = config.stereo; } function record(inputBuffer) { recBuffersL.push(inputBuffer[0]); - recBuffersR.push(inputBuffer[1]); + if (stereo) { + recBuffersR.push(inputBuffer[1]); + } recLength += inputBuffer[0].length; } @@ -10434,15 +10442,14 @@ var WaveformPlaylist = } function encodeWAV(samples) { - var mono = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; - + var numChannels = stereo ? 2 : 1; 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); + view.setUint32(4, 36 + samples.length * 2, true); /* RIFF type */ writeString(view, 8, 'WAVE'); /* format chunk identifier */ @@ -10452,13 +10459,13 @@ var WaveformPlaylist = /* sample format (raw) */ view.setUint16(20, 1, true); /* channel count */ - view.setUint16(22, mono ? 1 : 2, true); + view.setUint16(22, numChannels, true); /* sample rate */ view.setUint32(24, sampleRate, true); - /* byte rate (sample rate * block align) */ - view.setUint32(28, sampleRate * 4, true); + /* byte rate (sample rate * channel count * bytes per sample) */ + view.setUint32(28, sampleRate * numChannels * 2, true); /* block align (channel count * bytes per sample) */ - view.setUint16(32, 4, true); + view.setUint16(32, numChannels * 2, true); /* bits per sample */ view.setUint16(34, 16, true); /* data chunk identifier */ @@ -10500,8 +10507,11 @@ var WaveformPlaylist = function exportWAV(type) { var bufferL = mergeBuffers(recBuffersL, recLength); - var bufferR = mergeBuffers(recBuffersR, recLength); - var interleaved = interleave(bufferL, bufferR); + var interleaved = bufferL; + if (stereo) { + var bufferR = mergeBuffers(recBuffersR, recLength); + interleaved = interleave(bufferL, bufferR); + } var dataview = encodeWAV(interleaved); var audioBlob = new Blob([dataview], { type: type }); diff --git a/demweb/static/js/waveform-playlist.var.js.map b/demweb/static/js/waveform-playlist.var.js.map new file mode 100644 index 0000000..ed2b797 --- /dev/null +++ b/demweb/static/js/waveform-playlist.var.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap 591c4681c0a1ba4bffd2","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","info","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","controlWidth","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","infostr","states","fadeIn","fadeOut","cueIn","cuein","cueOut","cueout","gain","muted","soloed","selection","selected","peaks","customClass","playout","setInfo","setCustomClass","setWaveOutlineColor","shape","setActiveTrack","setPeakData","getState","concat","draw","activeTrack","isRendering","startTime","endTime","isSegmentSelection","segment","offlineAudioContext","currentTime","setOfflinePlayout","buffer","schedulePlay","shouldPlay","shouldTrackPlay","isOffline","startRendering","command","stereo","levels","splice","collapsed","scheduleStop","trackLists","list","setShouldPlay","reduce","getEndTime","cursorPos","getElapsedTime","lastPlay","stopAnimation","editor","bind","startAnimation","getCurrentTime","playbackReset","viewDuration","lastDraw","animationRequest","requestAnimationFrame","updateEditor","cancelAnimationFrame","getSeekStyle","elapsed","newTree","patches","clientWidth","resolution","isActive","playlistLength","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","byteLength","view","DataView","wanted","success","i","n","c","getUint8","charCodeAt","fileLoad_custom","decodeAudioData","err","demopusData","promises","ofs","channels","getUint32","numSamples","Number","getBigUint64","createBuffer","samplesOfs","dataLen","opusData","slice","promise","decoded","buf","copyToChannel","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","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","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","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","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","v","extractPeaks","channel","chanLength","numPeaks","extrema","self","subarray","audioPeaks","recLength","recBuffersL","recBuffersR","inputBuffer","writeString","string","setUint8","floatTo16BitPCM","input","writeOffset","setInt16","encodeWAV","numChannels","ArrayBuffer","setUint32","setUint16","mergeBuffers","recBuffers","Float32Array","set","interleave","inputL","inputR","inputIndex","exportWAV","bufferL","interleaved","bufferR","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;;mBA2FD,YAA6C;AAAA,OAAnCC,OAAmC,uEAAzB,EAAyB;AAAA,OAArBC,EAAqB,uEAAhB,6BAAgB;;AAC1D,UAAOF,KAAKC,OAAL,EAAcC,EAAd,CAAP;AACD,E;;AAnGD;;;;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;AAEfG,iBAAYH,aAAaG,UAFV;AAGfC,sBAAiB,IAHF;AAIfC,WAAM,IAJS;AAKfC,eAAU,aALK;AAMfC,eAAU,KANK;AAOfC,gBAAW,KAPI;AAQfC,eAAU;AACRC,aAAM,KADE;AAERC,cAAO,GAFC;AAGRC,gBAAS;AACPC,qBAAY,IADL;A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,CAAmBf,OAAOf,MAA1B;AACAkB,YAASa,aAAT,CAAuBhB,OAAOP,UAA9B;AACAU,YAASc,YAAT,CAAsBhB,SAAtB;AACAE,YAASe,OAAT,CAAiBlB,OAAO7B,IAAxB;AACAgC,YAASgB,WAAT,CAAqBnB,OAAO3B,QAA5B;AACA8B,YAASiB,gBAAT,CAA0BpB,OAAO1B,SAAjC;AACA6B,YAASkB,YAAT,CAAsBrB,OAAOX,SAA7B;AACAc,YAASmB,cAAT,CAAwBtB,OAAON,cAA/B;AACAS,YAASJ,iBAAT,GAA6BC,OAAOD,iBAApC;AACAI,YAASL,gBAAT,GAA4BE,OAAOF,gBAAnC;AACAK,YAASoB,eAAT,GAA2BvB,OAAOuB,eAAlC;;AAEA;AACA,OAAMC,OAAOrB,SAASsB,MAAT,EAAb;AACA,OAAMC,WAAW,6BAAcF,IAAd,CAAjB;;AAEAxB,UAAO1C,SAAP,CAAiBqE,WAAjB,CAA6BD,QAA7B;AACAvB,YAASqB,IAAT,GAAgBA,IAAhB;AACArB,YAASuB,QAAT,GAAoBA,QAApB;;AAEA,UAAOvB,QAAP;AACD,E;;;;;;AC/FD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;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;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qCAAoC;;AAEpC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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;;AAEA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;;AAEA;AACA;;;;;;;AClBA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAE;AACF;AACA;AACA;;;;;;;ACZA;;AAEA;;AAEA;AACA,sBA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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;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;AAFlB,UAAd;AAID;;AAED,WAAI,KAAK2D,OAAT,EAAkB;AAChB,aAAMA,UAAU,KAAK6M,KAAL,CAAW,KAAK7M,OAAhB,CAAhB;;AAEAxK,cAAKwK,OAAL,GAAe;AACbgB,kBAAOhB,QAAQgB,KADF;AAEbrI,qBAAUqH,QAAQ1D,GAAR,GAAc0D,QAAQ3D;AAFnB,UAAf;AAID;;AAED,cAAO7G,IAAP;AACD;;;;;;;;;;;;AC/wBH;AACA;AACA;AACA;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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" \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 591c4681c0a1ba4bffd2","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 info: 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 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 const controlWidth = this.controls.show ? this.controls.width : 0;\n this.annotationList = new AnnotationList(\n this,\n config.annotations,\n config.controls,\n config.editable,\n config.linkEndpoints,\n config.isContinuousPlay,\n controlWidth,\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 infostr = info.info || undefined;\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.setInfo(infostr);\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 this.isRendering = true;\n\n var duration = this.duration;\n var startTime = 0;\n var endTime = 0;\n if (this.isSegmentSelection()) {\n const segment = this.getTimeSelection();\n startTime = segment.start;\n endTime = segment.end;\n duration = (endTime - startTime);\n }\n\n this.offlineAudioContext = new OfflineAudioContext(1, 44100 * duration, 44100);\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, startTime, endTime, {\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 stereo: false\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 ],\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 if(audioData.byteLength > 16) {\n var view = new DataView(audioData);\n var wanted = \"DEMOPUSHEADER_V2\";\n var success = true;\n for(var i = 0, n = 16; i < n; i++) {\n var c = view.getUint8(i);\n if (c != wanted.charCodeAt(i)) {\n success = false;\n }\n }\n if(success) {\n return this.fileLoad_custom(audioData);\n }\n }\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 fileLoad_custom(demopusData) {\n this.setStateChange(STATE_DECODING);\n var promises = [];\n\n const view = new DataView(demopusData);\n var ofs = 16; // skip header\n\n var channels = 1;\n var sampleRate = view.getUint32(ofs, true);\n ofs += 4;\n var numSamples = Number(view.getBigUint64(ofs, true));\n ofs += 8;\n\n // output sample rate != input sample rate\n numSamples *= (this.ac.sampleRate / sampleRate);\n var audioBuffer = this.ac.createBuffer(channels, numSamples, this.ac.sampleRate);\n\n while (ofs < demopusData.byteLength) {\n var samplesOfs = Number(view.getBigUint64(ofs, true));\n ofs += 8;\n samplesOfs *= (this.ac.sampleRate / sampleRate);\n\n if (ofs >= demopusData.byteLength) {\n break;\n }\n\n var dataLen = view.getUint32(ofs, true);\n ofs += 4;\n\n var opusData = demopusData.slice(ofs, ofs + dataLen);\n ofs += dataLen;\n\n var promise = this.ac.decodeAudioData(\n opusData,\n function(decoded) {\n var buf = decoded.getChannelData(0);\n audioBuffer.copyToChannel(buf, 0, this);\n return decoded.length;\n }.bind(samplesOfs),\n (err) => {\n if (err === null) {\n // Safari issues with null error\n return Error('MediaDecodeAudioDataUnknownContentType');\n } else {\n return err;\n }\n },\n );\n\n promises.push(promise);\n }\n\n return new Promise((resolve, reject) => {\n Promise.all(promises).then(result => {\n this.setStateChange(STATE_FINISHED);\n resolve(audioBuffer);\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.info = undefined;\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 setInfo(info) {\n this.info = info;\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 if (widgets.info) {\n controls.push(\n h('label.info', [this.info])\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 info: this.info,\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, marginLeft = 0) {\n this.playlist = playlist;\n this.marginLeft = marginLeft;\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; position: relative; margin-left: ${this.marginLeft}px;`,\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 let stereo;\n\n function init(config) {\n sampleRate = config.sampleRate;\n stereo = config.stereo;\n }\n\n function record(inputBuffer) {\n recBuffersL.push(inputBuffer[0]);\n if (stereo) {\n recBuffersR.push(inputBuffer[1]);\n }\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) {\n const numChannels = stereo ? 2 : 1;\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, 36 + (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, numChannels, true);\n /* sample rate */\n view.setUint32(24, sampleRate, true);\n /* byte rate (sample rate * channel count * bytes per sample) */\n view.setUint32(28, sampleRate * numChannels * 2 , true);\n /* block align (channel count * bytes per sample) */\n view.setUint16(32, numChannels * 2, 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 var interleaved = bufferL;\n if (stereo) {\n const bufferR = mergeBuffers(recBuffersR, recLength);\n interleaved = interleave(bufferL, bufferR);\n }\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/demweb/templates/player.html b/demweb/templates/player.html new file mode 100644 index 0000000..1531479 --- /dev/null +++ b/demweb/templates/player.html @@ -0,0 +1,172 @@ + + + + + + + + + {{ player.guid }} - {{ player.name }} + + + + + + + + +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
guid + + {{ player.guid }} + +
name{{ player.name }}
first_seen{{ player.first_seen }}
last_seen{{ player.last_seen }}
playtime{{ player.playtime | to_duration }}
chats{{ player.chats }}
deaths{{ player.deaths }}
kills{{ player.kills }}
voicetime{{ player.voicetime | to_duration }}
+
+ +
+ + + + + + + + + {%- for name in player.names %} + + + + + {%- endfor %} + +
NameTime
{{ name.name }}{{ (name.time * 0.015) | to_duration }}
+
+ +
+ + + + + + + + {%- for spray in player.sprays %} + + + + {%- endfor %} + +
Spray
{{ spray.spray }}
+
+
+ +
+

Sessions

+ + + + + + + + + + + + + + {%- for session in player_sessions %} + + + + + + + + + + {%- endfor %} + +
#TimeLengthMapPlaytimeChatsVoicetime
+ + {{ session.session.id }} + + {{ session.session.time.isoformat(' ') }}{{ session.session.length | to_duration }}{{ session.session.mapname }}{{ session.playtime | to_duration }}{{ session.chats }}{{ session.voicetime | to_duration }}
+
+
+ + + + + + + + + + + diff --git a/demweb/templates/session.html b/demweb/templates/session.html index ac105c8..3e5dc9b 100644 --- a/demweb/templates/session.html +++ b/demweb/templates/session.html @@ -16,99 +16,113 @@ - +
-
- -
@@ -154,7 +168,7 @@ var g_events = [ playlist.load([ {%- for guid, psess in player_sessions.items() %} {%- if psess.voicetime > 0 %} -{src: "/static/css-ze-parsed/{{ session.demoname }}/voice/{{ guid }}.demopus", name: "{{ guid }}"}, +{src: "/static/css-ze-parsed/{{ session.demoname }}/voice/{{ guid }}.demopus", name: "{{ guid }}", info: "{{ psess.player.name }}"}, {%- endif -%} {% endfor %} ]).then(function() { diff --git a/demweb/views.py b/demweb/views.py index 34c1cac..5b5a9b1 100644 --- a/demweb/views.py +++ b/demweb/views.py @@ -40,3 +40,16 @@ def session(session_id): chats=chats, events=events ) + +@bp.route('/player/') +def player(guid): + player = Player.query.filter_by(guid=guid).one() + if not player: + return '404 Not Found', 404 + + player_sessions = PlayerSession.query.filter_by(player_guid=guid).all() + + return render_template('player.html', + player=player, + player_sessions=player_sessions + ) diff --git a/parser.py b/parser.py index 9eb481d..4860fe6 100644 --- a/parser.py +++ b/parser.py @@ -125,7 +125,7 @@ def parse_demo(path): kills = models.Player.kills + obj['kills'], voicetime = models.Player.voicetime + obj['voicetime'], first_seen = func.least(models.Player.first_seen, starttime), - last_seen = func.greatest(models.Player.first_seen, starttime), + last_seen = func.greatest(models.Player.last_seen, starttime), )) db.session.commit() break @@ -225,9 +225,11 @@ def parse_demo(path): eventdata = obj.copy() del eventdata['tick'] del eventdata['event'] + if 'steamid' in eventdata: + del eventdata['steamid'] event = models.Event( - player_guid=guid, + player_guid=obj['steamid'] if 'steamid' in obj else None, session_id=session.id, tick=obj['tick'], time=starttime + timedelta(seconds=obj['tick'] * tickinterval), diff --git a/requirements.txt b/requirements.txt index 88606fd..8cbca54 100644 --- a/requirements.txt +++ b/requirements.txt @@ -12,6 +12,7 @@ orjson==3.5.2 python-dotenv==0.17.1 SQLAlchemy==1.4.15 tqdm==4.60.0 +uWSGI==2.0.19.1 Werkzeug==2.0.0 zope.event==4.5.0 zope.interface==5.4.0