diff options
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/public/bundle.js b/public/bundle.js index ed51919..b2c7f36 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -12,5 +12,5 @@ var i=n(221),r=n(220),o=n(120);function s(){return u.TYPED_ARRAY_SUPPORT?2147483 * @license http://opensource.org/licenses/MIT MIT License * @copyright 2014-2018 Yotam Mann */return e=function(){var t=function(){if(!(this instanceof t))throw new Error("constructor needs to be called with the 'new' keyword")};t.prototype.toString=function(){for(var e in t){var n=e[0].match(/^[A-Z]$/),i=t[e]===this.constructor;if(t.isFunction(t[e])&&n&&i)return e}return"Tone"},t.prototype.dispose=function(){return this},t.prototype.set=function(e,n,i){if(t.isObject(e))i=n;else if(t.isString(e)){var r={};r[e]=n,e=r}t:for(var o in e){n=e[o];var s=this;if(-1!==o.indexOf(".")){for(var a=o.split("."),u=0;u<a.length-1;u++)if((s=s[a[u]])instanceof t){a.splice(0,u+1);var l=a.join(".");s.set(l,n);continue t}o=a[a.length-1]}var c=s[o];t.isUndef(c)||(t.Signal&&c instanceof t.Signal||t.Param&&c instanceof t.Param?c.value!==n&&(t.isUndef(i)?c.value=n:c.rampTo(n,i)):c instanceof AudioParam?c.value!==n&&(c.value=n):t.TimeBase&&c instanceof t.TimeBase?s[o]=n:c instanceof t?c.set(n):c!==n&&(s[o]=n))}return this},t.prototype.get=function(e){t.isUndef(e)?e=this._collectDefaults(this.constructor):t.isString(e)&&(e=[e]);for(var n={},i=0;i<e.length;i++){var r=e[i],o=this,s=n;if(-1!==r.indexOf(".")){for(var a=r.split("."),u=0;u<a.length-1;u++){var l=a[u];s[l]=s[l]||{},s=s[l],o=o[l]}r=a[a.length-1]}var c=o[r];t.isObject(e[r])?s[r]=c.get():t.Signal&&c instanceof t.Signal?s[r]=c.value:t.Param&&c instanceof t.Param?s[r]=c.value:c instanceof AudioParam?s[r]=c.value:c instanceof t?s[r]=c.get():!t.isFunction(c)&&t.isDefined(c)&&(s[r]=c)}return n},t.prototype._collectDefaults=function(e){var n=[];if(t.isDefined(e.defaults)&&(n=Object.keys(e.defaults)),t.isDefined(e._super))for(var i=this._collectDefaults(e._super),r=0;r<i.length;r++)-1===n.indexOf(i[r])&&n.push(i[r]);return n},t.defaults=function(e,n,i){var r={};if(1===e.length&&t.isObject(e[0]))r=e[0];else for(var o=0;o<n.length;o++)r[n[o]]=e[o];return t.isDefined(i.defaults)?t.defaultArg(r,i.defaults):t.isObject(i)?t.defaultArg(r,i):r},t.defaultArg=function(e,n){if(t.isObject(e)&&t.isObject(n)){var i={};for(var r in e)i[r]=t.defaultArg(n[r],e[r]);for(var o in n)i[o]=t.defaultArg(e[o],n[o]);return i}return t.isUndef(e)?n:e},t.connectSeries=function(){for(var e=arguments[0],n=1;n<arguments.length;n++){var i=arguments[n];e.connect(i),e=i}return t},t.isUndef=function(t){return void 0===t},t.isDefined=function(e){return!t.isUndef(e)},t.isFunction=function(t){return"function"==typeof t},t.isNumber=function(t){return"number"==typeof t},t.isObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object},t.isBoolean=function(t){return"boolean"==typeof t},t.isArray=function(t){return Array.isArray(t)},t.isString=function(t){return"string"==typeof t},t.isNote=function(e){return t.isString(e)&&/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i.test(e)},t.noOp=function(){},t.prototype._readOnly=function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this._readOnly(t[e]);else Object.defineProperty(this,t,{writable:!1,enumerable:!0})},t.prototype._writable=function(t){if(Array.isArray(t))for(var e=0;e<t.length;e++)this._writable(t[e]);else Object.defineProperty(this,t,{writable:!0})},t.State={Started:"started",Stopped:"stopped",Paused:"paused"},t.equalPowerScale=function(t){var e=.5*Math.PI;return Math.sin(t*e)},t.dbToGain=function(t){return Math.pow(10,t/20)},t.gainToDb=function(t){return Math.log(t)/Math.LN10*20},t.intervalToFrequencyRatio=function(t){return Math.pow(2,t/12)},t.prototype.now=function(){return t.context.now()},t.now=function(){return t.context.now()},t.extend=function(e,n){function i(){}t.isUndef(n)&&(n=t),i.prototype=n.prototype,e.prototype=new i,e.prototype.constructor=e,e._super=n};var e=null;return Object.defineProperty(t,"context",{get:function(){return e},set:function(n){e=t.Context&&n instanceof t.Context?n:new t.Context(n),t.Context.emit("init",e)}}),Object.defineProperty(t.prototype,"context",{get:function(){return t.context}}),t.setContext=function(e){t.context=e},Object.defineProperty(t.prototype,"blockTime",{get:function(){return 128/this.context.sampleRate}}),Object.defineProperty(t.prototype,"sampleTime",{get:function(){return 1/this.context.sampleRate}}),Object.defineProperty(t,"supported",{get:function(){var t=window.hasOwnProperty("AudioContext")||window.hasOwnProperty("webkitAudioContext"),e=window.hasOwnProperty("Promise"),n=window.hasOwnProperty("Worker");return t&&e&&n}}),Object.defineProperty(t,"initialized",{get:function(){return null!==e}}),t.getContext=function(e){if(t.initialized)e(t.context);else{var n=function(){e(t.context),t.Context.off("init",n)};t.Context.on("init",n)}return t},t.version="r12",t},t=e(),n(function(t){return t.Emitter=function(){t.call(this),this._events={}},t.extend(t.Emitter),t.Emitter.prototype.on=function(t,e){for(var n=t.split(/\W+/),i=0;i<n.length;i++){var r=n[i];this._events.hasOwnProperty(r)||(this._events[r]=[]),this._events[r].push(e)}return this},t.Emitter.prototype.once=function(t,e){var n=function(){e.apply(this,arguments),this.off(t,n)}.bind(this);return this.on(t,n),this},t.Emitter.prototype.off=function(e,n){for(var i=e.split(/\W+/),r=0;r<i.length;r++)if(e=i[r],this._events.hasOwnProperty(e))if(t.isUndef(n))this._events[e]=[];else for(var o=this._events[e],s=0;s<o.length;s++)o[s]===n&&o.splice(s,1);return this},t.Emitter.prototype.emit=function(t){if(this._events){var e=Array.apply(null,arguments).slice(1);if(this._events.hasOwnProperty(t))for(var n=this._events[t].slice(0),i=0,r=n.length;i<r;i++)n[i].apply(this,e)}return this},t.Emitter.mixin=function(e){var n=["on","once","off","emit"];e._events={};for(var i=0;i<n.length;i++){var r=n[i],o=t.Emitter.prototype[r];e[r]=o}return t.Emitter},t.Emitter.prototype.dispose=function(){return t.prototype.dispose.call(this),this._events=null,this},t.Emitter}),n(function(t){return t.Timeline=function(){var e=t.defaults(arguments,["memory"],t.Timeline);t.call(this),this._timeline=[],this.memory=e.memory},t.extend(t.Timeline),t.Timeline.defaults={memory:1/0},Object.defineProperty(t.Timeline.prototype,"length",{get:function(){return this._timeline.length}}),t.Timeline.prototype.add=function(e){if(t.isUndef(e.time))throw new Error("Tone.Timeline: events must have a time attribute");e.time=e.time.valueOf();var n=this._search(e.time);if(this._timeline.splice(n+1,0,e),this.length>this.memory){var i=this.length-this.memory;this._timeline.splice(0,i)}return this},t.Timeline.prototype.remove=function(t){var e=this._timeline.indexOf(t);return-1!==e&&this._timeline.splice(e,1),this},t.Timeline.prototype.get=function(e,n){n=t.defaultArg(n,"time");var i=this._search(e,n);return-1!==i?this._timeline[i]:null},t.Timeline.prototype.peek=function(){return this._timeline[0]},t.Timeline.prototype.shift=function(){return this._timeline.shift()},t.Timeline.prototype.getAfter=function(e,n){n=t.defaultArg(n,"time");var i=this._search(e,n);return i+1<this._timeline.length?this._timeline[i+1]:null},t.Timeline.prototype.getBefore=function(e,n){n=t.defaultArg(n,"time");var i=this._timeline.length;if(i>0&&this._timeline[i-1][n]<e)return this._timeline[i-1];var r=this._search(e,n);return r-1>=0?this._timeline[r-1]:null},t.Timeline.prototype.cancel=function(t){if(this._timeline.length>1){var e=this._search(t);if(e>=0)if(this._timeline[e].time===t){for(var n=e;n>=0&&this._timeline[n].time===t;n--)e=n;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else 1===this._timeline.length&&this._timeline[0].time>=t&&(this._timeline=[]);return this},t.Timeline.prototype.cancelBefore=function(t){var e=this._search(t);return e>=0&&(this._timeline=this._timeline.slice(e+1)),this},t.Timeline.prototype.previousEvent=function(t){var e=this._timeline.indexOf(t);return e>0?this._timeline[e-1]:null},t.Timeline.prototype._search=function(e,n){if(0===this._timeline.length)return-1;n=t.defaultArg(n,"time");var i=0,r=this._timeline.length,o=r;if(r>0&&this._timeline[r-1][n]<=e)return r-1;for(;i<o;){var s=Math.floor(i+(o-i)/2),a=this._timeline[s],u=this._timeline[s+1];if(a[n]===e){for(var l=s;l<this._timeline.length;l++)this._timeline[l][n]===e&&(s=l);return s}if(a[n]<e&&u[n]>e)return s;a[n]>e?o=s:i=s+1}return-1},t.Timeline.prototype._iterate=function(e,n,i){n=t.defaultArg(n,0),i=t.defaultArg(i,this._timeline.length-1),this._timeline.slice(n,i+1).forEach(function(t){e.call(this,t)}.bind(this))},t.Timeline.prototype.forEach=function(t){return this._iterate(t),this},t.Timeline.prototype.forEachBefore=function(t,e){var n=this._search(t);return-1!==n&&this._iterate(e,0,n),this},t.Timeline.prototype.forEachAfter=function(t,e){var n=this._search(t);return this._iterate(e,n+1),this},t.Timeline.prototype.forEachBetween=function(t,e,n){var i=this._search(t),r=this._search(e);return-1!==i&&-1!==r?(this._timeline[i].time!==t&&(i+=1),this._timeline[r].time===e&&(r-=1),this._iterate(n,i,r)):-1===i&&this._iterate(n,0,r),this},t.Timeline.prototype.forEachFrom=function(t,e){for(var n=this._search(t);n>=0&&this._timeline[n].time>=t;)n--;return this._iterate(e,n+1),this},t.Timeline.prototype.forEachAtTime=function(t,e){var n=this._search(t);return-1!==n&&this._iterate(function(n){n.time===t&&e.call(this,n)},0,n),this},t.Timeline.prototype.dispose=function(){return t.prototype.dispose.call(this),this._timeline=null,this},t.Timeline}),n(function(t){t.supported&&(!window.hasOwnProperty("OfflineAudioContext")&&window.hasOwnProperty("webkitOfflineAudioContext")&&(window.OfflineAudioContext=window.webkitOfflineAudioContext),new OfflineAudioContext(1,1,44100).startRendering()instanceof Promise||(OfflineAudioContext.prototype._native_startRendering=OfflineAudioContext.prototype.startRendering,OfflineAudioContext.prototype.startRendering=function(){return new Promise(function(t){this.oncomplete=function(e){t(e.renderedBuffer)},this._native_startRendering()}.bind(this))}))}),n(function(t){if(t.supported){!window.hasOwnProperty("AudioContext")&&window.hasOwnProperty("webkitAudioContext")&&(window.AudioContext=window.webkitAudioContext),AudioContext.prototype.close||(AudioContext.prototype.close=function(){return t.isFunction(this.suspend)&&this.suspend(),Promise.resolve()}),AudioContext.prototype.resume||(AudioContext.prototype.resume=function(){return Promise.resolve()}),!AudioContext.prototype.createGain&&AudioContext.prototype.createGainNode&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),!AudioContext.prototype.createDelay&&AudioContext.prototype.createDelayNode&&(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode);var e=!1,n=new OfflineAudioContext(1,1,44100),i=new Uint32Array([1179011410,48,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,8,0,0,0,0]).buffer;try{n.decodeAudioData(i)instanceof Promise&&(e=!0)}catch(t){e=!1}e||(AudioContext.prototype._native_decodeAudioData=AudioContext.prototype.decodeAudioData,AudioContext.prototype.decodeAudioData=function(t){return new Promise(function(e,n){this._native_decodeAudioData(t,e,n)}.bind(this))})}}),n(function(t){t.Context=function(){t.Emitter.call(this);var n=t.defaults(arguments,["context"],t.Context);if(!n.context&&(n.context=new window.AudioContext,!n.context))throw new Error("could not create AudioContext. Possibly too many AudioContexts running already.");for(var i in this._context=n.context,this._context)this._defineProperty(this._context,i);this._latencyHint=n.latencyHint,this._constants={},this.lookAhead=n.lookAhead,this._computedUpdateInterval=0,this._ticker=new e(this.emit.bind(this,"tick"),n.clockSource,n.updateInterval),this._timeouts=new t.Timeline,this._timeoutIds=0,this.on("tick",this._timeoutLoop.bind(this))},t.extend(t.Context,t.Emitter),t.Emitter.mixin(t.Context),t.Context.defaults={clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.03},t.Context.prototype._defineProperty=function(e,n){t.isUndef(this[n])&&Object.defineProperty(this,n,{get:function(){return"function"==typeof e[n]?e[n].bind(e):e[n]},set:function(t){e[n]=t}})},t.Context.prototype.now=function(){return this._context.currentTime+this.lookAhead},t.Context.prototype.ready=function(){return new Promise(function(t){"running"===this._context.state?t():this._context.resume().then(function(){t()})}.bind(this))},t.Context.prototype.close=function(){return this._context.close().then(function(){t.Context.emit("close",this)}.bind(this))},t.Context.prototype.getConstant=function(t){if(this._constants[t])return this._constants[t];for(var e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0),i=0;i<n.length;i++)n[i]=t;var r=this._context.createBufferSource();return r.channelCount=1,r.channelCountMode="explicit",r.buffer=e,r.loop=!0,r.start(0),this._constants[t]=r,r},t.Context.prototype._timeoutLoop=function(){for(var t=this.now();this._timeouts&&this._timeouts.length&&this._timeouts.peek().time<=t;)this._timeouts.shift().callback()},t.Context.prototype.setTimeout=function(t,e){this._timeoutIds++;var n=this.now();return this._timeouts.add({callback:t,time:n+e,id:this._timeoutIds}),this._timeoutIds},t.Context.prototype.clearTimeout=function(t){return this._timeouts.forEach(function(e){e.id===t&&this.remove(e)}),this},Object.defineProperty(t.Context.prototype,"updateInterval",{get:function(){return this._ticker.updateInterval},set:function(t){this._ticker.updateInterval=t}}),Object.defineProperty(t.Context.prototype,"clockSource",{get:function(){return this._ticker.type},set:function(t){this._ticker.type=t}}),Object.defineProperty(t.Context.prototype,"latencyHint",{get:function(){return this._latencyHint},set:function(e){var n=e;if(this._latencyHint=e,t.isString(e))switch(e){case"interactive":n=.1,this._context.latencyHint=e;break;case"playback":n=.8,this._context.latencyHint=e;break;case"balanced":n=.25,this._context.latencyHint=e;break;case"fastest":this._context.latencyHint="interactive",n=.01}this.lookAhead=n,this.updateInterval=n/3}}),t.Context.prototype.dispose=function(){return this.close().then(function(){for(var e in t.Emitter.prototype.dispose.call(this),this._ticker.dispose(),this._ticker=null,this._timeouts.dispose(),this._timeouts=null,this._constants)this._constants[e].disconnect();this._constants=null}.bind(this))};var e=function(e,n,i){this._type=n,this._updateInterval=i,this._callback=t.defaultArg(e,t.noOp),this._createClock()};return e.Type={Worker:"worker",Timeout:"timeout",Offline:"offline"},e.prototype._createWorker=function(){window.URL=window.URL||window.webkitURL;var t=new Blob(["var timeoutTime = "+(1e3*this._updateInterval).toFixed(1)+";self.onmessage = function(msg){\ttimeoutTime = parseInt(msg.data);};function tick(){\tsetTimeout(tick, timeoutTime);\tself.postMessage('tick');}tick();"]),e=URL.createObjectURL(t),n=new Worker(e);n.onmessage=this._callback.bind(this),this._worker=n},e.prototype._createTimeout=function(){this._timeout=setTimeout(function(){this._createTimeout(),this._callback()}.bind(this),1e3*this._updateInterval)},e.prototype._createClock=function(){if(this._type===e.Type.Worker)try{this._createWorker()}catch(t){this._type=e.Type.Timeout,this._createClock()}else this._type===e.Type.Timeout&&this._createTimeout()},Object.defineProperty(e.prototype,"updateInterval",{get:function(){return this._updateInterval},set:function(t){this._updateInterval=Math.max(t,128/44100),this._type===e.Type.Worker&&this._worker.postMessage(Math.max(1e3*t,1))}}),Object.defineProperty(e.prototype,"type",{get:function(){return this._type},set:function(t){this._disposeClock(),this._type=t,this._createClock()}}),e.prototype._disposeClock=function(){this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this._worker&&(this._worker.terminate(),this._worker.onmessage=null,this._worker=null)},e.prototype.dispose=function(){this._disposeClock(),this._callback=null},t.getContext(function(){var e=AudioNode.prototype.connect,n=AudioNode.prototype.disconnect;function i(n,i,r){if(n.input)return r=t.defaultArg(r,0),t.isArray(n.input)?this.connect(n.input[r]):this.connect(n.input,i,r);try{return n instanceof AudioNode?(e.call(this,n,i,r),n):(e.call(this,n,i),n)}catch(t){throw new Error("error connecting to node: "+n+"\n"+t)}}AudioNode.prototype.connect!==i&&(AudioNode.prototype.connect=i,AudioNode.prototype.disconnect=function(e,i,r){if(e&&e.input&&t.isArray(e.input))r=t.defaultArg(r,0),this.disconnect(e.input[r],i,0);else if(e&&e.input)this.disconnect(e.input,i,r);else try{n.apply(this,arguments)}catch(t){throw new Error("error disconnecting node: "+e+"\n"+t)}})}),t.supported&&!t.initialized?(t.context=new t.Context,window.TONE_SILENCE_VERSION_LOGGING||console.log("%c * Tone.js "+t.version+" * ","background: #000; color: #fff")):t.supported||console.warn("This browser does not support Tone.js"),t.Context}),n(function(t){return t.AudioNode=function(){t.call(this);var e=t.defaults(arguments,["context"],{context:t.context});this._context=e.context},t.extend(t.AudioNode),Object.defineProperty(t.AudioNode.prototype,"context",{get:function(){return this._context}}),t.AudioNode.prototype.createInsOuts=function(t,e){1===t?this.input=this.context.createGain():t>1&&(this.input=new Array(t)),1===e?this.output=this.context.createGain():e>1&&(this.output=new Array(e))},Object.defineProperty(t.AudioNode.prototype,"channelCount",{get:function(){return this.output.channelCount},set:function(t){return this.output.channelCount=t}}),Object.defineProperty(t.AudioNode.prototype,"channelCountMode",{get:function(){return this.output.channelCountMode},set:function(t){return this.output.channelCountMode=t}}),Object.defineProperty(t.AudioNode.prototype,"channelInterpretation",{get:function(){return this.output.channelInterpretation},set:function(t){return this.output.channelInterpretation=t}}),Object.defineProperty(t.AudioNode.prototype,"numberOfInputs",{get:function(){return this.input?t.isArray(this.input)?this.input.length:1:0}}),Object.defineProperty(t.AudioNode.prototype,"numberOfOutputs",{get:function(){return this.output?t.isArray(this.output)?this.output.length:1:0}}),t.AudioNode.prototype._onConnect=function(){},t.AudioNode.prototype.connect=function(e,n,i){return e._onConnect&&e._onConnect(this),t.isArray(this.output)?(n=t.defaultArg(n,0),this.output[n].connect(e,0,i)):this.output.connect(e,n,i),this},t.AudioNode.prototype.disconnect=function(e,n,i){t.isArray(this.output)?t.isNumber(e)?this.output[e].disconnect():(n=t.defaultArg(n,0),this.output[n].disconnect(e,0,i)):this.output.disconnect.apply(this.output,arguments)},t.AudioNode.prototype.chain=function(){for(var t=this,e=0;e<arguments.length;e++){var n=arguments[e];t.connect(n),t=n}return this},t.AudioNode.prototype.fan=function(){for(var t=0;t<arguments.length;t++)this.connect(arguments[t]);return this},window.AudioNode&&(AudioNode.prototype.chain=t.AudioNode.prototype.chain,AudioNode.prototype.fan=t.AudioNode.prototype.fan),t.AudioNode.prototype.dispose=function(){return t.isDefined(this.input)&&(this.input instanceof AudioNode&&this.input.disconnect(),this.input=null),t.isDefined(this.output)&&(this.output instanceof AudioNode&&this.output.disconnect(),this.output=null),this._context=null,this},t.AudioNode}),n(function(t){return t.SignalBase=function(){t.AudioNode.call(this)},t.extend(t.SignalBase,t.AudioNode),t.SignalBase.prototype.connect=function(e,n,i){return t.Signal&&t.Signal===e.constructor||t.Param&&t.Param===e.constructor?(e._param.cancelScheduledValues(0),e._param.value=0,e.overridden=!0):e instanceof AudioParam&&(e.cancelScheduledValues(0),e.value=0),t.AudioNode.prototype.connect.call(this,e,n,i),this},t.SignalBase}),n(function(t){if(t.supported){var e=navigator.userAgent.toLowerCase();if(e.includes("safari")&&!e.includes("chrome")){var n=function(t){for(var e in this._internalNode=this.input=this.output=t._native_createWaveShaper(),this._curve=null,this._internalNode)this._defineProperty(this._internalNode,e)};Object.defineProperty(n.prototype,"curve",{get:function(){return this._curve},set:function(t){this._curve=t;var e=new Float32Array(t.length+1);e.set(t,1),e[0]=t[0],this._internalNode.curve=e}}),n.prototype._defineProperty=function(e,n){t.isUndef(this[n])&&Object.defineProperty(this,n,{get:function(){return"function"==typeof e[n]?e[n].bind(e):e[n]},set:function(t){e[n]=t}})},AudioContext.prototype._native_createWaveShaper=AudioContext.prototype.createWaveShaper,AudioContext.prototype.createWaveShaper=function(){return new n(this)}}}}),n(function(t){return t.WaveShaper=function(e,n){t.SignalBase.call(this),this._shaper=this.input=this.output=this.context.createWaveShaper(),this._curve=null,Array.isArray(e)?this.curve=e:isFinite(e)||t.isUndef(e)?this._curve=new Float32Array(t.defaultArg(e,1024)):t.isFunction(e)&&(this._curve=new Float32Array(t.defaultArg(n,1024)),this.setMap(e))},t.extend(t.WaveShaper,t.SignalBase),t.WaveShaper.prototype.setMap=function(t){for(var e=new Array(this._curve.length),n=0,i=this._curve.length;n<i;n++){var r=n/(i-1)*2-1;e[n]=t(r,n)}return this.curve=e,this},Object.defineProperty(t.WaveShaper.prototype,"curve",{get:function(){return this._shaper.curve},set:function(t){this._curve=new Float32Array(t),this._shaper.curve=this._curve}}),Object.defineProperty(t.WaveShaper.prototype,"oversample",{get:function(){return this._shaper.oversample},set:function(t){if(!["none","2x","4x"].includes(t))throw new RangeError("Tone.WaveShaper: oversampling must be either 'none', '2x', or '4x'");this._shaper.oversample=t}}),t.WaveShaper.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._shaper.disconnect(),this._shaper=null,this._curve=null,this},t.WaveShaper}),n(function(t){return t.TimeBase=function(e,n){if(!(this instanceof t.TimeBase))return new t.TimeBase(e,n);if(this._val=e,this._units=n,t.isUndef(this._units)&&t.isString(this._val)&&parseFloat(this._val)==this._val&&"+"!==this._val.charAt(0))this._val=parseFloat(this._val),this._units=this._defaultUnits;else if(e&&e.constructor===this.constructor)this._val=e._val,this._units=e._units;else if(e instanceof t.TimeBase)switch(this._defaultUnits){case"s":this._val=e.toSeconds();break;case"i":this._val=e.toTicks();break;case"hz":this._val=e.toFrequency();break;case"midi":this._val=e.toMidi();break;default:throw new Error("Unrecognized default units "+this._defaultUnits)}},t.extend(t.TimeBase),t.TimeBase.prototype._expressions={n:{regexp:/^(\d+)n(\.?)$/i,method:function(t,e){t=parseInt(t);var n="."===e?1.5:1;return 1===t?this._beatsToUnits(this._getTimeSignature())*n:this._beatsToUnits(4/t)*n}},t:{regexp:/^(\d+)t$/i,method:function(t){return t=parseInt(t),this._beatsToUnits(8/(3*parseInt(t)))}},m:{regexp:/^(\d+)m$/i,method:function(t){return this._beatsToUnits(parseInt(t)*this._getTimeSignature())}},i:{regexp:/^(\d+)i$/i,method:function(t){return this._ticksToUnits(parseInt(t))}},hz:{regexp:/^(\d+(?:\.\d+)?)hz$/i,method:function(t){return this._frequencyToUnits(parseFloat(t))}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?$/,method:function(t,e,n){var i=0;return t&&"0"!==t&&(i+=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&"0"!==e&&(i+=this._beatsToUnits(parseFloat(e))),n&&"0"!==n&&(i+=this._beatsToUnits(parseFloat(n)/4)),i}},s:{regexp:/^(\d+(?:\.\d+)?)s$/,method:function(t){return this._secondsToUnits(parseFloat(t))}},samples:{regexp:/^(\d+)samples$/,method:function(t){return parseInt(t)/this.context.sampleRate}},default:{regexp:/^(\d+(?:\.\d+)?)$/,method:function(t){return this._expressions[this._defaultUnits].method.call(this,t)}}},t.TimeBase.prototype._defaultUnits="s",t.TimeBase.prototype._getBpm=function(){return t.Transport?t.Transport.bpm.value:120},t.TimeBase.prototype._getTimeSignature=function(){return t.Transport?t.Transport.timeSignature:4},t.TimeBase.prototype._getPPQ=function(){return t.Transport?t.Transport.PPQ:192},t.TimeBase.prototype._now=function(){return this.now()},t.TimeBase.prototype._frequencyToUnits=function(t){return 1/t},t.TimeBase.prototype._beatsToUnits=function(t){return 60/this._getBpm()*t},t.TimeBase.prototype._secondsToUnits=function(t){return t},t.TimeBase.prototype._ticksToUnits=function(t){return t*(this._beatsToUnits(1)/this._getPPQ())},t.TimeBase.prototype._noArg=function(){return this._now()},t.TimeBase.prototype.valueOf=function(){if(t.isUndef(this._val))return this._noArg();if(t.isString(this._val)&&t.isUndef(this._units))for(var e in this._expressions)if(this._expressions[e].regexp.test(this._val.trim())){this._units=e;break}if(t.isDefined(this._units)){var n=this._expressions[this._units],i=this._val.toString().trim().match(n.regexp);return i?n.method.apply(this,i.slice(1)):n.method.call(this,parseFloat(this._val))}return this._val},t.TimeBase.prototype.toSeconds=function(){return this.valueOf()},t.TimeBase.prototype.toFrequency=function(){return 1/this.toSeconds()},t.TimeBase.prototype.toSamples=function(){return this.toSeconds()*this.context.sampleRate},t.TimeBase.prototype.toMilliseconds=function(){return 1e3*this.toSeconds()},t.TimeBase.prototype.dispose=function(){this._val=null,this._units=null},t.TimeBase}),n(function(t){t.Frequency=function(e,n){if(!(this instanceof t.Frequency))return new t.Frequency(e,n);t.TimeBase.call(this,e,n)},t.extend(t.Frequency,t.TimeBase),t.Frequency.prototype._expressions=Object.assign({},t.TimeBase.prototype._expressions,{midi:{regexp:/^(\d+(?:\.\d+)?midi)/,method:function(e){return"midi"===this._defaultUnits?e:t.Frequency.mtof(e)}},note:{regexp:/^([a-g]{1}(?:b|#|x|bb)?)(-?[0-9]+)/i,method:function(n,i){var r=e[n.toLowerCase()]+12*(parseInt(i)+1);return"midi"===this._defaultUnits?r:t.Frequency.mtof(r)}},tr:{regexp:/^(\d+(?:\.\d+)?):(\d+(?:\.\d+)?):?(\d+(?:\.\d+)?)?/,method:function(t,e,n){var i=1;return t&&"0"!==t&&(i*=this._beatsToUnits(this._getTimeSignature()*parseFloat(t))),e&&"0"!==e&&(i*=this._beatsToUnits(parseFloat(e))),n&&"0"!==n&&(i*=this._beatsToUnits(parseFloat(n)/4)),i}}}),t.Frequency.prototype.transpose=function(e){return new this.constructor(this.valueOf()*t.intervalToFrequencyRatio(e))},t.Frequency.prototype.harmonize=function(t){return t.map(function(t){return this.transpose(t)}.bind(this))},t.Frequency.prototype.toMidi=function(){return t.Frequency.ftom(this.valueOf())},t.Frequency.prototype.toNote=function(){var e=this.toFrequency(),i=Math.log2(e/t.Frequency.A4),r=Math.round(12*i)+57,o=Math.floor(r/12);return o<0&&(r+=-12*o),n[r%12]+o.toString()},t.Frequency.prototype.toSeconds=function(){return 1/t.TimeBase.prototype.toSeconds.call(this)},t.Frequency.prototype.toFrequency=function(){return t.TimeBase.prototype.toFrequency.call(this)},t.Frequency.prototype.toTicks=function(){var e=this._beatsToUnits(1),n=this.valueOf()/e;return Math.floor(n*t.Transport.PPQ)},t.Frequency.prototype._noArg=function(){return 0},t.Frequency.prototype._frequencyToUnits=function(t){return t},t.Frequency.prototype._ticksToUnits=function(e){return 1/(60*e/(t.Transport.bpm.value*t.Transport.PPQ))},t.Frequency.prototype._beatsToUnits=function(e){return 1/t.TimeBase.prototype._beatsToUnits.call(this,e)},t.Frequency.prototype._secondsToUnits=function(t){return 1/t},t.Frequency.prototype._defaultUnits="hz";var e={cbb:-2,cb:-1,c:0,"c#":1,cx:2,dbb:0,db:1,d:2,"d#":3,dx:4,ebb:2,eb:3,e:4,"e#":5,ex:6,fbb:3,fb:4,f:5,"f#":6,fx:7,gbb:5,gb:6,g:7,"g#":8,gx:9,abb:7,ab:8,a:9,"a#":10,ax:11,bbb:9,bb:10,b:11,"b#":12,bx:13},n=["C","C#","D","D#","E","F","F#","G","G#","A","A#","B"];return t.Frequency.A4=440,t.Frequency.mtof=function(e){return t.Frequency.A4*Math.pow(2,(e-69)/12)},t.Frequency.ftom=function(e){return 69+Math.round(12*Math.log2(e/t.Frequency.A4))},t.Frequency}),n(function(t){return t.Time=function(e,n){if(!(this instanceof t.Time))return new t.Time(e,n);t.TimeBase.call(this,e,n)},t.extend(t.Time,t.TimeBase),t.Time.prototype._expressions=Object.assign({},t.TimeBase.prototype._expressions,{quantize:{regexp:/^@(.+)/,method:function(e){if(t.Transport){var n=new this.constructor(e);return t.Transport.nextSubdivision(n)}return 0}},now:{regexp:/^\+(.+)/,method:function(t){return this._now()+new this.constructor(t)}}}),t.Time.prototype.quantize=function(e,n){n=t.defaultArg(n,1);var i=new this.constructor(e),r=this.valueOf();return r+(Math.round(r/i)*i-r)*n},t.Time.prototype.toNotation=function(){for(var e=this.toSeconds(),n=["1m"],i=1;i<8;i++){var r=Math.pow(2,i);n.push(r+"n."),n.push(r+"n"),n.push(r+"t")}n.push("0");var o=n[0],s=t.Time(n[0]).toSeconds();return n.forEach(function(n){var i=t.Time(n).toSeconds();Math.abs(i-e)<Math.abs(s-e)&&(o=n,s=i)}),o},t.Time.prototype.toBarsBeatsSixteenths=function(){var t=this._beatsToUnits(1),e=this.valueOf()/t,n=Math.floor(e/this._getTimeSignature()),i=e%1*4;return e=Math.floor(e)%this._getTimeSignature(),(i=i.toString()).length>3&&(i=parseFloat(parseFloat(i).toFixed(3))),[n,e,i].join(":")},t.Time.prototype.toTicks=function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.round(e*this._getPPQ())},t.Time.prototype.toSeconds=function(){return this.valueOf()},t.Time.prototype.toMidi=function(){return t.Frequency.ftom(this.toFrequency())},t.Time}),n(function(t){return t.TransportTime=function(e,n){if(!(this instanceof t.TransportTime))return new t.TransportTime(e,n);t.Time.call(this,e,n)},t.extend(t.TransportTime,t.Time),t.TransportTime.prototype._now=function(){return t.Transport.seconds},t.TransportTime}),n(function(t){return t.Type={Default:"number",Time:"time",Frequency:"frequency",TransportTime:"transportTime",Ticks:"ticks",NormalRange:"normalRange",AudioRange:"audioRange",Decibels:"db",Interval:"interval",BPM:"bpm",Positive:"positive",Gain:"gain",Cents:"cents",Degrees:"degrees",MIDI:"midi",BarsBeatsSixteenths:"barsBeatsSixteenths",Samples:"samples",Hertz:"hertz",Note:"note",Milliseconds:"milliseconds",Seconds:"seconds",Notation:"notation"},t.prototype.toSeconds=function(e){return t.isNumber(e)?e:t.isUndef(e)?this.now():t.isString(e)?new t.Time(e).toSeconds():e instanceof t.TimeBase?e.toSeconds():void 0},t.prototype.toFrequency=function(e){return t.isNumber(e)?e:t.isString(e)||t.isUndef(e)?new t.Frequency(e).valueOf():e instanceof t.TimeBase?e.toFrequency():void 0},t.prototype.toTicks=function(e){return t.isNumber(e)||t.isString(e)?new t.TransportTime(e).toTicks():t.isUndef(e)?t.Transport.ticks:e instanceof t.TimeBase?e.toTicks():void 0},t}),n(function(t){return t.Param=function(){var e=t.defaults(arguments,["param","units","convert"],t.Param);t.AudioNode.call(this),this._param=this.input=e.param,this.units=e.units,this.convert=e.convert,this.overridden=!1,this._events=new t.Timeline(1e3),t.isDefined(e.value)&&this._param&&(this.value=e.value)},t.extend(t.Param,t.AudioNode),t.Param.defaults={units:t.Type.Default,convert:!0,param:void 0},Object.defineProperty(t.Param.prototype,"value",{get:function(){var t=this.now();return this._toUnits(this.getValueAtTime(t))},set:function(t){this._initialValue=this._fromUnits(t),this.cancelScheduledValues(this.context.currentTime),this.setValueAtTime(t,this.context.currentTime)}}),Object.defineProperty(t.Param.prototype,"minValue",{get:function(){return this.units===t.Type.Time||this.units===t.Type.Frequency||this.units===t.Type.NormalRange||this.units===t.Type.Positive||this.units===t.Type.BPM?0:this.units===t.Type.AudioRange?-1:this.units===t.Type.Decibels?-1/0:this._param.minValue}}),Object.defineProperty(t.Param.prototype,"maxValue",{get:function(){return this.units===t.Type.NormalRange||this.units===t.Type.AudioRange?1:this._param.maxValue}}),t.Param.prototype._fromUnits=function(e){if(!this.convert&&!t.isUndef(this.convert)||this.overridden)return e;switch(this.units){case t.Type.Time:return this.toSeconds(e);case t.Type.Frequency:return this.toFrequency(e);case t.Type.Decibels:return t.dbToGain(e);case t.Type.NormalRange:return Math.min(Math.max(e,0),1);case t.Type.AudioRange:return Math.min(Math.max(e,-1),1);case t.Type.Positive:return Math.max(e,0);default:return e}},t.Param.prototype._toUnits=function(e){if(!this.convert&&!t.isUndef(this.convert))return e;switch(this.units){case t.Type.Decibels:return t.gainToDb(e);default:return e}},t.Param.prototype._minOutput=1e-5,t.Param.AutomationType={Linear:"linearRampToValueAtTime",Exponential:"exponentialRampToValueAtTime",Target:"setTargetAtTime",SetValue:"setValueAtTime"},t.Param.prototype.setValueAtTime=function(e,n){return n=this.toSeconds(n),e=this._fromUnits(e),this._events.add({type:t.Param.AutomationType.SetValue,value:e,time:n}),this._param.setValueAtTime(e,n),this},t.Param.prototype.getValueAtTime=function(e){e=this.toSeconds(e);var n=this._events.getAfter(e),i=this._events.get(e),r=t.defaultArg(this._initialValue,this._param.defaultValue),o=r;if(null===i)o=r;else if(i.type===t.Param.AutomationType.Target){var s,a=this._events.getBefore(i.time);s=null===a?r:a.value,o=this._exponentialApproach(i.time,s,i.value,i.constant,e)}else o=null===n?i.value:n.type===t.Param.AutomationType.Linear?this._linearInterpolate(i.time,i.value,n.time,n.value,e):n.type===t.Param.AutomationType.Exponential?this._exponentialInterpolate(i.time,i.value,n.time,n.value,e):i.value;return o},t.Param.prototype.setRampPoint=function(t){t=this.toSeconds(t);var e=this.getValueAtTime(t);return this.cancelAndHoldAtTime(t),0===e&&(e=this._minOutput),this.setValueAtTime(this._toUnits(e),t),this},t.Param.prototype.linearRampToValueAtTime=function(e,n){return e=this._fromUnits(e),n=this.toSeconds(n),this._events.add({type:t.Param.AutomationType.Linear,value:e,time:n}),this._param.linearRampToValueAtTime(e,n),this},t.Param.prototype.exponentialRampToValueAtTime=function(e,n){return e=this._fromUnits(e),e=Math.max(this._minOutput,e),n=this.toSeconds(n),this._events.add({type:t.Param.AutomationType.Exponential,time:n,value:e}),this._param.exponentialRampToValueAtTime(e,n),this},t.Param.prototype.exponentialRampTo=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialRampToValueAtTime(t,n+this.toSeconds(e)),this},t.Param.prototype.linearRampTo=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.linearRampToValueAtTime(t,n+this.toSeconds(e)),this},t.Param.prototype.targetRampTo=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialApproachValueAtTime(t,n,e),this},t.Param.prototype.exponentialApproachValueAtTime=function(t,e,n){var i=Math.log(this.toSeconds(n)+1)/Math.log(200);return e=this.toSeconds(e),this.setTargetAtTime(t,e,i)},t.Param.prototype.setTargetAtTime=function(e,n,i){if(e=this._fromUnits(e),i<=0)throw new Error("timeConstant must be greater than 0");return n=this.toSeconds(n),this._events.add({type:t.Param.AutomationType.Target,value:e,time:n,constant:i}),this._param.setTargetAtTime(e,n,i),this},t.Param.prototype.setValueCurveAtTime=function(e,n,i,r){r=t.defaultArg(r,1),i=this.toSeconds(i),n=this.toSeconds(n),this.setValueAtTime(e[0]*r,n);for(var o=i/(e.length-1),s=1;s<e.length;s++)this.linearRampToValueAtTime(e[s]*r,n+s*o);return this},t.Param.prototype.cancelScheduledValues=function(t){return t=this.toSeconds(t),this._events.cancel(t),this._param.cancelScheduledValues(t),this},t.Param.prototype.cancelAndHoldAtTime=function(e){var n=this.getValueAtTime(e),i=this._events.get(e),r=this._events.getAfter(e);return i&&i.time===e?r?this._events.cancel(r.time):this._events.cancel(e+1e-6):r&&(this._events.cancel(r.time),this._param.cancelAndHoldAtTime||this._param.cancelScheduledValues(e),r.type===t.Param.AutomationType.Linear?this._param.cancelAndHoldAtTime?this._events.add({type:t.Param.AutomationType.Linear,value:n,time:e}):this.linearRampToValueAtTime(n,e):r.type===t.Param.AutomationType.Exponential&&(this._param.cancelAndHoldAtTime?this._events.add({type:t.Param.AutomationType.Exponential,value:n,time:e}):this.exponentialRampToValueAtTime(n,e))),this._events.add({type:t.Param.AutomationType.SetValue,value:n,time:e}),this._param.cancelAndHoldAtTime?this._param.cancelAndHoldAtTime(e):this._param.setValueAtTime(n,e),this},t.Param.prototype.rampTo=function(e,n,i){return n=t.defaultArg(n,.1),this.units===t.Type.Frequency||this.units===t.Type.BPM||this.units===t.Type.Decibels?this.exponentialRampTo(e,n,i):this.linearRampTo(e,n,i),this},t.Param.prototype._exponentialApproach=function(t,e,n,i,r){return n+(e-n)*Math.exp(-(r-t)/i)},t.Param.prototype._linearInterpolate=function(t,e,n,i,r){return e+(r-t)/(n-t)*(i-e)},t.Param.prototype._exponentialInterpolate=function(t,e,n,i,r){return e*Math.pow(i/e,(r-t)/(n-t))},t.Param.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._param=null,this._events=null,this},t.Param}),n(function(t){return t.OfflineContext=function(e,n,i){var r=new OfflineAudioContext(e,n*i,i);t.Context.call(this,{context:r,clockSource:"offline",lookAhead:0,updateInterval:128/i}),this._duration=n,this._currentTime=0},t.extend(t.OfflineContext,t.Context),t.OfflineContext.prototype.now=function(){return this._currentTime},t.OfflineContext.prototype.render=function(){for(;this._duration-this._currentTime>=0;)this.emit("tick"),this._currentTime+=this.blockTime;return this._context.startRendering()},t.OfflineContext.prototype.close=function(){return this._context=null,Promise.resolve()},t.OfflineContext}),n(function(t){if(t.supported){var e=navigator.userAgent.toLowerCase();e.includes("safari")&&!e.includes("chrome")&&e.includes("mobile")&&(t.OfflineContext.prototype.createBufferSource=function(){var t=this._context.createBufferSource(),e=t.start;return t.start=function(n){this.setTimeout(function(){e.call(t,n)}.bind(this),0)}.bind(this),t})}}),n(function(t){return t.Gain=function(){var e=t.defaults(arguments,["gain","units"],t.Gain);t.AudioNode.call(this),this.input=this.output=this._gainNode=this.context.createGain(),this.gain=new t.Param({param:this._gainNode.gain,units:e.units,value:e.gain,convert:e.convert}),this._readOnly("gain")},t.extend(t.Gain,t.AudioNode),t.Gain.defaults={gain:1,convert:!0},t.Gain.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},t.Gain}),n(function(t){if(t.supported&&!AudioContext.prototype.createConstantSource){var e=function(t){this.context=t;for(var e=t.createBuffer(1,128,t.sampleRate),n=e.getChannelData(0),i=0;i<n.length;i++)n[i]=1;this._bufferSource=t.createBufferSource(),this._bufferSource.channelCount=1,this._bufferSource.channelCountMode="explicit",this._bufferSource.buffer=e,this._bufferSource.loop=!0;var r=this._output=t.createGain();this.offset=r.gain,this._bufferSource.connect(r)};e.prototype.start=function(t){return this._bufferSource.start(t),this},e.prototype.stop=function(t){return this._bufferSource.stop(t),this},e.prototype.connect=function(){return this._output.connect.apply(this._output,arguments),this},e.prototype.disconnect=function(){return this._output.disconnect.apply(this._output,arguments),this},AudioContext.prototype.createConstantSource=function(){return new e(this)},t.Context.prototype.createConstantSource=function(){return new e(this)}}}),n(function(t){return t.Signal=function(){var e=t.defaults(arguments,["value","units"],t.Signal);t.Param.call(this,e),this._proxies=[],this._sourceStarted=!1,this._constantSource=this.context.createConstantSource(),this._param=this._constantSource.offset,this.value=e.value,this.output=this._constantSource,this.input=this._param=this.output.offset},t.extend(t.Signal,t.Param),t.Signal.defaults={value:0,units:t.Type.Default,convert:!0},t.Signal.prototype.connect=function(e){return this._isParam(e)&&!this._sourceStarted?(this._proxies.push(e),e.overridden=!0,this._applyAutomations(e)):(t.SignalBase.prototype.connect.apply(this,arguments),this._sourceStarted||(this._sourceStarted=!0,this._constantSource.start(0))),this},t.Signal.prototype._isParam=function(e){return t.Param&&t.Param===e.constructor||e instanceof AudioParam},t.Signal.prototype._connectProxies=function(){this._sourceStarted||(this._sourceStarted=!0,this._constantSource.start(0)),this._proxies.forEach(function(e){t.SignalBase.prototype.connect.call(this,e),e._proxies&&e._connectProxies()}.bind(this))},t.Signal.prototype._onConnect=function(t){this._isParam(t)||this._connectProxies()},t.Signal.prototype._applyAutomations=function(t){var e=this.context.currentTime;t.cancelScheduledValues(e);var n=this.getValueAtTime(e);t.setValueAtTime(n,e),this._events.forEachFrom(e,function(e){t[e.type](e.value,e.time,e.constant)})},t.Signal.prototype.disconnect=function(e){if(this._proxies.includes(e)){var n=this._proxies.indexOf(e);this._proxies.splice(n,1)}else e||(this._proxies=[]);return t.SignalBase.prototype.disconnect.apply(this,arguments)},t.Signal.prototype.getValueAtTime=function(e){return this._param.getValueAtTime?this._param.getValueAtTime(e):t.Param.prototype.getValueAtTime.call(this,e)},["setValueAtTime","linearRampToValueAtTime","exponentialRampToValueAtTime","setTargetAtTime"].forEach(function(e){var n=t.Signal.prototype[e];t.Signal.prototype[e]=function(){var t=arguments;n.apply(this,arguments),t[0]=this._fromUnits(t[0]),t[1]=this.toSeconds(t[1]),this._proxies.forEach(function(n){n[e].apply(n,t)})}}),["cancelScheduledValues","cancelAndHoldAtTime"].forEach(function(e){var n=t.Signal.prototype[e];t.Signal.prototype[e]=function(){var t=arguments;n.apply(this,arguments),t[0]=this.toSeconds(t[0]),this._proxies.forEach(function(n){n[e].apply(n,t)})}}),t.Signal.prototype.dispose=function(){return t.Param.prototype.dispose.call(this),this._constantSource.disconnect(),this._constantSource=null,this._proxies=null,this},t.Signal}),n(function(t){return t.Pow=function(e){t.SignalBase.call(this),this._exp=t.defaultArg(e,1),this._expScaler=this.input=this.output=new t.WaveShaper(this._expFunc(this._exp),8192)},t.extend(t.Pow,t.SignalBase),Object.defineProperty(t.Pow.prototype,"value",{get:function(){return this._exp},set:function(t){this._exp=t,this._expScaler.setMap(this._expFunc(this._exp))}}),t.Pow.prototype._expFunc=function(t){return function(e){return Math.pow(Math.abs(e),t)}},t.Pow.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._expScaler.dispose(),this._expScaler=null,this},t.Pow}),n(function(t){return t.Envelope=function(){var e=t.defaults(arguments,["attack","decay","sustain","release"],t.Envelope);t.AudioNode.call(this),this.attack=e.attack,this.decay=e.decay,this.sustain=e.sustain,this.release=e.release,this._attackCurve="linear",this._releaseCurve="exponential",this._sig=this.output=new t.Signal(0),this.attackCurve=e.attackCurve,this.releaseCurve=e.releaseCurve},t.extend(t.Envelope,t.AudioNode),t.Envelope.defaults={attack:.01,decay:.1,sustain:.5,release:1,attackCurve:"linear",releaseCurve:"exponential"},Object.defineProperty(t.Envelope.prototype,"value",{get:function(){return this.getValueAtTime(this.now())}}),Object.defineProperty(t.Envelope.prototype,"attackCurve",{get:function(){if(t.isString(this._attackCurve))return this._attackCurve;if(t.isArray(this._attackCurve)){for(var e in t.Envelope.Type)if(t.Envelope.Type[e].In===this._attackCurve)return e;return this._attackCurve}},set:function(e){if(t.Envelope.Type.hasOwnProperty(e)){var n=t.Envelope.Type[e];t.isObject(n)?this._attackCurve=n.In:this._attackCurve=n}else{if(!t.isArray(e))throw new Error("Tone.Envelope: invalid curve: "+e);this._attackCurve=e}}}),Object.defineProperty(t.Envelope.prototype,"releaseCurve",{get:function(){if(t.isString(this._releaseCurve))return this._releaseCurve;if(t.isArray(this._releaseCurve)){for(var e in t.Envelope.Type)if(t.Envelope.Type[e].Out===this._releaseCurve)return e;return this._releaseCurve}},set:function(e){if(t.Envelope.Type.hasOwnProperty(e)){var n=t.Envelope.Type[e];t.isObject(n)?this._releaseCurve=n.Out:this._releaseCurve=n}else{if(!t.isArray(e))throw new Error("Tone.Envelope: invalid curve: "+e);this._releaseCurve=e}}}),t.Envelope.prototype.triggerAttack=function(e,n){e=this.toSeconds(e);var i=this.toSeconds(this.attack),r=i,o=this.toSeconds(this.decay);n=t.defaultArg(n,1);var s=this.getValueAtTime(e);if(s>0&&(r=(1-s)/(1/r)),"linear"===this._attackCurve)this._sig.linearRampTo(n,r,e);else if("exponential"===this._attackCurve)this._sig.targetRampTo(n,r,e);else if(r>0){this._sig.cancelAndHoldAtTime(e);var a=this._attackCurve;if(r<i){var u=1-r/i,l=Math.floor(u*this._attackCurve.length);(a=this._attackCurve.slice(l))[0]=s}this._sig.setValueCurveAtTime(a,e,r,n)}return o&&this._sig.targetRampTo(n*this.sustain,o,r+e),this},t.Envelope.prototype.triggerRelease=function(e){e=this.toSeconds(e);var n=this.getValueAtTime(e);if(n>0){var i=this.toSeconds(this.release);if("linear"===this._releaseCurve)this._sig.linearRampTo(0,i,e);else if("exponential"===this._releaseCurve)this._sig.targetRampTo(0,i,e);else{var r=this._releaseCurve;t.isArray(r)&&(this._sig.cancelAndHoldAtTime(e),this._sig.setValueCurveAtTime(r,e,i,n))}}return this},t.Envelope.prototype.getValueAtTime=function(t){return this._sig.getValueAtTime(t)},t.Envelope.prototype.triggerAttackRelease=function(t,e,n){return e=this.toSeconds(e),this.triggerAttack(e,n),this.triggerRelease(e+this.toSeconds(t)),this},t.Envelope.prototype.cancel=function(t){return this._sig.cancelScheduledValues(t),this},t.Envelope.prototype.connect=t.SignalBase.prototype.connect,function(){var e,n,i=[];for(e=0;e<128;e++)i[e]=Math.sin(e/127*(Math.PI/2));var r=[];for(e=0;e<127;e++){n=e/127;var o=Math.sin(n*(2*Math.PI)*6.4-Math.PI/2)+1;r[e]=o/10+.83*n}r[127]=1;var s=[];for(e=0;e<128;e++)s[e]=Math.ceil(e/127*5)/5;var a=[];for(e=0;e<128;e++)n=e/127,a[e]=.5*(1-Math.cos(Math.PI*n));var u,l=[];for(e=0;e<128;e++){n=e/127;var c=4*Math.pow(n,3)+.2,h=Math.cos(c*Math.PI*2*n);l[e]=Math.abs(h*(1-n))}function p(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=1-t[n];return e}t.Envelope.Type={linear:"linear",exponential:"exponential",bounce:{In:p(l),Out:l},cosine:{In:i,Out:(u=i,u.slice(0).reverse())},step:{In:s,Out:p(s)},ripple:{In:r,Out:p(r)},sine:{In:a,Out:p(a)}}}(),t.Envelope.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._sig.dispose(),this._sig=null,this._attackCurve=null,this._releaseCurve=null,this},t.Envelope}),n(function(t){return t.AmplitudeEnvelope=function(){t.Envelope.apply(this,arguments),this.input=this.output=new t.Gain,this._sig.connect(this.output.gain)},t.extend(t.AmplitudeEnvelope,t.Envelope),t.AmplitudeEnvelope.prototype.dispose=function(){return t.Envelope.prototype.dispose.call(this),this},t.AmplitudeEnvelope}),n(function(t){t.supported&&(AnalyserNode.prototype.getFloatTimeDomainData||(AnalyserNode.prototype.getFloatTimeDomainData=function(t){var e=new Uint8Array(t.length);this.getByteTimeDomainData(e);for(var n=0;n<e.length;n++)t[n]=(e[n]-128)/128}))}),n(function(t){return t.Analyser=function(){var e=t.defaults(arguments,["type","size"],t.Analyser);t.AudioNode.call(this),this._analyser=this.input=this.output=this.context.createAnalyser(),this._type=e.type,this._buffer=null,this.size=e.size,this.type=e.type},t.extend(t.Analyser,t.AudioNode),t.Analyser.defaults={size:1024,type:"fft",smoothing:.8},t.Analyser.Type={Waveform:"waveform",FFT:"fft"},t.Analyser.prototype.getValue=function(){return this._type===t.Analyser.Type.FFT?this._analyser.getFloatFrequencyData(this._buffer):this._type===t.Analyser.Type.Waveform&&this._analyser.getFloatTimeDomainData(this._buffer),this._buffer},Object.defineProperty(t.Analyser.prototype,"size",{get:function(){return this._analyser.frequencyBinCount},set:function(t){this._analyser.fftSize=2*t,this._buffer=new Float32Array(t)}}),Object.defineProperty(t.Analyser.prototype,"type",{get:function(){return this._type},set:function(e){if(e!==t.Analyser.Type.Waveform&&e!==t.Analyser.Type.FFT)throw new TypeError("Tone.Analyser: invalid type: "+e);this._type=e}}),Object.defineProperty(t.Analyser.prototype,"smoothing",{get:function(){return this._analyser.smoothingTimeConstant},set:function(t){this._analyser.smoothingTimeConstant=t}}),t.Analyser.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this),this._analyser.disconnect(),this._analyser=null,this._buffer=null},t.Analyser}),n(function(t){return t.Compressor=function(){var e=t.defaults(arguments,["threshold","ratio"],t.Compressor);t.AudioNode.call(this),this._compressor=this.input=this.output=this.context.createDynamicsCompressor(),this.threshold=new t.Param({param:this._compressor.threshold,units:t.Type.Decibels,convert:!1}),this.attack=new t.Param(this._compressor.attack,t.Type.Time),this.release=new t.Param(this._compressor.release,t.Type.Time),this.knee=new t.Param({param:this._compressor.knee,units:t.Type.Decibels,convert:!1}),this.ratio=new t.Param({param:this._compressor.ratio,convert:!1}),this._readOnly(["knee","release","attack","ratio","threshold"]),this.set(e)},t.extend(t.Compressor,t.AudioNode),t.Compressor.defaults={ratio:12,threshold:-24,release:.25,attack:.003,knee:30},t.Compressor.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable(["knee","release","attack","ratio","threshold"]),this._compressor.disconnect(),this._compressor=null,this.attack.dispose(),this.attack=null,this.release.dispose(),this.release=null,this.threshold.dispose(),this.threshold=null,this.ratio.dispose(),this.ratio=null,this.knee.dispose(),this.knee=null,this},t.Compressor}),n(function(t){return t.Add=function(e){t.Signal.call(this),this.createInsOuts(2,0),this._sum=this.input[0]=this.input[1]=this.output=new t.Gain,this._param=this.input[1]=new t.Signal(e),this._param.connect(this._sum)},t.extend(t.Add,t.Signal),t.Add.prototype.dispose=function(){return t.Signal.prototype.dispose.call(this),this._sum.dispose(),this._sum=null,this},t.Add}),n(function(t){return t.Multiply=function(e){t.Signal.call(this),this.createInsOuts(2,0),this._mult=this.input[0]=this.output=new t.Gain,this._param=this.input[1]=this.output.gain,this.value=t.defaultArg(e,0)},t.extend(t.Multiply,t.Signal),t.Multiply.prototype.dispose=function(){return t.Signal.prototype.dispose.call(this),this._mult.dispose(),this._mult=null,this._param=null,this},t.Multiply}),n(function(t){return t.Negate=function(){t.SignalBase.call(this),this._multiply=this.input=this.output=new t.Multiply(-1)},t.extend(t.Negate,t.SignalBase),t.Negate.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._multiply.dispose(),this._multiply=null,this},t.Negate}),n(function(t){return t.Subtract=function(e){t.Signal.call(this),this.createInsOuts(2,0),this._sum=this.input[0]=this.output=new t.Gain,this._neg=new t.Negate,this._param=this.input[1]=new t.Signal(e),this._param.chain(this._neg,this._sum)},t.extend(t.Subtract,t.Signal),t.Subtract.prototype.dispose=function(){return t.Signal.prototype.dispose.call(this),this._neg.dispose(),this._neg=null,this._sum.disconnect(),this._sum=null,this},t.Subtract}),n(function(t){return t.EqualPowerGain=function(){t.SignalBase.call(this),this._eqPower=this.input=this.output=new t.WaveShaper(function(e){return Math.abs(e)<.001?0:t.equalPowerScale(e)}.bind(this),4096)},t.extend(t.EqualPowerGain,t.SignalBase),t.EqualPowerGain.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._eqPower.dispose(),this._eqPower=null,this},t.EqualPowerGain}),n(function(t){return t.CrossFade=function(e){t.AudioNode.call(this),this.createInsOuts(2,1),this.a=this.input[0]=new t.Gain,this.b=this.input[1]=new t.Gain,this.fade=new t.Signal(t.defaultArg(e,.5),t.Type.NormalRange),this._equalPowerA=new t.EqualPowerGain,this._equalPowerB=new t.EqualPowerGain,this._one=this.context.getConstant(1),this._invert=new t.Subtract,this.a.connect(this.output),this.b.connect(this.output),this.fade.chain(this._equalPowerB,this.b.gain),this._one.connect(this._invert,0,0),this.fade.connect(this._invert,0,1),this._invert.chain(this._equalPowerA,this.a.gain),this._readOnly("fade")},t.extend(t.CrossFade,t.AudioNode),t.CrossFade.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable("fade"),this._equalPowerA.dispose(),this._equalPowerA=null,this._equalPowerB.dispose(),this._equalPowerB=null,this.fade.dispose(),this.fade=null,this._invert.dispose(),this._invert=null,this._one=null,this.a.dispose(),this.a=null,this.b.dispose(),this.b=null,this},t.CrossFade}),n(function(t){return t.Filter=function(){var e=t.defaults(arguments,["frequency","type","rolloff"],t.Filter);t.AudioNode.call(this),this.createInsOuts(1,1),this._filters=[],this.frequency=new t.Signal(e.frequency,t.Type.Frequency),this.detune=new t.Signal(0,t.Type.Cents),this.gain=new t.Signal({value:e.gain,convert:!1}),this.Q=new t.Signal(e.Q),this._type=e.type,this._rolloff=e.rolloff,this.rolloff=e.rolloff,this._readOnly(["detune","frequency","gain","Q"])},t.extend(t.Filter,t.AudioNode),t.Filter.defaults={type:"lowpass",frequency:350,rolloff:-12,Q:1,gain:0},Object.defineProperty(t.Filter.prototype,"type",{get:function(){return this._type},set:function(t){if(-1===["lowpass","highpass","bandpass","lowshelf","highshelf","notch","allpass","peaking"].indexOf(t))throw new TypeError("Tone.Filter: invalid type "+t);this._type=t;for(var e=0;e<this._filters.length;e++)this._filters[e].type=t}}),Object.defineProperty(t.Filter.prototype,"rolloff",{get:function(){return this._rolloff},set:function(e){e=parseInt(e,10);var n=[-12,-24,-48,-96].indexOf(e);if(-1===n)throw new RangeError("Tone.Filter: rolloff can only be -12, -24, -48 or -96");n+=1,this._rolloff=e,this.input.disconnect();for(var i=0;i<this._filters.length;i++)this._filters[i].disconnect(),this._filters[i]=null;this._filters=new Array(n);for(var r=0;r<n;r++){var o=this.context.createBiquadFilter();o.type=this._type,this.frequency.connect(o.frequency),this.detune.connect(o.detune),this.Q.connect(o.Q),this.gain.connect(o.gain),this._filters[r]=o}var s=[this.input].concat(this._filters).concat([this.output]);t.connectSeries.apply(t,s)}}),t.Filter.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this);for(var e=0;e<this._filters.length;e++)this._filters[e].disconnect(),this._filters[e]=null;return this._filters=null,this._writable(["detune","frequency","gain","Q"]),this.frequency.dispose(),this.Q.dispose(),this.frequency=null,this.Q=null,this.detune.dispose(),this.detune=null,this.gain.dispose(),this.gain=null,this},t.Filter}),n(function(t){return t.MultibandSplit=function(){var e=t.defaults(arguments,["lowFrequency","highFrequency"],t.MultibandSplit);t.AudioNode.call(this),this.input=new t.Gain,this.output=new Array(3),this.low=this.output[0]=new t.Filter(0,"lowpass"),this._lowMidFilter=new t.Filter(0,"highpass"),this.mid=this.output[1]=new t.Filter(0,"lowpass"),this.high=this.output[2]=new t.Filter(0,"highpass"),this.lowFrequency=new t.Signal(e.lowFrequency,t.Type.Frequency),this.highFrequency=new t.Signal(e.highFrequency,t.Type.Frequency),this.Q=new t.Signal(e.Q),this.input.fan(this.low,this.high),this.input.chain(this._lowMidFilter,this.mid),this.lowFrequency.connect(this.low.frequency),this.lowFrequency.connect(this._lowMidFilter.frequency),this.highFrequency.connect(this.mid.frequency),this.highFrequency.connect(this.high.frequency),this.Q.connect(this.low.Q),this.Q.connect(this._lowMidFilter.Q),this.Q.connect(this.mid.Q),this.Q.connect(this.high.Q),this._readOnly(["high","mid","low","highFrequency","lowFrequency"])},t.extend(t.MultibandSplit,t.AudioNode),t.MultibandSplit.defaults={lowFrequency:400,highFrequency:2500,Q:1},t.MultibandSplit.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable(["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this.low=null,this._lowMidFilter.dispose(),this._lowMidFilter=null,this.mid.dispose(),this.mid=null,this.high.dispose(),this.high=null,this.lowFrequency.dispose(),this.lowFrequency=null,this.highFrequency.dispose(),this.highFrequency=null,this.Q.dispose(),this.Q=null,this},t.MultibandSplit}),n(function(t){return t.EQ3=function(){var e=t.defaults(arguments,["low","mid","high"],t.EQ3);t.AudioNode.call(this),this.output=new t.Gain,this._multibandSplit=this.input=new t.MultibandSplit({lowFrequency:e.lowFrequency,highFrequency:e.highFrequency}),this._lowGain=new t.Gain(e.low,t.Type.Decibels),this._midGain=new t.Gain(e.mid,t.Type.Decibels),this._highGain=new t.Gain(e.high,t.Type.Decibels),this.low=this._lowGain.gain,this.mid=this._midGain.gain,this.high=this._highGain.gain,this.Q=this._multibandSplit.Q,this.lowFrequency=this._multibandSplit.lowFrequency,this.highFrequency=this._multibandSplit.highFrequency,this._multibandSplit.low.chain(this._lowGain,this.output),this._multibandSplit.mid.chain(this._midGain,this.output),this._multibandSplit.high.chain(this._highGain,this.output),this._readOnly(["low","mid","high","lowFrequency","highFrequency"])},t.extend(t.EQ3,t.AudioNode),t.EQ3.defaults={low:0,mid:0,high:0,lowFrequency:400,highFrequency:2500},t.EQ3.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable(["low","mid","high","lowFrequency","highFrequency"]),this._multibandSplit.dispose(),this._multibandSplit=null,this.lowFrequency=null,this.highFrequency=null,this._lowGain.dispose(),this._lowGain=null,this._midGain.dispose(),this._midGain=null,this._highGain.dispose(),this._highGain=null,this.low=null,this.mid=null,this.high=null,this.Q=null,this},t.EQ3}),n(function(t){return t.Scale=function(e,n){t.SignalBase.call(this),this._outputMin=t.defaultArg(e,0),this._outputMax=t.defaultArg(n,1),this._scale=this.input=new t.Multiply(1),this._add=this.output=new t.Add(0),this._scale.connect(this._add),this._setRange()},t.extend(t.Scale,t.SignalBase),Object.defineProperty(t.Scale.prototype,"min",{get:function(){return this._outputMin},set:function(t){this._outputMin=t,this._setRange()}}),Object.defineProperty(t.Scale.prototype,"max",{get:function(){return this._outputMax},set:function(t){this._outputMax=t,this._setRange()}}),t.Scale.prototype._setRange=function(){this._add.value=this._outputMin,this._scale.value=this._outputMax-this._outputMin},t.Scale.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},t.Scale}),n(function(t){return t.ScaleExp=function(e,n,i){t.SignalBase.call(this),this._scale=this.output=new t.Scale(e,n),this._exp=this.input=new t.Pow(t.defaultArg(i,2)),this._exp.connect(this._scale)},t.extend(t.ScaleExp,t.SignalBase),Object.defineProperty(t.ScaleExp.prototype,"exponent",{get:function(){return this._exp.value},set:function(t){this._exp.value=t}}),Object.defineProperty(t.ScaleExp.prototype,"min",{get:function(){return this._scale.min},set:function(t){this._scale.min=t}}),Object.defineProperty(t.ScaleExp.prototype,"max",{get:function(){return this._scale.max},set:function(t){this._scale.max=t}}),t.ScaleExp.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._exp.dispose(),this._exp=null,this},t.ScaleExp}),n(function(t){return t.Delay=function(){var e=t.defaults(arguments,["delayTime","maxDelay"],t.Delay);t.AudioNode.call(this),this._maxDelay=Math.max(this.toSeconds(e.maxDelay),this.toSeconds(e.delayTime)),this._delayNode=this.input=this.output=this.context.createDelay(this._maxDelay),this.delayTime=new t.Param({param:this._delayNode.delayTime,units:t.Type.Time,value:e.delayTime}),this._readOnly("delayTime")},t.extend(t.Delay,t.AudioNode),t.Delay.defaults={maxDelay:1,delayTime:0},Object.defineProperty(t.Delay.prototype,"maxDelay",{get:function(){return this._maxDelay}}),t.Delay.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._delayNode.disconnect(),this._delayNode=null,this._writable("delayTime"),this.delayTime=null,this},t.Delay}),n(function(t){return t.FeedbackCombFilter=function(){var e=t.defaults(arguments,["delayTime","resonance"],t.FeedbackCombFilter);t.AudioNode.call(this),this._delay=this.input=this.output=new t.Delay(e.delayTime),this.delayTime=this._delay.delayTime,this._feedback=new t.Gain(e.resonance,t.Type.NormalRange),this.resonance=this._feedback.gain,this._delay.chain(this._feedback,this._delay),this._readOnly(["resonance","delayTime"])},t.extend(t.FeedbackCombFilter,t.AudioNode),t.FeedbackCombFilter.defaults={delayTime:.1,resonance:.5},t.FeedbackCombFilter.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable(["resonance","delayTime"]),this._delay.dispose(),this._delay=null,this.delayTime=null,this._feedback.dispose(),this._feedback=null,this.resonance=null,this},t.FeedbackCombFilter}),n(function(t){return t.FFT=function(){var e=t.defaults(arguments,["size"],t.FFT);e.type=t.Analyser.Type.FFT,t.AudioNode.call(this),this._analyser=this.input=this.output=new t.Analyser(e)},t.extend(t.FFT,t.AudioNode),t.FFT.defaults={size:1024},t.FFT.prototype.getValue=function(){return this._analyser.getValue()},Object.defineProperty(t.FFT.prototype,"size",{get:function(){return this._analyser.size},set:function(t){this._analyser.size=t}}),t.FFT.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this),this._analyser.dispose(),this._analyser=null},t.FFT}),n(function(t){return t.Abs=function(){t.SignalBase.call(this),this._abs=this.input=this.output=new t.WaveShaper(function(t){return Math.abs(t)<.001?0:Math.abs(t)},1024)},t.extend(t.Abs,t.SignalBase),t.Abs.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._abs.dispose(),this._abs=null,this},t.Abs}),n(function(t){return t.Follower=function(){var e=t.defaults(arguments,["attack","release"],t.Follower);t.AudioNode.call(this),this.createInsOuts(1,1),this._abs=new t.Abs,this._filter=this.context.createBiquadFilter(),this._filter.type="lowpass",this._filter.frequency.value=0,this._filter.Q.value=-100,this._frequencyValues=new t.WaveShaper,this._sub=new t.Subtract,this._delay=new t.Delay(this.blockTime),this._mult=new t.Multiply(1e4),this._attack=e.attack,this._release=e.release,this.input.chain(this._abs,this._filter,this.output),this._abs.connect(this._sub,0,1),this._filter.chain(this._delay,this._sub),this._sub.chain(this._mult,this._frequencyValues,this._filter.frequency),this._setAttackRelease(this._attack,this._release)},t.extend(t.Follower,t.AudioNode),t.Follower.defaults={attack:.05,release:.5},t.Follower.prototype._setAttackRelease=function(e,n){var i=this.blockTime;e=t.Time(e).toFrequency(),n=t.Time(n).toFrequency(),e=Math.max(e,i),n=Math.max(n,i),this._frequencyValues.setMap(function(t){return t<=0?e:n})},Object.defineProperty(t.Follower.prototype,"attack",{get:function(){return this._attack},set:function(t){this._attack=t,this._setAttackRelease(this._attack,this._release)}}),Object.defineProperty(t.Follower.prototype,"release",{get:function(){return this._release},set:function(t){this._release=t,this._setAttackRelease(this._attack,this._release)}}),t.Follower.prototype.connect=t.SignalBase.prototype.connect,t.Follower.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._filter.disconnect(),this._filter=null,this._frequencyValues.disconnect(),this._frequencyValues=null,this._delay.dispose(),this._delay=null,this._sub.disconnect(),this._sub=null,this._abs.dispose(),this._abs=null,this._mult.dispose(),this._mult=null,this._curve=null,this},t.Follower}),n(function(t){return t.ScaledEnvelope=function(){var e=t.defaults(arguments,["attack","decay","sustain","release"],t.Envelope);t.Envelope.call(this,e),e=t.defaultArg(e,t.ScaledEnvelope.defaults),this._exp=this.output=new t.Pow(e.exponent),this._scale=this.output=new t.Scale(e.min,e.max),this._sig.chain(this._exp,this._scale)},t.extend(t.ScaledEnvelope,t.Envelope),t.ScaledEnvelope.defaults={min:0,max:1,exponent:1},Object.defineProperty(t.ScaledEnvelope.prototype,"min",{get:function(){return this._scale.min},set:function(t){this._scale.min=t}}),Object.defineProperty(t.ScaledEnvelope.prototype,"max",{get:function(){return this._scale.max},set:function(t){this._scale.max=t}}),Object.defineProperty(t.ScaledEnvelope.prototype,"exponent",{get:function(){return this._exp.value},set:function(t){this._exp.value=t}}),t.ScaledEnvelope.prototype.dispose=function(){return t.Envelope.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._exp.dispose(),this._exp=null,this},t.ScaledEnvelope}),n(function(t){return t.FrequencyEnvelope=function(){var e=t.defaults(arguments,["attack","decay","sustain","release"],t.Envelope);t.ScaledEnvelope.call(this,e),e=t.defaultArg(e,t.FrequencyEnvelope.defaults),this._octaves=e.octaves,this.baseFrequency=e.baseFrequency,this.octaves=e.octaves},t.extend(t.FrequencyEnvelope,t.Envelope),t.FrequencyEnvelope.defaults={baseFrequency:200,octaves:4,exponent:2},Object.defineProperty(t.FrequencyEnvelope.prototype,"baseFrequency",{get:function(){return this._scale.min},set:function(t){this._scale.min=this.toFrequency(t),this.octaves=this._octaves}}),Object.defineProperty(t.FrequencyEnvelope.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._scale.max=this.baseFrequency*Math.pow(2,t)}}),Object.defineProperty(t.FrequencyEnvelope.prototype,"exponent",{get:function(){return this._exp.value},set:function(t){this._exp.value=t}}),t.FrequencyEnvelope.prototype.dispose=function(){return t.ScaledEnvelope.prototype.dispose.call(this),this},t.FrequencyEnvelope}),n(function(t){return t.GreaterThanZero=function(){t.SignalBase.call(this),this._thresh=this.output=new t.WaveShaper(function(t){return t<=0?0:1},127),this._scale=this.input=new t.Multiply(1e4),this._scale.connect(this._thresh)},t.extend(t.GreaterThanZero,t.SignalBase),t.GreaterThanZero.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._thresh.dispose(),this._thresh=null,this},t.GreaterThanZero}),n(function(t){return t.GreaterThan=function(e){t.Signal.call(this),this.createInsOuts(2,0),this._param=this.input[0]=new t.Subtract(e),this.input[1]=this._param.input[1],this._gtz=this.output=new t.GreaterThanZero,this._param.connect(this._gtz)},t.extend(t.GreaterThan,t.Signal),t.GreaterThan.prototype.dispose=function(){return t.Signal.prototype.dispose.call(this),this._gtz.dispose(),this._gtz=null,this},t.GreaterThan}),n(function(t){return t.Gate=function(){var e=t.defaults(arguments,["threshold","attack","release"],t.Gate);t.AudioNode.call(this),this.createInsOuts(1,1),this._follower=new t.Follower(e.attack,e.release),this._gt=new t.GreaterThan(t.dbToGain(e.threshold)),this.input.connect(this.output),this.input.chain(this._gt,this._follower,this.output.gain)},t.extend(t.Gate,t.AudioNode),t.Gate.defaults={attack:.1,release:.1,threshold:-40},Object.defineProperty(t.Gate.prototype,"threshold",{get:function(){return t.gainToDb(this._gt.value)},set:function(e){this._gt.value=t.dbToGain(e)}}),Object.defineProperty(t.Gate.prototype,"attack",{get:function(){return this._follower.attack},set:function(t){this._follower.attack=t}}),Object.defineProperty(t.Gate.prototype,"release",{get:function(){return this._follower.release},set:function(t){this._follower.release=t}}),t.Gate.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._follower.dispose(),this._gt.dispose(),this._follower=null,this._gt=null,this},t.Gate}),n(function(t){function e(t){return function(e,n){n=this.toSeconds(n),t.apply(this,arguments);var i=this._events.get(n),r=this._events.previousEvent(i),o=this._getTicksUntilEvent(r,n);return i.ticks=Math.max(o,0),this}}return t.TickSignal=function(e){e=t.defaultArg(e,1),t.Signal.call(this,{units:t.Type.Ticks,value:e}),this._events.memory=1/0,this.cancelScheduledValues(0),this._events.add({type:t.Param.AutomationType.SetValue,time:0,value:e})},t.extend(t.TickSignal,t.Signal),t.TickSignal.prototype.setValueAtTime=e(t.Signal.prototype.setValueAtTime),t.TickSignal.prototype.linearRampToValueAtTime=e(t.Signal.prototype.linearRampToValueAtTime),t.TickSignal.prototype.setTargetAtTime=function(t,e,n){e=this.toSeconds(e),this.setRampPoint(e),t=this._fromUnits(t);for(var i=this._events.get(e),r=Math.round(Math.max(1/n,1)),o=0;o<=r;o++){var s=n*o+e,a=this._exponentialApproach(i.time,i.value,t,n,s);this.linearRampToValueAtTime(this._toUnits(a),s)}return this},t.TickSignal.prototype.exponentialRampToValueAtTime=function(t,e){e=this.toSeconds(e),t=this._fromUnits(t);var n=this._events.get(e);null===n&&(n={value:this._initialValue,time:0});for(var i=Math.round(Math.max(10*(e-n.time),1)),r=(e-n.time)/i,o=0;o<=i;o++){var s=r*o+n.time,a=this._exponentialInterpolate(n.time,n.value,e,t,s);this.linearRampToValueAtTime(this._toUnits(a),s)}return this},t.TickSignal.prototype._getTicksUntilEvent=function(e,n){if(null===e)e={ticks:0,time:0};else if(t.isUndef(e.ticks)){var i=this._events.previousEvent(e);e.ticks=this._getTicksUntilEvent(i,e.time)}var r=this.getValueAtTime(e.time),o=this.getValueAtTime(n);return this._events.get(n).time===n&&this._events.get(n).type===t.Param.AutomationType.SetValue&&(o=this.getValueAtTime(n-this.sampleTime)),.5*(n-e.time)*(r+o)+e.ticks},t.TickSignal.prototype.getTicksAtTime=function(t){t=this.toSeconds(t);var e=this._events.get(t);return Math.max(this._getTicksUntilEvent(e,t),0)},t.TickSignal.prototype.getDurationOfTicks=function(t,e){e=this.toSeconds(e);var n=this.getTicksAtTime(e);return this.getTimeOfTick(n+t)-e},t.TickSignal.prototype.getTimeOfTick=function(e){var n=this._events.get(e,"ticks"),i=this._events.getAfter(e,"ticks");if(n&&n.ticks===e)return n.time;if(n&&i&&i.type===t.Param.AutomationType.Linear&&n.value!==i.value){var r=this.getValueAtTime(n.time),o=(this.getValueAtTime(i.time)-r)/(i.time-n.time),s=Math.sqrt(Math.pow(r,2)-2*o*(n.ticks-e)),a=(-r+s)/o;return(a>0?a:(-r-s)/o)+n.time}return n?0===n.value?1/0:n.time+(e-n.ticks)/n.value:e/this._initialValue},t.TickSignal.prototype.ticksToTime=function(e,n){return n=this.toSeconds(n),new t.Time(this.getDurationOfTicks(e,n))},t.TickSignal.prototype.timeToTicks=function(e,n){n=this.toSeconds(n),e=this.toSeconds(e);var i=this.getTicksAtTime(n),r=this.getTicksAtTime(n+e);return new t.Ticks(r-i)},t.TickSignal}),n(function(t){return t.TimelineState=function(e){t.Timeline.call(this),this._initial=e},t.extend(t.TimelineState,t.Timeline),t.TimelineState.prototype.getValueAtTime=function(t){var e=this.get(t);return null!==e?e.state:this._initial},t.TimelineState.prototype.setStateAtTime=function(t,e){return this.add({state:t,time:e}),this},t.TimelineState.prototype.getLastState=function(t,e){e=this.toSeconds(e);for(var n=this._search(e);n>=0;n--){var i=this._timeline[n];if(i.state===t)return i}},t.TimelineState.prototype.getNextState=function(t,e){e=this.toSeconds(e);var n=this._search(e);if(-1!==n)for(var i=n;i<this._timeline.length;i++){var r=this._timeline[i];if(r.state===t)return r}},t.TimelineState}),n(function(t){return t.TickSource=function(){var e=t.defaults(arguments,["frequency"],t.TickSource);this.frequency=new t.TickSignal(e.frequency,t.Type.Frequency),this._readOnly("frequency"),this._state=new t.TimelineState(t.State.Stopped),this._state.setStateAtTime(t.State.Stopped,0),this._tickOffset=new t.Timeline,this.setTicksAtTime(0,0)},t.extend(t.TickSource),t.TickSource.defaults={frequency:1},Object.defineProperty(t.TickSource.prototype,"state",{get:function(){return this._state.getValueAtTime(this.now())}}),t.TickSource.prototype.start=function(e,n){return e=this.toSeconds(e),this._state.getValueAtTime(e)!==t.State.Started&&(this._state.setStateAtTime(t.State.Started,e),t.isDefined(n)&&this.setTicksAtTime(n,e)),this},t.TickSource.prototype.stop=function(e){if(e=this.toSeconds(e),this._state.getValueAtTime(e)===t.State.Stopped){var n=this._state.get(e);n.time>0&&(this._tickOffset.cancel(n.time),this._state.cancel(n.time))}return this._state.cancel(e),this._state.setStateAtTime(t.State.Stopped,e),this.setTicksAtTime(0,e),this},t.TickSource.prototype.pause=function(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)===t.State.Started&&this._state.setStateAtTime(t.State.Paused,e),this},t.TickSource.prototype.cancel=function(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this},t.TickSource.prototype.getTicksAtTime=function(e){e=this.toSeconds(e);var n=this._state.getLastState(t.State.Stopped,e),i={state:t.State.Paused,time:e};this._state.add(i);var r=n,o=0;return this._state.forEachBetween(n.time,e+this.sampleTime,function(e){var n=r.time,i=this._tickOffset.get(e.time);i.time>=r.time&&(o=i.ticks,n=i.time),r.state===t.State.Started&&e.state!==t.State.Started&&(o+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(n)),r=e}.bind(this)),this._state.remove(i),o},Object.defineProperty(t.TickSource.prototype,"ticks",{get:function(){return this.getTicksAtTime(this.now())},set:function(t){this.setTicksAtTime(t,this.now())}}),Object.defineProperty(t.TickSource.prototype,"seconds",{get:function(){return this.getSecondsAtTime(this.now())},set:function(t){var e=this.now(),n=this.frequency.timeToTicks(t,e);this.setTicksAtTime(n,e)}}),t.TickSource.prototype.getSecondsAtTime=function(e){e=this.toSeconds(e);var n=this._state.getLastState(t.State.Stopped,e),i={state:t.State.Paused,time:e};this._state.add(i);var r=n,o=0;return this._state.forEachBetween(n.time,e+this.sampleTime,function(e){var n=r.time,i=this._tickOffset.get(e.time);i.time>=r.time&&(o=i.seconds,n=i.time),r.state===t.State.Started&&e.state!==t.State.Started&&(o+=e.time-n),r=e}.bind(this)),this._state.remove(i),o},t.TickSource.prototype.setTicksAtTime=function(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({time:e,ticks:t,seconds:this.frequency.getDurationOfTicks(t,e)}),this},t.TickSource.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},t.TickSource.prototype.getTimeOfTick=function(e,n){n=t.defaultArg(n,this.now());var i=this._tickOffset.get(n),r=this._state.get(n),o=Math.max(i.time,r.time),s=this.frequency.getTicksAtTime(o)+e-i.ticks;return this.frequency.getTimeOfTick(s)},t.TickSource.prototype.forEachTickBetween=function(e,n,i){var r=this._state.get(e);if(this._state.forEachBetween(e,n,function(n){r.state===t.State.Started&&n.state!==t.State.Started&&this.forEachTickBetween(Math.max(r.time,e),n.time-this.sampleTime,i),r=n}.bind(this)),e=Math.max(r.time,e),r.state===t.State.Started&&this._state){var o=this.frequency.getTicksAtTime(e),s=(o-this.frequency.getTicksAtTime(r.time))%1;0!==s&&(s=1-s);for(var a=this.frequency.getTimeOfTick(o+s),u=null;a<n&&this._state;){try{i(a,Math.round(this.getTicksAtTime(a)))}catch(t){u=t;break}this._state&&(a+=this.frequency.getDurationOfTicks(1,a))}}if(u)throw u;return this},t.TickSource.prototype.dispose=function(){return t.Param.prototype.dispose.call(this),this._state.dispose(),this._state=null,this._tickOffset.dispose(),this._tickOffset=null,this._writable("frequency"),this.frequency.dispose(),this.frequency=null,this},t.TickSource}),n(function(t){return t.Clock=function(){var e=t.defaults(arguments,["callback","frequency"],t.Clock);t.Emitter.call(this),this.callback=e.callback,this._nextTick=0,this._tickSource=new t.TickSource(e.frequency),this._lastUpdate=0,this.frequency=this._tickSource.frequency,this._readOnly("frequency"),this._state=new t.TimelineState(t.State.Stopped),this._state.setStateAtTime(t.State.Stopped,0),this._boundLoop=this._loop.bind(this),this.context.on("tick",this._boundLoop)},t.extend(t.Clock,t.Emitter),t.Clock.defaults={callback:t.noOp,frequency:1},Object.defineProperty(t.Clock.prototype,"state",{get:function(){return this._state.getValueAtTime(this.now())}}),t.Clock.prototype.start=function(e,n){return e=this.toSeconds(e),this._state.getValueAtTime(e)!==t.State.Started&&(this._state.setStateAtTime(t.State.Started,e),this._tickSource.start(e,n),e<this._lastUpdate&&this.emit("start",e,n)),this},t.Clock.prototype.stop=function(e){return e=this.toSeconds(e),this._state.cancel(e),this._state.setStateAtTime(t.State.Stopped,e),this._tickSource.stop(e),e<this._lastUpdate&&this.emit("stop",e),this},t.Clock.prototype.pause=function(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)===t.State.Started&&(this._state.setStateAtTime(t.State.Paused,e),this._tickSource.pause(e),e<this._lastUpdate&&this.emit("pause",e)),this},Object.defineProperty(t.Clock.prototype,"ticks",{get:function(){return Math.ceil(this.getTicksAtTime(this.now()))},set:function(t){this._tickSource.ticks=t}}),Object.defineProperty(t.Clock.prototype,"seconds",{get:function(){return this._tickSource.seconds},set:function(t){this._tickSource.seconds=t}}),t.Clock.prototype.getSecondsAtTime=function(t){return this._tickSource.getSecondsAtTime(t)},t.Clock.prototype.setTicksAtTime=function(t,e){return this._tickSource.setTicksAtTime(t,e),this},t.Clock.prototype.getTicksAtTime=function(t){return this._tickSource.getTicksAtTime(t)},t.Clock.prototype.nextTickTime=function(t,e){e=this.toSeconds(e);var n=this.getTicksAtTime(e);return this._tickSource.getTimeOfTick(n+t,e)},t.Clock.prototype._loop=function(){var e=this._lastUpdate,n=this.now();this._lastUpdate=n,e!==n&&(this._state.forEachBetween(e,n,function(e){switch(e.state){case t.State.Started:var n=this._tickSource.getTicksAtTime(e.time);this.emit("start",e.time,n);break;case t.State.Stopped:0!==e.time&&this.emit("stop",e.time);break;case t.State.Paused:this.emit("pause",e.time)}}.bind(this)),this._tickSource.forEachTickBetween(e,n,function(t,e){this.callback(t,e)}.bind(this)))},t.Clock.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},t.Clock.prototype.dispose=function(){t.Emitter.prototype.dispose.call(this),this.context.off("tick",this._boundLoop),this._writable("frequency"),this._tickSource.dispose(),this._tickSource=null,this.frequency=null,this._boundLoop=null,this._nextTick=1/0,this.callback=null,this._state.dispose(),this._state=null},t.Clock}),n(function(t){t.IntervalTimeline=function(){t.call(this),this._root=null,this._length=0},t.extend(t.IntervalTimeline),t.IntervalTimeline.prototype.add=function(n){if(t.isUndef(n.time)||t.isUndef(n.duration))throw new Error("Tone.IntervalTimeline: events must have time and duration parameters");n.time=n.time.valueOf();var i=new e(n.time,n.time+n.duration,n);for(null===this._root?this._root=i:this._root.insert(i),this._length++;null!==i;)i.updateHeight(),i.updateMax(),this._rebalance(i),i=i.parent;return this},t.IntervalTimeline.prototype.remove=function(t){if(null!==this._root){var e=[];this._root.search(t.time,e);for(var n=0;n<e.length;n++){var i=e[n];if(i.event===t){this._removeNode(i),this._length--;break}}}return this},Object.defineProperty(t.IntervalTimeline.prototype,"length",{get:function(){return this._length}}),t.IntervalTimeline.prototype.cancel=function(t){return this.forEachFrom(t,function(t){this.remove(t)}.bind(this)),this},t.IntervalTimeline.prototype._setRoot=function(t){this._root=t,null!==this._root&&(this._root.parent=null)},t.IntervalTimeline.prototype._replaceNodeInParent=function(t,e){null!==t.parent?(t.isLeftChild()?t.parent.left=e:t.parent.right=e,this._rebalance(t.parent)):this._setRoot(e)},t.IntervalTimeline.prototype._removeNode=function(t){if(null===t.left&&null===t.right)this._replaceNodeInParent(t,null);else if(null===t.right)this._replaceNodeInParent(t,t.left);else if(null===t.left)this._replaceNodeInParent(t,t.right);else{var e,n;if(t.getBalance()>0)if(null===t.left.right)(e=t.left).right=t.right,n=e;else{for(e=t.left.right;null!==e.right;)e=e.right;e.parent.right=e.left,n=e.parent,e.left=t.left,e.right=t.right}else if(null===t.right.left)(e=t.right).left=t.left,n=e;else{for(e=t.right.left;null!==e.left;)e=e.left;e.parent=e.parent,e.parent.left=e.right,n=e.parent,e.left=t.left,e.right=t.right}null!==t.parent?t.isLeftChild()?t.parent.left=e:t.parent.right=e:this._setRoot(e),this._rebalance(n)}t.dispose()},t.IntervalTimeline.prototype._rotateLeft=function(t){var e=t.parent,n=t.isLeftChild(),i=t.right;t.right=i.left,i.left=t,null!==e?n?e.left=i:e.right=i:this._setRoot(i)},t.IntervalTimeline.prototype._rotateRight=function(t){var e=t.parent,n=t.isLeftChild(),i=t.left;t.left=i.right,i.right=t,null!==e?n?e.left=i:e.right=i:this._setRoot(i)},t.IntervalTimeline.prototype._rebalance=function(t){var e=t.getBalance();e>1?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))},t.IntervalTimeline.prototype.get=function(t){if(null!==this._root){var e=[];if(this._root.search(t,e),e.length>0){for(var n=e[0],i=1;i<e.length;i++)e[i].low>n.low&&(n=e[i]);return n.event}}return null},t.IntervalTimeline.prototype.forEach=function(t){if(null!==this._root){var e=[];this._root.traverse(function(t){e.push(t)});for(var n=0;n<e.length;n++){var i=e[n].event;i&&t(i)}}return this},t.IntervalTimeline.prototype.forEachAtTime=function(t,e){if(null!==this._root){var n=[];this._root.search(t,n);for(var i=n.length-1;i>=0;i--){var r=n[i].event;r&&e(r)}}return this},t.IntervalTimeline.prototype.forEachFrom=function(t,e){if(null!==this._root){var n=[];this._root.searchAfter(t,n);for(var i=n.length-1;i>=0;i--)e(n[i].event)}return this},t.IntervalTimeline.prototype.dispose=function(){var t=[];null!==this._root&&this._root.traverse(function(e){t.push(e)});for(var e=0;e<t.length;e++)t[e].dispose();return t=null,this._root=null,this};var e=function(t,e,n){this.event=n,this.low=t,this.high=e,this.max=this.high,this._left=null,this._right=null,this.parent=null,this.height=0};return e.prototype.insert=function(t){t.low<=this.low?null===this.left?this.left=t:this.left.insert(t):null===this.right?this.right=t:this.right.insert(t)},e.prototype.search=function(t,e){t>this.max||(null!==this.left&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),this.low>t||null!==this.right&&this.right.search(t,e))},e.prototype.searchAfter=function(t,e){this.low>=t&&(e.push(this),null!==this.left&&this.left.searchAfter(t,e)),null!==this.right&&this.right.searchAfter(t,e)},e.prototype.traverse=function(t){t(this),null!==this.left&&this.left.traverse(t),null!==this.right&&this.right.traverse(t)},e.prototype.updateHeight=function(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0},e.prototype.updateMax=function(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))},e.prototype.getBalance=function(){var t=0;return null!==this.left&&null!==this.right?t=this.left.height-this.right.height:null!==this.left?t=this.left.height+1:null!==this.right&&(t=-(this.right.height+1)),t},e.prototype.isLeftChild=function(){return null!==this.parent&&this.parent.left===this},Object.defineProperty(e.prototype,"left",{get:function(){return this._left},set:function(t){this._left=t,null!==t&&(t.parent=this),this.updateHeight(),this.updateMax()}}),Object.defineProperty(e.prototype,"right",{get:function(){return this._right},set:function(t){this._right=t,null!==t&&(t.parent=this),this.updateHeight(),this.updateMax()}}),e.prototype.dispose=function(){this.parent=null,this._left=null,this._right=null,this.event=null},t.IntervalTimeline}),n(function(t){return t.Ticks=function(e,n){if(!(this instanceof t.Ticks))return new t.Ticks(e,n);t.TransportTime.call(this,e,n)},t.extend(t.Ticks,t.TransportTime),t.Ticks.prototype._defaultUnits="i",t.Ticks.prototype._now=function(){return t.Transport.ticks},t.Ticks.prototype._beatsToUnits=function(t){return this._getPPQ()*t},t.Ticks.prototype._secondsToUnits=function(t){return t/(60/this._getBpm())*this._getPPQ()},t.Ticks.prototype._ticksToUnits=function(t){return t},t.Ticks.prototype.toTicks=function(){return this.valueOf()},t.Ticks.prototype.toSeconds=function(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())},t.Ticks}),n(function(t){return t.TransportEvent=function(e,n){n=t.defaultArg(n,t.TransportEvent.defaults),t.call(this),this.Transport=e,this.id=t.TransportEvent._eventId++,this.time=t.Ticks(n.time),this.callback=n.callback,this._once=n.once},t.extend(t.TransportEvent),t.TransportEvent.defaults={once:!1,callback:t.noOp},t.TransportEvent._eventId=0,t.TransportEvent.prototype.invoke=function(t){this.callback&&(this.callback(t),this._once&&this.Transport&&this.Transport.clear(this.id))},t.TransportEvent.prototype.dispose=function(){return t.prototype.dispose.call(this),this.Transport=null,this.callback=null,this.time=null,this},t.TransportEvent}),n(function(t){return t.TransportRepeatEvent=function(e,n){t.TransportEvent.call(this,e,n),n=t.defaultArg(n,t.TransportRepeatEvent.defaults),this.duration=t.Ticks(n.duration),this._interval=t.Ticks(n.interval),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this),this.Transport.on("start loopStart",this._boundRestart),this._restart()},t.extend(t.TransportRepeatEvent,t.TransportEvent),t.TransportRepeatEvent.defaults={duration:1/0,interval:1},t.TransportRepeatEvent.prototype.invoke=function(e){this._createEvents(e),t.TransportEvent.prototype.invoke.call(this,e)},t.TransportRepeatEvent.prototype._createEvents=function(e){var n=this.Transport.getTicksAtTime(e);n>=this.time&&n>=this._nextTick&&this._nextTick+this._interval<this.time+this.duration&&(this._nextTick+=this._interval,this._currentId=this._nextId,this._nextId=this.Transport.scheduleOnce(this.invoke.bind(this),t.Ticks(this._nextTick)))},t.TransportRepeatEvent.prototype._restart=function(e){this.Transport.clear(this._currentId),this.Transport.clear(this._nextId),this._nextTick=this.time;var n=this.Transport.getTicksAtTime(e);n>this.time&&(this._nextTick=this.time+Math.ceil((n-this.time)/this._interval)*this._interval),this._currentId=this.Transport.scheduleOnce(this.invoke.bind(this),t.Ticks(this._nextTick)),this._nextTick+=this._interval,this._nextId=this.Transport.scheduleOnce(this.invoke.bind(this),t.Ticks(this._nextTick))},t.TransportRepeatEvent.prototype.dispose=function(){return this.Transport.clear(this._currentId),this.Transport.clear(this._nextId),this.Transport.off("start loopStart",this._boundRestart),this._boundCreateEvents=null,t.TransportEvent.prototype.dispose.call(this),this.duration=null,this._interval=null,this},t.TransportRepeatEvent}),n(function(t){t.Transport=function(){t.Emitter.call(this),t.getContext(function(){this.loop=!1,this._loopStart=0,this._loopEnd=0,this._ppq=e.defaults.PPQ,this._clock=new t.Clock({callback:this._processTick.bind(this),frequency:0}),this._bindClockEvents(),this.bpm=this._clock.frequency,this.bpm._toUnits=this._toUnits.bind(this),this.bpm._fromUnits=this._fromUnits.bind(this),this.bpm.units=t.Type.BPM,this.bpm.value=e.defaults.bpm,this._readOnly("bpm"),this._timeSignature=e.defaults.timeSignature,this._scheduledEvents={},this._timeline=new t.Timeline,this._repeatedEvents=new t.IntervalTimeline,this._syncedSignals=[],this._swingTicks=e.defaults.PPQ/2,this._swingAmount=0}.bind(this))},t.extend(t.Transport,t.Emitter),t.Transport.defaults={bpm:120,swing:0,swingSubdivision:"8n",timeSignature:4,loopStart:0,loopEnd:"4m",PPQ:192},t.Transport.prototype._processTick=function(e,n){if(this._swingAmount>0&&n%this._ppq!=0&&n%(2*this._swingTicks)!=0){var i=n%(2*this._swingTicks)/(2*this._swingTicks),r=Math.sin(i*Math.PI)*this._swingAmount;e+=t.Ticks(2*this._swingTicks/3).toSeconds()*r}this.loop&&n>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),n=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._timeline.forEachAtTime(n,function(t){t.invoke(e)})},t.Transport.prototype.schedule=function(e,n){var i=new t.TransportEvent(this,{time:t.TransportTime(n),callback:e});return this._addEvent(i,this._timeline)},t.Transport.prototype.scheduleRepeat=function(e,n,i,r){var o=new t.TransportRepeatEvent(this,{callback:e,interval:t.Time(n),time:t.TransportTime(i),duration:t.Time(t.defaultArg(r,1/0))});return this._addEvent(o,this._repeatedEvents)},t.Transport.prototype.scheduleOnce=function(e,n){var i=new t.TransportEvent(this,{time:t.TransportTime(n),callback:e,once:!0});return this._addEvent(i,this._timeline)},t.Transport.prototype.clear=function(t){if(this._scheduledEvents.hasOwnProperty(t)){var e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this},t.Transport.prototype._addEvent=function(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id},t.Transport.prototype.cancel=function(e){return e=t.defaultArg(e,0),e=this.toTicks(e),this._timeline.forEachFrom(e,function(t){this.clear(t.id)}.bind(this)),this._repeatedEvents.forEachFrom(e,function(t){this.clear(t.id)}.bind(this)),this},t.Transport.prototype._bindClockEvents=function(){this._clock.on("start",function(e,n){n=t.Ticks(n).toSeconds(),this.emit("start",e,n)}.bind(this)),this._clock.on("stop",function(t){this.emit("stop",t)}.bind(this)),this._clock.on("pause",function(t){this.emit("pause",t)}.bind(this))},Object.defineProperty(t.Transport.prototype,"state",{get:function(){return this._clock.getStateAtTime(this.now())}}),t.Transport.prototype.start=function(e,n){return t.isDefined(n)&&(n=this.toTicks(n)),this._clock.start(e,n),this},t.Transport.prototype.stop=function(t){return this._clock.stop(t),this},t.Transport.prototype.pause=function(t){return this._clock.pause(t),this},t.Transport.prototype.toggle=function(e){return e=this.toSeconds(e),this._clock.getStateAtTime(e)!==t.State.Started?this.start(e):this.stop(e),this},Object.defineProperty(t.Transport.prototype,"timeSignature",{get:function(){return this._timeSignature},set:function(e){t.isArray(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}}),Object.defineProperty(t.Transport.prototype,"loopStart",{get:function(){return t.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t)}}),Object.defineProperty(t.Transport.prototype,"loopEnd",{get:function(){return t.Ticks(this._loopEnd).toSeconds()},set:function(t){this._loopEnd=this.toTicks(t)}}),t.Transport.prototype.setLoopPoints=function(t,e){return this.loopStart=t,this.loopEnd=e,this},Object.defineProperty(t.Transport.prototype,"swing",{get:function(){return this._swingAmount},set:function(t){this._swingAmount=t}}),Object.defineProperty(t.Transport.prototype,"swingSubdivision",{get:function(){return t.Ticks(this._swingTicks).toNotation()},set:function(t){this._swingTicks=this.toTicks(t)}}),Object.defineProperty(t.Transport.prototype,"position",{get:function(){var e=this.now(),n=this._clock.getTicksAtTime(e);return t.Ticks(n).toBarsBeatsSixteenths()},set:function(t){var e=this.toTicks(t);this.ticks=e}}),Object.defineProperty(t.Transport.prototype,"seconds",{get:function(){return this._clock.seconds},set:function(t){var e=this.now(),n=this.bpm.timeToTicks(t,e);this.ticks=n}}),Object.defineProperty(t.Transport.prototype,"progress",{get:function(){if(this.loop){var t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}}),Object.defineProperty(t.Transport.prototype,"ticks",{get:function(){return this._clock.ticks},set:function(e){if(this._clock.ticks!==e){var n=this.now();this.state===t.State.Started?(this.emit("stop",n),this._clock.setTicksAtTime(e,n),this.emit("start",n,this.seconds)):this._clock.setTicksAtTime(e,n)}}}),t.Transport.prototype.getTicksAtTime=function(t){return Math.round(this._clock.getTicksAtTime(t))},t.Transport.prototype.getSecondsAtTime=function(t){return this._clock.getSecondsAtTime(t)},Object.defineProperty(t.Transport.prototype,"PPQ",{get:function(){return this._ppq},set:function(t){var e=this.bpm.value;this._ppq=t,this.bpm.value=e}}),t.Transport.prototype._fromUnits=function(t){return 1/(60/t/this.PPQ)},t.Transport.prototype._toUnits=function(t){return t/this.PPQ*60},t.Transport.prototype.nextSubdivision=function(e){if(e=this.toTicks(e),this.state!==t.State.Started)return 0;var n=this.now(),i=e-this.getTicksAtTime(n)%e;return this._clock.nextTickTime(i,n)},t.Transport.prototype.syncSignal=function(e,n){if(!n){var i=this.now();n=0!==e.getValueAtTime(i)?e.getValueAtTime(i)/this.bpm.getValueAtTime(i):0}var r=new t.Gain(n);return this.bpm.chain(r,e._param),this._syncedSignals.push({ratio:r,signal:e,initial:e.value}),e.value=0,this},t.Transport.prototype.unsyncSignal=function(t){for(var e=this._syncedSignals.length-1;e>=0;e--){var n=this._syncedSignals[e];n.signal===t&&(n.ratio.dispose(),n.signal.value=n.initial,this._syncedSignals.splice(e,1))}return this},t.Transport.prototype.dispose=function(){return t.Emitter.prototype.dispose.call(this),this._clock.dispose(),this._clock=null,this._writable("bpm"),this.bpm=null,this._timeline.dispose(),this._timeline=null,this._repeatedEvents.dispose(),this._repeatedEvents=null,this};var e=t.Transport;return t.Transport=new e,t.Context.on("init",function(n){n.Transport instanceof e?t.Transport=n.Transport:t.Transport=new e,n.Transport=t.Transport}),t.Context.on("close",function(t){t.Transport instanceof e&&t.Transport.dispose()}),t.Transport}),n(function(t){return t.Volume=function(){var e=t.defaults(arguments,["volume"],t.Volume);t.AudioNode.call(this),this.output=this.input=new t.Gain(e.volume,t.Type.Decibels),this._unmutedVolume=e.volume,this.volume=this.output.gain,this._readOnly("volume"),this.mute=e.mute},t.extend(t.Volume,t.AudioNode),t.Volume.defaults={volume:0,mute:!1},Object.defineProperty(t.Volume.prototype,"mute",{get:function(){return this.volume.value===-1/0},set:function(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}}),t.Volume.prototype.dispose=function(){return this.input.dispose(),t.AudioNode.prototype.dispose.call(this),this._writable("volume"),this.volume.dispose(),this.volume=null,this},t.Volume}),n(function(t){t.Master=function(){t.AudioNode.call(this),t.getContext(function(){this.createInsOuts(1,0),this._volume=this.output=new t.Volume,this.volume=this._volume.volume,this._readOnly("volume"),this.input.chain(this.output,this.context.destination)}.bind(this))},t.extend(t.Master,t.AudioNode),t.Master.defaults={volume:0,mute:!1},Object.defineProperty(t.Master.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),t.Master.prototype.chain=function(){this.input.disconnect(),this.input.chain.apply(this.input,arguments),arguments[arguments.length-1].connect(this.output)},t.Master.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this),this._writable("volume"),this._volume.dispose(),this._volume=null,this.volume=null},t.AudioNode.prototype.toMaster=function(){return this.connect(t.Master),this},window.AudioNode&&(AudioNode.prototype.toMaster=function(){return this.connect(t.Master),this});var e=t.Master;return t.Master=new e,t.Context.on("init",function(n){n.Master instanceof e?t.Master=n.Master:t.Master=new e,n.Master=t.Master}),t.Context.on("close",function(t){t.Master instanceof e&&t.Master.dispose()}),t.Master}),n(function(t){return t.Source=function(e){e=t.defaultArg(e,t.Source.defaults),t.AudioNode.call(this),this._volume=this.output=new t.Volume(e.volume),this.volume=this._volume.volume,this._readOnly("volume"),this._state=new t.TimelineState(t.State.Stopped),this._state.memory=100,this._synced=!1,this._scheduled=[],this._volume.output.output.channelCount=2,this._volume.output.output.channelCountMode="explicit",this.mute=e.mute},t.extend(t.Source,t.AudioNode),t.Source.defaults={volume:0,mute:!1},Object.defineProperty(t.Source.prototype,"state",{get:function(){return this._synced?t.Transport.state===t.State.Started?this._state.getValueAtTime(t.Transport.seconds):t.State.Stopped:this._state.getValueAtTime(this.now())}}),Object.defineProperty(t.Source.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),t.Source.prototype._start=t.noOp,t.Source.prototype.restart=t.noOp,t.Source.prototype._stop=t.noOp,t.Source.prototype.start=function(e,n,i){if(e=t.isUndef(e)&&this._synced?t.Transport.seconds:this.toSeconds(e),this._state.getValueAtTime(e)===t.State.Started)this._state.cancel(e),this._state.setStateAtTime(t.State.Started,e),this.restart(e,n,i);else if(this._state.setStateAtTime(t.State.Started,e),this._synced){var r=this._state.get(e);r.offset=t.defaultArg(n,0),r.duration=i;var o=t.Transport.schedule(function(t){this._start(t,n,i)}.bind(this),e);this._scheduled.push(o),t.Transport.state===t.State.Started&&this._syncedStart(this.now(),t.Transport.seconds)}else this._start.apply(this,arguments);return this},t.Source.prototype.stop=function(e){if(e=t.isUndef(e)&&this._synced?t.Transport.seconds:this.toSeconds(e),this._synced){var n=t.Transport.schedule(this._stop.bind(this),e);this._scheduled.push(n)}else this._stop.apply(this,arguments);return this._state.cancel(e),this._state.setStateAtTime(t.State.Stopped,e),this},t.Source.prototype.sync=function(){return this._synced=!0,this._syncedStart=function(e,n){if(n>0){var i=this._state.get(n);if(i&&i.state===t.State.Started&&i.time!==n){var r,o=n-this.toSeconds(i.time);i.duration&&(r=this.toSeconds(i.duration)-o),this._start(e,this.toSeconds(i.offset)+o,r)}}}.bind(this),this._syncedStop=function(e){var n=t.Transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));this._state.getValueAtTime(n)===t.State.Started&&this._stop(e)}.bind(this),t.Transport.on("start loopStart",this._syncedStart),t.Transport.on("stop pause loopEnd",this._syncedStop),this},t.Source.prototype.unsync=function(){this._synced&&(t.Transport.off("stop pause loopEnd",this._syncedStop),t.Transport.off("start loopStart",this._syncedStart)),this._synced=!1;for(var e=0;e<this._scheduled.length;e++){var n=this._scheduled[e];t.Transport.clear(n)}return this._scheduled=[],this._state.cancel(0),this},t.Source.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this),this.unsync(),this._scheduled=null,this._writable("volume"),this._volume.dispose(),this._volume=null,this.volume=null,this._state.dispose(),this._state=null},t.Source}),n(function(t){t.supported&&(AudioBuffer.prototype.copyToChannel||(AudioBuffer.prototype.copyToChannel=function(t,e,n){var i=this.getChannelData(e);n=n||0;for(var r=0;r<i.length;r++)i[r+n]=t[r]},AudioBuffer.prototype.copyFromChannel=function(t,e,n){var i=this.getChannelData(e);n=n||0;for(var r=0;r<t.length;r++)t[r]=i[r+n]}))}),n(function(t){return t.Buffer=function(){var e=t.defaults(arguments,["url","onload","onerror"],t.Buffer);t.call(this),this._buffer=null,this._reversed=e.reverse,this._xhr=null,this._onload=t.noOp,e.url instanceof AudioBuffer||e.url instanceof t.Buffer?(this.set(e.url),e.onload&&(this.loaded?e.onload(this):this._onload=e.onload)):t.isString(e.url)&&this.load(e.url).then(e.onload).catch(e.onerror)},t.extend(t.Buffer),t.Buffer.defaults={url:void 0,reverse:!1,onload:t.noOp,onerror:t.noOp},t.Buffer.prototype.set=function(e){return e instanceof t.Buffer?e.loaded?this._buffer=e.get():e._onload=function(){this.set(e),this._onload(this)}.bind(this):this._buffer=e,this},t.Buffer.prototype.get=function(){return this._buffer},t.Buffer.prototype.load=function(e,n,i){return new Promise(function(r,o){this._xhr=t.Buffer.load(e,function(t){this._xhr=null,this.set(t),r(this),this._onload(this),n&&n(this)}.bind(this),function(t){this._xhr=null,o(t),i&&i(t)}.bind(this))}.bind(this))},t.Buffer.prototype.dispose=function(){return t.prototype.dispose.call(this),this._buffer=null,this._xhr&&(t.Buffer._removeFromDownloadQueue(this._xhr),this._xhr.abort(),this._xhr=null),this},Object.defineProperty(t.Buffer.prototype,"loaded",{get:function(){return this.length>0}}),Object.defineProperty(t.Buffer.prototype,"duration",{get:function(){return this._buffer?this._buffer.duration:0}}),Object.defineProperty(t.Buffer.prototype,"length",{get:function(){return this._buffer?this._buffer.length:0}}),Object.defineProperty(t.Buffer.prototype,"numberOfChannels",{get:function(){return this._buffer?this._buffer.numberOfChannels:0}}),t.Buffer.prototype.fromArray=function(t){var e=t[0].length>0,n=e?t.length:1,i=e?t[0].length:t.length,r=this.context.createBuffer(n,i,this.context.sampleRate);e||1!==n||(t=[t]);for(var o=0;o<n;o++)r.copyToChannel(t[o],o);return this._buffer=r,this},t.Buffer.prototype.toMono=function(e){if(t.isNumber(e))this.fromArray(this.toArray(e));else{for(var n=new Float32Array(this.length),i=this.numberOfChannels,r=0;r<i;r++)for(var o=this.toArray(r),s=0;s<o.length;s++)n[s]+=o[s];n=n.map(function(t){return t/i}),this.fromArray(n)}return this},t.Buffer.prototype.toArray=function(e){if(t.isNumber(e))return this.getChannelData(e);if(1===this.numberOfChannels)return this.toArray(0);for(var n=[],i=0;i<this.numberOfChannels;i++)n[i]=this.getChannelData(i);return n},t.Buffer.prototype.getChannelData=function(t){return this._buffer.getChannelData(t)},t.Buffer.prototype.slice=function(e,n){n=t.defaultArg(n,this.duration);for(var i=Math.floor(this.context.sampleRate*this.toSeconds(e)),r=Math.floor(this.context.sampleRate*this.toSeconds(n)),o=[],s=0;s<this.numberOfChannels;s++)o[s]=this.toArray(s).slice(i,r);return(new t.Buffer).fromArray(o)},t.Buffer.prototype._reverse=function(){if(this.loaded)for(var t=0;t<this.numberOfChannels;t++)Array.prototype.reverse.call(this.getChannelData(t));return this},Object.defineProperty(t.Buffer.prototype,"reverse",{get:function(){return this._reversed},set:function(t){this._reversed!==t&&(this._reversed=t,this._reverse())}}),t.Emitter.mixin(t.Buffer),t.Buffer._downloadQueue=[],t.Buffer.baseUrl="",t.Buffer.fromArray=function(e){return(new t.Buffer).fromArray(e)},t.Buffer.fromUrl=function(e){var n=new t.Buffer;return n.load(e).then(function(){return n})},t.Buffer._removeFromDownloadQueue=function(e){var n=t.Buffer._downloadQueue.indexOf(e);-1!==n&&t.Buffer._downloadQueue.splice(n,1)},t.Buffer.load=function(e,n,i){n=t.defaultArg(n,t.noOp);var r=e.match(/\[(.+\|?)+\]$/);if(r){for(var o=r[1].split("|"),s=o[0],a=0;a<o.length;a++)if(t.Buffer.supportsType(o[a])){s=o[a];break}e=e.replace(r[0],s)}function u(e){if(t.Buffer._removeFromDownloadQueue(c),t.Buffer.emit("error",e),!i)throw e;i(e)}function l(){for(var e=0,n=0;n<t.Buffer._downloadQueue.length;n++)e+=t.Buffer._downloadQueue[n].progress;t.Buffer.emit("progress",e/t.Buffer._downloadQueue.length)}var c=new XMLHttpRequest;return c.open("GET",t.Buffer.baseUrl+e,!0),c.responseType="arraybuffer",c.progress=0,t.Buffer._downloadQueue.push(c),c.addEventListener("load",function(){200===c.status?t.context.decodeAudioData(c.response).then(function(e){c.progress=1,l(),n(e),t.Buffer._removeFromDownloadQueue(c),0===t.Buffer._downloadQueue.length&&t.Buffer.emit("load")}).catch(function(){t.Buffer._removeFromDownloadQueue(c),u("Tone.Buffer: could not decode audio data: "+e)}):u("Tone.Buffer: could not locate file: "+e)}),c.addEventListener("error",u),c.addEventListener("progress",function(t){t.lengthComputable&&(c.progress=t.loaded/t.total*.95,l())}),c.send(),c},t.Buffer.cancelDownloads=function(){return t.Buffer._downloadQueue.slice().forEach(function(e){t.Buffer._removeFromDownloadQueue(e),e.abort()}),t.Buffer},t.Buffer.supportsType=function(t){var e=t.split(".");return e=e[e.length-1],""!==document.createElement("audio").canPlayType("audio/"+e)},t.loaded=function(){var e,n;function i(){t.Buffer.off("load",e),t.Buffer.off("error",n)}return new Promise(function(i,r){e=function(){i()},n=function(){r()},t.Buffer.on("load",e),t.Buffer.on("error",n)}).then(i).catch(function(t){throw i(),new Error(t)})},t.Buffer}),n(function(t){return t.OscillatorNode=function(){var e=t.defaults(arguments,["frequency","type"],t.OscillatorNode);t.AudioNode.call(this,e),this.onended=e.onended,this._startTime=-1,this._stopTime=-1,this._gainNode=this.output=new t.Gain,this._gainNode.gain.setValueAtTime(0,this.context.currentTime),this._oscillator=this.context.createOscillator(),this._oscillator.connect(this._gainNode),this.type=e.type,this.frequency=new t.Param(this._oscillator.frequency,t.Type.Frequency),this.frequency.value=e.frequency,this.detune=new t.Param(this._oscillator.detune,t.Type.Cents),this.detune.value=e.detune,this._gain=1},t.extend(t.OscillatorNode,t.AudioNode),t.OscillatorNode.defaults={frequency:440,detune:0,type:"sine",onended:t.noOp},Object.defineProperty(t.OscillatorNode.prototype,"state",{get:function(){return this.getStateAtTime(this.now())}}),t.OscillatorNode.prototype.getStateAtTime=function(e){return e=this.toSeconds(e),-1!==this._startTime&&e>=this._startTime&&(-1===this._stopTime||e<=this._stopTime)?t.State.Started:t.State.Stopped},t.OscillatorNode.prototype.start=function(t){if(-1!==this._startTime)throw new Error("cannot call OscillatorNode.start more than once");this._startTime=this.toSeconds(t),this._oscillator.start(this._startTime);var e=this.context.currentTime;return this._gainNode.gain.cancelScheduledValues(e),this._gainNode.gain.setValueAtTime(0,e),this._gainNode.gain.setValueAtTime(1,this._startTime),this},t.OscillatorNode.prototype.setPeriodicWave=function(t){return this._oscillator.setPeriodicWave(t),this},t.OscillatorNode.prototype.stop=function(t){return this.cancelStop(),this._stopTime=this.toSeconds(t),this._gainNode.gain.setValueAtTime(0,this._stopTime),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(function(){this._oscillator.stop(this.now()),this.onended()}.bind(this),this._stopTime-this.now()),this},t.OscillatorNode.prototype.cancelStop=function(){return-1!==this._startTime&&(this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this._gainNode.gain.setValueAtTime(1,Math.max(this.now(),this._startTime)),this.context.clearTimeout(this._timeout),this._stopTime=-1),this},Object.defineProperty(t.OscillatorNode.prototype,"type",{get:function(){return this._oscillator.type},set:function(t){this._oscillator.type=t}}),t.OscillatorNode.prototype.dispose=function(){return this.context.clearTimeout(this._timeout),t.AudioNode.prototype.dispose.call(this),this.onended=null,this._oscillator.disconnect(),this._oscillator=null,this._gainNode.dispose(),this._gainNode=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this},t.OscillatorNode}),n(function(t){return t.Oscillator=function(){var e=t.defaults(arguments,["frequency","type"],t.Oscillator);t.Source.call(this,e),this._oscillator=null,this.frequency=new t.Signal(e.frequency,t.Type.Frequency),this.detune=new t.Signal(e.detune,t.Type.Cents),this._wave=null,this._partials=t.defaultArg(e.partials,[1]),this._phase=e.phase,this._type=null,this.type=e.type,this.phase=this._phase,this._readOnly(["frequency","detune"])},t.extend(t.Oscillator,t.Source),t.Oscillator.defaults={type:"sine",frequency:440,detune:0,phase:0,partials:[]},t.Oscillator.Type={Sine:"sine",Triangle:"triangle",Sawtooth:"sawtooth",Square:"square",Custom:"custom"},t.Oscillator.prototype._start=function(e){this._oscillator=new t.OscillatorNode,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),e=this.toSeconds(e),this._oscillator.start(e)},t.Oscillator.prototype._stop=function(t){return this._oscillator&&(t=this.toSeconds(t),this._oscillator.stop(t)),this},t.Oscillator.prototype.restart=function(t){return this._oscillator.cancelStop(),this._state.cancel(this.toSeconds(t)),this},t.Oscillator.prototype.syncFrequency=function(){return t.Transport.syncSignal(this.frequency),this},t.Oscillator.prototype.unsyncFrequency=function(){return t.Transport.unsyncSignal(this.frequency),this},Object.defineProperty(t.Oscillator.prototype,"type",{get:function(){return this._type},set:function(e){var n=[t.Oscillator.Type.Sine,t.Oscillator.Type.Square,t.Oscillator.Type.Triangle,t.Oscillator.Type.Sawtooth].includes(e);if(0===this._phase&&n)this._wave=null,null!==this._oscillator&&this._oscillator.type;else{var i=this._getRealImaginary(e,this._phase),r=this.context.createPeriodicWave(i[0],i[1]);this._wave=r,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}this._type=e}}),t.Oscillator.prototype._getRealImaginary=function(e,n){var i=2048,r=new Float32Array(i),o=new Float32Array(i),s=1;if(e===t.Oscillator.Type.Custom)i=s=this._partials.length+1;else{var a=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);a&&(s=parseInt(a[2])+1,e=a[1],i=s=Math.max(s,2))}for(var u=1;u<i;++u){var l,c=2/(u*Math.PI);switch(e){case t.Oscillator.Type.Sine:l=u<=s?1:0;break;case t.Oscillator.Type.Square:l=1&u?2*c:0;break;case t.Oscillator.Type.Sawtooth:l=c*(1&u?1:-1);break;case t.Oscillator.Type.Triangle:l=1&u?c*c*2*(u-1>>1&1?-1:1):0;break;case t.Oscillator.Type.Custom:l=this._partials[u-1];break;default:throw new TypeError("Tone.Oscillator: invalid type: "+e)}0!==l?(r[u]=-l*Math.sin(n*u),o[u]=l*Math.cos(n*u)):(r[u]=0,o[u]=0)}return[r,o]},t.Oscillator.prototype._inverseFFT=function(t,e,n){for(var i=0,r=t.length,o=0;o<r;o++)i+=t[o]*Math.cos(o*n)+e[o]*Math.sin(o*n);return i},t.Oscillator.prototype._getInitialValue=function(){for(var t=this._getRealImaginary(this._type,0),e=t[0],n=t[1],i=0,r=2*Math.PI,o=0;o<8;o++)i=Math.max(this._inverseFFT(e,n,o/8*r),i);return-this._inverseFFT(e,n,this._phase)/i},Object.defineProperty(t.Oscillator.prototype,"partials",{get:function(){return this._type!==t.Oscillator.Type.Custom?[]:this._partials},set:function(e){this._partials=e,this.type=t.Oscillator.Type.Custom}}),Object.defineProperty(t.Oscillator.prototype,"phase",{get:function(){return this._phase*(180/Math.PI)},set:function(t){this._phase=t*Math.PI/180,this.type=this._type}}),t.Oscillator.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),null!==this._oscillator&&(this._oscillator.dispose(),this._oscillator=null),this._wave=null,this._writable(["frequency","detune"]),this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this._partials=null,this},t.Oscillator}),n(function(t){return t.AudioToGain=function(){t.SignalBase.call(this),this._norm=this.input=this.output=new t.WaveShaper(function(t){return(t+1)/2})},t.extend(t.AudioToGain,t.SignalBase),t.AudioToGain.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._norm.dispose(),this._norm=null,this},t.AudioToGain}),n(function(t){return t.Zero=function(){t.SignalBase.call(this),this._gain=this.input=this.output=new t.Gain,this.context.getConstant(0).connect(this._gain)},t.extend(t.Zero,t.SignalBase),t.Zero.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._gain.dispose(),this._gain=null,this},t.Zero}),n(function(t){return t.LFO=function(){var e=t.defaults(arguments,["frequency","min","max"],t.LFO);t.AudioNode.call(this),this._oscillator=new t.Oscillator({frequency:e.frequency,type:e.type}),this.frequency=this._oscillator.frequency,this.amplitude=this._oscillator.volume,this.amplitude.units=t.Type.NormalRange,this.amplitude.value=e.amplitude,this._stoppedSignal=new t.Signal(0,t.Type.AudioRange),this._zeros=new t.Zero,this._stoppedValue=0,this._a2g=new t.AudioToGain,this._scaler=this.output=new t.Scale(e.min,e.max),this._units=t.Type.Default,this.units=e.units,this._oscillator.chain(this._a2g,this._scaler),this._zeros.connect(this._a2g),this._stoppedSignal.connect(this._a2g),this._readOnly(["amplitude","frequency"]),this.phase=e.phase},t.extend(t.LFO,t.AudioNode),t.LFO.defaults={type:"sine",min:0,max:1,phase:0,frequency:"4n",amplitude:1,units:t.Type.Default},t.LFO.prototype.start=function(t){return t=this.toSeconds(t),this._stoppedSignal.setValueAtTime(0,t),this._oscillator.start(t),this},t.LFO.prototype.stop=function(t){return t=this.toSeconds(t),this._stoppedSignal.setValueAtTime(this._stoppedValue,t),this._oscillator.stop(t),this},t.LFO.prototype.sync=function(){return this._oscillator.sync(),this._oscillator.syncFrequency(),this},t.LFO.prototype.unsync=function(){return this._oscillator.unsync(),this._oscillator.unsyncFrequency(),this},Object.defineProperty(t.LFO.prototype,"min",{get:function(){return this._toUnits(this._scaler.min)},set:function(t){t=this._fromUnits(t),this._scaler.min=t}}),Object.defineProperty(t.LFO.prototype,"max",{get:function(){return this._toUnits(this._scaler.max)},set:function(t){t=this._fromUnits(t),this._scaler.max=t}}),Object.defineProperty(t.LFO.prototype,"type",{get:function(){return this._oscillator.type},set:function(t){this._oscillator.type=t,this._stoppedValue=this._oscillator._getInitialValue(),this._stoppedSignal.value=this._stoppedValue}}),Object.defineProperty(t.LFO.prototype,"phase",{get:function(){return this._oscillator.phase},set:function(t){this._oscillator.phase=t,this._stoppedValue=this._oscillator._getInitialValue(),this._stoppedSignal.value=this._stoppedValue}}),Object.defineProperty(t.LFO.prototype,"units",{get:function(){return this._units},set:function(t){var e=this.min,n=this.max;this._units=t,this.min=e,this.max=n}}),Object.defineProperty(t.LFO.prototype,"mute",{get:function(){return this._oscillator.mute},set:function(t){this._oscillator.mute=t}}),Object.defineProperty(t.LFO.prototype,"state",{get:function(){return this._oscillator.state}}),t.LFO.prototype.connect=function(e){return e.constructor!==t.Signal&&e.constructor!==t.Param||(this.convert=e.convert,this.units=e.units),t.SignalBase.prototype.connect.apply(this,arguments),this},t.LFO.prototype._fromUnits=t.Param.prototype._fromUnits,t.LFO.prototype._toUnits=t.Param.prototype._toUnits,t.LFO.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable(["amplitude","frequency"]),this._oscillator.dispose(),this._oscillator=null,this._stoppedSignal.dispose(),this._stoppedSignal=null,this._zeros.dispose(),this._zeros=null,this._scaler.dispose(),this._scaler=null,this._a2g.dispose(),this._a2g=null,this.frequency=null,this.amplitude=null,this},t.LFO}),n(function(t){return t.Limiter=function(){var e=t.defaults(arguments,["threshold"],t.Limiter);t.AudioNode.call(this),this._compressor=this.input=this.output=new t.Compressor({attack:.001,decay:.001,threshold:e.threshold}),this.threshold=this._compressor.threshold,this._readOnly("threshold")},t.extend(t.Limiter,t.AudioNode),t.Limiter.defaults={threshold:-12},t.Limiter.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._compressor.dispose(),this._compressor=null,this._writable("threshold"),this.threshold=null,this},t.Limiter}),n(function(t){return t.LowpassCombFilter=function(){var e=t.defaults(arguments,["delayTime","resonance","dampening"],t.LowpassCombFilter);t.AudioNode.call(this),this.createInsOuts(1,1),this._delay=this.input=new t.Delay(e.delayTime),this.delayTime=this._delay.delayTime,this._lowpass=this.output=this.context.createBiquadFilter(),this._lowpass.Q.value=-3.0102999566398125,this._lowpass.type="lowpass",this.dampening=new t.Param({param:this._lowpass.frequency,units:t.Type.Frequency,value:e.dampening}),this._feedback=new t.Gain(e.resonance,t.Type.NormalRange),this.resonance=this._feedback.gain,this._delay.chain(this._lowpass,this._feedback,this._delay),this._readOnly(["dampening","resonance","delayTime"])},t.extend(t.LowpassCombFilter,t.AudioNode),t.LowpassCombFilter.defaults={delayTime:.1,resonance:.5,dampening:3e3},t.LowpassCombFilter.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable(["dampening","resonance","delayTime"]),this.dampening.dispose(),this.dampening=null,this.resonance.dispose(),this.resonance=null,this._delay.dispose(),this._delay=null,this.delayTime=null,this._lowpass.disconnect(),this._lowpass=null,this._feedback.disconnect(),this._feedback=null,this},t.LowpassCombFilter}),n(function(t){return t.Merge=function(){t.AudioNode.call(this),this.createInsOuts(2,0),this.left=this.input[0]=new t.Gain,this.right=this.input[1]=new t.Gain,this._merger=this.output=this.context.createChannelMerger(2),this.left.connect(this._merger,0,0),this.right.connect(this._merger,0,1),this.left.channelCount=1,this.right.channelCount=1,this.left.channelCountMode="explicit",this.right.channelCountMode="explicit"},t.extend(t.Merge,t.AudioNode),t.Merge.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.left.dispose(),this.left=null,this.right.dispose(),this.right=null,this._merger.disconnect(),this._merger=null,this},t.Merge}),n(function(t){return t.Meter=function(){var e=t.defaults(arguments,["smoothing"],t.Meter);t.AudioNode.call(this),this.input=this.output=this._analyser=new t.Analyser("waveform",1024),this.smoothing=e.smoothing},t.extend(t.Meter,t.AudioNode),t.Meter.defaults={smoothing:.8},t.Meter.prototype.getLevel=function(){this._analyser.type="fft";var t=this._analyser.getValue();return Math.max.apply(this,t)+28},t.Meter.prototype.getValue=function(){return this._analyser.type="waveform",this._analyser.getValue()[0]},Object.defineProperty(t.Meter.prototype,"smoothing",{get:function(){return this._analyser.smoothing},set:function(t){this._analyser.smoothing=t}}),t.Meter.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._analyser.dispose(),this._analyser=null,this},t.Meter}),n(function(t){return t.Split=function(){t.AudioNode.call(this),this.createInsOuts(0,2),this._splitter=this.input=this.context.createChannelSplitter(2),this._splitter.channelCount=2,this._splitter.channelCountMode="explicit",this.left=this.output[0]=new t.Gain,this.right=this.output[1]=new t.Gain,this._splitter.connect(this.left,0,0),this._splitter.connect(this.right,1,0)},t.extend(t.Split,t.AudioNode),t.Split.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._splitter.disconnect(),this.left.dispose(),this.left=null,this.right.dispose(),this.right=null,this._splitter=null,this},t.Split}),n(function(t){return t.MidSideSplit=function(){t.AudioNode.call(this),this.createInsOuts(0,2),this._split=this.input=new t.Split,this._midAdd=new t.Add,this.mid=this.output[0]=new t.Multiply(Math.SQRT1_2),this._sideSubtract=new t.Subtract,this.side=this.output[1]=new t.Multiply(Math.SQRT1_2),this._split.connect(this._midAdd,0,0),this._split.connect(this._midAdd,1,1),this._split.connect(this._sideSubtract,0,0),this._split.connect(this._sideSubtract,1,1),this._midAdd.connect(this.mid),this._sideSubtract.connect(this.side)},t.extend(t.MidSideSplit,t.AudioNode),t.MidSideSplit.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.mid.dispose(),this.mid=null,this.side.dispose(),this.side=null,this._midAdd.dispose(),this._midAdd=null,this._sideSubtract.dispose(),this._sideSubtract=null,this._split.dispose(),this._split=null,this},t.MidSideSplit}),n(function(t){return t.MidSideMerge=function(){t.AudioNode.call(this),this.createInsOuts(2,0),this.mid=this.input[0]=new t.Gain,this._left=new t.Add,this._timesTwoLeft=new t.Multiply(Math.SQRT1_2),this.side=this.input[1]=new t.Gain,this._right=new t.Subtract,this._timesTwoRight=new t.Multiply(Math.SQRT1_2),this._merge=this.output=new t.Merge,this.mid.connect(this._left,0,0),this.side.connect(this._left,0,1),this.mid.connect(this._right,0,0),this.side.connect(this._right,0,1),this._left.connect(this._timesTwoLeft),this._right.connect(this._timesTwoRight),this._timesTwoLeft.connect(this._merge,0,0),this._timesTwoRight.connect(this._merge,0,1)},t.extend(t.MidSideMerge,t.AudioNode),t.MidSideMerge.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.mid.dispose(),this.mid=null,this.side.dispose(),this.side=null,this._left.dispose(),this._left=null,this._timesTwoLeft.dispose(),this._timesTwoLeft=null,this._right.dispose(),this._right=null,this._timesTwoRight.dispose(),this._timesTwoRight=null,this._merge.dispose(),this._merge=null,this},t.MidSideMerge}),n(function(t){return t.MidSideCompressor=function(e){t.AudioNode.call(this),e=t.defaultArg(e,t.MidSideCompressor.defaults),this._midSideSplit=this.input=new t.MidSideSplit,this._midSideMerge=this.output=new t.MidSideMerge,this.mid=new t.Compressor(e.mid),this.side=new t.Compressor(e.side),this._midSideSplit.mid.chain(this.mid,this._midSideMerge.mid),this._midSideSplit.side.chain(this.side,this._midSideMerge.side),this._readOnly(["mid","side"])},t.extend(t.MidSideCompressor,t.AudioNode),t.MidSideCompressor.defaults={mid:{ratio:3,threshold:-24,release:.03,attack:.02,knee:16},side:{ratio:6,threshold:-30,release:.25,attack:.03,knee:10}},t.MidSideCompressor.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable(["mid","side"]),this.mid.dispose(),this.mid=null,this.side.dispose(),this.side=null,this._midSideSplit.dispose(),this._midSideSplit=null,this._midSideMerge.dispose(),this._midSideMerge=null,this},t.MidSideCompressor}),n(function(t){return t.Mono=function(){t.AudioNode.call(this),this.createInsOuts(1,0),this._merge=this.output=new t.Merge,this.input.connect(this._merge,0,0),this.input.connect(this._merge,0,1)},t.extend(t.Mono,t.AudioNode),t.Mono.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._merge.dispose(),this._merge=null,this},t.Mono}),n(function(t){return t.MultibandCompressor=function(e){t.AudioNode.call(this),e=t.defaultArg(arguments,t.MultibandCompressor.defaults),this._splitter=this.input=new t.MultibandSplit({lowFrequency:e.lowFrequency,highFrequency:e.highFrequency}),this.lowFrequency=this._splitter.lowFrequency,this.highFrequency=this._splitter.highFrequency,this.output=new t.Gain,this.low=new t.Compressor(e.low),this.mid=new t.Compressor(e.mid),this.high=new t.Compressor(e.high),this._splitter.low.chain(this.low,this.output),this._splitter.mid.chain(this.mid,this.output),this._splitter.high.chain(this.high,this.output),this._readOnly(["high","mid","low","highFrequency","lowFrequency"])},t.extend(t.MultibandCompressor,t.AudioNode),t.MultibandCompressor.defaults={low:t.Compressor.defaults,mid:t.Compressor.defaults,high:t.Compressor.defaults,lowFrequency:250,highFrequency:2e3},t.MultibandCompressor.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._splitter.dispose(),this._writable(["high","mid","low","highFrequency","lowFrequency"]),this.low.dispose(),this.mid.dispose(),this.high.dispose(),this._splitter=null,this.low=null,this.mid=null,this.high=null,this.lowFrequency=null,this.highFrequency=null,this},t.MultibandCompressor}),n(function(t){if(t.supported&&!window.StereoPannerNode){var e=function(e){this.context=e,this.pan=new t.Signal(0,t.Type.AudioRange);var n=new t.WaveShaper(function(e){return t.equalPowerScale((e+1)/2)},4096),i=new t.WaveShaper(function(e){return t.equalPowerScale(1-(e+1)/2)},4096),r=new t.Gain,o=new t.Gain,s=this.input=new t.Split;(new t.Zero).fan(n,i);var a=this.output=new t.Merge;s.left.chain(r,a.left),s.right.chain(o,a.right),this.pan.chain(i,r.gain),this.pan.chain(n,o.gain)};e.prototype.disconnect=function(){this.output.disconnect.apply(this.output,arguments)},e.prototype.connect=function(){this.output.connect.apply(this.output,arguments)},AudioContext.prototype.createStereoPanner=function(){return new e(this)},t.Context.prototype.createStereoPanner=function(){return new e(this)}}}),n(function(t){return t.Panner=function(e){t.AudioNode.call(this),this._panner=this.input=this.output=this.context.createStereoPanner(),this.pan=this._panner.pan,this.pan.value=t.defaultArg(e,0),this._readOnly("pan")},t.extend(t.Panner,t.AudioNode),t.Panner.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable("pan"),this._panner.disconnect(),this._panner=null,this.pan=null,this},t.Panner}),n(function(t){return t.Panner3D=function(){var e=t.defaults(arguments,["positionX","positionY","positionZ"],t.Panner3D);t.AudioNode.call(this),this._panner=this.input=this.output=this.context.createPanner(),this._panner.panningModel=e.panningModel,this._panner.maxDistance=e.maxDistance,this._panner.distanceModel=e.distanceModel,this._panner.coneOuterGain=e.coneOuterGain,this._panner.coneOuterAngle=e.coneOuterAngle,this._panner.coneInnerAngle=e.coneInnerAngle,this._panner.refDistance=e.refDistance,this._panner.rolloffFactor=e.rolloffFactor,this._orientation=[e.orientationX,e.orientationY,e.orientationZ],this._position=[e.positionX,e.positionY,e.positionZ],this.orientationX=e.orientationX,this.orientationY=e.orientationY,this.orientationZ=e.orientationZ,this.positionX=e.positionX,this.positionY=e.positionY,this.positionZ=e.positionZ},t.extend(t.Panner3D,t.AudioNode),t.Panner3D.defaults={positionX:0,positionY:0,positionZ:0,orientationX:0,orientationY:0,orientationZ:0,panningModel:"equalpower",maxDistance:1e4,distanceModel:"inverse",coneOuterGain:0,coneOuterAngle:360,coneInnerAngle:360,refDistance:1,rolloffFactor:1},t.Panner3D.prototype._rampTimeConstant=.01,t.Panner3D.prototype.setPosition=function(t,e,n){if(this._panner.positionX){var i=this.now();this._panner.positionX.setTargetAtTime(t,i,this._rampTimeConstant),this._panner.positionY.setTargetAtTime(e,i,this._rampTimeConstant),this._panner.positionZ.setTargetAtTime(n,i,this._rampTimeConstant)}else this._panner.setPosition(t,e,n);return this._position=Array.prototype.slice.call(arguments),this},t.Panner3D.prototype.setOrientation=function(t,e,n){if(this._panner.orientationX){var i=this.now();this._panner.orientationX.setTargetAtTime(t,i,this._rampTimeConstant),this._panner.orientationY.setTargetAtTime(e,i,this._rampTimeConstant),this._panner.orientationZ.setTargetAtTime(n,i,this._rampTimeConstant)}else this._panner.setOrientation(t,e,n);return this._orientation=Array.prototype.slice.call(arguments),this},Object.defineProperty(t.Panner3D.prototype,"positionX",{set:function(t){this._position[0]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[0]}}),Object.defineProperty(t.Panner3D.prototype,"positionY",{set:function(t){this._position[1]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[1]}}),Object.defineProperty(t.Panner3D.prototype,"positionZ",{set:function(t){this._position[2]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[2]}}),Object.defineProperty(t.Panner3D.prototype,"orientationX",{set:function(t){this._orientation[0]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[0]}}),Object.defineProperty(t.Panner3D.prototype,"orientationY",{set:function(t){this._orientation[1]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[1]}}),Object.defineProperty(t.Panner3D.prototype,"orientationZ",{set:function(t){this._orientation[2]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[2]}}),t.Panner3D._aliasProperty=function(e){Object.defineProperty(t.Panner3D.prototype,e,{set:function(t){this._panner[e]=t},get:function(){return this._panner[e]}})},t.Panner3D._aliasProperty("panningModel"),t.Panner3D._aliasProperty("refDistance"),t.Panner3D._aliasProperty("rolloffFactor"),t.Panner3D._aliasProperty("distanceModel"),t.Panner3D._aliasProperty("coneInnerAngle"),t.Panner3D._aliasProperty("coneOuterAngle"),t.Panner3D._aliasProperty("coneOuterGain"),t.Panner3D._aliasProperty("maxDistance"),t.Panner3D.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._panner.disconnect(),this._panner=null,this._orientation=null,this._position=null,this},t.Panner3D}),n(function(t){return t.PanVol=function(){var e=t.defaults(arguments,["pan","volume"],t.PanVol);t.AudioNode.call(this),this._panner=this.input=new t.Panner(e.pan),this.pan=this._panner.pan,this._volume=this.output=new t.Volume(e.volume),this.volume=this._volume.volume,this._panner.connect(this._volume),this.mute=e.mute,this._readOnly(["pan","volume"])},t.extend(t.PanVol,t.AudioNode),t.PanVol.defaults={pan:0,volume:0,mute:!1},Object.defineProperty(t.PanVol.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),t.PanVol.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._writable(["pan","volume"]),this._panner.dispose(),this._panner=null,this.pan=null,this._volume.dispose(),this._volume=null,this.volume=null,this},t.PanVol}),n(function(t){return t.Solo=function(){var e=t.defaults(arguments,["solo"],t.Solo);t.AudioNode.call(this),this.input=this.output=new t.Gain,this._soloBind=this._soloed.bind(this),this.context.on("solo",this._soloBind),this.solo=e.solo},t.extend(t.Solo,t.AudioNode),t.Solo.defaults={solo:!1},Object.defineProperty(t.Solo.prototype,"solo",{get:function(){return this._isSoloed()},set:function(t){t?this._addSolo():this._removeSolo(),this.context.emit("solo",this)}}),Object.defineProperty(t.Solo.prototype,"muted",{get:function(){return 0===this.input.gain.value}}),t.Solo.prototype._addSolo=function(){t.isArray(this.context._currentSolo)||(this.context._currentSolo=[]),this._isSoloed()||this.context._currentSolo.push(this)},t.Solo.prototype._removeSolo=function(){if(this._isSoloed()){var t=this.context._currentSolo.indexOf(this);this.context._currentSolo.splice(t,1)}},t.Solo.prototype._isSoloed=function(){return!!t.isArray(this.context._currentSolo)&&0!==this.context._currentSolo.length&&-1!==this.context._currentSolo.indexOf(this)},t.Solo.prototype._noSolos=function(){return!t.isArray(this.context._currentSolo)||0===this.context._currentSolo.length},t.Solo.prototype._soloed=function(){this._isSoloed()?this.input.gain.value=1:this._noSolos()?this.input.gain.value=1:this.input.gain.value=0},t.Solo.prototype.dispose=function(){return this.context.off("solo",this._soloBind),this._removeSolo(),this._soloBind=null,t.AudioNode.prototype.dispose.call(this),this},t.Solo}),n(function(t){return t.Waveform=function(){var e=t.defaults(arguments,["size"],t.Waveform);e.type=t.Analyser.Type.Waveform,t.AudioNode.call(this),this._analyser=this.input=this.output=new t.Analyser(e)},t.extend(t.Waveform,t.AudioNode),t.Waveform.defaults={size:1024},t.Waveform.prototype.getValue=function(){return this._analyser.getValue()},Object.defineProperty(t.Waveform.prototype,"size",{get:function(){return this._analyser.size},set:function(t){this._analyser.size=t}}),t.Waveform.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this),this._analyser.dispose(),this._analyser=null},t.Waveform}),n(function(t){return t.CtrlInterpolate=function(){var e=t.defaults(arguments,["values","index"],t.CtrlInterpolate);t.call(this),this.values=e.values,this.index=e.index},t.extend(t.CtrlInterpolate),t.CtrlInterpolate.defaults={index:0,values:[]},Object.defineProperty(t.CtrlInterpolate.prototype,"value",{get:function(){var t=this.index;t=Math.min(t,this.values.length-1);var e=Math.floor(t),n=this.values[e],i=this.values[Math.ceil(t)];return this._interpolate(t-e,n,i)}}),t.CtrlInterpolate.prototype._interpolate=function(e,n,i){if(t.isArray(n)){for(var r=[],o=0;o<n.length;o++)r[o]=this._interpolate(e,n[o],i[o]);return r}if(t.isObject(n)){var s={};for(var a in n)s[a]=this._interpolate(e,n[a],i[a]);return s}return(1-e)*(n=this._toNumber(n))+e*(i=this._toNumber(i))},t.CtrlInterpolate.prototype._toNumber=function(e){return t.isNumber(e)?e:this.toSeconds(e)},t.CtrlInterpolate.prototype.dispose=function(){this.values=null},t.CtrlInterpolate}),n(function(t){return t.CtrlMarkov=function(e,n){t.call(this),this.values=t.defaultArg(e,{}),this.value=t.defaultArg(n,Object.keys(this.values)[0])},t.extend(t.CtrlMarkov),t.CtrlMarkov.prototype.next=function(){if(this.values.hasOwnProperty(this.value)){var e=this.values[this.value];if(t.isArray(e))for(var n=this._getProbDistribution(e),i=Math.random(),r=0,o=0;o<n.length;o++){var s=n[o];if(i>r&&i<r+s){var a=e[o];t.isObject(a)?this.value=a.value:this.value=a}r+=s}else this.value=e}return this.value},t.CtrlMarkov.prototype._getProbDistribution=function(e){for(var n=[],i=0,r=!1,o=0;o<e.length;o++){var s=e[o];t.isObject(s)?(r=!0,n[o]=s.probability):n[o]=1/e.length,i+=n[o]}if(r)for(var a=0;a<n.length;a++)n[a]=n[a]/i;return n},t.CtrlMarkov.prototype.dispose=function(){this.values=null},t.CtrlMarkov}),n(function(t){return t.CtrlPattern=function(){var e=t.defaults(arguments,["values","type"],t.CtrlPattern);t.call(this),this.values=e.values,this.index=0,this._type=null,this._shuffled=null,this._direction=null,this.type=e.type},t.extend(t.CtrlPattern),t.CtrlPattern.Type={Up:"up",Down:"down",UpDown:"upDown",DownUp:"downUp",AlternateUp:"alternateUp",AlternateDown:"alternateDown",Random:"random",RandomWalk:"randomWalk",RandomOnce:"randomOnce"},t.CtrlPattern.defaults={type:t.CtrlPattern.Type.Up,values:[]},Object.defineProperty(t.CtrlPattern.prototype,"value",{get:function(){if(0!==this.values.length){if(1===this.values.length)return this.values[0];this.index=Math.min(this.index,this.values.length-1);var e=this.values[this.index];return this.type===t.CtrlPattern.Type.RandomOnce&&(this.values.length!==this._shuffled.length&&this._shuffleValues(),e=this.values[this._shuffled[this.index]]),e}}}),Object.defineProperty(t.CtrlPattern.prototype,"type",{get:function(){return this._type},set:function(e){this._type=e,this._shuffled=null,this._type===t.CtrlPattern.Type.Up||this._type===t.CtrlPattern.Type.UpDown||this._type===t.CtrlPattern.Type.RandomOnce||this._type===t.CtrlPattern.Type.AlternateUp?this.index=0:this._type!==t.CtrlPattern.Type.Down&&this._type!==t.CtrlPattern.Type.DownUp&&this._type!==t.CtrlPattern.Type.AlternateDown||(this.index=this.values.length-1),this._type===t.CtrlPattern.Type.UpDown||this._type===t.CtrlPattern.Type.AlternateUp?this._direction=t.CtrlPattern.Type.Up:this._type!==t.CtrlPattern.Type.DownUp&&this._type!==t.CtrlPattern.Type.AlternateDown||(this._direction=t.CtrlPattern.Type.Down),this._type===t.CtrlPattern.Type.RandomOnce?this._shuffleValues():this._type===t.CtrlPattern.Random&&(this.index=Math.floor(Math.random()*this.values.length))}}),t.CtrlPattern.prototype.next=function(){var e=this.type;return e===t.CtrlPattern.Type.Up?(this.index++,this.index>=this.values.length&&(this.index=0)):e===t.CtrlPattern.Type.Down?(this.index--,this.index<0&&(this.index=this.values.length-1)):e===t.CtrlPattern.Type.UpDown||e===t.CtrlPattern.Type.DownUp?(this._direction===t.CtrlPattern.Type.Up?this.index++:this.index--,this.index<0?(this.index=1,this._direction=t.CtrlPattern.Type.Up):this.index>=this.values.length&&(this.index=this.values.length-2,this._direction=t.CtrlPattern.Type.Down)):e===t.CtrlPattern.Type.Random?this.index=Math.floor(Math.random()*this.values.length):e===t.CtrlPattern.Type.RandomWalk?Math.random()<.5?(this.index--,this.index=Math.max(this.index,0)):(this.index++,this.index=Math.min(this.index,this.values.length-1)):e===t.CtrlPattern.Type.RandomOnce?(this.index++,this.index>=this.values.length&&(this.index=0,this._shuffleValues())):e===t.CtrlPattern.Type.AlternateUp?(this._direction===t.CtrlPattern.Type.Up?(this.index+=2,this._direction=t.CtrlPattern.Type.Down):(this.index-=1,this._direction=t.CtrlPattern.Type.Up),this.index>=this.values.length&&(this.index=0,this._direction=t.CtrlPattern.Type.Up)):e===t.CtrlPattern.Type.AlternateDown&&(this._direction===t.CtrlPattern.Type.Up?(this.index+=1,this._direction=t.CtrlPattern.Type.Down):(this.index-=2,this._direction=t.CtrlPattern.Type.Up),this.index<0&&(this.index=this.values.length-1,this._direction=t.CtrlPattern.Type.Down)),this.value},t.CtrlPattern.prototype._shuffleValues=function(){var t=[];this._shuffled=[];for(var e=0;e<this.values.length;e++)t[e]=e;for(;t.length>0;){var n=t.splice(Math.floor(t.length*Math.random()),1);this._shuffled.push(n[0])}},t.CtrlPattern.prototype.dispose=function(){this._shuffled=null,this.values=null},t.CtrlPattern}),n(function(t){return t.CtrlRandom=function(){var e=t.defaults(arguments,["min","max"],t.CtrlRandom);t.call(this),this.min=e.min,this.max=e.max,this.integer=e.integer},t.extend(t.CtrlRandom),t.CtrlRandom.defaults={min:0,max:1,integer:!1},Object.defineProperty(t.CtrlRandom.prototype,"value",{get:function(){var t=this.toSeconds(this.min),e=this.toSeconds(this.max),n=Math.random(),i=n*t+(1-n)*e;return this.integer&&(i=Math.floor(i)),i}}),t.CtrlRandom}),n(function(t){return t.Buffers=function(e){var n=Array.prototype.slice.call(arguments);n.shift();var i=t.defaults(n,["onload","baseUrl"],t.Buffers);for(var r in t.call(this),this._buffers={},this.baseUrl=i.baseUrl,this._loadingCount=0,e)this._loadingCount++,this.add(r,e[r],this._bufferLoaded.bind(this,i.onload))},t.extend(t.Buffers),t.Buffers.defaults={onload:t.noOp,baseUrl:""},t.Buffers.prototype.has=function(t){return this._buffers.hasOwnProperty(t)},t.Buffers.prototype.get=function(t){if(this.has(t))return this._buffers[t];throw new Error("Tone.Buffers: no buffer named "+t)},t.Buffers.prototype._bufferLoaded=function(t){this._loadingCount--,0===this._loadingCount&&t&&t(this)},Object.defineProperty(t.Buffers.prototype,"loaded",{get:function(){var t=!0;for(var e in this._buffers){var n=this.get(e);t=t&&n.loaded}return t}}),t.Buffers.prototype.add=function(e,n,i){return i=t.defaultArg(i,t.noOp),n instanceof t.Buffer?(this._buffers[e]=n,i(this)):n instanceof AudioBuffer?(this._buffers[e]=new t.Buffer(n),i(this)):t.isString(n)&&(this._buffers[e]=new t.Buffer(this.baseUrl+n,i)),this},t.Buffers.prototype.dispose=function(){for(var e in t.prototype.dispose.call(this),this._buffers)this._buffers[e].dispose();return this._buffers=null,this},t.Buffers}),n(function(t){var e={};return t.prototype.send=function(n,i){e.hasOwnProperty(n)||(e[n]=this.context.createGain()),i=t.defaultArg(i,0);var r=new t.Gain(i,t.Type.Decibels);return this.connect(r),r.connect(e[n]),r},t.prototype.receive=function(t,n){return e.hasOwnProperty(t)||(e[t]=this.context.createGain()),e[t].connect(this,0,n),this},t.Context.on("init",function(t){t.Buses?e=t.Buses:(e={},t.Buses=e)}),t}),n(function(t){return t.Draw=function(){t.call(this),this._events=new t.Timeline,this.expiration=.25,this.anticipation=.008,this._boundDrawLoop=this._drawLoop.bind(this)},t.extend(t.Draw),t.Draw.prototype.schedule=function(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),1===this._events.length&&requestAnimationFrame(this._boundDrawLoop),this},t.Draw.prototype.cancel=function(t){return this._events.cancel(this.toSeconds(t)),this},t.Draw.prototype._drawLoop=function(){for(var e=t.now();this._events.length&&this._events.peek().time-this.anticipation<=e;){var n=this._events.shift();e-n.time<=this.expiration&&n.callback()}this._events.length>0&&requestAnimationFrame(this._boundDrawLoop)},t.Draw=new t.Draw,t.Draw}),n(function(t){t.Listener=function(){t.call(this),this._orientation=[0,0,0,0,0,0],this._position=[0,0,0],t.getContext(function(){this.set(e.defaults)}.bind(this))},t.extend(t.Listener),t.Listener.defaults={positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:1,upX:0,upY:1,upZ:0},t.Listener.prototype._rampTimeConstant=.01,t.Listener.prototype.setPosition=function(t,e,n){if(this.context.listener.positionX){var i=this.now();this.context.listener.positionX.setTargetAtTime(t,i,this._rampTimeConstant),this.context.listener.positionY.setTargetAtTime(e,i,this._rampTimeConstant),this.context.listener.positionZ.setTargetAtTime(n,i,this._rampTimeConstant)}else this.context.listener.setPosition(t,e,n);return this._position=Array.prototype.slice.call(arguments),this},t.Listener.prototype.setOrientation=function(t,e,n,i,r,o){if(this.context.listener.forwardX){var s=this.now();this.context.listener.forwardX.setTargetAtTime(t,s,this._rampTimeConstant),this.context.listener.forwardY.setTargetAtTime(e,s,this._rampTimeConstant),this.context.listener.forwardZ.setTargetAtTime(n,s,this._rampTimeConstant),this.context.listener.upX.setTargetAtTime(i,s,this._rampTimeConstant),this.context.listener.upY.setTargetAtTime(r,s,this._rampTimeConstant),this.context.listener.upZ.setTargetAtTime(o,s,this._rampTimeConstant)}else this.context.listener.setOrientation(t,e,n,i,r,o);return this._orientation=Array.prototype.slice.call(arguments),this},Object.defineProperty(t.Listener.prototype,"positionX",{set:function(t){this._position[0]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[0]}}),Object.defineProperty(t.Listener.prototype,"positionY",{set:function(t){this._position[1]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[1]}}),Object.defineProperty(t.Listener.prototype,"positionZ",{set:function(t){this._position[2]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[2]}}),Object.defineProperty(t.Listener.prototype,"forwardX",{set:function(t){this._orientation[0]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[0]}}),Object.defineProperty(t.Listener.prototype,"forwardY",{set:function(t){this._orientation[1]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[1]}}),Object.defineProperty(t.Listener.prototype,"forwardZ",{set:function(t){this._orientation[2]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[2]}}),Object.defineProperty(t.Listener.prototype,"upX",{set:function(t){this._orientation[3]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[3]}}),Object.defineProperty(t.Listener.prototype,"upY",{set:function(t){this._orientation[4]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[4]}}),Object.defineProperty(t.Listener.prototype,"upZ",{set:function(t){this._orientation[5]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[5]}}),t.Listener.prototype.dispose=function(){return this._orientation=null,this._position=null,this};var e=t.Listener;return t.Listener=new e,t.Context.on("init",function(n){n.Listener instanceof e?t.Listener=n.Listener:t.Listener=new e,n.Listener=t.Listener}),t.Listener}),n(function(t){return t.Offline=function(e,n){var i,r=t.context.sampleRate,o=t.context,s=function e(n,i,r,o){o=t.defaultArg(o,0);var s=new t.OfflineContext(2,i,r);t.context=s;var a=n(t.Transport);return s.currentTime>0&&o<1e3?e(n,i,r,++o):{response:a,context:s}}(e,n,r),a=s.response,u=s.context;return i=a instanceof Promise?a.then(function(){return u.render()}):u.render(),t.context=o,i.then(function(e){return new t.Buffer(e)})},t.Offline}),n(function(t){return t.Effect=function(){var e=t.defaults(arguments,["wet"],t.Effect);t.AudioNode.call(this),this.createInsOuts(1,1),this._dryWet=new t.CrossFade(e.wet),this.wet=this._dryWet.fade,this.effectSend=new t.Gain,this.effectReturn=new t.Gain,this.input.connect(this._dryWet.a),this.input.connect(this.effectSend),this.effectReturn.connect(this._dryWet.b),this._dryWet.connect(this.output),this._readOnly(["wet"])},t.extend(t.Effect,t.AudioNode),t.Effect.defaults={wet:1},t.Effect.prototype.connectEffect=function(t){return this.effectSend.chain(t,this.effectReturn),this},t.Effect.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._dryWet.dispose(),this._dryWet=null,this.effectSend.dispose(),this.effectSend=null,this.effectReturn.dispose(),this.effectReturn=null,this._writable(["wet"]),this.wet=null,this},t.Effect}),n(function(t){return t.AutoFilter=function(){var e=t.defaults(arguments,["frequency","baseFrequency","octaves"],t.AutoFilter);t.Effect.call(this,e),this._lfo=new t.LFO({frequency:e.frequency,amplitude:e.depth}),this.depth=this._lfo.amplitude,this.frequency=this._lfo.frequency,this.filter=new t.Filter(e.filter),this._octaves=0,this.connectEffect(this.filter),this._lfo.connect(this.filter.frequency),this.type=e.type,this._readOnly(["frequency","depth"]),this.octaves=e.octaves,this.baseFrequency=e.baseFrequency},t.extend(t.AutoFilter,t.Effect),t.AutoFilter.defaults={frequency:1,type:"sine",depth:1,baseFrequency:200,octaves:2.6,filter:{type:"lowpass",rolloff:-12,Q:1}},t.AutoFilter.prototype.start=function(t){return this._lfo.start(t),this},t.AutoFilter.prototype.stop=function(t){return this._lfo.stop(t),this},t.AutoFilter.prototype.sync=function(t){return this._lfo.sync(t),this},t.AutoFilter.prototype.unsync=function(){return this._lfo.unsync(),this},Object.defineProperty(t.AutoFilter.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),Object.defineProperty(t.AutoFilter.prototype,"baseFrequency",{get:function(){return this._lfo.min},set:function(t){this._lfo.min=this.toFrequency(t),this.octaves=this._octaves}}),Object.defineProperty(t.AutoFilter.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._lfo.max=this.baseFrequency*Math.pow(2,t)}}),t.AutoFilter.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._lfo.dispose(),this._lfo=null,this.filter.dispose(),this.filter=null,this._writable(["frequency","depth"]),this.frequency=null,this.depth=null,this},t.AutoFilter}),n(function(t){return t.AutoPanner=function(){var e=t.defaults(arguments,["frequency"],t.AutoPanner);t.Effect.call(this,e),this._lfo=new t.LFO({frequency:e.frequency,amplitude:e.depth,min:-1,max:1}),this.depth=this._lfo.amplitude,this._panner=new t.Panner,this.frequency=this._lfo.frequency,this.connectEffect(this._panner),this._lfo.connect(this._panner.pan),this.type=e.type,this._readOnly(["depth","frequency"])},t.extend(t.AutoPanner,t.Effect),t.AutoPanner.defaults={frequency:1,type:"sine",depth:1},t.AutoPanner.prototype.start=function(t){return this._lfo.start(t),this},t.AutoPanner.prototype.stop=function(t){return this._lfo.stop(t),this},t.AutoPanner.prototype.sync=function(t){return this._lfo.sync(t),this},t.AutoPanner.prototype.unsync=function(){return this._lfo.unsync(),this},Object.defineProperty(t.AutoPanner.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),t.AutoPanner.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._lfo.dispose(),this._lfo=null,this._panner.dispose(),this._panner=null,this._writable(["depth","frequency"]),this.frequency=null,this.depth=null,this},t.AutoPanner}),n(function(t){return t.AutoWah=function(){var e=t.defaults(arguments,["baseFrequency","octaves","sensitivity"],t.AutoWah);t.Effect.call(this,e),this.follower=new t.Follower(e.follower),this._sweepRange=new t.ScaleExp(0,1,.5),this._baseFrequency=e.baseFrequency,this._octaves=e.octaves,this._inputBoost=new t.Gain,this._bandpass=new t.Filter({rolloff:-48,frequency:0,Q:e.Q}),this._peaking=new t.Filter(0,"peaking"),this._peaking.gain.value=e.gain,this.gain=this._peaking.gain,this.Q=this._bandpass.Q,this.effectSend.chain(this._inputBoost,this.follower,this._sweepRange),this._sweepRange.connect(this._bandpass.frequency),this._sweepRange.connect(this._peaking.frequency),this.effectSend.chain(this._bandpass,this._peaking,this.effectReturn),this._setSweepRange(),this.sensitivity=e.sensitivity,this._readOnly(["gain","Q"])},t.extend(t.AutoWah,t.Effect),t.AutoWah.defaults={baseFrequency:100,octaves:6,sensitivity:0,Q:2,gain:2,follower:{attack:.3,release:.5}},Object.defineProperty(t.AutoWah.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._setSweepRange()}}),Object.defineProperty(t.AutoWah.prototype,"baseFrequency",{get:function(){return this._baseFrequency},set:function(t){this._baseFrequency=t,this._setSweepRange()}}),Object.defineProperty(t.AutoWah.prototype,"sensitivity",{get:function(){return t.gainToDb(1/this._inputBoost.gain.value)},set:function(e){this._inputBoost.gain.value=1/t.dbToGain(e)}}),t.AutoWah.prototype._setSweepRange=function(){this._sweepRange.min=this._baseFrequency,this._sweepRange.max=Math.min(this._baseFrequency*Math.pow(2,this._octaves),this.context.sampleRate/2)},t.AutoWah.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this.follower.dispose(),this.follower=null,this._sweepRange.dispose(),this._sweepRange=null,this._bandpass.dispose(),this._bandpass=null,this._peaking.dispose(),this._peaking=null,this._inputBoost.dispose(),this._inputBoost=null,this._writable(["gain","Q"]),this.gain=null,this.Q=null,this},t.AutoWah}),n(function(t){return t.Modulo=function(e){t.SignalBase.call(this),this.createInsOuts(1,0),this._shaper=new t.WaveShaper(Math.pow(2,16)),this._multiply=new t.Multiply,this._subtract=this.output=new t.Subtract,this._modSignal=new t.Signal(e),this.input.fan(this._shaper,this._subtract),this._modSignal.connect(this._multiply,0,0),this._shaper.connect(this._multiply,0,1),this._multiply.connect(this._subtract,0,1),this._setWaveShaper(e)},t.extend(t.Modulo,t.SignalBase),t.Modulo.prototype._setWaveShaper=function(t){this._shaper.setMap(function(e){return Math.floor((e+1e-4)/t)})},Object.defineProperty(t.Modulo.prototype,"value",{get:function(){return this._modSignal.value},set:function(t){this._modSignal.value=t,this._setWaveShaper(t)}}),t.Modulo.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._shaper.dispose(),this._shaper=null,this._multiply.dispose(),this._multiply=null,this._subtract.dispose(),this._subtract=null,this._modSignal.dispose(),this._modSignal=null,this},t.Modulo}),n(function(t){return t.BitCrusher=function(){var e=t.defaults(arguments,["bits"],t.BitCrusher);t.Effect.call(this,e);var n=1/Math.pow(2,e.bits-1);this._subtract=new t.Subtract,this._modulo=new t.Modulo(n),this._bits=e.bits,this.effectSend.fan(this._subtract,this._modulo),this._modulo.connect(this._subtract,0,1),this._subtract.connect(this.effectReturn)},t.extend(t.BitCrusher,t.Effect),t.BitCrusher.defaults={bits:4},Object.defineProperty(t.BitCrusher.prototype,"bits",{get:function(){return this._bits},set:function(t){this._bits=t;var e=1/Math.pow(2,t-1);this._modulo.value=e}}),t.BitCrusher.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._subtract.dispose(),this._subtract=null,this._modulo.dispose(),this._modulo=null,this},t.BitCrusher}),n(function(t){return t.Chebyshev=function(){var e=t.defaults(arguments,["order"],t.Chebyshev);t.Effect.call(this,e),this._shaper=new t.WaveShaper(4096),this._order=e.order,this.connectEffect(this._shaper),this.order=e.order,this.oversample=e.oversample},t.extend(t.Chebyshev,t.Effect),t.Chebyshev.defaults={order:1,oversample:"none"},t.Chebyshev.prototype._getCoefficient=function(t,e,n){return n.hasOwnProperty(e)?n[e]:(n[e]=0===e?0:1===e?t:2*t*this._getCoefficient(t,e-1,n)-this._getCoefficient(t,e-2,n),n[e])},Object.defineProperty(t.Chebyshev.prototype,"order",{get:function(){return this._order},set:function(t){this._order=t;for(var e=new Array(4096),n=e.length,i=0;i<n;++i){var r=2*i/n-1;e[i]=0===r?0:this._getCoefficient(r,t,{})}this._shaper.curve=e}}),Object.defineProperty(t.Chebyshev.prototype,"oversample",{get:function(){return this._shaper.oversample},set:function(t){this._shaper.oversample=t}}),t.Chebyshev.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._shaper.dispose(),this._shaper=null,this},t.Chebyshev}),n(function(t){return t.StereoEffect=function(){t.AudioNode.call(this);var e=t.defaults(arguments,["wet"],t.Effect);this.createInsOuts(1,1),this._dryWet=new t.CrossFade(e.wet),this.wet=this._dryWet.fade,this._split=new t.Split,this.effectSendL=this._split.left,this.effectSendR=this._split.right,this._merge=new t.Merge,this.effectReturnL=this._merge.left,this.effectReturnR=this._merge.right,this.input.connect(this._split),this.input.connect(this._dryWet,0,0),this._merge.connect(this._dryWet,0,1),this._dryWet.connect(this.output),this._readOnly(["wet"])},t.extend(t.StereoEffect,t.Effect),t.StereoEffect.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._dryWet.dispose(),this._dryWet=null,this._split.dispose(),this._split=null,this._merge.dispose(),this._merge=null,this.effectSendL=null,this.effectSendR=null,this.effectReturnL=null,this.effectReturnR=null,this._writable(["wet"]),this.wet=null,this},t.StereoEffect}),n(function(t){return t.Chorus=function(){var e=t.defaults(arguments,["frequency","delayTime","depth"],t.Chorus);t.StereoEffect.call(this,e),this._depth=e.depth,this._delayTime=e.delayTime/1e3,this._lfoL=new t.LFO({frequency:e.frequency,min:0,max:1}),this._lfoR=new t.LFO({frequency:e.frequency,min:0,max:1,phase:180}),this._delayNodeL=new t.Delay,this._delayNodeR=new t.Delay,this.frequency=this._lfoL.frequency,this.effectSendL.chain(this._delayNodeL,this.effectReturnL),this.effectSendR.chain(this._delayNodeR,this.effectReturnR),this.effectSendL.connect(this.effectReturnL),this.effectSendR.connect(this.effectReturnR),this._lfoL.connect(this._delayNodeL.delayTime),this._lfoR.connect(this._delayNodeR.delayTime),this._lfoL.start(),this._lfoR.start(),this._lfoL.frequency.connect(this._lfoR.frequency),this.depth=this._depth,this.frequency.value=e.frequency,this.type=e.type,this._readOnly(["frequency"]),this.spread=e.spread},t.extend(t.Chorus,t.StereoEffect),t.Chorus.defaults={frequency:1.5,delayTime:3.5,depth:.7,type:"sine",spread:180},Object.defineProperty(t.Chorus.prototype,"depth",{get:function(){return this._depth},set:function(t){this._depth=t;var e=this._delayTime*t;this._lfoL.min=Math.max(this._delayTime-e,0),this._lfoL.max=this._delayTime+e,this._lfoR.min=Math.max(this._delayTime-e,0),this._lfoR.max=this._delayTime+e}}),Object.defineProperty(t.Chorus.prototype,"delayTime",{get:function(){return 1e3*this._delayTime},set:function(t){this._delayTime=t/1e3,this.depth=this._depth}}),Object.defineProperty(t.Chorus.prototype,"type",{get:function(){return this._lfoL.type},set:function(t){this._lfoL.type=t,this._lfoR.type=t}}),Object.defineProperty(t.Chorus.prototype,"spread",{get:function(){return this._lfoR.phase-this._lfoL.phase},set:function(t){this._lfoL.phase=90-t/2,this._lfoR.phase=t/2+90}}),t.Chorus.prototype.dispose=function(){return t.StereoEffect.prototype.dispose.call(this),this._lfoL.dispose(),this._lfoL=null,this._lfoR.dispose(),this._lfoR=null,this._delayNodeL.dispose(),this._delayNodeL=null,this._delayNodeR.dispose(),this._delayNodeR=null,this._writable("frequency"),this.frequency=null,this},t.Chorus}),n(function(t){return t.Convolver=function(){var e=t.defaults(arguments,["url","onload"],t.Convolver);t.Effect.call(this,e),this._convolver=this.context.createConvolver(),this._buffer=new t.Buffer(e.url,function(t){this._convolver.buffer=t.get(),e.onload()}.bind(this)),this.connectEffect(this._convolver)},t.extend(t.Convolver,t.Effect),t.Convolver.defaults={onload:t.noOp},Object.defineProperty(t.Convolver.prototype,"buffer",{get:function(){return this._buffer.get()},set:function(t){this._buffer.set(t),this._convolver.buffer=this._buffer.get()}}),t.Convolver.prototype.load=function(t,e){return this._buffer.load(t,function(t){this.buffer=t,e&&e()}.bind(this))},t.Convolver.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._convolver.disconnect(),this._convolver=null,this._buffer.dispose(),this._buffer=null,this},t.Convolver}),n(function(t){return t.Distortion=function(){var e=t.defaults(arguments,["distortion"],t.Distortion);t.Effect.call(this,e),this._shaper=new t.WaveShaper(4096),this._distortion=e.distortion,this.connectEffect(this._shaper),this.distortion=e.distortion,this.oversample=e.oversample},t.extend(t.Distortion,t.Effect),t.Distortion.defaults={distortion:.4,oversample:"none"},Object.defineProperty(t.Distortion.prototype,"distortion",{get:function(){return this._distortion},set:function(t){this._distortion=t;var e=100*t,n=Math.PI/180;this._shaper.setMap(function(t){return Math.abs(t)<.001?0:(3+e)*t*20*n/(Math.PI+e*Math.abs(t))})}}),Object.defineProperty(t.Distortion.prototype,"oversample",{get:function(){return this._shaper.oversample},set:function(t){this._shaper.oversample=t}}),t.Distortion.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._shaper.dispose(),this._shaper=null,this},t.Distortion}),n(function(t){return t.FeedbackEffect=function(){var e=t.defaults(arguments,["feedback"],t.FeedbackEffect);t.Effect.call(this,e),this._feedbackGain=new t.Gain(e.feedback,t.Type.NormalRange),this.feedback=this._feedbackGain.gain,this.effectReturn.chain(this._feedbackGain,this.effectSend),this._readOnly(["feedback"])},t.extend(t.FeedbackEffect,t.Effect),t.FeedbackEffect.defaults={feedback:.125},t.FeedbackEffect.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._writable(["feedback"]),this._feedbackGain.dispose(),this._feedbackGain=null,this.feedback=null,this},t.FeedbackEffect}),n(function(t){return t.FeedbackDelay=function(){var e=t.defaults(arguments,["delayTime","feedback"],t.FeedbackDelay);t.FeedbackEffect.call(this,e),this._delayNode=new t.Delay(e.delayTime,e.maxDelay),this.delayTime=this._delayNode.delayTime,this.connectEffect(this._delayNode),this._readOnly(["delayTime"])},t.extend(t.FeedbackDelay,t.FeedbackEffect),t.FeedbackDelay.defaults={delayTime:.25,maxDelay:1},t.FeedbackDelay.prototype.dispose=function(){return t.FeedbackEffect.prototype.dispose.call(this),this._delayNode.dispose(),this._delayNode=null,this._writable(["delayTime"]),this.delayTime=null,this},t.FeedbackDelay}),n(function(t){var e=[1557/44100,1617/44100,1491/44100,1422/44100,1277/44100,1356/44100,1188/44100,1116/44100],n=[225,556,441,341];return t.Freeverb=function(){var i=t.defaults(arguments,["roomSize","dampening"],t.Freeverb);t.StereoEffect.call(this,i),this.roomSize=new t.Signal(i.roomSize,t.Type.NormalRange),this.dampening=new t.Signal(i.dampening,t.Type.Frequency),this._combFilters=[],this._allpassFiltersL=[],this._allpassFiltersR=[];for(var r=0;r<n.length;r++){var o=this.context.createBiquadFilter();o.type="allpass",o.frequency.value=n[r],this._allpassFiltersL.push(o)}for(var s=0;s<n.length;s++){var a=this.context.createBiquadFilter();a.type="allpass",a.frequency.value=n[s],this._allpassFiltersR.push(a)}for(var u=0;u<e.length;u++){var l=new t.LowpassCombFilter(e[u]);u<e.length/2?this.effectSendL.chain(l,this._allpassFiltersL[0]):this.effectSendR.chain(l,this._allpassFiltersR[0]),this.roomSize.connect(l.resonance),this.dampening.connect(l.dampening),this._combFilters.push(l)}t.connectSeries.apply(t,this._allpassFiltersL),t.connectSeries.apply(t,this._allpassFiltersR),this._allpassFiltersL[this._allpassFiltersL.length-1].connect(this.effectReturnL),this._allpassFiltersR[this._allpassFiltersR.length-1].connect(this.effectReturnR),this._readOnly(["roomSize","dampening"])},t.extend(t.Freeverb,t.StereoEffect),t.Freeverb.defaults={roomSize:.7,dampening:3e3},t.Freeverb.prototype.dispose=function(){t.StereoEffect.prototype.dispose.call(this);for(var e=0;e<this._allpassFiltersL.length;e++)this._allpassFiltersL[e].disconnect(),this._allpassFiltersL[e]=null;this._allpassFiltersL=null;for(var n=0;n<this._allpassFiltersR.length;n++)this._allpassFiltersR[n].disconnect(),this._allpassFiltersR[n]=null;this._allpassFiltersR=null;for(var i=0;i<this._combFilters.length;i++)this._combFilters[i].dispose(),this._combFilters[i]=null;return this._combFilters=null,this._writable(["roomSize","dampening"]),this.roomSize.dispose(),this.roomSize=null,this.dampening.dispose(),this.dampening=null,this},t.Freeverb}),n(function(t){var e=[.06748,.06404,.08212,.09004],n=[.773,.802,.753,.733],i=[347,113,37];return t.JCReverb=function(){var r=t.defaults(arguments,["roomSize"],t.JCReverb);t.StereoEffect.call(this,r),this.roomSize=new t.Signal(r.roomSize,t.Type.NormalRange),this._scaleRoomSize=new t.Scale(-.733,.197),this._allpassFilters=[],this._feedbackCombFilters=[];for(var o=0;o<i.length;o++){var s=this.context.createBiquadFilter();s.type="allpass",s.frequency.value=i[o],this._allpassFilters.push(s)}for(var a=0;a<e.length;a++){var u=new t.FeedbackCombFilter(e[a],.1);this._scaleRoomSize.connect(u.resonance),u.resonance.value=n[a],this._allpassFilters[this._allpassFilters.length-1].connect(u),a<e.length/2?u.connect(this.effectReturnL):u.connect(this.effectReturnR),this._feedbackCombFilters.push(u)}this.roomSize.connect(this._scaleRoomSize),t.connectSeries.apply(t,this._allpassFilters),this.effectSendL.connect(this._allpassFilters[0]),this.effectSendR.connect(this._allpassFilters[0]),this._readOnly(["roomSize"])},t.extend(t.JCReverb,t.StereoEffect),t.JCReverb.defaults={roomSize:.5},t.JCReverb.prototype.dispose=function(){t.StereoEffect.prototype.dispose.call(this);for(var e=0;e<this._allpassFilters.length;e++)this._allpassFilters[e].disconnect(),this._allpassFilters[e]=null;this._allpassFilters=null;for(var n=0;n<this._feedbackCombFilters.length;n++)this._feedbackCombFilters[n].dispose(),this._feedbackCombFilters[n]=null;return this._feedbackCombFilters=null,this._writable(["roomSize"]),this.roomSize.dispose(),this.roomSize=null,this._scaleRoomSize.dispose(),this._scaleRoomSize=null,this},t.JCReverb}),n(function(t){return t.MidSideEffect=function(){t.Effect.apply(this,arguments),this._midSideSplit=new t.MidSideSplit,this._midSideMerge=new t.MidSideMerge,this.midSend=this._midSideSplit.mid,this.sideSend=this._midSideSplit.side,this.midReturn=this._midSideMerge.mid,this.sideReturn=this._midSideMerge.side,this.effectSend.connect(this._midSideSplit),this._midSideMerge.connect(this.effectReturn)},t.extend(t.MidSideEffect,t.Effect),t.MidSideEffect.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._midSideSplit.dispose(),this._midSideSplit=null,this._midSideMerge.dispose(),this._midSideMerge=null,this.midSend=null,this.sideSend=null,this.midReturn=null,this.sideReturn=null,this},t.MidSideEffect}),n(function(t){return t.Phaser=function(){var e=t.defaults(arguments,["frequency","octaves","baseFrequency"],t.Phaser);t.StereoEffect.call(this,e),this._lfoL=new t.LFO(e.frequency,0,1),this._lfoR=new t.LFO(e.frequency,0,1),this._lfoR.phase=180,this._baseFrequency=e.baseFrequency,this._octaves=e.octaves,this.Q=new t.Signal(e.Q,t.Type.Positive),this._filtersL=this._makeFilters(e.stages,this._lfoL,this.Q),this._filtersR=this._makeFilters(e.stages,this._lfoR,this.Q),this.frequency=this._lfoL.frequency,this.frequency.value=e.frequency,this.effectSendL.connect(this._filtersL[0]),this.effectSendR.connect(this._filtersR[0]),this._filtersL[e.stages-1].connect(this.effectReturnL),this._filtersR[e.stages-1].connect(this.effectReturnR),this._lfoL.frequency.connect(this._lfoR.frequency),this.baseFrequency=e.baseFrequency,this.octaves=e.octaves,this._lfoL.start(),this._lfoR.start(),this._readOnly(["frequency","Q"])},t.extend(t.Phaser,t.StereoEffect),t.Phaser.defaults={frequency:.5,octaves:3,stages:10,Q:10,baseFrequency:350},t.Phaser.prototype._makeFilters=function(e,n,i){for(var r=new Array(e),o=0;o<e;o++){var s=this.context.createBiquadFilter();s.type="allpass",i.connect(s.Q),n.connect(s.frequency),r[o]=s}return t.connectSeries.apply(t,r),r},Object.defineProperty(t.Phaser.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t;var e=this._baseFrequency*Math.pow(2,t);this._lfoL.max=e,this._lfoR.max=e}}),Object.defineProperty(t.Phaser.prototype,"baseFrequency",{get:function(){return this._baseFrequency},set:function(t){this._baseFrequency=t,this._lfoL.min=t,this._lfoR.min=t,this.octaves=this._octaves}}),t.Phaser.prototype.dispose=function(){t.StereoEffect.prototype.dispose.call(this),this._writable(["frequency","Q"]),this.Q.dispose(),this.Q=null,this._lfoL.dispose(),this._lfoL=null,this._lfoR.dispose(),this._lfoR=null;for(var e=0;e<this._filtersL.length;e++)this._filtersL[e].disconnect(),this._filtersL[e]=null;this._filtersL=null;for(var n=0;n<this._filtersR.length;n++)this._filtersR[n].disconnect(),this._filtersR[n]=null;return this._filtersR=null,this.frequency=null,this},t.Phaser}),n(function(t){return t.StereoXFeedbackEffect=function(){var e=t.defaults(arguments,["feedback"],t.FeedbackEffect);t.StereoEffect.call(this,e),this.feedback=new t.Signal(e.feedback,t.Type.NormalRange),this._feedbackLR=new t.Gain,this._feedbackRL=new t.Gain,this.effectReturnL.chain(this._feedbackLR,this.effectSendR),this.effectReturnR.chain(this._feedbackRL,this.effectSendL),this.feedback.fan(this._feedbackLR.gain,this._feedbackRL.gain),this._readOnly(["feedback"])},t.extend(t.StereoXFeedbackEffect,t.StereoEffect),t.StereoXFeedbackEffect.prototype.dispose=function(){return t.StereoEffect.prototype.dispose.call(this),this._writable(["feedback"]),this.feedback.dispose(),this.feedback=null,this._feedbackLR.dispose(),this._feedbackLR=null,this._feedbackRL.dispose(),this._feedbackRL=null,this},t.StereoXFeedbackEffect}),n(function(t){return t.PingPongDelay=function(){var e=t.defaults(arguments,["delayTime","feedback"],t.PingPongDelay);t.StereoXFeedbackEffect.call(this,e),this._leftDelay=new t.Delay(0,e.maxDelayTime),this._rightDelay=new t.Delay(0,e.maxDelayTime),this._rightPreDelay=new t.Delay(0,e.maxDelayTime),this.delayTime=new t.Signal(e.delayTime,t.Type.Time),this.effectSendL.chain(this._leftDelay,this.effectReturnL),this.effectSendR.chain(this._rightPreDelay,this._rightDelay,this.effectReturnR),this.delayTime.fan(this._leftDelay.delayTime,this._rightDelay.delayTime,this._rightPreDelay.delayTime),this._feedbackLR.disconnect(),this._feedbackLR.connect(this._rightDelay),this._readOnly(["delayTime"])},t.extend(t.PingPongDelay,t.StereoXFeedbackEffect),t.PingPongDelay.defaults={delayTime:.25,maxDelayTime:1},t.PingPongDelay.prototype.dispose=function(){return t.StereoXFeedbackEffect.prototype.dispose.call(this),this._leftDelay.dispose(),this._leftDelay=null,this._rightDelay.dispose(),this._rightDelay=null,this._rightPreDelay.dispose(),this._rightPreDelay=null,this._writable(["delayTime"]),this.delayTime.dispose(),this.delayTime=null,this},t.PingPongDelay}),n(function(t){return t.PitchShift=function(){var e=t.defaults(arguments,["pitch"],t.PitchShift);t.FeedbackEffect.call(this,e),this._frequency=new t.Signal(0),this._delayA=new t.Delay(0,1),this._lfoA=new t.LFO({min:0,max:.1,type:"sawtooth"}).connect(this._delayA.delayTime),this._delayB=new t.Delay(0,1),this._lfoB=new t.LFO({min:0,max:.1,type:"sawtooth",phase:180}).connect(this._delayB.delayTime),this._crossFade=new t.CrossFade,this._crossFadeLFO=new t.LFO({min:0,max:1,type:"triangle",phase:90}).connect(this._crossFade.fade),this._feedbackDelay=new t.Delay(e.delayTime),this.delayTime=this._feedbackDelay.delayTime,this._readOnly("delayTime"),this._pitch=e.pitch,this._windowSize=e.windowSize,this._delayA.connect(this._crossFade.a),this._delayB.connect(this._crossFade.b),this._frequency.fan(this._lfoA.frequency,this._lfoB.frequency,this._crossFadeLFO.frequency),this.effectSend.fan(this._delayA,this._delayB),this._crossFade.chain(this._feedbackDelay,this.effectReturn);var n=this.now();this._lfoA.start(n),this._lfoB.start(n),this._crossFadeLFO.start(n),this.windowSize=this._windowSize},t.extend(t.PitchShift,t.FeedbackEffect),t.PitchShift.defaults={pitch:0,windowSize:.1,delayTime:0,feedback:0},Object.defineProperty(t.PitchShift.prototype,"pitch",{get:function(){return this._pitch},set:function(e){this._pitch=e;var n=0;e<0?(this._lfoA.min=0,this._lfoA.max=this._windowSize,this._lfoB.min=0,this._lfoB.max=this._windowSize,n=t.intervalToFrequencyRatio(e-1)+1):(this._lfoA.min=this._windowSize,this._lfoA.max=0,this._lfoB.min=this._windowSize,this._lfoB.max=0,n=t.intervalToFrequencyRatio(e)-1),this._frequency.value=n*(1.2/this._windowSize)}}),Object.defineProperty(t.PitchShift.prototype,"windowSize",{get:function(){return this._windowSize},set:function(t){this._windowSize=this.toSeconds(t),this.pitch=this._pitch}}),t.PitchShift.prototype.dispose=function(){return t.FeedbackEffect.prototype.dispose.call(this),this._frequency.dispose(),this._frequency=null,this._delayA.disconnect(),this._delayA=null,this._delayB.disconnect(),this._delayB=null,this._lfoA.dispose(),this._lfoA=null,this._lfoB.dispose(),this._lfoB=null,this._crossFade.dispose(),this._crossFade=null,this._crossFadeLFO.dispose(),this._crossFadeLFO=null,this._writable("delayTime"),this._feedbackDelay.dispose(),this._feedbackDelay=null,this.delayTime=null,this},t.PitchShift}),n(function(t){return t.BufferSource=function(){var e=t.defaults(arguments,["buffer","onload"],t.BufferSource);t.AudioNode.call(this,e),this.onended=e.onended,this._startTime=-1,this._sourceStarted=!1,this._sourceStopped=!1,this._stopTime=-1,this._gainNode=this.output=new t.Gain,this._source=this.context.createBufferSource(),this._source.connect(this._gainNode),this._source.onended=this._onended.bind(this),this._buffer=new t.Buffer(e.buffer,e.onload),this.playbackRate=new t.Param(this._source.playbackRate,t.Type.Positive),this.fadeIn=e.fadeIn,this.fadeOut=e.fadeOut,this.curve=e.curve,this._gain=1,this._onendedTimeout=-1,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.playbackRate.value=e.playbackRate},t.extend(t.BufferSource,t.AudioNode),t.BufferSource.defaults={onended:t.noOp,onload:t.noOp,loop:!1,loopStart:0,loopEnd:0,fadeIn:0,fadeOut:0,curve:"linear",playbackRate:1},Object.defineProperty(t.BufferSource.prototype,"state",{get:function(){return this.getStateAtTime(this.now())}}),t.BufferSource.prototype.getStateAtTime=function(e){return e=this.toSeconds(e),-1!==this._startTime&&e>=this._startTime&&!this._sourceStopped?t.State.Started:t.State.Stopped},t.BufferSource.prototype.start=function(e,n,i,r,o){if(-1!==this._startTime)throw new Error("Tone.BufferSource can only be started once.");if(!this.buffer.loaded)throw new Error("Tone.BufferSource: buffer is either not set or not loaded.");e=this.toSeconds(e),n=this.loop?t.defaultArg(n,this.loopStart):t.defaultArg(n,0),n=this.toSeconds(n),r=t.defaultArg(r,1),this._gain=r,o=this.toSeconds(t.defaultArg(o,this.fadeIn)),this.fadeIn=o,o>0?(this._gainNode.gain.setValueAtTime(0,e),"linear"===this.curve?this._gainNode.gain.linearRampToValueAtTime(this._gain,e+o):this._gainNode.gain.exponentialApproachValueAtTime(this._gain,e,o)):this._gainNode.gain.setValueAtTime(r,e),this._startTime=e;var s=this.toSeconds(t.defaultArg(i,this.buffer.duration-n%this.buffer.duration));if(s=Math.max(s,0),t.isDefined(i)&&(this.loop||(s=Math.min(s,this.buffer.duration-n%this.buffer.duration)),this.stop(e+s,this.fadeOut)),this.loop){var a=this.loopEnd||this.buffer.duration,u=this.loopStart;n>=a&&(n=(n-u)%(a-u)+u)}return this._source.buffer=this.buffer.get(),this._source.loopEnd=this.loopEnd||this.buffer.duration,n<this.buffer.duration&&(this._sourceStarted=!0,this._source.start(e,n)),this},t.BufferSource.prototype.stop=function(e,n){if(!this.buffer.loaded)throw new Error("Tone.BufferSource: buffer is either not set or not loaded.");if(!this._sourceStopped){if(e=this.toSeconds(e),-1!==this._stopTime&&this.cancelStop(),e<=this._startTime)return this._gainNode.gain.cancelScheduledValues(e),this._gainNode.gain.value=0,this;e=Math.max(this._startTime+this.fadeIn+this.sampleTime,e),this._gainNode.gain.cancelScheduledValues(e),this._stopTime=e,n=this.toSeconds(t.defaultArg(n,this.fadeOut));var i=e-this._startTime-this.fadeIn-this.sampleTime;this.loop||(i=Math.min(i,this.buffer.duration));var r=e-(n=Math.min(i,n));return n>this.sampleTime?(this._gainNode.gain.setValueAtTime(this._gain,r),"linear"===this.curve?this._gainNode.gain.linearRampToValueAtTime(0,e):this._gainNode.gain.exponentialApproachValueAtTime(0,r,n)):this._gainNode.gain.setValueAtTime(0,e),t.context.clearTimeout(this._onendedTimeout),this._onendedTimeout=t.context.setTimeout(this._onended.bind(this),this._stopTime-this.now()),this}},t.BufferSource.prototype.cancelStop=function(){if(-1!==this._startTime&&!this._sourceStopped){var t=this.toSeconds(this.fadeIn);this._gainNode.gain.cancelScheduledValues(this._startTime+t+this.sampleTime),this._gainNode.gain.setValueAtTime(1,Math.max(this.now(),this._startTime+t+this.sampleTime)),this.context.clearTimeout(this._onendedTimeout),this._stopTime=-1}return this},t.BufferSource.prototype._onended=function(){if(!this._sourceStopped){this._sourceStopped=!0;var t="exponential"===this.curve?2*this.fadeOut:0;this._sourceStarted&&-1!==this._stopTime&&this._source.stop(this._stopTime+t),this.onended(this)}},Object.defineProperty(t.BufferSource.prototype,"loopStart",{get:function(){return this._source.loopStart},set:function(t){this._source.loopStart=this.toSeconds(t)}}),Object.defineProperty(t.BufferSource.prototype,"loopEnd",{get:function(){return this._source.loopEnd},set:function(t){this._source.loopEnd=this.toSeconds(t)}}),Object.defineProperty(t.BufferSource.prototype,"buffer",{get:function(){return this._buffer},set:function(t){this._buffer.set(t)}}),Object.defineProperty(t.BufferSource.prototype,"loop",{get:function(){return this._source.loop},set:function(t){this._source.loop=t,this.cancelStop()}}),t.BufferSource.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.onended=null,this._source.onended=null,this._source.disconnect(),this._source=null,this._gainNode.dispose(),this._gainNode=null,this._buffer.dispose(),this._buffer=null,this._startTime=-1,this.playbackRate=null,t.context.clearTimeout(this._onendedTimeout),this},t.BufferSource}),n(function(t){t.Noise=function(){var e=t.defaults(arguments,["type"],t.Noise);t.Source.call(this,e),this._source=null,this._type=e.type,this._playbackRate=e.playbackRate},t.extend(t.Noise,t.Source),t.Noise.defaults={type:"white",playbackRate:1},Object.defineProperty(t.Noise.prototype,"type",{get:function(){return this._type},set:function(e){if(this._type!==e){if(!(e in n))throw new TypeError("Tone.Noise: invalid type: "+e);if(this._type=e,this.state===t.State.Started){var i=this.now();this._stop(i),this._start(i)}}}}),Object.defineProperty(t.Noise.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._source&&(this._source.playbackRate.value=t)}}),t.Noise.prototype._start=function(e){var i=n[this._type];this._source=new t.BufferSource(i).connect(this.output),this._source.loop=!0,this._source.playbackRate.value=this._playbackRate,this._source.start(this.toSeconds(e),Math.random()*(i.duration-.001))},t.Noise.prototype._stop=function(t){this._source&&(this._source.stop(this.toSeconds(t)),this._source=null)},t.Noise.prototype.restart=function(t){this._stop(t),this._start(t)},t.Noise.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),null!==this._source&&(this._source.disconnect(),this._source=null),this._buffer=null,this};var e={pink:function(){for(var t=[],e=0;e<2;e++){var n,i,r,o,s,a,u,l=new Float32Array(220500);t[e]=l,n=i=r=o=s=a=u=0;for(var c=0;c<220500;c++){var h=2*Math.random()-1;n=.99886*n+.0555179*h,i=.99332*i+.0750759*h,r=.969*r+.153852*h,o=.8665*o+.3104856*h,s=.55*s+.5329522*h,a=-.7616*a-.016898*h,l[c]=n+i+r+o+s+a+u+.5362*h,l[c]*=.11,u=.115926*h}}return t}(),brown:function(){for(var t=[],e=0;e<2;e++){var n=new Float32Array(220500);t[e]=n;for(var i=0,r=0;r<220500;r++){var o=2*Math.random()-1;n[r]=(i+.02*o)/1.02,i=n[r],n[r]*=3.5}}return t}(),white:function(){for(var t=[],e=0;e<2;e++){var n=new Float32Array(220500);t[e]=n;for(var i=0;i<220500;i++)n[i]=2*Math.random()-1}return t}()},n={};function i(){for(var i in e)n[i]=(new t.Buffer).fromArray(e[i])}return t.getContext(i),t.Context.on("init",i),t.Noise}),n(function(t){return t.Reverb=function(){var e=t.defaults(arguments,["decay"],t.Reverb);t.Effect.call(this,e),this._convolver=this.context.createConvolver(),this.decay=e.decay,this.preDelay=e.preDelay,this.connectEffect(this._convolver)},t.extend(t.Reverb,t.Effect),t.Reverb.defaults={decay:1.5,preDelay:.01},t.Reverb.prototype.generate=function(){return t.Offline(function(){var e=new t.Noise,n=new t.Noise,i=new t.Merge;e.connect(i.left),n.connect(i.right);var r=(new t.Gain).toMaster();i.connect(r),e.start(0),n.start(0),r.gain.setValueAtTime(0,0),r.gain.linearRampToValueAtTime(1,this.preDelay),r.gain.exponentialApproachValueAtTime(0,this.preDelay,this.decay-this.preDelay)}.bind(this),this.decay).then(function(t){return this._convolver.buffer=t.get(),this}.bind(this))},t.Reverb.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._convolver.disconnect(),this._convolver=null,this},t.Reverb}),n(function(t){return t.StereoFeedbackEffect=function(){var e=t.defaults(arguments,["feedback"],t.FeedbackEffect);t.StereoEffect.call(this,e),this.feedback=new t.Signal(e.feedback,t.Type.NormalRange),this._feedbackL=new t.Gain,this._feedbackR=new t.Gain,this.effectReturnL.chain(this._feedbackL,this.effectSendL),this.effectReturnR.chain(this._feedbackR,this.effectSendR),this.feedback.fan(this._feedbackL.gain,this._feedbackR.gain),this._readOnly(["feedback"])},t.extend(t.StereoFeedbackEffect,t.StereoEffect),t.StereoFeedbackEffect.prototype.dispose=function(){return t.StereoEffect.prototype.dispose.call(this),this._writable(["feedback"]),this.feedback.dispose(),this.feedback=null,this._feedbackL.dispose(),this._feedbackL=null,this._feedbackR.dispose(),this._feedbackR=null,this},t.StereoFeedbackEffect}),n(function(t){return t.StereoWidener=function(){var e=t.defaults(arguments,["width"],t.StereoWidener);t.MidSideEffect.call(this,e),this.width=new t.Signal(e.width,t.Type.NormalRange),this._readOnly(["width"]),this._twoTimesWidthMid=new t.Multiply(2),this._twoTimesWidthSide=new t.Multiply(2),this._midMult=new t.Multiply,this._twoTimesWidthMid.connect(this._midMult,0,1),this.midSend.chain(this._midMult,this.midReturn),this._oneMinusWidth=new t.Subtract,this._oneMinusWidth.connect(this._twoTimesWidthMid),this.context.getConstant(1).connect(this._oneMinusWidth,0,0),this.width.connect(this._oneMinusWidth,0,1),this._sideMult=new t.Multiply,this.width.connect(this._twoTimesWidthSide),this._twoTimesWidthSide.connect(this._sideMult,0,1),this.sideSend.chain(this._sideMult,this.sideReturn)},t.extend(t.StereoWidener,t.MidSideEffect),t.StereoWidener.defaults={width:.5},t.StereoWidener.prototype.dispose=function(){return t.MidSideEffect.prototype.dispose.call(this),this._writable(["width"]),this.width.dispose(),this.width=null,this._midMult.dispose(),this._midMult=null,this._sideMult.dispose(),this._sideMult=null,this._twoTimesWidthMid.dispose(),this._twoTimesWidthMid=null,this._twoTimesWidthSide.dispose(),this._twoTimesWidthSide=null,this._oneMinusWidth.dispose(),this._oneMinusWidth=null,this},t.StereoWidener}),n(function(t){return t.Tremolo=function(){var e=t.defaults(arguments,["frequency","depth"],t.Tremolo);t.StereoEffect.call(this,e),this._lfoL=new t.LFO({phase:e.spread,min:1,max:0}),this._lfoR=new t.LFO({phase:e.spread,min:1,max:0}),this._amplitudeL=new t.Gain,this._amplitudeR=new t.Gain,this.frequency=new t.Signal(e.frequency,t.Type.Frequency),this.depth=new t.Signal(e.depth,t.Type.NormalRange),this._readOnly(["frequency","depth"]),this.effectSendL.chain(this._amplitudeL,this.effectReturnL),this.effectSendR.chain(this._amplitudeR,this.effectReturnR),this._lfoL.connect(this._amplitudeL.gain),this._lfoR.connect(this._amplitudeR.gain),this.frequency.fan(this._lfoL.frequency,this._lfoR.frequency),this.depth.fan(this._lfoR.amplitude,this._lfoL.amplitude),this.type=e.type,this.spread=e.spread},t.extend(t.Tremolo,t.StereoEffect),t.Tremolo.defaults={frequency:10,type:"sine",depth:.5,spread:180},t.Tremolo.prototype.start=function(t){return this._lfoL.start(t),this._lfoR.start(t),this},t.Tremolo.prototype.stop=function(t){return this._lfoL.stop(t),this._lfoR.stop(t),this},t.Tremolo.prototype.sync=function(e){return this._lfoL.sync(e),this._lfoR.sync(e),t.Transport.syncSignal(this.frequency),this},t.Tremolo.prototype.unsync=function(){return this._lfoL.unsync(),this._lfoR.unsync(),t.Transport.unsyncSignal(this.frequency),this},Object.defineProperty(t.Tremolo.prototype,"type",{get:function(){return this._lfoL.type},set:function(t){this._lfoL.type=t,this._lfoR.type=t}}),Object.defineProperty(t.Tremolo.prototype,"spread",{get:function(){return this._lfoR.phase-this._lfoL.phase},set:function(t){this._lfoL.phase=90-t/2,this._lfoR.phase=t/2+90}}),t.Tremolo.prototype.dispose=function(){return t.StereoEffect.prototype.dispose.call(this),this._writable(["frequency","depth"]),this._lfoL.dispose(),this._lfoL=null,this._lfoR.dispose(),this._lfoR=null,this._amplitudeL.dispose(),this._amplitudeL=null,this._amplitudeR.dispose(),this._amplitudeR=null,this.frequency=null,this.depth=null,this},t.Tremolo}),n(function(t){return t.Vibrato=function(){var e=t.defaults(arguments,["frequency","depth"],t.Vibrato);t.Effect.call(this,e),this._delayNode=new t.Delay(0,e.maxDelay),this._lfo=new t.LFO({type:e.type,min:0,max:e.maxDelay,frequency:e.frequency,phase:-90}).start().connect(this._delayNode.delayTime),this.frequency=this._lfo.frequency,this.depth=this._lfo.amplitude,this.depth.value=e.depth,this._readOnly(["frequency","depth"]),this.effectSend.chain(this._delayNode,this.effectReturn)},t.extend(t.Vibrato,t.Effect),t.Vibrato.defaults={maxDelay:.005,frequency:5,depth:.1,type:"sine"},Object.defineProperty(t.Vibrato.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),t.Vibrato.prototype.dispose=function(){t.Effect.prototype.dispose.call(this),this._delayNode.dispose(),this._delayNode=null,this._lfo.dispose(),this._lfo=null,this._writable(["frequency","depth"]),this.frequency=null,this.depth=null},t.Vibrato}),n(function(t){return t.Event=function(){var e=t.defaults(arguments,["callback","value"],t.Event);t.call(this),this._loop=e.loop,this.callback=e.callback,this.value=e.value,this._loopStart=this.toTicks(e.loopStart),this._loopEnd=this.toTicks(e.loopEnd),this._state=new t.TimelineState(t.State.Stopped),this._playbackRate=1,this._startOffset=0,this._probability=e.probability,this._humanize=e.humanize,this.mute=e.mute,this.playbackRate=e.playbackRate},t.extend(t.Event),t.Event.defaults={callback:t.noOp,loop:!1,loopEnd:"1m",loopStart:0,playbackRate:1,value:null,probability:1,mute:!1,humanize:!1},t.Event.prototype._rescheduleEvents=function(e){return e=t.defaultArg(e,-1),this._state.forEachFrom(e,function(e){var n;if(e.state===t.State.Started){t.isDefined(e.id)&&t.Transport.clear(e.id);var i=e.time+Math.round(this.startOffset/this._playbackRate);if(this._loop){n=1/0,t.isNumber(this._loop)&&(n=this._loop*this._getLoopDuration());var r=this._state.getAfter(i);null!==r&&(n=Math.min(n,r.time-i)),n!==1/0&&(this._state.setStateAtTime(t.State.Stopped,i+n+1),n=t.Ticks(n));var o=t.Ticks(this._getLoopDuration());e.id=t.Transport.scheduleRepeat(this._tick.bind(this),o,t.Ticks(i),n)}else e.id=t.Transport.schedule(this._tick.bind(this),t.Ticks(i))}}.bind(this)),this},Object.defineProperty(t.Event.prototype,"state",{get:function(){return this._state.getValueAtTime(t.Transport.ticks)}}),Object.defineProperty(t.Event.prototype,"startOffset",{get:function(){return this._startOffset},set:function(t){this._startOffset=t}}),Object.defineProperty(t.Event.prototype,"probability",{get:function(){return this._probability},set:function(t){this._probability=t}}),Object.defineProperty(t.Event.prototype,"humanize",{get:function(){return this._humanize},set:function(t){this._humanize=t}}),t.Event.prototype.start=function(e){return e=this.toTicks(e),this._state.getValueAtTime(e)===t.State.Stopped&&(this._state.add({state:t.State.Started,time:e,id:void 0}),this._rescheduleEvents(e)),this},t.Event.prototype.stop=function(e){if(this.cancel(e),e=this.toTicks(e),this._state.getValueAtTime(e)===t.State.Started){this._state.setStateAtTime(t.State.Stopped,e);var n=this._state.getBefore(e),i=e;null!==n&&(i=n.time),this._rescheduleEvents(i)}return this},t.Event.prototype.cancel=function(e){return e=t.defaultArg(e,-1/0),e=this.toTicks(e),this._state.forEachFrom(e,function(e){t.Transport.clear(e.id)}),this._state.cancel(e),this},t.Event.prototype._tick=function(e){var n=t.Transport.getTicksAtTime(e);if(!this.mute&&this._state.getValueAtTime(n)===t.State.Started){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){var i=.02;t.isBoolean(this.humanize)||(i=this.toSeconds(this.humanize)),e+=(2*Math.random()-1)*i}this.callback(e,this.value)}},t.Event.prototype._getLoopDuration=function(){return Math.round((this._loopEnd-this._loopStart)/this._playbackRate)},Object.defineProperty(t.Event.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this._rescheduleEvents()}}),Object.defineProperty(t.Event.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._rescheduleEvents()}}),Object.defineProperty(t.Event.prototype,"loopEnd",{get:function(){return t.Ticks(this._loopEnd).toSeconds()},set:function(t){this._loopEnd=this.toTicks(t),this._loop&&this._rescheduleEvents()}}),Object.defineProperty(t.Event.prototype,"loopStart",{get:function(){return t.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t),this._loop&&this._rescheduleEvents()}}),Object.defineProperty(t.Event.prototype,"progress",{get:function(){if(this._loop){var e=t.Transport.ticks,n=this._state.get(e);if(null!==n&&n.state===t.State.Started){var i=this._getLoopDuration();return(e-n.time)%i/i}return 0}return 0}}),t.Event.prototype.dispose=function(){this.cancel(),this._state.dispose(),this._state=null,this.callback=null,this.value=null},t.Event}),n(function(t){return t.Loop=function(){var e=t.defaults(arguments,["callback","interval"],t.Loop);t.call(this),this._event=new t.Event({callback:this._tick.bind(this),loop:!0,loopEnd:e.interval,playbackRate:e.playbackRate,probability:e.probability}),this.callback=e.callback,this.iterations=e.iterations},t.extend(t.Loop),t.Loop.defaults={interval:"4n",callback:t.noOp,playbackRate:1,iterations:1/0,probability:!0,mute:!1},t.Loop.prototype.start=function(t){return this._event.start(t),this},t.Loop.prototype.stop=function(t){return this._event.stop(t),this},t.Loop.prototype.cancel=function(t){return this._event.cancel(t),this},t.Loop.prototype._tick=function(t){this.callback(t)},Object.defineProperty(t.Loop.prototype,"state",{get:function(){return this._event.state}}),Object.defineProperty(t.Loop.prototype,"progress",{get:function(){return this._event.progress}}),Object.defineProperty(t.Loop.prototype,"interval",{get:function(){return this._event.loopEnd},set:function(t){this._event.loopEnd=t}}),Object.defineProperty(t.Loop.prototype,"playbackRate",{get:function(){return this._event.playbackRate},set:function(t){this._event.playbackRate=t}}),Object.defineProperty(t.Loop.prototype,"humanize",{get:function(){return this._event.humanize},set:function(t){this._event.humanize=t}}),Object.defineProperty(t.Loop.prototype,"probability",{get:function(){return this._event.probability},set:function(t){this._event.probability=t}}),Object.defineProperty(t.Loop.prototype,"mute",{get:function(){return this._event.mute},set:function(t){this._event.mute=t}}),Object.defineProperty(t.Loop.prototype,"iterations",{get:function(){return!0===this._event.loop?1/0:this._event.loop},set:function(t){this._event.loop=t===1/0||t}}),t.Loop.prototype.dispose=function(){this._event.dispose(),this._event=null,this.callback=null},t.Loop}),n(function(t){return t.Part=function(){var e=t.defaults(arguments,["callback","events"],t.Part);t.Event.call(this,e),this._events=[];for(var n=0;n<e.events.length;n++)Array.isArray(e.events[n])?this.add(e.events[n][0],e.events[n][1]):this.add(e.events[n])},t.extend(t.Part,t.Event),t.Part.defaults={callback:t.noOp,loop:!1,loopEnd:"1m",loopStart:0,playbackRate:1,probability:1,humanize:!1,mute:!1,events:[]},t.Part.prototype.start=function(e,n){var i=this.toTicks(e);return this._state.getValueAtTime(i)!==t.State.Started&&(n=this._loop?t.defaultArg(n,this._loopStart):t.defaultArg(n,0),n=this.toTicks(n),this._state.add({state:t.State.Started,time:i,offset:n}),this._forEach(function(t){this._startNote(t,i,n)})),this},t.Part.prototype._startNote=function(e,n,i){n-=i,this._loop?e.startOffset>=this._loopStart&&e.startOffset<this._loopEnd?(e.startOffset<i&&(n+=this._getLoopDuration()),e.start(t.Ticks(n))):e.startOffset<this._loopStart&&e.startOffset>=i&&(e.loop=!1,e.start(t.Ticks(n))):e.startOffset>=i&&e.start(t.Ticks(n))},Object.defineProperty(t.Part.prototype,"startOffset",{get:function(){return this._startOffset},set:function(t){this._startOffset=t,this._forEach(function(t){t.startOffset+=this._startOffset})}}),t.Part.prototype.stop=function(e){var n=this.toTicks(e);return this._state.cancel(n),this._state.setStateAtTime(t.State.Stopped,n),this._forEach(function(t){t.stop(e)}),this},t.Part.prototype.at=function(e,n){e=t.TransportTime(e);for(var i=t.Ticks(1).toSeconds(),r=0;r<this._events.length;r++){var o=this._events[r];if(Math.abs(e.toTicks()-o.startOffset)<i)return t.isDefined(n)&&(o.value=n),o}return t.isDefined(n)?(this.add(e,n),this._events[this._events.length-1]):null},t.Part.prototype.add=function(e,n){var i;return e.hasOwnProperty("time")&&(e=(n=e).time),e=this.toTicks(e),n instanceof t.Event?(i=n).callback=this._tick.bind(this):i=new t.Event({callback:this._tick.bind(this),value:n}),i.startOffset=e,i.set({loopEnd:this.loopEnd,loopStart:this.loopStart,loop:this.loop,humanize:this.humanize,playbackRate:this.playbackRate,probability:this.probability}),this._events.push(i),this._restartEvent(i),this},t.Part.prototype._restartEvent=function(e){this._state.forEach(function(n){n.state===t.State.Started?this._startNote(e,n.time,n.offset):e.stop(t.Ticks(n.time))}.bind(this))},t.Part.prototype.remove=function(e,n){e.hasOwnProperty("time")&&(e=(n=e).time),e=this.toTicks(e);for(var i=this._events.length-1;i>=0;i--){var r=this._events[i];r instanceof t.Part?r.remove(e,n):r.startOffset===e&&(t.isUndef(n)||t.isDefined(n)&&r.value===n)&&(this._events.splice(i,1),r.dispose())}return this},t.Part.prototype.removeAll=function(){return this._forEach(function(t){t.dispose()}),this._events=[],this},t.Part.prototype.cancel=function(t){return this._forEach(function(e){e.cancel(t)}),this._state.cancel(this.toTicks(t)),this},t.Part.prototype._forEach=function(e,n){if(this._events){n=t.defaultArg(n,this);for(var i=this._events.length-1;i>=0;i--){var r=this._events[i];r instanceof t.Part?r._forEach(e,n):e.call(n,r)}}return this},t.Part.prototype._setAll=function(t,e){this._forEach(function(n){n[t]=e})},t.Part.prototype._tick=function(t,e){this.mute||this.callback(t,e)},t.Part.prototype._testLoopBoundries=function(e){e.startOffset<this._loopStart||e.startOffset>=this._loopEnd?e.cancel(0):e.state===t.State.Stopped&&this._restartEvent(e)},Object.defineProperty(t.Part.prototype,"probability",{get:function(){return this._probability},set:function(t){this._probability=t,this._setAll("probability",t)}}),Object.defineProperty(t.Part.prototype,"humanize",{get:function(){return this._humanize},set:function(t){this._humanize=t,this._setAll("humanize",t)}}),Object.defineProperty(t.Part.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this._forEach(function(e){e._loopStart=this._loopStart,e._loopEnd=this._loopEnd,e.loop=t,this._testLoopBoundries(e)})}}),Object.defineProperty(t.Part.prototype,"loopEnd",{get:function(){return t.Ticks(this._loopEnd).toSeconds()},set:function(t){this._loopEnd=this.toTicks(t),this._loop&&this._forEach(function(e){e.loopEnd=t,this._testLoopBoundries(e)})}}),Object.defineProperty(t.Part.prototype,"loopStart",{get:function(){return t.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t),this._loop&&this._forEach(function(t){t.loopStart=this.loopStart,this._testLoopBoundries(t)})}}),Object.defineProperty(t.Part.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._setAll("playbackRate",t)}}),Object.defineProperty(t.Part.prototype,"length",{get:function(){return this._events.length}}),t.Part.prototype.dispose=function(){return this.removeAll(),this._state.dispose(),this._state=null,this.callback=null,this._events=null,this},t.Part}),n(function(t){return t.Pattern=function(){var e=t.defaults(arguments,["callback","values","pattern"],t.Pattern);t.Loop.call(this,e),this._pattern=new t.CtrlPattern({values:e.values,type:e.pattern,index:e.index})},t.extend(t.Pattern,t.Loop),t.Pattern.defaults={pattern:t.CtrlPattern.Type.Up,callback:t.noOp,values:[]},t.Pattern.prototype._tick=function(t){this.callback(t,this._pattern.value),this._pattern.next()},Object.defineProperty(t.Pattern.prototype,"index",{get:function(){return this._pattern.index},set:function(t){this._pattern.index=t}}),Object.defineProperty(t.Pattern.prototype,"values",{get:function(){return this._pattern.values},set:function(t){this._pattern.values=t}}),Object.defineProperty(t.Pattern.prototype,"value",{get:function(){return this._pattern.value}}),Object.defineProperty(t.Pattern.prototype,"pattern",{get:function(){return this._pattern.type},set:function(t){this._pattern.type=t}}),t.Pattern.prototype.dispose=function(){t.Loop.prototype.dispose.call(this),this._pattern.dispose(),this._pattern=null},t.Pattern}),n(function(t){return t.Sequence=function(){var e=t.defaults(arguments,["callback","events","subdivision"],t.Sequence),n=e.events;if(delete e.events,t.Part.call(this,e),this._subdivision=this.toTicks(e.subdivision),t.isUndef(e.loopEnd)&&t.isDefined(n)&&(this._loopEnd=n.length*this._subdivision),this._loop=!0,t.isDefined(n))for(var i=0;i<n.length;i++)this.add(i,n[i])},t.extend(t.Sequence,t.Part),t.Sequence.defaults={subdivision:"4n"},Object.defineProperty(t.Sequence.prototype,"subdivision",{get:function(){return t.Ticks(this._subdivision).toSeconds()}}),t.Sequence.prototype.at=function(e,n){return t.isArray(n)&&this.remove(e),t.Part.prototype.at.call(this,this._indexTime(e),n)},t.Sequence.prototype.add=function(e,n){if(null===n)return this;if(t.isArray(n)){var i=Math.round(this._subdivision/n.length);n=new t.Sequence(this._tick.bind(this),n,t.Ticks(i))}return t.Part.prototype.add.call(this,this._indexTime(e),n),this},t.Sequence.prototype.remove=function(e,n){return t.Part.prototype.remove.call(this,this._indexTime(e),n),this},t.Sequence.prototype._indexTime=function(e){return e instanceof t.TransportTime?e:t.Ticks(e*this._subdivision+this.startOffset).toSeconds()},t.Sequence.prototype.dispose=function(){return t.Part.prototype.dispose.call(this),this},t.Sequence}),n(function(t){return t.PulseOscillator=function(){var e=t.defaults(arguments,["frequency","width"],t.Oscillator);t.Source.call(this,e),this.width=new t.Signal(e.width,t.Type.NormalRange),this._widthGate=new t.Gain,this._sawtooth=new t.Oscillator({frequency:e.frequency,detune:e.detune,type:"sawtooth",phase:e.phase}),this.frequency=this._sawtooth.frequency,this.detune=this._sawtooth.detune,this._thresh=new t.WaveShaper(function(t){return t<0?-1:1}),this._sawtooth.chain(this._thresh,this.output),this.width.chain(this._widthGate,this._thresh),this._readOnly(["width","frequency","detune"])},t.extend(t.PulseOscillator,t.Source),t.PulseOscillator.defaults={frequency:440,detune:0,phase:0,width:.2},t.PulseOscillator.prototype._start=function(t){t=this.toSeconds(t),this._sawtooth.start(t),this._widthGate.gain.setValueAtTime(1,t)},t.PulseOscillator.prototype._stop=function(t){t=this.toSeconds(t),this._sawtooth.stop(t),this._widthGate.gain.setValueAtTime(0,t)},t.PulseOscillator.prototype.restart=function(t){this._sawtooth.restart(t)},Object.defineProperty(t.PulseOscillator.prototype,"phase",{get:function(){return this._sawtooth.phase},set:function(t){this._sawtooth.phase=t}}),Object.defineProperty(t.PulseOscillator.prototype,"type",{get:function(){return"pulse"}}),Object.defineProperty(t.PulseOscillator.prototype,"partials",{get:function(){return[]}}),t.PulseOscillator.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),this._sawtooth.dispose(),this._sawtooth=null,this._writable(["width","frequency","detune"]),this.width.dispose(),this.width=null,this._widthGate.dispose(),this._widthGate=null,this._thresh.dispose(),this._thresh=null,this.frequency=null,this.detune=null,this},t.PulseOscillator}),n(function(t){return t.PWMOscillator=function(){var e=t.defaults(arguments,["frequency","modulationFrequency"],t.PWMOscillator);t.Source.call(this,e),this._pulse=new t.PulseOscillator(e.modulationFrequency),this._pulse._sawtooth.type="sine",this._modulator=new t.Oscillator({frequency:e.frequency,detune:e.detune,phase:e.phase}),this._scale=new t.Multiply(2),this.frequency=this._modulator.frequency,this.detune=this._modulator.detune,this.modulationFrequency=this._pulse.frequency,this._modulator.chain(this._scale,this._pulse.width),this._pulse.connect(this.output),this._readOnly(["modulationFrequency","frequency","detune"])},t.extend(t.PWMOscillator,t.Source),t.PWMOscillator.defaults={frequency:440,detune:0,phase:0,modulationFrequency:.4},t.PWMOscillator.prototype._start=function(t){t=this.toSeconds(t),this._modulator.start(t),this._pulse.start(t)},t.PWMOscillator.prototype._stop=function(t){t=this.toSeconds(t),this._modulator.stop(t),this._pulse.stop(t)},t.PWMOscillator.prototype.restart=function(t){this._modulator.restart(t),this._pulse.restart(t)},Object.defineProperty(t.PWMOscillator.prototype,"type",{get:function(){return"pwm"}}),Object.defineProperty(t.PWMOscillator.prototype,"partials",{get:function(){return[]}}),Object.defineProperty(t.PWMOscillator.prototype,"phase",{get:function(){return this._modulator.phase},set:function(t){this._modulator.phase=t}}),t.PWMOscillator.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),this._pulse.dispose(),this._pulse=null,this._scale.dispose(),this._scale=null,this._modulator.dispose(),this._modulator=null,this._writable(["modulationFrequency","frequency","detune"]),this.frequency=null,this.detune=null,this.modulationFrequency=null,this},t.PWMOscillator}),n(function(t){return t.FMOscillator=function(){var e=t.defaults(arguments,["frequency","type","modulationType"],t.FMOscillator);t.Source.call(this,e),this._carrier=new t.Oscillator(e.frequency,e.type),this.frequency=new t.Signal(e.frequency,t.Type.Frequency),this.detune=this._carrier.detune,this.detune.value=e.detune,this.modulationIndex=new t.Multiply(e.modulationIndex),this.modulationIndex.units=t.Type.Positive,this._modulator=new t.Oscillator(e.frequency,e.modulationType),this.harmonicity=new t.Multiply(e.harmonicity),this.harmonicity.units=t.Type.Positive,this._modulationNode=new t.Gain(0),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this.detune.connect(this._modulator.detune),this.phase=e.phase,this._readOnly(["modulationIndex","frequency","detune","harmonicity"])},t.extend(t.FMOscillator,t.Source),t.FMOscillator.defaults={frequency:440,detune:0,phase:0,modulationIndex:2,modulationType:"square",harmonicity:1},t.FMOscillator.prototype._start=function(t){this._modulator.start(t),this._carrier.start(t)},t.FMOscillator.prototype._stop=function(t){this._modulator.stop(t),this._carrier.stop(t)},t.FMOscillator.prototype.restart=function(t){this._modulator.restart(t),this._carrier.restart(t)},Object.defineProperty(t.FMOscillator.prototype,"type",{get:function(){return this._carrier.type},set:function(t){this._carrier.type=t}}),Object.defineProperty(t.FMOscillator.prototype,"modulationType",{get:function(){return this._modulator.type},set:function(t){this._modulator.type=t}}),Object.defineProperty(t.FMOscillator.prototype,"phase",{get:function(){return this._carrier.phase},set:function(t){this._carrier.phase=t,this._modulator.phase=t}}),Object.defineProperty(t.FMOscillator.prototype,"partials",{get:function(){return this._carrier.partials},set:function(t){this._carrier.partials=t}}),t.FMOscillator.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),this._writable(["modulationIndex","frequency","detune","harmonicity"]),this.frequency.dispose(),this.frequency=null,this.detune=null,this.harmonicity.dispose(),this.harmonicity=null,this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this._modulationNode.dispose(),this._modulationNode=null,this.modulationIndex.dispose(),this.modulationIndex=null,this},t.FMOscillator}),n(function(t){return t.AMOscillator=function(){var e=t.defaults(arguments,["frequency","type","modulationType"],t.AMOscillator);t.Source.call(this,e),this._carrier=new t.Oscillator(e.frequency,e.type),this.frequency=this._carrier.frequency,this.detune=this._carrier.detune,this.detune.value=e.detune,this._modulator=new t.Oscillator(e.frequency,e.modulationType),this._modulationScale=new t.AudioToGain,this.harmonicity=new t.Multiply(e.harmonicity),this.harmonicity.units=t.Type.Positive,this._modulationNode=new t.Gain(0),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.connect(this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),this.phase=e.phase,this._readOnly(["frequency","detune","harmonicity"])},t.extend(t.AMOscillator,t.Oscillator),t.AMOscillator.defaults={frequency:440,detune:0,phase:0,modulationType:"square",harmonicity:1},t.AMOscillator.prototype._start=function(t){this._modulator.start(t),this._carrier.start(t)},t.AMOscillator.prototype._stop=function(t){this._modulator.stop(t),this._carrier.stop(t)},t.AMOscillator.prototype.restart=function(t){this._modulator.restart(t),this._carrier.restart(t)},Object.defineProperty(t.AMOscillator.prototype,"type",{get:function(){return this._carrier.type},set:function(t){this._carrier.type=t}}),Object.defineProperty(t.AMOscillator.prototype,"modulationType",{get:function(){return this._modulator.type},set:function(t){this._modulator.type=t}}),Object.defineProperty(t.AMOscillator.prototype,"phase",{get:function(){return this._carrier.phase},set:function(t){this._carrier.phase=t,this._modulator.phase=t}}),Object.defineProperty(t.AMOscillator.prototype,"partials",{get:function(){return this._carrier.partials},set:function(t){this._carrier.partials=t}}),t.AMOscillator.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),this._writable(["frequency","detune","harmonicity"]),this.frequency=null,this.detune=null,this.harmonicity.dispose(),this.harmonicity=null,this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this._modulationNode.dispose(),this._modulationNode=null,this._modulationScale.dispose(),this._modulationScale=null,this},t.AMOscillator}),n(function(t){return t.FatOscillator=function(){var e=t.defaults(arguments,["frequency","type","spread"],t.FatOscillator);t.Source.call(this,e),this.frequency=new t.Signal(e.frequency,t.Type.Frequency),this.detune=new t.Signal(e.detune,t.Type.Cents),this._oscillators=[],this._spread=e.spread,this._type=e.type,this._phase=e.phase,this._partials=t.defaultArg(e.partials,[]),this.count=e.count,this._readOnly(["frequency","detune"])},t.extend(t.FatOscillator,t.Source),t.FatOscillator.defaults={frequency:440,detune:0,phase:0,spread:20,count:3,type:"sawtooth"},t.FatOscillator.prototype._start=function(t){t=this.toSeconds(t),this._forEach(function(e){e.start(t)})},t.FatOscillator.prototype._stop=function(t){t=this.toSeconds(t),this._forEach(function(e){e.stop(t)})},t.FatOscillator.prototype.restart=function(t){t=this.toSeconds(t),this._forEach(function(e){e.restart(t)})},t.FatOscillator.prototype._forEach=function(t){for(var e=0;e<this._oscillators.length;e++)t.call(this,this._oscillators[e],e)},Object.defineProperty(t.FatOscillator.prototype,"type",{get:function(){return this._type},set:function(t){this._type=t,this._forEach(function(e){e.type=t})}}),Object.defineProperty(t.FatOscillator.prototype,"spread",{get:function(){return this._spread},set:function(t){if(this._spread=t,this._oscillators.length>1){var e=-t/2,n=t/(this._oscillators.length-1);this._forEach(function(t,i){t.detune.value=e+n*i})}}}),Object.defineProperty(t.FatOscillator.prototype,"count",{get:function(){return this._oscillators.length},set:function(e){if(e=Math.max(e,1),this._oscillators.length!==e){this._forEach(function(t){t.dispose()}),this._oscillators=[];for(var n=0;n<e;n++){var i=new t.Oscillator;this.type===t.Oscillator.Type.Custom?i.partials=this._partials:i.type=this._type,i.phase=this._phase,i.volume.value=-6-1.1*e,this.frequency.connect(i.frequency),this.detune.connect(i.detune),i.connect(this.output),this._oscillators[n]=i}this.spread=this._spread,this.state===t.State.Started&&this._forEach(function(t){t.start()})}}}),Object.defineProperty(t.FatOscillator.prototype,"phase",{get:function(){return this._phase},set:function(t){this._phase=t,this._forEach(function(e){e.phase=t})}}),Object.defineProperty(t.FatOscillator.prototype,"partials",{get:function(){return this._partials},set:function(e){this._partials=e,this._type=t.Oscillator.Type.Custom,this._forEach(function(t){t.partials=e})}}),t.FatOscillator.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),this._writable(["frequency","detune"]),this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this._forEach(function(t){t.dispose()}),this._oscillators=null,this._partials=null,this},t.FatOscillator}),n(function(t){t.OmniOscillator=function(){var e=t.defaults(arguments,["frequency","type"],t.OmniOscillator);t.Source.call(this,e),this.frequency=new t.Signal(e.frequency,t.Type.Frequency),this.detune=new t.Signal(e.detune,t.Type.Cents),this._sourceType=void 0,this._oscillator=null,this.type=e.type,this._readOnly(["frequency","detune"]),this.set(e)},t.extend(t.OmniOscillator,t.Source),t.OmniOscillator.defaults={frequency:440,detune:0,type:"sine",phase:0};var e="PulseOscillator",n="PWMOscillator",i="Oscillator",r="FMOscillator",o="AMOscillator",s="FatOscillator";return t.OmniOscillator.prototype._start=function(t){this._oscillator.start(t)},t.OmniOscillator.prototype._stop=function(t){this._oscillator.stop(t)},t.OmniOscillator.prototype.restart=function(t){this._oscillator.restart(t)},Object.defineProperty(t.OmniOscillator.prototype,"type",{get:function(){var t="";return this._sourceType===r?t="fm":this._sourceType===o?t="am":this._sourceType===s&&(t="fat"),t+this._oscillator.type},set:function(t){"fm"===t.substr(0,2)?(this._createNewOscillator(r),this._oscillator.type=t.substr(2)):"am"===t.substr(0,2)?(this._createNewOscillator(o),this._oscillator.type=t.substr(2)):"fat"===t.substr(0,3)?(this._createNewOscillator(s),this._oscillator.type=t.substr(3)):"pwm"===t?this._createNewOscillator(n):"pulse"===t?this._createNewOscillator(e):(this._createNewOscillator(i),this._oscillator.type=t)}}),Object.defineProperty(t.OmniOscillator.prototype,"partials",{get:function(){return this._oscillator.partials},set:function(t){this._oscillator.partials=t}}),t.OmniOscillator.prototype.set=function(e,n){return"type"===e?this.type=n:t.isObject(e)&&e.hasOwnProperty("type")&&(this.type=e.type),t.prototype.set.apply(this,arguments),this},t.OmniOscillator.prototype._createNewOscillator=function(e){if(e!==this._sourceType){this._sourceType=e;var n=t[e],i=this.now();if(null!==this._oscillator){var r=this._oscillator;r.stop(i),this.context.setTimeout(function(){r.dispose(),r=null},this.blockTime)}this._oscillator=new n,this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),this._oscillator.connect(this.output),this.state===t.State.Started&&this._oscillator.start(i)}},Object.defineProperty(t.OmniOscillator.prototype,"phase",{get:function(){return this._oscillator.phase},set:function(t){this._oscillator.phase=t}}),Object.defineProperty(t.OmniOscillator.prototype,"width",{get:function(){if(this._sourceType===e)return this._oscillator.width}}),Object.defineProperty(t.OmniOscillator.prototype,"count",{get:function(){if(this._sourceType===s)return this._oscillator.count},set:function(t){this._sourceType===s&&(this._oscillator.count=t)}}),Object.defineProperty(t.OmniOscillator.prototype,"spread",{get:function(){if(this._sourceType===s)return this._oscillator.spread},set:function(t){this._sourceType===s&&(this._oscillator.spread=t)}}),Object.defineProperty(t.OmniOscillator.prototype,"modulationType",{get:function(){if(this._sourceType===r||this._sourceType===o)return this._oscillator.modulationType},set:function(t){this._sourceType!==r&&this._sourceType!==o||(this._oscillator.modulationType=t)}}),Object.defineProperty(t.OmniOscillator.prototype,"modulationIndex",{get:function(){if(this._sourceType===r)return this._oscillator.modulationIndex}}),Object.defineProperty(t.OmniOscillator.prototype,"harmonicity",{get:function(){if(this._sourceType===r||this._sourceType===o)return this._oscillator.harmonicity}}),Object.defineProperty(t.OmniOscillator.prototype,"modulationFrequency",{get:function(){if(this._sourceType===n)return this._oscillator.modulationFrequency}}),t.OmniOscillator.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),this._writable(["frequency","detune"]),this.detune.dispose(),this.detune=null,this.frequency.dispose(),this.frequency=null,this._oscillator.dispose(),this._oscillator=null,this._sourceType=null,this},t.OmniOscillator}),n(function(t){return t.Instrument=function(e){e=t.defaultArg(e,t.Instrument.defaults),t.AudioNode.call(this),this._volume=this.output=new t.Volume(e.volume),this.volume=this._volume.volume,this._readOnly("volume"),this._scheduledEvents=[]},t.extend(t.Instrument,t.AudioNode),t.Instrument.defaults={volume:0},t.Instrument.prototype.triggerAttack=t.noOp,t.Instrument.prototype.triggerRelease=t.noOp,t.Instrument.prototype.sync=function(){return this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",0),this},t.Instrument.prototype._syncMethod=function(e,n){var i=this["_original_"+e]=this[e];this[e]=function(){var e=Array.prototype.slice.call(arguments),r=e[n],o=t.Transport.schedule(function(t){e[n]=t,i.apply(this,e)}.bind(this),r);this._scheduledEvents.push(o)}.bind(this)},t.Instrument.prototype.unsync=function(){return this._scheduledEvents.forEach(function(e){t.Transport.clear(e)}),this._scheduledEvents=[],this._original_triggerAttack&&(this.triggerAttack=this._original_triggerAttack,this.triggerRelease=this._original_triggerRelease),this},t.Instrument.prototype.triggerAttackRelease=function(t,e,n,i){return n=this.toSeconds(n),e=this.toSeconds(e),this.triggerAttack(t,n,i),this.triggerRelease(n+e),this},t.Instrument.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._volume.dispose(),this._volume=null,this._writable(["volume"]),this.volume=null,this.unsync(),this._scheduledEvents=null,this},t.Instrument}),n(function(t){return t.Monophonic=function(e){e=t.defaultArg(e,t.Monophonic.defaults),t.Instrument.call(this,e),this.portamento=e.portamento},t.extend(t.Monophonic,t.Instrument),t.Monophonic.defaults={portamento:0},t.Monophonic.prototype.triggerAttack=function(t,e,n){return e=this.toSeconds(e),this._triggerEnvelopeAttack(e,n),this.setNote(t,e),this},t.Monophonic.prototype.triggerRelease=function(t){return t=this.toSeconds(t),this._triggerEnvelopeRelease(t),this},t.Monophonic.prototype._triggerEnvelopeAttack=function(){},t.Monophonic.prototype._triggerEnvelopeRelease=function(){},t.Monophonic.prototype.getLevelAtTime=function(t){return t=this.toSeconds(t),this.envelope.getValueAtTime(t)},t.Monophonic.prototype.setNote=function(t,e){if(e=this.toSeconds(e),this.portamento>0&&this.getLevelAtTime(e)>.05){var n=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(t,n,e)}else this.frequency.setValueAtTime(t,e);return this},t.Monophonic}),n(function(t){return t.Synth=function(e){e=t.defaultArg(e,t.Synth.defaults),t.Monophonic.call(this,e),this.oscillator=new t.OmniOscillator(e.oscillator),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new t.AmplitudeEnvelope(e.envelope),this.oscillator.chain(this.envelope,this.output),this._readOnly(["oscillator","frequency","detune","envelope"])},t.extend(t.Synth,t.Monophonic),t.Synth.defaults={oscillator:{type:"triangle"},envelope:{attack:.005,decay:.1,sustain:.3,release:1}},t.Synth.prototype._triggerEnvelopeAttack=function(t,e){return this.envelope.triggerAttack(t,e),this.oscillator.start(t),0===this.envelope.sustain&&this.oscillator.stop(t+this.envelope.attack+this.envelope.decay),this},t.Synth.prototype._triggerEnvelopeRelease=function(t){return t=this.toSeconds(t),this.envelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},t.Synth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["oscillator","frequency","detune","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this.frequency=null,this.detune=null,this},t.Synth}),n(function(t){return t.AMSynth=function(e){e=t.defaultArg(e,t.AMSynth.defaults),t.Monophonic.call(this,e),this._carrier=new t.Synth,this._carrier.volume.value=-10,this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope.set(e.envelope),this._modulator=new t.Synth,this._modulator.volume.value=-10,this.modulation=this._modulator.oscillator.set(e.modulation),this.modulationEnvelope=this._modulator.envelope.set(e.modulationEnvelope),this.frequency=new t.Signal(440,t.Type.Frequency),this.detune=new t.Signal(e.detune,t.Type.Cents),this.harmonicity=new t.Multiply(e.harmonicity),this.harmonicity.units=t.Type.Positive,this._modulationScale=new t.AudioToGain,this._modulationNode=new t.Gain,this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),this._readOnly(["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])},t.extend(t.AMSynth,t.Monophonic),t.AMSynth.defaults={harmonicity:3,detune:0,oscillator:{type:"sine"},envelope:{attack:.01,decay:.01,sustain:1,release:.5},modulation:{type:"square"},modulationEnvelope:{attack:.5,decay:0,sustain:1,release:.5}},t.AMSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this._carrier._triggerEnvelopeAttack(t,e),this._modulator._triggerEnvelopeAttack(t),this},t.AMSynth.prototype._triggerEnvelopeRelease=function(t){return this._carrier._triggerEnvelopeRelease(t),this._modulator._triggerEnvelopeRelease(t),this},t.AMSynth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"]),this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this.harmonicity.dispose(),this.harmonicity=null,this._modulationScale.dispose(),this._modulationScale=null,this._modulationNode.dispose(),this._modulationNode=null,this.oscillator=null,this.envelope=null,this.modulationEnvelope=null,this.modulation=null,this},t.AMSynth}),n(function(t){return t.MonoSynth=function(e){e=t.defaultArg(e,t.MonoSynth.defaults),t.Monophonic.call(this,e),this.oscillator=new t.OmniOscillator(e.oscillator),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new t.Filter(e.filter),this.filterEnvelope=new t.FrequencyEnvelope(e.filterEnvelope),this.envelope=new t.AmplitudeEnvelope(e.envelope),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),this._readOnly(["oscillator","frequency","detune","filter","filterEnvelope","envelope"])},t.extend(t.MonoSynth,t.Monophonic),t.MonoSynth.defaults={frequency:"C4",detune:0,oscillator:{type:"square"},filter:{Q:6,type:"lowpass",rolloff:-24},envelope:{attack:.005,decay:.1,sustain:.9,release:1},filterEnvelope:{attack:.06,decay:.2,sustain:.5,release:2,baseFrequency:200,octaves:7,exponent:2}},t.MonoSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this.envelope.triggerAttack(t,e),this.filterEnvelope.triggerAttack(t),this.oscillator.start(t),0===this.envelope.sustain&&this.oscillator.stop(t+this.envelope.attack+this.envelope.decay),this},t.MonoSynth.prototype._triggerEnvelopeRelease=function(t){return this.envelope.triggerRelease(t),this.filterEnvelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},t.MonoSynth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["oscillator","frequency","detune","filter","filterEnvelope","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this.filterEnvelope.dispose(),this.filterEnvelope=null,this.filter.dispose(),this.filter=null,this.frequency=null,this.detune=null,this},t.MonoSynth}),n(function(t){return t.DuoSynth=function(e){e=t.defaultArg(e,t.DuoSynth.defaults),t.Monophonic.call(this,e),this.voice0=new t.MonoSynth(e.voice0),this.voice0.volume.value=-10,this.voice1=new t.MonoSynth(e.voice1),this.voice1.volume.value=-10,this._vibrato=new t.LFO(e.vibratoRate,-50,50),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new t.Gain(e.vibratoAmount,t.Type.Positive),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new t.Signal(440,t.Type.Frequency),this.harmonicity=new t.Multiply(e.harmonicity),this.harmonicity.units=t.Type.Positive,this.frequency.connect(this.voice0.frequency),this.frequency.chain(this.harmonicity,this.voice1.frequency),this._vibrato.connect(this._vibratoGain),this._vibratoGain.fan(this.voice0.detune,this.voice1.detune),this.voice0.connect(this.output),this.voice1.connect(this.output),this._readOnly(["voice0","voice1","frequency","vibratoAmount","vibratoRate"])},t.extend(t.DuoSynth,t.Monophonic),t.DuoSynth.defaults={vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:{volume:-10,portamento:0,oscillator:{type:"sine"},filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}},voice1:{volume:-10,portamento:0,oscillator:{type:"sine"},filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}},t.DuoSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this.voice0._triggerEnvelopeAttack(t,e),this.voice1._triggerEnvelopeAttack(t,e),this},t.DuoSynth.prototype._triggerEnvelopeRelease=function(t){return this.voice0._triggerEnvelopeRelease(t),this.voice1._triggerEnvelopeRelease(t),this},t.DuoSynth.prototype.getLevelAtTime=function(t){return(this.voice0.getLevelAtTime(t)+this.voice1.getLevelAtTime(t))/2},t.DuoSynth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["voice0","voice1","frequency","vibratoAmount","vibratoRate"]),this.voice0.dispose(),this.voice0=null,this.voice1.dispose(),this.voice1=null,this.frequency.dispose(),this.frequency=null,this._vibratoGain.dispose(),this._vibratoGain=null,this._vibrato=null,this.harmonicity.dispose(),this.harmonicity=null,this.vibratoAmount.dispose(),this.vibratoAmount=null,this.vibratoRate=null,this},t.DuoSynth}),n(function(t){return t.FMSynth=function(e){e=t.defaultArg(e,t.FMSynth.defaults),t.Monophonic.call(this,e),this._carrier=new t.Synth(e.carrier),this._carrier.volume.value=-10,this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope.set(e.envelope),this._modulator=new t.Synth(e.modulator),this._modulator.volume.value=-10,this.modulation=this._modulator.oscillator.set(e.modulation),this.modulationEnvelope=this._modulator.envelope.set(e.modulationEnvelope),this.frequency=new t.Signal(440,t.Type.Frequency),this.detune=new t.Signal(e.detune,t.Type.Cents),this.harmonicity=new t.Multiply(e.harmonicity),this.harmonicity.units=t.Type.Positive,this.modulationIndex=new t.Multiply(e.modulationIndex),this.modulationIndex.units=t.Type.Positive,this._modulationNode=new t.Gain(0),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this._readOnly(["frequency","harmonicity","modulationIndex","oscillator","envelope","modulation","modulationEnvelope","detune"])},t.extend(t.FMSynth,t.Monophonic),t.FMSynth.defaults={harmonicity:3,modulationIndex:10,detune:0,oscillator:{type:"sine"},envelope:{attack:.01,decay:.01,sustain:1,release:.5},modulation:{type:"square"},modulationEnvelope:{attack:.5,decay:0,sustain:1,release:.5}},t.FMSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this._carrier._triggerEnvelopeAttack(t,e),this._modulator._triggerEnvelopeAttack(t),this},t.FMSynth.prototype._triggerEnvelopeRelease=function(t){return t=this.toSeconds(t),this._carrier._triggerEnvelopeRelease(t),this._modulator._triggerEnvelopeRelease(t),this},t.FMSynth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["frequency","harmonicity","modulationIndex","oscillator","envelope","modulation","modulationEnvelope","detune"]),this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this.modulationIndex.dispose(),this.modulationIndex=null,this.harmonicity.dispose(),this.harmonicity=null,this._modulationNode.dispose(),this._modulationNode=null,this.oscillator=null,this.envelope=null,this.modulationEnvelope=null,this.modulation=null,this},t.FMSynth}),n(function(t){return t.MembraneSynth=function(e){e=t.defaultArg(e,t.MembraneSynth.defaults),t.Instrument.call(this,e),this.oscillator=new t.OmniOscillator(e.oscillator),this.envelope=new t.AmplitudeEnvelope(e.envelope),this.octaves=e.octaves,this.pitchDecay=e.pitchDecay,this.oscillator.chain(this.envelope,this.output),this._readOnly(["oscillator","envelope"])},t.extend(t.MembraneSynth,t.Instrument),t.MembraneSynth.defaults={pitchDecay:.05,octaves:10,oscillator:{type:"sine"},envelope:{attack:.001,decay:.4,sustain:.01,release:1.4,attackCurve:"exponential"}},t.MembraneSynth.prototype.triggerAttack=function(t,e,n){e=this.toSeconds(e);var i=(t=this.toFrequency(t))*this.octaves;return this.oscillator.frequency.setValueAtTime(i,e),this.oscillator.frequency.exponentialRampToValueAtTime(t,e+this.toSeconds(this.pitchDecay)),this.envelope.triggerAttack(e,n),this.oscillator.start(e),this},t.MembraneSynth.prototype.triggerRelease=function(t){return t=this.toSeconds(t),this.envelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},t.MembraneSynth.prototype.dispose=function(){return t.Instrument.prototype.dispose.call(this),this._writable(["oscillator","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this},t.MembraneSynth}),n(function(t){var e=[1,1.483,1.932,2.546,2.63,3.897];return t.MetalSynth=function(n){n=t.defaultArg(n,t.MetalSynth.defaults),t.Instrument.call(this,n),this.frequency=new t.Signal(n.frequency,t.Type.Frequency),this._oscillators=[],this._freqMultipliers=[],this._amplitue=new t.Gain(0).connect(this.output),this._highpass=new t.Filter({type:"highpass",Q:-3.0102999566398125}).connect(this._amplitue),this._octaves=n.octaves,this._filterFreqScaler=new t.Scale(n.resonance,7e3),this.envelope=new t.Envelope({attack:n.envelope.attack,attackCurve:"linear",decay:n.envelope.decay,sustain:0,release:n.envelope.release}).chain(this._filterFreqScaler,this._highpass.frequency),this.envelope.connect(this._amplitue.gain);for(var i=0;i<e.length;i++){var r=new t.FMOscillator({type:"square",modulationType:"square",harmonicity:n.harmonicity,modulationIndex:n.modulationIndex});r.connect(this._highpass),this._oscillators[i]=r;var o=new t.Multiply(e[i]);this._freqMultipliers[i]=o,this.frequency.chain(o,r.frequency)}this.octaves=n.octaves},t.extend(t.MetalSynth,t.Instrument),t.MetalSynth.defaults={frequency:200,envelope:{attack:.001,decay:1.4,release:.2},harmonicity:5.1,modulationIndex:32,resonance:4e3,octaves:1.5},t.MetalSynth.prototype.triggerAttack=function(e,n){return e=this.toSeconds(e),n=t.defaultArg(n,1),this.envelope.triggerAttack(e,n),this._oscillators.forEach(function(t){t.start(e)}),0===this.envelope.sustain&&this._oscillators.forEach(function(t){t.stop(e+this.envelope.attack+this.envelope.decay)}.bind(this)),this},t.MetalSynth.prototype.triggerRelease=function(t){return t=this.toSeconds(t),this.envelope.triggerRelease(t),this._oscillators.forEach(function(e){e.stop(t+this.envelope.release)}.bind(this)),this},t.MetalSynth.prototype.sync=function(){return this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0),this},t.MetalSynth.prototype.triggerAttackRelease=function(t,e,n){return e=this.toSeconds(e),t=this.toSeconds(t),this.triggerAttack(e,n),this.triggerRelease(e+t),this},Object.defineProperty(t.MetalSynth.prototype,"modulationIndex",{get:function(){return this._oscillators[0].modulationIndex.value},set:function(t){for(var e=0;e<this._oscillators.length;e++)this._oscillators[e].modulationIndex.value=t}}),Object.defineProperty(t.MetalSynth.prototype,"harmonicity",{get:function(){return this._oscillators[0].harmonicity.value},set:function(t){for(var e=0;e<this._oscillators.length;e++)this._oscillators[e].harmonicity.value=t}}),Object.defineProperty(t.MetalSynth.prototype,"resonance",{get:function(){return this._filterFreqScaler.min},set:function(t){this._filterFreqScaler.min=t,this.octaves=this._octaves}}),Object.defineProperty(t.MetalSynth.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._filterFreqScaler.max=this._filterFreqScaler.min*Math.pow(2,t)}}),t.MetalSynth.prototype.dispose=function(){t.Instrument.prototype.dispose.call(this);for(var e=0;e<this._oscillators.length;e++)this._oscillators[e].dispose(),this._freqMultipliers[e].dispose();this._oscillators=null,this._freqMultipliers=null,this.frequency.dispose(),this.frequency=null,this._filterFreqScaler.dispose(),this._filterFreqScaler=null,this._amplitue.dispose(),this._amplitue=null,this.envelope.dispose(),this.envelope=null,this._highpass.dispose(),this._highpass=null},t.MetalSynth}),n(function(t){return t.NoiseSynth=function(e){e=t.defaultArg(e,t.NoiseSynth.defaults),t.Instrument.call(this,e),this.noise=new t.Noise,this.envelope=new t.AmplitudeEnvelope(e.envelope),this.noise.chain(this.envelope,this.output),this._readOnly(["noise","envelope"])},t.extend(t.NoiseSynth,t.Instrument),t.NoiseSynth.defaults={noise:{type:"white"},envelope:{attack:.005,decay:.1,sustain:0}},t.NoiseSynth.prototype.triggerAttack=function(t,e){return this.envelope.triggerAttack(t,e),this.noise.start(t),0===this.envelope.sustain&&this.noise.stop(t=this.envelope.attack+this.envelope.decay),this},t.NoiseSynth.prototype.triggerRelease=function(t){return this.envelope.triggerRelease(t),this.noise.stop(t+this.envelope.release),this},t.NoiseSynth.prototype.sync=function(){return this._syncMethod("triggerAttack",0),this._syncMethod("triggerRelease",0),this},t.NoiseSynth.prototype.triggerAttackRelease=function(t,e,n){return e=this.toSeconds(e),t=this.toSeconds(t),this.triggerAttack(e,n),this.triggerRelease(e+t),this},t.NoiseSynth.prototype.dispose=function(){return t.Instrument.prototype.dispose.call(this),this._writable(["noise","envelope"]),this.noise.dispose(),this.noise=null,this.envelope.dispose(),this.envelope=null,this},t.NoiseSynth}),n(function(t){return t.PluckSynth=function(e){e=t.defaultArg(e,t.PluckSynth.defaults),t.Instrument.call(this,e),this._noise=new t.Noise("pink"),this.attackNoise=e.attackNoise,this._lfcf=new t.LowpassCombFilter({resonance:e.resonance,dampening:e.dampening}),this.resonance=this._lfcf.resonance,this.dampening=this._lfcf.dampening,this._noise.connect(this._lfcf),this._lfcf.connect(this.output),this._readOnly(["resonance","dampening"])},t.extend(t.PluckSynth,t.Instrument),t.PluckSynth.defaults={attackNoise:1,dampening:4e3,resonance:.7},t.PluckSynth.prototype.triggerAttack=function(t,e){t=this.toFrequency(t),e=this.toSeconds(e);var n=1/t;return this._lfcf.delayTime.setValueAtTime(n,e),this._noise.start(e),this._noise.stop(e+n*this.attackNoise),this},t.PluckSynth.prototype.dispose=function(){return t.Instrument.prototype.dispose.call(this),this._noise.dispose(),this._lfcf.dispose(),this._noise=null,this._lfcf=null,this._writable(["resonance","dampening"]),this.dampening=null,this.resonance=null,this},t.PluckSynth}),n(function(t){return t.PolySynth=function(){var e=t.defaults(arguments,["polyphony","voice"],t.PolySynth);t.Instrument.call(this,e),(e=t.defaultArg(e,t.Instrument.defaults)).polyphony=Math.min(t.PolySynth.MAX_POLYPHONY,e.polyphony),this.voices=new Array(e.polyphony),this._triggers=new Array(e.polyphony),this.detune=new t.Signal(e.detune,t.Type.Cents),this._readOnly("detune");for(var n=0;n<e.polyphony;n++){var i=new e.voice(arguments[2],arguments[3]);if(!(i instanceof t.Monophonic))throw new Error("Synth constructor must be instance of Tone.Monophonic");this.voices[n]=i,i.connect(this.output),i.hasOwnProperty("detune")&&this.detune.connect(i.detune),this._triggers[n]={release:-1,note:null,voice:i}}},t.extend(t.PolySynth,t.Instrument),t.PolySynth.defaults={polyphony:4,volume:0,detune:0,voice:t.Synth},t.PolySynth.prototype.triggerAttack=function(t,e,n){Array.isArray(t)||(t=[t]),e=this.toSeconds(e);for(var i=0;i<t.length;i++){for(var r=t[i],o=this._triggers[0],s=1;s<this._triggers.length;s++)this._triggers[s].release<o.release&&(o=this._triggers[s]);o.release=1/0,o.note=JSON.stringify(r),o.voice.triggerAttack(r,e,n)}return this},t.PolySynth.prototype.triggerAttackRelease=function(e,n,i,r){if(i=this.toSeconds(i),this.triggerAttack(e,i,r),t.isArray(n)&&t.isArray(e))for(var o=0;o<e.length;o++){var s=n[Math.min(o,n.length-1)];this.triggerRelease(e[o],i+this.toSeconds(s))}else this.triggerRelease(e,i+this.toSeconds(n));return this},t.PolySynth.prototype.triggerRelease=function(t,e){Array.isArray(t)||(t=[t]),e=this.toSeconds(e);for(var n=0;n<t.length;n++)for(var i=JSON.stringify(t[n]),r=0;r<this._triggers.length;r++){var o=this._triggers[r];o.note===i&&o.release>e&&(o.voice.triggerRelease(e),o.release=e)}return this},t.PolySynth.prototype.sync=function(){return this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1),this},t.PolySynth.prototype.set=function(t,e,n){for(var i=0;i<this.voices.length;i++)this.voices[i].set(t,e,n);return this},t.PolySynth.prototype.get=function(t){return this.voices[0].get(t)},t.PolySynth.prototype.releaseAll=function(t){t=this.toSeconds(t);for(var e=0;e<this._triggers.length;e++){var n=this._triggers[e];n.release>t&&(n.release=t,n.voice.triggerRelease(t))}return this},t.PolySynth.prototype.dispose=function(){t.Instrument.prototype.dispose.call(this);for(var e=0;e<this.voices.length;e++)this.voices[e].dispose(),this.voices[e]=null;return this._writable("detune"),this.detune.dispose(),this.detune=null,this.voices=null,this._triggers=null,this},t.PolySynth.MAX_POLYPHONY=20,t.PolySynth}),n(function(t){return t.Sampler=function(e){var n=Array.prototype.slice.call(arguments);n.shift();var i=t.defaults(n,["onload","baseUrl"],t.Sampler);t.Instrument.call(this,i);var r={};for(var o in e)if(t.isNote(o))r[t.Frequency(o).toMidi()]=e[o];else{if(isNaN(parseFloat(o)))throw new Error("Tone.Sampler: url keys must be the note's pitch");r[o]=e[o]}this._buffers=new t.Buffers(r,i.onload,i.baseUrl),this._activeSources={},this.attack=i.attack,this.release=i.release},t.extend(t.Sampler,t.Instrument),t.Sampler.defaults={attack:0,release:.1,onload:t.noOp,baseUrl:""},t.Sampler.prototype._findClosest=function(t){for(var e=0;e<96;){if(this._buffers.has(t+e))return-e;if(this._buffers.has(t-e))return e;e++}return null},t.Sampler.prototype.triggerAttack=function(e,n,i){var r=t.Frequency(e).toMidi(),o=this._findClosest(r);if(null!==o){var s=r-o,a=this._buffers.get(s),u=new t.BufferSource({buffer:a,playbackRate:t.intervalToFrequencyRatio(o),fadeIn:this.attack,fadeOut:this.release,curve:"exponential"}).connect(this.output);u.start(n,0,a.duration,i),t.isArray(this._activeSources[r])||(this._activeSources[r]=[]),this._activeSources[r].push({note:r,source:u})}return this},t.Sampler.prototype.triggerRelease=function(e,n){var i=t.Frequency(e).toMidi();if(this._activeSources[i]&&this._activeSources[i].length){var r=this._activeSources[i].shift().source;n=this.toSeconds(n),r.stop(n+this.release,this.release)}return this},t.Sampler.prototype.releaseAll=function(t){for(var e in t=this.toSeconds(t),this._activeSources)for(var n=this._activeSources[e];n.length;)n.shift().source.stop(t+this.release,this.release);return this},t.Sampler.prototype.sync=function(){return this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1),this},t.Sampler.prototype.triggerAttackRelease=function(t,e,n,i){return n=this.toSeconds(n),e=this.toSeconds(e),this.triggerAttack(t,n,i),this.triggerRelease(t,n+e),this},t.Sampler.prototype.add=function(e,n,i){if(t.isNote(e)){var r=t.Frequency(e).toMidi();this._buffers.add(r,n,i)}else{if(isNaN(parseFloat(e)))throw new Error("Tone.Sampler: note must be the note's pitch. Instead got "+e);this._buffers.add(e,n,i)}},Object.defineProperty(t.Sampler.prototype,"loaded",{get:function(){return this._buffers.loaded}}),t.Sampler.prototype.dispose=function(){for(var e in t.Instrument.prototype.dispose.call(this),this._buffers.dispose(),this._buffers=null,this._activeSources)this._activeSources[e].forEach(function(t){t.source.dispose()});return this._activeSources=null,this},t.Sampler}),n(function(t){t.supported&&(OscillatorNode.prototype.setPeriodicWave||(OscillatorNode.prototype.setPeriodicWave=OscillatorNode.prototype.setWaveTable),AudioContext.prototype.createPeriodicWave||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable))}),n(function(t){return t.GainToAudio=function(){t.SignalBase.call(this),this._norm=this.input=this.output=new t.WaveShaper(function(t){return 2*Math.abs(t)-1})},t.extend(t.GainToAudio,t.SignalBase),t.GainToAudio.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._norm.dispose(),this._norm=null,this},t.GainToAudio}),n(function(t){return t.Normalize=function(e,n){t.SignalBase.call(this),this._inputMin=t.defaultArg(e,0),this._inputMax=t.defaultArg(n,1),this._sub=this.input=new t.Add(0),this._div=this.output=new t.Multiply(1),this._sub.connect(this._div),this._setRange()},t.extend(t.Normalize,t.SignalBase),Object.defineProperty(t.Normalize.prototype,"min",{get:function(){return this._inputMin},set:function(t){this._inputMin=t,this._setRange()}}),Object.defineProperty(t.Normalize.prototype,"max",{get:function(){return this._inputMax},set:function(t){this._inputMax=t,this._setRange()}}),t.Normalize.prototype._setRange=function(){this._sub.value=-this._inputMin,this._div.value=1/(this._inputMax-this._inputMin)},t.Normalize.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._sub.dispose(),this._sub=null,this._div.dispose(),this._div=null,this},t.Normalize}),n(function(t){return t.TransportTimelineSignal=function(){t.Signal.apply(this,arguments),this.output=this._outputSig=new t.Signal(this._initialValue),this._lastVal=this.value,this._synced=t.Transport.scheduleRepeat(this._onTick.bind(this),"1i"),this._bindAnchorValue=this._anchorValue.bind(this),t.Transport.on("start stop pause",this._bindAnchorValue),this._events.memory=1/0},t.extend(t.TransportTimelineSignal,t.Signal),t.TransportTimelineSignal.prototype._onTick=function(e){var n=this.getValueAtTime(t.Transport.seconds);this._lastVal!==n&&(this._lastVal=n,this._outputSig.linearRampToValueAtTime(n,e))},t.TransportTimelineSignal.prototype._anchorValue=function(e){var n=this.getValueAtTime(t.Transport.seconds);return this._lastVal=n,this._outputSig.cancelScheduledValues(e),this._outputSig.setValueAtTime(n,e),this},t.TransportTimelineSignal.prototype.getValueAtTime=function(e){return e=t.TransportTime(e),t.Signal.prototype.getValueAtTime.call(this,e)},t.TransportTimelineSignal.prototype.setValueAtTime=function(e,n){return n=t.TransportTime(n),t.Signal.prototype.setValueAtTime.call(this,e,n),this},t.TransportTimelineSignal.prototype.linearRampToValueAtTime=function(e,n){return n=t.TransportTime(n),t.Signal.prototype.linearRampToValueAtTime.call(this,e,n),this},t.TransportTimelineSignal.prototype.exponentialRampToValueAtTime=function(e,n){return n=t.TransportTime(n),t.Signal.prototype.exponentialRampToValueAtTime.call(this,e,n),this},t.TransportTimelineSignal.prototype.setTargetAtTime=function(e,n,i){return n=t.TransportTime(n),t.Signal.prototype.setTargetAtTime.call(this,e,n,i),this},t.TransportTimelineSignal.prototype.cancelScheduledValues=function(e){return e=t.TransportTime(e),t.Signal.prototype.cancelScheduledValues.call(this,e),this},t.TransportTimelineSignal.prototype.setValueCurveAtTime=function(e,n,i,r){return n=t.TransportTime(n),i=t.TransportTime(i),t.Signal.prototype.setValueCurveAtTime.call(this,e,n,i,r),this},t.TransportTimelineSignal.prototype.cancelAndHoldAtTime=function(e){return t.Signal.prototype.cancelAndHoldAtTime.call(this,t.TransportTime(e))},t.TransportTimelineSignal.prototype.dispose=function(){t.Transport.clear(this._synced),t.Transport.off("start stop pause",this._syncedCallback),this._events.cancel(0),t.Signal.prototype.dispose.call(this),this._outputSig.dispose(),this._outputSig=null},t.TransportTimelineSignal}),n(function(t){return t.GrainPlayer=function(){var e=t.defaults(arguments,["url","onload"],t.GrainPlayer);t.Source.call(this,e),this.buffer=new t.Buffer(e.url,e.onload),this._clock=new t.Clock(this._tick.bind(this),e.grainSize),this._loopStart=0,this._loopEnd=0,this._activeSources=[],this._playbackRate=e.playbackRate,this._grainSize=e.grainSize,this._overlap=e.overlap,this.detune=e.detune,this.overlap=e.overlap,this.loop=e.loop,this.playbackRate=e.playbackRate,this.grainSize=e.grainSize,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.reverse=e.reverse,this._clock.on("stop",this._onstop.bind(this))},t.extend(t.GrainPlayer,t.Source),t.GrainPlayer.defaults={onload:t.noOp,overlap:.1,grainSize:.2,playbackRate:1,detune:0,loop:!1,loopStart:0,loopEnd:0,reverse:!1},t.GrainPlayer.prototype._start=function(e,n,i){n=t.defaultArg(n,0),n=this.toSeconds(n),e=this.toSeconds(e),this._offset=n,this._clock.start(e),i&&this.stop(e+this.toSeconds(i))},t.GrainPlayer.prototype._stop=function(t){this._clock.stop(t)},t.GrainPlayer.prototype._onstop=function(t){this._activeSources.forEach(function(e){e.stop(t,0)})},t.GrainPlayer.prototype._tick=function(e){var n=this._offset<this._overlap?0:this._overlap,i=new t.BufferSource({buffer:this.buffer,fadeIn:n,fadeOut:this._overlap,loop:this.loop,loopStart:this._loopStart,loopEnd:this._loopEnd,playbackRate:t.intervalToFrequencyRatio(this.detune/100)}).connect(this.output);i.start(e,this._offset),this._offset+=this.grainSize,i.stop(e+this.grainSize),this._activeSources.push(i),i.onended=function(){var t=this._activeSources.indexOf(i);-1!==t&&this._activeSources.splice(t,1)}.bind(this)},t.GrainPlayer.prototype.seek=function(t,e){return this._offset=this.toSeconds(t),this._tick(this.toSeconds(e)),this},Object.defineProperty(t.GrainPlayer.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this.grainSize=this._grainSize}}),Object.defineProperty(t.GrainPlayer.prototype,"loopStart",{get:function(){return this._loopStart},set:function(t){this._loopStart=this.toSeconds(t)}}),Object.defineProperty(t.GrainPlayer.prototype,"loopEnd",{get:function(){return this._loopEnd},set:function(t){this._loopEnd=this.toSeconds(t)}}),Object.defineProperty(t.GrainPlayer.prototype,"reverse",{get:function(){return this.buffer.reverse},set:function(t){this.buffer.reverse=t}}),Object.defineProperty(t.GrainPlayer.prototype,"grainSize",{get:function(){return this._grainSize},set:function(t){this._grainSize=this.toSeconds(t),this._clock.frequency.value=this._playbackRate/this._grainSize}}),Object.defineProperty(t.GrainPlayer.prototype,"overlap",{get:function(){return this._overlap},set:function(t){this._overlap=this.toSeconds(t)}}),t.GrainPlayer.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),this.buffer.dispose(),this.buffer=null,this._clock.dispose(),this._clock=null,this._activeSources.forEach(function(t){t.dispose()}),this._activeSources=null,this},t.GrainPlayer}),n(function(t){return t.Player=function(e){var n;e instanceof t.Buffer&&e.loaded?(e=e.get(),n=t.Player.defaults):n=t.defaults(arguments,["url","onload"],t.Player),t.Source.call(this,n),this.autostart=n.autostart,this._buffer=new t.Buffer({url:n.url,onload:this._onload.bind(this,n.onload),reverse:n.reverse}),e instanceof AudioBuffer&&this._buffer.set(e),this._loop=n.loop,this._loopStart=n.loopStart,this._loopEnd=n.loopEnd,this._playbackRate=n.playbackRate,this._activeSources=[],this._elapsedTime=new t.TickSource(n.playbackRate),this.fadeIn=n.fadeIn,this.fadeOut=n.fadeOut},t.extend(t.Player,t.Source),t.Player.defaults={onload:t.noOp,playbackRate:1,loop:!1,autostart:!1,loopStart:0,loopEnd:0,retrigger:!1,reverse:!1,fadeIn:0,fadeOut:0},t.Player.prototype.load=function(t,e){return this._buffer.load(t,this._onload.bind(this,e))},t.Player.prototype._onload=function(e){(e=t.defaultArg(e,t.noOp))(this),this.autostart&&this.start()},t.Player.prototype._onSourceEnd=function(t){var e=this._activeSources.indexOf(t);this._activeSources.splice(e,1)},t.Player.prototype._start=function(e,n,i){n=this._loop?t.defaultArg(n,this._loopStart):t.defaultArg(n,0),n=this.toSeconds(n);var r=t.defaultArg(i,Math.max(this._buffer.duration-n,0));r=this.toSeconds(r),e=this.toSeconds(e),this._elapsedTime.start(e,n);var o=new t.BufferSource({buffer:this._buffer,loop:this._loop,loopStart:this._loopStart,loopEnd:this._loopEnd,onended:this._onSourceEnd.bind(this),playbackRate:this._playbackRate,fadeIn:this.fadeIn,fadeOut:this.fadeOut}).connect(this.output);return this._loop||this._synced||this._state.setStateAtTime(t.State.Stopped,e+r/this._playbackRate),this._activeSources.push(o),this._loop&&t.isUndef(i)?o.start(e,n):o.start(e,n,r),this},t.Player.prototype._stop=function(t){return t=this.toSeconds(t),this._elapsedTime.stop(t),this._activeSources.forEach(function(e){e.stop(t)}),this},t.Player.prototype.restart=function(t,e,n){return this._stop(t),this._start(t,e,n),this},t.Player.prototype.seek=function(e,n){return n=this.toSeconds(n),this._state.getValueAtTime(n)===t.State.Started&&(e=this.toSeconds(e),this._stop(n),this._start(n,e)),this},t.Player.prototype.setLoopPoints=function(t,e){return this.loopStart=t,this.loopEnd=e,this},Object.defineProperty(t.Player.prototype,"loopStart",{get:function(){return this._loopStart},set:function(t){this._loopStart=t,this._activeSources.forEach(function(e){e.loopStart=t})}}),Object.defineProperty(t.Player.prototype,"loopEnd",{get:function(){return this._loopEnd},set:function(t){this._loopEnd=t,this._activeSources.forEach(function(e){e.loopEnd=t})}}),Object.defineProperty(t.Player.prototype,"buffer",{get:function(){return this._buffer},set:function(t){this._buffer.set(t)}}),Object.defineProperty(t.Player.prototype,"loop",{get:function(){return this._loop},set:function(e){if(this._loop!==e){this._loop=e;var n=this.now();if(e){var i=this._state.getNextState(t.State.Stopped,n);i&&(this._activeSources.forEach(function(t){t.loop=e}),this._state.cancel(i.time),this._elapsedTime.cancel(i.time))}else this._stopAtNextIteration(n)}}}),t.Player.prototype._stopAtNextIteration=function(e){if(this._state.getValueAtTime(e)===t.State.Started){var n=this._state.getNextState(t.State.Stopped,e),i=this._elapsedTime.getTicksAtTime(e),r=Math.max(Math.ceil(i/this.buffer.duration),1),o=this._elapsedTime.getTimeOfTick(r*this.buffer.duration,n?n.time-this.sampleTime:1/0);this.stop(o)}},Object.defineProperty(t.Player.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t;var e=this.now();this._elapsedTime.frequency.setValueAtTime(t,e),this._loop||this._stopAtNextIteration(e),this._activeSources.forEach(function(n){n.playbackRate.setValueAtTime(t,e)})}}),Object.defineProperty(t.Player.prototype,"position",{get:function(){var e=this.now();if(this._state.getValueAtTime(e)===t.State.Started&&this.loaded){var n=this.buffer.duration;return this._elapsedTime.getTicksAtTime(e)%n}return 0}}),Object.defineProperty(t.Player.prototype,"reverse",{get:function(){return this._buffer.reverse},set:function(t){this._buffer.reverse=t}}),Object.defineProperty(t.Player.prototype,"loaded",{get:function(){return this._buffer.loaded}}),t.Player.prototype.dispose=function(){return this._activeSources.forEach(function(t){t.dispose()}),this._activeSources=null,t.Source.prototype.dispose.call(this),this._buffer.dispose(),this._buffer=null,this._elapsedTime.dispose(),this._elapsedTime=null,this},t.Player}),n(function(t){return t.Players=function(e){var n=Array.prototype.slice.call(arguments);n.shift();var i=t.defaults(n,["onload"],t.Players);for(var r in t.call(this),this._volume=this.output=new t.Volume(i.volume),this.volume=this._volume.volume,this._readOnly("volume"),this._volume.output.output.channelCount=2,this._volume.output.output.channelCountMode="explicit",this.mute=i.mute,this._players={},this._loadingCount=0,this._fadeIn=i.fadeIn,this._fadeOut=i.fadeOut,e)this._loadingCount++,this.add(r,e[r],this._bufferLoaded.bind(this,i.onload))},t.extend(t.Players,t.AudioNode),t.Players.defaults={volume:0,mute:!1,onload:t.noOp,fadeIn:0,fadeOut:0},t.Players.prototype._bufferLoaded=function(t){this._loadingCount--,0===this._loadingCount&&t&&t(this)},Object.defineProperty(t.Players.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),Object.defineProperty(t.Players.prototype,"fadeIn",{get:function(){return this._fadeIn},set:function(t){this._fadeIn=t,this._forEach(function(e){e.fadeIn=t})}}),Object.defineProperty(t.Players.prototype,"fadeOut",{get:function(){return this._fadeOut},set:function(t){this._fadeOut=t,this._forEach(function(e){e.fadeOut=t})}}),Object.defineProperty(t.Players.prototype,"state",{get:function(){var e=!1;return this._forEach(function(n){e=e||n.state===t.State.Started}),e?t.State.Started:t.State.Stopped}}),t.Players.prototype.has=function(t){return this._players.hasOwnProperty(t)},t.Players.prototype.get=function(t){if(this.has(t))return this._players[t];throw new Error("Tone.Players: no player named "+t)},t.Players.prototype._forEach=function(t){for(var e in this._players)t(this._players[e],e);return this},Object.defineProperty(t.Players.prototype,"loaded",{get:function(){var t=!0;return this._forEach(function(e){t=t&&e.loaded}),t}}),t.Players.prototype.add=function(e,n,i){return this._players[e]=new t.Player(n,i).connect(this.output),this._players[e].fadeIn=this._fadeIn,this._players[e].fadeOut=this._fadeOut,this},t.Players.prototype.stopAll=function(t){this._forEach(function(e){e.stop(t)})},t.Players.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._volume.dispose(),this._volume=null,this._writable("volume"),this.volume=null,this.output=null,this._forEach(function(t){t.dispose()}),this._players=null,this},t.Players}),n(function(t){return t.UserMedia=function(){var e=t.defaults(arguments,["volume"],t.UserMedia);t.AudioNode.call(this),this._mediaStream=null,this._stream=null,this._device=null,this._volume=this.output=new t.Volume(e.volume),this.volume=this._volume.volume,this._readOnly("volume"),this.mute=e.mute},t.extend(t.UserMedia,t.AudioNode),t.UserMedia.defaults={volume:0,mute:!1},t.UserMedia.prototype.open=function(e){return t.UserMedia.enumerateDevices().then(function(n){var i;if(t.isNumber(e))i=n[e];else if(!(i=n.find(function(t){return t.label===e||t.deviceId===e}))&&n.length>0)i=n[0];else if(!i&&t.isDefined(e))throw new Error("Tone.UserMedia: no matching device: "+e);this._device=i;var r={audio:{echoCancellation:!1,sampleRate:this.context.sampleRate}};return i&&(r.audio.deviceId=i.deviceId),navigator.mediaDevices.getUserMedia(r).then(function(t){return this._stream||(this._stream=t,this._mediaStream=this.context.createMediaStreamSource(t),this._mediaStream.connect(this.output)),this}.bind(this))}.bind(this))},t.UserMedia.prototype.close=function(){return this._stream&&(this._stream.getAudioTracks().forEach(function(t){t.stop()}),this._stream=null,this._mediaStream.disconnect(),this._mediaStream=null),this._device=null,this},t.UserMedia.enumerateDevices=function(){return navigator.mediaDevices.enumerateDevices().then(function(t){return t.filter(function(t){return"audioinput"===t.kind})})},Object.defineProperty(t.UserMedia.prototype,"state",{get:function(){return this._stream&&this._stream.active?t.State.Started:t.State.Stopped}}),Object.defineProperty(t.UserMedia.prototype,"deviceId",{get:function(){if(this._device)return this._device.deviceId}}),Object.defineProperty(t.UserMedia.prototype,"groupId",{get:function(){if(this._device)return this._device.groupId}}),Object.defineProperty(t.UserMedia.prototype,"label",{get:function(){if(this._device)return this._device.label}}),Object.defineProperty(t.UserMedia.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),t.UserMedia.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.close(),this._writable("volume"),this._volume.dispose(),this._volume=null,this.volume=null,this},Object.defineProperty(t.UserMedia,"supported",{get:function(){return t.isDefined(navigator.mediaDevices)&&t.isFunction(navigator.mediaDevices.getUserMedia)}}),t.UserMedia}),n(function(t){return t.Midi=function(e,n){if(!(this instanceof t.Midi))return new t.Midi(e,n);t.Frequency.call(this,e,n)},t.extend(t.Midi,t.Frequency),t.Midi.prototype._defaultUnits="midi",t.Midi.prototype._frequencyToUnits=function(e){return t.Frequency.ftom(t.Frequency.prototype._frequencyToUnits.call(this,e))},t.Midi.prototype._ticksToUnits=function(e){return t.Frequency.ftom(t.Frequency.prototype._ticksToUnits.call(this,e))},t.Midi.prototype._beatsToUnits=function(e){return t.Frequency.ftom(t.Frequency.prototype._beatsToUnits.call(this,e))},t.Midi.prototype._secondsToUnits=function(e){return t.Frequency.ftom(t.Frequency.prototype._secondsToUnits.call(this,e))},t.Midi.prototype.toMidi=function(){return this.valueOf()},t.Midi.prototype.toFrequency=function(){return t.Frequency.mtof(this.toMidi())},t.Midi.prototype.transpose=function(t){return new this.constructor(this.toMidi()+t)},t.Midi}),t}()}.call(e,n,e,t))||(t.exports=i)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(1),a=n(2);n(3);var u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,s.Component),o(e,[{key:"handleChange",value:function(t){clearTimeout(this.timeout);var e=t.target.value;"PLACEHOLDER"!==e&&this.props.onChange&&this.props.onChange(this.props.name,e)}},{key:"render",value:function(){var t=this.props.live?this.props.opt[this.props.name]:this.props.value,e=void 0,n=(this.props.options||[]).map(function(t,n){var o=void 0,a=void 0;if("string"==typeof t)o=t.length<2?t.toUpperCase():t,a=t;else if("object"===(void 0===t?"undefined":r(t)))if(t.length){var u=i(t,2);o=u[0],a=u[1]}else if(t.count){var l=Math.round(t.count/30)+" s.";o=t.name.replace(/_/g," ")+" ("+l+")",a=t.name}else o=t.name,a=t.value||t.name;return e=a,(0,s.h)("option",{value:a,key:n},o)});return(0,s.h)("div",{className:"select param"},(0,s.h)("label",null,(0,s.h)("span",null,this.props.title),(0,s.h)("select",{onChange:this.handleChange,value:t||e},this.props.placeholder&&(0,s.h)("option",{value:"PLACEHOLDER"},this.props.placeholder),n)),this.props.children)}}]),e}();e.default=(0,a.connect)(function(t,e){return{opt:e.opt||t.live.opt}},function(t,e){return{}})(u)},function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){"use strict";(function(e){t.exports={isNode:void 0!==e,newBufferFrom:function(t,n){return new e(t,n)},allocBuffer:function(t){return e.alloc?e.alloc(t):new e(t)},isBuffer:function(t){return e.isBuffer(t)},isStream:function(t){return t&&"function"==typeof t.on&&"function"==typeof t.pause&&"function"==typeof t.resume}}}).call(this,n(47).Buffer)},function(t,e,n){var i=n(47),r=i.Buffer;function o(t,e){for(var n in t)e[n]=t[n]}function s(t,e,n){return r(t,e,n)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=s),o(r,s),s.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return r(t,e,n)},s.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var i=r(t);return void 0!==e?"string"==typeof n?i.fill(e,n):i.fill(e):i.fill(0),i},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e,n){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,n,i,r){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,i)});case 4:return e.nextTick(function(){t.call(null,n,i,r)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick(function(){t.apply(null,o)})}}}:t.exports=e}).call(this,n(43))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"pix2wav",displayName:"Pix2Wav",datatype:"spectrogram"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"biggan",displayName:"BigGAN",datatype:"image"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uploadFiles=e.fetchURL=e.uploadFile=e.updateFolder=e.createFolder=void 0;var i=s(n(6)),r=s(n(7)),o=n(126);function s(t){return t&&t.__esModule?t:{default:t}}e.createFolder=function(t,e){return function(n){return r.default.folder.create({module:t.name,datatype:t.datatype,activity:"dataset",name:e})}},e.updateFolder=function(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return function(o){return e&&e.id?r.default.folder.update({id:e.id,module:t.name,datatype:t.datatype,activity:"dataset",name:n,opt:i}):null}},e.uploadFile=function(t,e,n,i){return function(o){var s=new FormData;return s.append("file",n,i),r.default.folder.upload(s,{id:e.id,module:t.name,activity:"file",epoch:0,processed:!1,generated:!1})}},e.fetchURL=function(t,e,n){return function(i){console.log(t,e,n);var s=e.files.some(function(t){return t.url===n});console.log(s),s?console.log("already seen this url"):o.parser.parse(n,function(i){i&&(i.title=i.title.replace(/([\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])/g,"").trim(),console.log("media",i),r.default.file.create({folder_id:e.id,name:(i.title||"").replace(/\.[^.]+$/g,"").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_"),module:t.name,dataset:i.token,activity:"url",duration:parseInt(i.duration)||0,epoch:0,processed:!1,generated:!1,opt:i,url:n}))})}},e.uploadFiles=function(t){return{type:i.default.dataset.upload_files}}},function(t,e,n){var i=n(309);t.exports=f,t.exports.parse=o,t.exports.compile=function(t,e){return a(o(t,e))},t.exports.tokensToFunction=a,t.exports.tokensToRegExp=p;var r=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(t,e){for(var n,i=[],o=0,s=0,a="",c=e&&e.delimiter||"/";null!=(n=r.exec(t));){var h=n[0],p=n[1],f=n.index;if(a+=t.slice(s,f),s=f+h.length,p)a+=p[1];else{var d=t[s],m=n[2],y=n[3],_=n[4],v=n[5],g=n[6],b=n[7];a&&(i.push(a),a="");var w=null!=m&&null!=d&&d!==m,k="+"===g||"*"===g,S="?"===g||"*"===g,x=n[2]||c,T=_||v;i.push({name:y||o++,prefix:m||"",delimiter:x,optional:S,repeat:k,partial:w,asterisk:!!b,pattern:T?l(T):b?".*":"[^"+u(x)+"]+?"})}}return s<t.length&&(a+=t.substr(s)),a&&i.push(a),i}function s(t){return encodeURI(t).replace(/[\/?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function a(t){for(var e=new Array(t.length),n=0;n<t.length;n++)"object"==typeof t[n]&&(e[n]=new RegExp("^(?:"+t[n].pattern+")$"));return function(n,r){for(var o="",a=n||{},u=(r||{}).pretty?s:encodeURIComponent,l=0;l<t.length;l++){var c=t[l];if("string"!=typeof c){var h,p=a[c.name];if(null==p){if(c.optional){c.partial&&(o+=c.prefix);continue}throw new TypeError('Expected "'+c.name+'" to be defined')}if(i(p)){if(!c.repeat)throw new TypeError('Expected "'+c.name+'" to not repeat, but received `'+JSON.stringify(p)+"`");if(0===p.length){if(c.optional)continue;throw new TypeError('Expected "'+c.name+'" to not be empty')}for(var f=0;f<p.length;f++){if(h=u(p[f]),!e[l].test(h))throw new TypeError('Expected all "'+c.name+'" to match "'+c.pattern+'", but received `'+JSON.stringify(h)+"`");o+=(0===f?c.prefix:c.delimiter)+h}}else{if(h=c.asterisk?encodeURI(p).replace(/[?#]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()}):u(p),!e[l].test(h))throw new TypeError('Expected "'+c.name+'" to match "'+c.pattern+'", but received "'+h+'"');o+=c.prefix+h}}else o+=c}return o}}function u(t){return t.replace(/([.+*?=^!:${}()[\]|\/\\])/g,"\\$1")}function l(t){return t.replace(/([=!:$\/()])/g,"\\$1")}function c(t,e){return t.keys=e,t}function h(t){return t.sensitive?"":"i"}function p(t,e,n){i(e)||(n=e||n,e=[]);for(var r=(n=n||{}).strict,o=!1!==n.end,s="",a=0;a<t.length;a++){var l=t[a];if("string"==typeof l)s+=u(l);else{var p=u(l.prefix),f="(?:"+l.pattern+")";e.push(l),l.repeat&&(f+="(?:"+p+f+")*"),s+=f=l.optional?l.partial?p+"("+f+")?":"(?:"+p+"("+f+"))?":p+"("+f+")"}}var d=u(n.delimiter||"/"),m=s.slice(-d.length)===d;return r||(s=(m?s.slice(0,-d.length):s)+"(?:"+d+"(?=$))?"),s+=o?"$":r&&m?"":"(?="+d+"|$)",c(new RegExp("^"+s,h(n)),e)}function f(t,e,n){return i(e)||(n=e||n,e=[]),n=n||{},t instanceof RegExp?function(t,e){var n=t.source.match(/\((?!\?)/g);if(n)for(var i=0;i<n.length;i++)e.push({name:i,prefix:null,delimiter:null,optional:!1,repeat:!1,partial:!1,asterisk:!1,pattern:null});return c(t,e)}(t,e):i(t)?function(t,e,n){for(var i=[],r=0;r<t.length;r++)i.push(f(t[r],e,n).source);return c(new RegExp("(?:"+i.join("|")+")",h(n)),e)}(t,e,n):function(t,e,n){return p(o(t,n),e,n)}(t,e,n)}},function(t,e,n){t.exports=n(322)()},function(t,e,n){"use strict";t.exports=function(t,e,n,i,r,o,s,a){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,i,r,o,s,a],c=0;(u=new Error(e.replace(/%s/g,function(){return l[c++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2),s=n(3),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(19));var u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.timeout=0,n.state={value:t.live?t.opt[t.name]:t.value},n.handleInput=n.handleInput.bind(n),n.handleRange=n.handleRange.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillReceiveProps",value:function(t){var e=t.value||t.opt[t.name];e!==this.state.value&&this.setState({value:e})}},{key:"handleInput",value:function(t){var e=this.props,n=e.name,i=e.opt[n],r=t.target.value;""===r?r=this.props.defaultValue||(this.props.max-this.props.min)/2:"int"===this.props.type?r=parseInt(r):"odd"===this.props.type&&(r=parseInt(2*Math.floor(r/2)+1)),i!==r&&(this.setState({value:r}),this.props.live&&this.props.actions.set_param(this.props.name,r),this.props.onChange&&this.props.onChange(r)),clearTimeout(this.timeout)}},{key:"handleRange",value:function(t){var e=this;clearTimeout(this.timeout);var n=t.target.value;"int"===this.props.type&&(n=parseInt(n)),"odd"===this.props.type&&(n=parseInt(2*Math.floor(n/2)+1)),"list"===this.props.type&&(n=this.props.options[n]||this.props.options[0]),this.setState({value:n}),this.timeout=setTimeout(function(){e.props.live&&e.props.actions.set_param(e.props.name,n),e.props.onChange&&e.props.onChange(n)},100)}},{key:"render",value:function(){var t=this.props,e=t.name,n=t.title,i=this.state.value;void 0===i&&(i=this.props.min);var o=i,s=void 0,a=this.props.min||0,u=this.props.max||0;return"int"===this.props.type?s=1:"list"===this.props.type?(a=0,u=this.props.options.length-1,s=1,i=this.props.options.indexOf(i)):(s=(this.props.max-this.props.min)/100,o=parseFloat(i).toFixed(2)),(0,r.h)("div",{className:"slider param"},(0,r.h)("label",null,(0,r.h)("span",null,n||e.replace(/_/g," ")),(0,r.h)("input",{type:"text",value:o,onBlur:this.handleInput})),(0,r.h)("input",{type:"range",min:a,max:u,step:s,value:i,onInput:this.handleRange}))}}]),e}();e.default=(0,o.connect)(function(t){return{opt:t.live.opt}},function(t,e){return{actions:(0,s.bindActionCreators)(a,t)}})(u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"samplernn",displayName:"SampleRNN",datatype:"audio"}},function(t,e,n){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,n){"use strict";var i=n(10);var r=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();t.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,n,i){var o=r,s=i+n;t^=-1;for(var a=i;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}(0|e,t,t.length,0):function(t,e,n,i){var o=r,s=i+n;t^=-1;for(var a=i;a<s;a++)t=t>>>8^o[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length,0):0}},function(t,e,n){"use strict";var i=n(45),r=n(106),o=n(105),s=n(104);o=n(105);function a(t,e,n,i,r){this.compressedSize=t,this.uncompressedSize=e,this.crc32=n,this.compression=i,this.compressedContent=r}a.prototype={getContentWorker:function(){var t=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,n){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(n)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},t.exports=a},function(t,e,n){t.exports=!n(110)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";(function(e,i,r){var o=n(59);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var i=t.entry;t.entry=null;for(;i;){var r=i.callback;e.pendingcb--,r(n),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=v;var a,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;v.WritableState=_;var l=n(46);l.inherits=n(30);var c={deprecate:n(213)},h=n(117),p=n(58).Buffer,f=r.Uint8Array||function(){};var d,m=n(116);function y(){}function _(t,e){a=a||n(26),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,l=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,r=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,r){--e.pendingcb,n?(o.nextTick(r,i),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(r(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,n,i,e,r);else{var s=k(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||w(t,n),i?u(b,t,n,s,r):b(t,n,s,r)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function v(t){if(a=a||n(26),!(d.call(v,this)||this instanceof a))return new v(t);this._writableState=new _(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function g(t,e,n,i,r,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}function b(t,e,n,i){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),x(t,e)}function w(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,r=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var a=0,u=!0;n;)r[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;r.allBuffers=u,g(t,e,!0,e.length,r,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,h=n.callback;if(g(t,e,!1,e.objectMode?1:l.length,l,c,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function k(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),x(t,e)})}function x(t,e){var n=k(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}l.inherits(v,h),_.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(_.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===v&&(t&&t._writableState instanceof _)}})):d=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,n){var i,r=this._writableState,s=!1,a=!r.objectMode&&(i=t,p.isBuffer(i)||i instanceof f);return a&&!p.isBuffer(t)&&(t=function(t){return p.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=y),r.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(a||function(t,e,n,i){var r=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),r=!1),r}(this,r,t,n))&&(r.pendingcb++,s=function(t,e,n,i,r,o){if(!n){var s=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=p.from(e,n));return e}(e,i,r);i!==s&&(n=!0,r="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length<e.highWaterMark;u||(e.needDrain=!0);if(e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:r,isBuf:n,callback:o,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else g(t,e,!1,a,i,r,o);return u}(this,r,a,t,e,n)),s},v.prototype.cork=function(){this._writableState.corked++},v.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.finished||t.bufferProcessing||!t.bufferedRequest||w(this,t))},v.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,n){var i=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,n){e.ending=!0,x(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(43),n(215).setImmediate,n(22))},function(t,e,n){(e=t.exports=n(118)).Stream=e,e.Readable=e,e.Writable=n(73),e.Duplex=n(26),e.Transform=n(114),e.PassThrough=n(212)},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,a,u,l;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(o(n=this._events[t]))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(r(n))for(a=Array.prototype.slice.call(arguments,1),s=(l=n.slice()).length,u=0;u<s;u++)l[u].apply(this,a);return!0},n.prototype.addListener=function(t,e){var s;if(!i(e))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?r(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,r(this._events[t])&&!this._events[t].warned&&(s=o(this._maxListeners)?n.defaultMaxListeners:this._maxListeners)&&s>0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var n,o,s,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(s=(n=this._events[t]).length,o=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){o=a;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.live_task=void 0;r(n(15)),r(n(14)),r(n(6));var i=r(n(7));function r(t){return t&&t.__esModule?t:{default:t}}e.live_task=function(t,e){return function(n){var r={module:"pix2wav",activity:"live",dataset:t,checkpoint:e,opt:{poll_delay:.2}};return console.log(r),console.log("add live task"),i.default.queue.add_task(r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load_directories=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=(l(n(15)),l(n(14)),l(n(6))),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(36)),s=l(n(7)),a=l(n(4)),u=l(n(60));function l(t){return t&&t.__esModule?t:{default:t}}e.load_directories=function(t){return function(e){var n=u.default.name;a.default.allProgress([o.load(n),s.default.socket.list_directory({module:"pix2pix",dir:"sequences/pix2wav/"}),s.default.socket.list_directory({module:"pix2pix",dir:"datasets/pix2wav/"}),s.default.socket.list_directory({module:"pix2pix",dir:"checkpoints/pix2wav/"}),s.default.socket.list_directory({module:"pix2pix",dir:"checkpoints/pix2pix/"})],function(t,n,i){console.log("progress",n,i),e({type:r.default.app.load_progress,progress:{i:n,n:i}})}).then(function(t){var s=i(t,5),a=s[0],u=s[1],l=s[2],c=s[3],h=s[4],p=a.folderLookup,f=a.fileLookup,d=a.datasetLookup,m=a.folders,y=a.files,_=(a.unsortedFolder,u.filter(function(t){return t.dir}));_.forEach(function(t){o.getDataset(n,d,t.name).isBuilt=!0}),l.filter(function(t){return t.dir}).forEach(function(t){o.getDataset(n,d,t.name).hasDataset=!0});var v=c.filter(function(t){return t.dir});v.forEach(function(t){o.getDataset(n,d,t.name).hasCheckpoints=!0,t.module="pix2wav"});var g=h.filter(function(t){return t.dir});g.forEach(function(t){o.getDataset(n,d,t.name).hasCheckpoints=!0,t.module="pix2pix"}),console.log(t),console.log(v),console.log(g),e({type:r.default.dataset.load,data:{module:n,folderLookup:p,fileLookup:f,datasetLookup:d,folders:m,files:y,sequences:_,datasets:l,checkpoints:v.concat(g)}})}).catch(function(t){console.error(t)}),t&&(console.log("folder id",t),e({type:r.default.dataset.set_folder,data:{folder_id:t,module:n}}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"pix2pix",displayName:"Pix2Pix",datatype:"video"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load_directories=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=(l(n(15)),l(n(14)),l(n(6))),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(36)),s=l(n(7)),a=l(n(4)),u=l(n(78));function l(t){return t&&t.__esModule?t:{default:t}}e.load_directories=function(t){return function(e){var n=u.default.name;a.default.allProgress([o.load(n),s.default.socket.list_directory({module:n,dir:"sequences/pix2pix/"}),s.default.socket.list_directory({module:n,dir:"datasets/pix2pix/"}),s.default.socket.list_directory({module:n,dir:"checkpoints/pix2pix/"})],function(t,n,i){console.log("pix2pix load progress",n,i),e({type:r.default.app.load_progress,progress:{i:n,n:i}})}).then(function(t){var s=i(t,4),a=s[0],u=s[1],l=s[2],c=s[3],h=a.folderLookup,p=a.fileLookup,f=a.datasetLookup,d=a.folders,m=a.files,y=(a.unsortedFolder,u.filter(function(t){return t.dir}));y.forEach(function(t){o.getDataset(n,f,t.name).isBuilt=!0}),l.filter(function(t){return t.dir}).forEach(function(t){o.getDataset(n,f,t.name).hasDataset=!0});var _=c.filter(function(t){return t.dir});_.forEach(function(t){var e=o.getDataset(n,f,t.name);e.hasCheckpoints=!0,e.checkpoints=[t]}),e({type:r.default.dataset.load,data:{module:n,folderLookup:h,fileLookup:p,datasetLookup:f,folders:d,files:m,sequences:y,datasets:l,checkpoints:_}})}).catch(function(t){console.error(t)}),t&&(console.log("folder id",t),e({type:r.default.dataset.set_folder,data:{folder_id:t,module:n}}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=l(n(251)),r=l(n(244)),o=l(n(240)),s=l(n(236)),a=l(n(228)),u=l(n(166));function l(t){return t&&t.__esModule?t:{default:t}}e.default={biggan:i.default,morph:r.default,pix2pix:o.default,pix2pixhd:s.default,pix2wav:a.default,samplernn:u.default}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.enqueue_test_task=e.changeLanguage=e.changeTool=e.countDirectory=e.listDirectory=e.run=void 0;var i=o(n(14)),r=o(n(6));function o(t){return t&&t.__esModule?t:{default:t}}e.run=function(t){return function(e){e({type:r.default.system.running_command,cmd:t}),i.default.actions.run_system_command({cmd:t}).then(function(t){e({type:r.default.system.command_output,data:t})})}},e.listDirectory=function(t){return function(e){e({type:r.default.system.listing_directory,opt:t}),i.default.actions.list_directory(t).then(function(t){e({type:r.default.system.list_directory,data:t})})}},e.countDirectory=function(t){return function(e){e({type:r.default.system.counting_directory,opt:t}),i.default.actions.count_directory(t).then(function(t){e({type:r.default.system.count_directory,data:t})})}},e.changeTool=function(t){return localStorage.setItem("system.last_tool",t),{type:r.default.app.change_tool,tool:t}},e.changeLanguage=function(t){return localStorage.setItem("cortex.i18n.language",t),{type:r.default.system.change_language,language:t}},e.enqueue_test_task=function(t){return function(t){}};window.addEventListener("keyDown",function(t){t.altKey&&t.keyCode})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.languages=e.strings=void 0;var i=o(n(288)),r=o(n(287));function o(t){return t&&t.__esModule?t:{default:t}}e.strings=function(t){switch(t){case"pyro":return r.default;default:return i.default}},e.languages=["en","pyro"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gaussian=function(t,e){var n=void 0,i=!1;return function(){var r=void 0;if(i)r=n,i=!1;else{var o=void 0,s=void 0,a=void 0;do{o=2*Math.random()-1,s=2*Math.random()-1,a=o*o+s*s}while(a>=1);a=Math.sqrt(-2*Math.log(a)/a),r=o*a,n=s*a,i=!0}var u=t+e*r;return u>0?u:-u}};e.mod=function(t,e){return t-e*Math.floor(t/e)},e.clamp=function(t,e,n){return t<e?e:t<n?t:n},e.norm=function(t,e,n){return(t-e)/(n-e)},e.lerp=function(t,e,n){return(n-e)*t+e},e.mix=function(t,e,n){return e*(1-t)+n*t};var i=e.randint=function(t){return Math.floor(Math.random()*t)};e.randrange=function(t,e){return Math.random()*(e-t)+t},e.randsign=function(){return Math.random()>=.5?-1:1},e.choice=function(t){return t[Math.floor(Math.random()*t.length)]},e.angle=function(t,e,n,i){return Math.atan2(i-e,n-t)},e.dist=function(t,e,n,i){return Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2))},e.xor=function(t,e){return e=!!e,((t=!!t)||e)&&!(t&&e)},e.quantize=function(t,e){return Math.floor(t/e)*e},e.shuffle=function(t){for(var e=t.length;e>0;e--){var n=i(e),r=t[e-1];t[e-1]=t[n],t[n]=r}return t}},function(t,e,n){var i,r=r||function(t){"use strict";if(!(void 0===t||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=function(){return t.URL||t.webkitURL||t},n=t.document.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in n,r=/constructor/i.test(t.HTMLElement)||t.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent),s=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},a=function(t){setTimeout(function(){"string"==typeof t?e().revokeObjectURL(t):t.remove()},4e4)},u=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},l=function(l,c,h){h||(l=u(l));var p,f=this,d="application/octet-stream"===l.type,m=function(){!function(t,e,n){for(var i=(e=[].concat(e)).length;i--;){var r=t["on"+e[i]];if("function"==typeof r)try{r.call(t,n||t)}catch(t){s(t)}}}(f,"writestart progress write writeend".split(" "))};if(f.readyState=f.INIT,i)return p=e().createObjectURL(l),void setTimeout(function(){var t,e;n.href=p,n.download=c,t=n,e=new MouseEvent("click"),t.dispatchEvent(e),m(),a(p),f.readyState=f.DONE});!function(){if((o||d&&r)&&t.FileReader){var n=new FileReader;return n.onloadend=function(){var e=o?n.result:n.result.replace(/^data:[^;]*;/,"data:attachment/file;");t.open(e,"_blank")||(t.location.href=e),e=void 0,f.readyState=f.DONE,m()},n.readAsDataURL(l),void(f.readyState=f.INIT)}p||(p=e().createObjectURL(l)),d?t.location.href=p:t.open(p,"_blank")||(t.location.href=p);f.readyState=f.DONE,m(),a(p)}()},c=l.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return e=e||t.name||"download",n||(t=u(t)),navigator.msSaveOrOpenBlob(t,e)}:(c.abort=function(){},c.readyState=c.INIT=0,c.WRITING=1,c.DONE=2,c.error=c.onwritestart=c.onprogress=c.onwrite=c.onabort=c.onerror=c.onwriteend=null,function(t,e,n){return new l(t,e||t.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content); -/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */void 0!==t&&t.exports?t.exports.saveAs=r:null!==n(294)&&null!==n(293)&&(void 0===(i=function(){return r}.call(e,n,e,t))||(t.exports=i))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=e.as_type=function(t,e){return[t,e].join("_").toUpperCase()},r=e.with_type=function(t,e){return e.reduce(function(e,n){return(e[n]=i(t,n))&&e},{})};e.crud_type=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r(t,e.concat(["index_loading","index","index_error","show_loading","show","show_error","create_loading","create","create_error","update_loading","update","update_error","destroy_loading","destroy","destroy_error","upload_loading","upload_progress","upload_waiting","upload_complete","upload_error","sort"]))}},function(t,e,n){"use strict";e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t};var i=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return i(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",i="",r=e.indexOf("#");-1!==r&&(i=e.substr(r),e=e.substr(0,r));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===i?"":i}},e.createPath=function(t){var e=t.pathname,n=t.search,i=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}},function(t,e,n){"use strict";n.r(e);var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every(function(e,i){return t(e,n[i])});var r=void 0===e?"undefined":i(e);if(r!==(void 0===n?"undefined":i(n)))return!1;if("object"===r){var o=e.valueOf(),s=n.valueOf();if(o!==e||s!==n)return t(o,s);var a=Object.keys(e),u=Object.keys(n);return a.length===u.length&&a.every(function(i){return t(e[i],n[i])})}return!1}},function(t,e,n){"use strict";function i(t){return"/"===t.charAt(0)}function r(t,e){for(var n=e,i=n+1,r=t.length;i<r;n+=1,i+=1)t[n]=t[i];t.pop()}n.r(e),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],s=t&&i(t),a=e&&i(e),u=s||a;if(t&&i(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var l=void 0;if(o.length){var c=o[o.length-1];l="."===c||".."===c||""===c}else l=!1;for(var h=0,p=o.length;p>=0;p--){var f=o[p];"."===f?r(o,p):".."===f?(r(o,p),h++):h&&(r(o,p),h--)}if(!u)for(;h--;h)o.unshift("..");!u||""===o[0]||o[0]&&i(o[0])||o.unshift("");var d=o.join("/");return l&&"/"!==d.substr(-1)&&(d+="/"),d}},function(t,e,n){"use strict";(function(t,i){var r,o=n(147);r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:i;var s=Object(o.a)(r);e.a=s}).call(this,n(22),n(314)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=n(8),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(53)),c=n(11);var h=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state={username:"",password:"",password2:""},t.handleChange=t.handleChange.bind(t),t.handleSubmit=t.handleSubmit.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"handleChange",value:function(t,e){this.setState(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,t))}},{key:"validate",value:function(){return!(!this.state.password||this.state.password!==this.state.password2)}},{key:"handleSubmit",value:function(t){if(t.preventDefault(),!this.props.auth.loading){if(!this.validate())return this.props.actions.setError("bad password");var e=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(this.state,[]);this.props.actions.signup(e)}}},{key:"render",value:function(){if(this.props.auth.isAuthenticated){var t=this.props.auth.returnTo;return t&&!t.match(/(api|login|logout|signup)/i)||(t="/"),(0,o.h)(u.Redirect,{to:t})}return(0,o.h)("form",{onSubmit:this.handleSubmit},(0,o.h)("h1",null,"New account"),(0,o.h)("br",null),(0,o.h)(c.Group,null,(0,o.h)(c.TextInput,{autofocus:!0,autocapitalize:"off",autocomplete:"off",title:"Username",name:"username",type:"text",value:this.state.username,onInput:this.handleChange}),(0,o.h)(c.TextInput,{title:"Password",name:"password",type:"password",value:this.state.password,onInput:this.handleChange}),(0,o.h)(c.TextInput,{title:"Password again :)",name:"password2",type:"password",value:this.state.password2,onInput:this.handleChange}),(0,o.h)(c.Button,{loading:this.props.auth.loading},"Sign up"),this.renderAuthError()))}},{key:"renderAuthError",value:function(){return this.props.auth.error?(0,o.h)("div",{className:"form-input-hint"},"Please doublecheck the form (o=_o~~)"):(0,o.h)("div",{className:"form-input-hint"})}}]),e}();e.default=(0,a.connect)(function(t){return{auth:t.auth}},function(t){return{actions:(0,s.bindActionCreators)(i({},l),t)}})(h)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=n(8),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(53));var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(t){this.props.actions.logout()}},{key:"render",value:function(){return(0,r.h)(a.Redirect,{to:"/"})}}]),e}();e.default=(0,s.connect)(function(t){return{}},function(t){return{actions:(0,o.bindActionCreators)(u,t)}})(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(2);e.default=(0,r.connect)(function(t){return{}},function(t,e){return{}})(function(t){var e=t.fullscreen?"player fullscreen":"player";return t.square&&(e+=" square"),(0,i.h)("div",{className:e},(0,i.h)("canvas",{width:t.width,height:t.height}))})},function(t,e,n){"use strict";var i=n(95);function r(t){i.call(this,t)}n(10).inherits(r,i),r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(10);function r(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},t.exports=r},function(t,e,n){"use strict";var i=n(94);function r(t){i.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}n(10).inherits(r,i),r.prototype.byteAt=function(t){return this.data[this.zero+t]},r.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===i&&this.data[o+3]===r)return o-this.zero;return-1},r.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&n===o[1]&&i===o[2]&&r===o[3]},r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(10),r=n(24),o=n(95),s=n(173),a=n(172),u=n(93);t.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||r.uint8array?"nodebuffer"===e?new a(t):r.uint8array?new u(i.transformTo("uint8array",t)):new o(i.transformTo("array",t)):new s(t)}},function(t,e,n){"use strict";e.LOCAL_FILE_HEADER="PK",e.CENTRAL_FILE_HEADER="PK",e.CENTRAL_DIRECTORY_END="PK",e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",e.ZIP64_CENTRAL_DIRECTORY_END="PK",e.DATA_DESCRIPTOR="PK\b"},function(t,e,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,n){"use strict";var i=n(23),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new i.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",s=0;s<e;s++)n+=String.fromCharCode(t[s]);return n}s[254]=s[254]=1,e.string2buf=function(t){var e,n,r,o,s,a=t.length,u=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),u+=n<128?1:n<2048?2:n<65536?3:4;for(e=new i.Buf8(u),s=0,o=0;s<u;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},e.buf2binstring=function(t){return u(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},e.buf2string=function(t,e){var n,i,r,o,a=e||t.length,l=new Array(2*a);for(i=0,n=0;n<a;)if((r=t[n++])<128)l[i++]=r;else if((o=s[r])>4)l[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n<a;)r=r<<6|63&t[n++],o--;o>1?l[i++]=65533:r<65536?l[i++]=r:(r-=65536,l[i++]=55296|r>>10&1023,l[i++]=56320|1023&r)}return u(l,i)},e.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0?e:0===n?e:n+s[t[n]]>e?n:e}},function(t,e,n){"use strict";var i=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();t.exports=function(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}},function(t,e,n){"use strict";t.exports=function(t,e,n,i){for(var r=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{o=o+(r=r+e[i++]|0)|0}while(--s);r%=65521,o%=65521}return r|o<<16|0}},function(t,e,n){"use strict";var i=n(16);e.STORE={magic:"\0\0",compressWorker:function(t){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},e.DEFLATE=n(187)},function(t,e,n){"use strict";var i=n(16),r=n(69);function o(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n(10).inherits(o,i),o.prototype.processChunk=function(t){this.streamInfo.crc32=r(t.data,this.streamInfo.crc32||0),this.push(t)},t.exports=o},function(t,e,n){"use strict";var i=n(10),r=n(16);function o(t){r.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(o,r),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}r.prototype.processChunk.call(this,t)},t.exports=o},function(t,e,n){"use strict";var i=n(10),r=n(16);function o(t){r.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}i.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},function(t,e,n){"use strict";e.base64=!1,e.binary=!1,e.dir=!1,e.createFolders=!0,e.date=null,e.compression=null,e.compressionOptions=null,e.comment=null,e.unixPermissions=null,e.dosPermissions=null},function(t,e,n){"use strict";(function(e){var i=n(10),r=n(191),o=n(16),s=n(113),a=n(24),u=n(45),l=null;if(a.nodestream)try{l=n(190)}catch(t){}function c(t,n){return new u.Promise(function(r,o){var a=[],u=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",function(t,e){a.push(t),n&&n(e)}).on("error",function(t){a=[],o(t)}).on("end",function(){try{var t=function(t,e,n){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),n);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(l,function(t,n){var i,r=0,o=null,s=0;for(i=0;i<n.length;i++)s+=n[i].length;switch(t){case"string":return n.join("");case"array":return Array.prototype.concat.apply([],n);case"uint8array":for(o=new Uint8Array(s),i=0;i<n.length;i++)o.set(n[i],r),r+=n[i].length;return o;case"nodebuffer":return e.concat(n);default:throw new Error("concat : unsupported type '"+t+"'")}}(u,a),c);r(t)}catch(t){o(t)}a=[]}).resume()})}function h(t,e,n){var s=e;switch(e){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=e,this._mimeType=n,i.checkSupport(s),this._worker=t.pipe(new r(s)),t.lock()}catch(t){this._worker=new o("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return c(this,t)},on:function(t,e){var n=this;return"data"===t?this._worker.on(t,function(t){e.call(n,t.data,t.meta)}):this._worker.on(t,function(){i.delay(e,arguments,n)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:"nodebuffer"!==this._outputType},t)}},t.exports=h}).call(this,n(47).Buffer)},function(t,e,n){var i=n(72),r=n(56).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(204);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){var n=t.exports={version:"2.3.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";var i=n(10),r=n(24),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.encode=function(t){for(var e,n,r,s,a,u,l,c=[],h=0,p=t.length,f=p,d="string"!==i.getTypeOf(t);h<t.length;)f=p-h,d?(e=t[h++],n=h<p?t[h++]:0,r=h<p?t[h++]:0):(e=t.charCodeAt(h++),n=h<p?t.charCodeAt(h++):0,r=h<p?t.charCodeAt(h++):0),s=e>>2,a=(3&e)<<4|n>>4,u=f>1?(15&n)<<2|r>>6:64,l=f>2?63&r:64,c.push(o.charAt(s)+o.charAt(a)+o.charAt(u)+o.charAt(l));return c.join("")},e.decode=function(t){var e,n,i,s,a,u,l=0,c=0;if("data:"===t.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var h,p=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&p--,t.charAt(t.length-2)===o.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=r.uint8array?new Uint8Array(0|p):new Array(0|p);l<t.length;)e=o.indexOf(t.charAt(l++))<<2|(s=o.indexOf(t.charAt(l++)))>>4,n=(15&s)<<4|(a=o.indexOf(t.charAt(l++)))>>2,i=(3&a)<<6|(u=o.indexOf(t.charAt(l++))),h[c++]=e,64!==a&&(h[c++]=n),64!==u&&(h[c++]=i);return h}},function(t,e,n){"use strict";t.exports=o;var i=n(26),r=n(46);function o(t){if(!(this instanceof o))return new o(t);i.call(this,t),this._transformState={afterTransform:function(t,e){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),i(t);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",s)}function s(){var t=this;"function"==typeof this._flush?this._flush(function(e,n){a(t,e,n)}):a(this,null,null)}function a(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}r.inherits=n(30),r.inherits(o,i),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,i.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,n){var i=this._transformState;if(i.writecb=n,i.writechunk=t,i.writeencoding=e,!i.transforming){var r=this._readableState;(i.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var n=this;i.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){"use strict";var i=n(58).Buffer,r=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=l,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=c,this.end=h,e=3;break;default:return this.write=p,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function c(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var n=function(t,e,n){var i=e.length-1;if(i<n)return 0;var r=s(e[i]);if(r>=0)return r>0&&(t.lastNeed=r-1),r;if(--i<n||-2===r)return 0;if((r=s(e[i]))>=0)return r>0&&(t.lastNeed=r-2),r;if(--i<n||-2===r)return 0;if((r=s(e[i]))>=0)return r>0&&(2===r?r=0:t.lastNeed=r-3),r;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";var i=n(59);function r(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||i.nextTick(r,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(i.nextTick(r,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){t.exports=n(75).EventEmitter},function(t,e,n){"use strict";(function(e,i){var r=n(59);t.exports=g;var o,s=n(120);g.ReadableState=v;n(75).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=n(117),l=n(58).Buffer,c=e.Uint8Array||function(){};var h=n(46);h.inherits=n(30);var p=n(218),f=void 0;f=p&&p.debuglog?p.debuglog("stream"):function(){};var d,m=n(217),y=n(116);h.inherits(g,u);var _=["error","close","destroy","pause","resume"];function v(t,e){o=o||n(26),t=t||{};var i=e instanceof o;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=n(115).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function g(t){if(o=o||n(26),!(this instanceof g))return new g(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function b(t,e,n,i,r){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,x(t)}(t,s)):(r||(o=function(t,e){var n;i=e,l.isBuffer(i)||i instanceof c||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var i;return n}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?w(t,s,e,!1):O(t,s)):w(t,s,e,!1))):i||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(s)}function w(t,e,n,i){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&x(t)),O(t,e)}Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(t,e){this.push(null),e(t)},g.prototype.push=function(t,e){var n,i=this._readableState;return i.objectMode?n=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=l.from(t,e),e=""),n=!0),b(this,t,e,!1,n)},g.prototype.unshift=function(t){return b(this,t,null,!0,!1)},g.prototype.isPaused=function(){return!1===this._readableState.flowing},g.prototype.setEncoding=function(t){return d||(d=n(115).StringDecoder),this._readableState.decoder=new d(t),this._readableState.encoding=t,this};var k=8388608;function S(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function x(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(T,t):T(t))}function T(t){f("emit readable"),t.emit("readable"),E(t)}function O(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(P,t,e))}function P(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(f("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function A(t){f("readable nexttick read 0"),t.read(0)}function C(t,e){e.reading||(f("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),E(t),e.flowing&&!e.reading&&t.read(0)}function E(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var i;t<e.head.data.length?(i=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):i=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,i=1,r=n.data;t-=r.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(s===o.length?r+=o:r+=o.slice(0,t),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e):function(t,e){var n=l.allocUnsafe(t),i=e.head,r=1;i.data.copy(n),t-=i.data.length;for(;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++r}return e.length-=r,n}(t,e);return i}(t,e.buffer,e.decoder),n);var n}function R(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,r.nextTick(j,e,t))}function j(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function N(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1}g.prototype.read=function(t){f("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?R(this):x(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&R(this),null;var i,r=e.needReadable;return f("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&f("length less than watermark",r=!0),e.ended||e.reading?f("reading or ended",r=!1):r&&(f("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=S(n,e))),null===(i=t>0?M(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&R(this)),null!==i&&this.emit("data",i),i},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?c:g;function l(e,i){f("onunpipe"),e===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,f("cleanup"),t.removeListener("close",_),t.removeListener("finish",v),t.removeListener("drain",h),t.removeListener("error",y),t.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",m),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){f("onend"),t.end()}o.endEmitted?r.nextTick(u):n.once("end",u),t.on("unpipe",l);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,E(t))}}(n);t.on("drain",h);var p=!1;var d=!1;function m(e){f("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==N(o.pipes,t))&&!p&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function y(e){f("onerror",e),g(),t.removeListener("error",y),0===a(t,"error")&&t.emit("error",e)}function _(){t.removeListener("finish",v),g()}function v(){f("onfinish"),t.removeListener("close",_),g()}function g(){f("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",y),t.once("close",_),t.once("finish",v),t.emit("pipe",n),o.flowing||(f("pipe resume"),n.resume()),t},g.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<r;o++)i[o].emit("unpipe",this,n);return this}var s=N(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},g.prototype.on=function(t,e){var n=u.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&x(this):r.nextTick(A,this))}return n},g.prototype.addListener=g.prototype.on,g.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(C,t,e))}(this,t)),this},g.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},g.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var r in t.on("end",function(){if(f("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(r){(f("wrapped data"),n.decoder&&(r=n.decoder.write(r)),!n.objectMode||null!==r&&void 0!==r)&&((n.objectMode||r&&r.length)&&(e.push(r)||(i=!0,t.pause())))}),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var o=0;o<_.length;o++)t.on(_[o],this.emit.bind(this,_[o]));return this._read=function(e){f("wrapped _read",e),i&&(i=!1,t.resume())},this},Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),g._fromList=M}).call(this,n(22),n(43))},function(t,e,n){t.exports=n(219)},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.train_task=e.live_task=e.fetch_task=void 0;r(n(15)),r(n(14)),r(n(6));var i=r(n(7));function r(t){return t&&t.__esModule?t:{default:t}}e.fetch_task=function(t,e,n){return function(r){if(!t)return console.log("input file inaccessible (no url)");var o={module:"pix2pix",activity:"fetch",dataset:n,opt:{url:t,file_id:e,dataset:n}};return i.default.queue.add_task(o)}},e.live_task=function(t,e){return function(n){var r={module:"pix2pix",activity:"live",dataset:t,checkpoint:e,opt:{poll_delay:.09}};return console.log(r),console.log("add live task"),i.default.queue.add_task(r)}},e.train_task=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return function(r){var o={module:"pix2pix",activity:"train",dataset:t.name,epoch:0,epochs:n,opt:{folder_id:e,load_size:264}};return console.log(o),i.default.queue.add_task(o)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"morph",displayName:"Morph",datatype:"video"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.progress;if(!e)return;for(var n=e.i,r=e.n,o=[],s=0;s<r;s++)o.push((0,i.h)("div",{key:s,className:s<n?"x":"o"}));return(0,i.h)("div",{className:"progress"},o)};var i=n(1)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=function(t){var e=t.db,n=t.path,c=t.emptyText,h=t.activity;if(!e)return null;if(e.loading||!e.data)return(0,r.h)("div",{className:"col folderList"},(0,r.h)(l.default,{progress:e.progress}));var p=e.data.folders;h&&(p=p.filter(function(t){return t.activity===h}));if(!p.length&&c)return(0,r.h)("div",{className:"col folderList"},c);console.log(f);var f=p.map(function(t){var a=e.data.folderLookup[t.id],l=a.files?a.files.length:0,c=s.default.hush_null(l),h=i(c,2),p=h[0];h[1];return(0,r.h)(u.default,{title:(0,r.h)(o.Link,{to:n+a.id+"/"},a.name)},(0,r.h)("span",{className:p},l," file",s.default.courtesy_s(l)))});return(0,r.h)("div",{className:"col folderList"},(0,r.h)(a.default,{title:"Projects"},f))};var r=n(1),o=(n(3),n(2),n(8)),s=c(n(4)),a=c(n(25)),u=c(n(39)),l=c(n(17));function c(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1);var o=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleChange",value:function(t){var e=this;this.props.onChange&&this.props.onChange(),t.stopPropagation(),t.preventDefault(),this.setState({thumbnails:[],images:[]});var n=t.dataTransfer?t.dataTransfer.files:t.target.files,i=[],r=void 0;for(r=0;r<n.length;r++)i.push(n[r]);i.map(function(t){return function(n,i){e.props.onUpload(t,t.name).then(n).catch(i)}}).reduce(function(t,e){return t.then(e)},Promise.resolve())}},{key:"render",value:function(){return(0,r.h)("div",{className:"fileUpload param"},(0,r.h)("label",null,(0,r.h)("span",null,this.props.title),(0,r.h)("input",{type:"file",accept:this.props.accept||"*/*",multiple:this.props.multiple,onChange:this.handleChange}),(0,r.h)("button",null,this.props.label||"Choose file...")))}}]),e}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.actions=e.parser=e.util=void 0;var i,r=n(260),o=n(4),s=(i=o)&&i.__esModule?i:{default:i},a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(258));e.util=s.default,e.parser=a;e.actions=["folder","file","dataset","task","user"].reduce(function(t,e){return(t[e]=(0,r.crud_actions)(e))&&t},{})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1);function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var s=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,s=Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=i=o(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),i.state={x:0,y:0},o(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this,e=this.state,n=e.x,i=e.y,o=this.props,s=o.x,a=o.y,u=o.max,l=void 0===u?1/0:u,c=o.onClick,h=o.onHover;return(0,r.h)("table",{className:"buttonGrid"},(0,r.h)("tr",{className:"row"},(0,r.h)("th",null," "),s.map(function(t){return(0,r.h)("th",{className:t===n&&"bold"},t)})),a.map(function(e){return(0,r.h)("tr",{className:"row"},(0,r.h)("th",{className:e===i&&"bold"},e),s.map(function(n){return(0,r.h)("td",null,n*e>l?" ":(0,r.h)("button",{onClick:function(){return c(n,e)},onMouseEnter:function(){t.setState({x:n,y:e}),h(n,e)}}," "))}))}))}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(n(8),function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(53))),u=n(11);function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state={username:"",password:""},t.handleChange=t.handleChange.bind(t),t.handleSubmit=t.handleSubmit.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleChange",value:function(t,e){var n;this.setState((l(n={},e,t),l(n,"error",null),n))}},{key:"handleSubmit",value:function(t){t.preventDefault(),this.props.auth.loading||this.props.actions.login(this.state.username,this.state.password)}},{key:"render",value:function(){return(0,r.h)("form",{onSubmit:this.handleSubmit},(0,r.h)("h1",null,"Log in"),(0,r.h)("br",null),(0,r.h)(u.Group,null,(0,r.h)(u.TextInput,{autofocus:!0,autocapitalize:"off",autocomplete:"off",title:"Username",name:"username",type:"text",value:this.state.username,onInput:this.handleChange}),(0,r.h)(u.TextInput,{title:"Password",name:"password",type:"password",value:this.state.password,onInput:this.handleChange}),(0,r.h)(u.Button,{loading:this.props.auth.loading},"Login"),this.renderAuthError()))}},{key:"renderAuthError",value:function(){return this.props.auth.error?(0,r.h)("div",{className:"form-input-hint"},"There was an error logging you in (bad password?)"):null}}]),e}();e.default=(0,s.connect)(function(t){return{auth:t.auth}},function(t){return{actions:(0,o.bindActionCreators)(a,t)}})(c)},function(t,e){t.exports=e=window.fetch,e.default=window.fetch.bind(window),e.Headers=window.Headers,e.Request=window.Request,e.Response=window.Response},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.destroy=void 0,e.crud_fetch=function(t,e){var n="/api/"+t+"/"+(e||"");return{index:function(t){return(0,o.default)(function(t,e){var n=new URL(window.location.origin+t);e&&Object.keys(e).forEach(function(t){return n.searchParams.append(t,e[t])});return n}(n,t),{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}).then(function(t){return t.json()}).catch(c)},show:function(t){return(0,o.default)(n+t,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}},{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}).then(function(t){return t.json()}).catch(c)},create:function(t){return(0,o.default)(n,a(t)).then(function(t){return t.json()}).catch(c)},update:function(t){return(0,o.default)(n+t.id,u(t)).then(function(t){return t.json()}).catch(c)},destroy:function(t){return(0,o.default)(n+t.id,l(t)).then(function(t){return t.json()}).catch(c)}}},e._get_headers=s,e.post=a,e.postBody=function(t){return{method:"POST",body:t,credentials:"same-origin",headers:{Accept:"application/json"}}},e.put=u;var i,r=n(129),o=(i=r)&&i.__esModule?i:{default:i};function s(){return{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}}function a(t){return{method:"POST",body:JSON.stringify(t),credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}}function u(t){return{method:"PUT",body:JSON.stringify(t),credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}}function l(t){return{method:"DELETE",body:JSON.stringify(t),credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}}function c(t){console.warn(t)}e.destroy=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a(n(54)),r=n(4),o=n(271),s=a(n(268));function a(t){return t&&t.__esModule?t:{default:t}}var u=512,l=u/4,c=new s.default(u);function h(t,e){var n=t.length,i=0,r=void 0;for(r=0;r<e;r++)i=r/e,i*=i,t[r]*=i,t[n-r]*=i}function p(t){var e=t.data,n=t.fft_size,i=t.sr,r=t.fft_overlap,o=e.length,s=new Array(o),a=void 0;for(a=0;a<o;a++)s[a]=e[a].concat(),s[a][2]=0;return{data:s,fft_size:n,sr:i,fft_overlap:r}}function f(t,e){var n=p(t),i=t.data,r=t.sr,o=t.fft_size,s=t.fft_overlap,a=i.length,u=n.data,l=void 0,c=void 0,h=void 0,f=void 0;for(c=e.length;c<o;c++)e[c]=c;for(l=0;l<a;l++){for(h=i[l],f=u[l]=i[l].concat(),h[0]=0,h[2]=0,h[4]=0,c=0;c<o/2;c++)f[2*c]=h[2*e[c]],f[2*c+1]=h[2*e[c]+1];for(;c<o;c++)f[2*c]=0,f[2*c+1]=0}return{data:u,sr:r,fft_size:o,fft_overlap:s}}e.default={fft_size:u,fft_overlap:l,toSpectrum:function(t,e){e=e||44100;var n=o.windows.construct("ham",u),i=new Array(u),r=t.length,s=Math.ceil(r/u)*u,a=void 0,h=void 0,p=void 0,f=[];for(a=-u;a<s;a+=l){for(h=0;h<u;h++)i[h]=t[a+h]*n[h]||0;p=c.createComplexArray(),c.realTransform(p,i),c.completeSpectrum(p),f.push(p)}return{data:f,sr:e,fft_size:u,fft_overlap:l}},fromSpectrum:function(t){var e=t.data,n=t.sr,r=t.fft_size,s=t.fft_overlap,a=e.length,u=o.windows.construct("ham",r),l=c.createComplexArray(),p=s*a,f=i.default.context.createBuffer(1,p,n),d=f.getChannelData(0),m=void 0,y=void 0,_=void 0,v=void 0;for(m=0;m<a;m++)for(v=e[m],c.inverseTransform(l,v),_=m*s,y=0;y<r;y++)d[_+y]+=l[2*y]*u[y]||0;return h(d,r),f},fromImageData:function(t,e,n,i){var r=t.data,o=t.width,s=t.height,a=new Array(o),c=void 0,h=void 0,p=void 0,f=void 0,d=void 0;for(h=0;h<s;h++){var m=a[h]=new Float32Array(4*s);for(c=0;c<o;c++)p=4*(c*o+h),m[f=2*c]=(r[p]/255-.5)*n,m[f+1]=(r[p+1]/255-.5)*i,m[d=2*(s-h+s)]=m[f],m[d+1]=0;m[2*s]=m[2*s+1]=m[2*s-1]=m[2*s-2]=0}return{data:a,sr:e,fft_size:u,fft_overlap:l}},binToHz:function(t,e){return e/t.fft_size*t.sr},fadeInOut:h,cloneSpectrum:p,reverseSpectrum:function(t){var e=p(t);return e.data=e.data.reverse(),e},shuffleSpectrum:function(t){var e=t.fft_size,n=new Array(e),i=void 0;for(i=0;i<e;i++)n[i]=i;return(0,r.shuffle)(n),f(t,n)},invertSpectrum:function(t){var e=t.fft_size,n=new Array(e),i=void 0;for(i=0;i<e;i++)n[i]=e-i-1;return f(t,n)},rotateSpectrum:function(t,e){var n=t.fft_size;e&&e<1&&(e-=.5,e*=n),e=Math.floor(e);var i=new Array(n),o=void 0;for(o=0;o<n;o++)i[o]=(0,r.mod)(o+e,n/2);return f(t,i)},reorderBins:f,linearBins:function(t,e){e=e||1;var n=[],i=void 0,o=void 0;for(o=0;o<e;o++)n[o]=[];var s=Math.floor(t.fft_size/e),a=(0,r.quantize)(t.fft_size,e);for(i=0;i<a;i++)n[o=Math.floor(i/s)]=n[o]||[],n[o].push(i);for(;i<t.fft_size;i++)n[o].push(i);return n},logarithmicBins:function(t){var e=[],n=void 0,i=void 0,r=void 0,o=Math.log2(t.fft_size)-1;for(n=0,r=0,i=0;n<o;n++)for(i+=1<<n,e[n]=[];r<i;r++)e[n].push(r);return e},concatBins:function(t){return t.reduce(function(t,e){return t.concat(e)},[])},reverseBins:function(t){return t.map(function(t){return t.reverse()})},minBins:function(t){return t.map(function(t){var e=t[0];return t.map(function(){return e})})},maxBins:function(t){return t.map(function(t){var e=t[t.length-1];return t.map(function(){return e})})},rotatePhase:function(t,e){var n=t.data,i=t.fft_size,r=void 0,o=void 0,s=void 0,a=n.length;for(r=0;r<a;r++)for(s=n[r],o=0;o<i;o++)s[2*o+1]+=e;return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(54),o=(i=r)&&i.__esModule?i:{default:i};var s=new o.default.Compressor(-30,3).toMaster(),a=new o.default.Gain(1).connect(s);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.spectrum=function(t,e,n,i,r){var o=t.data,c=(t.fft_size,t.fft_size/2),h=o.length;s.width=o.length,s.height=c;var p=ctx.createImageData(s.width,s.height),f=p.data,d=void 0,m=void 0,y=void 0,_=void 0,v=void 0,g=void 0,b=void 0,w=void 0;for(d=0;d<h;d++)for(b=o[d],m=0;m<c;m++)y=4*((c-m)*h+d),v=b[_=2*m],g=mod(b[_+1],2*Math.PI)/(2*Math.PI),w=color.hsl2rgb((g+1)/2,1,1-Math.abs(v/10)),f[y]=w[0],f[y+1]=w[1],f[y+2]=w[2],f[y+3]=255;a.putImageData(p,0,0);var k=t.fft_overlap*h;e=e*devicePixelRatio||0,n=n*devicePixelRatio||Math.floor(l/4),i=i*devicePixelRatio||u,r=r*devicePixelRatio||l/4;var S=Math.round(k/t.sr*pixels_per_second),x=Math.floor(r);ctx.save(),clear(1,e,n,u,x),ctx.drawImage(s,e,n,S,x),ctx.restore()},e.raw_spectrum=function(t,e,n,i,r,s,a){var u=t.data,l=(t.fft_size,t.fft_size/2),c=u.length,h=document.createElement("canvas"),p=h.getContext("2d-lodpi");h.width=u.length,h.height=l;var f=p.createImageData(h.width,h.height),d=f.data,m=void 0,y=void 0,_=void 0,v=void 0,g=void 0,b=void 0,w=void 0,k=-s,S=-a,x=s-k,T=a-S,O=0,P=0,A=void 0,C=void 0;for(m=0;m<c;m++){for(w=u[m],O=0,P=0,y=0;y<l;y++)_=4*(y*c+m),A=w[v=2*y],C=w[v+1],O+=A,P+=C,g=o.default.clamp((A-k)/x*255,0,255),b=o.default.clamp((C-S)/T*255,0,255),d[_+0]=g,d[_+1]=b,d[_+2]=127,d[_+3]=255;O/=l,P/=l}return c,c,p.putImageData(f,0,0),{canvas:h,imageData:f}};var i,r=n(4),o=(i=r)&&i.__esModule?i:{default:i};var s=document.createElement("canvas"),a=s.getContext("2d-lodpi"),u=256,l=256},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.play=function(t){var e=o.default.fromImageData(t.imageData,44100,a,u),n=o.default.fromSpectrum(e),s=new i.default.Player(n);s.connect(r.default),s.start(i.default.now())};s(n(6));var i=s(n(54)),r=(function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(n(133)),s(n(132))),o=s(n(131));function s(t){return t&&t.__esModule?t:{default:t}}var a=8,u=8},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.syscall_async=e.thumbnail=e.read_file=e.upload_file=e.run_script=e.list_sequences=e.count_directory=e.list_directory=e.disk_usage=e.run_system_command=void 0;var i,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=n(15),s=(i=o)&&i.__esModule?i:{default:i},a=n(41);e.run_system_command=function(t){return u("run_system_command",t)},e.disk_usage=function(t){return u("run_system_command",r({cmd:"du"},t))},e.list_directory=function(t){return u("list_directory",t).then(function(t){return t.files})},e.count_directory=function(t){return u("count_directory",t).then(function(t){return t.count})},e.list_sequences=function(t){return u("list_sequences",t).then(function(t){return t.sequences})},e.run_script=function(t){return u("run_script",t)},e.upload_file=function(t){return u("upload_file",t)},e.read_file=function(t){return u("read_file",t).then(function(t){return t.file})},e.thumbnail=function(t){return u("thumbnail",t).then(function(t){return t.file})};var u=e.syscall_async=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;return n=e.ttl||n,new Promise(function(i,r){var o=(0,s.default)(),u=setTimeout(function(){a.socket.off("system_res",l),r("timeout")},n),l=function t(e){e.uuid&&e.uuid===o&&(clearTimeout(u),a.socket.off("system_res",t),i(e))};a.socket.emit("system",{cmd:t,payload:e,uuid:o}),a.socket.on("system_res",l)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.frameTimestamp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=o(((t/=i)%60).toFixed(1));if((t=Math.floor(t/60))>60)return Math.floor(t/60)+":"+o(t%60)+":"+e;return t%60+":"+e},e.timeInSeconds=function(t){return(t/10).toFixed(1)+" s."},e.gerund=function(t){return t.replace(/e?$/,"ing")},e.commatize=r,e.carbon_date=function(t,e){var n,i=(+new Date-new Date(t))/1e3;n=!e&&i<86400?"new":i<604800?"recent":i<1209600?"med":i<3024e3?"old":i<12315200?"older":"quiet";return n},e.carbon_time=function(t,e){var n,i=(+new Date-new Date(t))/1e3;n=!e&&i<3600?"new":i<10800?"recent":i<43200?"med":i<86400?"old":i<172800?"older":"quiet";return n},e.hush_views=function(t,e,n){var i=r(t,1e3);if(e=e||1,(t=t||0)<30)return["quiet",t+" v."];return t<200?["quiet",i+" v."]:t<500?["quiet",i+" v."]:t<1e3?["old",i+" v."]:t<5e3?["med",i+" kv."]:n||t<1e4?["recent",i+" kv."]:["new",i+" kv."]},e.hush_threads=function(t,e,n){var i=r(t,1e3);return e=e||1,(t=t||0)<10?["quiet",t+" t."]:t<25?["old",i+" t."]:t<50?["med",i+" t."]:n||t<100?["recent",i+" t."]:["new",i+" t."]},e.hush_size=function(t,e,n){var i=r(Math.round(t/1024));if(e=1,!(t=t||0))return["",""];if(t<1e3)return["quiet",t+" b."];if(t<1e6)return["quiet",i+" kb."];if(t<2e7/e)return["quiet",i+" mb."];if(t<5e7/e)return["old",i+" mb."];if(t<8e7/e)return["med",i+" mb."];if(n||t<17e7/e)return["recent",i+" mb."];return["new",i+" mb."]},e.hush_null=function(t,e,n){var i=e?t+" "+e+".":t;return t<3?["quiet",i]:t<6?["older",i]:t<10?["old",i]:t<16?["med",i]:n||t<21?["recent",i]:["new",i]},e.get_age=function(t){var e,n=Math.abs(+Date.now()-new Date(t))/1e3,i=Math.floor;if(n<5)return"now";if(n<60)return i(n)+"s";if((n/=60)<60)return i(n)+"m";if(e=i(n%60),n/=60,e>0&&n<2)return i(n)+"h"+e+"m";if(n<24)return i(n)+"h";if((n/=24)<7)return i(n)+"d";if((n/=7)<12)return i(n)+"w";if((n/=4)<12)return i(n)+"m";return i(n/=12)+"y"},e.courtesy_s=function(t,e){return 1==t?"":e||"s"},e.pad=o;var i=25;function r(t,e){e=e||1024;var n,i=[],r=0,o=Math.floor;t>e&&(t/=e,i.unshift(o(10*t%10)),i.unshift("."));do{n=t%10,!(t=o(t/10))||++r%3||(n=" "+o(n)),i.unshift(o(n))}while(t);return i.join("")}function o(t,e){return t<10?"0"+t:t}},function(t,e,n){"use strict";e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t};var i=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return i(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",i="",r=e.indexOf("#");-1!==r&&(i=e.substr(r),e=e.substr(0,r));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===i?"":i}},e.createPath=function(t){var e=t.pathname,n=t.search,i=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=e.CALL_HISTORY_METHOD="@@router/CALL_HISTORY_METHOD";function r(t){return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return{type:i,payload:{method:t,args:n}}}}var o=e.push=r("push"),s=e.replace=r("replace"),a=e.go=r("go"),u=e.goBack=r("goBack"),l=e.goForward=r("goForward");e.routerActions={push:o,replace:s,go:a,goBack:u,goForward:l}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};e.routerReducer=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.type,s=e.payload;if(n===r)return i({},t,{locationBeforeTransitions:s});return t};var r=e.LOCATION_CHANGE="@@router/LOCATION_CHANGE",o={locationBeforeTransitions:null}},function(t,e,n){"use strict";e.__esModule=!0;e.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),e.addEventListener=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},e.getConfirmation=function(t,e){return e(window.confirm(t))},e.supportsHistory=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},e.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},e.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},e.isExtraneousPopstateEvent=function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")}},function(t,e,n){"use strict";e.__esModule=!0;var i,r=n(9),o=(i=r)&&i.__esModule?i:{default:i};e.default=function(){var t=null,e=[];return{setPrompt:function(e){return(0,o.default)(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,i,r){if(null!=t){var s="function"==typeof t?t(e,n):t;"string"==typeof s?"function"==typeof i?i(s,r):((0,o.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),r(!0)):r(!1!==s)}else r(!0)},appendListener:function(t){var n=!0,i=function(){n&&t.apply(void 0,arguments)};return e.push(i),function(){n=!1,e=e.filter(function(t){return t!==i})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];e.forEach(function(t){return t.apply(void 0,n)})}}}},function(t,e,n){"use strict";e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=a(n(88)),o=a(n(87)),s=n(86);function a(t){return t&&t.__esModule?t:{default:t}}e.createLocation=function(t,e,n,o){var a=void 0;"string"==typeof t?(a=(0,s.parsePath)(t)).state=e:(void 0===(a=i({},t)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==e&&void 0===a.state&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=(0,r.default)(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,o.default)(t.state,e.state)}},function(t,e,n){t.exports=function(){"use strict";var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,i=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,o=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,a=s&&s(Object);return function u(l,c,h){if("string"!=typeof c){if(a){var p=s(c);p&&p!==a&&u(l,p,h)}var f=i(c);r&&(f=f.concat(r(c)));for(var d=0;d<f.length;++d){var m=f[d];if(!(t[m]||e[m]||h&&h[m])){var y=o(c,m);try{n(l,m,y)}catch(t){}}}return l}return l}}()},function(t,e,n){"use strict";e.__esModule=!0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=c(n(9)),o=c(n(12)),s=n(143),a=n(86),u=c(n(142)),l=n(141);function c(t){return t&&t.__esModule?t:{default:t}}var h={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+(0,a.stripLeadingSlash)(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:a.stripLeadingSlash,decodePath:a.addLeadingSlash},slash:{encodePath:a.addLeadingSlash,decodePath:a.addLeadingSlash}},p=function(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)},f=function(t){var e=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,e>=0?e:0)+"#"+t)};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.default)(l.canUseDOM,"Hash history needs a DOM");var e=window.history,n=(0,l.supportsGoWithoutReloadUsingHash)(),c=t.getUserConfirmation,d=void 0===c?l.getConfirmation:c,m=t.hashType,y=void 0===m?"slash":m,_=t.basename?(0,a.stripTrailingSlash)((0,a.addLeadingSlash)(t.basename)):"",v=h[y],g=v.encodePath,b=v.decodePath,w=function(){var t=b(p());return(0,r.default)(!_||(0,a.hasBasename)(t,_),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+t+'" to begin with "'+_+'".'),_&&(t=(0,a.stripBasename)(t,_)),(0,s.createLocation)(t)},k=(0,u.default)(),S=function(t){i(D,t),D.length=e.length,k.notifyListeners(D.location,D.action)},x=!1,T=null,O=function(){var t=p(),e=g(t);if(t!==e)f(e);else{var n=w(),i=D.location;if(!x&&(0,s.locationsAreEqual)(i,n))return;if(T===(0,a.createPath)(n))return;T=null,P(n)}},P=function(t){x?(x=!1,S()):k.confirmTransitionTo(t,"POP",d,function(e){e?S({action:"POP",location:t}):A(t)})},A=function(t){var e=D.location,n=R.lastIndexOf((0,a.createPath)(e));-1===n&&(n=0);var i=R.lastIndexOf((0,a.createPath)(t));-1===i&&(i=0);var r=n-i;r&&(x=!0,j(r))},C=p(),E=g(C);C!==E&&f(E);var M=w(),R=[(0,a.createPath)(M)],j=function(t){(0,r.default)(n,"Hash history go(n) causes a full page reload in this browser"),e.go(t)},N=0,F=function(t){1===(N+=t)?(0,l.addEventListener)(window,"hashchange",O):0===N&&(0,l.removeEventListener)(window,"hashchange",O)},L=!1,D={length:e.length,action:"POP",location:M,createHref:function(t){return"#"+g(_+(0,a.createPath)(t))},push:function(t,e){(0,r.default)(void 0===e,"Hash history cannot push state; it is ignored");var n=(0,s.createLocation)(t,void 0,void 0,D.location);k.confirmTransitionTo(n,"PUSH",d,function(t){if(t){var e=(0,a.createPath)(n),i=g(_+e);if(p()!==i){T=e,function(t){window.location.hash=t}(i);var o=R.lastIndexOf((0,a.createPath)(D.location)),s=R.slice(0,-1===o?0:o+1);s.push(e),R=s,S({action:"PUSH",location:n})}else(0,r.default)(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),S()}})},replace:function(t,e){(0,r.default)(void 0===e,"Hash history cannot replace state; it is ignored");var n=(0,s.createLocation)(t,void 0,void 0,D.location);k.confirmTransitionTo(n,"REPLACE",d,function(t){if(t){var e=(0,a.createPath)(n),i=g(_+e);p()!==i&&(T=e,f(i));var r=R.indexOf((0,a.createPath)(D.location));-1!==r&&(R[r]=e),S({action:"REPLACE",location:n})}})},go:j,goBack:function(){return j(-1)},goForward:function(){return j(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=k.setPrompt(t);return L||(F(1),L=!0),function(){return L&&(L=!1,F(-1)),e()}},listen:function(t){var e=k.appendListener(t);return F(1),function(){F(-1),e()}}};return D}},function(t,e,n){"use strict";e.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=h(n(9)),s=h(n(12)),a=n(143),u=n(86),l=h(n(142)),c=n(141);function h(t){return t&&t.__esModule?t:{default:t}}var p=function(){try{return window.history.state||{}}catch(t){return{}}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.default)(c.canUseDOM,"Browser history needs a DOM");var e=window.history,n=(0,c.supportsHistory)(),h=!(0,c.supportsPopStateOnHashChange)(),f=t.forceRefresh,d=void 0!==f&&f,m=t.getUserConfirmation,y=void 0===m?c.getConfirmation:m,_=t.keyLength,v=void 0===_?6:_,g=t.basename?(0,u.stripTrailingSlash)((0,u.addLeadingSlash)(t.basename)):"",b=function(t){var e=t||{},n=e.key,i=e.state,r=window.location,s=r.pathname+r.search+r.hash;return(0,o.default)(!g||(0,u.hasBasename)(s,g),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+s+'" to begin with "'+g+'".'),g&&(s=(0,u.stripBasename)(s,g)),(0,a.createLocation)(s,i,n)},w=function(){return Math.random().toString(36).substr(2,v)},k=(0,l.default)(),S=function(t){r(L,t),L.length=e.length,k.notifyListeners(L.location,L.action)},x=function(t){(0,c.isExtraneousPopstateEvent)(t)||P(b(t.state))},T=function(){P(b(p()))},O=!1,P=function(t){O?(O=!1,S()):k.confirmTransitionTo(t,"POP",y,function(e){e?S({action:"POP",location:t}):A(t)})},A=function(t){var e=L.location,n=E.indexOf(e.key);-1===n&&(n=0);var i=E.indexOf(t.key);-1===i&&(i=0);var r=n-i;r&&(O=!0,R(r))},C=b(p()),E=[C.key],M=function(t){return g+(0,u.createPath)(t)},R=function(t){e.go(t)},j=0,N=function(t){1===(j+=t)?((0,c.addEventListener)(window,"popstate",x),h&&(0,c.addEventListener)(window,"hashchange",T)):0===j&&((0,c.removeEventListener)(window,"popstate",x),h&&(0,c.removeEventListener)(window,"hashchange",T))},F=!1,L={length:e.length,action:"POP",location:C,createHref:M,push:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"PUSH",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.pushState({key:r,state:a},null,i),d)window.location.href=i;else{var u=E.indexOf(L.location.key),l=E.slice(0,-1===u?0:u+1);l.push(s.key),E=l,S({action:"PUSH",location:s})}else(0,o.default)(void 0===a,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=i}})},replace:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"REPLACE",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.replaceState({key:r,state:a},null,i),d)window.location.replace(i);else{var u=E.indexOf(L.location.key);-1!==u&&(E[u]=s.key),S({action:"REPLACE",location:s})}else(0,o.default)(void 0===a,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(i)}})},go:R,goBack:function(){return R(-1)},goForward:function(){return R(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=k.setPrompt(t);return F||(N(1),F=!0),function(){return F&&(F=!1,N(-1)),e()}},listen:function(t){var e=k.appendListener(t);return N(1),function(){N(-1),e()}}};return L}},function(t,e,n){"use strict";function i(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}n.d(e,"a",function(){return i})},function(t,e,n){t.exports=function(){"use strict";var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,i=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,o=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,a=s&&s(Object);return function u(l,c,h){if("string"!=typeof c){if(a){var p=s(c);p&&p!==a&&u(l,p,h)}var f=i(c);r&&(f=f.concat(r(c)));for(var d=0;d<f.length;++d){var m=f[d];if(!(t[m]||e[m]||h&&h[m])){var y=o(c,m);try{n(l,m,y)}catch(t){}}}return l}return l}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(n(6)),o=a(n(7)),s=a(n(4));function a(t){return t&&t.__esModule?t:{default:t}}e.load=function(){return function(t){s.default.allProgress([o.default.task.index({limit:40,orderBy:"created_at desc"}),o.default.folder.index({activity:"dataset"}),o.default.file.index({module:"samplernn",generated:1,limit:15,orderBy:"created_at desc"}),o.default.file.index({module:"pix2pixhd",generated:1,limit:15,orderBy:"created_at desc"}),o.default.file.index({module:"morph",generated:1,limit:15,orderBy:"created_at desc"})],function(e,n,i){t({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"dashboard"}})}).then(function(e){var n=i(e,5),o=n[0],a=n[1],u=n[2],l=n[3],c=n[4],h=s.default.sort.orderByFn("date desc"),p=h.mapFn,f=h.sortFn,d=a.map(p).sort(f).reduce(function(t,e){var n=e[1].module;return t[n]=t[n]||[],t[n].push(e[1]),t},{});t({type:r.default.dashboard.load,data:{tasks:o,folders:a,foldersByModule:d,renders:{samplernn:u,pix2pixhd:l,morph:c}}})})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(2),a=(n(3),n(4)),u=(i=a)&&i.__esModule?i:{default:i};var l=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleClick=n.handleClick.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"handleClick",value:function(t){this.props.onClick&&this.props.onClick()}},{key:"render",value:function(){var t=this.props,e=t.site,n=t.runner;return(0,o.h)("div",{className:"dashboardHeader heading"},(0,o.h)("h1",null,e.name," cortex"),this.renderStatus("GPU",n.gpu),this.renderStatus("CPU",n.cpu))}},{key:"renderStatus",value:function(t,e){if("IDLE"===e.status)return(0,o.h)("div",null,t," idle");var n=e.task;return"live"===n.activity?(0,o.h)("div",null,t," running ",(0,o.h)("b",null,n.module),' live on "',n.dataset,'"'):(0,o.h)("div",null,t," ",u.default.gerund(n.activity)," ",(0,o.h)("b",null,n.module)," on ",(0,o.h)("b",null,n.dataset),!!n.epoch&&(0,o.h)("span",null,"Epoch: ",n.epoch," / ",n.epochs,(0,o.h)("br",null)))}}]),e}();e.default=(0,s.connect)(function(t){return{runner:t.system.runner,site:t.system.site}},function(t,e){return{}})(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(8),a=n(2),u=(m(n(92)),m(n(25))),l=(m(n(66)),m(n(55)),m(n(51)),m(n(150))),c=n(11),h=d(n(149)),p=d(n(52)),f=m(n(80));m(n(7));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.load(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillUpdate",value:function(t){}},{key:"render",value:function(){var t=this,e=this.props,n=e.loading,i=e.progress,o=(e.site,e.foldersByModule),a=e.renders,h=e.queue;e.images;if(n)return(0,r.h)(c.Loading,{progress:i});var p=h.tasks,d=o&&Object.keys(f.default).sort().map(function(e){var n="samplernn"===e||"biggan"===e?"/samplernn/datasets/":"/"+e+"/sequences/",i=(o[e]||[]).map(function(t){return(0,r.h)("div",{key:t.id},(0,r.h)(s.Link,{to:n+t.id+"/"},t.name))}),u=a[e]&&(0,r.h)(c.FileList,{linkFiles:!0,files:a[e],orderBy:"date desc",fields:"name datetime epoch size",onClick:"samplernn"===e?function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a file",e),t.handlePick(e)}:null});return(0,r.h)("div",{className:"dashboardModule",key:e},(0,r.h)("div",{className:"row moduleHeading"},(0,r.h)("h3",null,e),(0,r.h)("div",null,(0,r.h)(s.Link,{to:"/"+e+"/new/"},"new")),i),u)}).filter(function(t){return!!t});return(0,r.h)("div",{className:"app dashboard"},(0,r.h)(l.default,null),(0,r.h)("div",{className:"params row"},(0,r.h)("div",{className:"column"},!!h.queue.length&&(0,r.h)(u.default,{title:"Upcoming Tasks"},(0,r.h)(c.TaskList,{tasks:h.queue.map(function(t){return p[t]})})),!!h.completed.length&&(0,r.h)(u.default,{title:"Completed Tasks"},(0,r.h)(c.TaskList,{tasks:h.completed.map(function(t){return p[t]})}))),(0,r.h)("div",{className:"column"},d)))}},{key:"handlePick",value:function(t){this.props.audioPlayer.play(t)}}]),e}();e.default=(0,a.connect)(function(t){return{loading:t.dashboard.loading,progress:t.dashboard.progress,site:t.system.site,foldersByModule:t.dashboard.data.foldersByModule,renders:t.dashboard.data.renders,images:t.dashboard.images,files:t.dashboard.files,queue:t.queue}},function(t,e){return{actions:(0,o.bindActionCreators)(h,t),audioPlayer:(0,o.bindActionCreators)(p,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=y(n(25)),l=y(n(39)),c=m(n(81)),h=m(n(19)),p=m(n(38)),f=m(n(53)),d=m(n(82));function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function y(t){return t&&t.__esModule?t:{default:t}}var _={activity:"cpu",module:"test",dataset:"test",epochs:1,opt:{}},v={activity:"gpu",module:"test",dataset:"test",epochs:1,opt:{}},g={activity:"live",module:"test",dataset:"test",epochs:1,opt:{}},b={activity:"wait",module:"test",dataset:"test",epochs:1,opt:{}},w=["apple","pear","orange","strawberry"];function k(t){return t[Math.floor(Math.random()*t.length)]}var S=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidUpdate",value:function(){this._screen.scrollHeight>this._screen.scrollTop-this._screen.offsetHeight+100&&(this._screen.scrollTop=this._screen.scrollHeight)}},{key:"render",value:function(){var t=this.props,e=t.site,n=t.server,i=t.relay,r=t.runner,s=t.rpc,a=t.actions,c=t.user;return(0,o.h)("div",{className:"app system"},(0,o.h)("div",{className:"heading"},(0,o.h)("h1",null,e.name," system")),(0,o.h)("div",{className:"row params"},(0,o.h)("div",{className:"column"},(0,o.h)(u.default,{title:"Status"},(0,o.h)(l.default,{title:"Server"},n.status),n.error&&(0,o.h)(l.default,{title:"Server error"},n.error.message),(0,o.h)(l.default,{title:"Relay"},i.status),(0,o.h)(l.default,{title:"RPC"},s.status),(0,o.h)(l.default,{title:"CPU"},this.renderStatus(r.cpu)),(0,o.h)(l.default,{title:"GPU"},this.renderStatus(r.gpu))),(0,o.h)(u.default,{title:"Diagnostics"},(0,o.h)(l.default,{title:"Check GPU"},(0,o.h)("button",{onClick:function(){return a.system.run("nvidia-smi")}},"nvidia-smi")),(0,o.h)(l.default,{title:"List processes"},(0,o.h)("button",{onClick:function(){return a.system.run("ps")}},"ps")),(0,o.h)(l.default,{title:"List users"},(0,o.h)("button",{onClick:function(){return a.system.run("w")}},"w")),(0,o.h)(l.default,{title:"Disk free space"},(0,o.h)("button",{onClick:function(){return a.system.run("df")}},"df"))),(0,o.h)(u.default,{title:"Tasks"},(0,o.h)(l.default,{title:"Kill task"},(0,o.h)("button",{onClick:function(){return a.queue.stop_task("cpu")}},"CPU"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task("gpu")}},"GPU")),(0,o.h)(l.default,{title:"Queue"},(0,o.h)("button",{onClick:function(){return a.queue.start_queue()}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_queue()}},"Stop"))),(0,o.h)(u.default,{title:"Auth"},(0,o.h)(l.default,{title:"Logged in as "+c.username},(0,o.h)("button",{onClick:function(){return a.auth.logout()}},"Logout"))),(0,o.h)(u.default,{title:"Test"},(0,o.h)(l.default,{title:"CPU Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(_,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.cpu.task)}},"Stop")),(0,o.h)(l.default,{title:"GPU Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(v,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.gpu.task)}},"Stop")),(0,o.h)(l.default,{title:"Live Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(g,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.cpu.task)}},"Stop")),(0,o.h)(l.default,{title:"Test Live RPC"},(0,o.h)("button",{onClick:function(){return a.live.get_params()}},"Get"),(0,o.h)("button",{onClick:function(){return a.live.set_param("fruit",k(w))}},"Set")),(0,o.h)(l.default,{title:"Queue Tests"},(0,o.h)("button",{onClick:function(){return a.system.enqueue_test_task(k(w))}},"+Add test task")),(0,o.h)(l.default,{title:""},(0,o.h)("button",{onClick:function(){return a.queue.start_task(b,{preempt:!0,watch:!0})}},"Wait and Buzz"))),(0,o.h)(u.default,{title:"Internationalization"},(0,o.h)(l.default,{title:"Language"},d.languages.map(function(t){return(0,o.h)("button",{onClick:function(){return a.system.changeLanguage(t)}},t)})))),this.renderCommandOutput()))}},{key:"renderStatus",value:function(t){if(!t)return"unknown";if("IDLE"===t.status)return"idle";var e=t.task;return e.activity+" "+e.module}},{key:"renderCommandOutput",value:function(){var t=this,e=this.props,n=e.cmd,i=e.stdout,r=e.stderr,s=void 0;return n.loading?s="Loading: "+n.name:n.loaded?n.error?s="Error: "+n.name+"\n\n"+JSON.stringify(n.error,null,2):(s=n.stdout,n.stderr&&(s+="\n\n_________________________________\n\n",s+=n.stderr)):(s=i,r.length&&(s+="\n\n_________________________________\n\n",s+=r)),(0,o.h)("div",null,(0,o.h)("div",{ref:function(e){return t._screen=e},className:"screen"},s))}}]),e}();e.default=(0,a.connect)(function(t){return i({user:t.auth.user},t.system,t.live)},function(t,e){return{actions:{auth:(0,s.bindActionCreators)(f,t),system:(0,s.bindActionCreators)(c,t),queue:(0,s.bindActionCreators)(p,t),live:(0,s.bindActionCreators)(h,t)}}})(S)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=(n(3),n(2),n(8),a(n(4)),a(n(25)),a(n(39)),a(n(17)),a(n(124))),s=a(n(28));function a(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return console.log(t),t.db.data||t.actions.load_directories(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this.props,e=t.module,n=t.history,i=t.db,a=t.path;return(0,r.h)("div",{className:"app new-view "+e.name},(0,r.h)("div",{className:"heading"},(0,r.h)("h1",null,e.displayName||e.name)),(0,r.h)("div",{className:"col narrow"},(0,r.h)(s.default,{module:e,history:n}),(0,r.h)(o.default,{db:i,path:a,activity:"dataset",emptyText:(0,r.h)("i",null,"No projects yet. Please create one~")})))}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.New=void 0;var i,r=n(153),o=(i=r)&&i.__esModule?i:{default:i};e.New=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(83);var a={dir:"/",start:null,end:null,cursor:null,selection:null,width:0,ratio:0,loading:!0},u=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state=i({},a),t.handleMouseDown=t.handleMouseDown.bind(t),t.handleMouseMove=t.handleMouseMove.bind(t),t.handleMouseUp=t.handleMouseUp.bind(t),t.computeOffset=t.computeOffset.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){var t=this.props.sequence;window.addEventListener("resize",this.computeOffset),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp),this.computeOffset(),t&&this.reset()}},{key:"componentDidUpdate",value:function(t){this.props.sequence!==t.sequence&&this.reset()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.computeOffset),window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"reset",value:function(){var t=this,e=this.props.sequence;if(e&&e.length){var n=e.length-1,r={frame:e[0],i:0},o={frame:e[n],i:n},u=Math.sqrt((0,s.clamp)(e.length/9e4,.3,1))*Math.min(window.innerWidth-40,600),l=u/e.length;setTimeout(function(){return t.computeOffset()}),this.setState(i({},a,{width:u,ratio:l,start:r,end:o}))}}},{key:"computeOffset",value:function(){this.ref&&(this.offset=this.ref.getBoundingClientRect())}},{key:"computeFrame",value:function(t){var e=this.props.sequence;if(!e||!e.length)return null;var n=(t.pageX-this.offset.left)/this.offset.width,i=(t.pageY-this.offset.top)/this.offset.height;if(this.state.dragging&&(n=(0,s.clamp)(n,0,1),i=(0,s.clamp)(i,0,1)),0<=n&&n<=1&&0<=i&&i<=1){var r=Math.floor(n*(e.length-1));return{frame:e[r],i:r}}return null}},{key:"handleMouseDown",value:function(t){this.setState({dragging:!0});var e=this.computeFrame(t);e&&(this.props.onPick&&this.props.onPick(e),this.props.onSelect&&this.props.onSelect({start:e,end:e}),this.setState({start:e,end:e}))}},{key:"handleMouseMove",value:function(t){var e=this.computeFrame(t);if(e)if(this.props.onCursor&&this.props.onCursor(e),this.state.dragging){var n=this.state.start,i=e;if(this.setState({cursor:e,end:e}),this.props.onSelect){if(i.i<n.i){var r=[i,n];n=r[0],i=r[1]}this.props.onSelect({start:n,end:i})}}else this.setState({cursor:e})}},{key:"handleMouseUp",value:function(t){if(this.state.dragging){var e=this.state,n=e.start,i=e.end;if(i.i<n.i){var r=[i,n];n=r[0],i=r[1]}this.props.onSelect&&this.props.onSelect({start:n,end:i}),this.setState({dragging:!1})}}},{key:"render",value:function(){var t=this,e=(this.props.sequence,this.state),n=(e.loading,e.start),i=e.end,r=e.cursor,s=e.width,a=e.ratio;return(0,o.h)("div",{className:"timeline",style:{width:s},ref:function(e){return t.ref=e},onMouseDown:this.handleMouseDown},a&&n&&i&&this.renderSelection(n,i,a),a&&r&&this.renderCursor(r,a))}},{key:"renderCursor",value:function(t,e){var n=t.i*e;return(0,o.h)("div",{key:"cursor",className:"cursor",style:{left:n}})}},{key:"renderSelection",value:function(t,e,n){var i=Math.min(t.i,e.i)*n,r=Math.max(Math.abs(t.i-e.i)*n,1);return(0,o.h)("div",{key:"selection",className:"selection",style:{left:i,width:r}})}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=(n(3),n(2)),s=n(8),a=l(n(4)),u=l(n(7));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"shouldComponentUpdate",value:function(t){return t.tasks.length!==this.props.tasks.length||t.tasks[0]!==this.props.tasks[0]}},{key:"render",value:function(){var t=this,e=this.props,n=(e.title,e.tasks),i=a.default.sort.orderByFn(this.props.sort||"date desc"),o=i.mapFn,u=i.sortFn,l=n.map(o).sort(u).map(function(e){var n=e[1],i=n.dataset,o="",u="";switch(n.activity){case"train":0===n.epoch?o+="latest":o+="ep. "+n.epoch,o+=" + "+n.epochs;break;case"augment":try{var l=JSON.parse(n.opt);o+=l.augment_take+" x "+l.augment_make}catch(t){}}return n.folder_id&&(u="/"+n.module+"/"+("samplernn"===n.module?"datasets":"sequences")+"/"+n.folder_id+"/"),(0,r.h)("div",{className:"row"},(0,r.h)("div",{className:"activity"},n.activity," ",n.module),n.folder_id?(0,r.h)("div",{className:"dataset"},(0,r.h)(s.Link,{to:u},(0,r.h)("span",{className:"datasetName"},i),o)):(0,r.h)("div",{className:"dataset"},(0,r.h)("span",{className:"datasetName"},i),o),(0,r.h)("div",{className:"age "+a.default.carbon_date(n.updated_at),title:n.updated_at},a.default.get_age(n.updated_at)),(0,r.h)("div",{className:"options"},(0,r.h)("span",{className:"destroy",onClick:function(){return t.handleDestroy(n)}},"x")))});return(0,r.h)("div",{className:"tasklist rows"},l)}},{key:"handleDestroy",value:function(t){confirm("Are you sure you want to delete this task?")&&u.default.task.destroy(t)}}]),e}();e.default=(0,o.connect)(function(t){return{}},function(t,e){return{}})(c)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2);n(3);var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleChange",value:function(t){clearTimeout(this.timeout);var e=t.target.value;"PLACEHOLDER"!==e&&this.props.onChange&&this.props.onChange(this.props.name,e)}},{key:"render",value:function(){var t=this.props.live?this.props.opt[this.props.name]:this.props.value,e=void 0,n=(this.props.options||[]).map(function(t,n){var i=t.name,o=t.options.map(function(t){var n=t.length<2?t.toUpperCase():t;n=n.replace(/_/g," ");var i=t;return e=i,(0,r.h)("option",{value:i,key:i},n)});return(0,r.h)("optgroup",{label:i,key:i},o)});return(0,r.h)("div",{className:"select param"},(0,r.h)("label",null,(0,r.h)("span",null,this.props.title),(0,r.h)("select",{onChange:this.handleChange,value:t||e},this.props.placeholder&&(0,r.h)("option",{value:"PLACEHOLDER"},this.props.placeholder),n)),this.props.children)}}]),e}();e.default=(0,o.connect)(function(t,e){return{opt:e.opt||t.live.opt}},function(t,e){return{}})(s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2),s=n(3),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(19));var u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleClick=n.handleClick.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleClick",value:function(t){clearTimeout(this.timeout);var e=t.target.checked;this.props.actions.set_param(this.props.name,e),this.props.onToggle&&this.props.onToggle(e)}},{key:"render",value:function(){var t=this.props.opt[this.props.name],e=!this.props.noToggle,n=!this.props.noDim&&e&&!t?"paramGroup inactive":"paramGroup active";return(0,r.h)("div",{className:n},(0,r.h)("label",null,(0,r.h)("h3",null,this.props.title),e?(0,r.h)("input",{type:"checkbox",onClick:this.handleClick,checked:t}):null),this.props.children)}}]),e}();e.default=(0,o.connect)(function(t){return{opt:t.live.opt}},function(t,e){return{actions:(0,s.bindActionCreators)(a,t)}})(u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1);var o=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={value:null,changed:!1},n.handleInput=n.handleInput.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleInput",value:function(t){this.setState({value:t.target.value,changed:!0}),this.props.onInput&&this.props.onInput(t.target.value,t.target.name),this.props.onChange&&this.props.onChange(t.target.name,t.target.value)}},{key:"handleKeydown",value:function(t){13===t.keyCode&&(this.setState({value:t.target.value,changed:!1}),this.props.onSave&&this.props.onSave(t.target.value,t.target.name))}},{key:"render",value:function(){return(0,r.h)("div",{className:"numberInput param"},(0,r.h)("label",null,(0,r.h)("span",null,this.props.title),(0,r.h)("input",{type:"number",name:this.props.name||"number",value:this.state.changed?this.state.value:this.props.value,onInput:this.handleInput,onKeydown:this.handleKeydown,placeholder:this.props.placeholder,autofocus:this.props.autofocus,min:this.props.min,max:this.props.max,step:this.props.step||"int"===this.props.type?1:.01})))}}]),e}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=l(n(4)),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(44));l(n(25)),l(n(66)),l(n(55)),l(n(51)),n(21),l(n(49));function l(t){return t&&t.__esModule?t:{default:t}}var c=a.default.lerp,h=a.default.norm,p=(a.default.randint,a.default.randrange),f=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.load_graph(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this;return this.refs={},(0,r.h)("div",{className:"app lossGraph"},(0,r.h)("div",{className:"heading"},(0,r.h)("h3",null,"SampleRNN Loss Graph"),(0,r.h)("canvas",{ref:function(e){return t.refs.canvas=e}})))}},{key:"componentDidUpdate",value:function(){var t=this.props.samplernn,e=t.lossReport,n=t.results;if(e&&n){var i=this.refs.canvas;i.width=window.innerWidth,i.height=window.innerHeight,i.style.width=i.width+"px",i.style.height=i.height+"px";var r=i.getContext("2d"),o=i.width,s=i.height;r.clearRect(0,0,o,s);var a=n.map(function(t){if(!t.name.match(/^exp:/))return null;var e=t.name.split("-")[3].split(":")[1];return[+new Date(t.date),e]}).filter(function(t){return!!t}).sort(function(t,e){return t[0]-t[1]}),u=0,l=1/0,f=0;Object.keys(e).filter(function(t){return!!e[t].length}).forEach(function(t){var n=e[t];f=Math.max(n.length,f),n.forEach(function(t){var e=parseFloat(t.training_loss);e&&(u=Math.max(e,u),l=Math.min(e,l))})}),u=3,l=0;var d=o/2,m=s/2;r.save();for(var y=void 0,_=void 0,v=0;v<f;v++)if(y=c(v/(f/1)*1,0,d),r.strokeStyle="rgba(0,0,0,0.3)",r.beginPath(0,0),r.moveTo(y,0),r.lineTo(y,s),r.lineWidth=.5,(v+1)%6==0){r.lineWidth=.5,r.stroke();r.font='italic 12px "Georgia"',r.fillStyle="rgba(0,12,28,0.6)",r.fillText(v/5*6,y+8,s-16)}for(v=l;v<u;v+=1){_=c(v/u,0,m),r.beginPath(0,0),r.moveTo(0,s-_),r.lineTo(o,s-_),r.lineWidth=1,r.lineWidth=2,r.setLineDash([4,4]),r.stroke(),r.stroke(),r.stroke(),r.setLineDash([1,1]);r.font='italic 12px "Georgia"',r.fillStyle="rgba(0,12,28,0.6)",r.fillText(v.toFixed(1),o-50,s-_+12+10)}r.lineWidth=1,r.restore();a[0][0],a[a.length-1][0];a.forEach(function(t){t[0];var n=t[1],i=e[n];if(n&&i&&i.length){var o=parseFloat(i[i.length-1].training_loss)||0;parseFloat(i[0].training_loss),h(o,l,u/2);r.lineWidth=4*(1-h(o,l,u)),r.strokeStyle="rgba("+[p(30,190),p(30,150),p(60,120)].join(",")+",0.8)";var s=!1;i.forEach(function(t,e){var n=parseFloat(t.training_loss);if(n){var i=c(e/(f/1)*1,0,d),o=c(h(n,l,u),m,0);s?r.lineTo(i,o):(s=!0,r.beginPath(0,0),r.moveTo(i,o))}}),r.stroke();var a=i.length-1,y=parseFloat(i[a].training_loss),_=c(a/(f/1)*1,0,d),v=c(h(y,l,u),m,0);r.font='italic 9px "Georgia"',r.fillStyle="rgba(0,12,28,0.6)",r.fillText(n,_+4,v+4.5)}})}}}]),e}();e.default=(0,s.connect)(function(t){return{samplernn:t.module.samplernn}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t)}})(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(8),a=n(2),u=d(n(4)),l=f(n(44)),c=f(n(52)),h=d(n(17)),p=n(21);function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.samplernn.data||t.actions.load_directories(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this;if(this.props.samplernn.loading)return(0,r.h)(h.default,{progress:this.props.samplernn.progress});var e=this.props.samplernn.data,n=e.folderLookup,i=e.fileLookup,o=e.datasetLookup,a=Object.keys(n).sort(u.default.sort.stringSort.asc).map(function(e){var a=n[e],l=u.default.sort.orderByFn("epoch desc"),c=l.mapFn,h=l.sortFn,f=a.datasets.map(function(t){return o[t]}).map(c).sort(h).map(function(t){return t[1]}).filter(function(t){return t.output.length}).map(function(t){return t.output.map(function(t){return i[t]}).map(c).sort(h)[0][1]}),d="unsorted"===a.name?"/samplernn/import/":"/samplernn/datasets/"+a.id+"/";return(0,r.h)("div",{className:"col bestRenders"},(0,r.h)("h3",null,(0,r.h)(s.Link,{to:d},a.name)),(0,r.h)(p.FileList,{linkFiles:!0,files:f,orderBy:"date desc",fields:"name date epoch size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a file",e),t.handlePick(e)}}))});return(0,r.h)("div",{className:"app samplernn"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"SampleRNN Results")),(0,r.h)("div",{class:"rows params renders"},a))}},{key:"handlePick",value:function(t){this.props.audioPlayer.play(t)}}]),e}();e.default=(0,a.connect)(function(t){return{samplernn:t.module.samplernn}},function(t,e){return{actions:(0,o.bindActionCreators)(l,t),audioPlayer:(0,o.bindActionCreators)(c,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=(f(n(4)),function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(44))),l=f(n(55)),c=f(n(49)),h=f(n(51)),p=f(n(27));function f(t){return t&&t.__esModule?t:{default:t}}var d={name:"samplernn",datatype:"audio"},m=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state={folder_id:1,import_action:"Hotlink",url_base:"https://s3.amazonaws.com/i.asdf.us/bucky/data/4279/",selected:{}},t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("samplernn.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.samplernn);e.samplernnActions;"new"!==t&&t&&(parseInt(t)&&localStorage.setItem("samplernn.last_id",t),n.folder&&n.folder.id===t||this.props.actions.load_directories(t))}},{key:"render",value:function(){var t=this,e=this.props.samplernn,n=[],i=void 0;return this.props.samplernn.data&&(n=(this.props.samplernn.data.folders||[]).map(function(t){return[t.name,t.id]}),i=this.props.samplernn.data.folderLookup.unsorted),(0,o.h)("div",{className:"app top"},(0,o.h)("div",{class:"heading"},(0,o.h)("h1",null,"Import")),(0,o.h)("div",{class:"params form row datasets"},(0,o.h)("div",{class:"row dataset"},(0,o.h)("div",{class:"col"}),(0,o.h)("div",{class:"col"}),(0,o.h)("div",{class:"col"}),(0,o.h)("div",{class:"col"},(0,o.h)("h2",null,"Import to dataset"),(0,o.h)(l.default,{title:"Destination dataset",options:n,name:"folder_id",opt:this.state,onChange:function(e,n){return t.setState({folder_id:n})}}),(0,o.h)(l.default,{title:"Import action",options:["Hotlink","Upload"],name:"import_action",opt:this.state,onChange:function(e,n){return t.setState({import_action:n})}}),(0,o.h)(c.default,{title:"Remote URL base",value:this.state.url_base,placeholder:"http://",onSave:function(e){return t.setState({url_base:e})}}),(0,o.h)(h.default,{title:"",onClick:function(){return t.doImport()}},"Import")))),(0,o.h)(p.default,{loading:e.loading,progress:e.progress,module:d,data:e.data,id:"unsorted",folder:i,history:this.props.history,onPickDataset:function(e){return t.toggle(e.name,t.state.selected[name])},beforeRow:function(e){return t.beforeRow(e)},afterRow:function(e){return t.afterRow(e)}}))}},{key:"toggle",value:function(t){var e,n,r;this.setState(i({},this.state,{selected:i({},this.state.selected,(e={},n=t,r=!this.state.selected[t],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e))}))}},{key:"beforeRow",value:function(t){}},{key:"afterRow",value:function(t){var e=t.name;return(0,o.h)("div",null,(0,o.h)("input",{type:"checkbox",value:e,checked:!!this.state.selected[e]}))}},{key:"doImport",value:function(){var t=this.props.samplernn;console.log(this.state),this.props.actions.import_files(this.state,t.data.datasetLookup,t.data.fileLookup)}}]),e}();e.default=(0,a.connect)(function(t){return{samplernn:t.module.samplernn,runner:t.system.runner,task:t.task}},function(t,e){return{actions:(0,s.bindActionCreators)(u,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clear_cache_task=e.log_task=e.fetch_task=e.generate_task=e.train_task=void 0;r(n(15)),r(n(14)),r(n(6));var i=r(n(7));function r(t){return t&&t.__esModule?t:{default:t}}e.train_task=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return function(r){var o={module:"samplernn",activity:"train",dataset:t.name,epoch:t.checkpoints.length&&t.checkpoints[0].epoch||0,epochs:n,folder_id:e,opt:{sample_length:220500,n_samples:6,keep_old_checkpoints:!1}};return console.log(o),i.default.queue.add_task(o)}},e.generate_task=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return function(s){var a={module:"samplernn",activity:"generate",dataset:t.name,epoch:o||t.checkpoints.length&&t.checkpoints[0].epoch||0,folder_id:e,opt:{sample_length:Math.round(44100*n),n_samples:r}};return console.log(a),i.default.queue.add_task(a)}},e.fetch_task=function(t,e,n,r){return function(o){if(!t)return console.log("input file inaccessible (no url)");var s={module:"samplernn",activity:"fetch",dataset:r,folder_id:e,opt:{url:t,file_id:n,dataset:r}};return i.default.queue.add_task(s)}},e.log_task=function(t){return function(e){var n={module:"samplernn",activity:"log",dataset:t.name};return i.default.queue.add_task(n)}},e.clear_cache_task=function(t){return function(e){var n={module:"samplernn",activity:"clear_cache",dataset:t.name};return i.default.queue.add_task(n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(y(n(4)),m(n(44))),u=m(n(163)),l=m(n(52)),c=n(11),h=y(n(35)),p=y(n(34)),f=y(n(27)),d=y(n(67));function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function y(t){return t&&t.__esModule?t:{default:t}}var _=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("samplernn.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.samplernn),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("samplernn.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/samplernn/new/"))}},{key:"render",value:function(){var t=this,e=this.props,n=e.samplernn,i=(e.runner,e.match,e.history),o=((n.data||{}).folderLookup||{})[n.folder_id]||{};return(0,r.h)("div",{className:"app samplernn"},(0,r.h)("div",{className:"heading"},(0,r.h)("h1",null,o?o.name:(0,r.h)(c.Loading,null))),(0,r.h)("div",{className:"row"},o&&o.name&&"unsorted"!==o.name&&(0,r.h)(h.default,{title:"Add Files",module:d.default,folder:o,canUpload:!0,canAddURL:!0}),(0,r.h)("div",null,(0,r.h)(p.default,null),(0,r.h)(c.CurrentTask,{processor:"gpu"}))),(0,r.h)(f.default,{loading:n.loading,progress:n.progress,id:n.folder_id,module:d.default,data:n.data,folder:o,history:i,onPickFile:function(e,n){n.preventDefault(),n.stopPropagation(),t.handlePick(e)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.samplernn,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,2)}},"2x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,4)}},"4x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,6)}},"6x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,18)}},"18x")),(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,5,12)}},"generate"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.5,120)}},"/2"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.25,240)}},"/4"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.125,480)}},"/8"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.0625,960)}},"/16")),(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,2,30)}},"2s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,10,6)}},"10s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,15,4)}},"15s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,30,2)}},"30s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,60,1)}},"1m")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"x")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,i.folder_id,s.id,t.name)}},"fetch"))):null}},{key:"handlePick",value:function(t){this.props.audioPlayer.play(t)}}]),e}();e.default=(0,s.connect)(function(t){return{samplernn:t.module.samplernn,runner:t.system.runner}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t),audioPlayer:(0,o.bindActionCreators)(l,t)}})(_)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(44)),u=l(n(67));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{samplernn:t.module.samplernn}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.samplernn,path:"/samplernn/datasets/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=f(n(7)),a=f(n(4)),u=f(n(165)),l=f(n(164)),c=f(n(162)),h=f(n(161)),p=f(n(160));function f(t){return t&&t.__esModule?t:{default:t}}var d=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("samplernn"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #eef, #fef)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("samplernn"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #eef, #fef)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/samplernn/new",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/datasets",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/datasets/:id",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/import",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/results",component:h.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/graph",component:p.default}))}}]),t}();e.default={name:"samplernn",router:d,links:function(){return[{url:"/samplernn/new/",name:"new"},{url:"/samplernn/datasets/",name:"datasets"},{url:"/samplernn/graph/",name:"graph"},{url:"/samplernn/results/",name:"results"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),a=n(2),u=n(11),l=n(40),c=m(l),h=m(n(19)),p=m(n(38)),f=m(n(76)),d=m(n(77));function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.pix2wav.load_directories(),t.actions.live.get_params(),n.changeCheckpoint=n.changeCheckpoint.bind(n),n.changeEpoch=n.changeEpoch.bind(n),n.changeSequence=n.changeSequence.bind(n),n.seek=n.seek.bind(n),n.togglePlaying=n.togglePlaying.bind(n),n.toggleRecording=n.toggleRecording.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillUpdate",value:function(t){t.opt.checkpoint_name&&t.opt.checkpoint_name!==this.props.opt.checkpoint_name&&(console.log("fetch checkpoint",t.opt.checkpoint_name),this.props.actions.live.list_epochs("pix2wav",t.opt.checkpoint_name))}},{key:"changeCheckpoint",value:function(t,e){this.props.actions.live.load_epoch(e,"latest")}},{key:"changeEpoch",value:function(t,e){this.props.actions.live.load_epoch(this.props.opt.checkpoint_name,e)}},{key:"changeSequence",value:function(t,e){console.log("got sequence",e),this.props.actions.live.load_sequence(e)}},{key:"seek",value:function(t){var e=Math.floor(t*(parseInt(this.props.frame.sequence_len)||1)+1);this.props.actions.live.seek(e)}},{key:"start",value:function(){console.log(this.props.pix2wav.data);var t=this.props.pix2wav.data.sequences[0].name||"",e=this.props.pix2wav.data.checkpoints[0].name||"";console.log("starting up!",t,e),this.props.actions.tasks.live_task(t,e)}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"exit",value:function(){this.props.actions.queue.stop_task("gpu",{sigkill:!0})}},{key:"togglePlaying",value:function(){this.props.opt.processing?this.props.actions.live.pause():this.props.actions.live.play()}},{key:"toggleRecording",value:function(){this.props.opt.recording?((0,l.stopRecording)(),this.props.actions.live.pause()):(0,l.startRecording)()}},{key:"render",value:function(){return this.props.pix2wav.loading?(0,r.h)(u.Loading,null):(0,r.h)("div",{className:"app pix2wav centered"},(0,r.h)("div",{className:"row"},(0,r.h)("div",{className:"column"},(0,r.h)(u.Player,{width:256,height:256})),(0,r.h)("div",{className:"params column audioParams"},(0,r.h)(u.Group,{title:"Audio playback"},(0,r.h)(u.Button,{title:"Start playback",onClick:function(){return c.startSynthesizing()}},"Start"),(0,r.h)(u.Button,{title:"Stop playback",onClick:function(){return c.stopSynthesizing()}},"Stop")))),(0,r.h)("div",{className:"params row"},(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Playback",noToggle:!0},(0,r.h)(u.Select,{name:"send_image",title:"view mode",options:["a","b","sequence","recursive"],onChange:this.props.actions.live.set_param}),(0,r.h)(u.Select,{name:"sequence_name",title:"sequence",options:this.props.pix2wav.data.sequences,onChange:this.changeSequence}),(0,r.h)(u.Select,{name:"output_format",title:"format",options:["JPEG","PNG"]}),(0,r.h)(u.Select,{name:"checkpoint_name",title:"checkpoint",options:this.props.pix2wav.data.checkpoints,onChange:this.changeCheckpoint}),(0,r.h)(u.Select,{name:"epoch",title:"epoch",options:this.props.epochs,onChange:this.changeEpoch}),(0,r.h)(u.Slider,{live:!0,name:"position",min:0,max:1,type:"float",value:(this.props.frame.sequence_i||0)/(this.props.frame.sequence_len||1),onChange:this.seek}),this.renderRestartButton(),(0,r.h)(u.Button,{title:this.props.opt.savingVideo?"Saving video...":this.props.opt.recording?"Recording ("+(t=this.props.opt.recordFrames,(t/10).toFixed(1)+" s.")+")":"Record video",onClick:this.toggleRecording},this.props.opt.savingVideo?"Saving":this.props.opt.recording?"Recording":"Record"),(0,r.h)(u.Button,{title:"Save frame",onClick:l.saveFrame},"Save"),(0,r.h)("p",{class:"last_message"},this.props.last_message))),(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Transition",name:"transition"},(0,r.h)(u.Slider,{live:!0,name:"transition_period",min:10,max:5e3,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"transition_min",min:.001,max:.2,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"transition_max",min:.1,max:1,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Recursion",name:"recursive"},(0,r.h)(u.Slider,{live:!0,name:"recursive_frac",min:0,max:.5,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"recurse_roll",min:-64,max:64,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"recurse_roll_axis",min:0,max:1,type:"int"})),(0,r.h)(u.ParamGroup,{title:"Sequence",name:"sequence"},(0,r.h)(u.Slider,{live:!0,name:"sequence_frac",min:0,max:1,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"process_frac",min:0,max:1,type:"float"}))),(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Clahe",name:"clahe"},(0,r.h)(u.Slider,{live:!0,name:"clip_limit",min:1,max:4,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Posterize",name:"posterize"},(0,r.h)(u.Slider,{live:!0,name:"spatial_window",min:2,max:128,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"color_window",min:2,max:128,type:"int"})),(0,r.h)(u.ParamGroup,{title:"Blur",name:"blur"},(0,r.h)(u.Slider,{live:!0,name:"blur_radius",min:3,max:7,type:"odd"}),(0,r.h)(u.Slider,{live:!0,name:"blur_sigma",min:0,max:2,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Canny Edge Detection",name:"canny"},(0,r.h)(u.Slider,{live:!0,name:"canny_lo",min:10,max:200,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"canny_hi",min:10,max:200,type:"int"})))));var t}},{key:"renderRestartButton",value:function(){var t=this;return"IDLE"===this.props.runner.gpu.status?(0,r.h)(u.Button,{title:"GPU Idle",onClick:function(){return t.start()}},"Start"):"pix2pix"!==this.props.runner.gpu.task.module&&"pix2wav"!==this.props.runner.gpu.task.module?(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"):this.props.opt.processing?(0,r.h)("div",null,(0,r.h)(u.Button,{title:"Processing",onClick:this.togglePlaying},"Pause"),(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"),(0,r.h)(u.Button,{title:"Last resort",onClick:function(){return t.exit()}},"Exit")):(0,r.h)("div",null,(0,r.h)(u.Button,{title:"Not processing",onClick:this.togglePlaying},"Restart"),(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"),(0,r.h)(u.Button,{title:"Last resort",onClick:function(){return t.exit()}},"Exit"))}}]),e}();e.default=(0,a.connect)(function(t){return{last_message:t.live.last_message,opt:t.live.opt,frame:t.live.frame,checkpoints:t.live.checkpoints,epochs:t.live.epochs,sequences:t.live.sequences,runner:t.system.runner,pix2wav:t.module.pix2wav}},function(t,e){return{actions:{live:(0,o.bindActionCreators)(h,t),queue:(0,o.bindActionCreators)(p,t),pix2wav:(0,o.bindActionCreators)(d,t),tasks:(0,o.bindActionCreators)(f,t),s:s}}})(y)},function(t,e,n){"use strict";var i,r,o;"function"==typeof Symbol&&Symbol.iterator;r=[],void 0===(o="function"==typeof(i=function(){var t={context:null,_tapListeners:[],_onStarted:[],setContext:function(e){return t.context=e,t},on:function(i){if(Array.isArray(i)||NodeList&&i instanceof NodeList)for(var r=0;r<i.length;r++)t.on(i[r]);else if("string"==typeof i)t.on(document.querySelectorAll(i));else if(i.jquery&&"function"==typeof i.toArray)t.on(i.toArray());else if(Element&&i instanceof Element){var o=new e(i,n);t._tapListeners.push(o)}return t},onStarted:function(e){return t.isStarted()?e():t._onStarted.push(e),t},isStarted:function(){return null!==t.context&&"running"===t.context.state}},e=function(t){this._dragged=!1,this._element=t,this._bindedMove=this._moved.bind(this),this._bindedEnd=this._ended.bind(this),t.addEventListener("touchmove",this._bindedMove),t.addEventListener("touchend",this._bindedEnd),t.addEventListener("mouseup",this._bindedEnd)};function n(){if(t.context&&!t.isStarted()){var e=t.context.createOscillator(),n=t.context.createGain();n.gain.value=0,e.connect(n),n.connect(t.context.destination);var i=t.context.currentTime;e.start(i),e.stop(i+.5)}if(t._tapListeners){for(var r=0;r<t._tapListeners.length;r++)t._tapListeners[r].dispose();t._tapListeners=null}if(t._onStarted){for(var o=0;o<t._onStarted.length;o++)t._onStarted[o]();t._onStarted=null}}return e.prototype._moved=function(t){this._dragged=!0},e.prototype._ended=function(t){this._dragged||n(),this._dragged=!1},e.prototype.dispose=function(){this._element.removeEventListener("touchmove",this._bindedMove),this._element.removeEventListener("touchend",this._bindedEnd),this._element.removeEventListener("mouseup",this._bindedEnd),this._bindedMove=null,this._bindedEnd=null,this._element=null},t})?i.apply(e,r):i)||(t.exports=o)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.requestAudioContext=function(t){if(o.is_mobile){var e=document.createElement("div"),n=document.createElement("div");n.innerHTML="Tap to start - please unmute your phone",Object.assign(e.style,{display:"block",position:"absolute",width:"100%",height:"100%",zIndex:"10000",top:"0px",left:"0px",backgroundColor:"rgba(0, 0, 0, 0.8)"}),Object.assign(n.style,{display:"block",position:"absolute",left:"50%",top:"50%",padding:"20px",backgroundColor:"#7F33ED",color:"white",fontFamily:"monospace",borderRadius:"3px",transform:"translate3D(-50%,-50%,0)",textAlign:"center",lineHeight:"1.5",width:"150px"}),e.appendChild(n),document.body.appendChild(e),r.default.setContext(i.default.context),r.default.on(n),r.default.onStarted(function(n){e.remove(),t()})}else t()};var i=s(n(54)),r=s(n(168)),o=n(4);function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var i;!function(){"use strict";var r={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function o(t){return function(t,e){var n,i,s,a,u,l,c,h,p,f=1,d=t.length,m="";for(i=0;i<d;i++)if("string"==typeof t[i])m+=t[i];else if(Array.isArray(t[i])){if((a=t[i])[2])for(n=e[f],s=0;s<a[2].length;s++){if(!n.hasOwnProperty(a[2][s]))throw new Error(o('[sprintf] property "%s" does not exist',a[2][s]));n=n[a[2][s]]}else n=a[1]?e[a[1]]:e[f++];if(r.not_type.test(a[8])&&r.not_primitive.test(a[8])&&n instanceof Function&&(n=n()),r.numeric_arg.test(a[8])&&"number"!=typeof n&&isNaN(n))throw new TypeError(o("[sprintf] expecting number but found %T",n));switch(r.number.test(a[8])&&(h=n>=0),a[8]){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a[6]?parseInt(a[6]):0);break;case"e":n=a[7]?parseFloat(n).toExponential(a[7]):parseFloat(n).toExponential();break;case"f":n=a[7]?parseFloat(n).toFixed(a[7]):parseFloat(n);break;case"g":n=a[7]?String(Number(n.toPrecision(a[7]))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a[7]?n.substring(0,a[7]):n;break;case"t":n=String(!!n),n=a[7]?n.substring(0,a[7]):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a[7]?n.substring(0,a[7]):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a[7]?n.substring(0,a[7]):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}r.json.test(a[8])?m+=n:(!r.number.test(a[8])||h&&!a[3]?p="":(p=h?"+":"-",n=n.toString().replace(r.sign,"")),l=a[4]?"0"===a[4]?"0":a[4].charAt(1):" ",c=a[6]-(p+n).length,u=a[6]&&c>0?l.repeat(c):"",m+=a[5]?p+n+u:"0"===l?p+u+n:u+p+n)}return m}(function(t){if(a[t])return a[t];var e,n=t,i=[],o=0;for(;n;){if(null!==(e=r.text.exec(n)))i.push(e[0]);else if(null!==(e=r.modulo.exec(n)))i.push("%");else{if(null===(e=r.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],u=e[2],l=[];if(null===(l=r.key.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(l[1]);""!==(u=u.substring(l[0].length));)if(null!==(l=r.key_access.exec(u)))s.push(l[1]);else{if(null===(l=r.index_access.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(l[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push(e)}n=n.substring(e[0].length)}return a[t]=i}(t),arguments)}function s(t,e){return o.apply(null,[t].concat(e||[]))}var a=Object.create(null);e.sprintf=o,e.vsprintf=s,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=s,void 0===(i=function(){return{sprintf:o,vsprintf:s}}.call(e,n,e,t))||(t.exports=i))}()},function(t,e,n){"use strict";var i=n(96),r=n(10),o=n(70),s=n(69),a=n(31),u=n(103),l=n(24);function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in u)if(u.hasOwnProperty(e)&&u[e].magic===t)return u[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,n,i,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index<r;)e=t.readInt(2),n=t.readInt(2),i=t.readData(n),this.extraFields[e]={id:e,length:n,value:i}},handleUTF8:function(){var t=l.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var n=r.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var o=r.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=i(t.value);return 1!==e.readInt(1)?null:s(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=i(t.value);return 1!==e.readInt(1)?null:s(this.fileComment)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null}},t.exports=c},function(t,e,n){"use strict";var i=n(93);function r(t){i.call(this,t)}n(10).inherits(r,i),r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(94);function r(t){i.call(this,t)}n(10).inherits(r,i),r.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},r.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},r.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(96),r=n(10),o=n(97),s=n(171),a=(n(31),n(24));function u(t){this.files=[],this.loadOptions=t}u.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(e)+", expected "+r.pretty(t)+")")}},isSignature:function(t,e){var n=this.reader.index;this.reader.setIndex(t);var i=this.reader.readString(4)===e;return this.reader.setIndex(n),i},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=a.uint8array?"uint8array":"array",n=r.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,n,i=this.zip64EndOfCentralSize-44;0<i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(t=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(t<0)throw!this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(t);var e=t;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var i=e-n;if(i>0)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=i(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},function(t,e,n){"use strict";var i=n(10),r=n(45),o=n(31),s=(i=n(10),n(174)),a=n(104),u=n(57);function l(t){return new r.Promise(function(e,n){var i=t.decompressed.getContentWorker().pipe(new a);i.on("error",function(t){n(t)}).on("end",function(){i.streamInfo.crc32!==t.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}t.exports=function(t,e){var n=this;return e=i.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(t)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var n=new s(e);return n.load(t),n}).then(function(t){var n=[r.Promise.resolve(t)],i=t.files;if(e.checkCRC32)for(var o=0;o<i.length;o++)n.push(l(i[o]));return r.Promise.all(n)}).then(function(t){for(var i=t.shift(),r=i.files,o=0;o<r.length;o++){var s=r[o];n.file(s.fileNameStr,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:e.createFolders})}return i.zipComment.length&&(n.comment=i.zipComment),n})}},function(t,e,n){"use strict";var i=n(10),r=n(16);function o(t,e){r.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}i.inherits(o,r),o.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},o.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},function(t,e,n){"use strict";var i=n(10),r=n(16),o=n(31),s=n(69),a=n(97),u=function(t,e){var n,i="";for(n=0;n<e;n++)i+=String.fromCharCode(255&t),t>>>=8;return i},l=function(t,e,n,r,l,c){var h,p,f=t.file,d=t.compression,m=c!==o.utf8encode,y=i.transformTo("string",c(f.name)),_=i.transformTo("string",o.utf8encode(f.name)),v=f.comment,g=i.transformTo("string",c(v)),b=i.transformTo("string",o.utf8encode(v)),w=_.length!==f.name.length,k=b.length!==v.length,S="",x="",T="",O=f.dir,P=f.date,A={crc32:0,compressedSize:0,uncompressedSize:0};e&&!n||(A.crc32=t.crc32,A.compressedSize=t.compressedSize,A.uncompressedSize=t.uncompressedSize);var C=0;e&&(C|=8),m||!w&&!k||(C|=2048);var E,M,R=0,j=0;O&&(R|=16),"UNIX"===l?(j=798,R|=(E=f.unixPermissions,M=E,E||(M=O?16893:33204),(65535&M)<<16)):(j=20,R|=63&(f.dosPermissions||0)),h=P.getUTCHours(),h<<=6,h|=P.getUTCMinutes(),h<<=5,h|=P.getUTCSeconds()/2,p=P.getUTCFullYear()-1980,p<<=4,p|=P.getUTCMonth()+1,p<<=5,p|=P.getUTCDate(),w&&(x=u(1,1)+u(s(y),4)+_,S+="up"+u(x.length,2)+x),k&&(T=u(1,1)+u(s(g),4)+b,S+="uc"+u(T.length,2)+T);var N="";return N+="\n\0",N+=u(C,2),N+=d.magic,N+=u(h,2),N+=u(p,2),N+=u(A.crc32,4),N+=u(A.compressedSize,4),N+=u(A.uncompressedSize,4),N+=u(y.length,2),N+=u(S.length,2),{fileRecord:a.LOCAL_FILE_HEADER+N+y+S,dirRecord:a.CENTRAL_FILE_HEADER+u(j,2)+N+u(g.length,2)+"\0\0\0\0"+u(R,4)+u(r,4)+y+S+g}};function c(t,e,n,i){r.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}i.inherits(c,r),c.prototype.push=function(t){var e=t.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,r.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:n?(e+100*(n-i-1))/n:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var n=l(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,n=l(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),e)this.push({data:function(t){return a.DATA_DESCRIPTOR+u(t.crc32,4)+u(t.compressedSize,4)+u(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var n=this.bytesWritten-t,r=function(t,e,n,r,o){var s=i.transformTo("string",o(r));return a.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(t,2)+u(t,2)+u(e,4)+u(n,4)+u(s.length,2)+s}(this.dirRecords.length,n,t,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},c.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},c.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()}),t.on("error",function(t){e.error(t)}),this},c.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},c.prototype.error=function(t){var e=this._sources;if(!r.prototype.error.call(this,t))return!1;for(var n=0;n<e.length;n++)try{e[n].error(t)}catch(t){}return!0},c.prototype.lock=function(){r.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},t.exports=c},function(t,e,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,n){"use strict";var i=n(23),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,n,u,l,c,h,p){var f,d,m,y,_,v,g,b,w,k=p.bits,S=0,x=0,T=0,O=0,P=0,A=0,C=0,E=0,M=0,R=0,j=null,N=0,F=new i.Buf16(16),L=new i.Buf16(16),D=null,q=0;for(S=0;S<=15;S++)F[S]=0;for(x=0;x<u;x++)F[e[n+x]]++;for(P=k,O=15;O>=1&&0===F[O];O--);if(P>O&&(P=O),0===O)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(T=1;T<O&&0===F[T];T++);for(P<T&&(P=T),E=1,S=1;S<=15;S++)if(E<<=1,(E-=F[S])<0)return-1;if(E>0&&(0===t||1!==O))return-1;for(L[1]=0,S=1;S<15;S++)L[S+1]=L[S]+F[S];for(x=0;x<u;x++)0!==e[n+x]&&(h[L[e[n+x]]++]=x);if(0===t?(j=D=h,v=19):1===t?(j=r,N-=257,D=o,q-=257,v=256):(j=s,D=a,v=-1),R=0,x=0,S=T,_=c,A=P,C=0,m=-1,y=(M=1<<P)-1,1===t&&M>852||2===t&&M>592)return 1;for(;;){g=S-C,h[x]<v?(b=0,w=h[x]):h[x]>v?(b=D[q+h[x]],w=j[N+h[x]]):(b=96,w=0),f=1<<S-C,T=d=1<<A;do{l[_+(R>>C)+(d-=f)]=g<<24|b<<16|w|0}while(0!==d);for(f=1<<S-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,x++,0==--F[S]){if(S===O)break;S=e[n+h[x]]}if(S>P&&(R&y)!==m){for(0===C&&(C=P),_+=T,E=1<<(A=S-C);A+C<O&&!((E-=F[A+C])<=0);)A++,E<<=1;if(M+=1<<A,1===t&&M>852||2===t&&M>592)return 1;l[m=R&y]=P<<24|A<<16|_-c|0}}return 0!==R&&(l[_+R]=S-C<<24|64<<16|0),p.bits=P,0}},function(t,e,n){"use strict";t.exports=function(t,e){var n,i,r,o,s,a,u,l,c,h,p,f,d,m,y,_,v,g,b,w,k,S,x,T,O;n=t.state,i=t.next_in,T=t.input,r=i+(t.avail_in-5),o=t.next_out,O=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),u=n.dmax,l=n.wsize,c=n.whave,h=n.wnext,p=n.window,f=n.hold,d=n.bits,m=n.lencode,y=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;t:do{d<15&&(f+=T[i++]<<d,d+=8,f+=T[i++]<<d,d+=8),g=m[f&_];e:for(;;){if(f>>>=b=g>>>24,d-=b,0===(b=g>>>16&255))O[o++]=65535&g;else{if(!(16&b)){if(0==(64&b)){g=m[(65535&g)+(f&(1<<b)-1)];continue e}if(32&b){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}w=65535&g,(b&=15)&&(d<b&&(f+=T[i++]<<d,d+=8),w+=f&(1<<b)-1,f>>>=b,d-=b),d<15&&(f+=T[i++]<<d,d+=8,f+=T[i++]<<d,d+=8),g=y[f&v];n:for(;;){if(f>>>=b=g>>>24,d-=b,!(16&(b=g>>>16&255))){if(0==(64&b)){g=y[(65535&g)+(f&(1<<b)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(k=65535&g,d<(b&=15)&&(f+=T[i++]<<d,(d+=8)<b&&(f+=T[i++]<<d,d+=8)),(k+=f&(1<<b)-1)>u){t.msg="invalid distance too far back",n.mode=30;break t}if(f>>>=b,d-=b,k>(b=o-s)){if((b=k-b)>c&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(S=0,x=p,0===h){if(S+=l-b,b<w){w-=b;do{O[o++]=p[S++]}while(--b);S=o-k,x=O}}else if(h<b){if(S+=l+h-b,(b-=h)<w){w-=b;do{O[o++]=p[S++]}while(--b);if(S=0,h<w){w-=b=h;do{O[o++]=p[S++]}while(--b);S=o-k,x=O}}}else if(S+=h-b,b<w){w-=b;do{O[o++]=p[S++]}while(--b);S=o-k,x=O}for(;w>2;)O[o++]=x[S++],O[o++]=x[S++],O[o++]=x[S++],w-=3;w&&(O[o++]=x[S++],w>1&&(O[o++]=x[S++]))}else{S=o-k;do{O[o++]=O[S++],O[o++]=O[S++],O[o++]=O[S++],w-=3}while(w>2);w&&(O[o++]=O[S++],w>1&&(O[o++]=O[S++]))}break}}break}}while(i<r&&o<a);i-=w=d>>3,f&=(1<<(d-=w<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<a?a-o+257:257-(o-a),n.hold=f,n.bits=d}},function(t,e,n){"use strict";var i=n(23),r=n(102),o=n(101),s=n(180),a=n(179),u=0,l=1,c=2,h=4,p=5,f=6,d=0,m=1,y=2,_=-2,v=-3,g=-4,b=-5,w=8,k=1,S=2,x=3,T=4,O=5,P=6,A=7,C=8,E=9,M=10,R=11,j=12,N=13,F=14,L=15,D=16,q=17,I=18,B=19,U=20,z=21,Y=22,W=23,G=24,V=25,H=26,Z=27,Q=28,K=29,$=30,X=31,J=32,tt=852,et=592,nt=15;function it(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function rt(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=k,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(tt),e.distcode=e.distdyn=new i.Buf32(et),e.sane=1,e.back=-1,d):_}function ot(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,rt(t)):_}function st(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,ot(t))):_}function at(t,e){var n,r;return t?(r=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},t.state=r,r.window=null,(n=st(t,e))!==d&&(t.state=null),n):_}var ut,lt,ct=!0;function ht(t){if(ct){var e;for(ut=new i.Buf32(512),lt=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(l,t.lens,0,288,ut,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(c,t.lens,0,32,lt,0,t.work,{bits:5}),ct=!1}t.lencode=ut,t.lenbits=9,t.distcode=lt,t.distbits=5}function pt(t,e,n,r){var o,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new i.Buf8(s.wsize)),r>=s.wsize?(i.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>r&&(o=r),i.arraySet(s.window,e,n-r,o,s.wnext),(r-=o)?(i.arraySet(s.window,e,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}e.inflateReset=ot,e.inflateReset2=st,e.inflateResetKeep=rt,e.inflateInit=function(t){return at(t,nt)},e.inflateInit2=at,e.inflate=function(t,e){var n,tt,et,nt,rt,ot,st,at,ut,lt,ct,ft,dt,mt,yt,_t,vt,gt,bt,wt,kt,St,xt,Tt,Ot=0,Pt=new i.Buf8(4),At=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return _;(n=t.state).mode===j&&(n.mode=N),rt=t.next_out,et=t.output,st=t.avail_out,nt=t.next_in,tt=t.input,ot=t.avail_in,at=n.hold,ut=n.bits,lt=ot,ct=st,St=d;t:for(;;)switch(n.mode){case k:if(0===n.wrap){n.mode=N;break}for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(2&n.wrap&&35615===at){n.check=0,Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0),at=0,ut=0,n.mode=S;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&at)<<8)+(at>>8))%31){t.msg="incorrect header check",n.mode=$;break}if((15&at)!==w){t.msg="unknown compression method",n.mode=$;break}if(ut-=4,kt=8+(15&(at>>>=4)),0===n.wbits)n.wbits=kt;else if(kt>n.wbits){t.msg="invalid window size",n.mode=$;break}n.dmax=1<<kt,t.adler=n.check=1,n.mode=512&at?M:j,at=0,ut=0;break;case S:for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(n.flags=at,(255&n.flags)!==w){t.msg="unknown compression method",n.mode=$;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=$;break}n.head&&(n.head.text=at>>8&1),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0,n.mode=x;case x:for(;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.head&&(n.head.time=at),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,Pt[2]=at>>>16&255,Pt[3]=at>>>24&255,n.check=o(n.check,Pt,4,0)),at=0,ut=0,n.mode=T;case T:for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.head&&(n.head.xflags=255&at,n.head.os=at>>8),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0,n.mode=O;case O:if(1024&n.flags){for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.length=at,n.head&&(n.head.extra_len=at),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0}else n.head&&(n.head.extra=null);n.mode=P;case P:if(1024&n.flags&&((ft=n.length)>ot&&(ft=ot),ft&&(n.head&&(kt=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,tt,nt,ft,kt)),512&n.flags&&(n.check=o(n.check,tt,ft,nt)),ot-=ft,nt+=ft,n.length-=ft),n.length))break t;n.length=0,n.mode=A;case A:if(2048&n.flags){if(0===ot)break t;ft=0;do{kt=tt[nt+ft++],n.head&&kt&&n.length<65536&&(n.head.name+=String.fromCharCode(kt))}while(kt&&ft<ot);if(512&n.flags&&(n.check=o(n.check,tt,ft,nt)),ot-=ft,nt+=ft,kt)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=C;case C:if(4096&n.flags){if(0===ot)break t;ft=0;do{kt=tt[nt+ft++],n.head&&kt&&n.length<65536&&(n.head.comment+=String.fromCharCode(kt))}while(kt&&ft<ot);if(512&n.flags&&(n.check=o(n.check,tt,ft,nt)),ot-=ft,nt+=ft,kt)break t}else n.head&&(n.head.comment=null);n.mode=E;case E:if(512&n.flags){for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(at!==(65535&n.check)){t.msg="header crc mismatch",n.mode=$;break}at=0,ut=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=j;break;case M:for(;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}t.adler=n.check=it(at),at=0,ut=0,n.mode=R;case R:if(0===n.havedict)return t.next_out=rt,t.avail_out=st,t.next_in=nt,t.avail_in=ot,n.hold=at,n.bits=ut,y;t.adler=n.check=1,n.mode=j;case j:if(e===p||e===f)break t;case N:if(n.last){at>>>=7&ut,ut-=7&ut,n.mode=Z;break}for(;ut<3;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}switch(n.last=1&at,ut-=1,3&(at>>>=1)){case 0:n.mode=F;break;case 1:if(ht(n),n.mode=U,e===f){at>>>=2,ut-=2;break t}break;case 2:n.mode=q;break;case 3:t.msg="invalid block type",n.mode=$}at>>>=2,ut-=2;break;case F:for(at>>>=7&ut,ut-=7&ut;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if((65535&at)!=(at>>>16^65535)){t.msg="invalid stored block lengths",n.mode=$;break}if(n.length=65535&at,at=0,ut=0,n.mode=L,e===f)break t;case L:n.mode=D;case D:if(ft=n.length){if(ft>ot&&(ft=ot),ft>st&&(ft=st),0===ft)break t;i.arraySet(et,tt,nt,ft,rt),ot-=ft,nt+=ft,st-=ft,rt+=ft,n.length-=ft;break}n.mode=j;break;case q:for(;ut<14;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(n.nlen=257+(31&at),at>>>=5,ut-=5,n.ndist=1+(31&at),at>>>=5,ut-=5,n.ncode=4+(15&at),at>>>=4,ut-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=$;break}n.have=0,n.mode=I;case I:for(;n.have<n.ncode;){for(;ut<3;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.lens[At[n.have++]]=7&at,at>>>=3,ut-=3}for(;n.have<19;)n.lens[At[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,xt={bits:n.lenbits},St=a(u,n.lens,0,19,n.lencode,0,n.work,xt),n.lenbits=xt.bits,St){t.msg="invalid code lengths set",n.mode=$;break}n.have=0,n.mode=B;case B:for(;n.have<n.nlen+n.ndist;){for(;_t=(Ot=n.lencode[at&(1<<n.lenbits)-1])>>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(vt<16)at>>>=yt,ut-=yt,n.lens[n.have++]=vt;else{if(16===vt){for(Tt=yt+2;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(at>>>=yt,ut-=yt,0===n.have){t.msg="invalid bit length repeat",n.mode=$;break}kt=n.lens[n.have-1],ft=3+(3&at),at>>>=2,ut-=2}else if(17===vt){for(Tt=yt+3;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}ut-=yt,kt=0,ft=3+(7&(at>>>=yt)),at>>>=3,ut-=3}else{for(Tt=yt+7;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}ut-=yt,kt=0,ft=11+(127&(at>>>=yt)),at>>>=7,ut-=7}if(n.have+ft>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=$;break}for(;ft--;)n.lens[n.have++]=kt}}if(n.mode===$)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=$;break}if(n.lenbits=9,xt={bits:n.lenbits},St=a(l,n.lens,0,n.nlen,n.lencode,0,n.work,xt),n.lenbits=xt.bits,St){t.msg="invalid literal/lengths set",n.mode=$;break}if(n.distbits=6,n.distcode=n.distdyn,xt={bits:n.distbits},St=a(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,xt),n.distbits=xt.bits,St){t.msg="invalid distances set",n.mode=$;break}if(n.mode=U,e===f)break t;case U:n.mode=z;case z:if(ot>=6&&st>=258){t.next_out=rt,t.avail_out=st,t.next_in=nt,t.avail_in=ot,n.hold=at,n.bits=ut,s(t,ct),rt=t.next_out,et=t.output,st=t.avail_out,nt=t.next_in,tt=t.input,ot=t.avail_in,at=n.hold,ut=n.bits,n.mode===j&&(n.back=-1);break}for(n.back=0;_t=(Ot=n.lencode[at&(1<<n.lenbits)-1])>>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(_t&&0==(240&_t)){for(gt=yt,bt=_t,wt=vt;_t=(Ot=n.lencode[wt+((at&(1<<gt+bt)-1)>>gt)])>>>16&255,vt=65535&Ot,!(gt+(yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}at>>>=gt,ut-=gt,n.back+=gt}if(at>>>=yt,ut-=yt,n.back+=yt,n.length=vt,0===_t){n.mode=H;break}if(32&_t){n.back=-1,n.mode=j;break}if(64&_t){t.msg="invalid literal/length code",n.mode=$;break}n.extra=15&_t,n.mode=Y;case Y:if(n.extra){for(Tt=n.extra;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.length+=at&(1<<n.extra)-1,at>>>=n.extra,ut-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=W;case W:for(;_t=(Ot=n.distcode[at&(1<<n.distbits)-1])>>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(0==(240&_t)){for(gt=yt,bt=_t,wt=vt;_t=(Ot=n.distcode[wt+((at&(1<<gt+bt)-1)>>gt)])>>>16&255,vt=65535&Ot,!(gt+(yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}at>>>=gt,ut-=gt,n.back+=gt}if(at>>>=yt,ut-=yt,n.back+=yt,64&_t){t.msg="invalid distance code",n.mode=$;break}n.offset=vt,n.extra=15&_t,n.mode=G;case G:if(n.extra){for(Tt=n.extra;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.offset+=at&(1<<n.extra)-1,at>>>=n.extra,ut-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=$;break}n.mode=V;case V:if(0===st)break t;if(ft=ct-st,n.offset>ft){if((ft=n.offset-ft)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=$;break}ft>n.wnext?(ft-=n.wnext,dt=n.wsize-ft):dt=n.wnext-ft,ft>n.length&&(ft=n.length),mt=n.window}else mt=et,dt=rt-n.offset,ft=n.length;ft>st&&(ft=st),st-=ft,n.length-=ft;do{et[rt++]=mt[dt++]}while(--ft);0===n.length&&(n.mode=z);break;case H:if(0===st)break t;et[rt++]=n.length,st--,n.mode=z;break;case Z:if(n.wrap){for(;ut<32;){if(0===ot)break t;ot--,at|=tt[nt++]<<ut,ut+=8}if(ct-=st,t.total_out+=ct,n.total+=ct,ct&&(t.adler=n.check=n.flags?o(n.check,et,ct,rt-ct):r(n.check,et,ct,rt-ct)),ct=st,(n.flags?at:it(at))!==n.check){t.msg="incorrect data check",n.mode=$;break}at=0,ut=0}n.mode=Q;case Q:if(n.wrap&&n.flags){for(;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(at!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=$;break}at=0,ut=0}n.mode=K;case K:St=m;break t;case $:St=v;break t;case X:return g;case J:default:return _}return t.next_out=rt,t.avail_out=st,t.next_in=nt,t.avail_in=ot,n.hold=at,n.bits=ut,(n.wsize||ct!==t.avail_out&&n.mode<$&&(n.mode<Z||e!==h))&&pt(t,t.output,t.next_out,ct-t.avail_out)?(n.mode=X,g):(lt-=t.avail_in,ct-=t.avail_out,t.total_in+=lt,t.total_out+=ct,n.total+=ct,n.wrap&&ct&&(t.adler=n.check=n.flags?o(n.check,et,ct,t.next_out-ct):r(n.check,et,ct,t.next_out-ct)),t.data_type=n.bits+(n.last?64:0)+(n.mode===j?128:0)+(n.mode===U||n.mode===L?256:0),(0===lt&&0===ct||e===h)&&St===d&&(St=b),St)},e.inflateEnd=function(t){if(!t||!t.state)return _;var e=t.state;return e.window&&(e.window=null),t.state=null,d},e.inflateGetHeader=function(t,e){var n;return t&&t.state?0==(2&(n=t.state).wrap)?_:(n.head=e,e.done=!1,d):_},e.inflateSetDictionary=function(t,e){var n,i=e.length;return t&&t.state?0!==(n=t.state).wrap&&n.mode!==R?_:n.mode===R&&r(1,e,i,0)!==n.check?v:pt(t,e,i,i)?(n.mode=X,g):(n.havedict=1,d):_},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,n){"use strict";var i=n(181),r=n(23),o=n(100),s=n(98),a=n(68),u=n(99),l=n(178),c=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK)throw new Error(a[n]);this.header=new l,i.inflateGetHeader(this.strm,this.header)}function p(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}h.prototype.push=function(t,e){var n,a,u,l,h,p,f=this.strm,d=this.options.chunkSize,m=this.options.dictionary,y=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?f.input=o.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new r.Buf8(d),f.next_out=0,f.avail_out=d),(n=i.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&m&&(p="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,n=i.inflateSetDictionary(this.strm,p)),n===s.Z_BUF_ERROR&&!0===y&&(n=s.Z_OK,y=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&n!==s.Z_STREAM_END&&(0!==f.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(f.output,f.next_out),l=f.next_out-u,h=o.buf2string(f.output,u),f.next_out=l,f.avail_out=d-l,l&&r.arraySet(f.output,f.output,u,l,0),this.onData(h)):this.onData(r.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(y=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=h,e.inflate=p,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,p(t,e)},e.ungzip=p},function(t,e,n){"use strict";var i=n(23),r=4,o=0,s=1,a=2;function u(t){for(var e=t.length;--e>=0;)t[e]=0}var l=0,c=1,h=2,p=29,f=256,d=f+1+p,m=30,y=19,_=2*d+1,v=15,g=16,b=7,w=256,k=16,S=17,x=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],O=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=new Array(2*(d+2));u(C);var E=new Array(2*m);u(E);var M=new Array(512);u(M);var R=new Array(256);u(R);var j=new Array(p);u(j);var N,F,L,D=new Array(m);function q(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function I(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function B(t){return t<256?M[t]:M[256+(t>>>7)]}function U(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function z(t,e,n){t.bi_valid>g-n?(t.bi_buf|=e<<t.bi_valid&65535,U(t,t.bi_buf),t.bi_buf=e>>g-t.bi_valid,t.bi_valid+=n-g):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function Y(t,e,n){z(t,n[2*e],n[2*e+1])}function W(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function G(t,e,n){var i,r,o=new Array(v+1),s=0;for(i=1;i<=v;i++)o[i]=s=s+n[i-1]<<1;for(r=0;r<=e;r++){var a=t[2*r+1];0!==a&&(t[2*r]=W(o[a]++,a))}}function V(t){var e;for(e=0;e<d;e++)t.dyn_ltree[2*e]=0;for(e=0;e<m;e++)t.dyn_dtree[2*e]=0;for(e=0;e<y;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*w]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function H(t){t.bi_valid>8?U(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Z(t,e,n,i){var r=2*e,o=2*n;return t[r]<t[o]||t[r]===t[o]&&i[e]<=i[n]}function Q(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&Z(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!Z(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function K(t,e,n){var i,r,o,s,a=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*a]<<8|t.pending_buf[t.d_buf+2*a+1],r=t.pending_buf[t.l_buf+a],a++,0===i?Y(t,r,e):(Y(t,(o=R[r])+f+1,e),0!==(s=T[o])&&z(t,r-=j[o],s),Y(t,o=B(--i),n),0!==(s=O[o])&&z(t,i-=D[o],s))}while(a<t.last_lit);Y(t,w,e)}function $(t,e){var n,i,r,o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.has_stree,u=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=_,n=0;n<u;n++)0!==o[2*n]?(t.heap[++t.heap_len]=l=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(r=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[r]=0,t.opt_len--,a&&(t.static_len-=s[2*r+1]);for(e.max_code=l,n=t.heap_len>>1;n>=1;n--)Q(t,o,n);r=u;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Q(t,o,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,o[2*r]=o[2*n]+o[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,o[2*n+1]=o[2*i+1]=r,t.heap[1]=r++,Q(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,o,s,a,u=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,d=e.stat_desc.max_length,m=0;for(o=0;o<=v;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<_;n++)(o=u[2*u[2*(i=t.heap[n])+1]+1]+1)>d&&(o=d,m++),u[2*i+1]=o,i>l||(t.bl_count[o]++,s=0,i>=f&&(s=p[i-f]),a=u[2*i],t.opt_len+=a*(o+s),h&&(t.static_len+=a*(c[2*i+1]+s)));if(0!==m){do{for(o=d-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[d]--,m-=2}while(m>0);for(o=d;0!==o;o--)for(i=t.bl_count[o];0!==i;)(r=t.heap[--n])>l||(u[2*r+1]!==o&&(t.opt_len+=(o-u[2*r+1])*u[2*r],u[2*r+1]=o),i--)}}(t,e),G(o,l,t.bl_count)}function X(t,e,n){var i,r,o=-1,s=e[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++a<u&&r===s||(a<l?t.bl_tree[2*r]+=a:0!==r?(r!==o&&t.bl_tree[2*r]++,t.bl_tree[2*k]++):a<=10?t.bl_tree[2*S]++:t.bl_tree[2*x]++,a=0,o=r,0===s?(u=138,l=3):r===s?(u=6,l=3):(u=7,l=4))}function J(t,e,n){var i,r,o=-1,s=e[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),i=0;i<=n;i++)if(r=s,s=e[2*(i+1)+1],!(++a<u&&r===s)){if(a<l)do{Y(t,r,t.bl_tree)}while(0!=--a);else 0!==r?(r!==o&&(Y(t,r,t.bl_tree),a--),Y(t,k,t.bl_tree),z(t,a-3,2)):a<=10?(Y(t,S,t.bl_tree),z(t,a-3,3)):(Y(t,x,t.bl_tree),z(t,a-11,7));a=0,o=r,0===s?(u=138,l=3):r===s?(u=6,l=3):(u=7,l=4)}}u(D);var tt=!1;function et(t,e,n,r){z(t,(l<<1)+(r?1:0),3),function(t,e,n,r){H(t),r&&(U(t,n),U(t,~n)),i.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n,!0)}e._tr_init=function(t){tt||(function(){var t,e,n,i,r,o=new Array(v+1);for(n=0,i=0;i<p-1;i++)for(j[i]=n,t=0;t<1<<T[i];t++)R[n++]=i;for(R[n-1]=i,r=0,i=0;i<16;i++)for(D[i]=r,t=0;t<1<<O[i];t++)M[r++]=i;for(r>>=7;i<m;i++)for(D[i]=r<<7,t=0;t<1<<O[i]-7;t++)M[256+r++]=i;for(e=0;e<=v;e++)o[e]=0;for(t=0;t<=143;)C[2*t+1]=8,t++,o[8]++;for(;t<=255;)C[2*t+1]=9,t++,o[9]++;for(;t<=279;)C[2*t+1]=7,t++,o[7]++;for(;t<=287;)C[2*t+1]=8,t++,o[8]++;for(G(C,d+1,o),t=0;t<m;t++)E[2*t+1]=5,E[2*t]=W(t,5);N=new q(C,T,f+1,d,v),F=new q(E,O,0,m,v),L=new q(new Array(0),P,0,y,b)}(),tt=!0),t.l_desc=new I(t.dyn_ltree,N),t.d_desc=new I(t.dyn_dtree,F),t.bl_desc=new I(t.bl_tree,L),t.bi_buf=0,t.bi_valid=0,V(t)},e._tr_stored_block=et,e._tr_flush_block=function(t,e,n,i){var u,l,p=0;t.level>0?(t.strm.data_type===a&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return s;for(e=32;e<f;e++)if(0!==t.dyn_ltree[2*e])return s;return o}(t)),$(t,t.l_desc),$(t,t.d_desc),p=function(t){var e;for(X(t,t.dyn_ltree,t.l_desc.max_code),X(t,t.dyn_dtree,t.d_desc.max_code),$(t,t.bl_desc),e=y-1;e>=3&&0===t.bl_tree[2*A[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),u=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=u&&(u=l)):u=l=n+5,n+4<=u&&-1!==e?et(t,e,n,i):t.strategy===r||l===u?(z(t,(c<<1)+(i?1:0),3),K(t,C,E)):(z(t,(h<<1)+(i?1:0),3),function(t,e,n,i){var r;for(z(t,e-257,5),z(t,n-1,5),z(t,i-4,4),r=0;r<i;r++)z(t,t.bl_tree[2*A[r]+1],3);J(t,t.dyn_ltree,e-1),J(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,p+1),K(t,t.dyn_ltree,t.dyn_dtree)),V(t),i&&H(t)},e._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(R[n]+f+1)]++,t.dyn_dtree[2*B(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){z(t,c<<1,3),Y(t,w,C),function(t){16===t.bi_valid?(U(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,n){"use strict";var i,r=n(23),o=n(183),s=n(102),a=n(101),u=n(68),l=0,c=1,h=3,p=4,f=5,d=0,m=1,y=-2,_=-3,v=-5,g=-1,b=1,w=2,k=3,S=4,x=0,T=2,O=8,P=9,A=15,C=8,E=286,M=30,R=19,j=2*E+1,N=15,F=3,L=258,D=L+F+1,q=32,I=42,B=69,U=73,z=91,Y=103,W=113,G=666,V=1,H=2,Z=3,Q=4,K=3;function $(t,e){return t.msg=u[e],e}function X(t){return(t<<1)-(t>4?9:0)}function J(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(r.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function et(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function nt(t,e){t.pending_buf[t.pending++]=e}function it(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function rt(t,e){var n,i,r=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,u=t.strstart>t.w_size-D?t.strstart-(t.w_size-D):0,l=t.window,c=t.w_mask,h=t.prev,p=t.strstart+L,f=l[o+s-1],d=l[o+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(l[(n=e)+s]===d&&l[n+s-1]===f&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<p);if(i=L-(p-o),o=p-L,i>s){if(t.match_start=e,s=i,i>=a)break;f=l[o+s-1],d=l[o+s]}}}while((e=h[e&c])>u&&0!=--r);return s<=t.lookahead?s:t.lookahead}function ot(t){var e,n,i,o,u,l,c,h,p,f,d=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-D)){r.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=n=t.hash_size;do{i=t.head[--e],t.head[e]=i>=d?i-d:0}while(--n);e=n=d;do{i=t.prev[--e],t.prev[e]=i>=d?i-d:0}while(--n);o+=d}if(0===t.strm.avail_in)break;if(l=t.strm,c=t.window,h=t.strstart+t.lookahead,p=o,f=void 0,(f=l.avail_in)>p&&(f=p),n=0===f?0:(l.avail_in-=f,r.arraySet(c,l.input,l.next_in,f,h),1===l.state.wrap?l.adler=s(l.adler,c,f,h):2===l.state.wrap&&(l.adler=a(l.adler,c,f,h)),l.next_in+=f,l.total_in+=f,f),t.lookahead+=n,t.lookahead+t.insert>=F)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+F-1])&t.hash_mask,t.prev[u&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=u,u++,t.insert--,!(t.lookahead+t.insert<F)););}while(t.lookahead<D&&0!==t.strm.avail_in)}function st(t,e){for(var n,i;;){if(t.lookahead<D){if(ot(t),t.lookahead<D&&e===l)return V;if(0===t.lookahead)break}if(n=0,t.lookahead>=F&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-D&&(t.match_length=rt(t,n)),t.match_length>=F)if(i=o._tr_tally(t,t.strstart-t.match_start,t.match_length-F),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=F){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=t.strstart<F-1?t.strstart:F-1,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}function at(t,e){for(var n,i,r;;){if(t.lookahead<D){if(ot(t),t.lookahead<D&&e===l)return V;if(0===t.lookahead)break}if(n=0,t.lookahead>=F&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=F-1,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-D&&(t.match_length=rt(t,n),t.match_length<=5&&(t.strategy===b||t.match_length===F&&t.strstart-t.match_start>4096)&&(t.match_length=F-1)),t.prev_length>=F&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-F,i=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-F),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=F-1,t.strstart++,i&&(et(t,!1),0===t.strm.avail_out))return V}else if(t.match_available){if((i=o._tr_tally(t,0,t.window[t.strstart-1]))&&et(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return V}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<F-1?t.strstart:F-1,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}function ut(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}function lt(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=T,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?I:W,t.adler=2===e.wrap?0:1,e.last_flush=l,o._tr_init(e),d):$(t,y)}function ct(t){var e,n=lt(t);return n===d&&((e=t.state).window_size=2*e.w_size,J(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=F-1,e.match_available=0,e.ins_h=0),n}function ht(t,e,n,i,o,s){if(!t)return y;var a=1;if(e===g&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),o<1||o>P||n!==O||i<8||i>15||e<0||e>9||s<0||s>S)return $(t,y);8===i&&(i=9);var u=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=O,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*j),this.dyn_dtree=new r.Buf16(2*(2*M+1)),this.bl_tree=new r.Buf16(2*(2*R+1)),J(this.dyn_ltree),J(this.dyn_dtree),J(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(N+1),this.heap=new r.Buf16(2*E+1),J(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*E+1),J(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return t.state=u,u.strm=t,u.wrap=a,u.gzhead=null,u.w_bits=i,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+F-1)/F),u.window=new r.Buf8(2*u.w_size),u.head=new r.Buf16(u.hash_size),u.prev=new r.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new r.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=s,u.method=n,ct(t)}i=[new ut(0,0,0,0,function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),0===t.lookahead&&e===l)return V;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,et(t,!1),0===t.strm.avail_out))return V;if(t.strstart-t.block_start>=t.w_size-D&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),V)}),new ut(4,4,8,4,st),new ut(4,5,16,8,st),new ut(4,6,32,32,st),new ut(4,4,16,16,at),new ut(8,16,32,32,at),new ut(8,16,128,128,at),new ut(8,32,128,256,at),new ut(32,128,258,1024,at),new ut(32,258,258,4096,at)],e.deflateInit=function(t,e){return ht(t,e,O,A,C,x)},e.deflateInit2=ht,e.deflateReset=ct,e.deflateResetKeep=lt,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?y:(t.state.gzhead=e,d):y},e.deflate=function(t,e){var n,r,s,u;if(!t||!t.state||e>f||e<0)return t?$(t,y):y;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||r.status===G&&e!==p)return $(t,0===t.avail_out?v:y);if(r.strm=t,n=r.last_flush,r.last_flush=e,r.status===I)if(2===r.wrap)t.adler=0,nt(r,31),nt(r,139),nt(r,8),r.gzhead?(nt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),nt(r,255&r.gzhead.time),nt(r,r.gzhead.time>>8&255),nt(r,r.gzhead.time>>16&255),nt(r,r.gzhead.time>>24&255),nt(r,9===r.level?2:r.strategy>=w||r.level<2?4:0),nt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(nt(r,255&r.gzhead.extra.length),nt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=B):(nt(r,0),nt(r,0),nt(r,0),nt(r,0),nt(r,0),nt(r,9===r.level?2:r.strategy>=w||r.level<2?4:0),nt(r,K),r.status=W);else{var _=O+(r.w_bits-8<<4)<<8;_|=(r.strategy>=w||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(_|=q),_+=31-_%31,r.status=W,it(r,_),0!==r.strstart&&(it(r,t.adler>>>16),it(r,65535&t.adler)),t.adler=1}if(r.status===B)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending!==r.pending_buf_size));)nt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=U)}else r.status=U;if(r.status===U)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending===r.pending_buf_size)){u=1;break}u=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,nt(r,u)}while(0!==u);r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===u&&(r.gzindex=0,r.status=z)}else r.status=z;if(r.status===z)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending===r.pending_buf_size)){u=1;break}u=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,nt(r,u)}while(0!==u);r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===u&&(r.status=Y)}else r.status=Y;if(r.status===Y&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&tt(t),r.pending+2<=r.pending_buf_size&&(nt(r,255&t.adler),nt(r,t.adler>>8&255),t.adler=0,r.status=W)):r.status=W),0!==r.pending){if(tt(t),0===t.avail_out)return r.last_flush=-1,d}else if(0===t.avail_in&&X(e)<=X(n)&&e!==p)return $(t,v);if(r.status===G&&0!==t.avail_in)return $(t,v);if(0!==t.avail_in||0!==r.lookahead||e!==l&&r.status!==G){var g=r.strategy===w?function(t,e){for(var n;;){if(0===t.lookahead&&(ot(t),0===t.lookahead)){if(e===l)return V;break}if(t.match_length=0,n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}(r,e):r.strategy===k?function(t,e){for(var n,i,r,s,a=t.window;;){if(t.lookahead<=L){if(ot(t),t.lookahead<=L&&e===l)return V;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=F&&t.strstart>0&&(i=a[r=t.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r]){s=t.strstart+L;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<s);t.match_length=L-(s-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=F?(n=o._tr_tally(t,1,t.match_length-F),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}(r,e):i[r.level].func(r,e);if(g!==Z&&g!==Q||(r.status=G),g===V||g===Z)return 0===t.avail_out&&(r.last_flush=-1),d;if(g===H&&(e===c?o._tr_align(r):e!==f&&(o._tr_stored_block(r,0,0,!1),e===h&&(J(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),tt(t),0===t.avail_out))return r.last_flush=-1,d}return e!==p?d:r.wrap<=0?m:(2===r.wrap?(nt(r,255&t.adler),nt(r,t.adler>>8&255),nt(r,t.adler>>16&255),nt(r,t.adler>>24&255),nt(r,255&t.total_in),nt(r,t.total_in>>8&255),nt(r,t.total_in>>16&255),nt(r,t.total_in>>24&255)):(it(r,t.adler>>>16),it(r,65535&t.adler)),tt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?d:m)},e.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==I&&e!==B&&e!==U&&e!==z&&e!==Y&&e!==W&&e!==G?$(t,y):(t.state=null,e===W?$(t,_):d):y},e.deflateSetDictionary=function(t,e){var n,i,o,a,u,l,c,h,p=e.length;if(!t||!t.state)return y;if(2===(a=(n=t.state).wrap)||1===a&&n.status!==I||n.lookahead)return y;for(1===a&&(t.adler=s(t.adler,e,p,0)),n.wrap=0,p>=n.w_size&&(0===a&&(J(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new r.Buf8(n.w_size),r.arraySet(h,e,p-n.w_size,n.w_size,0),e=h,p=n.w_size),u=t.avail_in,l=t.next_in,c=t.input,t.avail_in=p,t.next_in=0,t.input=e,ot(n);n.lookahead>=F;){i=n.strstart,o=n.lookahead-(F-1);do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+F-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++}while(--o);n.strstart=i,n.lookahead=F-1,ot(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=F-1,n.match_available=0,t.next_in=l,t.input=c,t.avail_in=u,n.wrap=a,d},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,n){"use strict";var i=n(184),r=n(23),o=n(100),s=n(68),a=n(99),u=Object.prototype.toString,l=0,c=-1,h=0,p=8;function f(t){if(!(this instanceof f))return new f(t);this.options=r.assign({level:c,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==l)throw new Error(s[n]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var d;if(d="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(n=i.deflateSetDictionary(this.strm,d))!==l)throw new Error(s[n]);this._dict_set=!0}}function d(t,e){var n=new f(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}f.prototype.push=function(t,e){var n,s,a=this.strm,c=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(c),a.next_out=0,a.avail_out=c),1!==(n=i.deflate(a,s))&&n!==l)return this.onEnd(n),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==n);return 4===s?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):2!==s||(this.onEnd(l),a.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=f,e.deflate=d,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,d(t,e)}},function(t,e,n){"use strict";var i={};(0,n(23).assign)(i,n(185),n(182),n(98)),t.exports=i},function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=n(186),o=n(10),s=n(16),a=i?"uint8array":"array";function u(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}e.magic="\b\0",o.inherits(u,s),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,t.data),!1)},u.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},e.compressWorker=function(t){return new u("Deflate",t)},e.uncompressWorker=function(){return new u("Inflate",{})}},function(t,e,n){"use strict";var i=n(103),r=n(177);e.generateWorker=function(t,e,n){var o=new r(e.streamFiles,n,e.platform,e.encodeFileName),s=0;try{t.forEach(function(t,n){s++;var r=function(t,e){var n=t||e,r=i[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,e.compression),a=n.options.compressionOptions||e.compressionOptions||{},u=n.dir,l=n.date;n._compressWorker(r,a).withStreamInfo("file",{name:t,dir:u,date:l,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)}),o.entriesCount=s}catch(t){o.error(t)}return o}},function(t,e,n){"use strict";var i=n(108),r=n(106),o=n(31),s=n(70),a=n(16),u=function(t,e,n){this.name=t,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=e,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};u.prototype={internalStream:function(t){var e=null,n="string";try{if(!t)throw new Error("No output type specified.");var r="string"===(n=t.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),e=this._decompressWorker();var s=!this._dataBinary;s&&!r&&(e=e.pipe(new o.Utf8EncodeWorker)),!s&&r&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new a("error")).error(t)}return new i(e,n,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof s&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(n,t,e)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof a?this._data:new r(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<l.length;h++)u.prototype[l[h]]=c;t.exports=u},function(t,e,n){"use strict";var i=n(119).Readable;function r(t,e,n){i.call(this,e),this._helper=t;var r=this;t.on("data",function(t,e){r.push(t)||r._helper.pause(),n&&n(e)}).on("error",function(t){r.emit("error",t)}).on("end",function(){r.push(null)})}n(10).inherits(r,i),r.prototype._read=function(){this._helper.resume()},t.exports=r},function(t,e,n){"use strict";var i=n(16),r=n(10);function o(t){i.call(this,"ConvertWorker to "+t),this.destType=t}r.inherits(o,i),o.prototype.processChunk=function(t){this.push({data:r.transformTo(this.destType,t.data),meta:t.meta})},t.exports=o},function(t,e,n){"use strict";(function(e){var n,i,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var o=0,s=new r(c),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var u=new e.MessageChannel;u.port1.onmessage=c,n=function(){u.port2.postMessage(0)}}var l=[];function c(){var t,e;i=!0;for(var n=l.length;n;){for(e=l,l=[],t=-1;++t<n;)e[t]();n=l.length}i=!1}t.exports=function(t){1!==l.push(t)||i||n()}}).call(this,n(22))},function(t,e,n){"use strict";var i=n(192);function r(){}var o={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==r&&f(this,t)}function c(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(t,e,n){i(function(){var i;try{i=e(n)}catch(e){return o.reject(t,e)}i===t?o.reject(t,new TypeError("Cannot resolve promise with itself")):o.resolve(t,i)})}function p(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function f(t,e){var n=!1;function i(e){n||(n=!0,o.reject(t,e))}function r(e){n||(n=!0,o.resolve(t,e))}var s=d(function(){e(r,i)});"error"===s.status&&i(s.value)}function d(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}t.exports=l,l.prototype.catch=function(t){return this.then(null,t)},l.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var n=new this.constructor(r);this.state!==u?h(n,this.state===a?t:e,this.outcome):this.queue.push(new c(n,t,e));return n},c.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){h(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){o.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){h(this.promise,this.onRejected,t)},o.resolve=function(t,e){var n=d(p,e);if("error"===n.status)return o.reject(t,n.value);var i=n.value;if(i)f(t,i);else{t.state=a,t.outcome=e;for(var r=-1,s=t.queue.length;++r<s;)t.queue[r].callFulfilled(e)}return t},o.reject=function(t,e){t.state=s,t.outcome=e;for(var n=-1,i=t.queue.length;++n<i;)t.queue[n].callRejected(e);return t},l.resolve=function(t){if(t instanceof this)return t;return o.resolve(new this(r),t)},l.reject=function(t){var e=new this(r);return o.reject(e,t)},l.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);var s=new Array(n),a=0,u=-1,l=new this(r);for(;++u<n;)c(t[u],u);return l;function c(t,r){e.resolve(t).then(function(t){s[r]=t,++a!==n||i||(i=!0,o.resolve(l,s))},function(t){i||(i=!0,o.reject(l,t))})}},l.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);var s=-1,a=new this(r);for(;++s<n;)u=t[s],e.resolve(u).then(function(t){i||(i=!0,o.resolve(a,t))},function(t){i||(i=!0,o.reject(a,t))});var u;return a}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){t.exports=n(56).document&&document.documentElement},function(t,e){t.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var i,r,o,s=n(111),a=n(196),u=n(195),l=n(109),c=n(56),h=c.process,p=c.setImmediate,f=c.clearImmediate,d=c.MessageChannel,m=0,y={},_=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},v=function(t){_.call(t.data)};p&&f||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++m]=function(){a("function"==typeof t?t:Function(t),e)},i(m),m},f=function(t){delete y[t]},"process"==n(194)(h)?i=function(t){h.nextTick(s(_,t,1))}:d?(o=(r=new d).port2,r.port1.onmessage=v,i=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(t){c.postMessage(t+"","*")},c.addEventListener("message",v,!1)):i="onreadystatechange"in l("script")?function(t){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),_.call(t)}}:function(t){setTimeout(s(_,t,1),0)}),t.exports={set:p,clear:f}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(72);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports=!n(71)&&!n(110)(function(){return 7!=Object.defineProperty(n(109)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(72);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var i=n(201),r=n(200),o=n(199),s=Object.defineProperty;e.f=n(71)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(202),r=n(198);t.exports=n(71)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(56),r=n(112),o=n(111),s=n(203),a=function(t,e,n){var u,l,c,h=t&a.F,p=t&a.G,f=t&a.S,d=t&a.P,m=t&a.B,y=t&a.W,_=p?r:r[e]||(r[e]={}),v=_.prototype,g=p?i:f?i[e]:(i[e]||{}).prototype;for(u in p&&(n=e),n)(l=!h&&g&&void 0!==g[u])&&u in _||(c=l?g[u]:n[u],_[u]=p&&"function"!=typeof g[u]?n[u]:m&&l?o(c,i):y&&g[u]==c?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):d&&"function"==typeof c?o(Function.call,c):c,d&&((_.virtual||(_.virtual={}))[u]=c,t&a.R&&v&&!v[u]&&s(v,u,c)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var i=n(205),r=n(197);i(i.G+i.B,{setImmediate:r.set,clearImmediate:r.clear})},function(t,e,n){n(206),t.exports=n(112).setImmediate},function(t,e,n){t.exports=n(74).PassThrough},function(t,e,n){t.exports=n(74).Transform},function(t,e,n){t.exports=n(26)},function(t,e,n){t.exports=n(73)},function(t,e,n){"use strict";t.exports=o;var i=n(114),r=n(46);function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}r.inherits=n(30),r.inherits(o,i),o.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,n(22))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,o,s,a,u=1,l={},c=!1,h=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},i=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(r=h.documentElement,i=function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&d(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(s+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return l[u]=r,i(u),u++},p.clearImmediate=f}function f(t){delete l[t]}function d(t){if(c)setTimeout(d,0,t);else{var e=l[t];if(e){c=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(n,i)}}(e)}finally{f(t),c=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(22),n(43))},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(214),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(22))},function(t,e){},function(t,e,n){"use strict";var i=n(58).Buffer,r=n(216);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,n,r,o=i.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,n=o,r=a,e.copy(n,r),a+=s.data.length,s=s.next;return o},t}(),r&&r.inspect&&r.inspect.custom&&(t.exports.prototype[r.inspect.custom]=function(){var t=r.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){t.exports=r;var i=n(75).EventEmitter;function r(){i.call(this)}n(30)(r,i),r.Readable=n(74),r.Writable=n(211),r.Duplex=n(210),r.Transform=n(209),r.PassThrough=n(208),r.Stream=r,r.prototype.pipe=function(t,e){var n=this;function r(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",r),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(c(),0===i.listenerCount(this,"error"))throw t}function c(){n.removeListener("data",r),t.removeListener("drain",o),n.removeListener("end",a),n.removeListener("close",u),n.removeListener("error",l),t.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),t.removeListener("close",c)}return n.on("error",l),t.on("error",l),n.on("end",c),n.on("close",c),t.on("close",c),t.emit("pipe",n),t}},function(t,e){e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,u=(1<<a)-1,l=u>>1,c=-7,h=n?r-1:0,p=n?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=l}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,u,l=8*o-r-1,c=(1<<l)-1,h=c>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*u-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=d,a/=256,r-=8);for(s=s<<r|a,l+=r;l>0;t[n+f]=255&s,f+=d,s/=256,l-=8);t[n+f-d]|=128*m}},function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],i=e[1];return 3*(n+i)/4-i},e.toByteArray=function(t){for(var e,n=l(t),i=n[0],s=n[1],a=new o(function(t,e,n){return 3*(e+n)/4-n}(0,i,s)),u=0,c=s>0?i-4:i,h=0;h<c;h+=4)e=r[t.charCodeAt(h)]<<18|r[t.charCodeAt(h+1)]<<12|r[t.charCodeAt(h+2)]<<6|r[t.charCodeAt(h+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=r[t.charCodeAt(h)]<<2|r[t.charCodeAt(h+1)]>>4,a[u++]=255&e);1===s&&(e=r[t.charCodeAt(h)]<<10|r[t.charCodeAt(h+1)]<<4|r[t.charCodeAt(h+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,o=[],s=0,a=n-r;s<a;s+=16383)o.push(c(t,s,s+16383>a?a:s+16383));1===r?(e=t[n-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return o.join("")};for(var i=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)i[a]=s[a],r[s.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var r,o,s=[],a=e;a<n;a+=3)r=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(i[(o=r)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e,n){"use strict";var i=n(31),r=n(10),o=n(16),s=n(108),a=n(107),u=n(70),l=n(189),c=n(188),h=n(57),p=n(176),f=function(t,e,n){var i,s=r.getTypeOf(e),c=r.extend(n||{},a);c.date=c.date||new Date,null!==c.compression&&(c.compression=c.compression.toUpperCase()),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(t=m(t)),c.createFolders&&(i=d(t))&&y.call(this,i,!0);var f="string"===s&&!1===c.binary&&!1===c.base64;n&&void 0!==n.binary||(c.binary=!f),(e instanceof u&&0===e.uncompressedSize||c.dir||!e||0===e.length)&&(c.base64=!1,c.binary=!0,e="",c.compression="STORE",s="string");var _=null;_=e instanceof u||e instanceof o?e:h.isNode&&h.isStream(e)?new p(t,e):r.prepareContent(t,e,c.binary,c.optimizedBinaryString,c.base64);var v=new l(t,_,c);this.files[t]=v},d=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},y=function(t,e){return e=void 0!==e?e:a.createFolders,t=m(t),this.files[t]||f.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function _(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,n,i;for(e in this.files)this.files.hasOwnProperty(e)&&(i=this.files[e],(n=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(n,i))},filter:function(t){var e=[];return this.forEach(function(n,i){t(n,i)&&e.push(i)}),e},file:function(t,e,n){if(1===arguments.length){if(_(t)){var i=t;return this.filter(function(t,e){return!e.dir&&i.test(t)})}var r=this.files[this.root+t];return r&&!r.dir?r:null}return t=this.root+t,f.call(this,t,e,n),this},folder:function(t){if(!t)return this;if(_(t))return this.filter(function(e,n){return n.dir&&t.test(e)});var e=this.root+t,n=y.call(this,e),i=this.clone();return i.root=n.name,i},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var n=this.filter(function(e,n){return n.name.slice(0,t.length)===t}),i=0;i<n.length;i++)delete this.files[n[i].name];return this},generate:function(t){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,n={};try{if((n=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");r.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var a=n.comment||this.comment||"";e=c.generateWorker(this,n,a)}catch(t){(e=new o("error")).error(t)}return new s(e,n.type||"string",n.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};t.exports=v},function(t,e,n){"use strict";function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var t=new i;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}i.prototype=n(222),i.prototype.loadAsync=n(175),i.support=n(24),i.defaults=n(107),i.version="3.1.5",i.loadAsync=function(t,e){return(new i).loadAsync(t,e)},i.external=n(45),t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildZip=e.renderFrames=e.loadPCM=e.loadBuffer=e.spectrum=e.FRAME_STEP=e.FRAME_LENGTH=void 0;var i=l(n(6)),r=l(n(54)),o=l(n(223)),s=n(170),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(133)),u=(l(n(132)),l(n(131)));n(169);function l(t){return t&&t.__esModule?t:{default:t}}var c=e.FRAME_LENGTH=32130,h=e.FRAME_STEP=Math.round(c/4),p=8,f=8;e.spectrum=u.default;var d=e.loadBuffer=function(t){return new Promise(function(e,n){var i=URL.createObjectURL(t),o=new r.default.Buffer(i,function(){URL.revokeObjectURL(i),e(o)},function(t){console.error("err",t),n(t)})})},m=e.loadPCM=function(t){return new Promise(function(e,n){if(t.pcm)return e(t);d(t).then(function(i){var r=i._buffer.getChannelData(0),o=i._buffer.sampleRate;if(!r)return n();console.log(r.length,o),e({file:t,buffer:i,pcm:r,sr:o})})})};e.renderFrames=function(t,e){var n=e.frame_step,r=void 0===n?h:n,o=e.frame_start,s=void 0===o?0:o,a=e.max,u=void 0===a?12:a;return function(e){return new Promise(function(n,o){m(t).then(function(t){t.file,t.buffer;var o=t.pcm,a=t.sr;e({type:i.default.wav2pix.load});for(var l=[],h=0,p=o.length-c,f=Math.round(p*s);f<p&&h<u;f+=r,h+=1)l.push(y(o.slice(f,f+c),a,h));e({type:i.default.wav2pix.finish,message:"Rendered "+h+" images"}),n({pcm:t,frames:l})})})}},e.buildZip=function(t,e,n){var r=n.frame_step,s=void 0===r?h:r,a=n.frame_start,u=void 0===a?0:a,l=n.max,p=void 0===l?1e4:l;return function(n){return new Promise(function(r,a){m(e).then(function(e){e.buffer;var a=e.pcm,l=e.sr;n({type:i.default.wav2pix.load});var h=new o.default,f=h.folder("wav2pix_"+t),d=(a.length-c)/s;console.log(d);for(var m=0,_=a.length-c,v=Math.round(_*u);v<_&&m<p;v+=s,m+=1)m%10==0&&n({type:i.default.wav2pix.progress,progress:{i:m/p*6,n:6}}),y(a.slice(v,v+c),l,m,f);n({type:i.default.wav2pix.finish,message:"Rendered "+m+" images"}),h.generateAsync({type:"blob"}).then(function(e){n({type:i.default.wav2pix.zip,size:e.size}),r({zip:e,filename:"wav2pix_"+t+".zip",count:m})})})})}};function y(t,e,n,i){var r=u.default.toSpectrum(t,e),o=a.raw_spectrum(r,0,256,0,256,p,f),l=o.canvas,c=o.imageData;if(i){var h=(0,s.sprintf)("frame_%05d.png",n),d=l.toDataURL("image/png");i.file(h,d.split(",")[1],{base64:!0})}return{fft:r,canvas:l,imageData:c}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=_(n(29)),l=_(n(4)),c=y(n(77)),h=y(n(76)),p=n(11),f=y(n(62)),d=y(n(224)),m=y(n(134));_(n(60));function y(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function _(t){return t&&t.__esModule?t:{default:t}}var v=function(){return(0,u.default)().format("_YYYYMMDD_HHmm")},g=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.state={file:null,pcm:null,name:"",datasetName:"",frames:[],frame_start:0,max:1e3,preview_count:32,frame_step:d.FRAME_STEP};var i=document.createElement("audio");return i.addEventListener("loadedmetadata",function(){var t=i.duration,e=Math.floor((44100*t-d.FRAME_LENGTH)/n.state.frame_step);n.setState({duration:t,max:Math.min(n.state.max,e,1e3)})}),n.audioElement=i,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"pickFile",value:function(t){var e=this,n=t.name.split(".")[0].replace(/\s+/g,"_").replace(/-/g,"_").replace(/_+/g,"_");this.setState({file:t,name:n+v(),datasetName:n,pcm:""},function(){e.rebuildFrames()}),this.audioElement.src=URL.createObjectURL(t)}},{key:"rebuildFrames",value:function(){var t=this,e=this.state,n=e.file,r=e.pcm,o=e.frame_step,s=e.frame_start,a=e.preview_count;this.props.wav2pix.renderFrames(r||n,{frame_start:s,frame_step:o,max:a}).then(function(e){console.log("got frames",e.frames.length),t.setState(i({},t.state,{frames:e.frames,pcm:e.pcm}))})}},{key:"buildZip",value:function(){var t=this,e=this.state,n=e.pcm,i=e.file,r=e.max,o=e.frame_step,s=e.frame_start;this.props.wav2pix.buildZip(this.state.name,n||i,{frame_start:s,frame_step:o,max:r}).then(function(e){var n=e.zip,i=e.filename,s=e.count;t.props.datasetActions.uploadFile(t.props.module,t.props.folder,n,i,{count:s,max:r,frame_step:o,frame_size:d.FRAME_LENGTH/44100})})}},{key:"playFrame",value:function(t){var e=this;return function(){var n=e.state.frames[t];m.play(n)}}},{key:"render",value:function(){for(var t=this,e=this.state,n=e.file,i=(e.frames,[]),r=0,s=e.preview_count;r<s;r++)i.push((0,o.h)("canvas",{key:r,onClick:this.playFrame(r)}));return(0,o.h)("div",{className:"row"},(0,o.h)("div",{className:"col spectrogramBuilder"},(0,o.h)(p.Group,{title:"Spectrogram Builder"},(0,o.h)("p",null,"Convert your sounds into spectrograms. ","Sound files can be WAV, MP3, AIFF, or FLAC. "),(0,o.h)(p.FileUpload,{title:"Choose a sound file",accept:"audio/*",onUpload:function(e){return t.pickFile(e)}}),n&&this.renderMetadata(n))),(0,o.h)("div",{ref:function(e){t.canvases=e},className:"thumbs",id:"pix2wav_canvases"},i))}},{key:"renderMetadata",value:function(t){var e=this,n=this.state,i=n.duration,r=(n.preview_count,l.default.hush_size(t.size)),s=Math.floor((44100*i-d.FRAME_LENGTH)/this.state.frame_step),a=Math.round(d.FRAME_LENGTH/44100*1e3)+" ms.",c=Math.round(this.state.frame_step/44100*1e3)+" ms.";return(0,o.h)("div",{className:"fileMetadata"},(0,o.h)(p.Group,{title:"Metadata"},(0,o.h)(p.Param,{title:"Name"},t.name),(0,o.h)(p.Param,{title:"Type"},t.type),(0,o.h)(p.Param,{title:"Size"},(0,o.h)("span",{className:r[0]},r[1])),(0,o.h)(p.Param,{title:"Date"},(0,u.default)(t.lastModifiedDate).format("YYYY-MM-DD h:mm a")),(0,o.h)(p.Param,{title:"Duration"},Math.floor(i)+" s."),(0,o.h)("br",null),(0,o.h)(p.Param,{title:"Frames"},s),(0,o.h)(p.Param,{title:"Frame Size"},a),(0,o.h)(p.Param,{title:"Frame Step"},c),(0,o.h)(p.Param,{title:"FFT Size"},d.spectrum.fft_size),(0,o.h)("br",null),(0,o.h)(p.Param,{title:"Status"},this.props.pix2wav.status),(0,o.h)("br",null)),(0,o.h)(p.Group,{title:"Data settings"},(0,o.h)(p.TextInput,{title:"Dataset name",onChange:function(t){return e.setState({name:t.target.value})},value:this.state.name}),(0,o.h)(p.Slider,{name:"Starting Frame",min:0,max:1,type:"float",value:this.state.frame_start,defaultValue:0,onChange:function(t){e.setState({frame_start:t},function(){e.rebuildFrames()})}}),(0,o.h)(p.Slider,{name:"No. Frames",min:10,max:Math.min(s,1e3),type:"int",value:this.state.max,defaultValue:Math.min(s,300),onChange:function(t){return e.setState({max:t})}}),(0,o.h)(p.Slider,{name:"Frame step",min:10,max:2e4,type:"int",value:this.state.frame_step,defaultValue:d.FRAME_STEP,onChange:function(t){var n=Math.floor((44100*i-d.FRAME_LENGTH)/t);e.setState({name:e.state.datasetName+"_step_"+t+v(),frame_step:t,max:Math.min(e.state.max,n)},function(){e.rebuildFrames()})}}),(0,o.h)(p.Button,{onClick:function(){return e.buildZip()}},"Upload Frames")),(0,o.h)(p.Progress,null))}},{key:"componentDidUpdate",value:function(){var t=this;(this.state.frames||[]).map(function(e,n){var i=t.canvases.children[n],r=i.getContext("2d-lodpi");i.width=e.canvas.width,i.height=e.canvas.height,r.drawImage(e.canvas,0,0)})}}]),e}();e.default=(0,a.connect)(function(t){return{pix2wav:t.module.pix2wav,upload:t.upload}},function(t,e){return{datasetActions:(0,s.bindActionCreators)(f,t),actions:(0,s.bindActionCreators)(c,t),remote:(0,s.bindActionCreators)(h,t),wav2pix:(0,s.bindActionCreators)(d,t)}})(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(m(n(4)),d(n(77))),u=d(n(76)),l=m(n(17)),c=(m(n(35)),m(n(28)),m(n(34))),h=(n(21),m(n(225))),p=m(n(27)),f=m(n(60));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("pix2wav.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.pix2wav),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("pix2wav.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/pix2wav/new/"))}},{key:"render",value:function(){var t=this.props,e=t.pix2wav,n=(t.match,t.history),i=((e.data||{}).folderLookup||{})[e.folder_id]||{};return(0,r.h)("div",{className:"app pix2wav"},(0,r.h)("div",{class:"heading"},(0,r.h)("div",{class:"spaced"},(0,r.h)("h1",null,i?i.name:(0,r.h)(l.default,null)),(0,r.h)(c.default,null))),(0,r.h)(h.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:i}),(0,r.h)(p.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:i,history:n,onPickFile:function(t,e){e.preventDefault(),e.stopPropagation(),console.log("picked a file",t)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2wav,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,2)}},"2x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,4)}},"4x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,6)}},"6x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,18)}},"18x")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2wav:t.module.pix2wav}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.history;return(0,i.h)("div",{class:"app pix2wav"},(0,i.h)(r.default,{module:o.default,history:e}))};var i=n(1),r=s(n(28)),o=s(n(60));function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=h(n(7)),a=h(n(4)),u=h(n(227)),l=h(n(226)),c=h(n(167));function h(t){return t&&t.__esModule?t:{default:t}}var p=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("pix2wav"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #bdf, #def)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("pix2wav"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #bdf, #def)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/pix2wav/new/",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2wav/datasets/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2wav/datasets/:id/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2wav/live/",component:c.default}))}}]),t}();e.default={name:"pix2wav",router:p,links:function(){return[{url:"/pix2wav/new/",name:"new"},{url:"/pix2wav/datasets/",name:"datasets"},{url:"/pix2wav/live/",name:"live"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=n(11),l=n(40),c=m(n(19)),h=m(n(38)),p=m(n(32)),f=m(n(33)),d=n(82);(i=d)&&i.__esModule;function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.pix2pixhd.load_directories(),t.actions.live.get_params(),n.changeCheckpoint=n.changeCheckpoint.bind(n),n.changeEpoch=n.changeEpoch.bind(n),n.changeSequence=n.changeSequence.bind(n),n.seek=n.seek.bind(n),n.togglePlaying=n.togglePlaying.bind(n),n.toggleRecording=n.toggleRecording.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentWillMount",value:function(){document.addEventListener("keydown",this.handleKeydown)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeydown)}},{key:"componentWillUpdate",value:function(t){t.opt.checkpoint_name&&t.opt.checkpoint_name!==this.props.opt.checkpoint_name&&(console.log("listing epochs"),this.props.actions.live.list_epochs("pix2pixhd",t.opt.checkpoint_name))}},{key:"handleKeydown",value:function(t){if(console.log(t.keyCode),!(t.altKey||t.ctrlKey||t.metaKey))switch(t.keyCode){case 27:t.preventDefault(),this.props.actions.live.set_fullscreen(!this.props.fullscreen)}}},{key:"changeCheckpoint",value:function(t,e){this.props.actions.live.load_epoch(e,"latest")}},{key:"changeEpoch",value:function(t,e){this.props.actions.live.load_epoch(this.props.opt.checkpoint_name,e)}},{key:"changeSequence",value:function(t,e){console.log("load sequence",e),this.props.actions.live.load_sequence(e)}},{key:"seek",value:function(t){var e=Math.floor(t*(parseInt(this.props.frame.sequence_len)||1)+1);console.log("seek to frame",t,e),this.props.actions.live.seek(e)}},{key:"start",value:function(){console.log(this.props.opt);var t=this.props.opt.sequence_name||this.props.pix2pixhd.data.sequences[0].name,e=this.props.opt.checkpoint_name||this.props.pix2pixhd.data.checkpoints[0].name;console.log("starting up!",t,e),this.props.actions.tasks.live_task(t,e,{folder_id:this.props.pix2pixhd.data.resultsFolder.id})}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"togglePlaying",value:function(){this.props.opt.processing?this.props.actions.live.pause():this.props.actions.live.play()}},{key:"toggleRecording",value:function(){this.props.opt.recording?((0,l.stopRecording)(),this.props.actions.live.pause()):(0,l.startRecording)()}},{key:"render",value:function(){var t=this.props,e=t.pix2pixhd,n=t.i18n;if(e.loading)return(0,o.h)(u.Loading,{progress:e.progress});var i=e.data,r=i.folderLookup,s=i.datasetLookup,a=i.sequences.reduce(function(t,e){return t[e.name]=!0,t},{}),l=Object.keys(r).map(function(t){var e=r[t];if("results"!==e.name){var n=e.datasets.map(function(t){return a[t]?t:null}).filter(function(t){return!!t});return{name:e.name,options:n.sort()}}}).filter(function(t){return!!t&&!!t.options.length}).sort(function(t,e){return t.name.localeCompare(e.name)}),c=Object.keys(r).map(function(t){var e=r[t];if("results"!==e.name){var n=e.datasets.map(function(t){return s[t].checkpoints.length?t:null}).filter(function(t){return!!t});return{name:e.name,options:n.sort()}}}).filter(function(t){return!!t&&!!t.options.length}).sort(function(t,e){return t.name.localeCompare(e.name)});return(0,o.h)("div",{className:"app live centered"},(0,o.h)(u.Player,{width:424,height:256,fullscreen:this.props.fullscreen}),(0,o.h)("div",{className:"params row"},(0,o.h)("div",{className:"column"},(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.network.title,noToggle:!0},(0,o.h)(u.Select,{live:!0,name:"send_image",title:n.pix2pixhd.live.network.view_mode,options:["a","b","sequence","recursive"],onChange:this.props.actions.live.set_param}),(0,o.h)(u.SelectGroup,{live:!0,name:"sequence_name",title:n.pix2pixhd.live.network.sequence,options:l,onChange:this.changeSequence}),(0,o.h)(u.SelectGroup,{live:!0,name:"checkpoint_name",title:n.pix2pixhd.live.network.checkpoint,options:c,onChange:this.changeCheckpoint}),(0,o.h)(u.Select,{live:!0,name:"epoch",title:n.pix2pixhd.live.network.epoch,options:this.props.epochs,onChange:this.changeEpoch})),(0,o.h)("div",null,(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.playback.title,name:"sequence_playing"},(0,o.h)(u.Slider,{name:n.pix2pixhd.live.playback.position,min:0,max:1,type:"float",value:(this.props.frame.sequence_i||0)/(this.props.frame.sequence_len||1),onChange:this.seek}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.playback.playback_rate,name:"sequence_step",min:-4,max:4,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.playback.skip_frames,name:"sequence_skip",min:0,max:1e3,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.playback.fade_sequence,name:"fade_sequence",min:0,max:4,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.playback.frame_delay,name:"frame_delay",min:0,max:2,type:"float"}))),(0,o.h)(u.Group,null,this.renderRestartButton(),this.renderLiveButtons(),this.renderRecordButton(),(0,o.h)("p",{class:"last_message"},this.props.last_message))),(0,o.h)("div",{className:"column"},(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.transition.title,name:"transition"},(0,o.h)(u.Slider,{live:!0,name:"transition_period",title:n.pix2pixhd.live.transition.period,min:10,max:5e3,type:"int"}),(0,o.h)(u.Slider,{live:!0,name:"transition_min",title:n.pix2pixhd.live.transition.min,min:.001,max:.2,type:"float"}),(0,o.h)(u.Slider,{live:!0,name:"transition_max",title:n.pix2pixhd.live.transition.max,min:.1,max:1,type:"float"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.recursion.title,name:"recursive"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.recursion.frac,name:"recursive_frac",min:0,max:.5,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.recursion.roll,name:"recurse_roll",min:-64,max:64,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.recursion.axis,name:"recurse_roll_axis",min:0,max:1,type:"int"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.sequence.title,name:"sequence"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.sequence.frac,name:"sequence_frac",min:0,max:1,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.sequence.process_frac,name:"process_frac",min:0,max:1,type:"float"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.transform.title,name:"transform"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.transform.rotate,name:"rotate",min:-1,max:1,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.transform.scale,name:"scale",min:.9,max:1.1,type:"float"}))),(0,o.h)("div",{className:"column"},(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.clahe.title,name:"clahe"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.clahe.clip_limit,name:"clip_limit",min:1,max:4,type:"float"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.posterize.title,name:"posterize"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.posterize.spatial_window,name:"spatial_window",min:2,max:128,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.posterize.color_window,name:"color_window",min:2,max:128,type:"int"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.blur.title,name:"blur"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.blur.radius,name:"blur_radius",min:3,max:7,type:"odd"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.blur.sigma,name:"blur_sigma",min:0,max:2,type:"float"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.canny.title,name:"canny"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.canny.lo,name:"canny_lo",min:10,max:200,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.canny.hi,name:"canny_hi",min:10,max:200,type:"int"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.hsl.title,name:"hsl"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.hsl.hue,name:"hue",min:-127,max:127,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.hsl.saturation,name:"saturation",min:-255,max:255,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.hsl.luminosity,name:"luminosity",min:-255,max:255,type:"int"})))))}},{key:"renderRestartButton",value:function(){var t=this,e=this.props.i18n;return"IDLE"===this.props.runner.gpu.status?(0,o.h)(u.Button,{title:e.gpu.idle,onClick:function(){return t.start()}},e.gpu.start):"pix2pixhd"!==this.props.runner.gpu.task.module?(0,o.h)(u.Button,{title:e.gpu.busy,onClick:function(){return t.interrupt()}},e.gpu.interrupt):this.props.opt.processing?(0,o.h)("div",null,(0,o.h)(u.Button,{title:e.gpu.processing,onClick:this.togglePlaying},e.gpu.stop),(0,o.h)(u.Button,{title:e.gpu.busy,onClick:function(){return t.interrupt()}},e.gpu.interrupt)):(0,o.h)("div",null,(0,o.h)(u.Button,{title:e.gpu.not_processing,onClick:this.togglePlaying},e.gpu.restart),(0,o.h)(u.Button,{title:e.gpu.busy,onClick:function(){return t.interrupt()}},e.gpu.interrupt))}},{key:"renderRecordButton",value:function(){return null}},{key:"renderLiveButtons",value:function(){var t=this,e=this.props.i18n;return(0,o.h)("div",null,(0,o.h)(u.Button,{title:e.pix2pixhd.live.record.save_frame,onClick:l.saveFrame},e.pix2pixhd.live.record.save),(0,o.h)(u.ParamGroup,{title:e.pix2pixhd.live.record.record_video,name:"store_b",noDim:!0,onToggle:function(t){}},(0,o.h)(u.TextInput,{title:e.pix2pixhd.live.record.video_name,name:"final_tag",value:this.props.opt.final_tag,onSave:function(e){t.props.actions.live.set_param("final_tag",e)}})))}}]),e}();e.default=(0,a.connect)(function(t){return{last_message:t.live.last_message,fullscreen:t.live.fullscreen,opt:t.live.opt,frame:t.live.frame,checkpoints:t.live.checkpoints,epochs:t.live.epochs,sequences:t.live.sequences,runner:t.system.runner,i18n:t.system.i18n.strings,pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:{live:(0,s.bindActionCreators)(c,t),queue:(0,s.bindActionCreators)(h,t),pix2pixhd:(0,s.bindActionCreators)(f,t),tasks:(0,s.bindActionCreators)(p,t)}}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=(n(8),p(n(29))),l=p(n(4)),c=n(11),h=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(32));p(n(7));function p(t){return t&&t.__esModule?t:{default:t}}var f={dir:"/",cursor:null,selection:null,title:null},d=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state=i({},f),t.handleCursor=t.handleCursor.bind(t),t.handleSelect=t.handleSelect.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){this.props.checkpoint&&this.reset()}},{key:"componentDidUpdate",value:function(t){this.props.checkpoint!==t.checkpoint&&this.reset()}},{key:"reset",value:function(){var t=this.props.checkpoint;t&&t.sequence&&this.setState(i({},f,{title:t.name+"_"+(0,u.default)().format("YYYYMMDD")}))}},{key:"handleCursor",value:function(t){this.setState({cursor:t})}},{key:"handleSelect",value:function(t){this.setState({selection:t})}},{key:"render",value:function(){var t=this,e=this.props,n=(e.app,e.pix2pixhd,e.remote),i=e.checkpoint,r=e.folder_id,s=(e.processed,this.state),a=s.cursor,u=s.selection,h=s.title,p="sequences/"+i.name;return(0,o.h)("div",{className:"sequenceEditor row"},u?(0,o.h)("div",{className:"form"},(0,o.h)(c.Param,{title:"Selection length"},u.end.i-u.start.i," frames"),(0,o.h)(c.Param,{title:"Duration"},l.default.frameTimestamp(u.end.i-u.start.i)),(0,o.h)(c.Group,{title:"New dataset"},(0,o.h)(c.TextInput,{title:"Title dataset",value:h,onInput:function(e){return t.setState({title:e.replace(/ /g,"_").replace(/\/\./g,"").toLowerCase()})}}),(0,o.h)(c.Button,{title:"Create a new dataset?",onClick:function(){return n.splice_task({title:h,sequence:i.name,selection:u,folder_id:r})}},"Create"))):(0,o.h)("div",{className:"form"},(0,o.h)(c.Group,{title:"New dataset"},"Please select some frames")),(0,o.h)("div",{className:"rows"},(0,o.h)("div",{className:"row"},(0,o.h)(m,{label:"Cursor",path:p,frame:a}),u&&u.start&&(0,o.h)(m,{label:"Selection Start",path:p,frame:u.start}),u&&u.end&&(0,o.h)(m,{label:"Selection End",path:p,frame:u.end})),(0,o.h)(c.Timeline,{sequence:i.sequence,onCursor:this.handleCursor,onSelect:this.handleSelect})))}}]),e}();function m(t){var e=t.label,n=t.path,i=t.frame;return i?(0,o.h)("div",{class:"frame"},(0,o.h)(c.FileViewer,{thumbnail:140,path:n,file:i.frame}),(0,o.h)("div",{class:"spaced"},(0,o.h)("span",null,e),(0,o.h)("span",null,"#",i.i," ",l.default.frameTimestamp(i.i)))):(0,o.h)("div",{class:"frame"})}e.default=(0,a.connect)(function(t){return{app:t.system.app,pix2pixhd:t.module.pix2pixhd}},function(t,e){return{remote:(0,s.bindActionCreators)(h,t)}})(d)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=(d(n(4)),f(n(33))),l=f(n(32)),c=n(11),h=(d(n(35)),d(n(28)),d(n(34)),d(n(27)),d(n(230))),p=d(n(48));function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={dataset:"PLACEHOLDER",epoch:"latest",augment_name:"",augment_take:100,augment_make:20,processed:!1},n.handleChange=n.handleChange.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("pix2pixhd.last_id"),e=localStorage.getItem("pix2pixhd.last_dataset");console.log("load dataset:",t,e);var n=this.props,i=(n.match,n.pix2pixhd),r=n.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("pix2pixhd.last_id",t),i.folder&&i.folder.id===t||r.load_directories(t)):this.props.history.push("/pix2pixhd/new/"),e&&this.setState({dataset:e}))}},{key:"componentDidUpdate",value:function(t,e){var n=this;if(!t.pix2pixhd.data&&this.props.pix2pixhd.data||t.pix2pixhd.data&&e.dataset!==this.state.dataset){var i=this.props.pix2pixhd.data.datasetLookup[this.state.dataset];if(i){var r=i.input.map(function(t){return n.props.pix2pixhd.data.fileLookup[t]}).reduce(function(t,e){return console.log(e),e.processed||t},!1);console.log(i.input,r),i.processed=r,this.setState({processed:r})}}e.dataset!==this.state.dataset&&(localStorage.setItem("pix2pixhd.last_dataset",this.state.dataset),this.setState({epoch:"latest"}),this.props.actions.list_epochs(this.state.dataset),this.props.actions.count_dataset(this.state.dataset))}},{key:"handleChange",value:function(t,e){console.log("name",t,"value",e),this.setState(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},t,e))}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"render",value:function(){var t=this;if(this.props.pix2pixhd.loading)return(0,o.h)(c.Loading,{progress:this.props.pix2pixhd.progress});var e=this.props,n=e.pix2pixhd,i=(e.match,e.history,n.data||{}),r=i.folderLookup,s=i.datasetLookup,a=((r||{})[n.folder_id],n.checkpoint),u=Object.keys(r).map(function(e){var n=t.props.pix2pixhd.data.folderLookup[e];if("results"!==n.name){var i=n.datasets.map(function(t){return s[t].isBuilt?t:null}).filter(function(t){return!!t});return{name:n.name,options:i.sort()}}}).filter(function(t){return!!t&&!!t.options.length}).sort(function(t,e){return t.name.localeCompare(e.name)}),l=this.props.pix2pixhd.epochs;return l&&l.length||(l=["latest"]),(0,o.h)("div",{className:"app pix2pixhd"},(0,o.h)("div",{className:"heading"},(0,o.h)("h1",null,"pix2pixhd training")),(0,o.h)("div",{className:"columns"},(0,o.h)("div",{className:"column"},(0,o.h)(c.Group,{title:"Sequence"},(0,o.h)(c.SelectGroup,{name:"dataset",title:"Sequence name",options:u,onChange:this.handleChange,placeholder:"Pick a dataset",value:this.state.dataset}),(0,o.h)(c.Select,{title:"Epoch",name:"epoch",options:l,onChange:this.handleChange,value:this.state.epoch})))),a&&a.sequence&&a.sequence.length?this.renderEditor():a&&(0,o.h)("div",null,"Sequence empty, augmentation impossible"))}},{key:"renderEditor",value:function(){var t=this,e=this.props,n=e.pix2pixhd,r=e.queue,s=e.remote,a=this.state,u=a.dataset,l=a.processed,f=n.checkpoint,d=n.folder_id,m=this.props.pix2pixhd.data.datasetLookup[this.state.dataset];return m&&m.folder_id&&(d=m.folder_id||d,console.log("dataset folder id",d)),console.log(m),console.log("so folder id is..",d),(0,o.h)("div",null,(0,o.h)(c.Group,{title:"Sequence Editor"},(0,o.h)(h.default,{folder_id:d,module:p.default,checkpoint:f,processed:l})),(0,o.h)("div",{className:"columns"},(0,o.h)("div",{className:"column"},(0,o.h)(c.Group,{title:"Augmentation Grid"},(0,o.h)(c.AugmentationGrid,{checkpoint:f,take:[1,2,3,4,5,10,15,20,25,50,75,100,200,300,400,500,1e3],make:[1,2,3,4,5,10,15,20,25,50,75,100,200],onAugment:function(e,n){s.augment_task(u,i({},t.state,{augment_take:e,augment_make:n}))},onTrain:function(){s.train_task(u,d,1),setTimeout(function(){s.augment_task(u,i({},t.state,{augment_take:10,augment_make:149,no_symlinks:!0,mov:!0,folder_id:n.data.resultsFolder.id}))},250)}})),(0,o.h)(c.Group,{title:"Augment"},(0,o.h)(c.NumberInput,{name:"augment_take",title:"Pick N random frames",value:this.state.augment_take,onChange:this.handleChange,type:"int",min:"1",max:"1000"}),(0,o.h)(c.NumberInput,{name:"augment_make",title:"Generate N recursively",value:this.state.augment_make,onChange:this.handleChange,type:"int",min:"1",max:"1000"}),(0,o.h)(c.Button,{title:"Augment dataset",value:"Augment",onClick:function(){return t.props.remote.augment_task(u,t.state)}}),(0,o.h)(c.Button,{title:"Make a movie without augmenting",value:"Generate",onClick:function(){t.props.remote.augment_task(u,i({},t.state,{no_symlinks:!0,mov:!0,folder_id:n.data.resultsFolder.id}))}})),(0,o.h)(c.Group,{title:"Status"},(0,o.h)(c.Button,{title:"GPU",value:"IDLE"===this.props.runner.gpu.status?"Idle":"Interrupt",onClick:function(){return t.interrupt()}}),(0,o.h)(c.CurrentTask,null))),(0,o.h)("div",{className:"column"},(0,o.h)(c.Group,{title:"Upcoming Tasks"},(0,o.h)(c.TaskList,{tasks:r.queue.map(function(t){return r.tasks[t]}),sort:"date asc"})))))}}]),e}();e.default=(0,a.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd,runner:t.system.runner,queue:t.queue}},function(t,e){return{actions:(0,s.bindActionCreators)(u,t),remote:(0,s.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=(n(8),n(2)),u=(d(n(4)),d(n(7))),l=f(n(33)),c=f(n(32)),h=d(n(17)),p=n(21);function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var m=0,y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.pix2pixhd.uprez||t.actions.load_uprez(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){m=0}},{key:"render",value:function(){var t=this;if(!this.props.pix2pixhd.uprez)return(0,o.h)(h.default,{progress:this.props.pix2pixhd.progress});var e=this.props.pix2pixhd.uprez,n=(e.resultsFolder,e.results),i=(e.renders,e.files);return(0,o.h)("div",{className:"app pix2pixhd"},(0,o.h)("div",{className:"heading row middle"},(0,o.h)("h1",null,"Pix2PixHD Uprez")),(0,o.h)("div",{class:"rows params renders"},(0,o.h)("h3",null,"folders on server"),(0,o.h)(p.FileList,{files:n,orderBy:"date desc",fields:"name date count",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)},options:function(e){return console.log(e),(0,o.h)("div",null," ~ ",(0,o.h)("a",{href:"#",onClick:function(){return t.handleUprez(e,{end:250})}},"Uprez 10 seconds")," ~ ",(0,o.h)("a",{href:"#",onClick:function(){return t.handleUprez(e,{end:1500})}},"Uprez 1 minute")," ~ ",(0,o.h)("a",{href:"#",onClick:function(){return t.handleUprez(e)}},"Uprez whole thing"))}}),(0,o.h)("br",null),(0,o.h)("h3",null,"uprezzed videos"),(0,o.h)(p.FileList,{linkFiles:!0,files:i,orderBy:"date desc",fields:"name date size delete",onDelete:function(t){(!(m<3)||confirm("Are you sure you want to delete this file?"))&&(m+=1,console.log("delete: confirmed"),u.default.file.destroy(t))}})))}},{key:"handlePick",value:function(t){}},{key:"handleUprez",value:function(t,e){console.log(t),this.props.remote.uprez_task(i({is_result:!0,dataset:t.name,folder_id:1},e))}}]),e}();e.default=(0,a.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,s.bindActionCreators)(l,t),remote:(0,s.bindActionCreators)(c,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=(n(8),n(2)),a=(f(n(4)),f(n(7))),u=p(n(33)),l=p(n(32)),c=f(n(17)),h=n(21);function p(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function f(t){return t&&t.__esModule?t:{default:t}}var d=0,m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.pix2pixhd.results||t.actions.load_results(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentDidMount",value:function(){d=0}},{key:"render",value:function(){var t=this;if(!this.props.pix2pixhd.results)return(0,r.h)(c.default,{progress:this.props.pix2pixhd.progress});var e=this.props.pix2pixhd.results,n=(e.resultsFolder,e.results),i=e.renders,o=e.files;return(0,r.h)("div",{className:"app pix2pixhd"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"Pix2PixHD Results")),(0,r.h)("div",{class:"rows params renders"},(0,r.h)(h.FileList,{linkFiles:!0,files:o,orderBy:"date desc",fields:"name date size delete",onDelete:function(t){(!(d<3)||confirm("Are you sure you want to delete this file?"))&&(d+=1,console.log("delete: confirmed"),a.default.file.destroy(t))}}),(0,r.h)("br",null),(0,r.h)("h3",null,"renders on server"),(0,r.h)(h.FileList,{files:i,orderBy:"date desc",fields:"name date size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)}}),(0,r.h)("br",null),(0,r.h)("h3",null,"folders on server"),(0,r.h)(h.FileList,{files:n,orderBy:"date desc",fields:"name date count",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)}})))}},{key:"handlePick",value:function(t){}}]),e}();e.default=(0,s.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(m(n(4)),d(n(33))),u=d(n(32)),l=n(11),c=m(n(35)),h=(m(n(28)),m(n(34))),p=m(n(27)),f=m(n(48));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("pix2pixhd.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.pix2pixhd),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("pix2pixhd.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/pix2pixhd/new/"))}},{key:"render",value:function(){var t=this.props,e=t.pix2pixhd,n=(t.match,t.history),i=((e.data||{}).folderLookup||{})[e.folder_id]||{};return(0,r.h)("div",{className:"app pix2pixhd"},(0,r.h)("div",{class:"heading"},(0,r.h)("div",{class:"spaced"},(0,r.h)("h1",null,i?i.name:(0,r.h)(l.Loading,null)),(0,r.h)(h.default,null))),(0,r.h)("div",{className:"row"},i&&i.name&&"unsorted"!==i.name&&(0,r.h)(c.default,{title:"Add Files",module:f.default,folder:i,canUpload:!0,canAddURL:!0}),(0,r.h)("div",null,(0,r.h)(h.default,null),(0,r.h)(l.CurrentTask,null))),(0,r.h)(p.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:i,history:n,onPickFile:function(t,e){e.preventDefault(),e.stopPropagation(),console.log("picked a file",t)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2pixhd,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,5)}},"5x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,10)}},"10x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,20)}},"20x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,50)}},"50x")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(33)),u=l(n(48));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.pix2pixhd,path:"/pix2pixhd/sequences/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=d(n(7)),a=d(n(4)),u=d(n(235)),l=d(n(234)),c=d(n(233)),h=d(n(232)),p=d(n(231)),f=d(n(229));function d(t){return t&&t.__esModule?t:{default:t}}var m=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("pix2pixhd"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #def, #dfe)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("pix2pixhd"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #def, #dfe)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/new/",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/sequences/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/sequences/:id/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/train/",component:p.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/results/",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/uprez/",component:h.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/live/",component:f.default}))}}]),t}();e.default={name:"pix2pixhd",router:m,links:function(){return[{url:"/pix2pixhd/new/",name:"folders"},{url:"/pix2pixhd/sequences/",name:"sequences"},{url:"/pix2pixhd/train/",name:"checkpoints"},{url:"/pix2pixhd/results/",name:"results"},{url:"/pix2pixhd/uprez/",name:"uprez"},{url:"/pix2pixhd/live/",name:"live"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),a=n(2),u=n(11),l=n(40),c=d(n(19)),h=d(n(38)),p=d(n(121)),f=d(n(79));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.pix2pix.load_directories(),t.actions.live.get_params(),n.changeCheckpoint=n.changeCheckpoint.bind(n),n.changeEpoch=n.changeEpoch.bind(n),n.changeSequence=n.changeSequence.bind(n),n.seek=n.seek.bind(n),n.togglePlaying=n.togglePlaying.bind(n),n.toggleRecording=n.toggleRecording.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillUpdate",value:function(t){t.opt.checkpoint_name&&t.opt.checkpoint_name!==this.props.opt.checkpoint_name&&this.props.actions.live.list_epochs("pix2pix",t.opt.checkpoint_name)}},{key:"changeCheckpoint",value:function(t,e){this.props.actions.live.load_epoch(e,"latest")}},{key:"changeEpoch",value:function(t,e){this.props.actions.live.load_epoch(this.props.opt.checkpoint_name,e)}},{key:"changeSequence",value:function(t,e){console.log("load sequence",e),this.props.actions.live.load_sequence(e)}},{key:"seek",value:function(t){var e=Math.floor(t*(parseInt(this.props.frame.sequence_len)||1)+1);console.log("seek to frame",t,e),this.props.actions.live.seek(e)}},{key:"start",value:function(){var t=this.props.pix2pix.data.sequences[0].name,e=this.props.pix2pix.data.checkpoints[0].name;console.log("starting up!",t,e),this.props.actions.tasks.live_task(t,e)}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"togglePlaying",value:function(){this.props.opt.processing?this.props.actions.live.pause():this.props.actions.live.play()}},{key:"toggleRecording",value:function(){this.props.opt.recording?((0,l.stopRecording)(),this.props.actions.live.pause()):(0,l.startRecording)()}},{key:"render",value:function(){return this.props.pix2pix.loading?(0,r.h)(u.Loading,null):(0,r.h)("div",{className:"app centered"},(0,r.h)(u.Player,{width:424,height:256}),(0,r.h)("div",{className:"params row"},(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Playback",noToggle:!0},(0,r.h)(u.Select,{name:"send_image",title:"view mode",options:["a","b","sequence","recursive"],onChange:this.props.actions.live.set_param}),(0,r.h)(u.Select,{name:"sequence_name",title:"sequence",options:this.props.pix2pix.data.sequences.map(function(t){return t.name}),onChange:this.changeSequence}),(0,r.h)(u.Select,{name:"checkpoint_name",title:"checkpoint",options:this.props.pix2pix.data.checkpoints.map(function(t){return t.name}),onChange:this.changeCheckpoint}),(0,r.h)(u.Select,{name:"epoch",title:"epoch",options:this.props.epochs,onChange:this.changeEpoch}),(0,r.h)(u.Slider,{name:"position",min:0,max:1,type:"float",value:(this.props.frame.sequence_i||0)/(this.props.frame.sequence_len||1),onChange:this.seek}),(0,r.h)(u.Slider,{live:!0,name:"frame_delay",min:.05,max:2,type:"float"}),this.renderRestartButton(),(0,r.h)(u.Button,{title:this.props.opt.savingVideo?"Saving video...":this.props.opt.recording?"Recording ("+(t=this.props.opt.recordFrames/25,t.toFixed(1)+" s.")+")":"Record video",onClick:this.toggleRecording},this.props.opt.savingVideo?"Saving":this.props.opt.recording?"Recording":"Record"),(0,r.h)(u.Button,{title:"Save frame",onClick:l.saveFrame},"Save"),(0,r.h)(u.ParamGroup,{title:"Render on server",name:"store_b",onToggle:function(t){}}),(0,r.h)("p",{className:"last_message"},this.props.last_message))),(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Transition",name:"transition"},(0,r.h)(u.Slider,{live:!0,name:"transition_period",min:10,max:5e3,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"transition_min",min:.001,max:.2,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"transition_max",min:.1,max:1,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Recursion",name:"recursive"},(0,r.h)(u.Slider,{live:!0,name:"recursive_frac",min:0,max:.5,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"recurse_roll",min:-64,max:64,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"recurse_roll_axis",min:0,max:1,type:"int"})),(0,r.h)(u.ParamGroup,{title:"Sequence",name:"sequence"},(0,r.h)(u.Slider,{live:!0,name:"sequence_frac",min:0,max:.5,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"process_frac",min:0,max:1,type:"float"}))),(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Clahe",name:"clahe"},(0,r.h)(u.Slider,{live:!0,name:"clip_limit",min:1,max:4,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Posterize",name:"posterize"},(0,r.h)(u.Slider,{live:!0,name:"spatial_window",min:2,max:128,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"color_window",min:2,max:128,type:"int"})),(0,r.h)(u.ParamGroup,{title:"Blur",name:"blur"},(0,r.h)(u.Slider,{live:!0,name:"blur_radius",min:3,max:7,type:"odd"}),(0,r.h)(u.Slider,{live:!0,name:"blur_sigma",min:0,max:2,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Canny Edge Detection",name:"canny"},(0,r.h)(u.Slider,{live:!0,name:"canny_lo",min:10,max:200,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"canny_hi",min:10,max:200,type:"int"})))));var t}},{key:"renderRestartButton",value:function(){var t=this;return"IDLE"===this.props.runner.gpu.status?(0,r.h)(u.Button,{title:"GPU Idle",onClick:function(){return t.start()}},"Start"):"pix2pix"!==this.props.runner.gpu.task.module?(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"):this.props.opt.processing?(0,r.h)("div",null,(0,r.h)(u.Button,{title:"Processing",onClick:this.togglePlaying},"Stop"),(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt")):(0,r.h)("div",null,(0,r.h)(u.Button,{title:"Not processing",onClick:this.togglePlaying},"Restart"),(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"))}}]),e}();e.default=(0,a.connect)(function(t){return{last_message:t.live.last_message,opt:t.live.opt,frame:t.live.frame,checkpoints:t.live.checkpoints,epochs:t.live.epochs,sequences:t.live.sequences,runner:t.system.runner,pix2pix:t.module.pix2pix}},function(t,e){return{actions:{live:(0,o.bindActionCreators)(c,t),queue:(0,o.bindActionCreators)(h,t),pix2pix:(0,o.bindActionCreators)(f,t),tasks:(0,o.bindActionCreators)(p,t),s:s}}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(m(n(4)),d(n(79))),u=d(n(121)),l=n(11),c=m(n(35)),h=(m(n(28)),m(n(34))),p=m(n(27)),f=m(n(78));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("pix2pix.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.pix2pix),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("pix2pix.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/pix2pix/new/"))}},{key:"render",value:function(){var t=this.props,e=t.pix2pix,n=(t.match,t.history),i=((e.data||{}).folderLookup||{})[e.folder_id]||{};return(0,r.h)("div",{className:"app pix2pix"},(0,r.h)("div",{className:"heading"},(0,r.h)("div",{className:"spaced"},(0,r.h)("h1",null,i?i.name:(0,r.h)(l.Loading,null)),(0,r.h)(h.default,null))),(0,r.h)("div",{className:"row"},i&&i.name&&"unsorted"!==i.name&&(0,r.h)(c.default,{title:"Add Files",module:f.default,folder:i,canUpload:!0,canAddURL:!0}),(0,r.h)("div",null,(0,r.h)(h.default,null),(0,r.h)(l.CurrentTask,null))),(0,r.h)(p.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:i,history:n,onPickFile:function(t,e){e.preventDefault(),e.stopPropagation(),console.log("picked a file",t)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2pix,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(console.log(t),(0,r.h)("div",null,(0,r.h)("div",{className:"actions"},(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,5)}},"5x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,10)}},"10x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,20)}},"20x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,50)}},"50x")),t.isBuilt?(0,r.h)("div",{className:"subtext"},"fetched ",(0,r.h)("span",{className:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{className:"subtext"},"fetching"):(0,r.h)("div",{className:"subtext"},(0,r.h)("span",{className:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch")))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2pix:t.module.pix2pix}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(79)),u=l(n(78));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{pix2pix:t.module.pix2pix}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.pix2pix,path:"/pix2pix/sequences/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=h(n(7)),a=h(n(4)),u=h(n(239)),l=h(n(238)),c=h(n(237));function h(t){return t&&t.__esModule?t:{default:t}}var p=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("pix2pix"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #fde, #ffe)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("pix2pix"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #fde, #ffe)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/pix2pix/new/",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pix/sequences/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pix/sequences/:id/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pix/live/",component:c.default}))}}]),t}();e.default={name:"pix2pix",router:p,links:function(){return[{url:"/pix2pix/new/",name:"new"},{url:"/pix2pix/sequences/",name:"sequences"},{url:"/pix2pix/live/",name:"live"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.morph_task=void 0;o(n(15)),o(n(14)),o(n(6));var i=o(n(7)),r=o(n(122));function o(t){return t&&t.__esModule?t:{default:t}}e.morph_task=function(t,e){return function(n){if("PLACEHOLDER"!==t.a&&"PLACEHOLDER"!==t.b){var o={module:r.default.name,activity:"morph",dataset:t.a,folder_id:e.id,opt:t};return i.default.queue.add_task(o)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load_data=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=(l(n(15)),l(n(14)),l(n(6))),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(36)),s=l(n(7)),a=l(n(4)),u=l(n(122));function l(t){return t&&t.__esModule?t:{default:t}}e.load_data=function(t){return function(t){var e=u.default.name;a.default.allProgress([o.load(e),s.default.socket.list_sequences({module:"pix2pixhd",dir:"sequences"}),s.default.socket.list_directory({module:e,dir:"renders"})],function(e,n,i){console.log("morph load progress",n,i),t({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"morph"}})}).then(function(e){var n=i(e,3),o=n[0],s=n[1],a=n[2],u=(o.folderLookup,o.fileLookup,o.datasetLookup,o.folders,o.files),l=(o.unsortedFolder,o.resultsFolder);t({type:r.default.morph.load,data:o,app:{resultsFolder:l,files:u,sequences:s,renders:a}})})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=(n(8),n(2)),a=(f(n(4)),f(n(7))),u=p(n(242)),l=p(n(241)),c=f(n(17)),h=n(11);function p(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function f(t){return t&&t.__esModule?t:{default:t}}var d=0,m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.state={dataset_module:"pix2pixhd",a:"PLACEHOLDER",b:"PLACEHOLDER",a_offset:0,a_duration:1,a_pos:0,b_offset:0,b_duration:1,b_pos:0,steps:16,dilate:2,frames:32,padding:3,smooth:!0,mode:"mix"},t.morph.data||t.actions.load_data(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentDidMount",value:function(){d=0}},{key:"render",value:function(){var t=this;if(!this.props.morph.app)return(0,r.h)(c.default,{progress:this.props.morph.progress});var e=this.props.morph.app,n=e.resultsFolder,i=e.sequences,o=e.renders,s=e.files,u=i.map(function(t){return[t.name.split("_").slice(0,3).join(" ")+"~ ("+t.count+")",t.name]}),l=i.reduce(function(t,e){return t[e.name]=e,t},{}),p=this.state.frames/25,f=void 0;return this.state.steps/this.state.dilate>64&&"mix"===this.state.mode&&(f=(0,r.h)("span",null,(0,r.h)("br",null),"warning, this will take a while")),(0,r.h)("div",{className:"app morph"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"Morph")),(0,r.h)("div",{className:"rows params renders"},(0,r.h)("div",{className:"column"},(0,r.h)(h.Group,{title:"From"},(0,r.h)(h.Select,{title:"Starting sequence",placeholder:"Please choose a video",value:this.state.a,options:u,onChange:function(e,n){return t.setState({a:n,a_duration:l[n].count,a_pos:0,a_offset:0})}}),(0,r.h)(h.Slider,{title:"Offset",value:this.state.a_pos,min:0,max:1,step:.01,onChange:function(e){return t.setState({a_pos:e,a_offset:Math.floor(e*(t.state.a_duration-t.state.frames))})}})),(0,r.h)(h.Group,{title:"To"},(0,r.h)(h.Select,{title:"Ending sequence",placeholder:"Please choose a video",value:this.state.b,options:u,onChange:function(e,n){return t.setState({b:n,b_duration:l[n].count,b_pos:0,b_offset:0})}}),(0,r.h)(h.Slider,{title:"Offset",value:this.state.b_pos,min:0,max:1,step:.01,onChange:function(e){return t.setState({b_pos:e,b_offset:Math.floor(e*(t.state.b_duration-t.state.frames))})}})),(0,r.h)(h.Group,{title:"Morph Settings"},(0,r.h)(h.Select,{title:"Mode",value:this.state.mode,options:["mix","average","mix_images"],onChange:function(e,n){return t.setState({mode:n})}}),(0,r.h)(h.Slider,{type:"list",title:"Steps",value:this.state.steps,options:[2,4,8,16,32,64,128,256,512,1024,2048,4096],onChange:function(e){return t.setState({steps:e,frames:e*t.state.dilate})}}),(0,r.h)(h.Slider,{type:"list",title:"Dilate",value:this.state.dilate,options:[1,2,4,8,16,32],onChange:function(e){return t.setState({dilate:e,frames:t.state.steps*e})}}),(0,r.h)(h.Checkbox,{title:"Smooth",value:this.state.smooth,onToggle:function(e){return t.setState({smooth:e})}}),(0,r.h)(h.Slider,{type:"int",title:"Padding (in seconds)",value:this.state.padding,min:0,max:30,step:1,onChange:function(e){return t.setState({padding:e})}}),(0,r.h)(h.Button,{title:"Run task",value:"Morph!",onClick:function(){return t.props.remote.morph_task(t.state,n)}}),(0,r.h)("br",null),(0,r.h)(h.Param,{title:"Total length"},p.toFixed(1)+" seconds"),(0,r.h)(h.Param,{title:"Total frames"},this.state.frames+" frames"),f,(0,r.h)("br",null),(0,r.h)(h.CurrentTask,null))),(0,r.h)("h3",null,"morphed videos"),(0,r.h)(h.FileList,{linkFiles:!0,files:s,orderBy:"date desc",fields:"name datetime size delete",onDelete:function(t){(!(d<3)||confirm("Are you sure you want to delete this file?"))&&(d+=1,console.log("delete: confirmed"),a.default.file.destroy(t))}}),(0,r.h)("br",null),(0,r.h)("h3",null,"renders on server"),(0,r.h)(h.FileList,{files:o,orderBy:"date desc",fields:"name datetime time size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)}})))}},{key:"handlePick",value:function(t){}}]),e}();e.default=(0,s.connect)(function(t){return{morph:t.module.morph}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=l(n(7)),a=l(n(4)),u=l(n(243));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("morph"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #def, #dfe)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("morph"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #def, #dfe)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/morph/app/",component:u.default}))}}]),t}();e.default={name:"morph",router:c,links:function(){return[{url:"/morph/app/",name:"morph"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=n(11),l=n(7),c=(i=l)&&i.__esModule?i:{default:i},h=d(n(50)),p=d(n(37)),f=n(136);function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var y=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=i=m(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={file_id:0},m(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){this.props.biggan.encodings||this.props.actions.biggan.load_encodings()}},{key:"render",value:function(){var t=this,e=this.state.file_id,n=this.props,i=n.opt,r=n.frame,s=this.props.biggan.encodings;return s?(0,o.h)("div",null,(0,o.h)("div",{className:"spacer"},r.i?(0,o.h)("div",{className:"param frame_counter"},(0,o.h)("span",null,"Frame #",r.i),(0,o.h)("var",null,(0,f.frameTimestamp)(r.i))):(0,o.h)("div",{className:"param frame_counter"},(0,o.h)("span",null))),(0,o.h)(u.Group,{title:"Stored Image"},(0,o.h)(u.Slider,{live:!0,name:"encoding_stored_speed",title:"Load speed",min:1,max:250,type:"int"}),(0,o.h)(u.Slider,{live:!0,name:"encoding_stored_n",title:"Image mix",min:0,max:1,type:"float"})),(0,o.h)(u.Group,{title:"Latent to Image Transition"},(0,o.h)(u.Button,{title:"Toggle",onClick:function(){return e&&c.default.live.send_command("switch","encoding_stored_mix")}},e?i.encoding_stored_mix_n<.5?"To Image":"Back to Latent":"Not loaded"),(0,o.h)(u.Slider,{live:!0,name:"encoding_stored_mix_speed",title:"Transition speed",min:1,max:250,type:"int"}),(0,o.h)(u.Slider,{live:!0,name:"encoding_stored_mix_n",title:"Transition mix",min:0,max:1,type:"float"})),(0,o.h)(u.Group,{title:"Encoding Orbit"},(0,o.h)(u.Slider,{live:!0,name:"encoding_orbit_speed",title:"Orbit speed",min:-250,max:250,type:"int"}),(0,o.h)(u.Slider,{live:!0,name:"encoding_orbit_radius",title:"Radius",min:0,max:1,step:.001,type:"float"}),(0,o.h)(u.Button,{title:"Shuffle",onClick:function(){return c.default.live.send_command("switch","encoding_orbit_noise")}},"Spin"),(0,o.h)(u.Slider,{live:!0,name:"encoding_orbit_noise_speed",title:"Shuffle Speed",min:1,max:250,type:"int"})),(0,o.h)("div",{className:"categories encodings",ref:function(e){return t.categoryRef=e}},Object.keys(s).sort().map(function(e){return(0,o.h)("div",{key:e},(0,o.h)("h3",null,e),s[e].map(function(e){return(0,o.h)("img",{key:e.id,src:e.url,onClick:function(){c.default.live.send_command("setEncoding",JSON.stringify({id:e.id})),t.setState({file_id:e.id})}})}))}))):(0,o.h)("div",null,"Loading encodings...")}}]),e}();e.default=(0,a.connect)(function(t){return{last_message:t.live.last_message,opt:t.live.opt,frame:t.live.frame,biggan:t.module.biggan}},function(t,e){return{actions:{biggan:(0,s.bindActionCreators)(p,t),tasks:(0,s.bindActionCreators)(h,t)}}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=(n(3),n(2)),a=n(11),u=n(7),l=(i=u)&&i.__esModule?i:{default:i};c(n(50)),c(n(37));function c(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var h="categories/biggan_all.json",p=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={loading:!0,error:!1,categories:{},q:"",fn:""},n.loadCategories(h),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"loadCategories",value:function(t){var e=this;this.setState({loading:!0,fn:t}),console.log("fetching",t),l.default.socket.read_file({module:"biggan",fn:t}).then(function(n){n.name;var i=n.buf;console.log("fetched",t);var r=String.fromCharCode.apply(null,new Uint8Array(i)),o=JSON.parse(r);e.setState({categories:o,loading:!1})}).catch(function(){e.setState({error:!0})})}},{key:"setCategory",value:function(t){l.default.live.send_command("setCategory",String(t))}},{key:"updateQuery",value:function(t){var e=this;this.setState({q:t},function(){e.categoryRef.scrollTo(0,0)})}},{key:"render",value:function(){var t=this,e=this.state,n=e.loading,i=e.q;return n?(0,o.h)("div",{className:"categories"},(0,o.h)(a.Loading,null)):(0,o.h)("div",null,(0,o.h)("div",{className:"search_form"},(0,o.h)("div",{class:"button"}),(0,o.h)("input",{type:"text",className:"categorySearch",value:i,onInput:function(e){return t.updateQuery(e.target.value)}})),(0,o.h)("div",{className:"categories",ref:function(e){return t.categoryRef=e}},this.renderGroup("inanimate"),this.renderGroup("animate")))}},{key:"renderGroup",value:function(t){var e=this,n=this.state,i=n.categories,r=n.q,s=new RegExp(r||".*"),a=i[t],u=Object.keys(a).map(function(t){var n=a[t],i=Object.keys(n).map(function(t){return t.match(s)?(0,o.h)("a",{key:t,onClick:function(){return e.setCategory(n[t])}},t):null}).filter(function(t){return!!t});return i.length?(0,o.h)("div",{key:t},(0,o.h)("h3",null,t),i):null}).filter(function(t){return!!t});return u.length?(0,o.h)("div",null,"animate"===t?(0,o.h)("h2",null,t):null,u):null}}]),e}();e.default=(0,s.connect)(function(t){return{opt:t.live.opt,biggan:t.module.biggan}},function(t,e){return{actions:{}}})(p)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=n(11),u=(n(40),m(n(19))),l=m(n(38)),c=m(n(50)),h=m(n(37)),p=d(n(246)),f=d(n(245));n(4);function d(t){return t&&t.__esModule?t:{default:t}}function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.live.get_params(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"start",value:function(){console.log("starting up!"),this.props.actions.tasks.live_task({})}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"render",value:function(){var t=this.props,e=(t.biggan,t.actions),n=t.last_message;return(0,r.h)("div",{className:"app live biggan centered"},(0,r.h)("div",{className:"row"},(0,r.h)("div",{className:"column"},(0,r.h)(a.Player,{width:512,height:512,square:!0,fullscreen:this.props.fullscreen})),(0,r.h)("div",{className:"params column audioParams"},(0,r.h)("div",{className:"spacer"},n),(0,r.h)(a.Group,{title:"Player"},this.renderRestartButton()),(0,r.h)(a.Group,{title:"Latent"},(0,r.h)(a.Button,{title:"Shuffle",onClick:function(){return e.live.send_command("switch","latent")}},"Latent"),(0,r.h)(a.Slider,{live:!0,name:"latent_speed",title:"Update Speed",min:1,max:250,type:"int"}),(0,r.h)(a.Slider,{live:!0,name:"truncation",title:"Truncation",min:1e-4,max:4,type:"float"})),(0,r.h)(a.Group,{title:"Label"},(0,r.h)(a.Slider,{live:!0,name:"num_classes",title:"Classes to mix",min:1,max:10,type:"int"}),(0,r.h)(a.Button,{title:"Shuffle",onClick:function(){return e.live.send_command("switch","label")}},"Label"),(0,r.h)(a.Slider,{live:!0,name:"label_speed",title:"Mix Speed",min:1,max:250,type:"int"})),(0,r.h)(a.Group,{title:"Orbit"},(0,r.h)(a.Slider,{live:!0,name:"orbit_speed",title:"Orbit speed",min:-250,max:250,type:"int"}),(0,r.h)(a.Slider,{live:!0,name:"orbit_radius",title:"Radius",min:0,max:1,type:"float"}),(0,r.h)(a.Button,{title:"Shuffle",onClick:function(){return e.live.send_command("switch","orbit_noise")}},"Spin"),(0,r.h)(a.Slider,{live:!0,name:"orbit_noise_speed",title:"Shuffle Speed",min:1,max:250,type:"int"})),(0,r.h)(a.Group,{title:"Saturation"},(0,r.h)(a.Slider,{live:!0,name:"saturation",title:"Amount",min:0,max:4,type:"float"}),(0,r.h)(a.Slider,{live:!0,name:"saturation_mix_n",title:"Saturation mix",min:0,max:1,type:"float"})),(0,r.h)(a.Group,{title:"Scaling"},(0,r.h)(a.Slider,{live:!0,name:"zoom",title:"Zoom",min:-4,max:4,type:"float"}),(0,r.h)(a.Slider,{live:!0,name:"Horizontal",title:"Horizontal",min:-2,max:2,type:"float"}),(0,r.h)(a.Slider,{live:!0,name:"Vertical",title:"Vertical",min:-2,max:2,type:"float"}),(0,r.h)(a.Slider,{live:!0,name:"luminance",title:"Brightness",min:-2,max:2,type:"float"}))),(0,r.h)("div",{className:"params column"},(0,r.h)(p.default,null)),(0,r.h)("div",{className:"params column"},(0,r.h)(f.default,null))))}},{key:"renderRestartButton",value:function(){var t=this,e=this.props.i18n;return"IDLE"===this.props.runner.gpu.status?(0,r.h)(a.Button,{title:e.gpu.idle,onClick:function(){return t.start()}},e.gpu.start):"biggan"!==this.props.runner.gpu.task.module?(0,r.h)(a.Button,{title:e.gpu.busy,onClick:function(){return t.interrupt()}},e.gpu.interrupt):(0,r.h)("div",null,(0,r.h)(a.Button,{title:e.gpu.busy,onClick:function(){return t.interrupt()}},e.gpu.stop))}}]),e}();e.default=(0,s.connect)(function(t){return{fullscreen:t.live.fullscreen,opt:t.live.opt,last_message:t.live.last_message,runner:t.system.runner,i18n:t.system.i18n.strings,biggan:t.module.biggan}},function(t,e){return{actions:{live:(0,o.bindActionCreators)(u,t),queue:(0,o.bindActionCreators)(l,t),biggan:(0,o.bindActionCreators)(h,t),tasks:(0,o.bindActionCreators)(c,t)}}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=(n(8),n(2)),a=(f(n(4)),f(n(7))),u=p(n(37)),l=p(n(50)),c=f(n(17)),h=n(21);function p(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function f(t){return t&&t.__esModule?t:{default:t}}var d=0,m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.biggan.results||t.actions.load_results(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentDidMount",value:function(){d=0}},{key:"render",value:function(){if(!this.props.biggan.results)return(0,r.h)(c.default,{progress:this.props.biggan.progress});var t=this.props.biggan.results,e=(t.resultsFolder,t.results,t.renders,t.files);return(0,r.h)("div",{className:"app biggan"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"BigGAN Results")),(0,r.h)("div",{class:"rows params renders"},(0,r.h)(h.FileList,{linkFiles:!0,files:e,orderBy:"date desc",fields:"name date size delete",onDelete:function(t){(!(d<3)||confirm("Are you sure you want to delete this file?"))&&(d+=1,console.log("delete: confirmed"),a.default.file.destroy(t))}})))}},{key:"handlePick",value:function(t){}}]),e}();e.default=(0,s.connect)(function(t){return{biggan:t.module.biggan}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(m(n(4)),d(n(37))),u=d(n(50)),l=n(11),c=m(n(35)),h=(m(n(28)),m(n(34))),p=m(n(27)),f=m(n(61));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("biggan.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.biggan),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("biggan.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/biggan/new/"))}},{key:"render",value:function(){var t=this.props,e=t.biggan,n=(t.match,t.history),i=(t.actions,t.tasks),o=((e.data||{}).folderLookup||{})[e.folder_id]||{};return(0,r.h)("div",{className:"app biggan"},(0,r.h)("div",{class:"heading"},(0,r.h)("div",{class:"spaced"},(0,r.h)("h1",null,o?o.name:(0,r.h)(l.Loading,null)),(0,r.h)(h.default,null),(0,r.h)("button",{onClick:function(){return i.invert_task(o.id,o.name)}},"Run inversion task"))),(0,r.h)("div",{className:"row"},o&&o.name&&"unsorted"!==o.name&&(0,r.h)(c.default,{title:"Add Files",module:f.default,folder:o,canUpload:!0,canAddURL:!0}),(0,r.h)("div",null,(0,r.h)(h.default,null),(0,r.h)(l.CurrentTask,null))),(0,r.h)(p.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:o,history:n,onPickFile:function(t,e){e.preventDefault(),e.stopPropagation(),console.log("picked a file",t)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.biggan,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"}),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{biggan:t.module.biggan}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),tasks:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(37)),u=l(n(61));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{biggan:t.module.biggan}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.biggan,path:"/biggan/datasets/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=p(n(7)),a=p(n(4)),u=p(n(250)),l=p(n(249)),c=p(n(248)),h=p(n(247));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("biggan"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #dfe, #def)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("biggan"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #dfe, #def)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/biggan/new/",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/biggan/datasets/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/biggan/datasets/:id/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/biggan/results/",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/biggan/live/",component:h.default}))}}]),t}();e.default={name:"biggan",router:f,links:function(){return[{url:"/biggan/new/",name:"folders"},{url:"/biggan/datasets/",name:"datasets"},{url:"/biggan/results/",name:"results"},{url:"/biggan/live/",name:"live"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(1),o=n(3),s=n(8),a=n(2),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(81)),l=n(80),c=(i=l)&&i.__esModule?i:{default:i};function h(t){if(!t.to)return(0,r.h)("span",null,t.children);var e=t.to===t.location.pathname?(0,r.h)("b",null,t.children):t.children;return(0,r.h)("span",null,(0,r.h)(s.Link,{to:t.to},e))}e.default=(0,a.connect)(function(t){return{site:t.system.site,app:t.system.app,fps:t.live.fps,playing:t.live.playing,i18n:t.system.i18n.strings}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t)}})(function(t){var e=t.site,n=t.app,i=t.fps,o=t.playing,s=t.actions,a=t.location,u=t.history,l=t.i18n,p=Object.keys(c.default).map(function(t,e){var n=t.replace(/_/," ");return(0,r.h)("option",{value:t,key:e},l.header[n]||n)}),f=c.default[n.tool].links().map(function(t,e){return(0,r.h)(h,{key:e,location:a,to:t.url},l.header[t.name]||t.name)}),d=l.header.site_name||e.name+" cortex";return document.querySelector("title").innerHTML=d,document.body.parentNode.setAttribute("lang",l.language),document.body.setAttribute("section",a.pathname.replace(/[0-9]/g,"").replace(/\//g,"_").replace(/^_/,"").replace(/_$/,"")),(0,r.h)("header",null,(0,r.h)("span",null,(0,r.h)("b",null,d)),(0,r.h)("span",null,(0,r.h)("select",{onChange:function(t){var e=window.location.pathname.split("/");e.shift(),console.log(e),e[0]in c.default&&e[1]&&u.push("/"+t.target.value+"/"+e[1]+"/"),s.changeTool(t.target.value,!0)},value:n.tool},p)),(0,r.h)(h,{location:a,to:"/system"},l.header.system),(0,r.h)(h,{location:a,to:"/dashboard"},l.header.dashboard),(0,r.h)("span",null,f),o&&(0,r.h)("span",null,i," fps"))})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=(n(3),n(2));var s=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this.props,e=(t.title,t.images.map(function(t){return(0,r.h)("div",null,(0,r.h)("img",{src:t.url}))}));return(0,r.h)("div",{class:"gallery"},e)}}]),e}();e.default=(0,o.connect)(function(t){return{}},function(t,e){return{}})(s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(2),a=n(7),u=(i=a)&&i.__esModule?i:{default:i};function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var c={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},h={wav:"audio/wav",mp3:"audio/mp3",flac:"audio/flac",aiff:"audio/aiff"},p={mp4:"video/mp4"},f=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=i=l(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={loading:!1,stale:!1,buffer:{},url:null},l(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){this.fetch()}},{key:"componentDidUpdate",value:function(t){this.props.file!==t.file&&this.deferFetch()}},{key:"componentWillUnmount",value:function(){this.state.url&&window.URL.revokeObjectURL(this.state.url)}},{key:"deferFetch",value:function(){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.fetch()},200)}},{key:"fetch",value:function(){var t=this.props,e=t.file,n=t.path,i=t.thumbnail;if(e)if(this.state.loading)this.setState({stale:!0});else{var r=[n||e.path,e.name].join("/").replace("//","/"),o=this.props.app.tool;if(this.setState({buffer:null,loading:!0}),i){var s=parseInt(i)||200;u.default.socket.thumbnail({module:o,fn:r,size:s}).then(this.loadBuffer.bind(this))}else u.default.socket.read_file({module:o,fn:r}).then(this.loadBuffer.bind(this))}}},{key:"loadBuffer",value:function(t){var e=this,n=t.name,i=t.buf,r=y(n);this.state.url&&window.URL.revokeObjectURL(this.state.url);var o=void 0;i&&(o=r in c?d(i,c[r]):r in h?d(i,h[r]):r in p?d(i,p[r]):m(i));var s=this.state.stale;this.setState({ext:r,url:o,buffer:t,loading:!1,stale:!1},function(){s&&e.fetch()})}},{key:"render",value:function(){if(!this.props.file)return(0,o.h)("div",{className:"fileViewer"});var t=this.state,e=t.loading,n=t.buffer,i=t.url,r=t.ext;if(e)return(0,o.h)("div",{className:"fileViewer"},(0,o.h)("span",null,"Loading..."));var s=n.error,a=n.name,u=(n.path,n.date,n.size,n.buf);if(s)return(0,o.h)("div",{className:"fileViewer"},(0,o.h)("span",null,s));if(!a)return(0,o.h)("div",{className:"fileViewer"});if(!u||!i)return(0,o.h)("div",{className:"fileViewer"},(0,o.h)("span",null,"File empty"));var l=void 0;return l=r in c?(0,o.h)("img",{src:i}):r in h?(0,o.h)("audio",{src:i,controls:!0,autoplay:!0}):r in p?(0,o.h)("video",{src:i,controls:!0,autoplay:!0}):(0,o.h)("div",{className:"text"},i),(0,o.h)("div",{className:"fileViewer"},l)}}]),e}(),d=function(t,e){var n=new Uint8Array(t),i=new Blob([n],{type:e});return(window.URL||window.webkitURL).createObjectURL(i)},m=function(t){return String.fromCharCode.apply(null,new Uint8Array(t))},y=function(t){return t.split(".").slice(-1)[0].toLowerCase()};e.default=(0,s.connect)(function(t){return{app:t.system.app}})(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(1),o=(n(3),n(2)),s=n(4),a=(i=s)&&i.__esModule?i:{default:i};e.default=(0,o.connect)(function(t){return t.system.runner},function(t,e){return{}})(function(t){var e=t.cpu,n=t.gpu,i=t.processor,o=void 0;i?o="cpu"===i?"cpu":"gpu":"IDLE"!==n.status?o="gpu":"IDLE"!==e.status&&(o="cpu");var s="cpu"===o?e:n;if(!s)return(0,r.h)("div",null);if("IDLE"===s.status)return(0,r.h)("div",null,o," idle");var u=s.last_message,l=s.pid,c=s.task,h=c.activity,p=c.epoch,f=c.epochs,d=c.dataset,m=c.module;return(0,r.h)("div",{className:"currentTask"},"#",l,": ",(0,r.h)("b",null,m," ",h)," ",(0,r.h)("i",null,d),f?(0,r.h)("span",null,f," epoch",a.default.courtesy_s(f)):"",p?(0,r.h)("span",null,"(currently #",p,")"):"",(0,r.h)("br",null),(0,r.h)("br",null),(0,r.h)("div",{className:"quiet lastMessage"},u))})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2);n(3),function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(n(19));var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleClick=n.handleClick.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleClick",value:function(t){clearTimeout(this.timeout);var e=t.target.checked;this.props.onToggle&&this.props.onToggle(e)}},{key:"render",value:function(){var t=this.props.value;this.props.noDim;return(0,r.h)("div",{className:"checkbox param"},(0,r.h)("label",null,(0,r.h)("span",null,this.props.title),(0,r.h)("input",{type:"checkbox",onClick:this.handleClick,checked:t})))}}]),e}();e.default=(0,o.connect)(function(t){return{}},function(t,e){return{}})(s)},function(t,e,n){var i,r,o;r=[e,t],void 0===(o="function"==typeof(i=function(t,e){"use strict";var n={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function i(t){try{delete window[t]}catch(e){window[t]=void 0}}function r(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=t,s=e.timeout||n.timeout,a=e.jsonpCallback||n.jsonpCallback,u=void 0;return new Promise(function(n,l){var c=e.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),h=a+"_"+c;window[c]=function(t){n({ok:!0,json:function(){return Promise.resolve(t)}}),u&&clearTimeout(u),r(h),i(c)},o+=-1===o.indexOf("?")?"?":"&";var p=document.createElement("script");p.setAttribute("src",""+o+a+"="+c),e.charset&&p.setAttribute("charset",e.charset),p.id=h,document.getElementsByTagName("head")[0].appendChild(p),u=setTimeout(function(){l(new Error("JSONP request to "+t+" timed out")),i(c),r(h),window[c]=function(){i(c)}},s),p.onerror=function(){l(new Error("JSONP request to "+t+" failed")),i(c),r(h),u&&clearTimeout(u)}})}})?i.apply(e,r):i)||(t.exports=o)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tumblr=e.thumbnail=e.loadImage=e.tag=e.parse=e.lookup=e.integrations=void 0;var i=o(n(129)),r=o(n(257));function o(t){return t&&t.__esModule?t:{default:t}}var s=e.integrations=[{type:"image",regex:/\.(jpeg|jpg|gif|png|svg)(\?.*)?$/i,fetch:function(t,e){var n=new Image;n.onload=function(){if(n){var i=n.naturalWidth,r=n.naturalHeight;n=null,e({url:t,type:"image",token:"",thumbnail:"",title:"",width:i,height:r})}},n.src=t,n.complete&&n.onload()},tag:function(t){return'<img src="'+t.url+'">'}},{type:"video",regex:/\.(mp4|webm)(\?.*)?$/i,fetch:function(t,e){var n=document.createElement("video"),i=t.replace(/\?.*$/,"").split("/"),r=i[i.length-1];n.addEventListener("loadedmetadata",function(){var i=n.videoWidth,o=n.videoHeight;n=null,e({url:t,type:"video",token:t,thumbnail:"/public/assets/img/video-thumbnail.png",title:r,width:i,height:o})}),n.src=t,n.load()},tag:function(t){return'<video src="'+t.url+'">'}},{type:"audio",regex:/\.(wav|mp3)(\?.*)?$/i,fetch:function(t,e){var n=document.createElement("audio"),i=t.replace(/\?.*$/,"").split("/"),r=i[i.length-1];n.addEventListener("loadedmetadata",function(){var i=n.duration;n=null,e({url:t,type:"audio",token:t,thumbnail:"/public/assets/img/audio-thumbnail.png",title:r,duration:i})}),n.src=t,n.load()},tag:function(t){return'<audio src="'+t.url+'">'}},{type:"youtube",regex:/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i,fetch:function(t,e){var n=(t.match(/v=([-_a-zA-Z0-9]{11})/i)||t.match(/youtu.be\/([-_a-zA-Z0-9]{11})/i)||t.match(/embed\/([-_a-zA-Z0-9]{11})/i))[1].split("&")[0],i="https://i.ytimg.com/vi/"+n+"/hqdefault.jpg",o=new URL("https://www.googleapis.com/youtube/v3/videos"),s={id:n,key:"AIzaSyA4UK3L2tZ5nHRUELEPk1PG13kxzZkc6qg",part:"id,contentDetails,snippet,status"};Object.keys(s).forEach(function(t){return o.searchParams.append(t,s[t])}),(0,r.default)(o.toString()).then(function(t){return t.json()}).then(function(r){if(console.log(r),!r||!r.items||!r.items.length)return alert("Sorry, this video URL is invalid.");var o,s=r.items[0],a=s.contentDetails.duration.match(/\d+/g).map(function(t){return parseInt(t)});console.log(s,a),o=a?3==a.length?60*a[0]+60*a[1]+a[2]:2==a.length?60*a[0]+a[1]:a[0]:0,["maxres","high","medium","standard","default"].some(function(t){return!!s.snippet.thumbnails[t]&&(i=s.snippet.thumbnails[t].url,!0)}),e({url:t,type:"youtube",token:n,thumbnail:i,title:s.snippet.title,duration:o,width:640,height:360})})},tag:function(t){return'<div class="video" style="width: '+t.width+"px; height: "+t.height+'px; overflow: hidden; position: relative;"><iframe frameborder="0" scrolling="no" seamless="seamless" webkitallowfullscreen="webkitAllowFullScreen" mozallowfullscreen="mozallowfullscreen" allowfullscreen="allowfullscreen" id="okplayer" width="'+t.width+'" height="'+t.height+'" src="https://youtube.com/embed/'+t.token+'?showinfo=0" style="position: absolute; top: 0px; left: 0px; width: '+t.width+"px; height: "+t.height+'px;"></iframe></div>'}},{type:"vimeo",regex:/vimeo.com\/\d+$/i,fetch:function(t,e){var n=t.match(/\d+$/i)[0];(0,i.default)("https://vimeo.com/api/v2/video/"+n+".json").then(function(t){return t.json()}).then(function(i){if(0==i.length)return e(n,"",640,360);var r=i[0];"anywhere"==r.embed_privacy?e({url:t,type:"vimeo",token:n,thumbnail:r.thumbnail_large,duration:r.duration,title:r.title,width:r.width,height:r.height}):alert("Sorry, the author of this video has marked it private, preventing it from being embedded.",function(){})})},tag:function(t){return'<div class="video" style="width: '+t.width+"px; height: "+t.height+'px; overflow: hidden; position: relative;"><iframe frameborder="0" scrolling="no" seamless="seamless" webkitallowfullscreen="webkitAllowFullScreen" mozallowfullscreen="mozallowfullscreen" allowfullscreen="allowfullscreen" id="okplayer" src="https://player.vimeo.com/video/'+t.token+'?api=1&title=0&byline=0&portrait=0&playbar=0&player_id=okplayer&loop=0&autoplay=0" width="'+t.width+'" height="'+t.height+'" style="position: absolute; top: 0px; left: 0px; width: '+t.width+"px; height: "+t.height+'px;"></iframe></div>'}},{type:"link",regex:/^http.+/i,fetch:function(t,e){e({url:t,type:"link",token:"",thumbnail:"",title:"",width:100,height:100})},tag:function(t){return'<a href="'+t.url+'" target="_blank">'+t.url+"</a>"}}],a=e.lookup=s.reduce(function(t,e){return(t[e.type]=e)&&t},{});e.parse=function(t,e){s.some(function(n){return!!n.regex.test(t)&&(n.fetch(t,function(t){e(t)}),!0)})||e(null)},e.tag=function(t){return t.type in a?a[t.type].tag(t):""},e.loadImage=function(t,e,n){a.image.regex.test(t)?a.image.fetch(t,function(t){e(t)}):n&&n()},e.thumbnail=function(t){return'<img src="'+(t.thumbnail||t.url)+'" class="thumb">'},e.tumblr=function(t,e){var n=t.replace(/^https?:\/\//,"").split("/")[0];-1==n.indexOf(".")&&(n+=".tumblr.com"),(0,r.default)("http://"+n+"/api/read").then(function(t){var n=t.posts.reduce(u,[]);e(n)})};function u(t,e){var n=void 0,i=void 0,r=void 0;switch(e.type){case"photo":i=stripHTML(e["photo-caption"]),e.photos.length?e.photos.forEach(function(e){n={url:e["photo-url-1280"],type:"image",token:"",thumbnail:e["photo-url-500"],description:i,width:parseInt(e.width),height:parseInt(e.height)},t.push(n)}):(n={url:e["photo-url-1280"],type:"image",token:"",thumbnail:e["photo-url-500"],description:i,width:parseInt(e.width),height:parseInt(e.height)},t.push(n));break;case"video":if(0!==(r=e["video-source"]).indexOf("http"))break;if(a.youtube.regex.test(r)){var o=(r.match(/v=([-_a-zA-Z0-9]{11})/i)||r.match(/youtu.be\/([-_a-zA-Z0-9]{11})/i)||r.match(/embed\/([-_a-zA-Z0-9]{11})/i))[1].split("&")[0],s="https://i.ytimg.com/vi/"+o+"/hqdefault.jpg";n={url:e["video-source"],type:"youtube",token:o,thumbnail:s,title:stripHTML(e["video-caption"]),width:640,height:360},t.push(n)}}return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.upload_action=void 0,e.crud_upload=o;var i=n(85);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e,n,o){return new Promise(function(s,a){var u=n.id;Object.keys(n).forEach(function(t){"id"!==t&&e.append(t,n[t])}),console.log("/api/"+t+"/"+u+"/upload/");var l=new XMLHttpRequest;l.upload.addEventListener("progress",function(e){if(e.lengthComputable){var n=Math.round(100*e.loaded/e.total)||0;n>99?o&&o(r({type:(0,i.as_type)(t,"upload_waiting"),percent:n},t,u)):o&&o(r({type:(0,i.as_type)(t,"upload_progress"),percent:n},t,u))}else o&&o(r({type:(0,i.as_type)(t,"upload_error"),error:"unable to compute upload progress"},t,u))},!1),l.addEventListener("load",function(e){var n=void 0;try{n=JSON.parse(e.target.responseText)}catch(e){return o&&o(r({type:(0,i.as_type)(t,"upload_error"),error:"upload failed"},t,u)),void a(e)}o&&o(r({type:(0,i.as_type)(t,"upload_complete"),data:n},t,u)),n.files&&n.files.length&&n.files.forEach(function(t){console.log(t),o&&o({type:(0,i.as_type)("file","create"),data:t})});s(n)},!1),l.addEventListener("error",function(e){o&&o(r({type:(0,i.as_type)(t,"upload_error"),error:"upload failed"},t,u)),a(e)},!1),l.addEventListener("abort",function(e){o&&o(r({type:(0,i.as_type)(t,"upload_error"),error:"upload cancelled"},t,u)),a(e)},!1),l.open("POST","/api/"+t+"/"+u+"/upload/"),l.send(e),o&&o({type:(0,i.as_type)(t,"upload_loading")})})}e.upload_action=function(t,e,n){return function(i){return o(t,e,n,i)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.crud_action=void 0,e.crud_actions=function(t){var e=(0,i.crud_fetch)(t);return["index","show","create","update","destroy"].reduce(function(n,i){return n[i]=s(t,i,function(t){return e[i](t)}),n},{action:function(e,n){return s(t,e,n)},upload:function(e,n){return(0,o.upload_action)(t,e,n)}})};var i=n(130),r=n(85),o=n(259);var s=e.crud_action=function(t,e,n){return function(i){return function(o){return new Promise(function(s,a){o({type:(0,r.as_type)(t,e+"_loading")}),n(i).then(function(n){o({type:(0,r.as_type)(t,e),data:n}),s(n)}).catch(function(n){o({type:(0,r.as_type)(t,e+"_error")}),a(n)})})}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(1),a=n(3),u=n(2),l=(n(8),n(11)),c=n(7),h=(i=c)&&i.__esModule?i:{default:i};function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var f=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=i=p(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={dir:"/",files:[],file:null,loading:!0},p(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,s.Component),o(e,[{key:"componentDidMount",value:function(){this.fetch(this.state.dir)}},{key:"handlePick",value:function(t){console.log(t),t.dir?this.fetch([this.state.dir,t.name].join("/").replace("//","/")):this.setState({file:r({},t,{path:this.state.dir})})}},{key:"fetch",value:function(t){var e=this;console.log("fetch",t);var n=this.props.app.tool;this.setState({dir:t,file:null,loading:!0}),h.default.socket.list_directory({module:n,dir:t}).then(function(n){console.log(n),e.setState({dir:t,files:n,loading:!1})})}},{key:"render",value:function(){var t=this,e=this.props.app,n=this.state,i=n.loading,r=n.dir,o=n.files,a=n.loadingFile,u=n.file;return console.log(this.props,this.state),(0,s.h)("div",{className:"app browser"},(0,s.h)("h1",null,r,"/"!==r[r.length-1]&&"/"),e.tool,(0,s.h)("br",null),i&&(0,s.h)(l.Loading,null),(0,s.h)(l.FileList,{files:o,groupDirectories:!0,parentDirectory:"/"!==r,orderBy:"name asc",fields:"name datetime size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)},onClickParent:function(e){console.log("navigate up"),t.fetch(r.split("/").slice(0,-1).join("/")||"/")}}),a&&(0,s.h)(l.Loading,null),u&&(0,s.h)(l.FileViewer,{file:u}))}}]),e}();e.default=(0,u.connect)(function(t){return{app:t.system.app}},function(t,e){return{actions:(0,a.bindActionCreators)({},t)}})(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=l(n(25)),s=l(n(39)),a=l(n(51)),u=l(n(127));function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var h=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=i=c(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={x:0,y:0,sum:0},c(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this,e=this.props,n=e.make,i=e.take,l=e.checkpoint,c=e.onTrain,h=e.onAugment,p=this.state,f=p.x,d=p.y,m=p.sum;return(0,r.h)(o.default,{className:"augmentationGrid"},(0,r.h)(u.default,{x:n,y:i,max:5e3,onHover:function(e,n){return t.setState({x:e,y:n})},onClick:function(e,n){t.setState({sum:m+e*n}),h(n,e)}}),(0,r.h)(s.default,{title:"Name"},l.name),(0,r.h)(s.default,{title:"Take"},d),(0,r.h)(s.default,{title:"Make"},f),(0,r.h)(s.default,{title:"Will add to dataset"},f*d),(0,r.h)(s.default,{title:"Total added this epoch"},m),(0,r.h)(s.default,{title:"Sequence length"},l.sequenceCount),(0,r.h)(s.default,{title:"Dataset size"},l.datasetCount),(0,r.h)(a.default,{onClick:function(){t.setState({sum:0}),c()}},"Train"))}}]),e}();e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2),s=n(3),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(52));var u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleClick=n.handleClick.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleClick",value:function(t){var e=this.props,n=e.audioPlayer,i=e.actions;n.playing?i.pause():i.resume()}},{key:"render",value:function(){var t=this.props.audioPlayer;return(0,r.h)("div",{className:"audioPlayer"},(0,r.h)("span",null,this.props.title),(0,r.h)("button",{onClick:this.handleClick},t.playing?"▶":"~"))}}]),e}();e.default=(0,o.connect)(function(t){return{audioPlayer:t.audioPlayer}},function(t,e){return{actions:(0,s.bindActionCreators)(a,t)}})(u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=n(3),a=n(2),u=n(20),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(53)),c=d(n(128)),h=d(n(91)),p=d(n(90)),f=n(83);function d(t){return t&&t.__esModule?t:{default:t}}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var v=function(t){function e(){return m(this,e),y(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,r.Component),i(e,[{key:"render",value:function(){var t=this;return(0,r.h)(o.BrowserRouter,null,(0,r.h)("div",null,(0,r.h)("div",{className:"diamond"}),(0,r.h)(o.Route,{exact:!0,path:"/",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/login",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/logout",component:h.default}),(0,r.h)(o.Route,{exact:!0,path:"/signup",component:p.default}),(0,r.h)(o.Route,{path:"/:module",component:function(e){switch(e.location.pathname){case"/login":case"/logout":case"/signup":return null}return t.props.actions.setReturnTo(e.location.pathname),(0,r.h)(o.Redirect,{to:"/login"})}})))}},{key:"componentDidMount",value:function(){document.querySelector(".diamond").style.backgroundImage="linear-gradient("+((0,f.randint)(40)-5)+"deg, #fde, #ffe)"}}]),e}(),g=function(t){function e(){return m(this,e),y(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,r.Component),i(e,[{key:"render",value:function(){var t=this.props,e=t.auth,n=t.env,i=t.actions;if(n.production&&!e.initialized)return(0,r.h)("div",{className:"loading"},"Loading");if(n.development||e.isAuthenticated){if(e.returnTo){var o=e.returnTo;return o&&!o.match(/(login|logout|signup)/i)||(o="/"),console.log("history.push",o),i.setReturnTo(null),u.history.push(o),(0,r.h)("div",null,"Launching app")}return(0,r.h)("div",null,this.props.children)}return(0,r.h)(v,this.props)}},{key:"componentDidMount",value:function(){this.props.env.production&&this.props.actions.checkin()}}]),e}();e.default=(0,a.connect)(function(t){return{env:t.system.env,auth:t.auth}},function(t){return{actions:(0,s.bindActionCreators)(l,t)}})(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a(n(264)),r=a(n(128)),o=a(n(91)),s=a(n(90));function a(t){return t&&t.__esModule?t:{default:t}}e.default={Gate:i.default,Login:r.default,Logout:o.default,Signup:s.default}},function(t,e,n){"use strict";var i,r=n(20),o=n(6),s=(i=o)&&i.__esModule?i:{default:i};n(41).socket.on("api_res",function(t){t=function(t){if("string"==typeof t)try{var e=JSON.parse(t);return e}catch(e){return console.error("not valid json"),t}return t}(t);var e=s.default[t.datatype];if(console.log("api_res",t.type,t.datatype),!e)return console.error("socket:api_res bad datatype",t.datatype);switch(t.type){case"create":return(0,r.dispatch)({type:e.create,source:"socket",data:t.data});case"update":return(0,r.dispatch)({type:e.update,source:"socket",data:t.data});case"destroy":return(0,r.dispatch)({type:e.destroy,source:"socket",data:t.data})}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stop_queue=e.start_queue=e.stop_task=e.start_task=e.remove_task=e.add_task=void 0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};e.emit=l;var r,o=n(20),s=n(6),a=(r=s)&&r.__esModule?r:{default:r},u=n(41);function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};u.socket.emit("task",i({type:t,task:e},n))}u.socket.on("task_res",function(t){var e=void 0;try{"string"==typeof t?"string"==typeof(e=JSON.parse(t))&&(e=JSON.parse(e)):e=t}catch(t){return void console.warn("problem with json",t)}switch(e.task&&(0,o.dispatch)({type:a.default.task.update,data:e.task}),e.type){case"start":case"stop":break;case"task_begin":(0,o.dispatch)({type:a.default.task.task_begin,task:e.task});break;case"task_finish":(0,o.dispatch)({type:a.default.task.task_finish,task:e.task});break;case"kill":break;case"stdout":return(0,o.dispatch)({type:a.default.system.stdout,data:e});case"stderr":return(0,o.dispatch)({type:a.default.system.stderr,data:e});case"add":case"remove":case"start_queue":case"stop_queue":case"list":case"set_priority":break;case"progress":(0,o.dispatch)({type:a.default.task.progress,task:e.task});break;case"epoch":(0,o.dispatch)({type:a.default.task.epoch,task:e.task});break;case"task_error":return console.log("task error",e);default:return console.log(e),console.log("no such task command",e.type)}});e.add_task=function(t){return l("add",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.remove_task=function(t){return l("remove",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.start_task=function(t){return l("start",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.stop_task=function(t){return l("stop",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.start_queue=function(){return l("start_queue",{},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},e.stop_queue=function(){return l("stop_queue",{},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},function(t,e,n){"use strict";function i(t){if(this.size=0|t,this.size<=1||0!=(this.size&this.size-1))throw new Error("FFT size must be a power of two and bigger than 1");this._csize=t<<1;for(var e=new Array(2*this.size),n=0;n<e.length;n+=2){const t=Math.PI*n/this.size;e[n]=Math.cos(t),e[n+1]=-Math.sin(t)}this.table=e;for(var i=0,r=1;this.size>r;r<<=1)i++;this._width=i%2==0?i-1:i,this._bitrev=new Array(1<<this._width);for(var o=0;o<this._bitrev.length;o++){this._bitrev[o]=0;for(var s=0;s<this._width;s+=2){var a=this._width-s-2;this._bitrev[o]|=(o>>>s&3)<<a}}this._out=null,this._data=null,this._inv=0}t.exports=i,i.prototype.fromComplexArray=function(t,e){for(var n=e||new Array(t.length>>>1),i=0;i<t.length;i+=2)n[i>>>1]=t[i];return n},i.prototype.createComplexArray=function(){const t=new Array(this._csize);for(var e=0;e<t.length;e++)t[e]=0;return t},i.prototype.toComplexArray=function(t,e){for(var n=e||this.createComplexArray(),i=0;i<n.length;i+=2)n[i]=t[i>>>1],n[i+1]=0;return n},i.prototype.completeSpectrum=function(t){for(var e=this._csize,n=e>>>1,i=2;i<n;i+=2)t[e-i]=t[i],t[e-i+1]=-t[i+1]},i.prototype.transform=function(t,e){if(t===e)throw new Error("Input and output buffers must be different");this._out=t,this._data=e,this._inv=0,this._transform4(),this._out=null,this._data=null},i.prototype.realTransform=function(t,e){if(t===e)throw new Error("Input and output buffers must be different");this._out=t,this._data=e,this._inv=0,this._realTransform4(),this._out=null,this._data=null},i.prototype.inverseTransform=function(t,e){if(t===e)throw new Error("Input and output buffers must be different");this._out=t,this._data=e,this._inv=1,this._transform4();for(var n=0;n<t.length;n++)t[n]/=this.size;this._out=null,this._data=null},i.prototype._transform4=function(){var t,e,n=this._out,i=this._csize,r=1<<this._width,o=i/r<<1,s=this._bitrev;if(4===o)for(t=0,e=0;t<i;t+=o,e++){const n=s[e];this._singleTransform2(t,n,r)}else for(t=0,e=0;t<i;t+=o,e++){const n=s[e];this._singleTransform4(t,n,r)}var a=this._inv?-1:1,u=this.table;for(r>>=2;r>=2;r>>=2){var l=(o=i/r<<1)>>>2;for(t=0;t<i;t+=o)for(var c=t+l,h=t,p=0;h<c;h+=2,p+=r){const t=h,e=t+l,i=e+l,r=i+l,o=n[t],s=n[t+1],c=n[e],f=n[e+1],d=n[i],m=n[i+1],y=n[r],_=n[r+1],v=o,g=s,b=u[p],w=a*u[p+1],k=c*b-f*w,S=c*w+f*b,x=u[2*p],T=a*u[2*p+1],O=d*x-m*T,P=d*T+m*x,A=u[3*p],C=a*u[3*p+1],E=y*A-_*C,M=y*C+_*A,R=v+O,j=g+P,N=v-O,F=g-P,L=k+E,D=S+M,q=a*(k-E),I=a*(S-M),B=R+L,U=j+D,z=R-L,Y=j-D,W=N+I,G=F-q,V=N-I,H=F+q;n[t]=B,n[t+1]=U,n[e]=W,n[e+1]=G,n[i]=z,n[i+1]=Y,n[r]=V,n[r+1]=H}}},i.prototype._singleTransform2=function(t,e,n){const i=this._out,r=this._data,o=r[e],s=r[e+1],a=r[e+n],u=r[e+n+1],l=o+a,c=s+u,h=o-a,p=s-u;i[t]=l,i[t+1]=c,i[t+2]=h,i[t+3]=p},i.prototype._singleTransform4=function(t,e,n){const i=this._out,r=this._data,o=this._inv?-1:1,s=2*n,a=3*n,u=r[e],l=r[e+1],c=r[e+n],h=r[e+n+1],p=r[e+s],f=r[e+s+1],d=r[e+a],m=r[e+a+1],y=u+p,_=l+f,v=u-p,g=l-f,b=c+d,w=h+m,k=o*(c-d),S=o*(h-m),x=y+b,T=_+w,O=v+S,P=g-k,A=y-b,C=_-w,E=v-S,M=g+k;i[t]=x,i[t+1]=T,i[t+2]=O,i[t+3]=P,i[t+4]=A,i[t+5]=C,i[t+6]=E,i[t+7]=M},i.prototype._realTransform4=function(){var t,e,n=this._out,i=this._csize,r=1<<this._width,o=i/r<<1,s=this._bitrev;if(4===o)for(t=0,e=0;t<i;t+=o,e++){const n=s[e];this._singleRealTransform2(t,n>>>1,r>>>1)}else for(t=0,e=0;t<i;t+=o,e++){const n=s[e];this._singleRealTransform4(t,n>>>1,r>>>1)}var a=this._inv?-1:1,u=this.table;for(r>>=2;r>=2;r>>=2){var l=(o=i/r<<1)>>>1,c=l>>>1,h=c>>>1;for(t=0;t<i;t+=o)for(var p=0,f=0;p<=h;p+=2,f+=r){var d=t+p,m=d+c,y=m+c,_=y+c,v=n[d],g=n[d+1],b=n[m],w=n[m+1],k=n[y],S=n[y+1],x=n[_],T=n[_+1],O=v,P=g,A=u[f],C=a*u[f+1],E=b*A-w*C,M=b*C+w*A,R=u[2*f],j=a*u[2*f+1],N=k*R-S*j,F=k*j+S*R,L=u[3*f],D=a*u[3*f+1],q=x*L-T*D,I=x*D+T*L,B=O+N,U=P+F,z=O-N,Y=P-F,W=E+q,G=M+I,V=a*(E-q),H=a*(M-I),Z=B+W,Q=U+G,K=z+H,$=Y-V;if(n[d]=Z,n[d+1]=Q,n[m]=K,n[m+1]=$,0!==p){if(p!==h){var X=z+-a*H,J=-Y+-a*V,tt=B+-a*W,et=-U- -a*G,nt=t+c-p,it=t+l-p;n[nt]=X,n[nt+1]=J,n[it]=tt,n[it+1]=et}}else{var rt=B-W,ot=U-G;n[y]=rt,n[y+1]=ot}}}},i.prototype._singleRealTransform2=function(t,e,n){const i=this._out,r=this._data,o=r[e],s=r[e+n],a=o+s,u=o-s;i[t]=a,i[t+1]=0,i[t+2]=u,i[t+3]=0},i.prototype._singleRealTransform4=function(t,e,n){const i=this._out,r=this._data,o=this._inv?-1:1,s=2*n,a=3*n,u=r[e],l=r[e+n],c=r[e+s],h=r[e+a],p=u+c,f=u-c,d=l+h,m=o*(l-h),y=p+d,_=f,v=-m,g=p-d,b=f,w=m;i[t]=y,i[t+1]=0,i[t+2]=_,i[t+3]=v,i[t+4]=g,i[t+5]=0,i[t+6]=b,i[t+7]=w}},function(t,e){t.exports={construct:function(t,e,n){var i=[];switch(t){case"ham":for(var r=0;r<e;r++)i[r]=.54-.46*Math.cos(2*Math.PI*r/(e-1));break;case"tukey":var o=e-1,s=n*o;for(r=0;r<e;r++)i[r]=r<s/2?.5*(1+Math.cos(Math.PI*(2*e/s-1))):r>o*(1-n/2)?.5*(1+Math.cos(Math.PI*(2*e/s-2/n+1))):1;break;case"rectangular":for(r=0;r<e;r++)i[r]=1}return i}}},function(t,e){var n=function(t){t=t||{},this.frameIx=0,this.frameSize=t.frameSize||64,this.frameStep=t.frameStep||this.frameSize,this.map=t.map||void 0,this.scale=t.scale||void 0,this.offset=t.offset?t.offset:0,this.sampleType=t.sampleType||"UInt8",this.wordSize=t.wordSize||1};n.prototype={frame:function(t,e){var n=this,i=this.offset,r=[],o="[object Array]"===Object.prototype.toString.call(t);for(n.frameIx=0;i<t.length;){var s=o?t[i]:t["read"+n.sampleType](i);r.push(this.map?this.map[s]:s),r.length!=this.frameSize&&i+n.wordSize!=t.length||a(r),i+=n.wordSize}function a(r){this.scale&&(r=r.map(function(t,e){return t*n.scale[e]})),e(r,n.frameIx),i!=t.length-n.wordSize&&(i-=(n.frameSize-n.frameStep)*n.wordSize,n.frameIx++,r.length=0)}0==this.frameIx&&e(void 0)}},t.exports=n},function(t,e,n){t.exports={framer:n(270),windows:n(269)}},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(){function t(t,e){for(var n,i=function(t){for(var e=t[0].width,n=t[0].height,i=t[0].duration,r=1;r<t.length;r++){if(t[r].width!=e)throw"Frame "+(r+1)+" has a different width";if(t[r].height!=n)throw"Frame "+(r+1)+" has a different height";if(t[r].duration<0||t[r].duration>32767)throw"Frame "+(r+1)+" has a weird duration (must be between 0 and 32767)";i+=t[r].duration}return{duration:i,width:e,height:n}}(t),r=[{id:440786851,data:[{data:1,id:17030},{data:1,id:17143},{data:4,id:17138},{data:8,id:17139},{data:"webm",id:17026},{data:2,id:17031},{data:2,id:17029}]},{id:408125543,data:[{id:357149030,data:[{data:1e6,id:2807729},{data:"whammy",id:19840},{data:"whammy",id:22337},{data:(n=i.duration,[].slice.call(new Uint8Array(new Float64Array([n]).buffer),0).map(function(t){return String.fromCharCode(t)}).reverse().join("")),id:17545}]},{id:374648427,data:[{id:174,data:[{data:1,id:215},{data:1,id:29637},{data:0,id:156},{data:"und",id:2274716},{data:"V_VP8",id:134},{data:"VP8",id:2459272},{data:1,id:131},{id:224,data:[{data:i.width,id:176},{data:i.height,id:186}]}]}]},{id:475249515,data:[]}]}],o=r[1],u=o.data[2],l=0,c=0;l<t.length;){var h={id:187,data:[{data:Math.round(c),id:179},{id:183,data:[{data:1,id:247},{data:0,size:8,id:241}]}]};u.data.push(h);var p=[],f=0;do{p.push(t[l]),f+=t[l].duration,l++}while(l<t.length&&f<3e4);var d=0,m={id:524531317,data:[{data:Math.round(c),id:231}].concat(p.map(function(t){var e=a({discardable:0,frame:t.data.slice(4),invisible:0,keyframe:1,lacing:0,trackNum:1,timecode:Math.round(d)});return d+=t.duration,{data:e,id:163}}))};o.data.push(m),c+=f}for(var y=0,_=0;_<o.data.length;_++){_>=3&&(u.data[_-3].data[1].data[1].data=y);var v=s([o.data[_]],e);y+=v.size||v.byteLength||v.length,2!=_&&(o.data[_]=v)}return s(r,e)}function e(t){for(var e=[];t>0;)e.push(255&t),t>>=8;return new Uint8Array(e.reverse())}function n(t,e){for(var n=new Uint8Array(e),i=e-1;i>=0;i--)n[i]=255&t,t>>=8;return n}function r(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function o(t){var e=[];t=(t.length%8?new Array(9-t.length%8).join("0"):"")+t;for(var n=0;n<t.length;n+=8)e.push(parseInt(t.substr(n,8),2));return new Uint8Array(e)}function s(t,a){for(var u=[],l=0;l<t.length;l++)if("id"in t[l]){var c=t[l].data;if("object"==(void 0===c?"undefined":i(c))&&(c=s(c,a)),"number"==typeof c&&(c="size"in t[l]?n(c,t[l].size):o(c.toString(2))),"string"==typeof c&&(c=r(c)),c.length);var h=c.size||c.byteLength||c.length,p=Math.ceil(Math.ceil(Math.log(h)/Math.log(2))/8),f=h.toString(2),d=new Array(7*p+7+1-f.length).join("0")+f,m=new Array(p).join("0")+"1"+d;u.push(e(t[l].id)),u.push(o(m)),u.push(c)}else u.push(t[l]);if(a){var y=function t(e,n){null==n&&(n=[]);for(var r=0;r<e.length;r++)"object"==i(e[r])?t(e[r],n):n.push(e[r]);return n}(u);return new Uint8Array(y)}return new Blob(u,{type:"video/webm"})}function a(t){var e=0;if(t.keyframe&&(e|=128),t.invisible&&(e|=8),t.lacing&&(e|=t.lacing<<1),t.discardable&&(e|=1),t.trackNum>127)throw"TrackNumber > 127 not supported";return[128|t.trackNum,t.timecode>>8,255&t.timecode,e].map(function(t){return String.fromCharCode(t)}).join("")+t.frame}function u(t){for(var e,n,i=t.RIFF[0].WEBP[0],r=i.indexOf("*"),o=0,s=[];o<4;o++)s[o]=i.charCodeAt(r+3+o);return e=16383&(n=s[1]<<8|s[0]),n>>14,(n=s[3]<<8|s[2])>>14,{width:e,height:16383&n,data:i,riff:t}}function l(t){for(var e=0,n={};e<t.length;){var i=t.substr(e,4);if(n[i]=n[i]||[],"RIFF"==i||"LIST"==i){var r=parseInt(t.substr(e+4,4).split("").map(function(t){var e=t.charCodeAt(0).toString(2);return new Array(8-e.length+1).join("0")+e}).join(""),2),o=t.substr(e+4+4,r);e+=8+r,n[i].push(l(o))}else"WEBP"==i?(n[i].push(t.substr(e+8)),e=t.length):(n[i].push(t.substr(e+4)),e=t.length)}return n}function c(t,e){this.frames=[],this.duration=1e3/t,this.quality=e||.8}return c.prototype.add=function(t,e){if(void 0!==e&&this.duration)throw"you can't pass a duration if the fps is set";if(void 0===e&&!this.duration)throw"if you don't have the fps set, you need to have durations here.";if(t.canvas&&(t=t.canvas),t.toDataURL)t=t.getContext("2d-lodpi").getImageData(0,0,t.width,t.height);else if("string"!=typeof t)throw"frame must be a a HTMLCanvasElement, a CanvasRenderingContext2D or a DataURI formatted string";if("string"==typeof t&&!/^data:image\/webp;base64,/gi.test(t))throw"Input must be formatted properly as a base64 encoded DataURI of type image/webp";this.frames.push({image:t,duration:e||this.duration})},c.prototype.encodeFrames=function(t){if(this.frames[0].image instanceof ImageData){var e=this.frames,n=document.createElement("canvas"),i=n.getContext("2d-lodpi");n.width=this.frames[0].image.width,n.height=this.frames[0].image.height;var r=function(o){console.log("encodeFrame",o);var s=e[o];i.putImageData(s.image,0,0),s.image=n.toDataURL("image/webp",this.quality),o<e.length-1?setTimeout(function(){r(o+1)},1):t()}.bind(this);r(0)}else t()},c.prototype.compile=function(e,n){this.encodeFrames(function(){var i=0,r=0,o=new t(this.frames.map(function(t){var e=u(l(atob(t.image.slice(23))));if(e.duration=t.duration,!e||!e.width||!e.height)return null;if(i){if(i!==e.width)return null}else i=e.width;if(r){if(r!==e.height)return null}else r=e.height;return e}).filter(function(t){return!!t}),e);n(o)}.bind(this))},{Video:c,fromImageArray:function(e,n,i){return t(e.map(function(t){var e=u(l(atob(t.slice(23))));return e.duration=1e3/n,e}),i)},toWebM:t}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.send_command=function(t,e){u.socket.emit("cmd",{cmd:t,payload:e})},e.list_checkpoints=function(t){u.socket.emit("cmd",{cmd:"list_checkpoints",payload:t})},e.list_all_checkpoints=function(t){u.socket.emit("cmd",{cmd:"list_all_checkpoints",payload:t})},e.list_epochs=function(t,e){u.socket.emit("cmd",{cmd:"list_epochs",payload:"pix2pix"===t||"pix2wav"===t?t+"/"+e:e})},e.list_sequences=function(t){u.socket.emit("cmd",{cmd:"list_sequences",payload:t})},e.load_epoch=function(t,e){console.log(">> SWITCH CHECKPOINT",t,e),u.socket.emit("cmd",{cmd:"load_epoch",payload:t+":"+e})},e.load_sequence=function(t){u.socket.emit("cmd",{cmd:"load_sequence",payload:t})},e.seek=function(t){u.socket.emit("cmd",{cmd:"seek",payload:t})},e.pause=function(t){u.socket.emit("cmd",{cmd:"pause"})},e.play=function(t){u.socket.emit("cmd",{cmd:"play"})},e.get_params=function(){u.socket.emit("cmd",{cmd:"get_params"})},e.set_param=function(t,e){u.socket.emit("cmd",{cmd:"set_param",payload:{key:t,value:e}})};var i,r=n(20),o=n(6),s=(i=o)&&i.__esModule?i:{default:i},a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(40)),u=n(41);u.socket.on("res",function(t){switch(t.cmd){case"get_last_frame":"working"!==t.res&&u.socket.emit("cmd",{cmd:"get_last_frame"});break;case"get_params":t.res&&(0,r.dispatch)({type:s.default.socket.load_params,opt:t.res}),t.res&&a.toggleFPS(t.res.processing);break;case"list_checkpoints":(0,r.dispatch)({type:s.default.socket.list_checkpoints,checkpoints:t.res});break;case"list_all_checkpoints":(0,r.dispatch)({type:s.default.socket.list_all_checkpoints,checkpoints:t.res});break;case"list_epochs":(0,r.dispatch)({type:s.default.socket.list_epochs,epochs:t.res});break;case"list_sequences":(0,r.dispatch)({type:s.default.socket.list_sequences,sequences:t.res})}}),u.socket.on("frame",a.onFrame)},function(t,e,n){"use strict";var i,r=n(20),o=n(6),s=(i=o)&&i.__esModule?i:{default:i};n(41).socket.on("system_res",function(t){switch(t.type){case"relay_connected":return(0,r.dispatch)({type:s.default.system.relay_connected});case"relay_disconnected":return(0,r.dispatch)({type:s.default.system.relay_disconnected});case"rpc_connected":return(0,r.dispatch)({type:s.default.system.rpc_connected,runner:t.runner});case"rpc_disconnected":return(0,r.dispatch)({type:s.default.system.rpc_disconnected});case"relay_status":return(0,r.dispatch)({type:t.rpc_connected?s.default.system.rpc_connected:s.default.system.rpc_disconnected,runner:t.runner});case"site":return(0,r.dispatch)({type:s.default.system.load_site,site:t.site})}})},function(t,e){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(t,e){var i=e||0,r=n;return r[t[i++]]+r[t[i++]]+r[t[i++]]+r[t[i++]]+"-"+r[t[i++]]+r[t[i++]]+"-"+r[t[i++]]+r[t[i++]]+"-"+r[t[i++]]+r[t[i++]]+"-"+r[t[i++]]+r[t[i++]]+r[t[i++]]+r[t[i++]]+r[t[i++]]+r[t[i++]]}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(n){var i=new Uint8Array(16);t.exports=function(){return n(i),i}}else{var r=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),r[e]=t>>>((3&e)<<3)&255;return r}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(42));function s(t){return t&&t.__esModule?t:{default:t}}var a={loading:!0,progress:{i:0,n:0},error:null,folders:[],folder_id:0,data:null,lossReport:null,results:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];if(e.data&&"samplernn"===e.data.module)return(0,o.default)(t,e);switch(e.type){case r.default.samplernn.load_loss:return i({},t,{lossReport:e.lossReport});case r.default.samplernn.load_graph:return i({},t,{lossReport:e.lossReport,results:e.results});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=a(n(6)),o=a(n(42)),s=a(n(4));function a(t){return t&&t.__esModule?t:{default:t}}var u={loading:!0,progress:{i:0,n:0},status:"",error:null,folder_id:0,data:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,e=arguments[1];switch(e.data&&"pix2wav"===e.data.module&&(t=(0,o.default)(t,e)),e.type){case r.default.wav2pix.load:return i({},t,{status:"Loaded buffer"});case r.default.wav2pix.progress:return i({},t,{status:"Rendering frame "+e.count});case r.default.wav2pix.finish:return i({},t,{status:e.message||"Render complete"});case r.default.wav2pix.zip:return i({},t,{status:"Built zip file "+s.default.hush_size(t.size)[1]});case r.default.wav2pix.uploading:return i({},t,{status:"Uploading zip file"});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(42));function s(t){return t&&t.__esModule?t:{default:t}}var a={loading:!0,progress:{i:0,n:0},error:null,folder_id:0,data:null,results:null,checkpoint:{name:"",sequenceCount:0,datasetCount:0}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.data&&"pix2pixhd"===e.data.module&&(t=(0,o.default)(t,e)),e.type){case r.default.pix2pixhd.load_results:return i({},t,{results:e.results});case r.default.pix2pixhd.load_uprez:return i({},t,{uprez:e.uprez});case r.default.pix2pixhd.load_dataset_count:return i({},t,{checkpoint:e.data});case r.default.file.destroy:return console.log("file destroy",t.results),i({},t,{results:i({},t.results,{files:t.results.files.filter(function(t){return t.id!==e.data.id})})});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});r(n(6));var i=r(n(42));function r(t){return t&&t.__esModule?t:{default:t}}var o={loading:!0,progress:{i:0,n:0},error:null,folder_id:0,data:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,e=arguments[1];return e.data&&"pix2pix"===e.data.module&&(t=(0,i.default)(t,e)),e.type,t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(42));function s(t){return t&&t.__esModule?t:{default:t}}var a={loading:!0,progress:{i:0,n:0},error:null,folder_id:0,data:null,app:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.data&&"morph"===e.data.module&&(t=(0,o.default)(t,e)),e.type){case r.default.morph.load:return console.log("morph load",e.app),i({},t,{app:e.app,loading:!1,data:e.data});case r.default.file.create:return console.log(e),"morph"!==e.data.module?t:i({},t,{app:t.app&&i({},t.app,{files:[e.data].concat(t.app.files)})});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(42));function s(t){return t&&t.__esModule?t:{default:t}}var a={loading:!0,progress:{i:0,n:0},error:null,folder_id:0,data:null,results:null,encodings:null,checkpoint:{name:"",sequenceCount:0,datasetCount:0}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.data&&"biggan"===e.data.module&&(t=(0,o.default)(t,e)),e.type){case r.default.biggan.load_results:return i({},t,{results:e.results});case r.default.biggan.load_encodings:return i({},t,{encodings:e.encodings});case r.default.file.destroy:return console.log("file destroy",t.results),i({},t,{results:i({},t.results,{files:t.results.files.filter(function(t){return t.id!==e.data.id})})});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.moduleReducer=void 0;var i=n(3),r=c(n(282)),o=c(n(281)),s=c(n(280)),a=c(n(279)),u=c(n(278)),l=c(n(277));function c(t){return t&&t.__esModule?t:{default:t}}e.moduleReducer=(0,i.combineReducers)({biggan:r.default,morph:o.default,pix2pix:s.default,pix2pixhd:a.default,pix2wav:u.default,samplernn:l.default})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=n(6),s=(i=o)&&i.__esModule?i:{default:i};var a={loading:!1,error:null,status:"",current:null,index:-1,playlist:[]},u=document.createElement("audio");e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.type){case s.default.audioPlayer.play:return e.file.url?(u.src=e.file.url,u.play(),r({},t,{playing:!0,current:e.file})):t;case s.default.audioPlayer.pause:return u.pause(),r({},t,{playing:!1});case s.default.audioPlayer.resume:return u.play(),r({},t,{playing:!0});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=o(n(6));o(n(29));function o(t){return t&&t.__esModule?t:{default:t}}n(84);var s={loading:!1,progress:null,error:null,data:{},images:[],files:[]};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,e=arguments[1];switch(e.type){case r.default.app.load_progress:return e.data&&"dashboard"===e.data.module?i({},t,{loading:!0,progress:e.progress}):t;case r.default.dashboard.load:return i({},t,{loading:!1,error:null,data:e.data});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(6),o=(i=r)&&i.__esModule?i:{default:i};var s={loading:!1,error:null,status:""};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,e=arguments[1];switch(e.type){case o.default.folder.upload_loading:return{error:null,loading:!0,status:"Loading..."};case o.default.folder.upload_error:return{error:null,loading:!1,status:"Error uploading :("};case o.default.folder.upload_progress:return{error:null,loading:!0,status:"Upload progress "+e.percent+"%"};case o.default.folder.upload_waiting:return{error:null,loading:!0,status:"Waiting for server to finish processing..."};case o.default.folder.upload_complete:return{error:null,loading:!1,status:"Upload complete"};case o.default.file.create_loading:return{error:null,loading:!0,status:"Creating file..."};default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={language:"pyro",header:{site_name:"political",system:"random wrecking ball",dashboard:"out of control buttons",folders:"spam",sequences:"YangGang offlimits sector",checkpoints:"ideological filters",results:"history",uprez:"resolution",live:"burning love",pix2pixhd:"PYROMANCER",pix2pix:"pyromancer lite",pix2wav:"hierophant",samplernn:"echo chamber",morph:"time travel"},gpu:{idle:"Pyromancer is idle",busy:"Pyromancer is working...",start:"Start",restart:"Restart",stop:"Stop",interrupt:"Interrupt",not_processing:"Preparing",processing:"Processing"},system:{},pix2pixhd:{live:{network:{title:"Mumbo Jumbo",view_mode:"bollocks",sequence:"mess",checkpoint:"skew",epoch:"reactionary regression"},playback:{title:"Divination",position:"accelerationism",playback_rate:"apocalypticism",skip_frames:"emergent phenomena",fade_sequence:"glossolalia",frame_delay:"babble"},record:{save_frame:"PYROMANCER DISCOUNT",save:"Save",record_video:"PYROMANCER PREMIUM",video_name:"Video name"},transition:{title:"Enlightenment",period:"endarkenment",min:"montecarlocasino",max:"random stumble"},recursion:{title:"Proprietary button",frac:"pay $5M to change this",roll:"waste $5M",axis:"When will I die?"},sequence:{title:"Political thermometer",frac:"ignition",process_frac:"wealth coeff."},transform:{title:"Hate",rotate:"0,14 factor",scale:"Ariernachweis"},clahe:{title:"Loss function",clip_limit:"sadness"},posterize:{title:"Depression",spatial_window:"breakdown",color_window:"burnout"},blur:{title:"Blur",radius:"pressure",sigma:"distortion"},canny:{title:"Future production",lo:"conjuration",hi:"self-fulfilling prophecy"},hsl:{title:"Generative future",hue:"figure it out",saturation:"make possibility appear",luminosity:"glow"}}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={language:"en",header:{system:"system",dashboard:"dashboard",folders:"folders",sequences:"sequences",checkpoints:"checkpoints",results:"results",uprez:"uprez",live:"live",pix2pixhd:"pix2pixhd",pix2pix:"pix2pix",pix2wav:"pix2wav",samplernn:"samplernn",morph:"morph"},gpu:{idle:"GPU Idle",busy:"GPU Busy",start:"Start",restart:"Restart",stop:"Stop",interrupt:"Interrupt",not_processing:"Not Processing",processing:"Processing"},system:{},pix2pixhd:{live:{network:{title:"Network",view_mode:"view mode",sequence:"sequence",checkpoint:"checkpoint",epoch:"epoch"},playback:{title:"Playback",position:"position",playback_rate:"playback rate",skip_frames:"skip frames",fade_sequence:"fade sequence",frame_delay:"frame delay"},record:{save_frame:"Save frame",save:"Save",record_video:"Record video",video_name:"Video name"},transition:{title:"Transition",period:"period",min:"min",max:"max"},recursion:{title:"Recursion",frac:"recursive amount",roll:"roll amount",axis:"roll axis"},sequence:{title:"Sequence",frac:"sequence frac",process_frac:"process frac"},transform:{title:"Transform",rotate:"rotate",scale:"scale"},clahe:{title:"Clahe",clip_limit:"clip limit"},posterize:{title:"Posterize",spatial_window:"spatial window",color_window:"color window"},blur:{title:"Blur",radius:"radius",sigma:"sigma"},canny:{title:"Canny Edge Detection",lo:"lower bound",hi:"upper bound"},hsl:{title:"Hue / Saturation",hue:"hue",saturation:"saturation",luminosity:"luminosity"}}}}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=(s(n(29)),function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(82)));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(84);var u=localStorage.getItem("cortex.i18n.language")||t.env.I18N_LANGUAGE||"en",l={loading:!1,error:null,site:{name:"loading"},env:{env:"production",production:!0,development:!1},i18n:{language:u,strings:o.strings(u)},app:{tool:localStorage.getItem("system.last_tool")||"pix2pixhd"},server:{connected:!1,status:"disconnected",error:null},relay:{connected:!1,status:"unknown",error:null},rpc:{connected:!1,status:"disconnected",error:null},cmd:{loading:!1,loaded:!1,name:null,error:null,stdout:"",stderr:""},runner:{cpu:{status:"IDLE",task:{}},gpu:{status:"IDLE",task:{}}},stdout:"",stderr:""},c=["pix2pix","pix2pixhd","pix2wav","samplernn","morph"].reduce(function(t,e){return t[e]=e,t},{});e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,e=arguments[1],n=null;switch(e.type){case r.default.socket.connect:case r.default.socket.reconnecting:return i({},t,{server:{status:"connected",connected:!0,error:null}});case r.default.socket.reconnect:return i({},t,{server:{status:"reconnecting (attempt "+e.attempt+")",connected:!1,error:null}});case r.default.socket.connect_error:case r.default.socket.reconnect_error:case r.default.socket.disconnect:case r.default.socket.reconnect_failed:return i({},t,{server:{status:"disconnected",connected:!1,error:e.error||null}});case r.default.socket.error:return i({},t,{server:i({},t.socket,{error:e.error})});case r.default.system.relay_connected:return i({},t,{relay:{status:"connected",connected:!0,error:null}});case r.default.system.relay_disconnected:return i({},t,{relay:{status:"disconnected",connected:!1,error:null},rpc:{status:"disconnected",connected:!1,error:null}});case r.default.system.rpc_connected:return i({},t,{rpc:{status:"connected",connected:!0,error:null},runner:e.runner});case r.default.system.rpc_disconnected:return i({},t,{rpc:{status:"disconnected",connected:!1,error:null},runner:e.runner||t.runner});case r.default.system.load_site:document.querySelector("title").innerHTML=e.site.name+".cortex";var s=t.app.tool,u=window.location.pathname.split("/")[1];return u in c&&(s=u),i({},t,{site:e.site,app:i({},t.app,{tool:s})});case r.default.system.running_command:return i({},t,{cmd:{loading:!0,loaded:!1,name:e.cmd,error:null,stdout:null,stderr:null}});case r.default.system.command_output:return i({},t,{cmd:{loading:!1,loaded:!0,name:e.data.cmd,error:e.data.error,stdout:e.data.stdout,stderr:e.data.stderr}});case r.default.task.task_begin:return console.log("task begin",e.task,e.task.processor),i({},t,{runner:i({},t.runner,a({},e.task.processor,{status:"RUNNING",task:e.task})),cmd:i({},t.cmd,{loaded:!1,stdout:"",stderr:""}),stdout:"",stderr:""});case r.default.task.task_finish:return n="cpu"===e.task.processor||t.runner.cpu.task&&t.runner.cpu.task.uuid===e.task.uuid?"cpu":"gpu"===e.task.processor||t.runner.gpu.task&&t.runner.gpu.task.uuid===e.task.uuid?"gpu":null,console.log("task finish",e),i({},t,{rpc:{connected:!1,status:"disconnected",error:null},runner:n?i({},t.runner,a({},n,{status:"IDLE",task:{}})):t.runner});case r.default.app.change_tool:return i({},t,{app:i({},t.app,{tool:e.tool})});case r.default.system.stdout:return e.data.processor&&t.runner[e.data.processor]?i({},t,{runner:i({},t.runner,a({},e.data.processor,i({},t.runner[e.data.processor],{last_message:e.data.data}))),stdout:t.stdout+e.data.data}):i({},t,{stdout:t.stdout+e.data.data});case r.default.system.stderr:return i({},t,{last_message:e.data.data,stderr:t.stderr+e.data.data});case r.default.system.change_language:return i({},t,{i18n:{language:e.language,strings:o.strings(e.language)}});default:return t}}}).call(this,n(43))},function(t,e,n){"use strict";var i,r,o,s,a;i=window.CanvasRenderingContext2D.prototype,r=window.document.createElement("canvas").getContext("2d"),o=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1,1!==(a=(window.devicePixelRatio||1)/o)&&(function(t,e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)}({fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all"},function(t,e){var n;i[e]=(n=i[e],function(){var e,i,r=Array.prototype.slice.call(arguments);if("all"===t)r=r.map(function(t){return t*a});else if(Array.isArray(t))for(e=0,i=t.length;e<i;e++)r[t[e]]*=a;return n.apply(this,r)})}),i.stroke=(s=i.stroke,function(){this.lineWidth*=a,s.apply(this,arguments),this.lineWidth/=a}),i.fillText=function(t){return function(){var e=Array.prototype.slice.call(arguments);e[1]*=a,e[2]*=a,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,e,n){return e*a+n}),t.apply(this,e),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,e,n){return e/a+n})}}(i.fillText),i.strokeText=function(t){return function(){var e=Array.prototype.slice.call(arguments);e[1]*=a,e[2]*=a,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,e,n){return e*a+n}),t.apply(this,e),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,e,n){return e/a+n})}}(i.strokeText)),function(t){var e;t.getContext=(e=t.getContext,function(t){var n,i,r;return"2d-lodpi"==t?r=e.call(this,"2d"):"2d"===t?(n=(r=e.call(this,"2d")).backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1,(i=(window.devicePixelRatio||1)/n)>1&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=i,this.height*=i)):r=e.call(this,t),r})}(window.HTMLCanvasElement.prototype)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=e.numericSort={asc:function(t,e){return t[0]-e[0]},desc:function(t,e){return e[0]-t[0]}},o=e.stringSort={asc:function(t,e){return t[0].localeCompare(e[0])},desc:function(t,e){return e[0].localeCompare(t[0])}};e.orderByFn=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"name asc").split(" "),e=i(t,2),n=e[0],s=void 0===n?"name":n,a=e[1],u=void 0===a?"asc":a,l=void 0,c=void 0;switch(s){case"epoch":l=function(t){return[parseInt(t.epoch||t.epochs)||0,t]},c=r[u];break;case"size":l=function(t){return[parseInt(t.size)||0,t]},c=r[u];break;case"date":l=function(t){return[+new Date(t.date||t.created_at),t]},c=r[u];break;case"updated_at":l=function(t){return[+new Date(t.updated_at),t]},c=r[u];break;case"priority":l=function(t){return[parseInt(t.priority)||parseInt(t.id)||1e3,t]},c=r[u];case"name":default:l=function(t){return[t.name||"",t]},c=o[u]}return{mapFn:l,sortFn:c}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(4));s(n(29));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={loading:!1,error:null,tasks:{},queue:[],completed:[]},l=o.default.sort.orderByFn("updated_at desc"),c=o.default.sort.orderByFn("priority asc");e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,e=arguments[1];switch(e.type){case r.default.task.index:return i({},t,{tasks:e.data.reduce(function(t,e){return t[e.id]=e,t},{}),queue:e.data.filter(function(t){return!t.completed}).map(l.mapFn).sort(l.sortFn).map(function(t){return t[1].id}),completed:e.data.filter(function(t){return t.completed}).map(c.mapFn).sort(c.sortFn).map(function(t){return t[1].id})});case r.default.task.create:return console.log(e.data),i({},t,{tasks:i({},t.tasks,a({},e.data.id,e.data)),queue:t.queue.concat([e.data.id])});case r.default.task.update:return i({},t,{tasks:i({},t.tasks,a({},e.data.id,e.data))});case r.default.task.destroy:var n=t.tasks,o=n[e.data.id],s=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(n,[e.data.id]);return i({},t,{queue:t.queue.filter(function(t){return t!==o.id}),completed:t.completed.filter(function(t){return t!==o.id}),tasks:s});case r.default.task.task_finish:return i({},t,{queue:t.queue.filter(function(t){return t!==e.task.id}),completed:[e.task.id].concat(t.completed)});default:return t}}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=a(n(29)),o=a(n(84)),s=a(n(6));function a(t){return t&&t.__esModule?t:{default:t}}var u={loading:!1,error:null,opt:{hue:0,saturation:0,luminosity:0,sequence_playing:!0,sequence_step:1,recurse_roll:0,rotate:0,scale:0,process_frac:.5,view_mode:"b",encoding_stored_mix_n:0},all_checkpoints:[],checkpoints:[],epochs:["latest"],sequences:[],fps:0,playing:!1,last_message:"",fullscreen:!1,frame:{i:0,sequence_i:0,sequence_len:"1"}};e.default=function(){var t,e,n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,l=arguments[1];switch(l.type){case s.default.socket.load_params:return console.log(l.opt),l.opt&&Object.keys(l.opt).length?i({},a,{loading:!1,error:null,opt:l.opt}):a;case s.default.player.set_param:return i({},a,{opt:i({},a.opt,(t={},e=l.key,n=l.value,e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t))});case s.default.player.set_fullscreen:return i({},a,{fullscreen:l.value});case s.default.socket.list_checkpoints:return i({},a,{checkpoints:l.checkpoints,epochs:[]});case s.default.socket.list_all_checkpoints:return i({},a,{all_checkpoints:l.all_checkpoints,epochs:[]});case s.default.socket.list_epochs:return console.log(l),"not found"===l.epochs?i({},a,{epochs:[]}):i({},a,{epochs:(l.epochs||[]).map(function(t){return["latest"==t?1/0:t,t]}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]})});case s.default.socket.list_sequences:return i({},a,{sequences:l.sequences});case s.default.player.loading_sequence:return i({},a,{opt:i({},a.opt,{sequence_name:l.sequence_name})});case s.default.player.loading_checkpoint:return i({},a,{opt:i({},a.opt,{checkpoint_name:l.checkpoint_name,epoch:l.epoch})});case s.default.player.set_fps:return i({},a,{fps:l.fps});case s.default.system.stdout:if("gpu"===l.data.processor){if(-1!==l.data.data.indexOf("set_opt")){var c=l.data.data.trim().split("\n").reduce(function(t,e){if(0===e.indexOf("set_opt")){var n=e.split(" "),i=n[1],r=parseFloat(n[2]);isNaN(r)&&(r=n[2]),t[i]=r}return t},{});return i({},a,{opt:i({},a.opt,c)})}return i({},a,{last_message:l.data.data})}return a;case s.default.player.current_frame:return l.meta?i({},a,{frame:l.meta}):a;case s.default.player.pausing:return i({},a,{playing:!1});case s.default.player.playing:return i({},a,{playing:!0});case s.default.player.start_recording:return i({},a,{opt:i({},a.opt,{recording:!0})});case s.default.player.add_record_frame:return i({},a,{opt:i({},a.opt,{recordFrames:(a.opt.recordFrames||0)+1})});case s.default.player.save_frame:return o.default.saveAs(l.blob,a.opt.checkpoint_name+"_"+a.opt.sequence+"_"+(0,r.default)().format("YYYYMMDD_HHmm")+".png"),a;case s.default.player.saving_video:return i({},a,{opt:i({},a.opt,{savingVideo:!0})});case s.default.player.save_video:return o.default.saveAs(l.blob,a.opt.checkpoint_name+"_"+a.opt.sequence+"_"+(0,r.default)().format("YYYYMMDD_HHmm")+".webm"),i({},a,{opt:i({},a.opt,{recording:!1,savingVideo:!1,recordFrames:0})});default:return a}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=n(6),s=(i=o)&&i.__esModule?i:{default:i};var a={token:null,user:{},groups:{},initialized:!1,loading:!1,isAuthenticated:!1,returnTo:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.type){case s.default.auth.set_token:return r({},t,{token:e.data,isAuthenticated:!!e.data,loading:!1,error:null});case s.default.auth.initialized:return r({},t,{loading:!1,initialized:!0,error:null});case s.default.auth.loading:return r({},t,{loading:!0,error:null});case s.default.auth.set_current_user:return r({},t,{loading:!1,initialized:!0,isAuthenticated:!0,user:e.data,error:null});case s.default.auth.set_return_to:return r({},t,{returnTo:e.data});case s.default.auth.logout_user:return r({},a);case s.default.auth.set_error:return r({},t,{loading:!1,error:e.data});case s.default.auth.loading:default:return t}}},function(t,e,n){"use strict";e.__esModule=!0;e.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),e.addEventListener=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},e.getConfirmation=function(t,e){return e(window.confirm(t))},e.supportsHistory=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},e.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},e.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},e.isExtraneousPopstateEvent=function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")}},function(t,e,n){"use strict";e.__esModule=!0;var i,r=n(138),o=(i=r)&&i.__esModule?i:{default:i};e.default=function(){var t=null,e=[];return{setPrompt:function(e){return(0,o.default)(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,i,r){if(null!=t){var s="function"==typeof t?t(e,n):t;"string"==typeof s?"function"==typeof i?i(s,r):((0,o.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),r(!0)):r(!1!==s)}else r(!0)},appendListener:function(t){var n=!0,i=function(){n&&t.apply(void 0,arguments)};return e.push(i),function(){n=!1,e=e.filter(function(t){return t!==i})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];e.forEach(function(t){return t.apply(void 0,n)})}}}},function(t,e,n){"use strict";n.r(e);var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every(function(e,i){return t(e,n[i])});var r=void 0===e?"undefined":i(e);if(r!==(void 0===n?"undefined":i(n)))return!1;if("object"===r){var o=e.valueOf(),s=n.valueOf();if(o!==e||s!==n)return t(o,s);var a=Object.keys(e),u=Object.keys(n);return a.length===u.length&&a.every(function(i){return t(e[i],n[i])})}return!1}},function(t,e,n){"use strict";function i(t){return"/"===t.charAt(0)}function r(t,e){for(var n=e,i=n+1,r=t.length;i<r;n+=1,i+=1)t[n]=t[i];t.pop()}n.r(e),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],s=t&&i(t),a=e&&i(e),u=s||a;if(t&&i(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var l=void 0;if(o.length){var c=o[o.length-1];l="."===c||".."===c||""===c}else l=!1;for(var h=0,p=o.length;p>=0;p--){var f=o[p];"."===f?r(o,p):".."===f?(r(o,p),h++):h&&(r(o,p),h--)}if(!u)for(;h--;h)o.unshift("..");!u||""===o[0]||o[0]&&i(o[0])||o.unshift("");var d=o.join("/");return l&&"/"!==d.substr(-1)&&(d+="/"),d}},function(t,e,n){"use strict";e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=a(n(301)),o=a(n(300)),s=n(137);function a(t){return t&&t.__esModule?t:{default:t}}e.createLocation=function(t,e,n,o){var a=void 0;"string"==typeof t?(a=(0,s.parsePath)(t)).state=e:(void 0===(a=i({},t)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==e&&void 0===a.state&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=(0,r.default)(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,o.default)(t.state,e.state)}},function(t,e,n){"use strict";t.exports=function(t,e,n,i,r,o,s,a){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,i,r,o,s,a],c=0;(u=new Error(e.replace(/%s/g,function(){return l[c++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(t,e,n){"use strict";e.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=h(n(138)),s=h(n(303)),a=n(302),u=n(137),l=h(n(299)),c=n(298);function h(t){return t&&t.__esModule?t:{default:t}}var p=function(){try{return window.history.state||{}}catch(t){return{}}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.default)(c.canUseDOM,"Browser history needs a DOM");var e=window.history,n=(0,c.supportsHistory)(),h=!(0,c.supportsPopStateOnHashChange)(),f=t.forceRefresh,d=void 0!==f&&f,m=t.getUserConfirmation,y=void 0===m?c.getConfirmation:m,_=t.keyLength,v=void 0===_?6:_,g=t.basename?(0,u.stripTrailingSlash)((0,u.addLeadingSlash)(t.basename)):"",b=function(t){var e=t||{},n=e.key,i=e.state,r=window.location,s=r.pathname+r.search+r.hash;return(0,o.default)(!g||(0,u.hasBasename)(s,g),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+s+'" to begin with "'+g+'".'),g&&(s=(0,u.stripBasename)(s,g)),(0,a.createLocation)(s,i,n)},w=function(){return Math.random().toString(36).substr(2,v)},k=(0,l.default)(),S=function(t){r(L,t),L.length=e.length,k.notifyListeners(L.location,L.action)},x=function(t){(0,c.isExtraneousPopstateEvent)(t)||P(b(t.state))},T=function(){P(b(p()))},O=!1,P=function(t){O?(O=!1,S()):k.confirmTransitionTo(t,"POP",y,function(e){e?S({action:"POP",location:t}):A(t)})},A=function(t){var e=L.location,n=E.indexOf(e.key);-1===n&&(n=0);var i=E.indexOf(t.key);-1===i&&(i=0);var r=n-i;r&&(O=!0,R(r))},C=b(p()),E=[C.key],M=function(t){return g+(0,u.createPath)(t)},R=function(t){e.go(t)},j=0,N=function(t){1===(j+=t)?((0,c.addEventListener)(window,"popstate",x),h&&(0,c.addEventListener)(window,"hashchange",T)):0===j&&((0,c.removeEventListener)(window,"popstate",x),h&&(0,c.removeEventListener)(window,"hashchange",T))},F=!1,L={length:e.length,action:"POP",location:C,createHref:M,push:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"PUSH",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.pushState({key:r,state:a},null,i),d)window.location.href=i;else{var u=E.indexOf(L.location.key),l=E.slice(0,-1===u?0:u+1);l.push(s.key),E=l,S({action:"PUSH",location:s})}else(0,o.default)(void 0===a,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=i}})},replace:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"REPLACE",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.replaceState({key:r,state:a},null,i),d)window.location.replace(i);else{var u=E.indexOf(L.location.key);-1!==u&&(E[u]=s.key),S({action:"REPLACE",location:s})}else(0,o.default)(void 0===a,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(i)}})},go:R,goBack:function(){return R(-1)},goForward:function(){return R(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=k.setPrompt(t);return F||(N(1),F=!0),function(){return F&&(F=!1,N(-1)),e()}},listen:function(t){var e=k.appendListener(t);return N(1),function(){N(-1),e()}}};return L}},function(t,e,n){"use strict";function i(t){return function(e){var n=e.dispatch,i=e.getState;return function(e){return function(r){return"function"==typeof r?r(n,i,t):e(r)}}}}e.__esModule=!0;var r=i();r.withExtraArgument=i,e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){return function(e){return function(n){if(n.type!==i.CALL_HISTORY_METHOD)return e(n);var r=n.payload,o=r.method,s=r.args;t[o].apply(t,function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(s))}}}};var i=n(139)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};e.default=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=n.selectLocationState,a=void 0===s?o:s,u=n.adjustUrlOnReplay,l=void 0===u||u;if(void 0===a(e.getState()))throw new Error("Expected the routing state to be available either as `state.routing` or as the custom expression you can specify as `selectLocationState` in the `syncHistoryWithStore()` options. Ensure you have added the `routerReducer` to your store's reducers via `combineReducers` or whatever method you use to isolate your reducers.");var c=void 0,h=void 0,p=void 0,f=void 0,d=void 0,m=function(t){var n=a(e.getState());return n.locationBeforeTransitions||(t?c:void 0)};if(c=m(),l){var y=function(){var e=m(!0);d!==e&&c!==e&&(h=!0,d=e,t.transitionTo(i({},e,{action:"PUSH"})),h=!1)};p=e.subscribe(y),y()}var _=function(t){h||(d=t,!c&&(c=t,m())||e.dispatch({type:r.LOCATION_CHANGE,payload:t}))};f=t.listen(_),t.getCurrentLocation&&_(t.getCurrentLocation());return i({},t,{listen:function(n){var i=m(!0),r=!1,o=e.subscribe(function(){var t=m(!0);t!==i&&(i=t,r||n(i))});return t.getCurrentLocation||n(i),function(){r=!0,o()}},unsubscribe:function(){l&&p(),f()}})};var r=n(140),o=function(t){return t.routing}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.routerMiddleware=e.routerActions=e.goForward=e.goBack=e.go=e.replace=e.push=e.CALL_HISTORY_METHOD=e.routerReducer=e.LOCATION_CHANGE=e.syncHistoryWithStore=void 0;var i=n(140);Object.defineProperty(e,"LOCATION_CHANGE",{enumerable:!0,get:function(){return i.LOCATION_CHANGE}}),Object.defineProperty(e,"routerReducer",{enumerable:!0,get:function(){return i.routerReducer}});var r=n(139);Object.defineProperty(e,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return r.CALL_HISTORY_METHOD}}),Object.defineProperty(e,"push",{enumerable:!0,get:function(){return r.push}}),Object.defineProperty(e,"replace",{enumerable:!0,get:function(){return r.replace}}),Object.defineProperty(e,"go",{enumerable:!0,get:function(){return r.go}}),Object.defineProperty(e,"goBack",{enumerable:!0,get:function(){return r.goBack}}),Object.defineProperty(e,"goForward",{enumerable:!0,get:function(){return r.goForward}}),Object.defineProperty(e,"routerActions",{enumerable:!0,get:function(){return r.routerActions}});var o=a(n(307)),s=a(n(306));function a(t){return t&&t.__esModule?t:{default:t}}e.syncHistoryWithStore=o.default,e.routerMiddleware=s.default},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";var i=function(t){};t.exports=function(t,e,n,r,o,s,a,u){if(i(e),!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,s,a,u],h=0;(l=new Error(e.replace(/%s/g,function(){return c[h++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";function i(t){return function(){return t}}var r=function(){};r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){"use strict";var i=n(312),r=n(311),o=n(310);t.exports=function(){function t(t,e,n,i,s,a){a!==o&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=i,n.PropTypes=n,n}},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";var i=function(t){};t.exports=function(t,e,n,r,o,s,a,u){if(i(e),!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,s,a,u],h=0;(l=new Error(e.replace(/%s/g,function(){return c[h++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";function i(t){return function(){return t}}var r=function(){};r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){"use strict";var i=n(317),r=n(316),o=n(315);t.exports=function(){function t(t,e,n,i,s,a){a!==o&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=i,n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";var i=function(t){};t.exports=function(t,e,n,r,o,s,a,u){if(i(e),!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,s,a,u],h=0;(l=new Error(e.replace(/%s/g,function(){return c[h++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";function i(t){return function(){return t}}var r=function(){};r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){"use strict";var i=n(321),r=n(320),o=n(319);t.exports=function(){function t(t,e,n,i,s,a){a!==o&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=i,n.PropTypes=n,n}},function(t,e,n){"use strict";var i=n(1),r=n(2),o=n(8),s=n(20),a=(function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(n(14)),p(n(4)),p(n(265))),u=n(11),l=p(n(152)),c=p(n(151)),h=p(n(80));function p(t){return t&&t.__esModule?t:{default:t}}var f=Object.keys(h.default).map(function(t){var e=h.default[t];return(0,i.h)(o.Route,{path:"/"+e.name,component:e.router})}),d=(0,i.h)(r.Provider,{store:s.store},(0,i.h)(a.default.Gate,null,(0,i.h)(o.BrowserRouter,null,(0,i.h)("div",null,(0,i.h)(o.Route,{exact:!0,path:"/system",component:l.default}),(0,i.h)(o.Route,{exact:!0,path:"/dashboard",component:c.default}),(0,i.h)(o.Route,{exact:!0,path:"/browse",component:u.Browser}),(0,i.h)(o.Route,{exact:!0,path:"/logout",component:a.default.Logout}),f,(0,i.h)(o.Route,{exact:!0,path:"/",component:c.default}),(0,i.h)(o.Route,{path:"/",component:u.Header}))),(0,i.h)(u.AudioPlayer,null)));(0,i.render)(d,document.getElementById("container"))},function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(22))}]); +/*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */void 0!==t&&t.exports?t.exports.saveAs=r:null!==n(294)&&null!==n(293)&&(void 0===(i=function(){return r}.call(e,n,e,t))||(t.exports=i))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=e.as_type=function(t,e){return[t,e].join("_").toUpperCase()},r=e.with_type=function(t,e){return e.reduce(function(e,n){return(e[n]=i(t,n))&&e},{})};e.crud_type=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r(t,e.concat(["index_loading","index","index_error","show_loading","show","show_error","create_loading","create","create_error","update_loading","update","update_error","destroy_loading","destroy","destroy_error","upload_loading","upload_progress","upload_waiting","upload_complete","upload_error","sort"]))}},function(t,e,n){"use strict";e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t};var i=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return i(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",i="",r=e.indexOf("#");-1!==r&&(i=e.substr(r),e=e.substr(0,r));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===i?"":i}},e.createPath=function(t){var e=t.pathname,n=t.search,i=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}},function(t,e,n){"use strict";n.r(e);var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every(function(e,i){return t(e,n[i])});var r=void 0===e?"undefined":i(e);if(r!==(void 0===n?"undefined":i(n)))return!1;if("object"===r){var o=e.valueOf(),s=n.valueOf();if(o!==e||s!==n)return t(o,s);var a=Object.keys(e),u=Object.keys(n);return a.length===u.length&&a.every(function(i){return t(e[i],n[i])})}return!1}},function(t,e,n){"use strict";function i(t){return"/"===t.charAt(0)}function r(t,e){for(var n=e,i=n+1,r=t.length;i<r;n+=1,i+=1)t[n]=t[i];t.pop()}n.r(e),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],s=t&&i(t),a=e&&i(e),u=s||a;if(t&&i(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var l=void 0;if(o.length){var c=o[o.length-1];l="."===c||".."===c||""===c}else l=!1;for(var h=0,p=o.length;p>=0;p--){var f=o[p];"."===f?r(o,p):".."===f?(r(o,p),h++):h&&(r(o,p),h--)}if(!u)for(;h--;h)o.unshift("..");!u||""===o[0]||o[0]&&i(o[0])||o.unshift("");var d=o.join("/");return l&&"/"!==d.substr(-1)&&(d+="/"),d}},function(t,e,n){"use strict";(function(t,i){var r,o=n(147);r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:i;var s=Object(o.a)(r);e.a=s}).call(this,n(22),n(314)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=n(8),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(53)),c=n(11);var h=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state={username:"",password:"",password2:""},t.handleChange=t.handleChange.bind(t),t.handleSubmit=t.handleSubmit.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"handleChange",value:function(t,e){this.setState(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},e,t))}},{key:"validate",value:function(){return!(!this.state.password||this.state.password!==this.state.password2)}},{key:"handleSubmit",value:function(t){if(t.preventDefault(),!this.props.auth.loading){if(!this.validate())return this.props.actions.setError("bad password");var e=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(this.state,[]);this.props.actions.signup(e)}}},{key:"render",value:function(){if(this.props.auth.isAuthenticated){var t=this.props.auth.returnTo;return t&&!t.match(/(api|login|logout|signup)/i)||(t="/"),(0,o.h)(u.Redirect,{to:t})}return(0,o.h)("form",{onSubmit:this.handleSubmit},(0,o.h)("h1",null,"New account"),(0,o.h)("br",null),(0,o.h)(c.Group,null,(0,o.h)(c.TextInput,{autofocus:!0,autocapitalize:"off",autocomplete:"off",title:"Username",name:"username",type:"text",value:this.state.username,onInput:this.handleChange}),(0,o.h)(c.TextInput,{title:"Password",name:"password",type:"password",value:this.state.password,onInput:this.handleChange}),(0,o.h)(c.TextInput,{title:"Password again :)",name:"password2",type:"password",value:this.state.password2,onInput:this.handleChange}),(0,o.h)(c.Button,{loading:this.props.auth.loading},"Sign up"),this.renderAuthError()))}},{key:"renderAuthError",value:function(){return this.props.auth.error?(0,o.h)("div",{className:"form-input-hint"},"Please doublecheck the form (o=_o~~)"):(0,o.h)("div",{className:"form-input-hint"})}}]),e}();e.default=(0,a.connect)(function(t){return{auth:t.auth}},function(t){return{actions:(0,s.bindActionCreators)(i({},l),t)}})(h)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=n(8),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(53));var l=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(t){this.props.actions.logout()}},{key:"render",value:function(){return(0,r.h)(a.Redirect,{to:"/"})}}]),e}();e.default=(0,s.connect)(function(t){return{}},function(t){return{actions:(0,o.bindActionCreators)(u,t)}})(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(2);e.default=(0,r.connect)(function(t){return{}},function(t,e){return{}})(function(t){var e=t.fullscreen?"player fullscreen":"player";return t.square&&(e+=" square"),(0,i.h)("div",{className:e},(0,i.h)("canvas",{width:t.width,height:t.height}))})},function(t,e,n){"use strict";var i=n(95);function r(t){i.call(this,t)}n(10).inherits(r,i),r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(10);function r(t){this.data=t,this.length=t.length,this.index=0,this.zero=0}r.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(t){},readInt:function(t){var e,n=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},t.exports=r},function(t,e,n){"use strict";var i=n(94);function r(t){i.call(this,t);for(var e=0;e<this.data.length;e++)t[e]=255&t[e]}n(10).inherits(r,i),r.prototype.byteAt=function(t){return this.data[this.zero+t]},r.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.length-4;o>=0;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===i&&this.data[o+3]===r)return o-this.zero;return-1},r.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&n===o[1]&&i===o[2]&&r===o[3]},r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(10),r=n(24),o=n(95),s=n(173),a=n(172),u=n(93);t.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||r.uint8array?"nodebuffer"===e?new a(t):r.uint8array?new u(i.transformTo("uint8array",t)):new o(i.transformTo("array",t)):new s(t)}},function(t,e,n){"use strict";e.LOCAL_FILE_HEADER="PK",e.CENTRAL_FILE_HEADER="PK",e.CENTRAL_DIRECTORY_END="PK",e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",e.ZIP64_CENTRAL_DIRECTORY_END="PK",e.DATA_DESCRIPTOR="PK\b"},function(t,e,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,n){"use strict";var i=n(23),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new i.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",s=0;s<e;s++)n+=String.fromCharCode(t[s]);return n}s[254]=s[254]=1,e.string2buf=function(t){var e,n,r,o,s,a=t.length,u=0;for(o=0;o<a;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),u+=n<128?1:n<2048?2:n<65536?3:4;for(e=new i.Buf8(u),s=0,o=0;s<u;o++)55296==(64512&(n=t.charCodeAt(o)))&&o+1<a&&56320==(64512&(r=t.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?e[s++]=n:n<2048?(e[s++]=192|n>>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},e.buf2binstring=function(t){return u(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n<r;n++)e[n]=t.charCodeAt(n);return e},e.buf2string=function(t,e){var n,i,r,o,a=e||t.length,l=new Array(2*a);for(i=0,n=0;n<a;)if((r=t[n++])<128)l[i++]=r;else if((o=s[r])>4)l[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n<a;)r=r<<6|63&t[n++],o--;o>1?l[i++]=65533:r<65536?l[i++]=r:(r-=65536,l[i++]=55296|r>>10&1023,l[i++]=56320|1023&r)}return u(l,i)},e.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0?e:0===n?e:n+s[t[n]]>e?n:e}},function(t,e,n){"use strict";var i=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();t.exports=function(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a<s;a++)t=t>>>8^o[255&(t^e[a])];return-1^t}},function(t,e,n){"use strict";t.exports=function(t,e,n,i){for(var r=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{o=o+(r=r+e[i++]|0)|0}while(--s);r%=65521,o%=65521}return r|o<<16|0}},function(t,e,n){"use strict";var i=n(16);e.STORE={magic:"\0\0",compressWorker:function(t){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},e.DEFLATE=n(187)},function(t,e,n){"use strict";var i=n(16),r=n(69);function o(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n(10).inherits(o,i),o.prototype.processChunk=function(t){this.streamInfo.crc32=r(t.data,this.streamInfo.crc32||0),this.push(t)},t.exports=o},function(t,e,n){"use strict";var i=n(10),r=n(16);function o(t){r.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(o,r),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}r.prototype.processChunk.call(this,t)},t.exports=o},function(t,e,n){"use strict";var i=n(10),r=n(16);function o(t){r.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}i.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},function(t,e,n){"use strict";e.base64=!1,e.binary=!1,e.dir=!1,e.createFolders=!0,e.date=null,e.compression=null,e.compressionOptions=null,e.comment=null,e.unixPermissions=null,e.dosPermissions=null},function(t,e,n){"use strict";(function(e){var i=n(10),r=n(191),o=n(16),s=n(113),a=n(24),u=n(45),l=null;if(a.nodestream)try{l=n(190)}catch(t){}function c(t,n){return new u.Promise(function(r,o){var a=[],u=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",function(t,e){a.push(t),n&&n(e)}).on("error",function(t){a=[],o(t)}).on("end",function(){try{var t=function(t,e,n){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),n);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(l,function(t,n){var i,r=0,o=null,s=0;for(i=0;i<n.length;i++)s+=n[i].length;switch(t){case"string":return n.join("");case"array":return Array.prototype.concat.apply([],n);case"uint8array":for(o=new Uint8Array(s),i=0;i<n.length;i++)o.set(n[i],r),r+=n[i].length;return o;case"nodebuffer":return e.concat(n);default:throw new Error("concat : unsupported type '"+t+"'")}}(u,a),c);r(t)}catch(t){o(t)}a=[]}).resume()})}function h(t,e,n){var s=e;switch(e){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=e,this._mimeType=n,i.checkSupport(s),this._worker=t.pipe(new r(s)),t.lock()}catch(t){this._worker=new o("error"),this._worker.error(t)}}h.prototype={accumulate:function(t){return c(this,t)},on:function(t,e){var n=this;return"data"===t?this._worker.on(t,function(t){e.call(n,t.data,t.meta)}):this._worker.on(t,function(){i.delay(e,arguments,n)}),this},resume:function(){return i.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(t){if(i.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new l(this,{objectMode:"nodebuffer"!==this._outputType},t)}},t.exports=h}).call(this,n(47).Buffer)},function(t,e,n){var i=n(72),r=n(56).document,o=i(r)&&i(r.createElement);t.exports=function(t){return o?r.createElement(t):{}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,n){var i=n(204);t.exports=function(t,e,n){if(i(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,i){return t.call(e,n,i)};case 3:return function(n,i,r){return t.call(e,n,i,r)}}return function(){return t.apply(e,arguments)}}},function(t,e){var n=t.exports={version:"2.3.0"};"number"==typeof __e&&(__e=n)},function(t,e,n){"use strict";var i=n(10),r=n(24),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.encode=function(t){for(var e,n,r,s,a,u,l,c=[],h=0,p=t.length,f=p,d="string"!==i.getTypeOf(t);h<t.length;)f=p-h,d?(e=t[h++],n=h<p?t[h++]:0,r=h<p?t[h++]:0):(e=t.charCodeAt(h++),n=h<p?t.charCodeAt(h++):0,r=h<p?t.charCodeAt(h++):0),s=e>>2,a=(3&e)<<4|n>>4,u=f>1?(15&n)<<2|r>>6:64,l=f>2?63&r:64,c.push(o.charAt(s)+o.charAt(a)+o.charAt(u)+o.charAt(l));return c.join("")},e.decode=function(t){var e,n,i,s,a,u,l=0,c=0;if("data:"===t.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var h,p=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&p--,t.charAt(t.length-2)===o.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=r.uint8array?new Uint8Array(0|p):new Array(0|p);l<t.length;)e=o.indexOf(t.charAt(l++))<<2|(s=o.indexOf(t.charAt(l++)))>>4,n=(15&s)<<4|(a=o.indexOf(t.charAt(l++)))>>2,i=(3&a)<<6|(u=o.indexOf(t.charAt(l++))),h[c++]=e,64!==a&&(h[c++]=n),64!==u&&(h[c++]=i);return h}},function(t,e,n){"use strict";t.exports=o;var i=n(26),r=n(46);function o(t){if(!(this instanceof o))return new o(t);i.call(this,t),this._transformState={afterTransform:function(t,e){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),i(t);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",s)}function s(){var t=this;"function"==typeof this._flush?this._flush(function(e,n){a(t,e,n)}):a(this,null,null)}function a(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(t._transformState.transforming)throw new Error("Calling transform done when still transforming");return t.push(null)}r.inherits=n(30),r.inherits(o,i),o.prototype.push=function(t,e){return this._transformState.needTransform=!1,i.prototype.push.call(this,t,e)},o.prototype._transform=function(t,e,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(t,e,n){var i=this._transformState;if(i.writecb=n,i.writechunk=t,i.writeencoding=e,!i.transforming){var r=this._readableState;(i.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},o.prototype._read=function(t){var e=this._transformState;null!==e.writechunk&&e.writecb&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0},o.prototype._destroy=function(t,e){var n=this;i.prototype._destroy.call(this,t,function(t){e(t),n.emit("close")})}},function(t,e,n){"use strict";var i=n(58).Buffer,r=i.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(i.isEncoding===r||!r(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=l,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=c,this.end=h,e=3;break;default:return this.write=p,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=i.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function c(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},o.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},o.prototype.text=function(t,e){var n=function(t,e,n){var i=e.length-1;if(i<n)return 0;var r=s(e[i]);if(r>=0)return r>0&&(t.lastNeed=r-1),r;if(--i<n||-2===r)return 0;if((r=s(e[i]))>=0)return r>0&&(t.lastNeed=r-2),r;if(--i<n||-2===r)return 0;if((r=s(e[i]))>=0)return r>0&&(2===r?r=0:t.lastNeed=r-3),r;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";var i=n(59);function r(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||i.nextTick(r,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(i.nextTick(r,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){t.exports=n(75).EventEmitter},function(t,e,n){"use strict";(function(e,i){var r=n(59);t.exports=g;var o,s=n(120);g.ReadableState=v;n(75).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=n(117),l=n(58).Buffer,c=e.Uint8Array||function(){};var h=n(46);h.inherits=n(30);var p=n(218),f=void 0;f=p&&p.debuglog?p.debuglog("stream"):function(){};var d,m=n(217),y=n(116);h.inherits(g,u);var _=["error","close","destroy","pause","resume"];function v(t,e){o=o||n(26),t=t||{};var i=e instanceof o;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=n(115).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function g(t){if(o=o||n(26),!(this instanceof g))return new g(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function b(t,e,n,i,r){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,x(t)}(t,s)):(r||(o=function(t,e){var n;i=e,l.isBuffer(i)||i instanceof c||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var i;return n}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?w(t,s,e,!1):O(t,s)):w(t,s,e,!1))):i||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.length<t.highWaterMark||0===t.length)}(s)}function w(t,e,n,i){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,i?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&x(t)),O(t,e)}Object.defineProperty(g.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),g.prototype.destroy=y.destroy,g.prototype._undestroy=y.undestroy,g.prototype._destroy=function(t,e){this.push(null),e(t)},g.prototype.push=function(t,e){var n,i=this._readableState;return i.objectMode?n=!0:"string"==typeof t&&((e=e||i.defaultEncoding)!==i.encoding&&(t=l.from(t,e),e=""),n=!0),b(this,t,e,!1,n)},g.prototype.unshift=function(t){return b(this,t,null,!0,!1)},g.prototype.isPaused=function(){return!1===this._readableState.flowing},g.prototype.setEncoding=function(t){return d||(d=n(115).StringDecoder),this._readableState.decoder=new d(t),this._readableState.encoding=t,this};var k=8388608;function S(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function x(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(T,t):T(t))}function T(t){f("emit readable"),t.emit("readable"),E(t)}function O(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(P,t,e))}function P(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length<e.highWaterMark&&(f("maybeReadMore read 0"),t.read(0),n!==e.length);)n=e.length;e.readingMore=!1}function A(t){f("readable nexttick read 0"),t.read(0)}function C(t,e){e.reading||(f("resume read 0"),t.read(0)),e.resumeScheduled=!1,e.awaitDrain=0,t.emit("resume"),E(t),e.flowing&&!e.reading&&t.read(0)}function E(t){var e=t._readableState;for(f("flow",e.flowing);e.flowing&&null!==t.read(););}function M(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var i;t<e.head.data.length?(i=e.head.data.slice(0,t),e.head.data=e.head.data.slice(t)):i=t===e.head.data.length?e.shift():n?function(t,e){var n=e.head,i=1,r=n.data;t-=r.length;for(;n=n.next;){var o=n.data,s=t>o.length?o.length:t;if(s===o.length?r+=o:r+=o.slice(0,t),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e):function(t,e){var n=l.allocUnsafe(t),i=e.head,r=1;i.data.copy(n),t-=i.data.length;for(;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++r}return e.length-=r,n}(t,e);return i}(t,e.buffer,e.decoder),n);var n}function R(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,r.nextTick(j,e,t))}function j(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function N(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1}g.prototype.read=function(t){f("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?R(this):x(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&R(this),null;var i,r=e.needReadable;return f("need readable",r),(0===e.length||e.length-t<e.highWaterMark)&&f("length less than watermark",r=!0),e.ended||e.reading?f("reading or ended",r=!1):r&&(f("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=S(n,e))),null===(i=t>0?M(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&R(this)),null!==i&&this.emit("data",i),i},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?c:g;function l(e,i){f("onunpipe"),e===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,f("cleanup"),t.removeListener("close",_),t.removeListener("finish",v),t.removeListener("drain",h),t.removeListener("error",y),t.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",m),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){f("onend"),t.end()}o.endEmitted?r.nextTick(u):n.once("end",u),t.on("unpipe",l);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,E(t))}}(n);t.on("drain",h);var p=!1;var d=!1;function m(e){f("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==N(o.pipes,t))&&!p&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function y(e){f("onerror",e),g(),t.removeListener("error",y),0===a(t,"error")&&t.emit("error",e)}function _(){t.removeListener("finish",v),g()}function v(){f("onfinish"),t.removeListener("close",_),g()}function g(){f("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",y),t.once("close",_),t.once("finish",v),t.emit("pipe",n),o.flowing||(f("pipe resume"),n.resume()),t},g.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<r;o++)i[o].emit("unpipe",this,n);return this}var s=N(e.pipes,t);return-1===s?this:(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},g.prototype.on=function(t,e){var n=u.prototype.on.call(this,t,e);if("data"===t)!1!==this._readableState.flowing&&this.resume();else if("readable"===t){var i=this._readableState;i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.emittedReadable=!1,i.reading?i.length&&x(this):r.nextTick(A,this))}return n},g.prototype.addListener=g.prototype.on,g.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!0,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(C,t,e))}(this,t)),this},g.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this},g.prototype.wrap=function(t){var e=this,n=this._readableState,i=!1;for(var r in t.on("end",function(){if(f("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(r){(f("wrapped data"),n.decoder&&(r=n.decoder.write(r)),!n.objectMode||null!==r&&void 0!==r)&&((n.objectMode||r&&r.length)&&(e.push(r)||(i=!0,t.pause())))}),t)void 0===this[r]&&"function"==typeof t[r]&&(this[r]=function(e){return function(){return t[e].apply(t,arguments)}}(r));for(var o=0;o<_.length;o++)t.on(_[o],this.emit.bind(this,_[o]));return this._read=function(e){f("wrapped _read",e),i&&(i=!1,t.resume())},this},Object.defineProperty(g.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),g._fromList=M}).call(this,n(22),n(43))},function(t,e,n){t.exports=n(219)},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.train_task=e.live_task=e.fetch_task=void 0;r(n(15)),r(n(14)),r(n(6));var i=r(n(7));function r(t){return t&&t.__esModule?t:{default:t}}e.fetch_task=function(t,e,n){return function(r){if(!t)return console.log("input file inaccessible (no url)");var o={module:"pix2pix",activity:"fetch",dataset:n,opt:{url:t,file_id:e,dataset:n}};return i.default.queue.add_task(o)}},e.live_task=function(t,e){return function(n){var r={module:"pix2pix",activity:"live",dataset:t,checkpoint:e,opt:{poll_delay:.09}};return console.log(r),console.log("add live task"),i.default.queue.add_task(r)}},e.train_task=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return function(r){var o={module:"pix2pix",activity:"train",dataset:t.name,epoch:0,epochs:n,opt:{folder_id:e,load_size:264}};return console.log(o),i.default.queue.add_task(o)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"morph",displayName:"Morph",datatype:"video"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.progress;if(!e)return;for(var n=e.i,r=e.n,o=[],s=0;s<r;s++)o.push((0,i.h)("div",{key:s,className:s<n?"x":"o"}));return(0,i.h)("div",{className:"progress"},o)};var i=n(1)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();e.default=function(t){var e=t.db,n=t.path,c=t.emptyText,h=t.activity;if(!e)return null;if(e.loading||!e.data)return(0,r.h)("div",{className:"col folderList"},(0,r.h)(l.default,{progress:e.progress}));var p=e.data.folders;h&&(p=p.filter(function(t){return t.activity===h}));if(!p.length&&c)return(0,r.h)("div",{className:"col folderList"},c);console.log(f);var f=p.map(function(t){var a=e.data.folderLookup[t.id],l=a.files?a.files.length:0,c=s.default.hush_null(l),h=i(c,2),p=h[0];h[1];return(0,r.h)(u.default,{title:(0,r.h)(o.Link,{to:n+a.id+"/"},a.name)},(0,r.h)("span",{className:p},l," file",s.default.courtesy_s(l)))});return(0,r.h)("div",{className:"col folderList"},(0,r.h)(a.default,{title:"Projects"},f))};var r=n(1),o=(n(3),n(2),n(8)),s=c(n(4)),a=c(n(25)),u=c(n(39)),l=c(n(17));function c(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1);var o=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleChange",value:function(t){var e=this;this.props.onChange&&this.props.onChange(),t.stopPropagation(),t.preventDefault(),this.setState({thumbnails:[],images:[]});var n=t.dataTransfer?t.dataTransfer.files:t.target.files,i=[],r=void 0;for(r=0;r<n.length;r++)i.push(n[r]);i.map(function(t){return function(n,i){e.props.onUpload(t,t.name).then(n).catch(i)}}).reduce(function(t,e){return t.then(e)},Promise.resolve())}},{key:"render",value:function(){return(0,r.h)("div",{className:"fileUpload param"},(0,r.h)("label",null,(0,r.h)("span",null,this.props.title),(0,r.h)("input",{type:"file",accept:this.props.accept||"*/*",multiple:this.props.multiple,onChange:this.handleChange}),(0,r.h)("button",null,this.props.label||"Choose file...")))}}]),e}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.actions=e.parser=e.util=void 0;var i,r=n(260),o=n(4),s=(i=o)&&i.__esModule?i:{default:i},a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(258));e.util=s.default,e.parser=a;e.actions=["folder","file","dataset","task","user"].reduce(function(t,e){return(t[e]=(0,r.crud_actions)(e))&&t},{})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1);function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var s=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,s=Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=i=o(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(s))),i.state={x:0,y:0},o(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this,e=this.state,n=e.x,i=e.y,o=this.props,s=o.x,a=o.y,u=o.max,l=void 0===u?1/0:u,c=o.onClick,h=o.onHover;return(0,r.h)("table",{className:"buttonGrid"},(0,r.h)("tr",{className:"row"},(0,r.h)("th",null," "),s.map(function(t){return(0,r.h)("th",{className:t===n&&"bold"},t)})),a.map(function(e){return(0,r.h)("tr",{className:"row"},(0,r.h)("th",{className:e===i&&"bold"},e),s.map(function(n){return(0,r.h)("td",null,n*e>l?" ":(0,r.h)("button",{onClick:function(){return c(n,e)},onMouseEnter:function(){t.setState({x:n,y:e}),h(n,e)}}," "))}))}))}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(n(8),function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(53))),u=n(11);function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var c=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state={username:"",password:""},t.handleChange=t.handleChange.bind(t),t.handleSubmit=t.handleSubmit.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleChange",value:function(t,e){var n;this.setState((l(n={},e,t),l(n,"error",null),n))}},{key:"handleSubmit",value:function(t){t.preventDefault(),this.props.auth.loading||this.props.actions.login(this.state.username,this.state.password)}},{key:"render",value:function(){return(0,r.h)("form",{onSubmit:this.handleSubmit},(0,r.h)("h1",null,"Log in"),(0,r.h)("br",null),(0,r.h)(u.Group,null,(0,r.h)(u.TextInput,{autofocus:!0,autocapitalize:"off",autocomplete:"off",title:"Username",name:"username",type:"text",value:this.state.username,onInput:this.handleChange}),(0,r.h)(u.TextInput,{title:"Password",name:"password",type:"password",value:this.state.password,onInput:this.handleChange}),(0,r.h)(u.Button,{loading:this.props.auth.loading},"Login"),this.renderAuthError()))}},{key:"renderAuthError",value:function(){return this.props.auth.error?(0,r.h)("div",{className:"form-input-hint"},"There was an error logging you in (bad password?)"):null}}]),e}();e.default=(0,s.connect)(function(t){return{auth:t.auth}},function(t){return{actions:(0,o.bindActionCreators)(a,t)}})(c)},function(t,e){t.exports=e=window.fetch,e.default=window.fetch.bind(window),e.Headers=window.Headers,e.Request=window.Request,e.Response=window.Response},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.destroy=void 0,e.crud_fetch=function(t,e){var n="/api/"+t+"/"+(e||"");return{index:function(t){return(0,o.default)(function(t,e){var n=new URL(window.location.origin+t);e&&Object.keys(e).forEach(function(t){return n.searchParams.append(t,e[t])});return n}(n,t),{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}).then(function(t){return t.json()}).catch(c)},show:function(t){return(0,o.default)(n+t,{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}},{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}).then(function(t){return t.json()}).catch(c)},create:function(t){return(0,o.default)(n,a(t)).then(function(t){return t.json()}).catch(c)},update:function(t){return(0,o.default)(n+t.id,u(t)).then(function(t){return t.json()}).catch(c)},destroy:function(t){return(0,o.default)(n+t.id,l(t)).then(function(t){return t.json()}).catch(c)}}},e._get_headers=s,e.post=a,e.postBody=function(t){return{method:"POST",body:t,credentials:"same-origin",headers:{Accept:"application/json"}}},e.put=u;var i,r=n(129),o=(i=r)&&i.__esModule?i:{default:i};function s(){return{method:"GET",credentials:"same-origin",headers:{Accept:"application/json"}}}function a(t){return{method:"POST",body:JSON.stringify(t),credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}}function u(t){return{method:"PUT",body:JSON.stringify(t),credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}}function l(t){return{method:"DELETE",body:JSON.stringify(t),credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}}}function c(t){console.warn(t)}e.destroy=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a(n(54)),r=n(4),o=n(271),s=a(n(268));function a(t){return t&&t.__esModule?t:{default:t}}var u=512,l=u/4,c=new s.default(u);function h(t,e){var n=t.length,i=0,r=void 0;for(r=0;r<e;r++)i=r/e,i*=i,t[r]*=i,t[n-r]*=i}function p(t){var e=t.data,n=t.fft_size,i=t.sr,r=t.fft_overlap,o=e.length,s=new Array(o),a=void 0;for(a=0;a<o;a++)s[a]=e[a].concat(),s[a][2]=0;return{data:s,fft_size:n,sr:i,fft_overlap:r}}function f(t,e){var n=p(t),i=t.data,r=t.sr,o=t.fft_size,s=t.fft_overlap,a=i.length,u=n.data,l=void 0,c=void 0,h=void 0,f=void 0;for(c=e.length;c<o;c++)e[c]=c;for(l=0;l<a;l++){for(h=i[l],f=u[l]=i[l].concat(),h[0]=0,h[2]=0,h[4]=0,c=0;c<o/2;c++)f[2*c]=h[2*e[c]],f[2*c+1]=h[2*e[c]+1];for(;c<o;c++)f[2*c]=0,f[2*c+1]=0}return{data:u,sr:r,fft_size:o,fft_overlap:s}}e.default={fft_size:u,fft_overlap:l,toSpectrum:function(t,e){e=e||44100;var n=o.windows.construct("ham",u),i=new Array(u),r=t.length,s=Math.ceil(r/u)*u,a=void 0,h=void 0,p=void 0,f=[];for(a=-u;a<s;a+=l){for(h=0;h<u;h++)i[h]=t[a+h]*n[h]||0;p=c.createComplexArray(),c.realTransform(p,i),c.completeSpectrum(p),f.push(p)}return{data:f,sr:e,fft_size:u,fft_overlap:l}},fromSpectrum:function(t){var e=t.data,n=t.sr,r=t.fft_size,s=t.fft_overlap,a=e.length,u=o.windows.construct("ham",r),l=c.createComplexArray(),p=s*a,f=i.default.context.createBuffer(1,p,n),d=f.getChannelData(0),m=void 0,y=void 0,_=void 0,v=void 0;for(m=0;m<a;m++)for(v=e[m],c.inverseTransform(l,v),_=m*s,y=0;y<r;y++)d[_+y]+=l[2*y]*u[y]||0;return h(d,r),f},fromImageData:function(t,e,n,i){var r=t.data,o=t.width,s=t.height,a=new Array(o),c=void 0,h=void 0,p=void 0,f=void 0,d=void 0;for(h=0;h<s;h++){var m=a[h]=new Float32Array(4*s);for(c=0;c<o;c++)p=4*(c*o+h),m[f=2*c]=(r[p]/255-.5)*n,m[f+1]=(r[p+1]/255-.5)*i,m[d=2*(s-h+s)]=m[f],m[d+1]=0;m[2*s]=m[2*s+1]=m[2*s-1]=m[2*s-2]=0}return{data:a,sr:e,fft_size:u,fft_overlap:l}},binToHz:function(t,e){return e/t.fft_size*t.sr},fadeInOut:h,cloneSpectrum:p,reverseSpectrum:function(t){var e=p(t);return e.data=e.data.reverse(),e},shuffleSpectrum:function(t){var e=t.fft_size,n=new Array(e),i=void 0;for(i=0;i<e;i++)n[i]=i;return(0,r.shuffle)(n),f(t,n)},invertSpectrum:function(t){var e=t.fft_size,n=new Array(e),i=void 0;for(i=0;i<e;i++)n[i]=e-i-1;return f(t,n)},rotateSpectrum:function(t,e){var n=t.fft_size;e&&e<1&&(e-=.5,e*=n),e=Math.floor(e);var i=new Array(n),o=void 0;for(o=0;o<n;o++)i[o]=(0,r.mod)(o+e,n/2);return f(t,i)},reorderBins:f,linearBins:function(t,e){e=e||1;var n=[],i=void 0,o=void 0;for(o=0;o<e;o++)n[o]=[];var s=Math.floor(t.fft_size/e),a=(0,r.quantize)(t.fft_size,e);for(i=0;i<a;i++)n[o=Math.floor(i/s)]=n[o]||[],n[o].push(i);for(;i<t.fft_size;i++)n[o].push(i);return n},logarithmicBins:function(t){var e=[],n=void 0,i=void 0,r=void 0,o=Math.log2(t.fft_size)-1;for(n=0,r=0,i=0;n<o;n++)for(i+=1<<n,e[n]=[];r<i;r++)e[n].push(r);return e},concatBins:function(t){return t.reduce(function(t,e){return t.concat(e)},[])},reverseBins:function(t){return t.map(function(t){return t.reverse()})},minBins:function(t){return t.map(function(t){var e=t[0];return t.map(function(){return e})})},maxBins:function(t){return t.map(function(t){var e=t[t.length-1];return t.map(function(){return e})})},rotatePhase:function(t,e){var n=t.data,i=t.fft_size,r=void 0,o=void 0,s=void 0,a=n.length;for(r=0;r<a;r++)for(s=n[r],o=0;o<i;o++)s[2*o+1]+=e;return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(54),o=(i=r)&&i.__esModule?i:{default:i};var s=new o.default.Compressor(-30,3).toMaster(),a=new o.default.Gain(1).connect(s);e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.spectrum=function(t,e,n,i,r){var o=t.data,c=(t.fft_size,t.fft_size/2),h=o.length;s.width=o.length,s.height=c;var p=ctx.createImageData(s.width,s.height),f=p.data,d=void 0,m=void 0,y=void 0,_=void 0,v=void 0,g=void 0,b=void 0,w=void 0;for(d=0;d<h;d++)for(b=o[d],m=0;m<c;m++)y=4*((c-m)*h+d),v=b[_=2*m],g=mod(b[_+1],2*Math.PI)/(2*Math.PI),w=color.hsl2rgb((g+1)/2,1,1-Math.abs(v/10)),f[y]=w[0],f[y+1]=w[1],f[y+2]=w[2],f[y+3]=255;a.putImageData(p,0,0);var k=t.fft_overlap*h;e=e*devicePixelRatio||0,n=n*devicePixelRatio||Math.floor(l/4),i=i*devicePixelRatio||u,r=r*devicePixelRatio||l/4;var S=Math.round(k/t.sr*pixels_per_second),x=Math.floor(r);ctx.save(),clear(1,e,n,u,x),ctx.drawImage(s,e,n,S,x),ctx.restore()},e.raw_spectrum=function(t,e,n,i,r,s,a){var u=t.data,l=(t.fft_size,t.fft_size/2),c=u.length,h=document.createElement("canvas"),p=h.getContext("2d-lodpi");h.width=u.length,h.height=l;var f=p.createImageData(h.width,h.height),d=f.data,m=void 0,y=void 0,_=void 0,v=void 0,g=void 0,b=void 0,w=void 0,k=-s,S=-a,x=s-k,T=a-S,O=0,P=0,A=void 0,C=void 0;for(m=0;m<c;m++){for(w=u[m],O=0,P=0,y=0;y<l;y++)_=4*(y*c+m),A=w[v=2*y],C=w[v+1],O+=A,P+=C,g=o.default.clamp((A-k)/x*255,0,255),b=o.default.clamp((C-S)/T*255,0,255),d[_+0]=g,d[_+1]=b,d[_+2]=127,d[_+3]=255;O/=l,P/=l}return c,c,p.putImageData(f,0,0),{canvas:h,imageData:f}};var i,r=n(4),o=(i=r)&&i.__esModule?i:{default:i};var s=document.createElement("canvas"),a=s.getContext("2d-lodpi"),u=256,l=256},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.play=function(t){var e=o.default.fromImageData(t.imageData,44100,a,u),n=o.default.fromSpectrum(e),s=new i.default.Player(n);s.connect(r.default),s.start(i.default.now())};s(n(6));var i=s(n(54)),r=(function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(n(133)),s(n(132))),o=s(n(131));function s(t){return t&&t.__esModule?t:{default:t}}var a=8,u=8},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.syscall_async=e.thumbnail=e.read_file=e.upload_file=e.run_script=e.list_sequences=e.count_directory=e.list_directory=e.disk_usage=e.run_system_command=void 0;var i,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=n(15),s=(i=o)&&i.__esModule?i:{default:i},a=n(41);e.run_system_command=function(t){return u("run_system_command",t)},e.disk_usage=function(t){return u("run_system_command",r({cmd:"du"},t))},e.list_directory=function(t){return u("list_directory",t).then(function(t){return t.files})},e.count_directory=function(t){return u("count_directory",t).then(function(t){return t.count})},e.list_sequences=function(t){return u("list_sequences",t).then(function(t){return t.sequences})},e.run_script=function(t){return u("run_script",t)},e.upload_file=function(t){return u("upload_file",t)},e.read_file=function(t){return u("read_file",t).then(function(t){return t.file})},e.thumbnail=function(t){return u("thumbnail",t).then(function(t){return t.file})};var u=e.syscall_async=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e4;return n=e.ttl||n,new Promise(function(i,r){var o=(0,s.default)(),u=setTimeout(function(){a.socket.off("system_res",l),r("timeout")},n),l=function t(e){e.uuid&&e.uuid===o&&(clearTimeout(u),a.socket.off("system_res",t),i(e))};a.socket.emit("system",{cmd:t,payload:e,uuid:o}),a.socket.on("system_res",l)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.frameTimestamp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=o(((t/=i)%60).toFixed(1));if((t=Math.floor(t/60))>60)return Math.floor(t/60)+":"+o(t%60)+":"+e;return t%60+":"+e},e.timeInSeconds=function(t){return(t/10).toFixed(1)+" s."},e.gerund=function(t){return t.replace(/e?$/,"ing")},e.commatize=r,e.carbon_date=function(t,e){var n,i=(+new Date-new Date(t))/1e3;n=!e&&i<86400?"new":i<604800?"recent":i<1209600?"med":i<3024e3?"old":i<12315200?"older":"quiet";return n},e.carbon_time=function(t,e){var n,i=(+new Date-new Date(t))/1e3;n=!e&&i<3600?"new":i<10800?"recent":i<43200?"med":i<86400?"old":i<172800?"older":"quiet";return n},e.hush_views=function(t,e,n){var i=r(t,1e3);if(e=e||1,(t=t||0)<30)return["quiet",t+" v."];return t<200?["quiet",i+" v."]:t<500?["quiet",i+" v."]:t<1e3?["old",i+" v."]:t<5e3?["med",i+" kv."]:n||t<1e4?["recent",i+" kv."]:["new",i+" kv."]},e.hush_threads=function(t,e,n){var i=r(t,1e3);return e=e||1,(t=t||0)<10?["quiet",t+" t."]:t<25?["old",i+" t."]:t<50?["med",i+" t."]:n||t<100?["recent",i+" t."]:["new",i+" t."]},e.hush_size=function(t,e,n){var i=r(Math.round(t/1024));if(e=1,!(t=t||0))return["",""];if(t<1e3)return["quiet",t+" b."];if(t<1e6)return["quiet",i+" kb."];if(t<2e7/e)return["quiet",i+" mb."];if(t<5e7/e)return["old",i+" mb."];if(t<8e7/e)return["med",i+" mb."];if(n||t<17e7/e)return["recent",i+" mb."];return["new",i+" mb."]},e.hush_null=function(t,e,n){var i=e?t+" "+e+".":t;return t<3?["quiet",i]:t<6?["older",i]:t<10?["old",i]:t<16?["med",i]:n||t<21?["recent",i]:["new",i]},e.get_age=function(t){var e,n=Math.abs(+Date.now()-new Date(t))/1e3,i=Math.floor;if(n<5)return"now";if(n<60)return i(n)+"s";if((n/=60)<60)return i(n)+"m";if(e=i(n%60),n/=60,e>0&&n<2)return i(n)+"h"+e+"m";if(n<24)return i(n)+"h";if((n/=24)<7)return i(n)+"d";if((n/=7)<12)return i(n)+"w";if((n/=4)<12)return i(n)+"m";return i(n/=12)+"y"},e.courtesy_s=function(t,e){return 1==t?"":e||"s"},e.pad=o;var i=25;function r(t,e){e=e||1024;var n,i=[],r=0,o=Math.floor;t>e&&(t/=e,i.unshift(o(10*t%10)),i.unshift("."));do{n=t%10,!(t=o(t/10))||++r%3||(n=" "+o(n)),i.unshift(o(n))}while(t);return i.join("")}function o(t,e){return t<10?"0"+t:t}},function(t,e,n){"use strict";e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t};var i=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return i(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",i="",r=e.indexOf("#");-1!==r&&(i=e.substr(r),e=e.substr(0,r));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===i?"":i}},e.createPath=function(t){var e=t.pathname,n=t.search,i=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=e.CALL_HISTORY_METHOD="@@router/CALL_HISTORY_METHOD";function r(t){return function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return{type:i,payload:{method:t,args:n}}}}var o=e.push=r("push"),s=e.replace=r("replace"),a=e.go=r("go"),u=e.goBack=r("goBack"),l=e.goForward=r("goForward");e.routerActions={push:o,replace:s,go:a,goBack:u,goForward:l}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};e.routerReducer=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.type,s=e.payload;if(n===r)return i({},t,{locationBeforeTransitions:s});return t};var r=e.LOCATION_CHANGE="@@router/LOCATION_CHANGE",o={locationBeforeTransitions:null}},function(t,e,n){"use strict";e.__esModule=!0;e.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),e.addEventListener=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},e.getConfirmation=function(t,e){return e(window.confirm(t))},e.supportsHistory=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},e.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},e.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},e.isExtraneousPopstateEvent=function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")}},function(t,e,n){"use strict";e.__esModule=!0;var i,r=n(9),o=(i=r)&&i.__esModule?i:{default:i};e.default=function(){var t=null,e=[];return{setPrompt:function(e){return(0,o.default)(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,i,r){if(null!=t){var s="function"==typeof t?t(e,n):t;"string"==typeof s?"function"==typeof i?i(s,r):((0,o.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),r(!0)):r(!1!==s)}else r(!0)},appendListener:function(t){var n=!0,i=function(){n&&t.apply(void 0,arguments)};return e.push(i),function(){n=!1,e=e.filter(function(t){return t!==i})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];e.forEach(function(t){return t.apply(void 0,n)})}}}},function(t,e,n){"use strict";e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=a(n(88)),o=a(n(87)),s=n(86);function a(t){return t&&t.__esModule?t:{default:t}}e.createLocation=function(t,e,n,o){var a=void 0;"string"==typeof t?(a=(0,s.parsePath)(t)).state=e:(void 0===(a=i({},t)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==e&&void 0===a.state&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=(0,r.default)(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,o.default)(t.state,e.state)}},function(t,e,n){t.exports=function(){"use strict";var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,i=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,o=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,a=s&&s(Object);return function u(l,c,h){if("string"!=typeof c){if(a){var p=s(c);p&&p!==a&&u(l,p,h)}var f=i(c);r&&(f=f.concat(r(c)));for(var d=0;d<f.length;++d){var m=f[d];if(!(t[m]||e[m]||h&&h[m])){var y=o(c,m);try{n(l,m,y)}catch(t){}}}return l}return l}}()},function(t,e,n){"use strict";e.__esModule=!0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=c(n(9)),o=c(n(12)),s=n(143),a=n(86),u=c(n(142)),l=n(141);function c(t){return t&&t.__esModule?t:{default:t}}var h={hashbang:{encodePath:function(t){return"!"===t.charAt(0)?t:"!/"+(0,a.stripLeadingSlash)(t)},decodePath:function(t){return"!"===t.charAt(0)?t.substr(1):t}},noslash:{encodePath:a.stripLeadingSlash,decodePath:a.addLeadingSlash},slash:{encodePath:a.addLeadingSlash,decodePath:a.addLeadingSlash}},p=function(){var t=window.location.href,e=t.indexOf("#");return-1===e?"":t.substring(e+1)},f=function(t){var e=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,e>=0?e:0)+"#"+t)};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.default)(l.canUseDOM,"Hash history needs a DOM");var e=window.history,n=(0,l.supportsGoWithoutReloadUsingHash)(),c=t.getUserConfirmation,d=void 0===c?l.getConfirmation:c,m=t.hashType,y=void 0===m?"slash":m,_=t.basename?(0,a.stripTrailingSlash)((0,a.addLeadingSlash)(t.basename)):"",v=h[y],g=v.encodePath,b=v.decodePath,w=function(){var t=b(p());return(0,r.default)(!_||(0,a.hasBasename)(t,_),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+t+'" to begin with "'+_+'".'),_&&(t=(0,a.stripBasename)(t,_)),(0,s.createLocation)(t)},k=(0,u.default)(),S=function(t){i(D,t),D.length=e.length,k.notifyListeners(D.location,D.action)},x=!1,T=null,O=function(){var t=p(),e=g(t);if(t!==e)f(e);else{var n=w(),i=D.location;if(!x&&(0,s.locationsAreEqual)(i,n))return;if(T===(0,a.createPath)(n))return;T=null,P(n)}},P=function(t){x?(x=!1,S()):k.confirmTransitionTo(t,"POP",d,function(e){e?S({action:"POP",location:t}):A(t)})},A=function(t){var e=D.location,n=R.lastIndexOf((0,a.createPath)(e));-1===n&&(n=0);var i=R.lastIndexOf((0,a.createPath)(t));-1===i&&(i=0);var r=n-i;r&&(x=!0,j(r))},C=p(),E=g(C);C!==E&&f(E);var M=w(),R=[(0,a.createPath)(M)],j=function(t){(0,r.default)(n,"Hash history go(n) causes a full page reload in this browser"),e.go(t)},N=0,F=function(t){1===(N+=t)?(0,l.addEventListener)(window,"hashchange",O):0===N&&(0,l.removeEventListener)(window,"hashchange",O)},L=!1,D={length:e.length,action:"POP",location:M,createHref:function(t){return"#"+g(_+(0,a.createPath)(t))},push:function(t,e){(0,r.default)(void 0===e,"Hash history cannot push state; it is ignored");var n=(0,s.createLocation)(t,void 0,void 0,D.location);k.confirmTransitionTo(n,"PUSH",d,function(t){if(t){var e=(0,a.createPath)(n),i=g(_+e);if(p()!==i){T=e,function(t){window.location.hash=t}(i);var o=R.lastIndexOf((0,a.createPath)(D.location)),s=R.slice(0,-1===o?0:o+1);s.push(e),R=s,S({action:"PUSH",location:n})}else(0,r.default)(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),S()}})},replace:function(t,e){(0,r.default)(void 0===e,"Hash history cannot replace state; it is ignored");var n=(0,s.createLocation)(t,void 0,void 0,D.location);k.confirmTransitionTo(n,"REPLACE",d,function(t){if(t){var e=(0,a.createPath)(n),i=g(_+e);p()!==i&&(T=e,f(i));var r=R.indexOf((0,a.createPath)(D.location));-1!==r&&(R[r]=e),S({action:"REPLACE",location:n})}})},go:j,goBack:function(){return j(-1)},goForward:function(){return j(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=k.setPrompt(t);return L||(F(1),L=!0),function(){return L&&(L=!1,F(-1)),e()}},listen:function(t){var e=k.appendListener(t);return F(1),function(){F(-1),e()}}};return D}},function(t,e,n){"use strict";e.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=h(n(9)),s=h(n(12)),a=n(143),u=n(86),l=h(n(142)),c=n(141);function h(t){return t&&t.__esModule?t:{default:t}}var p=function(){try{return window.history.state||{}}catch(t){return{}}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.default)(c.canUseDOM,"Browser history needs a DOM");var e=window.history,n=(0,c.supportsHistory)(),h=!(0,c.supportsPopStateOnHashChange)(),f=t.forceRefresh,d=void 0!==f&&f,m=t.getUserConfirmation,y=void 0===m?c.getConfirmation:m,_=t.keyLength,v=void 0===_?6:_,g=t.basename?(0,u.stripTrailingSlash)((0,u.addLeadingSlash)(t.basename)):"",b=function(t){var e=t||{},n=e.key,i=e.state,r=window.location,s=r.pathname+r.search+r.hash;return(0,o.default)(!g||(0,u.hasBasename)(s,g),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+s+'" to begin with "'+g+'".'),g&&(s=(0,u.stripBasename)(s,g)),(0,a.createLocation)(s,i,n)},w=function(){return Math.random().toString(36).substr(2,v)},k=(0,l.default)(),S=function(t){r(L,t),L.length=e.length,k.notifyListeners(L.location,L.action)},x=function(t){(0,c.isExtraneousPopstateEvent)(t)||P(b(t.state))},T=function(){P(b(p()))},O=!1,P=function(t){O?(O=!1,S()):k.confirmTransitionTo(t,"POP",y,function(e){e?S({action:"POP",location:t}):A(t)})},A=function(t){var e=L.location,n=E.indexOf(e.key);-1===n&&(n=0);var i=E.indexOf(t.key);-1===i&&(i=0);var r=n-i;r&&(O=!0,R(r))},C=b(p()),E=[C.key],M=function(t){return g+(0,u.createPath)(t)},R=function(t){e.go(t)},j=0,N=function(t){1===(j+=t)?((0,c.addEventListener)(window,"popstate",x),h&&(0,c.addEventListener)(window,"hashchange",T)):0===j&&((0,c.removeEventListener)(window,"popstate",x),h&&(0,c.removeEventListener)(window,"hashchange",T))},F=!1,L={length:e.length,action:"POP",location:C,createHref:M,push:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"PUSH",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.pushState({key:r,state:a},null,i),d)window.location.href=i;else{var u=E.indexOf(L.location.key),l=E.slice(0,-1===u?0:u+1);l.push(s.key),E=l,S({action:"PUSH",location:s})}else(0,o.default)(void 0===a,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=i}})},replace:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"REPLACE",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.replaceState({key:r,state:a},null,i),d)window.location.replace(i);else{var u=E.indexOf(L.location.key);-1!==u&&(E[u]=s.key),S({action:"REPLACE",location:s})}else(0,o.default)(void 0===a,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(i)}})},go:R,goBack:function(){return R(-1)},goForward:function(){return R(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=k.setPrompt(t);return F||(N(1),F=!0),function(){return F&&(F=!1,N(-1)),e()}},listen:function(t){var e=k.appendListener(t);return N(1),function(){N(-1),e()}}};return L}},function(t,e,n){"use strict";function i(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}n.d(e,"a",function(){return i})},function(t,e,n){t.exports=function(){"use strict";var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,i=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,o=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,a=s&&s(Object);return function u(l,c,h){if("string"!=typeof c){if(a){var p=s(c);p&&p!==a&&u(l,p,h)}var f=i(c);r&&(f=f.concat(r(c)));for(var d=0;d<f.length;++d){var m=f[d];if(!(t[m]||e[m]||h&&h[m])){var y=o(c,m);try{n(l,m,y)}catch(t){}}}return l}return l}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=a(n(6)),o=a(n(7)),s=a(n(4));function a(t){return t&&t.__esModule?t:{default:t}}e.load=function(){return function(t){s.default.allProgress([o.default.task.index({limit:40,orderBy:"created_at desc"}),o.default.folder.index({activity:"dataset"}),o.default.file.index({module:"samplernn",generated:1,limit:15,orderBy:"created_at desc"}),o.default.file.index({module:"pix2pixhd",generated:1,limit:15,orderBy:"created_at desc"}),o.default.file.index({module:"morph",generated:1,limit:15,orderBy:"created_at desc"})],function(e,n,i){t({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"dashboard"}})}).then(function(e){var n=i(e,5),o=n[0],a=n[1],u=n[2],l=n[3],c=n[4],h=s.default.sort.orderByFn("date desc"),p=h.mapFn,f=h.sortFn,d=a.map(p).sort(f).reduce(function(t,e){var n=e[1].module;return t[n]=t[n]||[],t[n].push(e[1]),t},{});t({type:r.default.dashboard.load,data:{tasks:o,folders:a,foldersByModule:d,renders:{samplernn:u,pix2pixhd:l,morph:c}}})})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(2),a=(n(3),n(4)),u=(i=a)&&i.__esModule?i:{default:i};var l=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleClick=n.handleClick.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"handleClick",value:function(t){this.props.onClick&&this.props.onClick()}},{key:"render",value:function(){var t=this.props,e=t.site,n=t.runner;return(0,o.h)("div",{className:"dashboardHeader heading"},(0,o.h)("h1",null,e.name," cortex"),this.renderStatus("GPU",n.gpu),this.renderStatus("CPU",n.cpu))}},{key:"renderStatus",value:function(t,e){if("IDLE"===e.status)return(0,o.h)("div",null,t," idle");var n=e.task;return"live"===n.activity?(0,o.h)("div",null,t," running ",(0,o.h)("b",null,n.module),' live on "',n.dataset,'"'):(0,o.h)("div",null,t," ",u.default.gerund(n.activity)," ",(0,o.h)("b",null,n.module)," on ",(0,o.h)("b",null,n.dataset),!!n.epoch&&(0,o.h)("span",null,"Epoch: ",n.epoch," / ",n.epochs,(0,o.h)("br",null)))}}]),e}();e.default=(0,s.connect)(function(t){return{runner:t.system.runner,site:t.system.site}},function(t,e){return{}})(l)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(8),a=n(2),u=(m(n(92)),m(n(25))),l=(m(n(66)),m(n(55)),m(n(51)),m(n(150))),c=n(11),h=d(n(149)),p=d(n(52)),f=m(n(80));m(n(7));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.load(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillUpdate",value:function(t){}},{key:"render",value:function(){var t=this,e=this.props,n=e.loading,i=e.progress,o=(e.site,e.foldersByModule),a=e.renders,h=e.queue;e.images;if(n)return(0,r.h)(c.Loading,{progress:i});var p=h.tasks,d=o&&Object.keys(f.default).sort().map(function(e){var n="samplernn"===e||"biggan"===e?"/samplernn/datasets/":"/"+e+"/sequences/",i=(o[e]||[]).map(function(t){return(0,r.h)("div",{key:t.id},(0,r.h)(s.Link,{to:n+t.id+"/"},t.name))}),u=a[e]&&(0,r.h)(c.FileList,{linkFiles:!0,files:a[e],orderBy:"date desc",fields:"name datetime epoch size",onClick:"samplernn"===e?function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a file",e),t.handlePick(e)}:null});return(0,r.h)("div",{className:"dashboardModule",key:e},(0,r.h)("div",{className:"row moduleHeading"},(0,r.h)("h3",null,e),(0,r.h)("div",null,(0,r.h)(s.Link,{to:"/"+e+"/new/"},"new")),i),u)}).filter(function(t){return!!t});return(0,r.h)("div",{className:"app dashboard"},(0,r.h)(l.default,null),(0,r.h)("div",{className:"params row"},(0,r.h)("div",{className:"column"},!!h.queue.length&&(0,r.h)(u.default,{title:"Upcoming Tasks"},(0,r.h)(c.TaskList,{tasks:h.queue.map(function(t){return p[t]})})),!!h.completed.length&&(0,r.h)(u.default,{title:"Completed Tasks"},(0,r.h)(c.TaskList,{tasks:h.completed.map(function(t){return p[t]})}))),(0,r.h)("div",{className:"column"},d)))}},{key:"handlePick",value:function(t){this.props.audioPlayer.play(t)}}]),e}();e.default=(0,a.connect)(function(t){return{loading:t.dashboard.loading,progress:t.dashboard.progress,site:t.system.site,foldersByModule:t.dashboard.data.foldersByModule,renders:t.dashboard.data.renders,images:t.dashboard.images,files:t.dashboard.files,queue:t.queue}},function(t,e){return{actions:(0,o.bindActionCreators)(h,t),audioPlayer:(0,o.bindActionCreators)(p,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=y(n(25)),l=y(n(39)),c=m(n(81)),h=m(n(19)),p=m(n(38)),f=m(n(53)),d=m(n(82));function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function y(t){return t&&t.__esModule?t:{default:t}}var _={activity:"cpu",module:"test",dataset:"test",epochs:1,opt:{}},v={activity:"gpu",module:"test",dataset:"test",epochs:1,opt:{}},g={activity:"live",module:"test",dataset:"test",epochs:1,opt:{}},b={activity:"wait",module:"test",dataset:"test",epochs:1,opt:{}},w=["apple","pear","orange","strawberry"];function k(t){return t[Math.floor(Math.random()*t.length)]}var S=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidUpdate",value:function(){this._screen.scrollHeight>this._screen.scrollTop-this._screen.offsetHeight+100&&(this._screen.scrollTop=this._screen.scrollHeight)}},{key:"render",value:function(){var t=this.props,e=t.site,n=t.server,i=t.relay,r=t.runner,s=t.rpc,a=t.actions,c=t.user;return(0,o.h)("div",{className:"app system"},(0,o.h)("div",{className:"heading"},(0,o.h)("h1",null,e.name," system")),(0,o.h)("div",{className:"row params"},(0,o.h)("div",{className:"column"},(0,o.h)(u.default,{title:"Status"},(0,o.h)(l.default,{title:"Server"},n.status),n.error&&(0,o.h)(l.default,{title:"Server error"},n.error.message),(0,o.h)(l.default,{title:"Relay"},i.status),(0,o.h)(l.default,{title:"RPC"},s.status),(0,o.h)(l.default,{title:"CPU"},this.renderStatus(r.cpu)),(0,o.h)(l.default,{title:"GPU"},this.renderStatus(r.gpu))),(0,o.h)(u.default,{title:"Diagnostics"},(0,o.h)(l.default,{title:"Check GPU"},(0,o.h)("button",{onClick:function(){return a.system.run("nvidia-smi")}},"nvidia-smi")),(0,o.h)(l.default,{title:"List processes"},(0,o.h)("button",{onClick:function(){return a.system.run("ps")}},"ps")),(0,o.h)(l.default,{title:"List users"},(0,o.h)("button",{onClick:function(){return a.system.run("w")}},"w")),(0,o.h)(l.default,{title:"Disk free space"},(0,o.h)("button",{onClick:function(){return a.system.run("df")}},"df"))),(0,o.h)(u.default,{title:"Tasks"},(0,o.h)(l.default,{title:"Kill task"},(0,o.h)("button",{onClick:function(){return a.queue.stop_task("cpu")}},"CPU"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task("gpu")}},"GPU")),(0,o.h)(l.default,{title:"Queue"},(0,o.h)("button",{onClick:function(){return a.queue.start_queue()}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_queue()}},"Stop"))),(0,o.h)(u.default,{title:"Auth"},(0,o.h)(l.default,{title:"Logged in as "+c.username},(0,o.h)("button",{onClick:function(){return a.auth.logout()}},"Logout"))),(0,o.h)(u.default,{title:"Test"},(0,o.h)(l.default,{title:"CPU Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(_,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.cpu.task)}},"Stop")),(0,o.h)(l.default,{title:"GPU Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(v,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.gpu.task)}},"Stop")),(0,o.h)(l.default,{title:"Live Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(g,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.cpu.task)}},"Stop")),(0,o.h)(l.default,{title:"Test Live RPC"},(0,o.h)("button",{onClick:function(){return a.live.get_params()}},"Get"),(0,o.h)("button",{onClick:function(){return a.live.set_param("fruit",k(w))}},"Set")),(0,o.h)(l.default,{title:"Queue Tests"},(0,o.h)("button",{onClick:function(){return a.system.enqueue_test_task(k(w))}},"+Add test task")),(0,o.h)(l.default,{title:""},(0,o.h)("button",{onClick:function(){return a.queue.start_task(b,{preempt:!0,watch:!0})}},"Wait and Buzz"))),(0,o.h)(u.default,{title:"Internationalization"},(0,o.h)(l.default,{title:"Language"},d.languages.map(function(t){return(0,o.h)("button",{onClick:function(){return a.system.changeLanguage(t)}},t)})))),this.renderCommandOutput()))}},{key:"renderStatus",value:function(t){if(!t)return"unknown";if("IDLE"===t.status)return"idle";var e=t.task;return e.activity+" "+e.module}},{key:"renderCommandOutput",value:function(){var t=this,e=this.props,n=e.cmd,i=e.stdout,r=e.stderr,s=void 0;return n.loading?s="Loading: "+n.name:n.loaded?n.error?s="Error: "+n.name+"\n\n"+JSON.stringify(n.error,null,2):(s=n.stdout,n.stderr&&(s+="\n\n_________________________________\n\n",s+=n.stderr)):(s=i,r.length&&(s+="\n\n_________________________________\n\n",s+=r)),(0,o.h)("div",null,(0,o.h)("div",{ref:function(e){return t._screen=e},className:"screen"},s))}}]),e}();e.default=(0,a.connect)(function(t){return i({user:t.auth.user},t.system,t.live)},function(t,e){return{actions:{auth:(0,s.bindActionCreators)(f,t),system:(0,s.bindActionCreators)(c,t),queue:(0,s.bindActionCreators)(p,t),live:(0,s.bindActionCreators)(h,t)}}})(S)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=(n(3),n(2),n(8),a(n(4)),a(n(25)),a(n(39)),a(n(17)),a(n(124))),s=a(n(28));function a(t){return t&&t.__esModule?t:{default:t}}var u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return console.log(t),t.db.data||t.actions.load_directories(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this.props,e=t.module,n=t.history,i=t.db,a=t.path;return(0,r.h)("div",{className:"app new-view "+e.name},(0,r.h)("div",{className:"heading"},(0,r.h)("h1",null,e.displayName||e.name)),(0,r.h)("div",{className:"col narrow"},(0,r.h)(s.default,{module:e,history:n}),(0,r.h)(o.default,{db:i,path:a,activity:"dataset",emptyText:(0,r.h)("i",null,"No projects yet. Please create one~")})))}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.New=void 0;var i,r=n(153),o=(i=r)&&i.__esModule?i:{default:i};e.New=o.default},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(83);var a={dir:"/",start:null,end:null,cursor:null,selection:null,width:0,ratio:0,loading:!0},u=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state=i({},a),t.handleMouseDown=t.handleMouseDown.bind(t),t.handleMouseMove=t.handleMouseMove.bind(t),t.handleMouseUp=t.handleMouseUp.bind(t),t.computeOffset=t.computeOffset.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){var t=this.props.sequence;window.addEventListener("resize",this.computeOffset),window.addEventListener("mousemove",this.handleMouseMove),window.addEventListener("mouseup",this.handleMouseUp),this.computeOffset(),t&&this.reset()}},{key:"componentDidUpdate",value:function(t){this.props.sequence!==t.sequence&&this.reset()}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.computeOffset),window.removeEventListener("mousemove",this.handleMouseMove),window.removeEventListener("mouseup",this.handleMouseUp)}},{key:"reset",value:function(){var t=this,e=this.props.sequence;if(e&&e.length){var n=e.length-1,r={frame:e[0],i:0},o={frame:e[n],i:n},u=Math.sqrt((0,s.clamp)(e.length/9e4,.3,1))*Math.min(window.innerWidth-40,600),l=u/e.length;setTimeout(function(){return t.computeOffset()}),this.setState(i({},a,{width:u,ratio:l,start:r,end:o}))}}},{key:"computeOffset",value:function(){this.ref&&(this.offset=this.ref.getBoundingClientRect())}},{key:"computeFrame",value:function(t){var e=this.props.sequence;if(!e||!e.length)return null;var n=(t.pageX-this.offset.left)/this.offset.width,i=(t.pageY-this.offset.top)/this.offset.height;if(this.state.dragging&&(n=(0,s.clamp)(n,0,1),i=(0,s.clamp)(i,0,1)),0<=n&&n<=1&&0<=i&&i<=1){var r=Math.floor(n*(e.length-1));return{frame:e[r],i:r}}return null}},{key:"handleMouseDown",value:function(t){this.setState({dragging:!0});var e=this.computeFrame(t);e&&(this.props.onPick&&this.props.onPick(e),this.props.onSelect&&this.props.onSelect({start:e,end:e}),this.setState({start:e,end:e}))}},{key:"handleMouseMove",value:function(t){var e=this.computeFrame(t);if(e)if(this.props.onCursor&&this.props.onCursor(e),this.state.dragging){var n=this.state.start,i=e;if(this.setState({cursor:e,end:e}),this.props.onSelect){if(i.i<n.i){var r=[i,n];n=r[0],i=r[1]}this.props.onSelect({start:n,end:i})}}else this.setState({cursor:e})}},{key:"handleMouseUp",value:function(t){if(this.state.dragging){var e=this.state,n=e.start,i=e.end;if(i.i<n.i){var r=[i,n];n=r[0],i=r[1]}this.props.onSelect&&this.props.onSelect({start:n,end:i}),this.setState({dragging:!1})}}},{key:"render",value:function(){var t=this,e=(this.props.sequence,this.state),n=(e.loading,e.start),i=e.end,r=e.cursor,s=e.width,a=e.ratio;return(0,o.h)("div",{className:"timeline",style:{width:s},ref:function(e){return t.ref=e},onMouseDown:this.handleMouseDown},a&&n&&i&&this.renderSelection(n,i,a),a&&r&&this.renderCursor(r,a))}},{key:"renderCursor",value:function(t,e){var n=t.i*e;return(0,o.h)("div",{key:"cursor",className:"cursor",style:{left:n}})}},{key:"renderSelection",value:function(t,e,n){var i=Math.min(t.i,e.i)*n,r=Math.max(Math.abs(t.i-e.i)*n,1);return(0,o.h)("div",{key:"selection",className:"selection",style:{left:i,width:r}})}}]),e}();e.default=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=(n(3),n(2)),s=n(8),a=l(n(4)),u=l(n(7));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"shouldComponentUpdate",value:function(t){return t.tasks.length!==this.props.tasks.length||t.tasks[0]!==this.props.tasks[0]}},{key:"render",value:function(){var t=this,e=this.props,n=(e.title,e.tasks),i=a.default.sort.orderByFn(this.props.sort||"date desc"),o=i.mapFn,u=i.sortFn,l=n.map(o).sort(u).map(function(e){var n=e[1],i=n.dataset,o="",u="";switch(n.activity){case"train":0===n.epoch?o+="latest":o+="ep. "+n.epoch,o+=" + "+n.epochs;break;case"augment":try{var l=JSON.parse(n.opt);o+=l.augment_take+" x "+l.augment_make}catch(t){}}return n.folder_id&&(u="/"+n.module+"/"+("samplernn"===n.module?"datasets":"sequences")+"/"+n.folder_id+"/"),(0,r.h)("div",{className:"row"},(0,r.h)("div",{className:"activity"},n.activity," ",n.module),n.folder_id?(0,r.h)("div",{className:"dataset"},(0,r.h)(s.Link,{to:u},(0,r.h)("span",{className:"datasetName"},i),o)):(0,r.h)("div",{className:"dataset"},(0,r.h)("span",{className:"datasetName"},i),o),(0,r.h)("div",{className:"age "+a.default.carbon_date(n.updated_at),title:n.updated_at},a.default.get_age(n.updated_at)),(0,r.h)("div",{className:"options"},(0,r.h)("span",{className:"destroy",onClick:function(){return t.handleDestroy(n)}},"x")))});return(0,r.h)("div",{className:"tasklist rows"},l)}},{key:"handleDestroy",value:function(t){confirm("Are you sure you want to delete this task?")&&u.default.task.destroy(t)}}]),e}();e.default=(0,o.connect)(function(t){return{}},function(t,e){return{}})(c)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2);n(3);var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleChange=n.handleChange.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleChange",value:function(t){clearTimeout(this.timeout);var e=t.target.value;"PLACEHOLDER"!==e&&this.props.onChange&&this.props.onChange(this.props.name,e)}},{key:"render",value:function(){var t=this.props.live?this.props.opt[this.props.name]:this.props.value,e=void 0,n=(this.props.options||[]).map(function(t,n){var i=t.name,o=t.options.map(function(t){var n=t.length<2?t.toUpperCase():t;n=n.replace(/_/g," ");var i=t;return e=i,(0,r.h)("option",{value:i,key:i},n)});return(0,r.h)("optgroup",{label:i,key:i},o)});return(0,r.h)("div",{className:"select param"},(0,r.h)("label",null,(0,r.h)("span",null,this.props.title),(0,r.h)("select",{onChange:this.handleChange,value:t||e},this.props.placeholder&&(0,r.h)("option",{value:"PLACEHOLDER"},this.props.placeholder),n)),this.props.children)}}]),e}();e.default=(0,o.connect)(function(t,e){return{opt:e.opt||t.live.opt}},function(t,e){return{}})(s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2),s=n(3),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(19));var u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleClick=n.handleClick.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleClick",value:function(t){clearTimeout(this.timeout);var e=t.target.checked;this.props.actions.set_param(this.props.name,e),this.props.onToggle&&this.props.onToggle(e)}},{key:"render",value:function(){var t=this.props.opt[this.props.name],e=!this.props.noToggle,n=!this.props.noDim&&e&&!t?"paramGroup inactive":"paramGroup active";return(0,r.h)("div",{className:n},(0,r.h)("label",null,(0,r.h)("h3",null,this.props.title),e?(0,r.h)("input",{type:"checkbox",onClick:this.handleClick,checked:t}):null),this.props.children)}}]),e}();e.default=(0,o.connect)(function(t){return{opt:t.live.opt}},function(t,e){return{actions:(0,s.bindActionCreators)(a,t)}})(u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1);var o=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={value:null,changed:!1},n.handleInput=n.handleInput.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleInput",value:function(t){this.setState({value:t.target.value,changed:!0}),this.props.onInput&&this.props.onInput(t.target.value,t.target.name),this.props.onChange&&this.props.onChange(t.target.name,t.target.value)}},{key:"handleKeydown",value:function(t){13===t.keyCode&&(this.setState({value:t.target.value,changed:!1}),this.props.onSave&&this.props.onSave(t.target.value,t.target.name))}},{key:"render",value:function(){return(0,r.h)("div",{className:"numberInput param"},(0,r.h)("label",null,(0,r.h)("span",null,this.props.title),(0,r.h)("input",{type:"number",name:this.props.name||"number",value:this.state.changed?this.state.value:this.props.value,onInput:this.handleInput,onKeydown:this.handleKeydown,placeholder:this.props.placeholder,autofocus:this.props.autofocus,min:this.props.min,max:this.props.max,step:this.props.step||"int"===this.props.type?1:.01})))}}]),e}();e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=l(n(4)),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(44));l(n(25)),l(n(66)),l(n(55)),l(n(51)),n(21),l(n(49));function l(t){return t&&t.__esModule?t:{default:t}}var c=a.default.lerp,h=a.default.norm,p=(a.default.randint,a.default.randrange),f=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.load_graph(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this;return this.refs={},(0,r.h)("div",{className:"app lossGraph"},(0,r.h)("div",{className:"heading"},(0,r.h)("h3",null,"SampleRNN Loss Graph"),(0,r.h)("canvas",{ref:function(e){return t.refs.canvas=e}})))}},{key:"componentDidUpdate",value:function(){var t=this.props.samplernn,e=t.lossReport,n=t.results;if(e&&n){var i=this.refs.canvas;i.width=window.innerWidth,i.height=window.innerHeight,i.style.width=i.width+"px",i.style.height=i.height+"px";var r=i.getContext("2d"),o=i.width,s=i.height;r.clearRect(0,0,o,s);var a=n.map(function(t){if(!t.name.match(/^exp:/))return null;var e=t.name.split("-")[3].split(":")[1];return[+new Date(t.date),e]}).filter(function(t){return!!t}).sort(function(t,e){return t[0]-t[1]}),u=0,l=1/0,f=0;Object.keys(e).filter(function(t){return!!e[t].length}).forEach(function(t){var n=e[t];f=Math.max(n.length,f),n.forEach(function(t){var e=parseFloat(t.training_loss);e&&(u=Math.max(e,u),l=Math.min(e,l))})}),u=3,l=0;var d=o/2,m=s/2;r.save();for(var y=void 0,_=void 0,v=0;v<f;v++)if(y=c(v/(f/1)*1,0,d),r.strokeStyle="rgba(0,0,0,0.3)",r.beginPath(0,0),r.moveTo(y,0),r.lineTo(y,s),r.lineWidth=.5,(v+1)%6==0){r.lineWidth=.5,r.stroke();r.font='italic 12px "Georgia"',r.fillStyle="rgba(0,12,28,0.6)",r.fillText(v/5*6,y+8,s-16)}for(v=l;v<u;v+=1){_=c(v/u,0,m),r.beginPath(0,0),r.moveTo(0,s-_),r.lineTo(o,s-_),r.lineWidth=1,r.lineWidth=2,r.setLineDash([4,4]),r.stroke(),r.stroke(),r.stroke(),r.setLineDash([1,1]);r.font='italic 12px "Georgia"',r.fillStyle="rgba(0,12,28,0.6)",r.fillText(v.toFixed(1),o-50,s-_+12+10)}r.lineWidth=1,r.restore();a[0][0],a[a.length-1][0];a.forEach(function(t){t[0];var n=t[1],i=e[n];if(n&&i&&i.length){var o=parseFloat(i[i.length-1].training_loss)||0;parseFloat(i[0].training_loss),h(o,l,u/2);r.lineWidth=4*(1-h(o,l,u)),r.strokeStyle="rgba("+[p(30,190),p(30,150),p(60,120)].join(",")+",0.8)";var s=!1;i.forEach(function(t,e){var n=parseFloat(t.training_loss);if(n){var i=c(e/(f/1)*1,0,d),o=c(h(n,l,u),m,0);s?r.lineTo(i,o):(s=!0,r.beginPath(0,0),r.moveTo(i,o))}}),r.stroke();var a=i.length-1,y=parseFloat(i[a].training_loss),_=c(a/(f/1)*1,0,d),v=c(h(y,l,u),m,0);r.font='italic 9px "Georgia"',r.fillStyle="rgba(0,12,28,0.6)",r.fillText(n,_+4,v+4.5)}})}}}]),e}();e.default=(0,s.connect)(function(t){return{samplernn:t.module.samplernn}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t)}})(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(8),a=n(2),u=d(n(4)),l=f(n(44)),c=f(n(52)),h=d(n(17)),p=n(21);function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.samplernn.data||t.actions.load_directories(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this;if(this.props.samplernn.loading)return(0,r.h)(h.default,{progress:this.props.samplernn.progress});var e=this.props.samplernn.data,n=e.folderLookup,i=e.fileLookup,o=e.datasetLookup,a=Object.keys(n).sort(u.default.sort.stringSort.asc).map(function(e){var a=n[e],l=u.default.sort.orderByFn("epoch desc"),c=l.mapFn,h=l.sortFn,f=a.datasets.map(function(t){return o[t]}).map(c).sort(h).map(function(t){return t[1]}).filter(function(t){return t.output.length}).map(function(t){return t.output.map(function(t){return i[t]}).map(c).sort(h)[0][1]}),d="unsorted"===a.name?"/samplernn/import/":"/samplernn/datasets/"+a.id+"/";return(0,r.h)("div",{className:"col bestRenders"},(0,r.h)("h3",null,(0,r.h)(s.Link,{to:d},a.name)),(0,r.h)(p.FileList,{linkFiles:!0,files:f,orderBy:"date desc",fields:"name date epoch size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a file",e),t.handlePick(e)}}))});return(0,r.h)("div",{className:"app samplernn"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"SampleRNN Results")),(0,r.h)("div",{class:"rows params renders"},a))}},{key:"handlePick",value:function(t){this.props.audioPlayer.play(t)}}]),e}();e.default=(0,a.connect)(function(t){return{samplernn:t.module.samplernn}},function(t,e){return{actions:(0,o.bindActionCreators)(l,t),audioPlayer:(0,o.bindActionCreators)(c,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=(f(n(4)),function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(44))),l=f(n(55)),c=f(n(49)),h=f(n(51)),p=f(n(27));function f(t){return t&&t.__esModule?t:{default:t}}var d={name:"samplernn",datatype:"audio"},m=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state={folder_id:1,import_action:"Hotlink",url_base:"https://s3.amazonaws.com/i.asdf.us/bucky/data/4279/",selected:{}},t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("samplernn.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.samplernn);e.samplernnActions;"new"!==t&&t&&(parseInt(t)&&localStorage.setItem("samplernn.last_id",t),n.folder&&n.folder.id===t||this.props.actions.load_directories(t))}},{key:"render",value:function(){var t=this,e=this.props.samplernn,n=[],i=void 0;return this.props.samplernn.data&&(n=(this.props.samplernn.data.folders||[]).map(function(t){return[t.name,t.id]}),i=this.props.samplernn.data.folderLookup.unsorted),(0,o.h)("div",{className:"app top"},(0,o.h)("div",{class:"heading"},(0,o.h)("h1",null,"Import")),(0,o.h)("div",{class:"params form row datasets"},(0,o.h)("div",{class:"row dataset"},(0,o.h)("div",{class:"col"}),(0,o.h)("div",{class:"col"}),(0,o.h)("div",{class:"col"}),(0,o.h)("div",{class:"col"},(0,o.h)("h2",null,"Import to dataset"),(0,o.h)(l.default,{title:"Destination dataset",options:n,name:"folder_id",opt:this.state,onChange:function(e,n){return t.setState({folder_id:n})}}),(0,o.h)(l.default,{title:"Import action",options:["Hotlink","Upload"],name:"import_action",opt:this.state,onChange:function(e,n){return t.setState({import_action:n})}}),(0,o.h)(c.default,{title:"Remote URL base",value:this.state.url_base,placeholder:"http://",onSave:function(e){return t.setState({url_base:e})}}),(0,o.h)(h.default,{title:"",onClick:function(){return t.doImport()}},"Import")))),(0,o.h)(p.default,{loading:e.loading,progress:e.progress,module:d,data:e.data,id:"unsorted",folder:i,history:this.props.history,onPickDataset:function(e){return t.toggle(e.name,t.state.selected[name])},beforeRow:function(e){return t.beforeRow(e)},afterRow:function(e){return t.afterRow(e)}}))}},{key:"toggle",value:function(t){var e,n,r;this.setState(i({},this.state,{selected:i({},this.state.selected,(e={},n=t,r=!this.state.selected[t],n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e))}))}},{key:"beforeRow",value:function(t){}},{key:"afterRow",value:function(t){var e=t.name;return(0,o.h)("div",null,(0,o.h)("input",{type:"checkbox",value:e,checked:!!this.state.selected[e]}))}},{key:"doImport",value:function(){var t=this.props.samplernn;console.log(this.state),this.props.actions.import_files(this.state,t.data.datasetLookup,t.data.fileLookup)}}]),e}();e.default=(0,a.connect)(function(t){return{samplernn:t.module.samplernn,runner:t.system.runner,task:t.task}},function(t,e){return{actions:(0,s.bindActionCreators)(u,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.clear_cache_task=e.log_task=e.fetch_task=e.generate_task=e.train_task=void 0;r(n(15)),r(n(14)),r(n(6));var i=r(n(7));function r(t){return t&&t.__esModule?t:{default:t}}e.train_task=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return function(r){var o={module:"samplernn",activity:"train",dataset:t.name,epoch:t.checkpoints.length&&t.checkpoints[0].epoch||0,epochs:n,folder_id:e,opt:{sample_length:220500,n_samples:6,keep_old_checkpoints:!1}};return console.log(o),i.default.queue.add_task(o)}},e.generate_task=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return function(s){var a={module:"samplernn",activity:"generate",dataset:t.name,epoch:o||t.checkpoints.length&&t.checkpoints[0].epoch||0,folder_id:e,opt:{sample_length:Math.round(44100*n),n_samples:r}};return console.log(a),i.default.queue.add_task(a)}},e.fetch_task=function(t,e,n,r){return function(o){if(!t)return console.log("input file inaccessible (no url)");var s={module:"samplernn",activity:"fetch",dataset:r,folder_id:e,opt:{url:t,file_id:n,dataset:r}};return i.default.queue.add_task(s)}},e.log_task=function(t){return function(e){var n={module:"samplernn",activity:"log",dataset:t.name};return i.default.queue.add_task(n)}},e.clear_cache_task=function(t){return function(e){var n={module:"samplernn",activity:"clear_cache",dataset:t.name};return i.default.queue.add_task(n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(y(n(4)),m(n(44))),u=m(n(163)),l=m(n(52)),c=n(11),h=y(n(35)),p=y(n(34)),f=y(n(27)),d=y(n(67));function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function y(t){return t&&t.__esModule?t:{default:t}}var _=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("samplernn.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.samplernn),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("samplernn.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/samplernn/new/"))}},{key:"render",value:function(){var t=this,e=this.props,n=e.samplernn,i=(e.runner,e.match,e.history),o=((n.data||{}).folderLookup||{})[n.folder_id]||{};return(0,r.h)("div",{className:"app samplernn"},(0,r.h)("div",{className:"heading"},(0,r.h)("h1",null,o?o.name:(0,r.h)(c.Loading,null))),(0,r.h)("div",{className:"row"},o&&o.name&&"unsorted"!==o.name&&(0,r.h)(h.default,{title:"Add Files",module:d.default,folder:o,canUpload:!0,canAddURL:!0}),(0,r.h)("div",null,(0,r.h)(p.default,null),(0,r.h)(c.CurrentTask,{processor:"gpu"}))),(0,r.h)(f.default,{loading:n.loading,progress:n.progress,id:n.folder_id,module:d.default,data:n.data,folder:o,history:i,onPickFile:function(e,n){n.preventDefault(),n.stopPropagation(),t.handlePick(e)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.samplernn,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,2)}},"2x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,4)}},"4x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,6)}},"6x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,18)}},"18x")),(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,5,12)}},"generate"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.5,120)}},"/2"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.25,240)}},"/4"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.125,480)}},"/8"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.0625,960)}},"/16")),(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,2,30)}},"2s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,10,6)}},"10s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,15,4)}},"15s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,30,2)}},"30s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,60,1)}},"1m")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"x")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,i.folder_id,s.id,t.name)}},"fetch"))):null}},{key:"handlePick",value:function(t){this.props.audioPlayer.play(t)}}]),e}();e.default=(0,s.connect)(function(t){return{samplernn:t.module.samplernn,runner:t.system.runner}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t),audioPlayer:(0,o.bindActionCreators)(l,t)}})(_)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(44)),u=l(n(67));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{samplernn:t.module.samplernn}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.samplernn,path:"/samplernn/datasets/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=f(n(7)),a=f(n(4)),u=f(n(165)),l=f(n(164)),c=f(n(162)),h=f(n(161)),p=f(n(160));function f(t){return t&&t.__esModule?t:{default:t}}var d=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("samplernn"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #eef, #fef)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("samplernn"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #eef, #fef)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/samplernn/new",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/datasets",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/datasets/:id",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/import",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/results",component:h.default}),(0,r.h)(o.Route,{exact:!0,path:"/samplernn/graph",component:p.default}))}}]),t}();e.default={name:"samplernn",router:d,links:function(){return[{url:"/samplernn/new/",name:"new"},{url:"/samplernn/datasets/",name:"datasets"},{url:"/samplernn/graph/",name:"graph"},{url:"/samplernn/results/",name:"results"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),a=n(2),u=n(11),l=n(40),c=m(l),h=m(n(19)),p=m(n(38)),f=m(n(76)),d=m(n(77));function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.pix2wav.load_directories(),t.actions.live.get_params(),n.changeCheckpoint=n.changeCheckpoint.bind(n),n.changeEpoch=n.changeEpoch.bind(n),n.changeSequence=n.changeSequence.bind(n),n.seek=n.seek.bind(n),n.togglePlaying=n.togglePlaying.bind(n),n.toggleRecording=n.toggleRecording.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillUpdate",value:function(t){t.opt.checkpoint_name&&t.opt.checkpoint_name!==this.props.opt.checkpoint_name&&(console.log("fetch checkpoint",t.opt.checkpoint_name),this.props.actions.live.list_epochs("pix2wav",t.opt.checkpoint_name))}},{key:"changeCheckpoint",value:function(t,e){this.props.actions.live.load_epoch(e,"latest")}},{key:"changeEpoch",value:function(t,e){this.props.actions.live.load_epoch(this.props.opt.checkpoint_name,e)}},{key:"changeSequence",value:function(t,e){console.log("got sequence",e),this.props.actions.live.load_sequence(e)}},{key:"seek",value:function(t){var e=Math.floor(t*(parseInt(this.props.frame.sequence_len)||1)+1);this.props.actions.live.seek(e)}},{key:"start",value:function(){console.log(this.props.pix2wav.data);var t=this.props.pix2wav.data.sequences[0].name||"",e=this.props.pix2wav.data.checkpoints[0].name||"";console.log("starting up!",t,e),this.props.actions.tasks.live_task(t,e)}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"exit",value:function(){this.props.actions.queue.stop_task("gpu",{sigkill:!0})}},{key:"togglePlaying",value:function(){this.props.opt.processing?this.props.actions.live.pause():this.props.actions.live.play()}},{key:"toggleRecording",value:function(){this.props.opt.recording?((0,l.stopRecording)(),this.props.actions.live.pause()):(0,l.startRecording)()}},{key:"render",value:function(){return this.props.pix2wav.loading?(0,r.h)(u.Loading,null):(0,r.h)("div",{className:"app pix2wav centered"},(0,r.h)("div",{className:"row"},(0,r.h)("div",{className:"column"},(0,r.h)(u.Player,{width:256,height:256})),(0,r.h)("div",{className:"params column audioParams"},(0,r.h)(u.Group,{title:"Audio playback"},(0,r.h)(u.Button,{title:"Start playback",onClick:function(){return c.startSynthesizing()}},"Start"),(0,r.h)(u.Button,{title:"Stop playback",onClick:function(){return c.stopSynthesizing()}},"Stop")))),(0,r.h)("div",{className:"params row"},(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Playback",noToggle:!0},(0,r.h)(u.Select,{name:"send_image",title:"view mode",options:["a","b","sequence","recursive"],onChange:this.props.actions.live.set_param}),(0,r.h)(u.Select,{name:"sequence_name",title:"sequence",options:this.props.pix2wav.data.sequences,onChange:this.changeSequence}),(0,r.h)(u.Select,{name:"output_format",title:"format",options:["JPEG","PNG"]}),(0,r.h)(u.Select,{name:"checkpoint_name",title:"checkpoint",options:this.props.pix2wav.data.checkpoints,onChange:this.changeCheckpoint}),(0,r.h)(u.Select,{name:"epoch",title:"epoch",options:this.props.epochs,onChange:this.changeEpoch}),(0,r.h)(u.Slider,{live:!0,name:"position",min:0,max:1,type:"float",value:(this.props.frame.sequence_i||0)/(this.props.frame.sequence_len||1),onChange:this.seek}),this.renderRestartButton(),(0,r.h)(u.Button,{title:this.props.opt.savingVideo?"Saving video...":this.props.opt.recording?"Recording ("+(t=this.props.opt.recordFrames,(t/10).toFixed(1)+" s.")+")":"Record video",onClick:this.toggleRecording},this.props.opt.savingVideo?"Saving":this.props.opt.recording?"Recording":"Record"),(0,r.h)(u.Button,{title:"Save frame",onClick:l.saveFrame},"Save"),(0,r.h)("p",{class:"last_message"},this.props.last_message))),(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Transition",name:"transition"},(0,r.h)(u.Slider,{live:!0,name:"transition_period",min:10,max:5e3,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"transition_min",min:.001,max:.2,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"transition_max",min:.1,max:1,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Recursion",name:"recursive"},(0,r.h)(u.Slider,{live:!0,name:"recursive_frac",min:0,max:.5,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"recurse_roll",min:-64,max:64,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"recurse_roll_axis",min:0,max:1,type:"int"})),(0,r.h)(u.ParamGroup,{title:"Sequence",name:"sequence"},(0,r.h)(u.Slider,{live:!0,name:"sequence_frac",min:0,max:1,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"process_frac",min:0,max:1,type:"float"}))),(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Clahe",name:"clahe"},(0,r.h)(u.Slider,{live:!0,name:"clip_limit",min:1,max:4,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Posterize",name:"posterize"},(0,r.h)(u.Slider,{live:!0,name:"spatial_window",min:2,max:128,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"color_window",min:2,max:128,type:"int"})),(0,r.h)(u.ParamGroup,{title:"Blur",name:"blur"},(0,r.h)(u.Slider,{live:!0,name:"blur_radius",min:3,max:7,type:"odd"}),(0,r.h)(u.Slider,{live:!0,name:"blur_sigma",min:0,max:2,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Canny Edge Detection",name:"canny"},(0,r.h)(u.Slider,{live:!0,name:"canny_lo",min:10,max:200,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"canny_hi",min:10,max:200,type:"int"})))));var t}},{key:"renderRestartButton",value:function(){var t=this;return"IDLE"===this.props.runner.gpu.status?(0,r.h)(u.Button,{title:"GPU Idle",onClick:function(){return t.start()}},"Start"):"pix2pix"!==this.props.runner.gpu.task.module&&"pix2wav"!==this.props.runner.gpu.task.module?(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"):this.props.opt.processing?(0,r.h)("div",null,(0,r.h)(u.Button,{title:"Processing",onClick:this.togglePlaying},"Pause"),(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"),(0,r.h)(u.Button,{title:"Last resort",onClick:function(){return t.exit()}},"Exit")):(0,r.h)("div",null,(0,r.h)(u.Button,{title:"Not processing",onClick:this.togglePlaying},"Restart"),(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"),(0,r.h)(u.Button,{title:"Last resort",onClick:function(){return t.exit()}},"Exit"))}}]),e}();e.default=(0,a.connect)(function(t){return{last_message:t.live.last_message,opt:t.live.opt,frame:t.live.frame,checkpoints:t.live.checkpoints,epochs:t.live.epochs,sequences:t.live.sequences,runner:t.system.runner,pix2wav:t.module.pix2wav}},function(t,e){return{actions:{live:(0,o.bindActionCreators)(h,t),queue:(0,o.bindActionCreators)(p,t),pix2wav:(0,o.bindActionCreators)(d,t),tasks:(0,o.bindActionCreators)(f,t),s:s}}})(y)},function(t,e,n){"use strict";var i,r,o;"function"==typeof Symbol&&Symbol.iterator;r=[],void 0===(o="function"==typeof(i=function(){var t={context:null,_tapListeners:[],_onStarted:[],setContext:function(e){return t.context=e,t},on:function(i){if(Array.isArray(i)||NodeList&&i instanceof NodeList)for(var r=0;r<i.length;r++)t.on(i[r]);else if("string"==typeof i)t.on(document.querySelectorAll(i));else if(i.jquery&&"function"==typeof i.toArray)t.on(i.toArray());else if(Element&&i instanceof Element){var o=new e(i,n);t._tapListeners.push(o)}return t},onStarted:function(e){return t.isStarted()?e():t._onStarted.push(e),t},isStarted:function(){return null!==t.context&&"running"===t.context.state}},e=function(t){this._dragged=!1,this._element=t,this._bindedMove=this._moved.bind(this),this._bindedEnd=this._ended.bind(this),t.addEventListener("touchmove",this._bindedMove),t.addEventListener("touchend",this._bindedEnd),t.addEventListener("mouseup",this._bindedEnd)};function n(){if(t.context&&!t.isStarted()){var e=t.context.createOscillator(),n=t.context.createGain();n.gain.value=0,e.connect(n),n.connect(t.context.destination);var i=t.context.currentTime;e.start(i),e.stop(i+.5)}if(t._tapListeners){for(var r=0;r<t._tapListeners.length;r++)t._tapListeners[r].dispose();t._tapListeners=null}if(t._onStarted){for(var o=0;o<t._onStarted.length;o++)t._onStarted[o]();t._onStarted=null}}return e.prototype._moved=function(t){this._dragged=!0},e.prototype._ended=function(t){this._dragged||n(),this._dragged=!1},e.prototype.dispose=function(){this._element.removeEventListener("touchmove",this._bindedMove),this._element.removeEventListener("touchend",this._bindedEnd),this._element.removeEventListener("mouseup",this._bindedEnd),this._bindedMove=null,this._bindedEnd=null,this._element=null},t})?i.apply(e,r):i)||(t.exports=o)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.requestAudioContext=function(t){if(o.is_mobile){var e=document.createElement("div"),n=document.createElement("div");n.innerHTML="Tap to start - please unmute your phone",Object.assign(e.style,{display:"block",position:"absolute",width:"100%",height:"100%",zIndex:"10000",top:"0px",left:"0px",backgroundColor:"rgba(0, 0, 0, 0.8)"}),Object.assign(n.style,{display:"block",position:"absolute",left:"50%",top:"50%",padding:"20px",backgroundColor:"#7F33ED",color:"white",fontFamily:"monospace",borderRadius:"3px",transform:"translate3D(-50%,-50%,0)",textAlign:"center",lineHeight:"1.5",width:"150px"}),e.appendChild(n),document.body.appendChild(e),r.default.setContext(i.default.context),r.default.on(n),r.default.onStarted(function(n){e.remove(),t()})}else t()};var i=s(n(54)),r=s(n(168)),o=n(4);function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){var i;!function(){"use strict";var r={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[\+\-]/};function o(t){return function(t,e){var n,i,s,a,u,l,c,h,p,f=1,d=t.length,m="";for(i=0;i<d;i++)if("string"==typeof t[i])m+=t[i];else if(Array.isArray(t[i])){if((a=t[i])[2])for(n=e[f],s=0;s<a[2].length;s++){if(!n.hasOwnProperty(a[2][s]))throw new Error(o('[sprintf] property "%s" does not exist',a[2][s]));n=n[a[2][s]]}else n=a[1]?e[a[1]]:e[f++];if(r.not_type.test(a[8])&&r.not_primitive.test(a[8])&&n instanceof Function&&(n=n()),r.numeric_arg.test(a[8])&&"number"!=typeof n&&isNaN(n))throw new TypeError(o("[sprintf] expecting number but found %T",n));switch(r.number.test(a[8])&&(h=n>=0),a[8]){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a[6]?parseInt(a[6]):0);break;case"e":n=a[7]?parseFloat(n).toExponential(a[7]):parseFloat(n).toExponential();break;case"f":n=a[7]?parseFloat(n).toFixed(a[7]):parseFloat(n);break;case"g":n=a[7]?String(Number(n.toPrecision(a[7]))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a[7]?n.substring(0,a[7]):n;break;case"t":n=String(!!n),n=a[7]?n.substring(0,a[7]):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a[7]?n.substring(0,a[7]):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a[7]?n.substring(0,a[7]):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}r.json.test(a[8])?m+=n:(!r.number.test(a[8])||h&&!a[3]?p="":(p=h?"+":"-",n=n.toString().replace(r.sign,"")),l=a[4]?"0"===a[4]?"0":a[4].charAt(1):" ",c=a[6]-(p+n).length,u=a[6]&&c>0?l.repeat(c):"",m+=a[5]?p+n+u:"0"===l?p+u+n:u+p+n)}return m}(function(t){if(a[t])return a[t];var e,n=t,i=[],o=0;for(;n;){if(null!==(e=r.text.exec(n)))i.push(e[0]);else if(null!==(e=r.modulo.exec(n)))i.push("%");else{if(null===(e=r.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],u=e[2],l=[];if(null===(l=r.key.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(l[1]);""!==(u=u.substring(l[0].length));)if(null!==(l=r.key_access.exec(u)))s.push(l[1]);else{if(null===(l=r.index_access.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(l[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push(e)}n=n.substring(e[0].length)}return a[t]=i}(t),arguments)}function s(t,e){return o.apply(null,[t].concat(e||[]))}var a=Object.create(null);e.sprintf=o,e.vsprintf=s,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=s,void 0===(i=function(){return{sprintf:o,vsprintf:s}}.call(e,n,e,t))||(t.exports=i))}()},function(t,e,n){"use strict";var i=n(96),r=n(10),o=n(70),s=n(69),a=n(31),u=n(103),l=n(24);function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in u)if(u.hasOwnProperty(e)&&u[e].magic===t)return u[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,n,i,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index<r;)e=t.readInt(2),n=t.readInt(2),i=t.readData(n),this.extraFields[e]={id:e,length:n,value:i}},handleUTF8:function(){var t=l.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=a.utf8decode(this.fileName),this.fileCommentStr=a.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var n=r.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var i=this.findExtraFieldUnicodeComment();if(null!==i)this.fileCommentStr=i;else{var o=r.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=i(t.value);return 1!==e.readInt(1)?null:s(this.fileName)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=i(t.value);return 1!==e.readInt(1)?null:s(this.fileComment)!==e.readInt(4)?null:a.utf8decode(e.readData(t.length-5))}return null}},t.exports=c},function(t,e,n){"use strict";var i=n(93);function r(t){i.call(this,t)}n(10).inherits(r,i),r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(94);function r(t){i.call(this,t)}n(10).inherits(r,i),r.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},r.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},r.prototype.readAndCheckSignature=function(t){return t===this.readData(4)},r.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(96),r=n(10),o=n(97),s=n(171),a=(n(31),n(24));function u(t){this.files=[],this.loadOptions=t}u.prototype={checkSignature:function(t){if(!this.reader.readAndCheckSignature(t)){this.reader.index-=4;var e=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+r.pretty(e)+", expected "+r.pretty(t)+")")}},isSignature:function(t,e){var n=this.reader.index;this.reader.setIndex(t);var i=this.reader.readString(4)===e;return this.reader.setIndex(n),i},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var t=this.reader.readData(this.zipCommentLength),e=a.uint8array?"uint8array":"array",n=r.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var t,e,n,i=this.zip64EndOfCentralSize-44;0<i;)t=this.reader.readInt(2),e=this.reader.readInt(4),n=this.reader.readData(e),this.zip64ExtensibleData[t]={id:t,length:e,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(t=new s({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(t<0)throw!this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(t);var e=t;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===r.MAX_VALUE_16BITS||this.diskWithCentralDirStart===r.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===r.MAX_VALUE_16BITS||this.centralDirRecords===r.MAX_VALUE_16BITS||this.centralDirSize===r.MAX_VALUE_32BITS||this.centralDirOffset===r.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var i=e-n;if(i>0)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=i(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},function(t,e,n){"use strict";var i=n(10),r=n(45),o=n(31),s=(i=n(10),n(174)),a=n(104),u=n(57);function l(t){return new r.Promise(function(e,n){var i=t.decompressed.getContentWorker().pipe(new a);i.on("error",function(t){n(t)}).on("end",function(){i.streamInfo.crc32!==t.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}t.exports=function(t,e){var n=this;return e=i.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(t)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var n=new s(e);return n.load(t),n}).then(function(t){var n=[r.Promise.resolve(t)],i=t.files;if(e.checkCRC32)for(var o=0;o<i.length;o++)n.push(l(i[o]));return r.Promise.all(n)}).then(function(t){for(var i=t.shift(),r=i.files,o=0;o<r.length;o++){var s=r[o];n.file(s.fileNameStr,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:e.createFolders})}return i.zipComment.length&&(n.comment=i.zipComment),n})}},function(t,e,n){"use strict";var i=n(10),r=n(16);function o(t,e){r.call(this,"Nodejs stream input adapter for "+t),this._upstreamEnded=!1,this._bindStream(e)}i.inherits(o,r),o.prototype._bindStream=function(t){var e=this;this._stream=t,t.pause(),t.on("data",function(t){e.push({data:t,meta:{percent:0}})}).on("error",function(t){e.isPaused?this.generatedError=t:e.error(t)}).on("end",function(){e.isPaused?e._upstreamEnded=!0:e.end()})},o.prototype.pause=function(){return!!r.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},function(t,e,n){"use strict";var i=n(10),r=n(16),o=n(31),s=n(69),a=n(97),u=function(t,e){var n,i="";for(n=0;n<e;n++)i+=String.fromCharCode(255&t),t>>>=8;return i},l=function(t,e,n,r,l,c){var h,p,f=t.file,d=t.compression,m=c!==o.utf8encode,y=i.transformTo("string",c(f.name)),_=i.transformTo("string",o.utf8encode(f.name)),v=f.comment,g=i.transformTo("string",c(v)),b=i.transformTo("string",o.utf8encode(v)),w=_.length!==f.name.length,k=b.length!==v.length,S="",x="",T="",O=f.dir,P=f.date,A={crc32:0,compressedSize:0,uncompressedSize:0};e&&!n||(A.crc32=t.crc32,A.compressedSize=t.compressedSize,A.uncompressedSize=t.uncompressedSize);var C=0;e&&(C|=8),m||!w&&!k||(C|=2048);var E,M,R=0,j=0;O&&(R|=16),"UNIX"===l?(j=798,R|=(E=f.unixPermissions,M=E,E||(M=O?16893:33204),(65535&M)<<16)):(j=20,R|=63&(f.dosPermissions||0)),h=P.getUTCHours(),h<<=6,h|=P.getUTCMinutes(),h<<=5,h|=P.getUTCSeconds()/2,p=P.getUTCFullYear()-1980,p<<=4,p|=P.getUTCMonth()+1,p<<=5,p|=P.getUTCDate(),w&&(x=u(1,1)+u(s(y),4)+_,S+="up"+u(x.length,2)+x),k&&(T=u(1,1)+u(s(g),4)+b,S+="uc"+u(T.length,2)+T);var N="";return N+="\n\0",N+=u(C,2),N+=d.magic,N+=u(h,2),N+=u(p,2),N+=u(A.crc32,4),N+=u(A.compressedSize,4),N+=u(A.uncompressedSize,4),N+=u(y.length,2),N+=u(S.length,2),{fileRecord:a.LOCAL_FILE_HEADER+N+y+S,dirRecord:a.CENTRAL_FILE_HEADER+u(j,2)+N+u(g.length,2)+"\0\0\0\0"+u(R,4)+u(r,4)+y+S+g}};function c(t,e,n,i){r.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}i.inherits(c,r),c.prototype.push=function(t){var e=t.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,r.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:n?(e+100*(n-i-1))/n:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var n=l(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,n=l(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),e)this.push({data:function(t){return a.DATA_DESCRIPTOR+u(t.crc32,4)+u(t.compressedSize,4)+u(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e<this.dirRecords.length;e++)this.push({data:this.dirRecords[e],meta:{percent:100}});var n=this.bytesWritten-t,r=function(t,e,n,r,o){var s=i.transformTo("string",o(r));return a.CENTRAL_DIRECTORY_END+"\0\0\0\0"+u(t,2)+u(t,2)+u(e,4)+u(n,4)+u(s.length,2)+s}(this.dirRecords.length,n,t,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},c.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},c.prototype.registerPrevious=function(t){this._sources.push(t);var e=this;return t.on("data",function(t){e.processChunk(t)}),t.on("end",function(){e.closedSource(e.previous.streamInfo),e._sources.length?e.prepareNextSource():e.end()}),t.on("error",function(t){e.error(t)}),this},c.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},c.prototype.error=function(t){var e=this._sources;if(!r.prototype.error.call(this,t))return!1;for(var n=0;n<e.length;n++)try{e[n].error(t)}catch(t){}return!0},c.prototype.lock=function(){r.prototype.lock.call(this);for(var t=this._sources,e=0;e<t.length;e++)t[e].lock()},t.exports=c},function(t,e,n){"use strict";t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},function(t,e,n){"use strict";var i=n(23),r=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(t,e,n,u,l,c,h,p){var f,d,m,y,_,v,g,b,w,k=p.bits,S=0,x=0,T=0,O=0,P=0,A=0,C=0,E=0,M=0,R=0,j=null,N=0,F=new i.Buf16(16),L=new i.Buf16(16),D=null,q=0;for(S=0;S<=15;S++)F[S]=0;for(x=0;x<u;x++)F[e[n+x]]++;for(P=k,O=15;O>=1&&0===F[O];O--);if(P>O&&(P=O),0===O)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(T=1;T<O&&0===F[T];T++);for(P<T&&(P=T),E=1,S=1;S<=15;S++)if(E<<=1,(E-=F[S])<0)return-1;if(E>0&&(0===t||1!==O))return-1;for(L[1]=0,S=1;S<15;S++)L[S+1]=L[S]+F[S];for(x=0;x<u;x++)0!==e[n+x]&&(h[L[e[n+x]]++]=x);if(0===t?(j=D=h,v=19):1===t?(j=r,N-=257,D=o,q-=257,v=256):(j=s,D=a,v=-1),R=0,x=0,S=T,_=c,A=P,C=0,m=-1,y=(M=1<<P)-1,1===t&&M>852||2===t&&M>592)return 1;for(;;){g=S-C,h[x]<v?(b=0,w=h[x]):h[x]>v?(b=D[q+h[x]],w=j[N+h[x]]):(b=96,w=0),f=1<<S-C,T=d=1<<A;do{l[_+(R>>C)+(d-=f)]=g<<24|b<<16|w|0}while(0!==d);for(f=1<<S-1;R&f;)f>>=1;if(0!==f?(R&=f-1,R+=f):R=0,x++,0==--F[S]){if(S===O)break;S=e[n+h[x]]}if(S>P&&(R&y)!==m){for(0===C&&(C=P),_+=T,E=1<<(A=S-C);A+C<O&&!((E-=F[A+C])<=0);)A++,E<<=1;if(M+=1<<A,1===t&&M>852||2===t&&M>592)return 1;l[m=R&y]=P<<24|A<<16|_-c|0}}return 0!==R&&(l[_+R]=S-C<<24|64<<16|0),p.bits=P,0}},function(t,e,n){"use strict";t.exports=function(t,e){var n,i,r,o,s,a,u,l,c,h,p,f,d,m,y,_,v,g,b,w,k,S,x,T,O;n=t.state,i=t.next_in,T=t.input,r=i+(t.avail_in-5),o=t.next_out,O=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),u=n.dmax,l=n.wsize,c=n.whave,h=n.wnext,p=n.window,f=n.hold,d=n.bits,m=n.lencode,y=n.distcode,_=(1<<n.lenbits)-1,v=(1<<n.distbits)-1;t:do{d<15&&(f+=T[i++]<<d,d+=8,f+=T[i++]<<d,d+=8),g=m[f&_];e:for(;;){if(f>>>=b=g>>>24,d-=b,0===(b=g>>>16&255))O[o++]=65535&g;else{if(!(16&b)){if(0==(64&b)){g=m[(65535&g)+(f&(1<<b)-1)];continue e}if(32&b){n.mode=12;break t}t.msg="invalid literal/length code",n.mode=30;break t}w=65535&g,(b&=15)&&(d<b&&(f+=T[i++]<<d,d+=8),w+=f&(1<<b)-1,f>>>=b,d-=b),d<15&&(f+=T[i++]<<d,d+=8,f+=T[i++]<<d,d+=8),g=y[f&v];n:for(;;){if(f>>>=b=g>>>24,d-=b,!(16&(b=g>>>16&255))){if(0==(64&b)){g=y[(65535&g)+(f&(1<<b)-1)];continue n}t.msg="invalid distance code",n.mode=30;break t}if(k=65535&g,d<(b&=15)&&(f+=T[i++]<<d,(d+=8)<b&&(f+=T[i++]<<d,d+=8)),(k+=f&(1<<b)-1)>u){t.msg="invalid distance too far back",n.mode=30;break t}if(f>>>=b,d-=b,k>(b=o-s)){if((b=k-b)>c&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(S=0,x=p,0===h){if(S+=l-b,b<w){w-=b;do{O[o++]=p[S++]}while(--b);S=o-k,x=O}}else if(h<b){if(S+=l+h-b,(b-=h)<w){w-=b;do{O[o++]=p[S++]}while(--b);if(S=0,h<w){w-=b=h;do{O[o++]=p[S++]}while(--b);S=o-k,x=O}}}else if(S+=h-b,b<w){w-=b;do{O[o++]=p[S++]}while(--b);S=o-k,x=O}for(;w>2;)O[o++]=x[S++],O[o++]=x[S++],O[o++]=x[S++],w-=3;w&&(O[o++]=x[S++],w>1&&(O[o++]=x[S++]))}else{S=o-k;do{O[o++]=O[S++],O[o++]=O[S++],O[o++]=O[S++],w-=3}while(w>2);w&&(O[o++]=O[S++],w>1&&(O[o++]=O[S++]))}break}}break}}while(i<r&&o<a);i-=w=d>>3,f&=(1<<(d-=w<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i<r?r-i+5:5-(i-r),t.avail_out=o<a?a-o+257:257-(o-a),n.hold=f,n.bits=d}},function(t,e,n){"use strict";var i=n(23),r=n(102),o=n(101),s=n(180),a=n(179),u=0,l=1,c=2,h=4,p=5,f=6,d=0,m=1,y=2,_=-2,v=-3,g=-4,b=-5,w=8,k=1,S=2,x=3,T=4,O=5,P=6,A=7,C=8,E=9,M=10,R=11,j=12,N=13,F=14,L=15,D=16,q=17,I=18,B=19,U=20,z=21,Y=22,W=23,G=24,V=25,H=26,Z=27,Q=28,K=29,$=30,X=31,J=32,tt=852,et=592,nt=15;function it(t){return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function rt(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=k,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(tt),e.distcode=e.distdyn=new i.Buf32(et),e.sane=1,e.back=-1,d):_}function ot(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,rt(t)):_}function st(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,ot(t))):_}function at(t,e){var n,r;return t?(r=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},t.state=r,r.window=null,(n=st(t,e))!==d&&(t.state=null),n):_}var ut,lt,ct=!0;function ht(t){if(ct){var e;for(ut=new i.Buf32(512),lt=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(l,t.lens,0,288,ut,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(c,t.lens,0,32,lt,0,t.work,{bits:5}),ct=!1}t.lencode=ut,t.lenbits=9,t.distcode=lt,t.distbits=5}function pt(t,e,n,r){var o,s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new i.Buf8(s.wsize)),r>=s.wsize?(i.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>r&&(o=r),i.arraySet(s.window,e,n-r,o,s.wnext),(r-=o)?(i.arraySet(s.window,e,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}e.inflateReset=ot,e.inflateReset2=st,e.inflateResetKeep=rt,e.inflateInit=function(t){return at(t,nt)},e.inflateInit2=at,e.inflate=function(t,e){var n,tt,et,nt,rt,ot,st,at,ut,lt,ct,ft,dt,mt,yt,_t,vt,gt,bt,wt,kt,St,xt,Tt,Ot=0,Pt=new i.Buf8(4),At=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return _;(n=t.state).mode===j&&(n.mode=N),rt=t.next_out,et=t.output,st=t.avail_out,nt=t.next_in,tt=t.input,ot=t.avail_in,at=n.hold,ut=n.bits,lt=ot,ct=st,St=d;t:for(;;)switch(n.mode){case k:if(0===n.wrap){n.mode=N;break}for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(2&n.wrap&&35615===at){n.check=0,Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0),at=0,ut=0,n.mode=S;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&at)<<8)+(at>>8))%31){t.msg="incorrect header check",n.mode=$;break}if((15&at)!==w){t.msg="unknown compression method",n.mode=$;break}if(ut-=4,kt=8+(15&(at>>>=4)),0===n.wbits)n.wbits=kt;else if(kt>n.wbits){t.msg="invalid window size",n.mode=$;break}n.dmax=1<<kt,t.adler=n.check=1,n.mode=512&at?M:j,at=0,ut=0;break;case S:for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(n.flags=at,(255&n.flags)!==w){t.msg="unknown compression method",n.mode=$;break}if(57344&n.flags){t.msg="unknown header flags set",n.mode=$;break}n.head&&(n.head.text=at>>8&1),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0,n.mode=x;case x:for(;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.head&&(n.head.time=at),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,Pt[2]=at>>>16&255,Pt[3]=at>>>24&255,n.check=o(n.check,Pt,4,0)),at=0,ut=0,n.mode=T;case T:for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.head&&(n.head.xflags=255&at,n.head.os=at>>8),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0,n.mode=O;case O:if(1024&n.flags){for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.length=at,n.head&&(n.head.extra_len=at),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0}else n.head&&(n.head.extra=null);n.mode=P;case P:if(1024&n.flags&&((ft=n.length)>ot&&(ft=ot),ft&&(n.head&&(kt=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,tt,nt,ft,kt)),512&n.flags&&(n.check=o(n.check,tt,ft,nt)),ot-=ft,nt+=ft,n.length-=ft),n.length))break t;n.length=0,n.mode=A;case A:if(2048&n.flags){if(0===ot)break t;ft=0;do{kt=tt[nt+ft++],n.head&&kt&&n.length<65536&&(n.head.name+=String.fromCharCode(kt))}while(kt&&ft<ot);if(512&n.flags&&(n.check=o(n.check,tt,ft,nt)),ot-=ft,nt+=ft,kt)break t}else n.head&&(n.head.name=null);n.length=0,n.mode=C;case C:if(4096&n.flags){if(0===ot)break t;ft=0;do{kt=tt[nt+ft++],n.head&&kt&&n.length<65536&&(n.head.comment+=String.fromCharCode(kt))}while(kt&&ft<ot);if(512&n.flags&&(n.check=o(n.check,tt,ft,nt)),ot-=ft,nt+=ft,kt)break t}else n.head&&(n.head.comment=null);n.mode=E;case E:if(512&n.flags){for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(at!==(65535&n.check)){t.msg="header crc mismatch",n.mode=$;break}at=0,ut=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=j;break;case M:for(;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}t.adler=n.check=it(at),at=0,ut=0,n.mode=R;case R:if(0===n.havedict)return t.next_out=rt,t.avail_out=st,t.next_in=nt,t.avail_in=ot,n.hold=at,n.bits=ut,y;t.adler=n.check=1,n.mode=j;case j:if(e===p||e===f)break t;case N:if(n.last){at>>>=7&ut,ut-=7&ut,n.mode=Z;break}for(;ut<3;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}switch(n.last=1&at,ut-=1,3&(at>>>=1)){case 0:n.mode=F;break;case 1:if(ht(n),n.mode=U,e===f){at>>>=2,ut-=2;break t}break;case 2:n.mode=q;break;case 3:t.msg="invalid block type",n.mode=$}at>>>=2,ut-=2;break;case F:for(at>>>=7&ut,ut-=7&ut;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if((65535&at)!=(at>>>16^65535)){t.msg="invalid stored block lengths",n.mode=$;break}if(n.length=65535&at,at=0,ut=0,n.mode=L,e===f)break t;case L:n.mode=D;case D:if(ft=n.length){if(ft>ot&&(ft=ot),ft>st&&(ft=st),0===ft)break t;i.arraySet(et,tt,nt,ft,rt),ot-=ft,nt+=ft,st-=ft,rt+=ft,n.length-=ft;break}n.mode=j;break;case q:for(;ut<14;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(n.nlen=257+(31&at),at>>>=5,ut-=5,n.ndist=1+(31&at),at>>>=5,ut-=5,n.ncode=4+(15&at),at>>>=4,ut-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=$;break}n.have=0,n.mode=I;case I:for(;n.have<n.ncode;){for(;ut<3;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.lens[At[n.have++]]=7&at,at>>>=3,ut-=3}for(;n.have<19;)n.lens[At[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,xt={bits:n.lenbits},St=a(u,n.lens,0,19,n.lencode,0,n.work,xt),n.lenbits=xt.bits,St){t.msg="invalid code lengths set",n.mode=$;break}n.have=0,n.mode=B;case B:for(;n.have<n.nlen+n.ndist;){for(;_t=(Ot=n.lencode[at&(1<<n.lenbits)-1])>>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(vt<16)at>>>=yt,ut-=yt,n.lens[n.have++]=vt;else{if(16===vt){for(Tt=yt+2;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(at>>>=yt,ut-=yt,0===n.have){t.msg="invalid bit length repeat",n.mode=$;break}kt=n.lens[n.have-1],ft=3+(3&at),at>>>=2,ut-=2}else if(17===vt){for(Tt=yt+3;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}ut-=yt,kt=0,ft=3+(7&(at>>>=yt)),at>>>=3,ut-=3}else{for(Tt=yt+7;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}ut-=yt,kt=0,ft=11+(127&(at>>>=yt)),at>>>=7,ut-=7}if(n.have+ft>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=$;break}for(;ft--;)n.lens[n.have++]=kt}}if(n.mode===$)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=$;break}if(n.lenbits=9,xt={bits:n.lenbits},St=a(l,n.lens,0,n.nlen,n.lencode,0,n.work,xt),n.lenbits=xt.bits,St){t.msg="invalid literal/lengths set",n.mode=$;break}if(n.distbits=6,n.distcode=n.distdyn,xt={bits:n.distbits},St=a(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,xt),n.distbits=xt.bits,St){t.msg="invalid distances set",n.mode=$;break}if(n.mode=U,e===f)break t;case U:n.mode=z;case z:if(ot>=6&&st>=258){t.next_out=rt,t.avail_out=st,t.next_in=nt,t.avail_in=ot,n.hold=at,n.bits=ut,s(t,ct),rt=t.next_out,et=t.output,st=t.avail_out,nt=t.next_in,tt=t.input,ot=t.avail_in,at=n.hold,ut=n.bits,n.mode===j&&(n.back=-1);break}for(n.back=0;_t=(Ot=n.lencode[at&(1<<n.lenbits)-1])>>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(_t&&0==(240&_t)){for(gt=yt,bt=_t,wt=vt;_t=(Ot=n.lencode[wt+((at&(1<<gt+bt)-1)>>gt)])>>>16&255,vt=65535&Ot,!(gt+(yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}at>>>=gt,ut-=gt,n.back+=gt}if(at>>>=yt,ut-=yt,n.back+=yt,n.length=vt,0===_t){n.mode=H;break}if(32&_t){n.back=-1,n.mode=j;break}if(64&_t){t.msg="invalid literal/length code",n.mode=$;break}n.extra=15&_t,n.mode=Y;case Y:if(n.extra){for(Tt=n.extra;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.length+=at&(1<<n.extra)-1,at>>>=n.extra,ut-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=W;case W:for(;_t=(Ot=n.distcode[at&(1<<n.distbits)-1])>>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(0==(240&_t)){for(gt=yt,bt=_t,wt=vt;_t=(Ot=n.distcode[wt+((at&(1<<gt+bt)-1)>>gt)])>>>16&255,vt=65535&Ot,!(gt+(yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}at>>>=gt,ut-=gt,n.back+=gt}if(at>>>=yt,ut-=yt,n.back+=yt,64&_t){t.msg="invalid distance code",n.mode=$;break}n.offset=vt,n.extra=15&_t,n.mode=G;case G:if(n.extra){for(Tt=n.extra;ut<Tt;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}n.offset+=at&(1<<n.extra)-1,at>>>=n.extra,ut-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=$;break}n.mode=V;case V:if(0===st)break t;if(ft=ct-st,n.offset>ft){if((ft=n.offset-ft)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=$;break}ft>n.wnext?(ft-=n.wnext,dt=n.wsize-ft):dt=n.wnext-ft,ft>n.length&&(ft=n.length),mt=n.window}else mt=et,dt=rt-n.offset,ft=n.length;ft>st&&(ft=st),st-=ft,n.length-=ft;do{et[rt++]=mt[dt++]}while(--ft);0===n.length&&(n.mode=z);break;case H:if(0===st)break t;et[rt++]=n.length,st--,n.mode=z;break;case Z:if(n.wrap){for(;ut<32;){if(0===ot)break t;ot--,at|=tt[nt++]<<ut,ut+=8}if(ct-=st,t.total_out+=ct,n.total+=ct,ct&&(t.adler=n.check=n.flags?o(n.check,et,ct,rt-ct):r(n.check,et,ct,rt-ct)),ct=st,(n.flags?at:it(at))!==n.check){t.msg="incorrect data check",n.mode=$;break}at=0,ut=0}n.mode=Q;case Q:if(n.wrap&&n.flags){for(;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<<ut,ut+=8}if(at!==(4294967295&n.total)){t.msg="incorrect length check",n.mode=$;break}at=0,ut=0}n.mode=K;case K:St=m;break t;case $:St=v;break t;case X:return g;case J:default:return _}return t.next_out=rt,t.avail_out=st,t.next_in=nt,t.avail_in=ot,n.hold=at,n.bits=ut,(n.wsize||ct!==t.avail_out&&n.mode<$&&(n.mode<Z||e!==h))&&pt(t,t.output,t.next_out,ct-t.avail_out)?(n.mode=X,g):(lt-=t.avail_in,ct-=t.avail_out,t.total_in+=lt,t.total_out+=ct,n.total+=ct,n.wrap&&ct&&(t.adler=n.check=n.flags?o(n.check,et,ct,t.next_out-ct):r(n.check,et,ct,t.next_out-ct)),t.data_type=n.bits+(n.last?64:0)+(n.mode===j?128:0)+(n.mode===U||n.mode===L?256:0),(0===lt&&0===ct||e===h)&&St===d&&(St=b),St)},e.inflateEnd=function(t){if(!t||!t.state)return _;var e=t.state;return e.window&&(e.window=null),t.state=null,d},e.inflateGetHeader=function(t,e){var n;return t&&t.state?0==(2&(n=t.state).wrap)?_:(n.head=e,e.done=!1,d):_},e.inflateSetDictionary=function(t,e){var n,i=e.length;return t&&t.state?0!==(n=t.state).wrap&&n.mode!==R?_:n.mode===R&&r(1,e,i,0)!==n.check?v:pt(t,e,i,i)?(n.mode=X,g):(n.havedict=1,d):_},e.inflateInfo="pako inflate (from Nodeca project)"},function(t,e,n){"use strict";var i=n(181),r=n(23),o=n(100),s=n(98),a=n(68),u=n(99),l=n(178),c=Object.prototype.toString;function h(t){if(!(this instanceof h))return new h(t);this.options=r.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK)throw new Error(a[n]);this.header=new l,i.inflateGetHeader(this.strm,this.header)}function p(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}h.prototype.push=function(t,e){var n,a,u,l,h,p,f=this.strm,d=this.options.chunkSize,m=this.options.dictionary,y=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?f.input=o.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new r.Buf8(d),f.next_out=0,f.avail_out=d),(n=i.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&m&&(p="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,n=i.inflateSetDictionary(this.strm,p)),n===s.Z_BUF_ERROR&&!0===y&&(n=s.Z_OK,y=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&n!==s.Z_STREAM_END&&(0!==f.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(f.output,f.next_out),l=f.next_out-u,h=o.buf2string(f.output,u),f.next_out=l,f.avail_out=d-l,l&&r.arraySet(f.output,f.output,u,l,0),this.onData(h)):this.onData(r.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(y=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=h,e.inflate=p,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,p(t,e)},e.ungzip=p},function(t,e,n){"use strict";var i=n(23),r=4,o=0,s=1,a=2;function u(t){for(var e=t.length;--e>=0;)t[e]=0}var l=0,c=1,h=2,p=29,f=256,d=f+1+p,m=30,y=19,_=2*d+1,v=15,g=16,b=7,w=256,k=16,S=17,x=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],O=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=new Array(2*(d+2));u(C);var E=new Array(2*m);u(E);var M=new Array(512);u(M);var R=new Array(256);u(R);var j=new Array(p);u(j);var N,F,L,D=new Array(m);function q(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function I(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function B(t){return t<256?M[t]:M[256+(t>>>7)]}function U(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function z(t,e,n){t.bi_valid>g-n?(t.bi_buf|=e<<t.bi_valid&65535,U(t,t.bi_buf),t.bi_buf=e>>g-t.bi_valid,t.bi_valid+=n-g):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=n)}function Y(t,e,n){z(t,n[2*e],n[2*e+1])}function W(t,e){var n=0;do{n|=1&t,t>>>=1,n<<=1}while(--e>0);return n>>>1}function G(t,e,n){var i,r,o=new Array(v+1),s=0;for(i=1;i<=v;i++)o[i]=s=s+n[i-1]<<1;for(r=0;r<=e;r++){var a=t[2*r+1];0!==a&&(t[2*r]=W(o[a]++,a))}}function V(t){var e;for(e=0;e<d;e++)t.dyn_ltree[2*e]=0;for(e=0;e<m;e++)t.dyn_dtree[2*e]=0;for(e=0;e<y;e++)t.bl_tree[2*e]=0;t.dyn_ltree[2*w]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function H(t){t.bi_valid>8?U(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Z(t,e,n,i){var r=2*e,o=2*n;return t[r]<t[o]||t[r]===t[o]&&i[e]<=i[n]}function Q(t,e,n){for(var i=t.heap[n],r=n<<1;r<=t.heap_len&&(r<t.heap_len&&Z(e,t.heap[r+1],t.heap[r],t.depth)&&r++,!Z(e,i,t.heap[r],t.depth));)t.heap[n]=t.heap[r],n=r,r<<=1;t.heap[n]=i}function K(t,e,n){var i,r,o,s,a=0;if(0!==t.last_lit)do{i=t.pending_buf[t.d_buf+2*a]<<8|t.pending_buf[t.d_buf+2*a+1],r=t.pending_buf[t.l_buf+a],a++,0===i?Y(t,r,e):(Y(t,(o=R[r])+f+1,e),0!==(s=T[o])&&z(t,r-=j[o],s),Y(t,o=B(--i),n),0!==(s=O[o])&&z(t,i-=D[o],s))}while(a<t.last_lit);Y(t,w,e)}function $(t,e){var n,i,r,o=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.has_stree,u=e.stat_desc.elems,l=-1;for(t.heap_len=0,t.heap_max=_,n=0;n<u;n++)0!==o[2*n]?(t.heap[++t.heap_len]=l=n,t.depth[n]=0):o[2*n+1]=0;for(;t.heap_len<2;)o[2*(r=t.heap[++t.heap_len]=l<2?++l:0)]=1,t.depth[r]=0,t.opt_len--,a&&(t.static_len-=s[2*r+1]);for(e.max_code=l,n=t.heap_len>>1;n>=1;n--)Q(t,o,n);r=u;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Q(t,o,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,o[2*r]=o[2*n]+o[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,o[2*n+1]=o[2*i+1]=r,t.heap[1]=r++,Q(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,o,s,a,u=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,d=e.stat_desc.max_length,m=0;for(o=0;o<=v;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<_;n++)(o=u[2*u[2*(i=t.heap[n])+1]+1]+1)>d&&(o=d,m++),u[2*i+1]=o,i>l||(t.bl_count[o]++,s=0,i>=f&&(s=p[i-f]),a=u[2*i],t.opt_len+=a*(o+s),h&&(t.static_len+=a*(c[2*i+1]+s)));if(0!==m){do{for(o=d-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[d]--,m-=2}while(m>0);for(o=d;0!==o;o--)for(i=t.bl_count[o];0!==i;)(r=t.heap[--n])>l||(u[2*r+1]!==o&&(t.opt_len+=(o-u[2*r+1])*u[2*r],u[2*r+1]=o),i--)}}(t,e),G(o,l,t.bl_count)}function X(t,e,n){var i,r,o=-1,s=e[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++a<u&&r===s||(a<l?t.bl_tree[2*r]+=a:0!==r?(r!==o&&t.bl_tree[2*r]++,t.bl_tree[2*k]++):a<=10?t.bl_tree[2*S]++:t.bl_tree[2*x]++,a=0,o=r,0===s?(u=138,l=3):r===s?(u=6,l=3):(u=7,l=4))}function J(t,e,n){var i,r,o=-1,s=e[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),i=0;i<=n;i++)if(r=s,s=e[2*(i+1)+1],!(++a<u&&r===s)){if(a<l)do{Y(t,r,t.bl_tree)}while(0!=--a);else 0!==r?(r!==o&&(Y(t,r,t.bl_tree),a--),Y(t,k,t.bl_tree),z(t,a-3,2)):a<=10?(Y(t,S,t.bl_tree),z(t,a-3,3)):(Y(t,x,t.bl_tree),z(t,a-11,7));a=0,o=r,0===s?(u=138,l=3):r===s?(u=6,l=3):(u=7,l=4)}}u(D);var tt=!1;function et(t,e,n,r){z(t,(l<<1)+(r?1:0),3),function(t,e,n,r){H(t),r&&(U(t,n),U(t,~n)),i.arraySet(t.pending_buf,t.window,e,n,t.pending),t.pending+=n}(t,e,n,!0)}e._tr_init=function(t){tt||(function(){var t,e,n,i,r,o=new Array(v+1);for(n=0,i=0;i<p-1;i++)for(j[i]=n,t=0;t<1<<T[i];t++)R[n++]=i;for(R[n-1]=i,r=0,i=0;i<16;i++)for(D[i]=r,t=0;t<1<<O[i];t++)M[r++]=i;for(r>>=7;i<m;i++)for(D[i]=r<<7,t=0;t<1<<O[i]-7;t++)M[256+r++]=i;for(e=0;e<=v;e++)o[e]=0;for(t=0;t<=143;)C[2*t+1]=8,t++,o[8]++;for(;t<=255;)C[2*t+1]=9,t++,o[9]++;for(;t<=279;)C[2*t+1]=7,t++,o[7]++;for(;t<=287;)C[2*t+1]=8,t++,o[8]++;for(G(C,d+1,o),t=0;t<m;t++)E[2*t+1]=5,E[2*t]=W(t,5);N=new q(C,T,f+1,d,v),F=new q(E,O,0,m,v),L=new q(new Array(0),P,0,y,b)}(),tt=!0),t.l_desc=new I(t.dyn_ltree,N),t.d_desc=new I(t.dyn_dtree,F),t.bl_desc=new I(t.bl_tree,L),t.bi_buf=0,t.bi_valid=0,V(t)},e._tr_stored_block=et,e._tr_flush_block=function(t,e,n,i){var u,l,p=0;t.level>0?(t.strm.data_type===a&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return s;for(e=32;e<f;e++)if(0!==t.dyn_ltree[2*e])return s;return o}(t)),$(t,t.l_desc),$(t,t.d_desc),p=function(t){var e;for(X(t,t.dyn_ltree,t.l_desc.max_code),X(t,t.dyn_dtree,t.d_desc.max_code),$(t,t.bl_desc),e=y-1;e>=3&&0===t.bl_tree[2*A[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),u=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=u&&(u=l)):u=l=n+5,n+4<=u&&-1!==e?et(t,e,n,i):t.strategy===r||l===u?(z(t,(c<<1)+(i?1:0),3),K(t,C,E)):(z(t,(h<<1)+(i?1:0),3),function(t,e,n,i){var r;for(z(t,e-257,5),z(t,n-1,5),z(t,i-4,4),r=0;r<i;r++)z(t,t.bl_tree[2*A[r]+1],3);J(t,t.dyn_ltree,e-1),J(t,t.dyn_dtree,n-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,p+1),K(t,t.dyn_ltree,t.dyn_dtree)),V(t),i&&H(t)},e._tr_tally=function(t,e,n){return t.pending_buf[t.d_buf+2*t.last_lit]=e>>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(R[n]+f+1)]++,t.dyn_dtree[2*B(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){z(t,c<<1,3),Y(t,w,C),function(t){16===t.bi_valid?(U(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,n){"use strict";var i,r=n(23),o=n(183),s=n(102),a=n(101),u=n(68),l=0,c=1,h=3,p=4,f=5,d=0,m=1,y=-2,_=-3,v=-5,g=-1,b=1,w=2,k=3,S=4,x=0,T=2,O=8,P=9,A=15,C=8,E=286,M=30,R=19,j=2*E+1,N=15,F=3,L=258,D=L+F+1,q=32,I=42,B=69,U=73,z=91,Y=103,W=113,G=666,V=1,H=2,Z=3,Q=4,K=3;function $(t,e){return t.msg=u[e],e}function X(t){return(t<<1)-(t>4?9:0)}function J(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(r.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function et(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function nt(t,e){t.pending_buf[t.pending++]=e}function it(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function rt(t,e){var n,i,r=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,u=t.strstart>t.w_size-D?t.strstart-(t.w_size-D):0,l=t.window,c=t.w_mask,h=t.prev,p=t.strstart+L,f=l[o+s-1],d=l[o+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(l[(n=e)+s]===d&&l[n+s-1]===f&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&o<p);if(i=L-(p-o),o=p-L,i>s){if(t.match_start=e,s=i,i>=a)break;f=l[o+s-1],d=l[o+s]}}}while((e=h[e&c])>u&&0!=--r);return s<=t.lookahead?s:t.lookahead}function ot(t){var e,n,i,o,u,l,c,h,p,f,d=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-D)){r.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=n=t.hash_size;do{i=t.head[--e],t.head[e]=i>=d?i-d:0}while(--n);e=n=d;do{i=t.prev[--e],t.prev[e]=i>=d?i-d:0}while(--n);o+=d}if(0===t.strm.avail_in)break;if(l=t.strm,c=t.window,h=t.strstart+t.lookahead,p=o,f=void 0,(f=l.avail_in)>p&&(f=p),n=0===f?0:(l.avail_in-=f,r.arraySet(c,l.input,l.next_in,f,h),1===l.state.wrap?l.adler=s(l.adler,c,f,h):2===l.state.wrap&&(l.adler=a(l.adler,c,f,h)),l.next_in+=f,l.total_in+=f,f),t.lookahead+=n,t.lookahead+t.insert>=F)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[u+F-1])&t.hash_mask,t.prev[u&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=u,u++,t.insert--,!(t.lookahead+t.insert<F)););}while(t.lookahead<D&&0!==t.strm.avail_in)}function st(t,e){for(var n,i;;){if(t.lookahead<D){if(ot(t),t.lookahead<D&&e===l)return V;if(0===t.lookahead)break}if(n=0,t.lookahead>=F&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==n&&t.strstart-n<=t.w_size-D&&(t.match_length=rt(t,n)),t.match_length>=F)if(i=o._tr_tally(t,t.strstart-t.match_start,t.match_length-F),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=F){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=t.strstart<F-1?t.strstart:F-1,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}function at(t,e){for(var n,i,r;;){if(t.lookahead<D){if(ot(t),t.lookahead<D&&e===l)return V;if(0===t.lookahead)break}if(n=0,t.lookahead>=F&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=F-1,0!==n&&t.prev_length<t.max_lazy_match&&t.strstart-n<=t.w_size-D&&(t.match_length=rt(t,n),t.match_length<=5&&(t.strategy===b||t.match_length===F&&t.strstart-t.match_start>4096)&&(t.match_length=F-1)),t.prev_length>=F&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-F,i=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-F),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+F-1])&t.hash_mask,n=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=F-1,t.strstart++,i&&(et(t,!1),0===t.strm.avail_out))return V}else if(t.match_available){if((i=o._tr_tally(t,0,t.window[t.strstart-1]))&&et(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return V}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=o._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<F-1?t.strstart:F-1,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}function ut(t,e,n,i,r){this.good_length=t,this.max_lazy=e,this.nice_length=n,this.max_chain=i,this.func=r}function lt(t){var e;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=T,(e=t.state).pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?I:W,t.adler=2===e.wrap?0:1,e.last_flush=l,o._tr_init(e),d):$(t,y)}function ct(t){var e,n=lt(t);return n===d&&((e=t.state).window_size=2*e.w_size,J(e.head),e.max_lazy_match=i[e.level].max_lazy,e.good_match=i[e.level].good_length,e.nice_match=i[e.level].nice_length,e.max_chain_length=i[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=F-1,e.match_available=0,e.ins_h=0),n}function ht(t,e,n,i,o,s){if(!t)return y;var a=1;if(e===g&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),o<1||o>P||n!==O||i<8||i>15||e<0||e>9||s<0||s>S)return $(t,y);8===i&&(i=9);var u=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=O,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*j),this.dyn_dtree=new r.Buf16(2*(2*M+1)),this.bl_tree=new r.Buf16(2*(2*R+1)),J(this.dyn_ltree),J(this.dyn_dtree),J(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(N+1),this.heap=new r.Buf16(2*E+1),J(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*E+1),J(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return t.state=u,u.strm=t,u.wrap=a,u.gzhead=null,u.w_bits=i,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+F-1)/F),u.window=new r.Buf8(2*u.w_size),u.head=new r.Buf16(u.hash_size),u.prev=new r.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new r.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=e,u.strategy=s,u.method=n,ct(t)}i=[new ut(0,0,0,0,function(t,e){var n=65535;for(n>t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),0===t.lookahead&&e===l)return V;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,et(t,!1),0===t.strm.avail_out))return V;if(t.strstart-t.block_start>=t.w_size-D&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),V)}),new ut(4,4,8,4,st),new ut(4,5,16,8,st),new ut(4,6,32,32,st),new ut(4,4,16,16,at),new ut(8,16,32,32,at),new ut(8,16,128,128,at),new ut(8,32,128,256,at),new ut(32,128,258,1024,at),new ut(32,258,258,4096,at)],e.deflateInit=function(t,e){return ht(t,e,O,A,C,x)},e.deflateInit2=ht,e.deflateReset=ct,e.deflateResetKeep=lt,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?y:(t.state.gzhead=e,d):y},e.deflate=function(t,e){var n,r,s,u;if(!t||!t.state||e>f||e<0)return t?$(t,y):y;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||r.status===G&&e!==p)return $(t,0===t.avail_out?v:y);if(r.strm=t,n=r.last_flush,r.last_flush=e,r.status===I)if(2===r.wrap)t.adler=0,nt(r,31),nt(r,139),nt(r,8),r.gzhead?(nt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),nt(r,255&r.gzhead.time),nt(r,r.gzhead.time>>8&255),nt(r,r.gzhead.time>>16&255),nt(r,r.gzhead.time>>24&255),nt(r,9===r.level?2:r.strategy>=w||r.level<2?4:0),nt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(nt(r,255&r.gzhead.extra.length),nt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=B):(nt(r,0),nt(r,0),nt(r,0),nt(r,0),nt(r,0),nt(r,9===r.level?2:r.strategy>=w||r.level<2?4:0),nt(r,K),r.status=W);else{var _=O+(r.w_bits-8<<4)<<8;_|=(r.strategy>=w||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(_|=q),_+=31-_%31,r.status=W,it(r,_),0!==r.strstart&&(it(r,t.adler>>>16),it(r,65535&t.adler)),t.adler=1}if(r.status===B)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending!==r.pending_buf_size));)nt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=U)}else r.status=U;if(r.status===U)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending===r.pending_buf_size)){u=1;break}u=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,nt(r,u)}while(0!==u);r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===u&&(r.gzindex=0,r.status=z)}else r.status=z;if(r.status===z)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending===r.pending_buf_size)){u=1;break}u=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,nt(r,u)}while(0!==u);r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===u&&(r.status=Y)}else r.status=Y;if(r.status===Y&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&tt(t),r.pending+2<=r.pending_buf_size&&(nt(r,255&t.adler),nt(r,t.adler>>8&255),t.adler=0,r.status=W)):r.status=W),0!==r.pending){if(tt(t),0===t.avail_out)return r.last_flush=-1,d}else if(0===t.avail_in&&X(e)<=X(n)&&e!==p)return $(t,v);if(r.status===G&&0!==t.avail_in)return $(t,v);if(0!==t.avail_in||0!==r.lookahead||e!==l&&r.status!==G){var g=r.strategy===w?function(t,e){for(var n;;){if(0===t.lookahead&&(ot(t),0===t.lookahead)){if(e===l)return V;break}if(t.match_length=0,n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}(r,e):r.strategy===k?function(t,e){for(var n,i,r,s,a=t.window;;){if(t.lookahead<=L){if(ot(t),t.lookahead<=L&&e===l)return V;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=F&&t.strstart>0&&(i=a[r=t.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r]){s=t.strstart+L;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&r<s);t.match_length=L-(s-r),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=F?(n=o._tr_tally(t,1,t.match_length-F),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}(r,e):i[r.level].func(r,e);if(g!==Z&&g!==Q||(r.status=G),g===V||g===Z)return 0===t.avail_out&&(r.last_flush=-1),d;if(g===H&&(e===c?o._tr_align(r):e!==f&&(o._tr_stored_block(r,0,0,!1),e===h&&(J(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),tt(t),0===t.avail_out))return r.last_flush=-1,d}return e!==p?d:r.wrap<=0?m:(2===r.wrap?(nt(r,255&t.adler),nt(r,t.adler>>8&255),nt(r,t.adler>>16&255),nt(r,t.adler>>24&255),nt(r,255&t.total_in),nt(r,t.total_in>>8&255),nt(r,t.total_in>>16&255),nt(r,t.total_in>>24&255)):(it(r,t.adler>>>16),it(r,65535&t.adler)),tt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?d:m)},e.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==I&&e!==B&&e!==U&&e!==z&&e!==Y&&e!==W&&e!==G?$(t,y):(t.state=null,e===W?$(t,_):d):y},e.deflateSetDictionary=function(t,e){var n,i,o,a,u,l,c,h,p=e.length;if(!t||!t.state)return y;if(2===(a=(n=t.state).wrap)||1===a&&n.status!==I||n.lookahead)return y;for(1===a&&(t.adler=s(t.adler,e,p,0)),n.wrap=0,p>=n.w_size&&(0===a&&(J(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new r.Buf8(n.w_size),r.arraySet(h,e,p-n.w_size,n.w_size,0),e=h,p=n.w_size),u=t.avail_in,l=t.next_in,c=t.input,t.avail_in=p,t.next_in=0,t.input=e,ot(n);n.lookahead>=F;){i=n.strstart,o=n.lookahead-(F-1);do{n.ins_h=(n.ins_h<<n.hash_shift^n.window[i+F-1])&n.hash_mask,n.prev[i&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=i,i++}while(--o);n.strstart=i,n.lookahead=F-1,ot(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=F-1,n.match_available=0,t.next_in=l,t.input=c,t.avail_in=u,n.wrap=a,d},e.deflateInfo="pako deflate (from Nodeca project)"},function(t,e,n){"use strict";var i=n(184),r=n(23),o=n(100),s=n(68),a=n(99),u=Object.prototype.toString,l=0,c=-1,h=0,p=8;function f(t){if(!(this instanceof f))return new f(t);this.options=r.assign({level:c,method:p,chunkSize:16384,windowBits:15,memLevel:8,strategy:h,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==l)throw new Error(s[n]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var d;if(d="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(n=i.deflateSetDictionary(this.strm,d))!==l)throw new Error(s[n]);this._dict_set=!0}}function d(t,e){var n=new f(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}f.prototype.push=function(t,e){var n,s,a=this.strm,c=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(c),a.next_out=0,a.avail_out=c),1!==(n=i.deflate(a,s))&&n!==l)return this.onEnd(n),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==n);return 4===s?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):2!==s||(this.onEnd(l),a.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=f,e.deflate=d,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,d(t,e)}},function(t,e,n){"use strict";var i={};(0,n(23).assign)(i,n(185),n(182),n(98)),t.exports=i},function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=n(186),o=n(10),s=n(16),a=i?"uint8array":"array";function u(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}e.magic="\b\0",o.inherits(u,s),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,t.data),!1)},u.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},e.compressWorker=function(t){return new u("Deflate",t)},e.uncompressWorker=function(){return new u("Inflate",{})}},function(t,e,n){"use strict";var i=n(103),r=n(177);e.generateWorker=function(t,e,n){var o=new r(e.streamFiles,n,e.platform,e.encodeFileName),s=0;try{t.forEach(function(t,n){s++;var r=function(t,e){var n=t||e,r=i[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,e.compression),a=n.options.compressionOptions||e.compressionOptions||{},u=n.dir,l=n.date;n._compressWorker(r,a).withStreamInfo("file",{name:t,dir:u,date:l,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)}),o.entriesCount=s}catch(t){o.error(t)}return o}},function(t,e,n){"use strict";var i=n(108),r=n(106),o=n(31),s=n(70),a=n(16),u=function(t,e,n){this.name=t,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=e,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};u.prototype={internalStream:function(t){var e=null,n="string";try{if(!t)throw new Error("No output type specified.");var r="string"===(n=t.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),e=this._decompressWorker();var s=!this._dataBinary;s&&!r&&(e=e.pipe(new o.Utf8EncodeWorker)),!s&&r&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new a("error")).error(t)}return new i(e,n,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof s&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(n,t,e)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof a?this._data:new r(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<l.length;h++)u.prototype[l[h]]=c;t.exports=u},function(t,e,n){"use strict";var i=n(119).Readable;function r(t,e,n){i.call(this,e),this._helper=t;var r=this;t.on("data",function(t,e){r.push(t)||r._helper.pause(),n&&n(e)}).on("error",function(t){r.emit("error",t)}).on("end",function(){r.push(null)})}n(10).inherits(r,i),r.prototype._read=function(){this._helper.resume()},t.exports=r},function(t,e,n){"use strict";var i=n(16),r=n(10);function o(t){i.call(this,"ConvertWorker to "+t),this.destType=t}r.inherits(o,i),o.prototype.processChunk=function(t){this.push({data:r.transformTo(this.destType,t.data),meta:t.meta})},t.exports=o},function(t,e,n){"use strict";(function(e){var n,i,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var o=0,s=new r(c),a=e.document.createTextNode("");s.observe(a,{characterData:!0}),n=function(){a.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};else{var u=new e.MessageChannel;u.port1.onmessage=c,n=function(){u.port2.postMessage(0)}}var l=[];function c(){var t,e;i=!0;for(var n=l.length;n;){for(e=l,l=[],t=-1;++t<n;)e[t]();n=l.length}i=!1}t.exports=function(t){1!==l.push(t)||i||n()}}).call(this,n(22))},function(t,e,n){"use strict";var i=n(192);function r(){}var o={},s=["REJECTED"],a=["FULFILLED"],u=["PENDING"];function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,t!==r&&f(this,t)}function c(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(t,e,n){i(function(){var i;try{i=e(n)}catch(e){return o.reject(t,e)}i===t?o.reject(t,new TypeError("Cannot resolve promise with itself")):o.resolve(t,i)})}function p(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function f(t,e){var n=!1;function i(e){n||(n=!0,o.reject(t,e))}function r(e){n||(n=!0,o.resolve(t,e))}var s=d(function(){e(r,i)});"error"===s.status&&i(s.value)}function d(t,e){var n={};try{n.value=t(e),n.status="success"}catch(t){n.status="error",n.value=t}return n}t.exports=l,l.prototype.catch=function(t){return this.then(null,t)},l.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===s)return this;var n=new this.constructor(r);this.state!==u?h(n,this.state===a?t:e,this.outcome):this.queue.push(new c(n,t,e));return n},c.prototype.callFulfilled=function(t){o.resolve(this.promise,t)},c.prototype.otherCallFulfilled=function(t){h(this.promise,this.onFulfilled,t)},c.prototype.callRejected=function(t){o.reject(this.promise,t)},c.prototype.otherCallRejected=function(t){h(this.promise,this.onRejected,t)},o.resolve=function(t,e){var n=d(p,e);if("error"===n.status)return o.reject(t,n.value);var i=n.value;if(i)f(t,i);else{t.state=a,t.outcome=e;for(var r=-1,s=t.queue.length;++r<s;)t.queue[r].callFulfilled(e)}return t},o.reject=function(t,e){t.state=s,t.outcome=e;for(var n=-1,i=t.queue.length;++n<i;)t.queue[n].callRejected(e);return t},l.resolve=function(t){if(t instanceof this)return t;return o.resolve(new this(r),t)},l.reject=function(t){var e=new this(r);return o.reject(e,t)},l.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);var s=new Array(n),a=0,u=-1,l=new this(r);for(;++u<n;)c(t[u],u);return l;function c(t,r){e.resolve(t).then(function(t){s[r]=t,++a!==n||i||(i=!0,o.resolve(l,s))},function(t){i||(i=!0,o.reject(l,t))})}},l.race=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,i=!1;if(!n)return this.resolve([]);var s=-1,a=new this(r);for(;++s<n;)u=t[s],e.resolve(u).then(function(t){i||(i=!0,o.resolve(a,t))},function(t){i||(i=!0,o.reject(a,t))});var u;return a}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){t.exports=n(56).document&&document.documentElement},function(t,e){t.exports=function(t,e,n){var i=void 0===n;switch(e.length){case 0:return i?t():t.call(n);case 1:return i?t(e[0]):t.call(n,e[0]);case 2:return i?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return i?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return i?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},function(t,e,n){var i,r,o,s=n(111),a=n(196),u=n(195),l=n(109),c=n(56),h=c.process,p=c.setImmediate,f=c.clearImmediate,d=c.MessageChannel,m=0,y={},_=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},v=function(t){_.call(t.data)};p&&f||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return y[++m]=function(){a("function"==typeof t?t:Function(t),e)},i(m),m},f=function(t){delete y[t]},"process"==n(194)(h)?i=function(t){h.nextTick(s(_,t,1))}:d?(o=(r=new d).port2,r.port1.onmessage=v,i=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(t){c.postMessage(t+"","*")},c.addEventListener("message",v,!1)):i="onreadystatechange"in l("script")?function(t){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),_.call(t)}}:function(t){setTimeout(s(_,t,1),0)}),t.exports={set:p,clear:f}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(72);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports=!n(71)&&!n(110)(function(){return 7!=Object.defineProperty(n(109)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(72);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var i=n(201),r=n(200),o=n(199),s=Object.defineProperty;e.f=n(71)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(202),r=n(198);t.exports=n(71)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(56),r=n(112),o=n(111),s=n(203),a=function(t,e,n){var u,l,c,h=t&a.F,p=t&a.G,f=t&a.S,d=t&a.P,m=t&a.B,y=t&a.W,_=p?r:r[e]||(r[e]={}),v=_.prototype,g=p?i:f?i[e]:(i[e]||{}).prototype;for(u in p&&(n=e),n)(l=!h&&g&&void 0!==g[u])&&u in _||(c=l?g[u]:n[u],_[u]=p&&"function"!=typeof g[u]?n[u]:m&&l?o(c,i):y&&g[u]==c?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):d&&"function"==typeof c?o(Function.call,c):c,d&&((_.virtual||(_.virtual={}))[u]=c,t&a.R&&v&&!v[u]&&s(v,u,c)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var i=n(205),r=n(197);i(i.G+i.B,{setImmediate:r.set,clearImmediate:r.clear})},function(t,e,n){n(206),t.exports=n(112).setImmediate},function(t,e,n){t.exports=n(74).PassThrough},function(t,e,n){t.exports=n(74).Transform},function(t,e,n){t.exports=n(26)},function(t,e,n){t.exports=n(73)},function(t,e,n){"use strict";t.exports=o;var i=n(114),r=n(46);function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}r.inherits=n(30),r.inherits(o,i),o.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,n(22))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,o,s,a,u=1,l={},c=!1,h=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},i=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(r=h.documentElement,i=function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&d(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(s+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n<e.length;n++)e[n]=arguments[n+1];var r={callback:t,args:e};return l[u]=r,i(u),u++},p.clearImmediate=f}function f(t){delete l[t]}function d(t){if(c)setTimeout(d,0,t);else{var e=l[t];if(e){c=!0;try{!function(t){var e=t.callback,i=t.args;switch(i.length){case 0:e();break;case 1:e(i[0]);break;case 2:e(i[0],i[1]);break;case 3:e(i[0],i[1],i[2]);break;default:e.apply(n,i)}}(e)}finally{f(t),c=!1}}}}}("undefined"==typeof self?void 0===t?this:t:self)}).call(this,n(22),n(43))},function(t,e,n){(function(t){var i=void 0!==t&&t||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(r.call(setTimeout,i,arguments),clearTimeout)},e.setInterval=function(){return new o(r.call(setInterval,i,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(i,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(214),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(22))},function(t,e){},function(t,e,n){"use strict";var i=n(58).Buffer,r=n(216);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,n,r,o=i.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,n=o,r=a,e.copy(n,r),a+=s.data.length,s=s.next;return o},t}(),r&&r.inspect&&r.inspect.custom&&(t.exports.prototype[r.inspect.custom]=function(){var t=r.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){t.exports=r;var i=n(75).EventEmitter;function r(){i.call(this)}n(30)(r,i),r.Readable=n(74),r.Writable=n(211),r.Duplex=n(210),r.Transform=n(209),r.PassThrough=n(208),r.Stream=r,r.prototype.pipe=function(t,e){var n=this;function r(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",r),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(c(),0===i.listenerCount(this,"error"))throw t}function c(){n.removeListener("data",r),t.removeListener("drain",o),n.removeListener("end",a),n.removeListener("close",u),n.removeListener("error",l),t.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),t.removeListener("close",c)}return n.on("error",l),t.on("error",l),n.on("end",c),n.on("close",c),t.on("close",c),t.emit("pipe",n),t}},function(t,e){e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,u=(1<<a)-1,l=u>>1,c=-7,h=n?r-1:0,p=n?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=l}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,u,l=8*o-r-1,c=(1<<l)-1,h=c>>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*u-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=d,a/=256,r-=8);for(s=s<<r|a,l+=r;l>0;t[n+f]=255&s,f+=d,s/=256,l-=8);t[n+f-d]|=128*m}},function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],i=e[1];return 3*(n+i)/4-i},e.toByteArray=function(t){for(var e,n=l(t),i=n[0],s=n[1],a=new o(function(t,e,n){return 3*(e+n)/4-n}(0,i,s)),u=0,c=s>0?i-4:i,h=0;h<c;h+=4)e=r[t.charCodeAt(h)]<<18|r[t.charCodeAt(h+1)]<<12|r[t.charCodeAt(h+2)]<<6|r[t.charCodeAt(h+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=r[t.charCodeAt(h)]<<2|r[t.charCodeAt(h+1)]>>4,a[u++]=255&e);1===s&&(e=r[t.charCodeAt(h)]<<10|r[t.charCodeAt(h+1)]<<4|r[t.charCodeAt(h+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,o=[],s=0,a=n-r;s<a;s+=16383)o.push(c(t,s,s+16383>a?a:s+16383));1===r?(e=t[n-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return o.join("")};for(var i=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)i[a]=s[a],r[s.charCodeAt(a)]=a;function l(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var r,o,s=[],a=e;a<n;a+=3)r=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),s.push(i[(o=r)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e,n){"use strict";var i=n(31),r=n(10),o=n(16),s=n(108),a=n(107),u=n(70),l=n(189),c=n(188),h=n(57),p=n(176),f=function(t,e,n){var i,s=r.getTypeOf(e),c=r.extend(n||{},a);c.date=c.date||new Date,null!==c.compression&&(c.compression=c.compression.toUpperCase()),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(t=m(t)),c.createFolders&&(i=d(t))&&y.call(this,i,!0);var f="string"===s&&!1===c.binary&&!1===c.base64;n&&void 0!==n.binary||(c.binary=!f),(e instanceof u&&0===e.uncompressedSize||c.dir||!e||0===e.length)&&(c.base64=!1,c.binary=!0,e="",c.compression="STORE",s="string");var _=null;_=e instanceof u||e instanceof o?e:h.isNode&&h.isStream(e)?new p(t,e):r.prepareContent(t,e,c.binary,c.optimizedBinaryString,c.base64);var v=new l(t,_,c);this.files[t]=v},d=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},y=function(t,e){return e=void 0!==e?e:a.createFolders,t=m(t),this.files[t]||f.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function _(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,n,i;for(e in this.files)this.files.hasOwnProperty(e)&&(i=this.files[e],(n=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(n,i))},filter:function(t){var e=[];return this.forEach(function(n,i){t(n,i)&&e.push(i)}),e},file:function(t,e,n){if(1===arguments.length){if(_(t)){var i=t;return this.filter(function(t,e){return!e.dir&&i.test(t)})}var r=this.files[this.root+t];return r&&!r.dir?r:null}return t=this.root+t,f.call(this,t,e,n),this},folder:function(t){if(!t)return this;if(_(t))return this.filter(function(e,n){return n.dir&&t.test(e)});var e=this.root+t,n=y.call(this,e),i=this.clone();return i.root=n.name,i},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var n=this.filter(function(e,n){return n.name.slice(0,t.length)===t}),i=0;i<n.length;i++)delete this.files[n[i].name];return this},generate:function(t){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(t){var e,n={};try{if((n=r.extend(t||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");r.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var a=n.comment||this.comment||"";e=c.generateWorker(this,n,a)}catch(t){(e=new o("error")).error(t)}return new s(e,n.type||"string",n.mimeType)},generateAsync:function(t,e){return this.generateInternalStream(t).accumulate(e)},generateNodeStream:function(t,e){return(t=t||{}).type||(t.type="nodebuffer"),this.generateInternalStream(t).toNodejsStream(e)}};t.exports=v},function(t,e,n){"use strict";function i(){if(!(this instanceof i))return new i;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var t=new i;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}i.prototype=n(222),i.prototype.loadAsync=n(175),i.support=n(24),i.defaults=n(107),i.version="3.1.5",i.loadAsync=function(t,e){return(new i).loadAsync(t,e)},i.external=n(45),t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildZip=e.renderFrames=e.loadPCM=e.loadBuffer=e.spectrum=e.FRAME_STEP=e.FRAME_LENGTH=void 0;var i=l(n(6)),r=l(n(54)),o=l(n(223)),s=n(170),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(133)),u=(l(n(132)),l(n(131)));n(169);function l(t){return t&&t.__esModule?t:{default:t}}var c=e.FRAME_LENGTH=32130,h=e.FRAME_STEP=Math.round(c/4),p=8,f=8;e.spectrum=u.default;var d=e.loadBuffer=function(t){return new Promise(function(e,n){var i=URL.createObjectURL(t),o=new r.default.Buffer(i,function(){URL.revokeObjectURL(i),e(o)},function(t){console.error("err",t),n(t)})})},m=e.loadPCM=function(t){return new Promise(function(e,n){if(t.pcm)return e(t);d(t).then(function(i){var r=i._buffer.getChannelData(0),o=i._buffer.sampleRate;if(!r)return n();console.log(r.length,o),e({file:t,buffer:i,pcm:r,sr:o})})})};e.renderFrames=function(t,e){var n=e.frame_step,r=void 0===n?h:n,o=e.frame_start,s=void 0===o?0:o,a=e.max,u=void 0===a?12:a;return function(e){return new Promise(function(n,o){m(t).then(function(t){t.file,t.buffer;var o=t.pcm,a=t.sr;e({type:i.default.wav2pix.load});for(var l=[],h=0,p=o.length-c,f=Math.round(p*s);f<p&&h<u;f+=r,h+=1)l.push(y(o.slice(f,f+c),a,h));e({type:i.default.wav2pix.finish,message:"Rendered "+h+" images"}),n({pcm:t,frames:l})})})}},e.buildZip=function(t,e,n){var r=n.frame_step,s=void 0===r?h:r,a=n.frame_start,u=void 0===a?0:a,l=n.max,p=void 0===l?1e4:l;return function(n){return new Promise(function(r,a){m(e).then(function(e){e.buffer;var a=e.pcm,l=e.sr;n({type:i.default.wav2pix.load});var h=new o.default,f=h.folder("wav2pix_"+t),d=(a.length-c)/s;console.log(d);for(var m=0,_=a.length-c,v=Math.round(_*u);v<_&&m<p;v+=s,m+=1)m%10==0&&n({type:i.default.wav2pix.progress,progress:{i:m/p*6,n:6}}),y(a.slice(v,v+c),l,m,f);n({type:i.default.wav2pix.finish,message:"Rendered "+m+" images"}),h.generateAsync({type:"blob"}).then(function(e){n({type:i.default.wav2pix.zip,size:e.size}),r({zip:e,filename:"wav2pix_"+t+".zip",count:m})})})})}};function y(t,e,n,i){var r=u.default.toSpectrum(t,e),o=a.raw_spectrum(r,0,256,0,256,p,f),l=o.canvas,c=o.imageData;if(i){var h=(0,s.sprintf)("frame_%05d.png",n),d=l.toDataURL("image/png");i.file(h,d.split(",")[1],{base64:!0})}return{fft:r,canvas:l,imageData:c}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=_(n(29)),l=_(n(4)),c=y(n(77)),h=y(n(76)),p=n(11),f=y(n(62)),d=y(n(224)),m=y(n(134));_(n(60));function y(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function _(t){return t&&t.__esModule?t:{default:t}}var v=function(){return(0,u.default)().format("_YYYYMMDD_HHmm")},g=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));n.state={file:null,pcm:null,name:"",datasetName:"",frames:[],frame_start:0,max:1e3,preview_count:32,frame_step:d.FRAME_STEP};var i=document.createElement("audio");return i.addEventListener("loadedmetadata",function(){var t=i.duration,e=Math.floor((44100*t-d.FRAME_LENGTH)/n.state.frame_step);n.setState({duration:t,max:Math.min(n.state.max,e,1e3)})}),n.audioElement=i,n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"pickFile",value:function(t){var e=this,n=t.name.split(".")[0].replace(/\s+/g,"_").replace(/-/g,"_").replace(/_+/g,"_");this.setState({file:t,name:n+v(),datasetName:n,pcm:""},function(){e.rebuildFrames()}),this.audioElement.src=URL.createObjectURL(t)}},{key:"rebuildFrames",value:function(){var t=this,e=this.state,n=e.file,r=e.pcm,o=e.frame_step,s=e.frame_start,a=e.preview_count;this.props.wav2pix.renderFrames(r||n,{frame_start:s,frame_step:o,max:a}).then(function(e){console.log("got frames",e.frames.length),t.setState(i({},t.state,{frames:e.frames,pcm:e.pcm}))})}},{key:"buildZip",value:function(){var t=this,e=this.state,n=e.pcm,i=e.file,r=e.max,o=e.frame_step,s=e.frame_start;this.props.wav2pix.buildZip(this.state.name,n||i,{frame_start:s,frame_step:o,max:r}).then(function(e){var n=e.zip,i=e.filename,s=e.count;t.props.datasetActions.uploadFile(t.props.module,t.props.folder,n,i,{count:s,max:r,frame_step:o,frame_size:d.FRAME_LENGTH/44100})})}},{key:"playFrame",value:function(t){var e=this;return function(){var n=e.state.frames[t];m.play(n)}}},{key:"render",value:function(){for(var t=this,e=this.state,n=e.file,i=(e.frames,[]),r=0,s=e.preview_count;r<s;r++)i.push((0,o.h)("canvas",{key:r,onClick:this.playFrame(r)}));return(0,o.h)("div",{className:"row"},(0,o.h)("div",{className:"col spectrogramBuilder"},(0,o.h)(p.Group,{title:"Spectrogram Builder"},(0,o.h)("p",null,"Convert your sounds into spectrograms. ","Sound files can be WAV, MP3, AIFF, or FLAC. "),(0,o.h)(p.FileUpload,{title:"Choose a sound file",accept:"audio/*",onUpload:function(e){return t.pickFile(e)}}),n&&this.renderMetadata(n))),(0,o.h)("div",{ref:function(e){t.canvases=e},className:"thumbs",id:"pix2wav_canvases"},i))}},{key:"renderMetadata",value:function(t){var e=this,n=this.state,i=n.duration,r=(n.preview_count,l.default.hush_size(t.size)),s=Math.floor((44100*i-d.FRAME_LENGTH)/this.state.frame_step),a=Math.round(d.FRAME_LENGTH/44100*1e3)+" ms.",c=Math.round(this.state.frame_step/44100*1e3)+" ms.";return(0,o.h)("div",{className:"fileMetadata"},(0,o.h)(p.Group,{title:"Metadata"},(0,o.h)(p.Param,{title:"Name"},t.name),(0,o.h)(p.Param,{title:"Type"},t.type),(0,o.h)(p.Param,{title:"Size"},(0,o.h)("span",{className:r[0]},r[1])),(0,o.h)(p.Param,{title:"Date"},(0,u.default)(t.lastModifiedDate).format("YYYY-MM-DD h:mm a")),(0,o.h)(p.Param,{title:"Duration"},Math.floor(i)+" s."),(0,o.h)("br",null),(0,o.h)(p.Param,{title:"Frames"},s),(0,o.h)(p.Param,{title:"Frame Size"},a),(0,o.h)(p.Param,{title:"Frame Step"},c),(0,o.h)(p.Param,{title:"FFT Size"},d.spectrum.fft_size),(0,o.h)("br",null),(0,o.h)(p.Param,{title:"Status"},this.props.pix2wav.status),(0,o.h)("br",null)),(0,o.h)(p.Group,{title:"Data settings"},(0,o.h)(p.TextInput,{title:"Dataset name",onChange:function(t){return e.setState({name:t.target.value})},value:this.state.name}),(0,o.h)(p.Slider,{name:"Starting Frame",min:0,max:1,type:"float",value:this.state.frame_start,defaultValue:0,onChange:function(t){e.setState({frame_start:t},function(){e.rebuildFrames()})}}),(0,o.h)(p.Slider,{name:"No. Frames",min:10,max:Math.min(s,1e3),type:"int",value:this.state.max,defaultValue:Math.min(s,300),onChange:function(t){return e.setState({max:t})}}),(0,o.h)(p.Slider,{name:"Frame step",min:10,max:2e4,type:"int",value:this.state.frame_step,defaultValue:d.FRAME_STEP,onChange:function(t){var n=Math.floor((44100*i-d.FRAME_LENGTH)/t);e.setState({name:e.state.datasetName+"_step_"+t+v(),frame_step:t,max:Math.min(e.state.max,n)},function(){e.rebuildFrames()})}}),(0,o.h)(p.Button,{onClick:function(){return e.buildZip()}},"Upload Frames")),(0,o.h)(p.Progress,null))}},{key:"componentDidUpdate",value:function(){var t=this;(this.state.frames||[]).map(function(e,n){var i=t.canvases.children[n],r=i.getContext("2d-lodpi");i.width=e.canvas.width,i.height=e.canvas.height,r.drawImage(e.canvas,0,0)})}}]),e}();e.default=(0,a.connect)(function(t){return{pix2wav:t.module.pix2wav,upload:t.upload}},function(t,e){return{datasetActions:(0,s.bindActionCreators)(f,t),actions:(0,s.bindActionCreators)(c,t),remote:(0,s.bindActionCreators)(h,t),wav2pix:(0,s.bindActionCreators)(d,t)}})(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(m(n(4)),d(n(77))),u=d(n(76)),l=m(n(17)),c=(m(n(35)),m(n(28)),m(n(34))),h=(n(21),m(n(225))),p=m(n(27)),f=m(n(60));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("pix2wav.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.pix2wav),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("pix2wav.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/pix2wav/new/"))}},{key:"render",value:function(){var t=this.props,e=t.pix2wav,n=(t.match,t.history),i=((e.data||{}).folderLookup||{})[e.folder_id]||{};return(0,r.h)("div",{className:"app pix2wav"},(0,r.h)("div",{class:"heading"},(0,r.h)("div",{class:"spaced"},(0,r.h)("h1",null,i?i.name:(0,r.h)(l.default,null)),(0,r.h)(c.default,null))),(0,r.h)(h.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:i}),(0,r.h)(p.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:i,history:n,onPickFile:function(t,e){e.preventDefault(),e.stopPropagation(),console.log("picked a file",t)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2wav,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,2)}},"2x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,4)}},"4x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,6)}},"6x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,18)}},"18x")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2wav:t.module.pix2wav}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.history;return(0,i.h)("div",{class:"app pix2wav"},(0,i.h)(r.default,{module:o.default,history:e}))};var i=n(1),r=s(n(28)),o=s(n(60));function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=h(n(7)),a=h(n(4)),u=h(n(227)),l=h(n(226)),c=h(n(167));function h(t){return t&&t.__esModule?t:{default:t}}var p=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("pix2wav"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #bdf, #def)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("pix2wav"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #bdf, #def)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/pix2wav/new/",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2wav/datasets/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2wav/datasets/:id/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2wav/live/",component:c.default}))}}]),t}();e.default={name:"pix2wav",router:p,links:function(){return[{url:"/pix2wav/new/",name:"new"},{url:"/pix2wav/datasets/",name:"datasets"},{url:"/pix2wav/live/",name:"live"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=n(11),l=n(40),c=m(n(19)),h=m(n(38)),p=m(n(32)),f=m(n(33)),d=n(82);(i=d)&&i.__esModule;function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.pix2pixhd.load_directories(),t.actions.live.get_params(),n.changeCheckpoint=n.changeCheckpoint.bind(n),n.changeEpoch=n.changeEpoch.bind(n),n.changeSequence=n.changeSequence.bind(n),n.seek=n.seek.bind(n),n.togglePlaying=n.togglePlaying.bind(n),n.toggleRecording=n.toggleRecording.bind(n),n.handleKeydown=n.handleKeydown.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentWillMount",value:function(){document.addEventListener("keydown",this.handleKeydown)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeydown)}},{key:"componentWillUpdate",value:function(t){t.opt.checkpoint_name&&t.opt.checkpoint_name!==this.props.opt.checkpoint_name&&(console.log("listing epochs"),this.props.actions.live.list_epochs("pix2pixhd",t.opt.checkpoint_name))}},{key:"handleKeydown",value:function(t){if(console.log(t.keyCode),!(t.altKey||t.ctrlKey||t.metaKey))switch(t.keyCode){case 27:t.preventDefault(),this.props.actions.live.set_fullscreen(!this.props.fullscreen)}}},{key:"changeCheckpoint",value:function(t,e){this.props.actions.live.load_epoch(e,"latest")}},{key:"changeEpoch",value:function(t,e){this.props.actions.live.load_epoch(this.props.opt.checkpoint_name,e)}},{key:"changeSequence",value:function(t,e){console.log("load sequence",e),this.props.actions.live.load_sequence(e)}},{key:"seek",value:function(t){var e=Math.floor(t*(parseInt(this.props.frame.sequence_len)||1)+1);console.log("seek to frame",t,e),this.props.actions.live.seek(e)}},{key:"start",value:function(){console.log(this.props.opt);var t=this.props.opt.sequence_name||this.props.pix2pixhd.data.sequences[0].name,e=this.props.opt.checkpoint_name||this.props.pix2pixhd.data.checkpoints[0].name;console.log("starting up!",t,e),this.props.actions.tasks.live_task(t,e,{folder_id:this.props.pix2pixhd.data.resultsFolder.id})}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"togglePlaying",value:function(){this.props.opt.processing?this.props.actions.live.pause():this.props.actions.live.play()}},{key:"toggleRecording",value:function(){this.props.opt.recording?((0,l.stopRecording)(),this.props.actions.live.pause()):(0,l.startRecording)()}},{key:"render",value:function(){var t=this.props,e=t.pix2pixhd,n=t.i18n;if(e.loading)return(0,o.h)(u.Loading,{progress:e.progress});var i=e.data,r=i.folderLookup,s=i.datasetLookup,a=i.sequences.reduce(function(t,e){return t[e.name]=!0,t},{}),l=Object.keys(r).map(function(t){var e=r[t];if("results"!==e.name){var n=e.datasets.map(function(t){return a[t]?t:null}).filter(function(t){return!!t});return{name:e.name,options:n.sort()}}}).filter(function(t){return!!t&&!!t.options.length}).sort(function(t,e){return t.name.localeCompare(e.name)}),c=Object.keys(r).map(function(t){var e=r[t];if("results"!==e.name){var n=e.datasets.map(function(t){return s[t].checkpoints.length?t:null}).filter(function(t){return!!t});return{name:e.name,options:n.sort()}}}).filter(function(t){return!!t&&!!t.options.length}).sort(function(t,e){return t.name.localeCompare(e.name)});return(0,o.h)("div",{className:"app live centered"},(0,o.h)(u.Player,{width:424,height:256,fullscreen:this.props.fullscreen}),(0,o.h)("div",{className:"params row"},(0,o.h)("div",{className:"column"},(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.network.title,noToggle:!0},(0,o.h)(u.Select,{live:!0,name:"send_image",title:n.pix2pixhd.live.network.view_mode,options:["a","b","sequence","recursive"],onChange:this.props.actions.live.set_param}),(0,o.h)(u.SelectGroup,{live:!0,name:"sequence_name",title:n.pix2pixhd.live.network.sequence,options:l,onChange:this.changeSequence}),(0,o.h)(u.SelectGroup,{live:!0,name:"checkpoint_name",title:n.pix2pixhd.live.network.checkpoint,options:c,onChange:this.changeCheckpoint}),(0,o.h)(u.Select,{live:!0,name:"epoch",title:n.pix2pixhd.live.network.epoch,options:this.props.epochs,onChange:this.changeEpoch})),(0,o.h)("div",null,(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.playback.title,name:"sequence_playing"},(0,o.h)(u.Slider,{name:n.pix2pixhd.live.playback.position,min:0,max:1,type:"float",value:(this.props.frame.sequence_i||0)/(this.props.frame.sequence_len||1),onChange:this.seek}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.playback.playback_rate,name:"sequence_step",min:-4,max:4,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.playback.skip_frames,name:"sequence_skip",min:0,max:1e3,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.playback.fade_sequence,name:"fade_sequence",min:0,max:4,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.playback.frame_delay,name:"frame_delay",min:0,max:2,type:"float"}))),(0,o.h)(u.Group,null,this.renderRestartButton(),this.renderLiveButtons(),this.renderRecordButton(),(0,o.h)("p",{class:"last_message"},this.props.last_message))),(0,o.h)("div",{className:"column"},(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.transition.title,name:"transition"},(0,o.h)(u.Slider,{live:!0,name:"transition_period",title:n.pix2pixhd.live.transition.period,min:10,max:5e3,type:"int"}),(0,o.h)(u.Slider,{live:!0,name:"transition_min",title:n.pix2pixhd.live.transition.min,min:.001,max:.2,type:"float"}),(0,o.h)(u.Slider,{live:!0,name:"transition_max",title:n.pix2pixhd.live.transition.max,min:.1,max:1,type:"float"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.recursion.title,name:"recursive"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.recursion.frac,name:"recursive_frac",min:0,max:.5,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.recursion.roll,name:"recurse_roll",min:-64,max:64,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.recursion.axis,name:"recurse_roll_axis",min:0,max:1,type:"int"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.sequence.title,name:"sequence"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.sequence.frac,name:"sequence_frac",min:0,max:1,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.sequence.process_frac,name:"process_frac",min:0,max:1,type:"float"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.transform.title,name:"transform"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.transform.rotate,name:"rotate",min:-1,max:1,type:"float"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.transform.scale,name:"scale",min:.9,max:1.1,type:"float"}))),(0,o.h)("div",{className:"column"},(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.clahe.title,name:"clahe"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.clahe.clip_limit,name:"clip_limit",min:1,max:4,type:"float"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.posterize.title,name:"posterize"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.posterize.spatial_window,name:"spatial_window",min:2,max:128,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.posterize.color_window,name:"color_window",min:2,max:128,type:"int"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.blur.title,name:"blur"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.blur.radius,name:"blur_radius",min:3,max:7,type:"odd"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.blur.sigma,name:"blur_sigma",min:0,max:2,type:"float"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.canny.title,name:"canny"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.canny.lo,name:"canny_lo",min:10,max:200,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.canny.hi,name:"canny_hi",min:10,max:200,type:"int"})),(0,o.h)(u.ParamGroup,{title:n.pix2pixhd.live.hsl.title,name:"hsl"},(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.hsl.hue,name:"hue",min:-127,max:127,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.hsl.saturation,name:"saturation",min:-255,max:255,type:"int"}),(0,o.h)(u.Slider,{live:!0,title:n.pix2pixhd.live.hsl.luminosity,name:"luminosity",min:-255,max:255,type:"int"})))))}},{key:"renderRestartButton",value:function(){var t=this,e=this.props.i18n;return"IDLE"===this.props.runner.gpu.status?(0,o.h)(u.Button,{title:e.gpu.idle,onClick:function(){return t.start()}},e.gpu.start):"pix2pixhd"!==this.props.runner.gpu.task.module?(0,o.h)(u.Button,{title:e.gpu.busy,onClick:function(){return t.interrupt()}},e.gpu.interrupt):this.props.opt.processing?(0,o.h)("div",null,(0,o.h)(u.Button,{title:e.gpu.processing,onClick:this.togglePlaying},e.gpu.stop),(0,o.h)(u.Button,{title:e.gpu.busy,onClick:function(){return t.interrupt()}},e.gpu.interrupt)):(0,o.h)("div",null,(0,o.h)(u.Button,{title:e.gpu.not_processing,onClick:this.togglePlaying},e.gpu.restart),(0,o.h)(u.Button,{title:e.gpu.busy,onClick:function(){return t.interrupt()}},e.gpu.interrupt))}},{key:"renderRecordButton",value:function(){return null}},{key:"renderLiveButtons",value:function(){var t=this,e=this.props.i18n;return(0,o.h)("div",null,(0,o.h)(u.Button,{title:e.pix2pixhd.live.record.save_frame,onClick:l.saveFrame},e.pix2pixhd.live.record.save),(0,o.h)(u.ParamGroup,{title:e.pix2pixhd.live.record.record_video,name:"store_b",noDim:!0,onToggle:function(t){}},(0,o.h)(u.TextInput,{title:e.pix2pixhd.live.record.video_name,name:"final_tag",value:this.props.opt.final_tag,onSave:function(e){t.props.actions.live.set_param("final_tag",e)}})))}}]),e}();e.default=(0,a.connect)(function(t){return{last_message:t.live.last_message,fullscreen:t.live.fullscreen,opt:t.live.opt,frame:t.live.frame,checkpoints:t.live.checkpoints,epochs:t.live.epochs,sequences:t.live.sequences,runner:t.system.runner,i18n:t.system.i18n.strings,pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:{live:(0,s.bindActionCreators)(c,t),queue:(0,s.bindActionCreators)(h,t),pix2pixhd:(0,s.bindActionCreators)(f,t),tasks:(0,s.bindActionCreators)(p,t)}}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=(n(8),p(n(29))),l=p(n(4)),c=n(11),h=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(32));p(n(7));function p(t){return t&&t.__esModule?t:{default:t}}var f={dir:"/",cursor:null,selection:null,title:null},d=function(t){function e(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var t=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.state=i({},f),t.handleCursor=t.handleCursor.bind(t),t.handleSelect=t.handleSelect.bind(t),t}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){this.props.checkpoint&&this.reset()}},{key:"componentDidUpdate",value:function(t){this.props.checkpoint!==t.checkpoint&&this.reset()}},{key:"reset",value:function(){var t=this.props.checkpoint;t&&t.sequence&&this.setState(i({},f,{title:t.name+"_"+(0,u.default)().format("YYYYMMDD")}))}},{key:"handleCursor",value:function(t){this.setState({cursor:t})}},{key:"handleSelect",value:function(t){this.setState({selection:t})}},{key:"render",value:function(){var t=this,e=this.props,n=(e.app,e.pix2pixhd,e.remote),i=e.checkpoint,r=e.folder_id,s=(e.processed,this.state),a=s.cursor,u=s.selection,h=s.title,p="sequences/"+i.name;return(0,o.h)("div",{className:"sequenceEditor row"},u?(0,o.h)("div",{className:"form"},(0,o.h)(c.Param,{title:"Selection length"},u.end.i-u.start.i," frames"),(0,o.h)(c.Param,{title:"Duration"},l.default.frameTimestamp(u.end.i-u.start.i)),(0,o.h)(c.Group,{title:"New dataset"},(0,o.h)(c.TextInput,{title:"Title dataset",value:h,onInput:function(e){return t.setState({title:e.replace(/ /g,"_").replace(/\/\./g,"").toLowerCase()})}}),(0,o.h)(c.Button,{title:"Create a new dataset?",onClick:function(){return n.splice_task({title:h,sequence:i.name,selection:u,folder_id:r})}},"Create"))):(0,o.h)("div",{className:"form"},(0,o.h)(c.Group,{title:"New dataset"},"Please select some frames")),(0,o.h)("div",{className:"rows"},(0,o.h)("div",{className:"row"},(0,o.h)(m,{label:"Cursor",path:p,frame:a}),u&&u.start&&(0,o.h)(m,{label:"Selection Start",path:p,frame:u.start}),u&&u.end&&(0,o.h)(m,{label:"Selection End",path:p,frame:u.end})),(0,o.h)(c.Timeline,{sequence:i.sequence,onCursor:this.handleCursor,onSelect:this.handleSelect})))}}]),e}();function m(t){var e=t.label,n=t.path,i=t.frame;return i?(0,o.h)("div",{class:"frame"},(0,o.h)(c.FileViewer,{thumbnail:140,path:n,file:i.frame}),(0,o.h)("div",{class:"spaced"},(0,o.h)("span",null,e),(0,o.h)("span",null,"#",i.i," ",l.default.frameTimestamp(i.i)))):(0,o.h)("div",{class:"frame"})}e.default=(0,a.connect)(function(t){return{app:t.system.app,pix2pixhd:t.module.pix2pixhd}},function(t,e){return{remote:(0,s.bindActionCreators)(h,t)}})(d)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=(d(n(4)),f(n(33))),l=f(n(32)),c=n(11),h=(d(n(35)),d(n(28)),d(n(34)),d(n(27)),d(n(230))),p=d(n(48));function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={dataset:"PLACEHOLDER",epoch:"latest",augment_name:"",augment_take:100,augment_make:20,processed:!1},n.handleChange=n.handleChange.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("pix2pixhd.last_id"),e=localStorage.getItem("pix2pixhd.last_dataset");console.log("load dataset:",t,e);var n=this.props,i=(n.match,n.pix2pixhd),r=n.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("pix2pixhd.last_id",t),i.folder&&i.folder.id===t||r.load_directories(t)):this.props.history.push("/pix2pixhd/new/"),e&&this.setState({dataset:e}))}},{key:"componentDidUpdate",value:function(t,e){var n=this;if(!t.pix2pixhd.data&&this.props.pix2pixhd.data||t.pix2pixhd.data&&e.dataset!==this.state.dataset){var i=this.props.pix2pixhd.data.datasetLookup[this.state.dataset];if(i){var r=i.input.map(function(t){return n.props.pix2pixhd.data.fileLookup[t]}).reduce(function(t,e){return console.log(e),e.processed||t},!1);console.log(i.input,r),i.processed=r,this.setState({processed:r})}}e.dataset!==this.state.dataset&&(localStorage.setItem("pix2pixhd.last_dataset",this.state.dataset),this.setState({epoch:"latest"}),this.props.actions.list_epochs(this.state.dataset),this.props.actions.count_dataset(this.state.dataset))}},{key:"handleChange",value:function(t,e){console.log("name",t,"value",e),this.setState(function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}({},t,e))}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"render",value:function(){var t=this;if(this.props.pix2pixhd.loading)return(0,o.h)(c.Loading,{progress:this.props.pix2pixhd.progress});var e=this.props,n=e.pix2pixhd,i=(e.match,e.history,n.data||{}),r=i.folderLookup,s=i.datasetLookup,a=((r||{})[n.folder_id],n.checkpoint),u=Object.keys(r).map(function(e){var n=t.props.pix2pixhd.data.folderLookup[e];if("results"!==n.name){var i=n.datasets.map(function(t){return s[t].isBuilt?t:null}).filter(function(t){return!!t});return{name:n.name,options:i.sort()}}}).filter(function(t){return!!t&&!!t.options.length}).sort(function(t,e){return t.name.localeCompare(e.name)}),l=this.props.pix2pixhd.epochs;return l&&l.length||(l=["latest"]),(0,o.h)("div",{className:"app pix2pixhd"},(0,o.h)("div",{className:"heading"},(0,o.h)("h1",null,"pix2pixhd training")),(0,o.h)("div",{className:"columns"},(0,o.h)("div",{className:"column"},(0,o.h)(c.Group,{title:"Sequence"},(0,o.h)(c.SelectGroup,{name:"dataset",title:"Sequence name",options:u,onChange:this.handleChange,placeholder:"Pick a dataset",value:this.state.dataset}),(0,o.h)(c.Select,{title:"Epoch",name:"epoch",options:l,onChange:this.handleChange,value:this.state.epoch})))),a&&a.sequence&&a.sequence.length?this.renderEditor():a&&(0,o.h)("div",null,"Sequence empty, augmentation impossible"))}},{key:"renderEditor",value:function(){var t=this,e=this.props,n=e.pix2pixhd,r=e.queue,s=e.remote,a=this.state,u=a.dataset,l=a.processed,f=n.checkpoint,d=n.folder_id,m=this.props.pix2pixhd.data.datasetLookup[this.state.dataset];return m&&m.folder_id&&(d=m.folder_id||d,console.log("dataset folder id",d)),console.log(m),console.log("so folder id is..",d),(0,o.h)("div",null,(0,o.h)(c.Group,{title:"Sequence Editor"},(0,o.h)(h.default,{folder_id:d,module:p.default,checkpoint:f,processed:l})),(0,o.h)("div",{className:"columns"},(0,o.h)("div",{className:"column"},(0,o.h)(c.Group,{title:"Augmentation Grid"},(0,o.h)(c.AugmentationGrid,{checkpoint:f,take:[1,2,3,4,5,10,15,20,25,50,75,100,200,300,400,500,1e3],make:[1,2,3,4,5,10,15,20,25,50,75,100,200],onAugment:function(e,n){s.augment_task(u,i({},t.state,{augment_take:e,augment_make:n}))},onTrain:function(){s.train_task(u,d,1),setTimeout(function(){s.augment_task(u,i({},t.state,{augment_take:10,augment_make:149,no_symlinks:!0,mov:!0,folder_id:n.data.resultsFolder.id}))},250)}})),(0,o.h)(c.Group,{title:"Augment"},(0,o.h)(c.NumberInput,{name:"augment_take",title:"Pick N random frames",value:this.state.augment_take,onChange:this.handleChange,type:"int",min:"1",max:"1000"}),(0,o.h)(c.NumberInput,{name:"augment_make",title:"Generate N recursively",value:this.state.augment_make,onChange:this.handleChange,type:"int",min:"1",max:"1000"}),(0,o.h)(c.Button,{title:"Augment dataset",value:"Augment",onClick:function(){return t.props.remote.augment_task(u,t.state)}}),(0,o.h)(c.Button,{title:"Make a movie without augmenting",value:"Generate",onClick:function(){t.props.remote.augment_task(u,i({},t.state,{no_symlinks:!0,mov:!0,folder_id:n.data.resultsFolder.id}))}})),(0,o.h)(c.Group,{title:"Status"},(0,o.h)(c.Button,{title:"GPU",value:"IDLE"===this.props.runner.gpu.status?"Idle":"Interrupt",onClick:function(){return t.interrupt()}}),(0,o.h)(c.CurrentTask,null))),(0,o.h)("div",{className:"column"},(0,o.h)(c.Group,{title:"Upcoming Tasks"},(0,o.h)(c.TaskList,{tasks:r.queue.map(function(t){return r.tasks[t]}),sort:"date asc"})))))}}]),e}();e.default=(0,a.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd,runner:t.system.runner,queue:t.queue}},function(t,e){return{actions:(0,s.bindActionCreators)(u,t),remote:(0,s.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=(n(8),n(2)),u=(d(n(4)),d(n(7))),l=f(n(33)),c=f(n(32)),h=d(n(17)),p=n(21);function f(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function d(t){return t&&t.__esModule?t:{default:t}}var m=0,y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.pix2pixhd.uprez||t.actions.load_uprez(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){m=0}},{key:"render",value:function(){var t=this;if(!this.props.pix2pixhd.uprez)return(0,o.h)(h.default,{progress:this.props.pix2pixhd.progress});var e=this.props.pix2pixhd.uprez,n=(e.resultsFolder,e.results),i=(e.renders,e.files);return(0,o.h)("div",{className:"app pix2pixhd"},(0,o.h)("div",{className:"heading row middle"},(0,o.h)("h1",null,"Pix2PixHD Uprez")),(0,o.h)("div",{class:"rows params renders"},(0,o.h)("h3",null,"folders on server"),(0,o.h)(p.FileList,{files:n,orderBy:"date desc",fields:"name date count",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)},options:function(e){return console.log(e),(0,o.h)("div",null," ~ ",(0,o.h)("a",{href:"#",onClick:function(){return t.handleUprez(e,{end:250})}},"Uprez 10 seconds")," ~ ",(0,o.h)("a",{href:"#",onClick:function(){return t.handleUprez(e,{end:1500})}},"Uprez 1 minute")," ~ ",(0,o.h)("a",{href:"#",onClick:function(){return t.handleUprez(e)}},"Uprez whole thing"))}}),(0,o.h)("br",null),(0,o.h)("h3",null,"uprezzed videos"),(0,o.h)(p.FileList,{linkFiles:!0,files:i,orderBy:"date desc",fields:"name date size delete",onDelete:function(t){(!(m<3)||confirm("Are you sure you want to delete this file?"))&&(m+=1,console.log("delete: confirmed"),u.default.file.destroy(t))}})))}},{key:"handlePick",value:function(t){}},{key:"handleUprez",value:function(t,e){console.log(t),this.props.remote.uprez_task(i({is_result:!0,dataset:t.name,folder_id:1},e))}}]),e}();e.default=(0,a.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,s.bindActionCreators)(l,t),remote:(0,s.bindActionCreators)(c,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=(n(8),n(2)),a=(f(n(4)),f(n(7))),u=p(n(33)),l=p(n(32)),c=f(n(17)),h=n(21);function p(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function f(t){return t&&t.__esModule?t:{default:t}}var d=0,m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.pix2pixhd.results||t.actions.load_results(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentDidMount",value:function(){d=0}},{key:"render",value:function(){var t=this;if(!this.props.pix2pixhd.results)return(0,r.h)(c.default,{progress:this.props.pix2pixhd.progress});var e=this.props.pix2pixhd.results,n=(e.resultsFolder,e.results),i=e.renders,o=e.files;return(0,r.h)("div",{className:"app pix2pixhd"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"Pix2PixHD Results")),(0,r.h)("div",{class:"rows params renders"},(0,r.h)(h.FileList,{linkFiles:!0,files:o,orderBy:"date desc",fields:"name date size delete",onDelete:function(t){(!(d<3)||confirm("Are you sure you want to delete this file?"))&&(d+=1,console.log("delete: confirmed"),a.default.file.destroy(t))}}),(0,r.h)("br",null),(0,r.h)("h3",null,"renders on server"),(0,r.h)(h.FileList,{files:i,orderBy:"date desc",fields:"name date size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)}}),(0,r.h)("br",null),(0,r.h)("h3",null,"folders on server"),(0,r.h)(h.FileList,{files:n,orderBy:"date desc",fields:"name date count",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)}})))}},{key:"handlePick",value:function(t){}}]),e}();e.default=(0,s.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(m(n(4)),d(n(33))),u=d(n(32)),l=n(11),c=m(n(35)),h=(m(n(28)),m(n(34))),p=m(n(27)),f=m(n(48));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("pix2pixhd.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.pix2pixhd),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("pix2pixhd.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/pix2pixhd/new/"))}},{key:"render",value:function(){var t=this.props,e=t.pix2pixhd,n=(t.match,t.history),i=((e.data||{}).folderLookup||{})[e.folder_id]||{};return(0,r.h)("div",{className:"app pix2pixhd"},(0,r.h)("div",{class:"heading"},(0,r.h)("div",{class:"spaced"},(0,r.h)("h1",null,i?i.name:(0,r.h)(l.Loading,null)),(0,r.h)(h.default,null))),(0,r.h)("div",{className:"row"},i&&i.name&&"unsorted"!==i.name&&(0,r.h)(c.default,{title:"Add Files",module:f.default,folder:i,canUpload:!0,canAddURL:!0}),(0,r.h)("div",null,(0,r.h)(h.default,null),(0,r.h)(l.CurrentTask,null))),(0,r.h)(p.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:i,history:n,onPickFile:function(t,e){e.preventDefault(),e.stopPropagation(),console.log("picked a file",t)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2pixhd,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,5)}},"5x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,10)}},"10x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,20)}},"20x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,50)}},"50x")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(33)),u=l(n(48));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.pix2pixhd,path:"/pix2pixhd/sequences/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=d(n(7)),a=d(n(4)),u=d(n(235)),l=d(n(234)),c=d(n(233)),h=d(n(232)),p=d(n(231)),f=d(n(229));function d(t){return t&&t.__esModule?t:{default:t}}var m=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("pix2pixhd"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #def, #dfe)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("pix2pixhd"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #def, #dfe)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/new/",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/sequences/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/sequences/:id/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/train/",component:p.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/results/",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/uprez/",component:h.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pixhd/live/",component:f.default}))}}]),t}();e.default={name:"pix2pixhd",router:m,links:function(){return[{url:"/pix2pixhd/new/",name:"folders"},{url:"/pix2pixhd/sequences/",name:"sequences"},{url:"/pix2pixhd/train/",name:"checkpoints"},{url:"/pix2pixhd/results/",name:"results"},{url:"/pix2pixhd/uprez/",name:"uprez"},{url:"/pix2pixhd/live/",name:"live"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),a=n(2),u=n(11),l=n(40),c=d(n(19)),h=d(n(38)),p=d(n(121)),f=d(n(79));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.pix2pix.load_directories(),t.actions.live.get_params(),n.changeCheckpoint=n.changeCheckpoint.bind(n),n.changeEpoch=n.changeEpoch.bind(n),n.changeSequence=n.changeSequence.bind(n),n.seek=n.seek.bind(n),n.togglePlaying=n.togglePlaying.bind(n),n.toggleRecording=n.toggleRecording.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillUpdate",value:function(t){t.opt.checkpoint_name&&t.opt.checkpoint_name!==this.props.opt.checkpoint_name&&this.props.actions.live.list_epochs("pix2pix",t.opt.checkpoint_name)}},{key:"changeCheckpoint",value:function(t,e){this.props.actions.live.load_epoch(e,"latest")}},{key:"changeEpoch",value:function(t,e){this.props.actions.live.load_epoch(this.props.opt.checkpoint_name,e)}},{key:"changeSequence",value:function(t,e){console.log("load sequence",e),this.props.actions.live.load_sequence(e)}},{key:"seek",value:function(t){var e=Math.floor(t*(parseInt(this.props.frame.sequence_len)||1)+1);console.log("seek to frame",t,e),this.props.actions.live.seek(e)}},{key:"start",value:function(){var t=this.props.pix2pix.data.sequences[0].name,e=this.props.pix2pix.data.checkpoints[0].name;console.log("starting up!",t,e),this.props.actions.tasks.live_task(t,e)}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"togglePlaying",value:function(){this.props.opt.processing?this.props.actions.live.pause():this.props.actions.live.play()}},{key:"toggleRecording",value:function(){this.props.opt.recording?((0,l.stopRecording)(),this.props.actions.live.pause()):(0,l.startRecording)()}},{key:"render",value:function(){return this.props.pix2pix.loading?(0,r.h)(u.Loading,null):(0,r.h)("div",{className:"app centered"},(0,r.h)(u.Player,{width:424,height:256}),(0,r.h)("div",{className:"params row"},(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Playback",noToggle:!0},(0,r.h)(u.Select,{name:"send_image",title:"view mode",options:["a","b","sequence","recursive"],onChange:this.props.actions.live.set_param}),(0,r.h)(u.Select,{name:"sequence_name",title:"sequence",options:this.props.pix2pix.data.sequences.map(function(t){return t.name}),onChange:this.changeSequence}),(0,r.h)(u.Select,{name:"checkpoint_name",title:"checkpoint",options:this.props.pix2pix.data.checkpoints.map(function(t){return t.name}),onChange:this.changeCheckpoint}),(0,r.h)(u.Select,{name:"epoch",title:"epoch",options:this.props.epochs,onChange:this.changeEpoch}),(0,r.h)(u.Slider,{name:"position",min:0,max:1,type:"float",value:(this.props.frame.sequence_i||0)/(this.props.frame.sequence_len||1),onChange:this.seek}),(0,r.h)(u.Slider,{live:!0,name:"frame_delay",min:.05,max:2,type:"float"}),this.renderRestartButton(),(0,r.h)(u.Button,{title:this.props.opt.savingVideo?"Saving video...":this.props.opt.recording?"Recording ("+(t=this.props.opt.recordFrames/25,t.toFixed(1)+" s.")+")":"Record video",onClick:this.toggleRecording},this.props.opt.savingVideo?"Saving":this.props.opt.recording?"Recording":"Record"),(0,r.h)(u.Button,{title:"Save frame",onClick:l.saveFrame},"Save"),(0,r.h)(u.ParamGroup,{title:"Render on server",name:"store_b",onToggle:function(t){}}),(0,r.h)("p",{className:"last_message"},this.props.last_message))),(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Transition",name:"transition"},(0,r.h)(u.Slider,{live:!0,name:"transition_period",min:10,max:5e3,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"transition_min",min:.001,max:.2,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"transition_max",min:.1,max:1,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Recursion",name:"recursive"},(0,r.h)(u.Slider,{live:!0,name:"recursive_frac",min:0,max:.5,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"recurse_roll",min:-64,max:64,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"recurse_roll_axis",min:0,max:1,type:"int"})),(0,r.h)(u.ParamGroup,{title:"Sequence",name:"sequence"},(0,r.h)(u.Slider,{live:!0,name:"sequence_frac",min:0,max:.5,type:"float"}),(0,r.h)(u.Slider,{live:!0,name:"process_frac",min:0,max:1,type:"float"}))),(0,r.h)("div",{className:"column"},(0,r.h)(u.ParamGroup,{title:"Clahe",name:"clahe"},(0,r.h)(u.Slider,{live:!0,name:"clip_limit",min:1,max:4,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Posterize",name:"posterize"},(0,r.h)(u.Slider,{live:!0,name:"spatial_window",min:2,max:128,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"color_window",min:2,max:128,type:"int"})),(0,r.h)(u.ParamGroup,{title:"Blur",name:"blur"},(0,r.h)(u.Slider,{live:!0,name:"blur_radius",min:3,max:7,type:"odd"}),(0,r.h)(u.Slider,{live:!0,name:"blur_sigma",min:0,max:2,type:"float"})),(0,r.h)(u.ParamGroup,{title:"Canny Edge Detection",name:"canny"},(0,r.h)(u.Slider,{live:!0,name:"canny_lo",min:10,max:200,type:"int"}),(0,r.h)(u.Slider,{live:!0,name:"canny_hi",min:10,max:200,type:"int"})))));var t}},{key:"renderRestartButton",value:function(){var t=this;return"IDLE"===this.props.runner.gpu.status?(0,r.h)(u.Button,{title:"GPU Idle",onClick:function(){return t.start()}},"Start"):"pix2pix"!==this.props.runner.gpu.task.module?(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"):this.props.opt.processing?(0,r.h)("div",null,(0,r.h)(u.Button,{title:"Processing",onClick:this.togglePlaying},"Stop"),(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt")):(0,r.h)("div",null,(0,r.h)(u.Button,{title:"Not processing",onClick:this.togglePlaying},"Restart"),(0,r.h)(u.Button,{title:"GPU Busy",onClick:function(){return t.interrupt()}},"Interrupt"))}}]),e}();e.default=(0,a.connect)(function(t){return{last_message:t.live.last_message,opt:t.live.opt,frame:t.live.frame,checkpoints:t.live.checkpoints,epochs:t.live.epochs,sequences:t.live.sequences,runner:t.system.runner,pix2pix:t.module.pix2pix}},function(t,e){return{actions:{live:(0,o.bindActionCreators)(c,t),queue:(0,o.bindActionCreators)(h,t),pix2pix:(0,o.bindActionCreators)(f,t),tasks:(0,o.bindActionCreators)(p,t),s:s}}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(m(n(4)),d(n(79))),u=d(n(121)),l=n(11),c=m(n(35)),h=(m(n(28)),m(n(34))),p=m(n(27)),f=m(n(78));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("pix2pix.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.pix2pix),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("pix2pix.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/pix2pix/new/"))}},{key:"render",value:function(){var t=this.props,e=t.pix2pix,n=(t.match,t.history),i=((e.data||{}).folderLookup||{})[e.folder_id]||{};return(0,r.h)("div",{className:"app pix2pix"},(0,r.h)("div",{className:"heading"},(0,r.h)("div",{className:"spaced"},(0,r.h)("h1",null,i?i.name:(0,r.h)(l.Loading,null)),(0,r.h)(h.default,null))),(0,r.h)("div",{className:"row"},i&&i.name&&"unsorted"!==i.name&&(0,r.h)(c.default,{title:"Add Files",module:f.default,folder:i,canUpload:!0,canAddURL:!0}),(0,r.h)("div",null,(0,r.h)(h.default,null),(0,r.h)(l.CurrentTask,null))),(0,r.h)(p.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:i,history:n,onPickFile:function(t,e){e.preventDefault(),e.stopPropagation(),console.log("picked a file",t)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2pix,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(console.log(t),(0,r.h)("div",null,(0,r.h)("div",{className:"actions"},(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,5)}},"5x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,10)}},"10x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,20)}},"20x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,50)}},"50x")),t.isBuilt?(0,r.h)("div",{className:"subtext"},"fetched ",(0,r.h)("span",{className:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{className:"subtext"},"fetching"):(0,r.h)("div",{className:"subtext"},(0,r.h)("span",{className:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch")))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2pix:t.module.pix2pix}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(79)),u=l(n(78));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{pix2pix:t.module.pix2pix}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.pix2pix,path:"/pix2pix/sequences/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=h(n(7)),a=h(n(4)),u=h(n(239)),l=h(n(238)),c=h(n(237));function h(t){return t&&t.__esModule?t:{default:t}}var p=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("pix2pix"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #fde, #ffe)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("pix2pix"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #fde, #ffe)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/pix2pix/new/",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pix/sequences/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pix/sequences/:id/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/pix2pix/live/",component:c.default}))}}]),t}();e.default={name:"pix2pix",router:p,links:function(){return[{url:"/pix2pix/new/",name:"new"},{url:"/pix2pix/sequences/",name:"sequences"},{url:"/pix2pix/live/",name:"live"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.morph_task=void 0;o(n(15)),o(n(14)),o(n(6));var i=o(n(7)),r=o(n(122));function o(t){return t&&t.__esModule?t:{default:t}}e.morph_task=function(t,e){return function(n){if("PLACEHOLDER"!==t.a&&"PLACEHOLDER"!==t.b){var o={module:r.default.name,activity:"morph",dataset:t.a,folder_id:e.id,opt:t};return i.default.queue.add_task(o)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load_data=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=(l(n(15)),l(n(14)),l(n(6))),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(36)),s=l(n(7)),a=l(n(4)),u=l(n(122));function l(t){return t&&t.__esModule?t:{default:t}}e.load_data=function(t){return function(t){var e=u.default.name;a.default.allProgress([o.load(e),s.default.socket.list_sequences({module:"pix2pixhd",dir:"sequences"}),s.default.socket.list_directory({module:e,dir:"renders"})],function(e,n,i){console.log("morph load progress",n,i),t({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"morph"}})}).then(function(e){var n=i(e,3),o=n[0],s=n[1],a=n[2],u=(o.folderLookup,o.fileLookup,o.datasetLookup,o.folders,o.files),l=(o.unsortedFolder,o.resultsFolder);t({type:r.default.morph.load,data:o,app:{resultsFolder:l,files:u,sequences:s,renders:a}})})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=(n(8),n(2)),a=(f(n(4)),f(n(7))),u=p(n(242)),l=p(n(241)),c=f(n(17)),h=n(11);function p(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function f(t){return t&&t.__esModule?t:{default:t}}var d=0,m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return n.state={dataset_module:"pix2pixhd",a:"PLACEHOLDER",b:"PLACEHOLDER",a_offset:0,a_duration:1,a_pos:0,b_offset:0,b_duration:1,b_pos:0,steps:16,dilate:2,frames:32,padding:3,smooth:!0,mode:"mix"},t.morph.data||t.actions.load_data(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentDidMount",value:function(){d=0}},{key:"render",value:function(){var t=this;if(!this.props.morph.app)return(0,r.h)(c.default,{progress:this.props.morph.progress});var e=this.props.morph.app,n=e.resultsFolder,i=e.sequences,o=e.renders,s=e.files,u=i.map(function(t){return[t.name.split("_").slice(0,3).join(" ")+"~ ("+t.count+")",t.name]}),l=i.reduce(function(t,e){return t[e.name]=e,t},{}),p=this.state.frames/25,f=void 0;return this.state.steps/this.state.dilate>64&&"mix"===this.state.mode&&(f=(0,r.h)("span",null,(0,r.h)("br",null),"warning, this will take a while")),(0,r.h)("div",{className:"app morph"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"Morph")),(0,r.h)("div",{className:"rows params renders"},(0,r.h)("div",{className:"column"},(0,r.h)(h.Group,{title:"From"},(0,r.h)(h.Select,{title:"Starting sequence",placeholder:"Please choose a video",value:this.state.a,options:u,onChange:function(e,n){return t.setState({a:n,a_duration:l[n].count,a_pos:0,a_offset:0})}}),(0,r.h)(h.Slider,{title:"Offset",value:this.state.a_pos,min:0,max:1,step:.01,onChange:function(e){return t.setState({a_pos:e,a_offset:Math.floor(e*(t.state.a_duration-t.state.frames))})}})),(0,r.h)(h.Group,{title:"To"},(0,r.h)(h.Select,{title:"Ending sequence",placeholder:"Please choose a video",value:this.state.b,options:u,onChange:function(e,n){return t.setState({b:n,b_duration:l[n].count,b_pos:0,b_offset:0})}}),(0,r.h)(h.Slider,{title:"Offset",value:this.state.b_pos,min:0,max:1,step:.01,onChange:function(e){return t.setState({b_pos:e,b_offset:Math.floor(e*(t.state.b_duration-t.state.frames))})}})),(0,r.h)(h.Group,{title:"Morph Settings"},(0,r.h)(h.Select,{title:"Mode",value:this.state.mode,options:["mix","average","mix_images"],onChange:function(e,n){return t.setState({mode:n})}}),(0,r.h)(h.Slider,{type:"list",title:"Steps",value:this.state.steps,options:[2,4,8,16,32,64,128,256,512,1024,2048,4096],onChange:function(e){return t.setState({steps:e,frames:e*t.state.dilate})}}),(0,r.h)(h.Slider,{type:"list",title:"Dilate",value:this.state.dilate,options:[1,2,4,8,16,32],onChange:function(e){return t.setState({dilate:e,frames:t.state.steps*e})}}),(0,r.h)(h.Checkbox,{title:"Smooth",value:this.state.smooth,onToggle:function(e){return t.setState({smooth:e})}}),(0,r.h)(h.Slider,{type:"int",title:"Padding (in seconds)",value:this.state.padding,min:0,max:30,step:1,onChange:function(e){return t.setState({padding:e})}}),(0,r.h)(h.Button,{title:"Run task",value:"Morph!",onClick:function(){return t.props.remote.morph_task(t.state,n)}}),(0,r.h)("br",null),(0,r.h)(h.Param,{title:"Total length"},p.toFixed(1)+" seconds"),(0,r.h)(h.Param,{title:"Total frames"},this.state.frames+" frames"),f,(0,r.h)("br",null),(0,r.h)(h.CurrentTask,null))),(0,r.h)("h3",null,"morphed videos"),(0,r.h)(h.FileList,{linkFiles:!0,files:s,orderBy:"date desc",fields:"name datetime size delete",onDelete:function(t){(!(d<3)||confirm("Are you sure you want to delete this file?"))&&(d+=1,console.log("delete: confirmed"),a.default.file.destroy(t))}}),(0,r.h)("br",null),(0,r.h)("h3",null,"renders on server"),(0,r.h)(h.FileList,{files:o,orderBy:"date desc",fields:"name datetime time size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)}})))}},{key:"handlePick",value:function(t){}}]),e}();e.default=(0,s.connect)(function(t){return{morph:t.module.morph}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=l(n(7)),a=l(n(4)),u=l(n(243));function l(t){return t&&t.__esModule?t:{default:t}}var c=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("morph"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #def, #dfe)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("morph"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #def, #dfe)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/morph/app/",component:u.default}))}}]),t}();e.default={name:"morph",router:c,links:function(){return[{url:"/morph/app/",name:"morph"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(3),a=n(2),u=n(11),l=n(7),c=(i=l)&&i.__esModule?i:{default:i},h=d(n(50)),p=d(n(37)),f=n(136);function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var y=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=i=m(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={file_id:0},m(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){this.props.biggan.encodings||this.props.actions.biggan.load_encodings()}},{key:"render",value:function(){var t=this,e=this.state.file_id,n=this.props,i=n.opt,r=n.frame,s=this.props.biggan.encodings;return s?(0,o.h)("div",null,(0,o.h)("div",{className:"spacer"},r.i?(0,o.h)("div",{className:"param frame_counter"},(0,o.h)("span",null,"Frame #",r.i),(0,o.h)("var",null,(0,f.frameTimestamp)(r.i))):(0,o.h)("div",{className:"param frame_counter"},(0,o.h)("span",null))),(0,o.h)(u.Group,{title:"Stored Image"},(0,o.h)(u.Slider,{live:!0,name:"encoding_stored_speed",title:"Load speed",min:1,max:250,type:"int"}),(0,o.h)(u.Slider,{live:!0,name:"encoding_stored_n",title:"Image mix",min:0,max:1,type:"float"})),(0,o.h)(u.Group,{title:"Latent to Image Transition"},(0,o.h)(u.Button,{title:"Toggle",onClick:function(){return e&&c.default.live.send_command("switch","encoding_stored_mix")}},e?i.encoding_stored_mix_n<.5?"To Image":"Back to Latent":"Not loaded"),(0,o.h)(u.Slider,{live:!0,name:"encoding_stored_mix_speed",title:"Transition speed",min:1,max:250,type:"int"}),(0,o.h)(u.Slider,{live:!0,name:"encoding_stored_mix_n",title:"Transition mix",min:0,max:1,type:"float"})),(0,o.h)(u.Group,{title:"Encoding Orbit"},(0,o.h)(u.Slider,{live:!0,name:"encoding_orbit_speed",title:"Orbit speed",min:-250,max:250,type:"int"}),(0,o.h)(u.Slider,{live:!0,name:"encoding_orbit_radius",title:"Radius",min:0,max:1,step:.001,type:"float"}),(0,o.h)(u.Button,{title:"Shuffle",onClick:function(){return c.default.live.send_command("switch","encoding_orbit_noise")}},"Spin"),(0,o.h)(u.Slider,{live:!0,name:"encoding_orbit_noise_speed",title:"Shuffle Speed",min:1,max:250,type:"int"})),(0,o.h)("div",{className:"categories encodings",ref:function(e){return t.categoryRef=e}},Object.keys(s).sort().map(function(e){return(0,o.h)("div",{key:e},(0,o.h)("h3",null,e),s[e].map(function(e){return(0,o.h)("img",{key:e.id,src:e.url,onClick:function(){c.default.live.send_command("setEncoding",JSON.stringify({id:e.id})),t.setState({file_id:e.id})}})}))}))):(0,o.h)("div",null,"Loading encodings...")}}]),e}();e.default=(0,a.connect)(function(t){return{last_message:t.live.last_message,opt:t.live.opt,frame:t.live.frame,biggan:t.module.biggan}},function(t,e){return{actions:{biggan:(0,s.bindActionCreators)(p,t),tasks:(0,s.bindActionCreators)(h,t)}}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=(n(3),n(2)),a=n(11),u=n(7),l=(i=u)&&i.__esModule?i:{default:i};c(n(50)),c(n(37));function c(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var h="categories/biggan_all.json",p=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.state={loading:!0,error:!1,categories:{},q:"",fn:""},n.loadCategories(h),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"loadCategories",value:function(t){var e=this;this.setState({loading:!0,fn:t}),console.log("fetching",t),l.default.socket.read_file({module:"biggan",fn:t}).then(function(n){n.name;var i=n.buf;console.log("fetched",t);var r=String.fromCharCode.apply(null,new Uint8Array(i)),o=JSON.parse(r);e.setState({categories:o,loading:!1})}).catch(function(){e.setState({error:!0})})}},{key:"setCategory",value:function(t){l.default.live.send_command("setCategory",String(t))}},{key:"updateQuery",value:function(t){var e=this;this.setState({q:t},function(){e.categoryRef.scrollTo(0,0)})}},{key:"render",value:function(){var t=this,e=this.state,n=e.loading,i=e.q;return n?(0,o.h)("div",{className:"categories"},(0,o.h)(a.Loading,null)):(0,o.h)("div",null,(0,o.h)("div",{className:"search_form"},(0,o.h)("div",{class:"button"}),(0,o.h)("input",{type:"text",className:"categorySearch",value:i,onInput:function(e){return t.updateQuery(e.target.value)}})),(0,o.h)("div",{className:"categories",ref:function(e){return t.categoryRef=e}},this.renderGroup("inanimate"),this.renderGroup("animate")))}},{key:"renderGroup",value:function(t){var e=this,n=this.state,i=n.categories,r=n.q,s=new RegExp(r||".*"),a=i[t],u=Object.keys(a).map(function(t){var n=a[t],i=Object.keys(n).map(function(t){return t.match(s)?(0,o.h)("a",{key:t,onClick:function(){return e.setCategory(n[t])}},t):null}).filter(function(t){return!!t});return i.length?(0,o.h)("div",{key:t},(0,o.h)("h3",null,t),i):null}).filter(function(t){return!!t});return u.length?(0,o.h)("div",null,"animate"===t?(0,o.h)("h2",null,t):null,u):null}}]),e}();e.default=(0,s.connect)(function(t){return{opt:t.live.opt,biggan:t.module.biggan}},function(t,e){return{actions:{}}})(p)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=n(11),u=(n(40),m(n(19))),l=m(n(38)),c=m(n(50)),h=m(n(37)),p=d(n(246)),f=d(n(245));n(4);function d(t){return t&&t.__esModule?t:{default:t}}function m(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.actions.live.get_params(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"start",value:function(){console.log("starting up!"),this.props.actions.tasks.live_task({})}},{key:"interrupt",value:function(){this.props.actions.queue.stop_task("gpu")}},{key:"stop",value:function(){actions.live.send_command("stop","")}},{key:"render",value:function(){var t=this.props,e=(t.biggan,t.actions),n=t.last_message;return(0,r.h)("div",{className:"app live biggan centered"},(0,r.h)("div",{className:"row"},(0,r.h)("div",{className:"column"},(0,r.h)(a.Player,{width:512,height:512,square:!0,fullscreen:this.props.fullscreen})),(0,r.h)("div",{className:"params column audioParams"},(0,r.h)("div",{className:"spacer"},n),(0,r.h)(a.Group,{title:"Player"},this.renderRestartButton()),(0,r.h)(a.Group,{title:"Latent"},(0,r.h)(a.Button,{title:"Shuffle",onClick:function(){return e.live.send_command("switch","latent")}},"Latent"),(0,r.h)(a.Slider,{live:!0,name:"latent_speed",title:"Update Speed",min:1,max:250,type:"int"}),(0,r.h)(a.Slider,{live:!0,name:"truncation",title:"Truncation",min:1e-4,max:4,type:"float"})),(0,r.h)(a.Group,{title:"Label"},(0,r.h)(a.Slider,{live:!0,name:"num_classes",title:"Classes to mix",min:1,max:10,type:"int"}),(0,r.h)(a.Button,{title:"Shuffle",onClick:function(){return e.live.send_command("switch","label")}},"Label"),(0,r.h)(a.Slider,{live:!0,name:"label_speed",title:"Mix Speed",min:1,max:250,type:"int"})),(0,r.h)(a.Group,{title:"Orbit"},(0,r.h)(a.Slider,{live:!0,name:"orbit_speed",title:"Orbit speed",min:-250,max:250,type:"int"}),(0,r.h)(a.Slider,{live:!0,name:"orbit_radius",title:"Radius",min:0,max:1,type:"float"}),(0,r.h)(a.Button,{title:"Shuffle",onClick:function(){return e.live.send_command("switch","orbit_noise")}},"Spin"),(0,r.h)(a.Slider,{live:!0,name:"orbit_noise_speed",title:"Shuffle Speed",min:1,max:250,type:"int"})),(0,r.h)(a.Group,{title:"Saturation"},(0,r.h)(a.Slider,{live:!0,name:"saturation",title:"Amount",min:0,max:4,type:"float"}),(0,r.h)(a.Slider,{live:!0,name:"saturation_mix_n",title:"Saturation mix",min:0,max:1,type:"float"})),(0,r.h)(a.Group,{title:"Scaling"},(0,r.h)(a.Slider,{live:!0,name:"zoom",title:"Zoom",min:-4,max:4,type:"float"}),(0,r.h)(a.Slider,{live:!0,name:"Horizontal",title:"Horizontal",min:-2,max:2,type:"float"}),(0,r.h)(a.Slider,{live:!0,name:"Vertical",title:"Vertical",min:-2,max:2,type:"float"}),(0,r.h)(a.Slider,{live:!0,name:"luminance",title:"Brightness",min:-2,max:2,type:"float"}))),(0,r.h)("div",{className:"params column"},(0,r.h)(p.default,null)),(0,r.h)("div",{className:"params column"},(0,r.h)(f.default,null))))}},{key:"renderRestartButton",value:function(){var t=this,e=this.props.i18n;return"IDLE"===this.props.runner.gpu.status?(0,r.h)(a.Button,{title:e.gpu.idle,onClick:function(){return t.start()}},e.gpu.start):"biggan"!==this.props.runner.gpu.task.module?(0,r.h)(a.Button,{title:e.gpu.busy,onClick:function(){return t.stop()}},e.gpu.interrupt):(0,r.h)("div",null,(0,r.h)(a.Button,{title:e.gpu.busy,onClick:function(){return t.stop()}},e.gpu.stop))}}]),e}();e.default=(0,s.connect)(function(t){return{fullscreen:t.live.fullscreen,opt:t.live.opt,last_message:t.live.last_message,runner:t.system.runner,i18n:t.system.i18n.strings,biggan:t.module.biggan}},function(t,e){return{actions:{live:(0,o.bindActionCreators)(u,t),queue:(0,o.bindActionCreators)(l,t),biggan:(0,o.bindActionCreators)(h,t),tasks:(0,o.bindActionCreators)(c,t)}}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=(n(8),n(2)),a=(f(n(4)),f(n(7))),u=p(n(37)),l=p(n(50)),c=f(n(17)),h=n(21);function p(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function f(t){return t&&t.__esModule?t:{default:t}}var d=0,m=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return t.biggan.results||t.actions.load_results(),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentDidMount",value:function(){d=0}},{key:"render",value:function(){if(!this.props.biggan.results)return(0,r.h)(c.default,{progress:this.props.biggan.progress});var t=this.props.biggan.results,e=(t.resultsFolder,t.results,t.renders,t.files);return(0,r.h)("div",{className:"app biggan"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"BigGAN Results")),(0,r.h)("div",{class:"rows params renders"},(0,r.h)(h.FileList,{linkFiles:!0,files:e,orderBy:"date desc",fields:"name date size delete",onDelete:function(t){(!(d<3)||confirm("Are you sure you want to delete this file?"))&&(d+=1,console.log("delete: confirmed"),a.default.file.destroy(t))}})))}},{key:"handlePick",value:function(t){}}]),e}();e.default=(0,s.connect)(function(t){return{biggan:t.module.biggan}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(3),s=n(2),a=(m(n(4)),d(n(37))),u=d(n(50)),l=n(11),c=m(n(35)),h=(m(n(28)),m(n(34))),p=m(n(27)),f=m(n(61));function d(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}function m(t){return t&&t.__esModule?t:{default:t}}var y=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.datasetActions=n.datasetActions.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"componentWillMount",value:function(){var t=this.props.match.params.id||localStorage.getItem("biggan.last_id");console.log("load dataset:",t);var e=this.props,n=(e.match,e.biggan),i=e.actions;"new"!==t&&(t?(parseInt(t)&&localStorage.setItem("biggan.last_id",t),n.folder&&n.folder.id===t||i.load_directories(t)):this.props.history.push("/biggan/new/"))}},{key:"render",value:function(){var t=this.props,e=t.biggan,n=(t.match,t.history),i=(t.actions,t.tasks),o=((e.data||{}).folderLookup||{})[e.folder_id]||{};return(0,r.h)("div",{className:"app biggan"},(0,r.h)("div",{class:"heading"},(0,r.h)("div",{class:"spaced"},(0,r.h)("h1",null,o?o.name:(0,r.h)(l.Loading,null)),(0,r.h)(h.default,null),(0,r.h)("button",{onClick:function(){return i.invert_task(o.id,o.name)}},"Run inversion task"))),(0,r.h)("div",{className:"row"},o&&o.name&&"unsorted"!==o.name&&(0,r.h)(c.default,{title:"Add Files",module:f.default,folder:o,canUpload:!0,canAddURL:!0}),(0,r.h)("div",null,(0,r.h)(h.default,null),(0,r.h)(l.CurrentTask,null))),(0,r.h)(p.default,{loading:e.loading,progress:e.progress,id:e.folder_id,module:f.default,data:e.data,folder:o,history:n,onPickFile:function(t,e){e.preventDefault(),e.stopPropagation(),console.log("picked a file",t)},datasetActions:this.datasetActions}))}},{key:"datasetActions",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.biggan,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"}),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{biggan:t.module.biggan}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),tasks:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(37)),u=l(n(61));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{biggan:t.module.biggan}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.biggan,path:"/biggan/datasets/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=p(n(7)),a=p(n(4)),u=p(n(250)),l=p(n(249)),c=p(n(248)),h=p(n(247));function p(t){return t&&t.__esModule?t:{default:t}}var f=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)}return i(t,[{key:"componentWillMount",value:function(){s.default.system.changeTool("biggan"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #dfe, #def)"}},{key:"componentWillReceiveProps",value:function(){s.default.system.changeTool("biggan"),document.body.style.backgroundImage="linear-gradient("+(a.default.randint(40)+40)+"deg, #dfe, #def)"}},{key:"render",value:function(){return(0,r.h)("section",null,(0,r.h)(o.Route,{exact:!0,path:"/biggan/new/",component:u.default}),(0,r.h)(o.Route,{exact:!0,path:"/biggan/datasets/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/biggan/datasets/:id/",component:l.default}),(0,r.h)(o.Route,{exact:!0,path:"/biggan/results/",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/biggan/live/",component:h.default}))}}]),t}();e.default={name:"biggan",router:f,links:function(){return[{url:"/biggan/new/",name:"folders"},{url:"/biggan/datasets/",name:"datasets"},{url:"/biggan/results/",name:"results"},{url:"/biggan/live/",name:"live"}]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(1),o=n(3),s=n(8),a=n(2),u=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(81)),l=n(80),c=(i=l)&&i.__esModule?i:{default:i};function h(t){if(!t.to)return(0,r.h)("span",null,t.children);var e=t.to===t.location.pathname?(0,r.h)("b",null,t.children):t.children;return(0,r.h)("span",null,(0,r.h)(s.Link,{to:t.to},e))}e.default=(0,a.connect)(function(t){return{site:t.system.site,app:t.system.app,fps:t.live.fps,playing:t.live.playing,i18n:t.system.i18n.strings}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t)}})(function(t){var e=t.site,n=t.app,i=t.fps,o=t.playing,s=t.actions,a=t.location,u=t.history,l=t.i18n,p=Object.keys(c.default).map(function(t,e){var n=t.replace(/_/," ");return(0,r.h)("option",{value:t,key:e},l.header[n]||n)}),f=c.default[n.tool].links().map(function(t,e){return(0,r.h)(h,{key:e,location:a,to:t.url},l.header[t.name]||t.name)}),d=l.header.site_name||e.name+" cortex";return document.querySelector("title").innerHTML=d,document.body.parentNode.setAttribute("lang",l.language),document.body.setAttribute("section",a.pathname.replace(/[0-9]/g,"").replace(/\//g,"_").replace(/^_/,"").replace(/_$/,"")),(0,r.h)("header",null,(0,r.h)("span",null,(0,r.h)("b",null,d)),(0,r.h)("span",null,(0,r.h)("select",{onChange:function(t){var e=window.location.pathname.split("/");e.shift(),console.log(e),e[0]in c.default&&e[1]&&u.push("/"+t.target.value+"/"+e[1]+"/"),s.changeTool(t.target.value,!0)},value:n.tool},p)),(0,r.h)(h,{location:a,to:"/system"},l.header.system),(0,r.h)(h,{location:a,to:"/dashboard"},l.header.dashboard),(0,r.h)("span",null,f),o&&(0,r.h)("span",null,i," fps"))})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=(n(3),n(2));var s=function(t){function e(t){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this.props,e=(t.title,t.images.map(function(t){return(0,r.h)("div",null,(0,r.h)("img",{src:t.url}))}));return(0,r.h)("div",{class:"gallery"},e)}}]),e}();e.default=(0,o.connect)(function(t){return{}},function(t,e){return{}})(s)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=n(1),s=n(2),a=n(7),u=(i=a)&&i.__esModule?i:{default:i};function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var c={jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif"},h={wav:"audio/wav",mp3:"audio/mp3",flac:"audio/flac",aiff:"audio/aiff"},p={mp4:"video/mp4"},f=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=i=l(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={loading:!1,stale:!1,buffer:{},url:null},l(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,o.Component),r(e,[{key:"componentDidMount",value:function(){this.fetch()}},{key:"componentDidUpdate",value:function(t){this.props.file!==t.file&&this.deferFetch()}},{key:"componentWillUnmount",value:function(){this.state.url&&window.URL.revokeObjectURL(this.state.url)}},{key:"deferFetch",value:function(){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.fetch()},200)}},{key:"fetch",value:function(){var t=this.props,e=t.file,n=t.path,i=t.thumbnail;if(e)if(this.state.loading)this.setState({stale:!0});else{var r=[n||e.path,e.name].join("/").replace("//","/"),o=this.props.app.tool;if(this.setState({buffer:null,loading:!0}),i){var s=parseInt(i)||200;u.default.socket.thumbnail({module:o,fn:r,size:s}).then(this.loadBuffer.bind(this))}else u.default.socket.read_file({module:o,fn:r}).then(this.loadBuffer.bind(this))}}},{key:"loadBuffer",value:function(t){var e=this,n=t.name,i=t.buf,r=y(n);this.state.url&&window.URL.revokeObjectURL(this.state.url);var o=void 0;i&&(o=r in c?d(i,c[r]):r in h?d(i,h[r]):r in p?d(i,p[r]):m(i));var s=this.state.stale;this.setState({ext:r,url:o,buffer:t,loading:!1,stale:!1},function(){s&&e.fetch()})}},{key:"render",value:function(){if(!this.props.file)return(0,o.h)("div",{className:"fileViewer"});var t=this.state,e=t.loading,n=t.buffer,i=t.url,r=t.ext;if(e)return(0,o.h)("div",{className:"fileViewer"},(0,o.h)("span",null,"Loading..."));var s=n.error,a=n.name,u=(n.path,n.date,n.size,n.buf);if(s)return(0,o.h)("div",{className:"fileViewer"},(0,o.h)("span",null,s));if(!a)return(0,o.h)("div",{className:"fileViewer"});if(!u||!i)return(0,o.h)("div",{className:"fileViewer"},(0,o.h)("span",null,"File empty"));var l=void 0;return l=r in c?(0,o.h)("img",{src:i}):r in h?(0,o.h)("audio",{src:i,controls:!0,autoplay:!0}):r in p?(0,o.h)("video",{src:i,controls:!0,autoplay:!0}):(0,o.h)("div",{className:"text"},i),(0,o.h)("div",{className:"fileViewer"},l)}}]),e}(),d=function(t,e){var n=new Uint8Array(t),i=new Blob([n],{type:e});return(window.URL||window.webkitURL).createObjectURL(i)},m=function(t){return String.fromCharCode.apply(null,new Uint8Array(t))},y=function(t){return t.split(".").slice(-1)[0].toLowerCase()};e.default=(0,s.connect)(function(t){return{app:t.system.app}})(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(1),o=(n(3),n(2)),s=n(4),a=(i=s)&&i.__esModule?i:{default:i};e.default=(0,o.connect)(function(t){return t.system.runner},function(t,e){return{}})(function(t){var e=t.cpu,n=t.gpu,i=t.processor,o=void 0;i?o="cpu"===i?"cpu":"gpu":"IDLE"!==n.status?o="gpu":"IDLE"!==e.status&&(o="cpu");var s="cpu"===o?e:n;if(!s)return(0,r.h)("div",null);if("IDLE"===s.status)return(0,r.h)("div",null,o," idle");var u=s.last_message,l=s.pid,c=s.task,h=c.activity,p=c.epoch,f=c.epochs,d=c.dataset,m=c.module;return(0,r.h)("div",{className:"currentTask"},"#",l,": ",(0,r.h)("b",null,m," ",h)," ",(0,r.h)("i",null,d),f?(0,r.h)("span",null,f," epoch",a.default.courtesy_s(f)):"",p?(0,r.h)("span",null,"(currently #",p,")"):"",(0,r.h)("br",null),(0,r.h)("br",null),(0,r.h)("div",{className:"quiet lastMessage"},u))})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2);n(3),function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(n(19));var s=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleClick=n.handleClick.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleClick",value:function(t){clearTimeout(this.timeout);var e=t.target.checked;this.props.onToggle&&this.props.onToggle(e)}},{key:"render",value:function(){var t=this.props.value;this.props.noDim;return(0,r.h)("div",{className:"checkbox param"},(0,r.h)("label",null,(0,r.h)("span",null,this.props.title),(0,r.h)("input",{type:"checkbox",onClick:this.handleClick,checked:t})))}}]),e}();e.default=(0,o.connect)(function(t){return{}},function(t,e){return{}})(s)},function(t,e,n){var i,r,o;r=[e,t],void 0===(o="function"==typeof(i=function(t,e){"use strict";var n={timeout:5e3,jsonpCallback:"callback",jsonpCallbackFunction:null};function i(t){try{delete window[t]}catch(e){window[t]=void 0}}function r(t){var e=document.getElementById(t);e&&document.getElementsByTagName("head")[0].removeChild(e)}e.exports=function(t){var e=arguments.length<=1||void 0===arguments[1]?{}:arguments[1],o=t,s=e.timeout||n.timeout,a=e.jsonpCallback||n.jsonpCallback,u=void 0;return new Promise(function(n,l){var c=e.jsonpCallbackFunction||"jsonp_"+Date.now()+"_"+Math.ceil(1e5*Math.random()),h=a+"_"+c;window[c]=function(t){n({ok:!0,json:function(){return Promise.resolve(t)}}),u&&clearTimeout(u),r(h),i(c)},o+=-1===o.indexOf("?")?"?":"&";var p=document.createElement("script");p.setAttribute("src",""+o+a+"="+c),e.charset&&p.setAttribute("charset",e.charset),p.id=h,document.getElementsByTagName("head")[0].appendChild(p),u=setTimeout(function(){l(new Error("JSONP request to "+t+" timed out")),i(c),r(h),window[c]=function(){i(c)}},s),p.onerror=function(){l(new Error("JSONP request to "+t+" failed")),i(c),r(h),u&&clearTimeout(u)}})}})?i.apply(e,r):i)||(t.exports=o)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tumblr=e.thumbnail=e.loadImage=e.tag=e.parse=e.lookup=e.integrations=void 0;var i=o(n(129)),r=o(n(257));function o(t){return t&&t.__esModule?t:{default:t}}var s=e.integrations=[{type:"image",regex:/\.(jpeg|jpg|gif|png|svg)(\?.*)?$/i,fetch:function(t,e){var n=new Image;n.onload=function(){if(n){var i=n.naturalWidth,r=n.naturalHeight;n=null,e({url:t,type:"image",token:"",thumbnail:"",title:"",width:i,height:r})}},n.src=t,n.complete&&n.onload()},tag:function(t){return'<img src="'+t.url+'">'}},{type:"video",regex:/\.(mp4|webm)(\?.*)?$/i,fetch:function(t,e){var n=document.createElement("video"),i=t.replace(/\?.*$/,"").split("/"),r=i[i.length-1];n.addEventListener("loadedmetadata",function(){var i=n.videoWidth,o=n.videoHeight;n=null,e({url:t,type:"video",token:t,thumbnail:"/public/assets/img/video-thumbnail.png",title:r,width:i,height:o})}),n.src=t,n.load()},tag:function(t){return'<video src="'+t.url+'">'}},{type:"audio",regex:/\.(wav|mp3)(\?.*)?$/i,fetch:function(t,e){var n=document.createElement("audio"),i=t.replace(/\?.*$/,"").split("/"),r=i[i.length-1];n.addEventListener("loadedmetadata",function(){var i=n.duration;n=null,e({url:t,type:"audio",token:t,thumbnail:"/public/assets/img/audio-thumbnail.png",title:r,duration:i})}),n.src=t,n.load()},tag:function(t){return'<audio src="'+t.url+'">'}},{type:"youtube",regex:/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i,fetch:function(t,e){var n=(t.match(/v=([-_a-zA-Z0-9]{11})/i)||t.match(/youtu.be\/([-_a-zA-Z0-9]{11})/i)||t.match(/embed\/([-_a-zA-Z0-9]{11})/i))[1].split("&")[0],i="https://i.ytimg.com/vi/"+n+"/hqdefault.jpg",o=new URL("https://www.googleapis.com/youtube/v3/videos"),s={id:n,key:"AIzaSyA4UK3L2tZ5nHRUELEPk1PG13kxzZkc6qg",part:"id,contentDetails,snippet,status"};Object.keys(s).forEach(function(t){return o.searchParams.append(t,s[t])}),(0,r.default)(o.toString()).then(function(t){return t.json()}).then(function(r){if(console.log(r),!r||!r.items||!r.items.length)return alert("Sorry, this video URL is invalid.");var o,s=r.items[0],a=s.contentDetails.duration.match(/\d+/g).map(function(t){return parseInt(t)});console.log(s,a),o=a?3==a.length?60*a[0]+60*a[1]+a[2]:2==a.length?60*a[0]+a[1]:a[0]:0,["maxres","high","medium","standard","default"].some(function(t){return!!s.snippet.thumbnails[t]&&(i=s.snippet.thumbnails[t].url,!0)}),e({url:t,type:"youtube",token:n,thumbnail:i,title:s.snippet.title,duration:o,width:640,height:360})})},tag:function(t){return'<div class="video" style="width: '+t.width+"px; height: "+t.height+'px; overflow: hidden; position: relative;"><iframe frameborder="0" scrolling="no" seamless="seamless" webkitallowfullscreen="webkitAllowFullScreen" mozallowfullscreen="mozallowfullscreen" allowfullscreen="allowfullscreen" id="okplayer" width="'+t.width+'" height="'+t.height+'" src="https://youtube.com/embed/'+t.token+'?showinfo=0" style="position: absolute; top: 0px; left: 0px; width: '+t.width+"px; height: "+t.height+'px;"></iframe></div>'}},{type:"vimeo",regex:/vimeo.com\/\d+$/i,fetch:function(t,e){var n=t.match(/\d+$/i)[0];(0,i.default)("https://vimeo.com/api/v2/video/"+n+".json").then(function(t){return t.json()}).then(function(i){if(0==i.length)return e(n,"",640,360);var r=i[0];"anywhere"==r.embed_privacy?e({url:t,type:"vimeo",token:n,thumbnail:r.thumbnail_large,duration:r.duration,title:r.title,width:r.width,height:r.height}):alert("Sorry, the author of this video has marked it private, preventing it from being embedded.",function(){})})},tag:function(t){return'<div class="video" style="width: '+t.width+"px; height: "+t.height+'px; overflow: hidden; position: relative;"><iframe frameborder="0" scrolling="no" seamless="seamless" webkitallowfullscreen="webkitAllowFullScreen" mozallowfullscreen="mozallowfullscreen" allowfullscreen="allowfullscreen" id="okplayer" src="https://player.vimeo.com/video/'+t.token+'?api=1&title=0&byline=0&portrait=0&playbar=0&player_id=okplayer&loop=0&autoplay=0" width="'+t.width+'" height="'+t.height+'" style="position: absolute; top: 0px; left: 0px; width: '+t.width+"px; height: "+t.height+'px;"></iframe></div>'}},{type:"link",regex:/^http.+/i,fetch:function(t,e){e({url:t,type:"link",token:"",thumbnail:"",title:"",width:100,height:100})},tag:function(t){return'<a href="'+t.url+'" target="_blank">'+t.url+"</a>"}}],a=e.lookup=s.reduce(function(t,e){return(t[e.type]=e)&&t},{});e.parse=function(t,e){s.some(function(n){return!!n.regex.test(t)&&(n.fetch(t,function(t){e(t)}),!0)})||e(null)},e.tag=function(t){return t.type in a?a[t.type].tag(t):""},e.loadImage=function(t,e,n){a.image.regex.test(t)?a.image.fetch(t,function(t){e(t)}):n&&n()},e.thumbnail=function(t){return'<img src="'+(t.thumbnail||t.url)+'" class="thumb">'},e.tumblr=function(t,e){var n=t.replace(/^https?:\/\//,"").split("/")[0];-1==n.indexOf(".")&&(n+=".tumblr.com"),(0,r.default)("http://"+n+"/api/read").then(function(t){var n=t.posts.reduce(u,[]);e(n)})};function u(t,e){var n=void 0,i=void 0,r=void 0;switch(e.type){case"photo":i=stripHTML(e["photo-caption"]),e.photos.length?e.photos.forEach(function(e){n={url:e["photo-url-1280"],type:"image",token:"",thumbnail:e["photo-url-500"],description:i,width:parseInt(e.width),height:parseInt(e.height)},t.push(n)}):(n={url:e["photo-url-1280"],type:"image",token:"",thumbnail:e["photo-url-500"],description:i,width:parseInt(e.width),height:parseInt(e.height)},t.push(n));break;case"video":if(0!==(r=e["video-source"]).indexOf("http"))break;if(a.youtube.regex.test(r)){var o=(r.match(/v=([-_a-zA-Z0-9]{11})/i)||r.match(/youtu.be\/([-_a-zA-Z0-9]{11})/i)||r.match(/embed\/([-_a-zA-Z0-9]{11})/i))[1].split("&")[0],s="https://i.ytimg.com/vi/"+o+"/hqdefault.jpg";n={url:e["video-source"],type:"youtube",token:o,thumbnail:s,title:stripHTML(e["video-caption"]),width:640,height:360},t.push(n)}}return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.upload_action=void 0,e.crud_upload=o;var i=n(85);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function o(t,e,n,o){return new Promise(function(s,a){var u=n.id;Object.keys(n).forEach(function(t){"id"!==t&&e.append(t,n[t])}),console.log("/api/"+t+"/"+u+"/upload/");var l=new XMLHttpRequest;l.upload.addEventListener("progress",function(e){if(e.lengthComputable){var n=Math.round(100*e.loaded/e.total)||0;n>99?o&&o(r({type:(0,i.as_type)(t,"upload_waiting"),percent:n},t,u)):o&&o(r({type:(0,i.as_type)(t,"upload_progress"),percent:n},t,u))}else o&&o(r({type:(0,i.as_type)(t,"upload_error"),error:"unable to compute upload progress"},t,u))},!1),l.addEventListener("load",function(e){var n=void 0;try{n=JSON.parse(e.target.responseText)}catch(e){return o&&o(r({type:(0,i.as_type)(t,"upload_error"),error:"upload failed"},t,u)),void a(e)}o&&o(r({type:(0,i.as_type)(t,"upload_complete"),data:n},t,u)),n.files&&n.files.length&&n.files.forEach(function(t){console.log(t),o&&o({type:(0,i.as_type)("file","create"),data:t})});s(n)},!1),l.addEventListener("error",function(e){o&&o(r({type:(0,i.as_type)(t,"upload_error"),error:"upload failed"},t,u)),a(e)},!1),l.addEventListener("abort",function(e){o&&o(r({type:(0,i.as_type)(t,"upload_error"),error:"upload cancelled"},t,u)),a(e)},!1),l.open("POST","/api/"+t+"/"+u+"/upload/"),l.send(e),o&&o({type:(0,i.as_type)(t,"upload_loading")})})}e.upload_action=function(t,e,n){return function(i){return o(t,e,n,i)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.crud_action=void 0,e.crud_actions=function(t){var e=(0,i.crud_fetch)(t);return["index","show","create","update","destroy"].reduce(function(n,i){return n[i]=s(t,i,function(t){return e[i](t)}),n},{action:function(e,n){return s(t,e,n)},upload:function(e,n){return(0,o.upload_action)(t,e,n)}})};var i=n(130),r=n(85),o=n(259);var s=e.crud_action=function(t,e,n){return function(i){return function(o){return new Promise(function(s,a){o({type:(0,r.as_type)(t,e+"_loading")}),n(i).then(function(n){o({type:(0,r.as_type)(t,e),data:n}),s(n)}).catch(function(n){o({type:(0,r.as_type)(t,e+"_error")}),a(n)})})}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),s=n(1),a=n(3),u=n(2),l=(n(8),n(11)),c=n(7),h=(i=c)&&i.__esModule?i:{default:i};function p(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var f=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=i=p(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={dir:"/",files:[],file:null,loading:!0},p(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,s.Component),o(e,[{key:"componentDidMount",value:function(){this.fetch(this.state.dir)}},{key:"handlePick",value:function(t){console.log(t),t.dir?this.fetch([this.state.dir,t.name].join("/").replace("//","/")):this.setState({file:r({},t,{path:this.state.dir})})}},{key:"fetch",value:function(t){var e=this;console.log("fetch",t);var n=this.props.app.tool;this.setState({dir:t,file:null,loading:!0}),h.default.socket.list_directory({module:n,dir:t}).then(function(n){console.log(n),e.setState({dir:t,files:n,loading:!1})})}},{key:"render",value:function(){var t=this,e=this.props.app,n=this.state,i=n.loading,r=n.dir,o=n.files,a=n.loadingFile,u=n.file;return console.log(this.props,this.state),(0,s.h)("div",{className:"app browser"},(0,s.h)("h1",null,r,"/"!==r[r.length-1]&&"/"),e.tool,(0,s.h)("br",null),i&&(0,s.h)(l.Loading,null),(0,s.h)(l.FileList,{files:o,groupDirectories:!0,parentDirectory:"/"!==r,orderBy:"name asc",fields:"name datetime size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)},onClickParent:function(e){console.log("navigate up"),t.fetch(r.split("/").slice(0,-1).join("/")||"/")}}),a&&(0,s.h)(l.Loading,null),u&&(0,s.h)(l.FileViewer,{file:u}))}}]),e}();e.default=(0,u.connect)(function(t){return{app:t.system.app}},function(t,e){return{actions:(0,a.bindActionCreators)({},t)}})(f)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=l(n(25)),s=l(n(39)),a=l(n(51)),u=l(n(127));function l(t){return t&&t.__esModule?t:{default:t}}function c(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}var h=function(t){function e(){var t,n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s<r;s++)o[s]=arguments[s];return n=i=c(this,(t=e.__proto__||Object.getPrototypeOf(e)).call.apply(t,[this].concat(o))),i.state={x:0,y:0,sum:0},c(i,n)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"render",value:function(){var t=this,e=this.props,n=e.make,i=e.take,l=e.checkpoint,c=e.onTrain,h=e.onAugment,p=this.state,f=p.x,d=p.y,m=p.sum;return(0,r.h)(o.default,{className:"augmentationGrid"},(0,r.h)(u.default,{x:n,y:i,max:5e3,onHover:function(e,n){return t.setState({x:e,y:n})},onClick:function(e,n){t.setState({sum:m+e*n}),h(n,e)}}),(0,r.h)(s.default,{title:"Name"},l.name),(0,r.h)(s.default,{title:"Take"},d),(0,r.h)(s.default,{title:"Make"},f),(0,r.h)(s.default,{title:"Will add to dataset"},f*d),(0,r.h)(s.default,{title:"Total added this epoch"},m),(0,r.h)(s.default,{title:"Sequence length"},l.sequenceCount),(0,r.h)(s.default,{title:"Dataset size"},l.datasetCount),(0,r.h)(a.default,{onClick:function(){t.setState({sum:0}),c()}},"Train"))}}]),e}();e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(2),s=n(3),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(52));var u=function(t){function e(t){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this,t));return n.handleClick=n.handleClick.bind(n),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,r.Component),i(e,[{key:"handleClick",value:function(t){var e=this.props,n=e.audioPlayer,i=e.actions;n.playing?i.pause():i.resume()}},{key:"render",value:function(){var t=this.props.audioPlayer;return(0,r.h)("div",{className:"audioPlayer"},(0,r.h)("span",null,this.props.title),(0,r.h)("button",{onClick:this.handleClick},t.playing?"▶":"~"))}}]),e}();e.default=(0,o.connect)(function(t){return{audioPlayer:t.audioPlayer}},function(t,e){return{actions:(0,s.bindActionCreators)(a,t)}})(u)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),r=n(1),o=n(8),s=n(3),a=n(2),u=n(20),l=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(53)),c=d(n(128)),h=d(n(91)),p=d(n(90)),f=n(83);function d(t){return t&&t.__esModule?t:{default:t}}function m(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function _(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var v=function(t){function e(){return m(this,e),y(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,r.Component),i(e,[{key:"render",value:function(){var t=this;return(0,r.h)(o.BrowserRouter,null,(0,r.h)("div",null,(0,r.h)("div",{className:"diamond"}),(0,r.h)(o.Route,{exact:!0,path:"/",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/login",component:c.default}),(0,r.h)(o.Route,{exact:!0,path:"/logout",component:h.default}),(0,r.h)(o.Route,{exact:!0,path:"/signup",component:p.default}),(0,r.h)(o.Route,{path:"/:module",component:function(e){switch(e.location.pathname){case"/login":case"/logout":case"/signup":return null}return t.props.actions.setReturnTo(e.location.pathname),(0,r.h)(o.Redirect,{to:"/login"})}})))}},{key:"componentDidMount",value:function(){document.querySelector(".diamond").style.backgroundImage="linear-gradient("+((0,f.randint)(40)-5)+"deg, #fde, #ffe)"}}]),e}(),g=function(t){function e(){return m(this,e),y(this,(e.__proto__||Object.getPrototypeOf(e)).apply(this,arguments))}return _(e,r.Component),i(e,[{key:"render",value:function(){var t=this.props,e=t.auth,n=t.env,i=t.actions;if(n.production&&!e.initialized)return(0,r.h)("div",{className:"loading"},"Loading");if(n.development||e.isAuthenticated){if(e.returnTo){var o=e.returnTo;return o&&!o.match(/(login|logout|signup)/i)||(o="/"),console.log("history.push",o),i.setReturnTo(null),u.history.push(o),(0,r.h)("div",null,"Launching app")}return(0,r.h)("div",null,this.props.children)}return(0,r.h)(v,this.props)}},{key:"componentDidMount",value:function(){this.props.env.production&&this.props.actions.checkin()}}]),e}();e.default=(0,a.connect)(function(t){return{env:t.system.env,auth:t.auth}},function(t){return{actions:(0,s.bindActionCreators)(l,t)}})(g)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=a(n(264)),r=a(n(128)),o=a(n(91)),s=a(n(90));function a(t){return t&&t.__esModule?t:{default:t}}e.default={Gate:i.default,Login:r.default,Logout:o.default,Signup:s.default}},function(t,e,n){"use strict";var i,r=n(20),o=n(6),s=(i=o)&&i.__esModule?i:{default:i};n(41).socket.on("api_res",function(t){t=function(t){if("string"==typeof t)try{var e=JSON.parse(t);return e}catch(e){return console.error("not valid json"),t}return t}(t);var e=s.default[t.datatype];if(console.log("api_res",t.type,t.datatype),!e)return console.error("socket:api_res bad datatype",t.datatype);switch(t.type){case"create":return(0,r.dispatch)({type:e.create,source:"socket",data:t.data});case"update":return(0,r.dispatch)({type:e.update,source:"socket",data:t.data});case"destroy":return(0,r.dispatch)({type:e.destroy,source:"socket",data:t.data})}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stop_queue=e.start_queue=e.stop_task=e.start_task=e.remove_task=e.add_task=void 0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};e.emit=l;var r,o=n(20),s=n(6),a=(r=s)&&r.__esModule?r:{default:r},u=n(41);function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};u.socket.emit("task",i({type:t,task:e},n))}u.socket.on("task_res",function(t){var e=void 0;try{"string"==typeof t?"string"==typeof(e=JSON.parse(t))&&(e=JSON.parse(e)):e=t}catch(t){return void console.warn("problem with json",t)}switch(e.task&&(0,o.dispatch)({type:a.default.task.update,data:e.task}),e.type){case"start":case"stop":break;case"task_begin":(0,o.dispatch)({type:a.default.task.task_begin,task:e.task});break;case"task_finish":(0,o.dispatch)({type:a.default.task.task_finish,task:e.task});break;case"kill":break;case"stdout":return(0,o.dispatch)({type:a.default.system.stdout,data:e});case"stderr":return(0,o.dispatch)({type:a.default.system.stderr,data:e});case"add":case"remove":case"start_queue":case"stop_queue":case"list":case"set_priority":break;case"progress":(0,o.dispatch)({type:a.default.task.progress,task:e.task});break;case"epoch":(0,o.dispatch)({type:a.default.task.epoch,task:e.task});break;case"task_error":return console.log("task error",e);default:return console.log(e),console.log("no such task command",e.type)}});e.add_task=function(t){return l("add",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.remove_task=function(t){return l("remove",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.start_task=function(t){return l("start",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.stop_task=function(t){return l("stop",t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},e.start_queue=function(){return l("start_queue",{},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})},e.stop_queue=function(){return l("stop_queue",{},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})}},function(t,e,n){"use strict";function i(t){if(this.size=0|t,this.size<=1||0!=(this.size&this.size-1))throw new Error("FFT size must be a power of two and bigger than 1");this._csize=t<<1;for(var e=new Array(2*this.size),n=0;n<e.length;n+=2){const t=Math.PI*n/this.size;e[n]=Math.cos(t),e[n+1]=-Math.sin(t)}this.table=e;for(var i=0,r=1;this.size>r;r<<=1)i++;this._width=i%2==0?i-1:i,this._bitrev=new Array(1<<this._width);for(var o=0;o<this._bitrev.length;o++){this._bitrev[o]=0;for(var s=0;s<this._width;s+=2){var a=this._width-s-2;this._bitrev[o]|=(o>>>s&3)<<a}}this._out=null,this._data=null,this._inv=0}t.exports=i,i.prototype.fromComplexArray=function(t,e){for(var n=e||new Array(t.length>>>1),i=0;i<t.length;i+=2)n[i>>>1]=t[i];return n},i.prototype.createComplexArray=function(){const t=new Array(this._csize);for(var e=0;e<t.length;e++)t[e]=0;return t},i.prototype.toComplexArray=function(t,e){for(var n=e||this.createComplexArray(),i=0;i<n.length;i+=2)n[i]=t[i>>>1],n[i+1]=0;return n},i.prototype.completeSpectrum=function(t){for(var e=this._csize,n=e>>>1,i=2;i<n;i+=2)t[e-i]=t[i],t[e-i+1]=-t[i+1]},i.prototype.transform=function(t,e){if(t===e)throw new Error("Input and output buffers must be different");this._out=t,this._data=e,this._inv=0,this._transform4(),this._out=null,this._data=null},i.prototype.realTransform=function(t,e){if(t===e)throw new Error("Input and output buffers must be different");this._out=t,this._data=e,this._inv=0,this._realTransform4(),this._out=null,this._data=null},i.prototype.inverseTransform=function(t,e){if(t===e)throw new Error("Input and output buffers must be different");this._out=t,this._data=e,this._inv=1,this._transform4();for(var n=0;n<t.length;n++)t[n]/=this.size;this._out=null,this._data=null},i.prototype._transform4=function(){var t,e,n=this._out,i=this._csize,r=1<<this._width,o=i/r<<1,s=this._bitrev;if(4===o)for(t=0,e=0;t<i;t+=o,e++){const n=s[e];this._singleTransform2(t,n,r)}else for(t=0,e=0;t<i;t+=o,e++){const n=s[e];this._singleTransform4(t,n,r)}var a=this._inv?-1:1,u=this.table;for(r>>=2;r>=2;r>>=2){var l=(o=i/r<<1)>>>2;for(t=0;t<i;t+=o)for(var c=t+l,h=t,p=0;h<c;h+=2,p+=r){const t=h,e=t+l,i=e+l,r=i+l,o=n[t],s=n[t+1],c=n[e],f=n[e+1],d=n[i],m=n[i+1],y=n[r],_=n[r+1],v=o,g=s,b=u[p],w=a*u[p+1],k=c*b-f*w,S=c*w+f*b,x=u[2*p],T=a*u[2*p+1],O=d*x-m*T,P=d*T+m*x,A=u[3*p],C=a*u[3*p+1],E=y*A-_*C,M=y*C+_*A,R=v+O,j=g+P,N=v-O,F=g-P,L=k+E,D=S+M,q=a*(k-E),I=a*(S-M),B=R+L,U=j+D,z=R-L,Y=j-D,W=N+I,G=F-q,V=N-I,H=F+q;n[t]=B,n[t+1]=U,n[e]=W,n[e+1]=G,n[i]=z,n[i+1]=Y,n[r]=V,n[r+1]=H}}},i.prototype._singleTransform2=function(t,e,n){const i=this._out,r=this._data,o=r[e],s=r[e+1],a=r[e+n],u=r[e+n+1],l=o+a,c=s+u,h=o-a,p=s-u;i[t]=l,i[t+1]=c,i[t+2]=h,i[t+3]=p},i.prototype._singleTransform4=function(t,e,n){const i=this._out,r=this._data,o=this._inv?-1:1,s=2*n,a=3*n,u=r[e],l=r[e+1],c=r[e+n],h=r[e+n+1],p=r[e+s],f=r[e+s+1],d=r[e+a],m=r[e+a+1],y=u+p,_=l+f,v=u-p,g=l-f,b=c+d,w=h+m,k=o*(c-d),S=o*(h-m),x=y+b,T=_+w,O=v+S,P=g-k,A=y-b,C=_-w,E=v-S,M=g+k;i[t]=x,i[t+1]=T,i[t+2]=O,i[t+3]=P,i[t+4]=A,i[t+5]=C,i[t+6]=E,i[t+7]=M},i.prototype._realTransform4=function(){var t,e,n=this._out,i=this._csize,r=1<<this._width,o=i/r<<1,s=this._bitrev;if(4===o)for(t=0,e=0;t<i;t+=o,e++){const n=s[e];this._singleRealTransform2(t,n>>>1,r>>>1)}else for(t=0,e=0;t<i;t+=o,e++){const n=s[e];this._singleRealTransform4(t,n>>>1,r>>>1)}var a=this._inv?-1:1,u=this.table;for(r>>=2;r>=2;r>>=2){var l=(o=i/r<<1)>>>1,c=l>>>1,h=c>>>1;for(t=0;t<i;t+=o)for(var p=0,f=0;p<=h;p+=2,f+=r){var d=t+p,m=d+c,y=m+c,_=y+c,v=n[d],g=n[d+1],b=n[m],w=n[m+1],k=n[y],S=n[y+1],x=n[_],T=n[_+1],O=v,P=g,A=u[f],C=a*u[f+1],E=b*A-w*C,M=b*C+w*A,R=u[2*f],j=a*u[2*f+1],N=k*R-S*j,F=k*j+S*R,L=u[3*f],D=a*u[3*f+1],q=x*L-T*D,I=x*D+T*L,B=O+N,U=P+F,z=O-N,Y=P-F,W=E+q,G=M+I,V=a*(E-q),H=a*(M-I),Z=B+W,Q=U+G,K=z+H,$=Y-V;if(n[d]=Z,n[d+1]=Q,n[m]=K,n[m+1]=$,0!==p){if(p!==h){var X=z+-a*H,J=-Y+-a*V,tt=B+-a*W,et=-U- -a*G,nt=t+c-p,it=t+l-p;n[nt]=X,n[nt+1]=J,n[it]=tt,n[it+1]=et}}else{var rt=B-W,ot=U-G;n[y]=rt,n[y+1]=ot}}}},i.prototype._singleRealTransform2=function(t,e,n){const i=this._out,r=this._data,o=r[e],s=r[e+n],a=o+s,u=o-s;i[t]=a,i[t+1]=0,i[t+2]=u,i[t+3]=0},i.prototype._singleRealTransform4=function(t,e,n){const i=this._out,r=this._data,o=this._inv?-1:1,s=2*n,a=3*n,u=r[e],l=r[e+n],c=r[e+s],h=r[e+a],p=u+c,f=u-c,d=l+h,m=o*(l-h),y=p+d,_=f,v=-m,g=p-d,b=f,w=m;i[t]=y,i[t+1]=0,i[t+2]=_,i[t+3]=v,i[t+4]=g,i[t+5]=0,i[t+6]=b,i[t+7]=w}},function(t,e){t.exports={construct:function(t,e,n){var i=[];switch(t){case"ham":for(var r=0;r<e;r++)i[r]=.54-.46*Math.cos(2*Math.PI*r/(e-1));break;case"tukey":var o=e-1,s=n*o;for(r=0;r<e;r++)i[r]=r<s/2?.5*(1+Math.cos(Math.PI*(2*e/s-1))):r>o*(1-n/2)?.5*(1+Math.cos(Math.PI*(2*e/s-2/n+1))):1;break;case"rectangular":for(r=0;r<e;r++)i[r]=1}return i}}},function(t,e){var n=function(t){t=t||{},this.frameIx=0,this.frameSize=t.frameSize||64,this.frameStep=t.frameStep||this.frameSize,this.map=t.map||void 0,this.scale=t.scale||void 0,this.offset=t.offset?t.offset:0,this.sampleType=t.sampleType||"UInt8",this.wordSize=t.wordSize||1};n.prototype={frame:function(t,e){var n=this,i=this.offset,r=[],o="[object Array]"===Object.prototype.toString.call(t);for(n.frameIx=0;i<t.length;){var s=o?t[i]:t["read"+n.sampleType](i);r.push(this.map?this.map[s]:s),r.length!=this.frameSize&&i+n.wordSize!=t.length||a(r),i+=n.wordSize}function a(r){this.scale&&(r=r.map(function(t,e){return t*n.scale[e]})),e(r,n.frameIx),i!=t.length-n.wordSize&&(i-=(n.frameSize-n.frameStep)*n.wordSize,n.frameIx++,r.length=0)}0==this.frameIx&&e(void 0)}},t.exports=n},function(t,e,n){t.exports={framer:n(270),windows:n(269)}},function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(){function t(t,e){for(var n,i=function(t){for(var e=t[0].width,n=t[0].height,i=t[0].duration,r=1;r<t.length;r++){if(t[r].width!=e)throw"Frame "+(r+1)+" has a different width";if(t[r].height!=n)throw"Frame "+(r+1)+" has a different height";if(t[r].duration<0||t[r].duration>32767)throw"Frame "+(r+1)+" has a weird duration (must be between 0 and 32767)";i+=t[r].duration}return{duration:i,width:e,height:n}}(t),r=[{id:440786851,data:[{data:1,id:17030},{data:1,id:17143},{data:4,id:17138},{data:8,id:17139},{data:"webm",id:17026},{data:2,id:17031},{data:2,id:17029}]},{id:408125543,data:[{id:357149030,data:[{data:1e6,id:2807729},{data:"whammy",id:19840},{data:"whammy",id:22337},{data:(n=i.duration,[].slice.call(new Uint8Array(new Float64Array([n]).buffer),0).map(function(t){return String.fromCharCode(t)}).reverse().join("")),id:17545}]},{id:374648427,data:[{id:174,data:[{data:1,id:215},{data:1,id:29637},{data:0,id:156},{data:"und",id:2274716},{data:"V_VP8",id:134},{data:"VP8",id:2459272},{data:1,id:131},{id:224,data:[{data:i.width,id:176},{data:i.height,id:186}]}]}]},{id:475249515,data:[]}]}],o=r[1],u=o.data[2],l=0,c=0;l<t.length;){var h={id:187,data:[{data:Math.round(c),id:179},{id:183,data:[{data:1,id:247},{data:0,size:8,id:241}]}]};u.data.push(h);var p=[],f=0;do{p.push(t[l]),f+=t[l].duration,l++}while(l<t.length&&f<3e4);var d=0,m={id:524531317,data:[{data:Math.round(c),id:231}].concat(p.map(function(t){var e=a({discardable:0,frame:t.data.slice(4),invisible:0,keyframe:1,lacing:0,trackNum:1,timecode:Math.round(d)});return d+=t.duration,{data:e,id:163}}))};o.data.push(m),c+=f}for(var y=0,_=0;_<o.data.length;_++){_>=3&&(u.data[_-3].data[1].data[1].data=y);var v=s([o.data[_]],e);y+=v.size||v.byteLength||v.length,2!=_&&(o.data[_]=v)}return s(r,e)}function e(t){for(var e=[];t>0;)e.push(255&t),t>>=8;return new Uint8Array(e.reverse())}function n(t,e){for(var n=new Uint8Array(e),i=e-1;i>=0;i--)n[i]=255&t,t>>=8;return n}function r(t){for(var e=new Uint8Array(t.length),n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}function o(t){var e=[];t=(t.length%8?new Array(9-t.length%8).join("0"):"")+t;for(var n=0;n<t.length;n+=8)e.push(parseInt(t.substr(n,8),2));return new Uint8Array(e)}function s(t,a){for(var u=[],l=0;l<t.length;l++)if("id"in t[l]){var c=t[l].data;if("object"==(void 0===c?"undefined":i(c))&&(c=s(c,a)),"number"==typeof c&&(c="size"in t[l]?n(c,t[l].size):o(c.toString(2))),"string"==typeof c&&(c=r(c)),c.length);var h=c.size||c.byteLength||c.length,p=Math.ceil(Math.ceil(Math.log(h)/Math.log(2))/8),f=h.toString(2),d=new Array(7*p+7+1-f.length).join("0")+f,m=new Array(p).join("0")+"1"+d;u.push(e(t[l].id)),u.push(o(m)),u.push(c)}else u.push(t[l]);if(a){var y=function t(e,n){null==n&&(n=[]);for(var r=0;r<e.length;r++)"object"==i(e[r])?t(e[r],n):n.push(e[r]);return n}(u);return new Uint8Array(y)}return new Blob(u,{type:"video/webm"})}function a(t){var e=0;if(t.keyframe&&(e|=128),t.invisible&&(e|=8),t.lacing&&(e|=t.lacing<<1),t.discardable&&(e|=1),t.trackNum>127)throw"TrackNumber > 127 not supported";return[128|t.trackNum,t.timecode>>8,255&t.timecode,e].map(function(t){return String.fromCharCode(t)}).join("")+t.frame}function u(t){for(var e,n,i=t.RIFF[0].WEBP[0],r=i.indexOf("*"),o=0,s=[];o<4;o++)s[o]=i.charCodeAt(r+3+o);return e=16383&(n=s[1]<<8|s[0]),n>>14,(n=s[3]<<8|s[2])>>14,{width:e,height:16383&n,data:i,riff:t}}function l(t){for(var e=0,n={};e<t.length;){var i=t.substr(e,4);if(n[i]=n[i]||[],"RIFF"==i||"LIST"==i){var r=parseInt(t.substr(e+4,4).split("").map(function(t){var e=t.charCodeAt(0).toString(2);return new Array(8-e.length+1).join("0")+e}).join(""),2),o=t.substr(e+4+4,r);e+=8+r,n[i].push(l(o))}else"WEBP"==i?(n[i].push(t.substr(e+8)),e=t.length):(n[i].push(t.substr(e+4)),e=t.length)}return n}function c(t,e){this.frames=[],this.duration=1e3/t,this.quality=e||.8}return c.prototype.add=function(t,e){if(void 0!==e&&this.duration)throw"you can't pass a duration if the fps is set";if(void 0===e&&!this.duration)throw"if you don't have the fps set, you need to have durations here.";if(t.canvas&&(t=t.canvas),t.toDataURL)t=t.getContext("2d-lodpi").getImageData(0,0,t.width,t.height);else if("string"!=typeof t)throw"frame must be a a HTMLCanvasElement, a CanvasRenderingContext2D or a DataURI formatted string";if("string"==typeof t&&!/^data:image\/webp;base64,/gi.test(t))throw"Input must be formatted properly as a base64 encoded DataURI of type image/webp";this.frames.push({image:t,duration:e||this.duration})},c.prototype.encodeFrames=function(t){if(this.frames[0].image instanceof ImageData){var e=this.frames,n=document.createElement("canvas"),i=n.getContext("2d-lodpi");n.width=this.frames[0].image.width,n.height=this.frames[0].image.height;var r=function(o){console.log("encodeFrame",o);var s=e[o];i.putImageData(s.image,0,0),s.image=n.toDataURL("image/webp",this.quality),o<e.length-1?setTimeout(function(){r(o+1)},1):t()}.bind(this);r(0)}else t()},c.prototype.compile=function(e,n){this.encodeFrames(function(){var i=0,r=0,o=new t(this.frames.map(function(t){var e=u(l(atob(t.image.slice(23))));if(e.duration=t.duration,!e||!e.width||!e.height)return null;if(i){if(i!==e.width)return null}else i=e.width;if(r){if(r!==e.height)return null}else r=e.height;return e}).filter(function(t){return!!t}),e);n(o)}.bind(this))},{Video:c,fromImageArray:function(e,n,i){return t(e.map(function(t){var e=u(l(atob(t.slice(23))));return e.duration=1e3/n,e}),i)},toWebM:t}}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.send_command=function(t,e){u.socket.emit("cmd",{cmd:t,payload:e})},e.list_checkpoints=function(t){u.socket.emit("cmd",{cmd:"list_checkpoints",payload:t})},e.list_all_checkpoints=function(t){u.socket.emit("cmd",{cmd:"list_all_checkpoints",payload:t})},e.list_epochs=function(t,e){u.socket.emit("cmd",{cmd:"list_epochs",payload:"pix2pix"===t||"pix2wav"===t?t+"/"+e:e})},e.list_sequences=function(t){u.socket.emit("cmd",{cmd:"list_sequences",payload:t})},e.load_epoch=function(t,e){console.log(">> SWITCH CHECKPOINT",t,e),u.socket.emit("cmd",{cmd:"load_epoch",payload:t+":"+e})},e.load_sequence=function(t){u.socket.emit("cmd",{cmd:"load_sequence",payload:t})},e.seek=function(t){u.socket.emit("cmd",{cmd:"seek",payload:t})},e.pause=function(t){u.socket.emit("cmd",{cmd:"pause"})},e.play=function(t){u.socket.emit("cmd",{cmd:"play"})},e.get_params=function(){u.socket.emit("cmd",{cmd:"get_params"})},e.set_param=function(t,e){u.socket.emit("cmd",{cmd:"set_param",payload:{key:t,value:e}})};var i,r=n(20),o=n(6),s=(i=o)&&i.__esModule?i:{default:i},a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(40)),u=n(41);u.socket.on("res",function(t){switch(t.cmd){case"get_last_frame":"working"!==t.res&&u.socket.emit("cmd",{cmd:"get_last_frame"});break;case"get_params":t.res&&(0,r.dispatch)({type:s.default.socket.load_params,opt:t.res}),t.res&&a.toggleFPS(t.res.processing);break;case"list_checkpoints":(0,r.dispatch)({type:s.default.socket.list_checkpoints,checkpoints:t.res});break;case"list_all_checkpoints":(0,r.dispatch)({type:s.default.socket.list_all_checkpoints,checkpoints:t.res});break;case"list_epochs":(0,r.dispatch)({type:s.default.socket.list_epochs,epochs:t.res});break;case"list_sequences":(0,r.dispatch)({type:s.default.socket.list_sequences,sequences:t.res})}}),u.socket.on("frame",a.onFrame)},function(t,e,n){"use strict";var i,r=n(20),o=n(6),s=(i=o)&&i.__esModule?i:{default:i};n(41).socket.on("system_res",function(t){switch(t.type){case"relay_connected":return(0,r.dispatch)({type:s.default.system.relay_connected});case"relay_disconnected":return(0,r.dispatch)({type:s.default.system.relay_disconnected});case"rpc_connected":return(0,r.dispatch)({type:s.default.system.rpc_connected,runner:t.runner});case"rpc_disconnected":return(0,r.dispatch)({type:s.default.system.rpc_disconnected});case"relay_status":return(0,r.dispatch)({type:t.rpc_connected?s.default.system.rpc_connected:s.default.system.rpc_disconnected,runner:t.runner});case"site":return(0,r.dispatch)({type:s.default.system.load_site,site:t.site})}})},function(t,e){for(var n=[],i=0;i<256;++i)n[i]=(i+256).toString(16).substr(1);t.exports=function(t,e){var i=e||0,r=n;return r[t[i++]]+r[t[i++]]+r[t[i++]]+r[t[i++]]+"-"+r[t[i++]]+r[t[i++]]+"-"+r[t[i++]]+r[t[i++]]+"-"+r[t[i++]]+r[t[i++]]+"-"+r[t[i++]]+r[t[i++]]+r[t[i++]]+r[t[i++]]+r[t[i++]]+r[t[i++]]}},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(n){var i=new Uint8Array(16);t.exports=function(){return n(i),i}}else{var r=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),r[e]=t>>>((3&e)<<3)&255;return r}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(42));function s(t){return t&&t.__esModule?t:{default:t}}var a={loading:!0,progress:{i:0,n:0},error:null,folders:[],folder_id:0,data:null,lossReport:null,results:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];if(e.data&&"samplernn"===e.data.module)return(0,o.default)(t,e);switch(e.type){case r.default.samplernn.load_loss:return i({},t,{lossReport:e.lossReport});case r.default.samplernn.load_graph:return i({},t,{lossReport:e.lossReport,results:e.results});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=a(n(6)),o=a(n(42)),s=a(n(4));function a(t){return t&&t.__esModule?t:{default:t}}var u={loading:!0,progress:{i:0,n:0},status:"",error:null,folder_id:0,data:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,e=arguments[1];switch(e.data&&"pix2wav"===e.data.module&&(t=(0,o.default)(t,e)),e.type){case r.default.wav2pix.load:return i({},t,{status:"Loaded buffer"});case r.default.wav2pix.progress:return i({},t,{status:"Rendering frame "+e.count});case r.default.wav2pix.finish:return i({},t,{status:e.message||"Render complete"});case r.default.wav2pix.zip:return i({},t,{status:"Built zip file "+s.default.hush_size(t.size)[1]});case r.default.wav2pix.uploading:return i({},t,{status:"Uploading zip file"});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(42));function s(t){return t&&t.__esModule?t:{default:t}}var a={loading:!0,progress:{i:0,n:0},error:null,folder_id:0,data:null,results:null,checkpoint:{name:"",sequenceCount:0,datasetCount:0}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.data&&"pix2pixhd"===e.data.module&&(t=(0,o.default)(t,e)),e.type){case r.default.pix2pixhd.load_results:return i({},t,{results:e.results});case r.default.pix2pixhd.load_uprez:return i({},t,{uprez:e.uprez});case r.default.pix2pixhd.load_dataset_count:return i({},t,{checkpoint:e.data});case r.default.file.destroy:return console.log("file destroy",t.results),i({},t,{results:i({},t.results,{files:t.results.files.filter(function(t){return t.id!==e.data.id})})});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});r(n(6));var i=r(n(42));function r(t){return t&&t.__esModule?t:{default:t}}var o={loading:!0,progress:{i:0,n:0},error:null,folder_id:0,data:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,e=arguments[1];return e.data&&"pix2pix"===e.data.module&&(t=(0,i.default)(t,e)),e.type,t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(42));function s(t){return t&&t.__esModule?t:{default:t}}var a={loading:!0,progress:{i:0,n:0},error:null,folder_id:0,data:null,app:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.data&&"morph"===e.data.module&&(t=(0,o.default)(t,e)),e.type){case r.default.morph.load:return console.log("morph load",e.app),i({},t,{app:e.app,loading:!1,data:e.data});case r.default.file.create:return console.log(e),"morph"!==e.data.module?t:i({},t,{app:t.app&&i({},t.app,{files:[e.data].concat(t.app.files)})});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(42));function s(t){return t&&t.__esModule?t:{default:t}}var a={loading:!0,progress:{i:0,n:0},error:null,folder_id:0,data:null,results:null,encodings:null,checkpoint:{name:"",sequenceCount:0,datasetCount:0}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.data&&"biggan"===e.data.module&&(t=(0,o.default)(t,e)),e.type){case r.default.biggan.load_results:return i({},t,{results:e.results});case r.default.biggan.load_encodings:return i({},t,{encodings:e.encodings});case r.default.file.destroy:return console.log("file destroy",t.results),i({},t,{results:i({},t.results,{files:t.results.files.filter(function(t){return t.id!==e.data.id})})});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.moduleReducer=void 0;var i=n(3),r=c(n(282)),o=c(n(281)),s=c(n(280)),a=c(n(279)),u=c(n(278)),l=c(n(277));function c(t){return t&&t.__esModule?t:{default:t}}e.moduleReducer=(0,i.combineReducers)({biggan:r.default,morph:o.default,pix2pix:s.default,pix2pixhd:a.default,pix2wav:u.default,samplernn:l.default})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=n(6),s=(i=o)&&i.__esModule?i:{default:i};var a={loading:!1,error:null,status:"",current:null,index:-1,playlist:[]},u=document.createElement("audio");e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.type){case s.default.audioPlayer.play:return e.file.url?(u.src=e.file.url,u.play(),r({},t,{playing:!0,current:e.file})):t;case s.default.audioPlayer.pause:return u.pause(),r({},t,{playing:!1});case s.default.audioPlayer.resume:return u.play(),r({},t,{playing:!0});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=o(n(6));o(n(29));function o(t){return t&&t.__esModule?t:{default:t}}n(84);var s={loading:!1,progress:null,error:null,data:{},images:[],files:[]};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,e=arguments[1];switch(e.type){case r.default.app.load_progress:return e.data&&"dashboard"===e.data.module?i({},t,{loading:!0,progress:e.progress}):t;case r.default.dashboard.load:return i({},t,{loading:!1,error:null,data:e.data});default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(6),o=(i=r)&&i.__esModule?i:{default:i};var s={loading:!1,error:null,status:""};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,e=arguments[1];switch(e.type){case o.default.folder.upload_loading:return{error:null,loading:!0,status:"Loading..."};case o.default.folder.upload_error:return{error:null,loading:!1,status:"Error uploading :("};case o.default.folder.upload_progress:return{error:null,loading:!0,status:"Upload progress "+e.percent+"%"};case o.default.folder.upload_waiting:return{error:null,loading:!0,status:"Waiting for server to finish processing..."};case o.default.folder.upload_complete:return{error:null,loading:!1,status:"Upload complete"};case o.default.file.create_loading:return{error:null,loading:!0,status:"Creating file..."};default:return t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={language:"pyro",header:{site_name:"political",system:"random wrecking ball",dashboard:"out of control buttons",folders:"spam",sequences:"YangGang offlimits sector",checkpoints:"ideological filters",results:"history",uprez:"resolution",live:"burning love",pix2pixhd:"PYROMANCER",pix2pix:"pyromancer lite",pix2wav:"hierophant",samplernn:"echo chamber",morph:"time travel"},gpu:{idle:"Pyromancer is idle",busy:"Pyromancer is working...",start:"Start",restart:"Restart",stop:"Stop",interrupt:"Interrupt",not_processing:"Preparing",processing:"Processing"},system:{},pix2pixhd:{live:{network:{title:"Mumbo Jumbo",view_mode:"bollocks",sequence:"mess",checkpoint:"skew",epoch:"reactionary regression"},playback:{title:"Divination",position:"accelerationism",playback_rate:"apocalypticism",skip_frames:"emergent phenomena",fade_sequence:"glossolalia",frame_delay:"babble"},record:{save_frame:"PYROMANCER DISCOUNT",save:"Save",record_video:"PYROMANCER PREMIUM",video_name:"Video name"},transition:{title:"Enlightenment",period:"endarkenment",min:"montecarlocasino",max:"random stumble"},recursion:{title:"Proprietary button",frac:"pay $5M to change this",roll:"waste $5M",axis:"When will I die?"},sequence:{title:"Political thermometer",frac:"ignition",process_frac:"wealth coeff."},transform:{title:"Hate",rotate:"0,14 factor",scale:"Ariernachweis"},clahe:{title:"Loss function",clip_limit:"sadness"},posterize:{title:"Depression",spatial_window:"breakdown",color_window:"burnout"},blur:{title:"Blur",radius:"pressure",sigma:"distortion"},canny:{title:"Future production",lo:"conjuration",hi:"self-fulfilling prophecy"},hsl:{title:"Generative future",hue:"figure it out",saturation:"make possibility appear",luminosity:"glow"}}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default={language:"en",header:{system:"system",dashboard:"dashboard",folders:"folders",sequences:"sequences",checkpoints:"checkpoints",results:"results",uprez:"uprez",live:"live",pix2pixhd:"pix2pixhd",pix2pix:"pix2pix",pix2wav:"pix2wav",samplernn:"samplernn",morph:"morph"},gpu:{idle:"GPU Idle",busy:"GPU Busy",start:"Start",restart:"Restart",stop:"Stop",interrupt:"Interrupt",not_processing:"Not Processing",processing:"Processing"},system:{},pix2pixhd:{live:{network:{title:"Network",view_mode:"view mode",sequence:"sequence",checkpoint:"checkpoint",epoch:"epoch"},playback:{title:"Playback",position:"position",playback_rate:"playback rate",skip_frames:"skip frames",fade_sequence:"fade sequence",frame_delay:"frame delay"},record:{save_frame:"Save frame",save:"Save",record_video:"Record video",video_name:"Video name"},transition:{title:"Transition",period:"period",min:"min",max:"max"},recursion:{title:"Recursion",frac:"recursive amount",roll:"roll amount",axis:"roll axis"},sequence:{title:"Sequence",frac:"sequence frac",process_frac:"process frac"},transform:{title:"Transform",rotate:"rotate",scale:"scale"},clahe:{title:"Clahe",clip_limit:"clip limit"},posterize:{title:"Posterize",spatial_window:"spatial window",color_window:"color window"},blur:{title:"Blur",radius:"radius",sigma:"sigma"},canny:{title:"Canny Edge Detection",lo:"lower bound",hi:"upper bound"},hsl:{title:"Hue / Saturation",hue:"hue",saturation:"saturation",luminosity:"luminosity"}}}}},function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=(s(n(29)),function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(82)));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n(84);var u=localStorage.getItem("cortex.i18n.language")||t.env.I18N_LANGUAGE||"en",l={loading:!1,error:null,site:{name:"loading"},env:{env:"production",production:!0,development:!1},i18n:{language:u,strings:o.strings(u)},app:{tool:localStorage.getItem("system.last_tool")||"pix2pixhd"},server:{connected:!1,status:"disconnected",error:null},relay:{connected:!1,status:"unknown",error:null},rpc:{connected:!1,status:"disconnected",error:null},cmd:{loading:!1,loaded:!1,name:null,error:null,stdout:"",stderr:""},runner:{cpu:{status:"IDLE",task:{}},gpu:{status:"IDLE",task:{}}},stdout:"",stderr:""},c=["pix2pix","pix2pixhd","pix2wav","samplernn","morph"].reduce(function(t,e){return t[e]=e,t},{});e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,e=arguments[1],n=null;switch(e.type){case r.default.socket.connect:case r.default.socket.reconnecting:return i({},t,{server:{status:"connected",connected:!0,error:null}});case r.default.socket.reconnect:return i({},t,{server:{status:"reconnecting (attempt "+e.attempt+")",connected:!1,error:null}});case r.default.socket.connect_error:case r.default.socket.reconnect_error:case r.default.socket.disconnect:case r.default.socket.reconnect_failed:return i({},t,{server:{status:"disconnected",connected:!1,error:e.error||null}});case r.default.socket.error:return i({},t,{server:i({},t.socket,{error:e.error})});case r.default.system.relay_connected:return i({},t,{relay:{status:"connected",connected:!0,error:null}});case r.default.system.relay_disconnected:return i({},t,{relay:{status:"disconnected",connected:!1,error:null},rpc:{status:"disconnected",connected:!1,error:null}});case r.default.system.rpc_connected:return i({},t,{rpc:{status:"connected",connected:!0,error:null},runner:e.runner});case r.default.system.rpc_disconnected:return i({},t,{rpc:{status:"disconnected",connected:!1,error:null},runner:e.runner||t.runner});case r.default.system.load_site:document.querySelector("title").innerHTML=e.site.name+".cortex";var s=t.app.tool,u=window.location.pathname.split("/")[1];return u in c&&(s=u),i({},t,{site:e.site,app:i({},t.app,{tool:s})});case r.default.system.running_command:return i({},t,{cmd:{loading:!0,loaded:!1,name:e.cmd,error:null,stdout:null,stderr:null}});case r.default.system.command_output:return i({},t,{cmd:{loading:!1,loaded:!0,name:e.data.cmd,error:e.data.error,stdout:e.data.stdout,stderr:e.data.stderr}});case r.default.task.task_begin:return console.log("task begin",e.task,e.task.processor),i({},t,{runner:i({},t.runner,a({},e.task.processor,{status:"RUNNING",task:e.task})),cmd:i({},t.cmd,{loaded:!1,stdout:"",stderr:""}),stdout:"",stderr:""});case r.default.task.task_finish:return n="cpu"===e.task.processor||t.runner.cpu.task&&t.runner.cpu.task.uuid===e.task.uuid?"cpu":"gpu"===e.task.processor||t.runner.gpu.task&&t.runner.gpu.task.uuid===e.task.uuid?"gpu":null,console.log("task finish",e),i({},t,{rpc:{connected:!1,status:"disconnected",error:null},runner:n?i({},t.runner,a({},n,{status:"IDLE",task:{}})):t.runner});case r.default.app.change_tool:return i({},t,{app:i({},t.app,{tool:e.tool})});case r.default.system.stdout:return e.data.processor&&t.runner[e.data.processor]?i({},t,{runner:i({},t.runner,a({},e.data.processor,i({},t.runner[e.data.processor],{last_message:e.data.data}))),stdout:t.stdout+e.data.data}):i({},t,{stdout:t.stdout+e.data.data});case r.default.system.stderr:return i({},t,{last_message:e.data.data,stderr:t.stderr+e.data.data});case r.default.system.change_language:return i({},t,{i18n:{language:e.language,strings:o.strings(e.language)}});default:return t}}}).call(this,n(43))},function(t,e,n){"use strict";var i,r,o,s,a;i=window.CanvasRenderingContext2D.prototype,r=window.document.createElement("canvas").getContext("2d"),o=r.backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1,1!==(a=(window.devicePixelRatio||1)/o)&&(function(t,e){for(var n in t)t.hasOwnProperty(n)&&e(t[n],n)}({fillRect:"all",clearRect:"all",strokeRect:"all",moveTo:"all",lineTo:"all",arc:[0,1,2],arcTo:"all",bezierCurveTo:"all",isPointinPath:"all",isPointinStroke:"all",quadraticCurveTo:"all",rect:"all",translate:"all",createRadialGradient:"all",createLinearGradient:"all"},function(t,e){var n;i[e]=(n=i[e],function(){var e,i,r=Array.prototype.slice.call(arguments);if("all"===t)r=r.map(function(t){return t*a});else if(Array.isArray(t))for(e=0,i=t.length;e<i;e++)r[t[e]]*=a;return n.apply(this,r)})}),i.stroke=(s=i.stroke,function(){this.lineWidth*=a,s.apply(this,arguments),this.lineWidth/=a}),i.fillText=function(t){return function(){var e=Array.prototype.slice.call(arguments);e[1]*=a,e[2]*=a,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,e,n){return e*a+n}),t.apply(this,e),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,e,n){return e/a+n})}}(i.fillText),i.strokeText=function(t){return function(){var e=Array.prototype.slice.call(arguments);e[1]*=a,e[2]*=a,this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,e,n){return e*a+n}),t.apply(this,e),this.font=this.font.replace(/(\d+)(px|em|rem|pt)/g,function(t,e,n){return e/a+n})}}(i.strokeText)),function(t){var e;t.getContext=(e=t.getContext,function(t){var n,i,r;return"2d-lodpi"==t?r=e.call(this,"2d"):"2d"===t?(n=(r=e.call(this,"2d")).backingStorePixelRatio||r.webkitBackingStorePixelRatio||r.mozBackingStorePixelRatio||r.msBackingStorePixelRatio||r.oBackingStorePixelRatio||r.backingStorePixelRatio||1,(i=(window.devicePixelRatio||1)/n)>1&&(this.style.height=this.height+"px",this.style.width=this.width+"px",this.width*=i,this.height*=i)):r=e.call(this,t),r})}(window.HTMLCanvasElement.prototype)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=e.numericSort={asc:function(t,e){return t[0]-e[0]},desc:function(t,e){return e[0]-t[0]}},o=e.stringSort={asc:function(t,e){return t[0].localeCompare(e[0])},desc:function(t,e){return e[0].localeCompare(t[0])}};e.orderByFn=function(){var t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"name asc").split(" "),e=i(t,2),n=e[0],s=void 0===n?"name":n,a=e[1],u=void 0===a?"asc":a,l=void 0,c=void 0;switch(s){case"epoch":l=function(t){return[parseInt(t.epoch||t.epochs)||0,t]},c=r[u];break;case"size":l=function(t){return[parseInt(t.size)||0,t]},c=r[u];break;case"date":l=function(t){return[+new Date(t.date||t.created_at),t]},c=r[u];break;case"updated_at":l=function(t){return[+new Date(t.updated_at),t]},c=r[u];break;case"priority":l=function(t){return[parseInt(t.priority)||parseInt(t.id)||1e3,t]},c=r[u];case"name":default:l=function(t){return[t.name||"",t]},c=o[u]}return{mapFn:l,sortFn:c}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=s(n(6)),o=s(n(4));s(n(29));function s(t){return t&&t.__esModule?t:{default:t}}function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var u={loading:!1,error:null,tasks:{},queue:[],completed:[]},l=o.default.sort.orderByFn("updated_at desc"),c=o.default.sort.orderByFn("priority asc");e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,e=arguments[1];switch(e.type){case r.default.task.index:return i({},t,{tasks:e.data.reduce(function(t,e){return t[e.id]=e,t},{}),queue:e.data.filter(function(t){return!t.completed}).map(l.mapFn).sort(l.sortFn).map(function(t){return t[1].id}),completed:e.data.filter(function(t){return t.completed}).map(c.mapFn).sort(c.sortFn).map(function(t){return t[1].id})});case r.default.task.create:return console.log(e.data),i({},t,{tasks:i({},t.tasks,a({},e.data.id,e.data)),queue:t.queue.concat([e.data.id])});case r.default.task.update:return i({},t,{tasks:i({},t.tasks,a({},e.data.id,e.data))});case r.default.task.destroy:var n=t.tasks,o=n[e.data.id],s=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(n,[e.data.id]);return i({},t,{queue:t.queue.filter(function(t){return t!==o.id}),completed:t.completed.filter(function(t){return t!==o.id}),tasks:s});case r.default.task.task_finish:return i({},t,{queue:t.queue.filter(function(t){return t!==e.task.id}),completed:[e.task.id].concat(t.completed)});default:return t}}},function(t,e){(function(e){t.exports=e}).call(this,{})},function(t,e){t.exports=function(){throw new Error("define cannot be used indirect")}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=a(n(29)),o=a(n(84)),s=a(n(6));function a(t){return t&&t.__esModule?t:{default:t}}var u={loading:!1,error:null,opt:{hue:0,saturation:0,luminosity:0,sequence_playing:!0,sequence_step:1,recurse_roll:0,rotate:0,scale:0,process_frac:.5,view_mode:"b",encoding_stored_mix_n:0},all_checkpoints:[],checkpoints:[],epochs:["latest"],sequences:[],fps:0,playing:!1,last_message:"",fullscreen:!1,frame:{i:0,sequence_i:0,sequence_len:"1"}};e.default=function(){var t,e,n,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:u,l=arguments[1];switch(l.type){case s.default.socket.load_params:return console.log(l.opt),l.opt&&Object.keys(l.opt).length?i({},a,{loading:!1,error:null,opt:l.opt}):a;case s.default.player.set_param:return i({},a,{opt:i({},a.opt,(t={},e=l.key,n=l.value,e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t))});case s.default.player.set_fullscreen:return i({},a,{fullscreen:l.value});case s.default.socket.list_checkpoints:return i({},a,{checkpoints:l.checkpoints,epochs:[]});case s.default.socket.list_all_checkpoints:return i({},a,{all_checkpoints:l.all_checkpoints,epochs:[]});case s.default.socket.list_epochs:return console.log(l),"not found"===l.epochs?i({},a,{epochs:[]}):i({},a,{epochs:(l.epochs||[]).map(function(t){return["latest"==t?1/0:t,t]}).sort(function(t,e){return t[0]-e[0]}).map(function(t){return t[1]})});case s.default.socket.list_sequences:return i({},a,{sequences:l.sequences});case s.default.player.loading_sequence:return i({},a,{opt:i({},a.opt,{sequence_name:l.sequence_name})});case s.default.player.loading_checkpoint:return i({},a,{opt:i({},a.opt,{checkpoint_name:l.checkpoint_name,epoch:l.epoch})});case s.default.player.set_fps:return i({},a,{fps:l.fps});case s.default.system.stdout:if("gpu"===l.data.processor){if(-1!==l.data.data.indexOf("set_opt")){var c=l.data.data.trim().split("\n").reduce(function(t,e){if(0===e.indexOf("set_opt")){var n=e.split(" "),i=n[1],r=parseFloat(n[2]);isNaN(r)&&(r=n[2]),t[i]=r}return t},{});return i({},a,{opt:i({},a.opt,c)})}return i({},a,{last_message:l.data.data})}return a;case s.default.player.current_frame:return l.meta?i({},a,{frame:l.meta}):a;case s.default.player.pausing:return i({},a,{playing:!1});case s.default.player.playing:return i({},a,{playing:!0});case s.default.player.start_recording:return i({},a,{opt:i({},a.opt,{recording:!0})});case s.default.player.add_record_frame:return i({},a,{opt:i({},a.opt,{recordFrames:(a.opt.recordFrames||0)+1})});case s.default.player.save_frame:return o.default.saveAs(l.blob,a.opt.checkpoint_name+"_"+a.opt.sequence+"_"+(0,r.default)().format("YYYYMMDD_HHmm")+".png"),a;case s.default.player.saving_video:return i({},a,{opt:i({},a.opt,{savingVideo:!0})});case s.default.player.save_video:return o.default.saveAs(l.blob,a.opt.checkpoint_name+"_"+a.opt.sequence+"_"+(0,r.default)().format("YYYYMMDD_HHmm")+".webm"),i({},a,{opt:i({},a.opt,{recording:!1,savingVideo:!1,recordFrames:0})});default:return a}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=n(6),s=(i=o)&&i.__esModule?i:{default:i};var a={token:null,user:{},groups:{},initialized:!1,loading:!1,isAuthenticated:!1,returnTo:null};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,e=arguments[1];switch(e.type){case s.default.auth.set_token:return r({},t,{token:e.data,isAuthenticated:!!e.data,loading:!1,error:null});case s.default.auth.initialized:return r({},t,{loading:!1,initialized:!0,error:null});case s.default.auth.loading:return r({},t,{loading:!0,error:null});case s.default.auth.set_current_user:return r({},t,{loading:!1,initialized:!0,isAuthenticated:!0,user:e.data,error:null});case s.default.auth.set_return_to:return r({},t,{returnTo:e.data});case s.default.auth.logout_user:return r({},a);case s.default.auth.set_error:return r({},t,{loading:!1,error:e.data});case s.default.auth.loading:default:return t}}},function(t,e,n){"use strict";e.__esModule=!0;e.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),e.addEventListener=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},e.getConfirmation=function(t,e){return e(window.confirm(t))},e.supportsHistory=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},e.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},e.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},e.isExtraneousPopstateEvent=function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")}},function(t,e,n){"use strict";e.__esModule=!0;var i,r=n(138),o=(i=r)&&i.__esModule?i:{default:i};e.default=function(){var t=null,e=[];return{setPrompt:function(e){return(0,o.default)(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,i,r){if(null!=t){var s="function"==typeof t?t(e,n):t;"string"==typeof s?"function"==typeof i?i(s,r):((0,o.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),r(!0)):r(!1!==s)}else r(!0)},appendListener:function(t){var n=!0,i=function(){n&&t.apply(void 0,arguments)};return e.push(i),function(){n=!1,e=e.filter(function(t){return t!==i})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),i=0;i<t;i++)n[i]=arguments[i];e.forEach(function(t){return t.apply(void 0,n)})}}}},function(t,e,n){"use strict";n.r(e);var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every(function(e,i){return t(e,n[i])});var r=void 0===e?"undefined":i(e);if(r!==(void 0===n?"undefined":i(n)))return!1;if("object"===r){var o=e.valueOf(),s=n.valueOf();if(o!==e||s!==n)return t(o,s);var a=Object.keys(e),u=Object.keys(n);return a.length===u.length&&a.every(function(i){return t(e[i],n[i])})}return!1}},function(t,e,n){"use strict";function i(t){return"/"===t.charAt(0)}function r(t,e){for(var n=e,i=n+1,r=t.length;i<r;n+=1,i+=1)t[n]=t[i];t.pop()}n.r(e),e.default=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],s=t&&i(t),a=e&&i(e),u=s||a;if(t&&i(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var l=void 0;if(o.length){var c=o[o.length-1];l="."===c||".."===c||""===c}else l=!1;for(var h=0,p=o.length;p>=0;p--){var f=o[p];"."===f?r(o,p):".."===f?(r(o,p),h++):h&&(r(o,p),h--)}if(!u)for(;h--;h)o.unshift("..");!u||""===o[0]||o[0]&&i(o[0])||o.unshift("");var d=o.join("/");return l&&"/"!==d.substr(-1)&&(d+="/"),d}},function(t,e,n){"use strict";e.__esModule=!0,e.locationsAreEqual=e.createLocation=void 0;var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},r=a(n(301)),o=a(n(300)),s=n(137);function a(t){return t&&t.__esModule?t:{default:t}}e.createLocation=function(t,e,n,o){var a=void 0;"string"==typeof t?(a=(0,s.parsePath)(t)).state=e:(void 0===(a=i({},t)).pathname&&(a.pathname=""),a.search?"?"!==a.search.charAt(0)&&(a.search="?"+a.search):a.search="",a.hash?"#"!==a.hash.charAt(0)&&(a.hash="#"+a.hash):a.hash="",void 0!==e&&void 0===a.state&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(t){throw t instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):t}return n&&(a.key=n),o?a.pathname?"/"!==a.pathname.charAt(0)&&(a.pathname=(0,r.default)(a.pathname,o.pathname)):a.pathname=o.pathname:a.pathname||(a.pathname="/"),a},e.locationsAreEqual=function(t,e){return t.pathname===e.pathname&&t.search===e.search&&t.hash===e.hash&&t.key===e.key&&(0,o.default)(t.state,e.state)}},function(t,e,n){"use strict";t.exports=function(t,e,n,i,r,o,s,a){if(!t){var u;if(void 0===e)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,i,r,o,s,a],c=0;(u=new Error(e.replace(/%s/g,function(){return l[c++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(t,e,n){"use strict";e.__esModule=!0;var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},o=h(n(138)),s=h(n(303)),a=n(302),u=n(137),l=h(n(299)),c=n(298);function h(t){return t&&t.__esModule?t:{default:t}}var p=function(){try{return window.history.state||{}}catch(t){return{}}};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,s.default)(c.canUseDOM,"Browser history needs a DOM");var e=window.history,n=(0,c.supportsHistory)(),h=!(0,c.supportsPopStateOnHashChange)(),f=t.forceRefresh,d=void 0!==f&&f,m=t.getUserConfirmation,y=void 0===m?c.getConfirmation:m,_=t.keyLength,v=void 0===_?6:_,g=t.basename?(0,u.stripTrailingSlash)((0,u.addLeadingSlash)(t.basename)):"",b=function(t){var e=t||{},n=e.key,i=e.state,r=window.location,s=r.pathname+r.search+r.hash;return(0,o.default)(!g||(0,u.hasBasename)(s,g),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+s+'" to begin with "'+g+'".'),g&&(s=(0,u.stripBasename)(s,g)),(0,a.createLocation)(s,i,n)},w=function(){return Math.random().toString(36).substr(2,v)},k=(0,l.default)(),S=function(t){r(L,t),L.length=e.length,k.notifyListeners(L.location,L.action)},x=function(t){(0,c.isExtraneousPopstateEvent)(t)||P(b(t.state))},T=function(){P(b(p()))},O=!1,P=function(t){O?(O=!1,S()):k.confirmTransitionTo(t,"POP",y,function(e){e?S({action:"POP",location:t}):A(t)})},A=function(t){var e=L.location,n=E.indexOf(e.key);-1===n&&(n=0);var i=E.indexOf(t.key);-1===i&&(i=0);var r=n-i;r&&(O=!0,R(r))},C=b(p()),E=[C.key],M=function(t){return g+(0,u.createPath)(t)},R=function(t){e.go(t)},j=0,N=function(t){1===(j+=t)?((0,c.addEventListener)(window,"popstate",x),h&&(0,c.addEventListener)(window,"hashchange",T)):0===j&&((0,c.removeEventListener)(window,"popstate",x),h&&(0,c.removeEventListener)(window,"hashchange",T))},F=!1,L={length:e.length,action:"POP",location:C,createHref:M,push:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"PUSH",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.pushState({key:r,state:a},null,i),d)window.location.href=i;else{var u=E.indexOf(L.location.key),l=E.slice(0,-1===u?0:u+1);l.push(s.key),E=l,S({action:"PUSH",location:s})}else(0,o.default)(void 0===a,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=i}})},replace:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"REPLACE",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.replaceState({key:r,state:a},null,i),d)window.location.replace(i);else{var u=E.indexOf(L.location.key);-1!==u&&(E[u]=s.key),S({action:"REPLACE",location:s})}else(0,o.default)(void 0===a,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(i)}})},go:R,goBack:function(){return R(-1)},goForward:function(){return R(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=k.setPrompt(t);return F||(N(1),F=!0),function(){return F&&(F=!1,N(-1)),e()}},listen:function(t){var e=k.appendListener(t);return N(1),function(){N(-1),e()}}};return L}},function(t,e,n){"use strict";function i(t){return function(e){var n=e.dispatch,i=e.getState;return function(e){return function(r){return"function"==typeof r?r(n,i,t):e(r)}}}}e.__esModule=!0;var r=i();r.withExtraArgument=i,e.default=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){return function(){return function(e){return function(n){if(n.type!==i.CALL_HISTORY_METHOD)return e(n);var r=n.payload,o=r.method,s=r.args;t[o].apply(t,function(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}(s))}}}};var i=n(139)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t};e.default=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},s=n.selectLocationState,a=void 0===s?o:s,u=n.adjustUrlOnReplay,l=void 0===u||u;if(void 0===a(e.getState()))throw new Error("Expected the routing state to be available either as `state.routing` or as the custom expression you can specify as `selectLocationState` in the `syncHistoryWithStore()` options. Ensure you have added the `routerReducer` to your store's reducers via `combineReducers` or whatever method you use to isolate your reducers.");var c=void 0,h=void 0,p=void 0,f=void 0,d=void 0,m=function(t){var n=a(e.getState());return n.locationBeforeTransitions||(t?c:void 0)};if(c=m(),l){var y=function(){var e=m(!0);d!==e&&c!==e&&(h=!0,d=e,t.transitionTo(i({},e,{action:"PUSH"})),h=!1)};p=e.subscribe(y),y()}var _=function(t){h||(d=t,!c&&(c=t,m())||e.dispatch({type:r.LOCATION_CHANGE,payload:t}))};f=t.listen(_),t.getCurrentLocation&&_(t.getCurrentLocation());return i({},t,{listen:function(n){var i=m(!0),r=!1,o=e.subscribe(function(){var t=m(!0);t!==i&&(i=t,r||n(i))});return t.getCurrentLocation||n(i),function(){r=!0,o()}},unsubscribe:function(){l&&p(),f()}})};var r=n(140),o=function(t){return t.routing}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.routerMiddleware=e.routerActions=e.goForward=e.goBack=e.go=e.replace=e.push=e.CALL_HISTORY_METHOD=e.routerReducer=e.LOCATION_CHANGE=e.syncHistoryWithStore=void 0;var i=n(140);Object.defineProperty(e,"LOCATION_CHANGE",{enumerable:!0,get:function(){return i.LOCATION_CHANGE}}),Object.defineProperty(e,"routerReducer",{enumerable:!0,get:function(){return i.routerReducer}});var r=n(139);Object.defineProperty(e,"CALL_HISTORY_METHOD",{enumerable:!0,get:function(){return r.CALL_HISTORY_METHOD}}),Object.defineProperty(e,"push",{enumerable:!0,get:function(){return r.push}}),Object.defineProperty(e,"replace",{enumerable:!0,get:function(){return r.replace}}),Object.defineProperty(e,"go",{enumerable:!0,get:function(){return r.go}}),Object.defineProperty(e,"goBack",{enumerable:!0,get:function(){return r.goBack}}),Object.defineProperty(e,"goForward",{enumerable:!0,get:function(){return r.goForward}}),Object.defineProperty(e,"routerActions",{enumerable:!0,get:function(){return r.routerActions}});var o=a(n(307)),s=a(n(306));function a(t){return t&&t.__esModule?t:{default:t}}e.syncHistoryWithStore=o.default,e.routerMiddleware=s.default},function(t,e){t.exports=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";var i=function(t){};t.exports=function(t,e,n,r,o,s,a,u){if(i(e),!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,s,a,u],h=0;(l=new Error(e.replace(/%s/g,function(){return c[h++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";function i(t){return function(){return t}}var r=function(){};r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){"use strict";var i=n(312),r=n(311),o=n(310);t.exports=function(){function t(t,e,n,i,s,a){a!==o&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=i,n.PropTypes=n,n}},function(t,e){t.exports=function(t){if(!t.webpackPolyfill){var e=Object.create(t);e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),Object.defineProperty(e,"exports",{enumerable:!0}),e.webpackPolyfill=1}return e}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";var i=function(t){};t.exports=function(t,e,n,r,o,s,a,u){if(i(e),!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,s,a,u],h=0;(l=new Error(e.replace(/%s/g,function(){return c[h++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";function i(t){return function(){return t}}var r=function(){};r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){"use strict";var i=n(317),r=n(316),o=n(315);t.exports=function(){function t(t,e,n,i,s,a){a!==o&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=i,n.PropTypes=n,n}},function(t,e,n){"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(t,e,n){"use strict";var i=function(t){};t.exports=function(t,e,n,r,o,s,a,u){if(i(e),!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,s,a,u],h=0;(l=new Error(e.replace(/%s/g,function(){return c[h++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";function i(t){return function(){return t}}var r=function(){};r.thatReturns=i,r.thatReturnsFalse=i(!1),r.thatReturnsTrue=i(!0),r.thatReturnsNull=i(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(t){return t},t.exports=r},function(t,e,n){"use strict";var i=n(321),r=n(320),o=n(319);t.exports=function(){function t(t,e,n,i,s,a){a!==o&&r(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function e(){return t}t.isRequired=t;var n={array:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e};return n.checkPropTypes=i,n.PropTypes=n,n}},function(t,e,n){"use strict";var i=n(1),r=n(2),o=n(8),s=n(20),a=(function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);e.default=t}(n(14)),p(n(4)),p(n(265))),u=n(11),l=p(n(152)),c=p(n(151)),h=p(n(80));function p(t){return t&&t.__esModule?t:{default:t}}var f=Object.keys(h.default).map(function(t){var e=h.default[t];return(0,i.h)(o.Route,{path:"/"+e.name,component:e.router})}),d=(0,i.h)(r.Provider,{store:s.store},(0,i.h)(a.default.Gate,null,(0,i.h)(o.BrowserRouter,null,(0,i.h)("div",null,(0,i.h)(o.Route,{exact:!0,path:"/system",component:l.default}),(0,i.h)(o.Route,{exact:!0,path:"/dashboard",component:c.default}),(0,i.h)(o.Route,{exact:!0,path:"/browse",component:u.Browser}),(0,i.h)(o.Route,{exact:!0,path:"/logout",component:a.default.Logout}),f,(0,i.h)(o.Route,{exact:!0,path:"/",component:c.default}),(0,i.h)(o.Route,{path:"/",component:u.Header}))),(0,i.h)(u.AudioPlayer,null)));(0,i.render)(d,document.getElementById("container"))},function(t,e,n){"use strict";(function(t){var n="object"==typeof t&&t&&t.Object===Object&&t;e.a=n}).call(this,n(22))}]); //# sourceMappingURL=bundle.js.map
\ No newline at end of file |
