UNPKG

smartdown

Version:

A library for translating, rendering and interacting with Smartdown documents. Smartdown is an extension of Markdown that provides richer media support and reactive programming capability.

1 lines 200 kB
(self.webpackChunksmartdown=self.webpackChunksmartdown||[]).push([[87],{482:()=>{!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=40)}([function(t,e,n){var i;void 0===(i=function(){"use strict";function t(t,e){this.isUndef(t)||1===t?this.input=this.context.createGain():1<t&&(this.input=new Array(t)),this.isUndef(e)||1===e?this.output=this.context.createGain():1<e&&(this.output=new Array(t))}var e;return t.prototype.set=function(e,n,i){if(this.isObject(e))i=n;else if(this.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 c=a.join(".");s.set(c,n);continue t}o=a[a.length-1]}var l=s[o];this.isUndef(l)||(t.Signal&&l instanceof t.Signal||t.Param&&l instanceof t.Param?l.value!==n&&(this.isUndef(i)?l.value=n:l.rampTo(n,i)):l instanceof AudioParam?l.value!==n&&(l.value=n):l instanceof t?l.set(n):l!==n&&(s[o]=n))}return this},t.prototype.get=function(e){this.isUndef(e)?e=this._collectDefaults(this.constructor):this.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 c=a[u];s[c]=s[c]||{},s=s[c],o=o[c]}r=a[a.length-1]}var l=o[r];this.isObject(e[r])?s[r]=l.get():t.Signal&&l instanceof t.Signal||t.Param&&l instanceof t.Param||l instanceof AudioParam?s[r]=l.value:l instanceof t?s[r]=l.get():this.isFunction(l)||this.isUndef(l)||(s[r]=l)}return n},t.prototype._collectDefaults=function(t){var e=[];if(this.isUndef(t.defaults)||(e=Object.keys(t.defaults)),!this.isUndef(t._super))for(var n=this._collectDefaults(t._super),i=0;i<n.length;i++)-1===e.indexOf(n[i])&&e.push(n[i]);return e},t.prototype.toString=function(){for(var e in t){var n=e[0].match(/^[A-Z]$/),i=t[e]===this.constructor;if(this.isFunction(t[e])&&n&&i)return e}return"Tone"},Object.defineProperty(t.prototype,"numberOfInputs",{get:function(){return this.input?this.isArray(this.input)?this.input.length:1:0}}),Object.defineProperty(t.prototype,"numberOfOutputs",{get:function(){return this.output?this.isArray(this.output)?this.output.length:1:0}}),t.prototype.dispose=function(){return this.isUndef(this.input)||(this.input instanceof AudioNode&&this.input.disconnect(),this.input=null),this.isUndef(this.output)||(this.output instanceof AudioNode&&this.output.disconnect(),this.output=null),this},t.prototype.connect=function(t,e,n){return Array.isArray(this.output)?(e=this.defaultArg(e,0),this.output[e].connect(t,0,n)):this.output.connect(t,e,n),this},t.prototype.disconnect=function(t,e,n){this.isArray(this.output)?this.isNumber(t)?this.output[t].disconnect():(e=this.defaultArg(e,0),this.output[e].disconnect(t,0,n)):this.output.disconnect.apply(this.output,arguments)},t.prototype.connectSeries=function(){if(1<arguments.length)for(var t=arguments[0],e=1;e<arguments.length;e++){var n=arguments[e];t.connect(n),t=n}return this},t.prototype.chain=function(){if(0<arguments.length)for(var t=this,e=0;e<arguments.length;e++){var n=arguments[e];t.connect(n),t=n}return this},t.prototype.fan=function(){if(0<arguments.length)for(var t=0;t<arguments.length;t++)this.connect(arguments[t]);return this},AudioNode.prototype.chain=t.prototype.chain,AudioNode.prototype.fan=t.prototype.fan,t.prototype.defaultArg=function(t,e){if(this.isObject(t)&&this.isObject(e)){var n={};for(var i in t)n[i]=this.defaultArg(e[i],t[i]);for(var r in e)n[r]=this.defaultArg(t[r],e[r]);return n}return this.isUndef(t)?e:t},t.prototype.optionsObject=function(t,e,n){var i={};if(1===t.length&&this.isObject(t[0]))i=t[0];else for(var r=0;r<e.length;r++)i[e[r]]=t[r];return this.isUndef(n)?i:this.defaultArg(i,n)},t.prototype.isUndef=function(t){return void 0===t},t.prototype.isFunction=function(t){return"function"==typeof t},t.prototype.isNumber=function(t){return"number"==typeof t},t.prototype.isObject=function(t){return"[object Object]"===Object.prototype.toString.call(t)&&t.constructor===Object},t.prototype.isBoolean=function(t){return"boolean"==typeof t},t.prototype.isArray=function(t){return Array.isArray(t)},t.prototype.isString=function(t){return"string"==typeof t},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.prototype.equalPowerScale=function(t){var e=.5*Math.PI;return Math.sin(t*e)},t.prototype.dbToGain=function(t){return Math.pow(2,t/6)},t.prototype.gainToDb=function(t){return Math.log(t)/Math.LN10*20},t.prototype.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.prototype.isUndef(n)&&(n=t),i.prototype=n.prototype,e.prototype=new i,(e.prototype.constructor=e)._super=n},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&&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}}),t.version="r10",window.TONE_SILENCE_VERSION_LOGGING,t}.call(e,n,e,t))||(t.exports=i)},function(t,e,n){var i,r;i=[n(0),n(2),n(10)],void 0===(r=function(t){"use strict";return t.Multiply=function(e){this.createInsOuts(2,0),this._mult=this.input[0]=this.output=new t.Gain,this._param=this.input[1]=this.output.gain,this._param.value=this.defaultArg(e,0)},t.extend(t.Multiply,t.Signal),t.Multiply.prototype.dispose=function(){return t.prototype.dispose.call(this),this._mult.dispose(),this._mult=null,this._param=null,this},t.Multiply}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(6),n(9),n(18),n(10)],void 0===(r=function(t){"use strict";return t.Signal=function(){var e=this.optionsObject(arguments,["value","units"],t.Signal.defaults);this.output=this._gain=this.context.createGain(),e.param=this._gain.gain,t.Param.call(this,e),this.input=this._param=this._gain.gain,this.context.getConstant(1).chain(this._gain)},t.extend(t.Signal,t.Param),t.Signal.defaults={value:0,units:t.Type.Default,convert:!0},t.Signal.prototype.connect=t.SignalBase.prototype.connect,t.Signal.prototype.dispose=function(){return t.Param.prototype.dispose.call(this),this._param=null,this._gain.disconnect(),this._gain=null,this},t.Signal}.apply(e,i))||(t.exports=r)},function(t,e,n){"use strict";(function(t){n.d(e,"b",(function(){return u})),n.d(e,"c",(function(){return c}));var i=n(22),r=n.n(i),o=n(0),s=n.n(o);n(12),t.TONE_SILENCE_VERSION_LOGGING=!0;var a=new window.AudioContext;function u(){return a}function c(t,e){var n=t;return t instanceof p5.Element?n=t.elt:t instanceof Array&&t[0]instanceof p5.Element&&(n=t.map((function(t){return t.elt}))),r()(a,n,e)}s.a.setContext(a),e.a=a}).call(this,n(26))},function(t,e,n){var i,r;i=[n(0),n(2),n(10)],void 0===(r=function(t){"use strict";return t.Add=function(e){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.prototype.dispose.call(this),this._sum.dispose(),this._sum=null,this._param.dispose(),this._param=null,this},t.Add}.apply(e,i))||(t.exports=r)},function(t,e){t.exports={recorderProcessor:"recorder-processor",soundFileProcessor:"sound-file-processor",amplitudeProcessor:"amplitude-processor"}},function(t,e,n){var i,r;i=[n(0),n(15)],void 0===(r=function(t){"use strict";return t.WaveShaper=function(t,e){this._shaper=this.input=this.output=this.context.createWaveShaper(),this._curve=null,Array.isArray(t)?this.curve=t:isFinite(t)||this.isUndef(t)?this._curve=new Float32Array(this.defaultArg(t,1024)):this.isFunction(t)&&(this._curve=new Float32Array(this.defaultArg(e,1024)),this.setMap(t))},t.extend(t.WaveShaper,t.SignalBase),t.WaveShaper.prototype.setMap=function(t){for(var e=0,n=this._curve.length;e<n;e++){var i=e/(n-1)*2-1;this._curve[e]=t(i,e)}return this._shaper.curve=this._curve,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(-1===["none","2x","4x"].indexOf(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.prototype.dispose.call(this),this._shaper.disconnect(),this._shaper=null,this._curve=null,this},t.WaveShaper}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(2),n(19)],void 0===(r=function(t){"use strict";return t.TimelineSignal=function(){var e=this.optionsObject(arguments,["value","units"],t.Signal.defaults);this._events=new t.Timeline(10),t.Signal.apply(this,e),e.param=this._param,t.Param.call(this,e),this._initial=this._fromUnits(this._param.value)},t.extend(t.TimelineSignal,t.Param),t.TimelineSignal.Type={Linear:"linear",Exponential:"exponential",Target:"target",Curve:"curve",Set:"set"},Object.defineProperty(t.TimelineSignal.prototype,"value",{get:function(){var t=this.now(),e=this.getValueAtTime(t);return this._toUnits(e)},set:function(t){var e=this._fromUnits(t);this._initial=e,this.cancelScheduledValues(),this._param.value=e}}),t.TimelineSignal.prototype.setValueAtTime=function(e,n){return e=this._fromUnits(e),n=this.toSeconds(n),this._events.add({type:t.TimelineSignal.Type.Set,value:e,time:n}),this._param.setValueAtTime(e,n),this},t.TimelineSignal.prototype.linearRampToValueAtTime=function(e,n){return e=this._fromUnits(e),n=this.toSeconds(n),this._events.add({type:t.TimelineSignal.Type.Linear,value:e,time:n}),this._param.linearRampToValueAtTime(e,n),this},t.TimelineSignal.prototype.exponentialRampToValueAtTime=function(e,n){n=this.toSeconds(n);var i=this._searchBefore(n);i&&0===i.value&&this.setValueAtTime(this._minOutput,i.time),e=this._fromUnits(e);var r=Math.max(e,this._minOutput);return this._events.add({type:t.TimelineSignal.Type.Exponential,value:r,time:n}),e<this._minOutput?(this._param.exponentialRampToValueAtTime(this._minOutput,n-this.sampleTime),this.setValueAtTime(0,n)):this._param.exponentialRampToValueAtTime(e,n),this},t.TimelineSignal.prototype.setTargetAtTime=function(e,n,i){return e=this._fromUnits(e),e=Math.max(this._minOutput,e),i=Math.max(this._minOutput,i),n=this.toSeconds(n),this._events.add({type:t.TimelineSignal.Type.Target,value:e,time:n,constant:i}),this._param.setTargetAtTime(e,n,i),this},t.TimelineSignal.prototype.setValueCurveAtTime=function(e,n,i,r){r=this.defaultArg(r,1);for(var o=new Array(e.length),s=0;s<o.length;s++)o[s]=this._fromUnits(e[s])*r;n=this.toSeconds(n),i=this.toSeconds(i),this._events.add({type:t.TimelineSignal.Type.Curve,value:o,time:n,duration:i}),this._param.setValueAtTime(o[0],n);for(var a=1;a<o.length;a++){var u=n+a/(o.length-1)*i;this._param.linearRampToValueAtTime(o[a],u)}return this},t.TimelineSignal.prototype.cancelScheduledValues=function(t){return t=this.toSeconds(t),this._events.cancel(t),this._param.cancelScheduledValues(t),this},t.TimelineSignal.prototype.setRampPoint=function(e){e=this.toSeconds(e);var n=this._toUnits(this.getValueAtTime(e)),i=this._searchBefore(e);if(i&&i.time===e)this.cancelScheduledValues(e+this.sampleTime);else if(i&&i.type===t.TimelineSignal.Type.Curve&&i.time+i.duration>e)this.cancelScheduledValues(e),this.linearRampToValueAtTime(n,e);else{var r=this._searchAfter(e);r&&(this.cancelScheduledValues(e),r.type===t.TimelineSignal.Type.Linear?this.linearRampToValueAtTime(n,e):r.type===t.TimelineSignal.Type.Exponential&&this.exponentialRampToValueAtTime(n,e)),this.setValueAtTime(n,e)}return this},t.TimelineSignal.prototype.linearRampToValueBetween=function(t,e,n){return this.setRampPoint(e),this.linearRampToValueAtTime(t,n),this},t.TimelineSignal.prototype.exponentialRampToValueBetween=function(t,e,n){return this.setRampPoint(e),this.exponentialRampToValueAtTime(t,n),this},t.TimelineSignal.prototype._searchBefore=function(t){return this._events.get(t)},t.TimelineSignal.prototype._searchAfter=function(t){return this._events.getAfter(t)},t.TimelineSignal.prototype.getValueAtTime=function(e){e=this.toSeconds(e);var n=this._searchAfter(e),i=this._searchBefore(e),r=this._initial;if(null===i)r=this._initial;else if(i.type===t.TimelineSignal.Type.Target){var o,s=this._events.getBefore(i.time);o=null===s?this._initial:s.value,r=this._exponentialApproach(i.time,o,i.value,i.constant,e)}else r=i.type===t.TimelineSignal.Type.Curve?this._curveInterpolate(i.time,i.value,i.duration,e):null===n?i.value:n.type===t.TimelineSignal.Type.Linear?this._linearInterpolate(i.time,i.value,n.time,n.value,e):n.type===t.TimelineSignal.Type.Exponential?this._exponentialInterpolate(i.time,i.value,n.time,n.value,e):i.value;return r},t.TimelineSignal.prototype.connect=t.SignalBase.prototype.connect,t.TimelineSignal.prototype._exponentialApproach=function(t,e,n,i,r){return n+(e-n)*Math.exp(-(r-t)/i)},t.TimelineSignal.prototype._linearInterpolate=function(t,e,n,i,r){return e+(r-t)/(n-t)*(i-e)},t.TimelineSignal.prototype._exponentialInterpolate=function(t,e,n,i,r){return(e=Math.max(this._minOutput,e))*Math.pow(i/e,(r-t)/(n-t))},t.TimelineSignal.prototype._curveInterpolate=function(t,e,n,i){var r=e.length;if(t+n<=i)return e[r-1];if(i<=t)return e[0];var o=(i-t)/n,s=Math.floor((r-1)*o),a=Math.ceil((r-1)*o),u=e[s],c=e[a];return a===s?u:this._linearInterpolate(s,u,a,c,o*(r-1))},t.TimelineSignal.prototype.dispose=function(){t.Signal.prototype.dispose.call(this),t.Param.prototype.dispose.call(this),this._events.dispose(),this._events=null},t.TimelineSignal}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(4),n(1),n(2)],void 0===(r=function(t){"use strict";return t.Scale=function(e,n){this._outputMin=this.defaultArg(e,0),this._outputMax=this.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.prototype.dispose.call(this),this._add.dispose(),this._add=null,this._scale.dispose(),this._scale=null,this},t.Scale}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(16),n(30),n(31),n(12)],void 0===(r=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",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 this.isNumber(e)?e:this.isUndef(e)?this.now():this.isString(e)?new t.Time(e).toSeconds():e instanceof t.TimeBase?e.toSeconds():void 0},t.prototype.toFrequency=function(e){return this.isNumber(e)?e:this.isString(e)||this.isUndef(e)?new t.Frequency(e).valueOf():e instanceof t.TimeBase?e.toFrequency():void 0},t.prototype.toTicks=function(e){return this.isNumber(e)||this.isString(e)?new t.TransportTime(e).toTicks():this.isUndef(e)?t.Transport.ticks:e instanceof t.TimeBase?e.toTicks():void 0},t}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(18),n(9)],void 0===(r=function(t){"use strict";return window.GainNode&&!AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),t.Gain=function(){var e=this.optionsObject(arguments,["gain","units"],t.Gain.defaults);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.Gain.defaults={gain:1,convert:!0},t.Gain.prototype.dispose=function(){t.Param.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},t.prototype.createInsOuts=function(e,n){1===e?this.input=new t.Gain:1<e&&(this.input=new Array(e)),1===n?this.output=new t.Gain:1<n&&(this.output=new Array(e))},t.Gain}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(7),n(39),n(14),n(12)],void 0===(r=function(t){"use strict";return t.Clock=function(){t.Emitter.call(this);var e=this.optionsObject(arguments,["callback","frequency"],t.Clock.defaults);this.callback=e.callback,this._nextTick=0,this._lastState=t.State.Stopped,this.frequency=new t.TimelineSignal(e.frequency,t.Type.Frequency),this._readOnly("frequency"),this.ticks=0,this._state=new t.TimelineState(t.State.Stopped),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,lookAhead:"auto"},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.add({state:t.State.Started,time:e,offset: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},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},t.Clock.prototype._loop=function(){for(var e=this.now()+this.context.lookAhead+this.context.updateInterval+2*this.context.lag;e>this._nextTick&&this._state;){var n=this._state.getValueAtTime(this._nextTick);if(n!==this._lastState){this._lastState=n;var i=this._state.get(this._nextTick);n===t.State.Started?(this._nextTick=i.time,this.isUndef(i.offset)||(this.ticks=i.offset),this.emit("start",i.time,this.ticks)):n===t.State.Stopped?(this.ticks=0,this.emit("stop",i.time)):n===t.State.Paused&&this.emit("pause",i.time)}var r=this._nextTick;this.frequency&&(this._nextTick+=1/this.frequency.getValueAtTime(this._nextTick),n===t.State.Started&&(this.callback(r),this.ticks++))}},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.frequency.dispose(),this.frequency=null,this._boundLoop=null,this._nextTick=1/0,this.callback=null,this._state.dispose(),this._state=null},t.Clock}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(14)],void 0===(r=function(t){function e(e,i,r){if(e.input)Array.isArray(e.input)?(t.prototype.isUndef(r)&&(r=0),this.connect(e.input[r])):this.connect(e.input,i,r);else try{e instanceof AudioNode?n.call(this,e,i,r):n.call(this,e,i)}catch(i){throw new Error("error connecting to node: "+e+"\n"+i)}}var n,i;return!window.hasOwnProperty("AudioContext")&&window.hasOwnProperty("webkitAudioContext")&&(window.AudioContext=window.webkitAudioContext),t.Context=function(e){for(var n in t.Emitter.call(this),e=e||new window.AudioContext,this._context=e,this._context)this._defineProperty(this._context,n);this._latencyHint="interactive",this._lookAhead=.1,this._updateInterval=this._lookAhead/3,this._computedUpdateInterval=0,this._worker=this._createWorker(),this._constants={}},t.extend(t.Context,t.Emitter),t.Emitter.mixin(t.Context),t.Context.prototype._defineProperty=function(t,e){this.isUndef(this[e])&&Object.defineProperty(this,e,{get:function(){return"function"==typeof t[e]?t[e].bind(t):t[e]},set:function(n){t[e]=n}})},t.Context.prototype.now=function(){return this._context.currentTime},t.Context.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);return n.addEventListener("message",function(){this.emit("tick")}.bind(this)),n.addEventListener("message",function(){var t=this.now();if(this.isNumber(this._lastUpdate)){var e=t-this._lastUpdate;this._computedUpdateInterval=Math.max(e,.97*this._computedUpdateInterval)}this._lastUpdate=t}.bind(this)),n},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},Object.defineProperty(t.Context.prototype,"lag",{get:function(){var t=this._computedUpdateInterval-this._updateInterval;return Math.max(t,0)}}),Object.defineProperty(t.Context.prototype,"lookAhead",{get:function(){return this._lookAhead},set:function(t){this._lookAhead=t}}),Object.defineProperty(t.Context.prototype,"updateInterval",{get:function(){return this._updateInterval},set:function(e){this._updateInterval=Math.max(e,t.prototype.blockTime),this._worker.postMessage(Math.max(1e3*e,1))}}),Object.defineProperty(t.Context.prototype,"latencyHint",{get:function(){return this._latencyHint},set:function(t){var e=t;if(this._latencyHint=t,this.isString(t))switch(t){case"interactive":e=.1,this._context.latencyHint=t;break;case"playback":e=.8,this._context.latencyHint=t;break;case"balanced":e=.25,this._context.latencyHint=t;break;case"fastest":e=.01}this.lookAhead=e,this.updateInterval=e/3}}),t.supported&&(n=AudioNode.prototype.connect,i=AudioNode.prototype.disconnect,AudioNode.prototype.connect!==e&&(AudioNode.prototype.connect=e,AudioNode.prototype.disconnect=function(e,n,r){if(e&&e.input&&Array.isArray(e.input))t.prototype.isUndef(r)&&(r=0),this.disconnect(e.input[r],n,r);else if(e&&e.input)this.disconnect(e.input,n,r);else try{i.apply(this,arguments)}catch(n){throw new Error("error disconnecting node: "+e+"\n"+n)}}),t.context=new t.Context),t.Context}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(4),n(20),n(2),n(10)],void 0===(r=function(t){"use strict";return t.Subtract=function(e){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.prototype.dispose.call(this),this._neg.dispose(),this._neg=null,this._sum.disconnect(),this._sum=null,this._param.dispose(),this._param=null,this},t.Subtract}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0)],void 0===(r=function(t){"use strict";return t.Emitter=function(){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.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.prototype.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],i=0,r=n.length;i<r;i++)n[i].apply(this,e)}return this},t.Emitter.mixin=function(e){var n=["on","off","emit"];e._events={};for(var i=0;i<n.length;i++){var r=n[i],o=t.Emitter.prototype[r];e[r]=o}},t.Emitter.prototype.dispose=function(){return t.prototype.dispose.call(this),this._events=null,this},t.Emitter}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0)],void 0===(r=function(t){"use strict";return t.SignalBase=function(){},t.extend(t.SignalBase),t.SignalBase.prototype.connect=function(e,n,i){return t.Signal&&t.Signal===e.constructor||t.Param&&t.Param===e.constructor||t.TimelineSignal&&t.TimelineSignal===e.constructor?(e._param.cancelScheduledValues(0),e._param.value=0,e.overridden=!0):e instanceof AudioParam&&(e.cancelScheduledValues(0),e.value=0),t.prototype.connect.call(this,e,n,i),this},t.SignalBase}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(17)],void 0===(r=function(t){return t.Time=function(e,n){if(!(this instanceof t.Time))return new t.Time(e,n);this._plusNow=!1,t.TimeBase.call(this,e,n)},t.extend(t.Time,t.TimeBase),t.Time.prototype._unaryExpressions=Object.create(t.TimeBase.prototype._unaryExpressions),t.Time.prototype._unaryExpressions.quantize={regexp:/^@/,method:function(e){return t.Transport.nextSubdivision(e())}},t.Time.prototype._unaryExpressions.now={regexp:/^\+/,method:function(t){return this._plusNow=!0,t()}},t.Time.prototype.quantize=function(t,e){return e=this.defaultArg(e,1),this._expr=function(t,e,n){return t=t(),e=e.toSeconds(),t+(Math.round(t/e)*e-t)*n}.bind(this,this._expr,new this.constructor(t),e),this},t.Time.prototype.addNow=function(){return this._plusNow=!0,this},t.Time.prototype._defaultExpr=function(){return this._plusNow=!0,this._noOp},t.Time.prototype.copy=function(e){return t.TimeBase.prototype.copy.call(this,e),this._plusNow=e._plusNow,this},t.Time.prototype.toNotation=function(){var t=this.toSeconds(),e=this._toNotationHelper(t,["1m","2n","4n","8n","16n","32n","64n","128n"]),n=this._toNotationHelper(t,["1m","2n","2t","4n","4t","8n","8t","16n","16t","32n","32t","64n","64t","128n"]);return n.split("+").length<e.split("+").length?n:e},t.Time.prototype._toNotationHelper=function(t,e){for(var n=this._notationToUnits(e[e.length-1]),i="",r=0;r<e.length;r++){var o=this._notationToUnits(e[r]),s=t/o;if(1-s%1<1e-6&&(s+=1e-6),0<(s=Math.floor(s))){if(i+=1===s?e[r]:s.toString()+"*"+e[r],(t-=s*o)<n)break;i+=" + "}}return""===i&&(i="0"),i},t.Time.prototype._notationToUnits=function(t){for(var e=this._primaryExpressions,n=[e.n,e.t,e.m],i=0;i<n.length;i++){var r=n[i],o=t.match(r.regexp);if(o)return r.method.call(this,o[1])}},t.Time.prototype.toBarsBeatsSixteenths=function(){var t=this._beatsToUnits(1),e=this.toSeconds()/t,n=Math.floor(e/this._timeSignature()),i=e%1*4;return e=Math.floor(e)%this._timeSignature(),3<(i=i.toString()).length&&(i=parseFloat(i).toFixed(3)),[n,e,i].join(":")},t.Time.prototype.toTicks=function(){var e=this._beatsToUnits(1),n=this.valueOf()/e;return Math.floor(n*t.Transport.PPQ)},t.Time.prototype.toSamples=function(){return this.toSeconds()*this.context.sampleRate},t.Time.prototype.toFrequency=function(){return 1/this.toSeconds()},t.Time.prototype.toSeconds=function(){return this.valueOf()},t.Time.prototype.toMilliseconds=function(){return 1e3*this.toSeconds()},t.Time.prototype.valueOf=function(){return this._expr()+(this._plusNow?this.now():0)},t.Time}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0)],void 0===(r=function(t){return t.TimeBase=function(e,n){if(!(this instanceof t.TimeBase))return new t.TimeBase(e,n);if(this._expr=this._noOp,e instanceof t.TimeBase)this.copy(e);else if(!this.isUndef(n)||this.isNumber(e)){n=this.defaultArg(n,this._defaultUnits);var i=this._primaryExpressions[n].method;this._expr=i.bind(this,e)}else this.isString(e)?this.set(e):this.isUndef(e)&&(this._expr=this._defaultExpr())},t.extend(t.TimeBase),t.TimeBase.prototype.set=function(t){return this._expr=this._parseExprString(t),this},t.TimeBase.prototype.clone=function(){var t=new this.constructor;return t.copy(this),t},t.TimeBase.prototype.copy=function(t){var e=t._expr();return this.set(e)},t.TimeBase.prototype._primaryExpressions={n:{regexp:/^(\d+)n/i,method:function(t){return 1===(t=parseInt(t))?this._beatsToUnits(this._timeSignature()):this._beatsToUnits(4/t)}},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._timeSignature())}},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._timeSignature()*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._primaryExpressions[this._defaultUnits].method.call(this,t)}}},t.TimeBase.prototype._binaryExpressions={"+":{regexp:/^\+/,precedence:2,method:function(t,e){return t()+e()}},"-":{regexp:/^\-/,precedence:2,method:function(t,e){return t()-e()}},"*":{regexp:/^\*/,precedence:1,method:function(t,e){return t()*e()}},"/":{regexp:/^\//,precedence:1,method:function(t,e){return t()/e()}}},t.TimeBase.prototype._unaryExpressions={neg:{regexp:/^\-/,method:function(t){return-t()}}},t.TimeBase.prototype._syntaxGlue={"(":{regexp:/^\(/},")":{regexp:/^\)/}},t.TimeBase.prototype._tokenize=function(t){for(var e=-1,n=[];0<t.length;){var i=r(t=t.trim(),this);n.push(i),t=t.substr(i.value.length)}function r(t,e){for(var n=["_binaryExpressions","_unaryExpressions","_primaryExpressions","_syntaxGlue"],i=0;i<n.length;i++){var r=e[n[i]];for(var o in r){var s=r[o],a=s.regexp,u=t.match(a);if(null!==u)return{method:s.method,precedence:s.precedence,regexp:s.regexp,value:u[0]}}}throw new SyntaxError("Tone.TimeBase: Unexpected token "+t)}return{next:function(){return n[++e]},peek:function(){return n[e+1]}}},t.TimeBase.prototype._matchGroup=function(t,e,n){if(!this.isUndef(t))for(var i in e){var r=e[i];if(r.regexp.test(t.value)){if(this.isUndef(n))return r;if(r.precedence===n)return r}}return!1},t.TimeBase.prototype._parseBinary=function(t,e){var n;this.isUndef(e)&&(e=2),n=e<0?this._parseUnary(t):this._parseBinary(t,e-1);for(var i=t.peek();i&&this._matchGroup(i,this._binaryExpressions,e);)n=(i=t.next()).method.bind(this,n,this._parseBinary(t,e-1)),i=t.peek();return n},t.TimeBase.prototype._parseUnary=function(t){var e,n;e=t.peek();var i=this._matchGroup(e,this._unaryExpressions);return i?(e=t.next(),n=this._parseUnary(t),i.method.bind(this,n)):this._parsePrimary(t)},t.TimeBase.prototype._parsePrimary=function(t){var e,n;if(e=t.peek(),this.isUndef(e))throw new SyntaxError("Tone.TimeBase: Unexpected end of expression");if(this._matchGroup(e,this._primaryExpressions)){var i=(e=t.next()).value.match(e.regexp);return e.method.bind(this,i[1],i[2],i[3])}if(e&&"("===e.value){if(t.next(),n=this._parseBinary(t),!(e=t.next())||")"!==e.value)throw new SyntaxError("Expected )");return n}throw new SyntaxError("Tone.TimeBase: Cannot process token "+e.value)},t.TimeBase.prototype._parseExprString=function(t){this.isString(t)||(t=t.toString());var e=this._tokenize(t);return this._parseBinary(e)},t.TimeBase.prototype._noOp=function(){return 0},t.TimeBase.prototype._defaultExpr=function(){return this._noOp},t.TimeBase.prototype._defaultUnits="s",t.TimeBase.prototype._frequencyToUnits=function(t){return 1/t},t.TimeBase.prototype._beatsToUnits=function(e){return 60/t.Transport.bpm.value*e},t.TimeBase.prototype._secondsToUnits=function(t){return t},t.TimeBase.prototype._ticksToUnits=function(e){return e*(this._beatsToUnits(1)/t.Transport.PPQ)},t.TimeBase.prototype._timeSignature=function(){return t.Transport.timeSignature},t.TimeBase.prototype._pushExpr=function(e,n,i){return e instanceof t.TimeBase||(e=new this.constructor(e,i)),this._expr=this._binaryExpressions[n].method.bind(this,this._expr,e._expr),this},t.TimeBase.prototype.add=function(t,e){return this._pushExpr(t,"+",e)},t.TimeBase.prototype.sub=function(t,e){return this._pushExpr(t,"-",e)},t.TimeBase.prototype.mult=function(t,e){return this._pushExpr(t,"*",e)},t.TimeBase.prototype.div=function(t,e){return this._pushExpr(t,"/",e)},t.TimeBase.prototype.valueOf=function(){return this._expr()},t.TimeBase.prototype.dispose=function(){this._expr=null},t.TimeBase}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(9)],void 0===(r=function(t){"use strict";return t.Param=function(){var e=this.optionsObject(arguments,["param","units","convert"],t.Param.defaults);this._param=this.input=e.param,this.units=e.units,this.convert=e.convert,this.overridden=!1,this._lfo=null,this.isObject(e.lfo)?this.value=e.lfo:this.isUndef(e.value)||(this.value=e.value)},t.extend(t.Param),t.Param.defaults={units:t.Type.Default,convert:!0,param:void 0},Object.defineProperty(t.Param.prototype,"value",{get:function(){return this._toUnits(this._param.value)},set:function(e){if(this.isObject(e)){if(this.isUndef(t.LFO))throw new Error("Include 'Tone.LFO' to use an LFO as a Param value.");this._lfo&&this._lfo.dispose(),this._lfo=new t.LFO(e).start(),this._lfo.connect(this.input)}else{var n=this._fromUnits(e);this._param.cancelScheduledValues(0),this._param.value=n}}}),t.Param.prototype._fromUnits=function(e){if(!this.convert&&!this.isUndef(this.convert))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 this.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){return(this.convert||this.isUndef(this.convert))&&this.units===t.Type.Decibels?this.gainToDb(e):e},t.Param.prototype._minOutput=1e-5,t.Param.prototype.setValueAtTime=function(t,e){return t=this._fromUnits(t),(e=this.toSeconds(e))<=this.now()+this.blockTime?this._param.value=t:this._param.setValueAtTime(t,e),this},t.Param.prototype.setRampPoint=function(t){t=this.defaultArg(t,this.now());var e=this._param.value;return 0===e&&(e=this._minOutput),this._param.setValueAtTime(e,t),this},t.Param.prototype.linearRampToValueAtTime=function(t,e){return t=this._fromUnits(t),this._param.linearRampToValueAtTime(t,this.toSeconds(e)),this},t.Param.prototype.exponentialRampToValueAtTime=function(t,e){return t=this._fromUnits(t),t=Math.max(this._minOutput,t),this._param.exponentialRampToValueAtTime(t,this.toSeconds(e)),this},t.Param.prototype.exponentialRampToValue=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialRampToValueAtTime(t,n+this.toSeconds(e)),this},t.Param.prototype.linearRampToValue=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.linearRampToValueAtTime(t,n+this.toSeconds(e)),this},t.Param.prototype.setTargetAtTime=function(t,e,n){return t=this._fromUnits(t),t=Math.max(this._minOutput,t),n=Math.max(this._minOutput,n),this._param.setTargetAtTime(t,this.toSeconds(e),n),this},t.Param.prototype.setValueCurveAtTime=function(t,e,n){for(var i=0;i<t.length;i++)t[i]=this._fromUnits(t[i]);return this._param.setValueCurveAtTime(t,this.toSeconds(e),this.toSeconds(n)),this},t.Param.prototype.cancelScheduledValues=function(t){return this._param.cancelScheduledValues(this.toSeconds(t)),this},t.Param.prototype.rampTo=function(e,n,i){return n=this.defaultArg(n,0),this.units===t.Type.Frequency||this.units===t.Type.BPM||this.units===t.Type.Decibels?this.exponentialRampToValue(e,n,i):this.linearRampToValue(e,n,i),this},Object.defineProperty(t.Param.prototype,"lfo",{get:function(){return this._lfo}}),t.Param.prototype.dispose=function(){return t.prototype.dispose.call(this),this._param=null,this._lfo&&(this._lfo.dispose(),this._lfo=null),this},t.Param}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(9)],void 0===(r=function(t){"use strict";return t.Timeline=function(){var e=this.optionsObject(arguments,["memory"],t.Timeline.defaults);this._timeline=[],this._toRemove=[],this._iterating=!1,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(t){if(this.isUndef(t.time))throw new Error("Tone.Timeline: events must have a time attribute");if(this._timeline.length){var e=this._search(t.time);this._timeline.splice(e+1,0,t)}else this._timeline.push(t);if(this.length>this.memory){var n=this.length-this.memory;this._timeline.splice(0,n)}return this},t.Timeline.prototype.remove=function(t){if(this._iterating)this._toRemove.push(t);else{var e=this._timeline.indexOf(t);-1!==e&&this._timeline.splice(e,1)}return this},t.Timeline.prototype.get=function(t){var e=this._search(t);return-1!==e?this._timeline[e]:null},t.Timeline.prototype.peek=function(){return this._timeline[0]},t.Timeline.prototype.shift=function(){return this._timeline.shift()},t.Timeline.prototype.getAfter=function(t){var e=this._search(t);return e+1<this._timeline.length?this._timeline[e+1]:null},t.Timeline.prototype.getBefore=function(t){var e=this._timeline.length;if(0<e&&this._timeline[e-1].time<t)return this._timeline[e-1];var n=this._search(t);return 0<=n-1?this._timeline[n-1]:null},t.Timeline.prototype.cancel=function(t){if(1<this._timeline.length){var e=this._search(t);if(0<=e)if(this._timeline[e].time===t){for(var n=e;0<=n&&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){if(this._timeline.length){var e=this._search(t);0<=e&&(this._timeline=this._timeline.slice(e+1))}return this},t.Timeline.prototype._search=function(t){var e=0,n=this._timeline.length,i=n;if(0<n&&this._timeline[n-1].time<=t)return n-1;for(;e<i;){var r=Math.floor(e+(i-e)/2),o=this._timeline[r],s=this._timeline[r+1];if(o.time===t){for(var a=r;a<this._timeline.length;a++)this._timeline[a].time===t&&(r=a);return r}if(o.time<t&&s.time>t)return r;o.time>t?i=r:o.time<t&&(e=r+1)}return-1},t.Timeline.prototype._iterate=function(t,e,n){this._iterating=!0,e=this.defaultArg(e,0),n=this.defaultArg(n,this._timeline.length-1);for(var i=e;i<=n;i++)t(this._timeline[i]);if(this._iterating=!1,0<this._toRemove.length){for(var r=0;r<this._toRemove.length;r++){var o=this._timeline.indexOf(this._toRemove[r]);-1!==o&&this._timeline.splice(o,1)}this._toRemove=[]}},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.forEachFrom=function(t,e){for(var n=this._search(t);0<=n&&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(n)}),0,n),this},t.Timeline.prototype.dispose=function(){t.prototype.dispose.call(this),this._timeline=null,this._toRemove=null},t.Timeline}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(1),n(2)],void 0===(r=function(t){"use strict";return t.Negate=function(){this._multiply=this.input=this.output=new t.Multiply(-1)},t.extend(t.Negate,t.SignalBase),t.Negate.prototype.dispose=function(){return t.prototype.dispose.call(this),this._multiply.dispose(),this._multiply=null,this},t.Negate}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(2),n(1),n(6)],void 0===(r=function(t){"use strict";return t.GreaterThanZero=function(){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.prototype.dispose.call(this),this._scale.dispose(),this._scale=null,this._thresh.dispose(),this._thresh=null,this},t.GreaterThanZero}.apply(e,i))||(t.exports=r)},function(t,e,n){var i,r;void 0===(r="function"==typeof(i=function(){var t=function(t,e){this._dragged=!1,this._element=t,this._bindedMove=this._moved.bind(this),this._bindedEnd=this._ended.bind(this,e),t.addEventListener("touchstart",this._bindedEnd),t.addEventListener("touchmove",this._bindedMove),t.addEventListener("touchend",this._bindedEnd),t.addEventListener("mouseup",this._bindedEnd)};function e(t){return"running"===t.state}return t.prototype._moved=function(t){this._dragged=!0},t.prototype._ended=function(t){this._dragged||function(t){var e=t.createBuffer(1,1,t.sampleRate),n=t.createBufferSource();n.buffer=e,n.connect(t.destination),n.start(0),t.resume&&t.resume()}(t),this._dragged=!1},t.prototype.dispose=function(){this._element.removeEventListener("touchstart",this._bindedEnd),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},function(n,i,r){var o=new Promise((function(t){!function(t,n){e(t)?n():function i(){e(t)?n():(requestAnimationFrame(i),t.resume&&t.resume())}()}(n,t)})),s=[];return function e(n,i,r){if(Array.isArray(n)||NodeList&&n instanceof NodeList)for(var o=0;o<n.length;o++)e(n[o],i,r);else if("string"==typeof n)e(document.querySelectorAll(n),i,r);else if(n.jquery&&"function"==typeof n.toArray)e(n.toArray(),i,r);else if(Element&&n instanceof Element){var s=new t(n,r);i.push(s)}}(i=i||document.body,s,n),o.then((function(){for(var t=0;t<s.length;t++)s[t].dispose();s=null,r&&r()})),o}})?i.apply(e,[]):i)||(t.exports=r)},function(t,e,n){var i,r;i=[n(0),n(2),n(32),n(38),n(10)],void 0===(r=function(t){"use strict";return t.CrossFade=function(e){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(this.defaultArg(e,.5),t.Type.NormalRange),this._equalPowerA=new t.EqualPowerGain,this._equalPowerB=new t.EqualPowerGain,this._invert=new t.Expr("1 - $0"),this.a.connect(this.output),this.b.connect(this.output),this.fade.chain(this._equalPowerB,this.b.gain),this.fade.chain(this._invert,this._equalPowerA,this.a.gain),this._readOnly("fade")},t.extend(t.CrossFade),t.CrossFade.prototype.dispose=function(){return t.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.a.dispose(),this.a=null,this.b.dispose(),this.b=null,this},t.CrossFade}.apply(e,i))||(t.exports=r)},function(t,e){function n(t){var e=this,n={},r=-1;this.parameters.forEach((function(t,i){var o=a[++r]||(a[r]=new Float32Array(e.bufferSize));o.fill(t.value),n[i]=o})),this.processor.realm.exec("self.sampleRate=sampleRate="+this.context.sampleRate+";self.currentTime=currentTime="+this.context.currentTime);var o=i(t.inputBuffer),s=i(t.outputBuffer);this.instance.process([o],[s],n)}function i(t){for(var e=[],n=0;n<t.numberOfChannels;n++)e[n]=t.getChannelData(n);return e}function r(t){return t.$$processors||(t.$$processors={})}function o(t){this.$$context=t}var s,a;a=[],"function"!=typeof AudioWorkletNode&&(self.AudioWorkletNode=function(t,e,i){var o=r(t)[e],a=t.createScriptProcessor(void 0,2,i&&i.outputChannelCount?i.outputChannelCount[0]:2);if(a.parameters=new Map,o.properties)for(var u=0;u<o.properties.length;u++){var c=o.properties[u],l=t.createGain().gain;l.value=c.defaultValue,a.parameters.set(c.name,l)}var h=new MessageChannel;s=h.port2;var p=new o.Processor(i||{});return s=null,a.port=h.port1,a.processor=o,a.instance=p,a.onaudioprocess=n,a},Object.defineProperty((self.AudioContext||self.webkitAudioContext).prototype,"audioWorklet",{get:function(){return this.$$audioWorklet||(this.$$audioWorklet=new self.AudioWorklet(this))}}),self.AudioWorklet=(o.prototype.addModule=function(t,e){var n=this;return fetch(t).then((function(t){if(!t.ok)throw Error(t.status);return t.text()})).then((function(t){var i={sampleRate:0,currentTime:0,AudioWorkletProcessor:function(){this.port=s},registerProcessor:function(t,e){r(n.$$context)[t]={realm:o,context:i,Processor:e,properties:e.parameterDescriptors||[]}}},o=new function(t,e){var n=document.createElement("iframe");n.style.cssText="position:absolute;left:0;top:-999px;width:1px;height:1px;",e.appendChild(n);var i=n.contentWindow,r=i.document,o="var window,$hook";for(var s in i)s in t||"eval"===s||(o+=",",o+=s);for(var a in t)o+=",",o+=a,o+="=self.",o+=a;var u=r.createElement("script");u.appendChild(r.createTextNode('function $hook(self,console) {"use strict";\n '+o+";return function() {return eval(arguments[0])}}")),r.body.appendChild(u),this.exec=i.$hook(t,console)}(i.self=i,document.documentElement);return o.exec((e&&e.transpile||String)(t)),null}))},o))},function(t,e){function n(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window,window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=window.webkitAudioContext,"function"!=typeof AudioContext.prototype.createGain&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),"function"!=typeof AudioContext.prototype.createDelay&&(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),"function"!=typeof AudioContext.prototype.createScriptProcessor&&(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),"function"!=typeof AudioContext.prototype.createPeriodicWave&&(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var t=this.internal_createGain();return n(t.gain),t},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(t){var e=t?this.internal_createDelay(t):this.internal_createDelay();return n(e.delayTime),e},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var t=this.internal_createBufferSource();return t.start?(t.internal_start=t.start,t.start=function(e,n,i){void 0!==i?t.internal_start(e||0,n,i):t.internal_start(e||0,n||0)}):t.start=function(t,e,n){e||n?this.noteGrainOn(t||0,e,n):this.noteOn(t||0)},t.stop?(t.internal_stop=t.stop,t.stop=function(e){t.internal_stop(e||0)}):t.stop=function(t){this.noteOff(t||0)},n(t.playbackRate),t},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var t=this.internal_createDynamicsCompressor();return n(t.threshold),n(t.knee),n(t.ratio),n(t.reduction),n(t.attack),n(t.release),t},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var t=this.internal_createBiquadFilter();return n(t.frequency),n(t.detune),n(t.Q),n(t.gain),t},"function"!=typeof AudioContext.prototype.createOscillator&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var t=this.internal_createOscillator();return t.start?(t.internal_start=t.start,t.start=function(e){t.internal_start(e||0)}):t.start=function(t){this.noteOn(t||0)},t.stop?(t.internal_stop=t.stop,t.stop=function(e){t.internal_stop(e||0)}):t.stop=function(t){this.noteOff(t||0)},t.setPeriodicWave||(t.setPeriodicWave=t.setWaveTable),n(t.frequency),n(t.detune),t})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=window.webkitOfflineAudioContext),navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGet