!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Wad=e():t.Wad=e()}(window,(function(){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},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 r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},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=9)}([function(t,e,n){"use strict";n.r(e),n.d(e,"logStats",(function(){return h})),n.d(e,"logMessage",(function(){return p})),n.d(e,"audioCache",(function(){return f})),n.d(e,"context",(function(){return c})),n.d(e,"noiseBuffer",(function(){return y})),n.d(e,"constructEnv",(function(){return m})),n.d(e,"constructFilter",(function(){return b})),n.d(e,"requestAudioFile",(function(){return _})),n.d(e,"constructVibrato",(function(){return w})),n.d(e,"constructTremolo",(function(){return x})),n.d(e,"constructReverb",(function(){return k})),n.d(e,"constructPanning",(function(){return T})),n.d(e,"constructDelay",(function(){return O})),n.d(e,"constructCompressor",(function(){return I})),n.d(e,"getConsent",(function(){return j})),n.d(e,"permissionsGranted",(function(){return A})),n.d(e,"setUpMic",(function(){return M})),n.d(e,"setUpPanningOnPlay",(function(){return D})),n.d(e,"setUpVibratoOnPlay",(function(){return N})),n.d(e,"setUpTremoloOnPlay",(function(){return E})),n.d(e,"setUpDelayOnPlay",(function(){return B})),n.d(e,"setUpTunaOnPlay",(function(){return z})),n.d(e,"plugEmIn",(function(){return R})),n.d(e,"setUpEnvOnPlay",(function(){return P})),n.d(e,"setUpFilterOnPlay",(function(){return F})),n.d(e,"setUpReverbOnPlay",(function(){return q})),n.d(e,"filterEnv",(function(){return S})),n.d(e,"playEnv",(function(){return L})),n.d(e,"setUpOscillator",(function(){return C})),n.d(e,"createFilters",(function(){return G}));var r=n(3),i=n.n(r),a=n(5),o=n(2),u=n(1),s=n.n(u);let c,l=window.AudioContext||window.webkitAudioContext,f={},h={verbosity:0,suppressedLogs:0},p=function(t,e){e=e||1,h.verbosity>=e?console.log(t):h.suppressedLogs++},d=document.querySelector("a-scene");d&&d.audioListener&&d.audioListener.context?(c=d.audioListener.context,p("An A-Frame scene has been detected.")):c=new l;let v=function(){p("unlock",2),"suspended"===c.state?(p("suspended",2),c.resume()):"running"===c.state&&(p("The audio context is running.",2),p(c,2),window.removeEventListener("click",v),window.removeEventListener("touchstart",v),window.removeEventListener("touchend",v))};window.addEventListener("click",v),window.addEventListener("touchstart",v),window.addEventListener("touchend",v);let g=function(t){if(t.navigator.mediaDevices&&t.navigator.mediaDevices.getUserMedia)return t.navigator.mediaDevices.getUserMedia.bind(t.navigator.mediaDevices);let e=t.navigator.getUserMedia||t.navigator.webkitGetUserMedia||t.navigator.mozGetUserMedia;return e?function(n){return new Promise((function(r,i){e.call(t.navigator,n,r,i)}))}:function(){throw"getUserMedia is unsupported"}}(window);p(g?"Your browser supports getUserMedia.":"Your browser does not support getUserMedia.");let y=function(){Math.seed=6,Math.seededRandom=function(t,e){return t=t||1,e=e||0,Math.seed=(9301*Math.seed+49297)%233280,e+Math.seed/233280*(t-e)};for(var t=2*c.sampleRate,e=c.createBuffer(1,t,c.sampleRate),n=e.getChannelData(0),r=0;rt.arrayBuffer()).then(t=>c.decodeAudioData(t)),t.useCache&&(f[t.source]=n)),n.then(n=>{t.decodedBuffer=n,3.14159===t.env.hold&&(t.defaultEnv.hold=t.decodedBuffer.duration*(1/t.rate),t.env.hold=t.decodedBuffer.duration*(1/t.rate)),t.duration=1e3*t.env.hold,e&&e(t),t.playable++,t.playOnLoad&&t.play(t.playOnLoadArg)})},w=function(t){return t.vibrato?{shape:s.a.get(t,"vibrato.shape","sine"),speed:s.a.get(t,"vibrato.speed",1),magnitude:s.a.get(t,"vibrato.magnitude",5),attack:s.a.get(t,"vibrato.attack",0)}:null},x=function(t){return t.tremolo?{shape:s.a.get(t,"tremolo.shape","sine"),speed:s.a.get(t,"tremolo.speed",1),magnitude:s.a.get(t,"tremolo.magnitude",5),attack:s.a.get(t,"tremolo.attack",1)}:null},k=function(t,e){if(e.reverb){var n=e.reverb.impulse||"https://frivolous.biz/audio/widehall.wav",r=new XMLHttpRequest;return r.open("GET",n,!0),r.responseType="arraybuffer",t.playable--,r.onload=function(){c.decodeAudioData(r.response,(function(n){t.reverb.buffer=n,t.playable++,t.playOnLoad&&t.play(t.playOnLoadArg),t instanceof a.a&&t.setUp(e),"mic"===t.source&&t.reverb&&t.reverb.buffer&&t.reverb.node&&!t.reverb.node.buffer&&(t.reverb.node.convolver.buffer=t.reverb.buffer)}))},r.send(),{wet:s.a.get(e,"reverb.wet",1)}}return null},T=function(t){let e=null;return"panning"in t?(e={location:t.panning},"number"==typeof t.panning?e.type="stereo":(e.type="3d",e.panningModel=t.panningModel||"equalpower",e.distanceModel=t.distanceModel,e.maxDistance=t.maxDistance,e.rolloffFactor=t.rolloffFactor,e.refDistance=t.refDistance,e.coneInnerAngle=t.coneInnerAngle,e.coneOuterAngle=t.coneOuterAngle,e.coneOuterGain=t.coneOuterGain)):e={location:0,type:"stereo"},"stereo"!==e.type||c.createStereoPanner||(p("Your browser does not support stereo panning. Falling back to 3D panning."),e={location:[0,0,0],type:"3d",panningModel:"equalpower"}),e},O=function(t){return t.delay?{delayTime:s.a.get(t,"delay.delayTime",.5),maxDelayTime:s.a.get(t,"delay.maxDelayTime",2),feedback:s.a.get(t,"delay.feedback",.25),wet:s.a.get(t,"delay.wet",.25)}:null},A={micConsent:!1},j=function(t,e){return t.nodes=[],t.mediaStreamSource=null,t.gain=null,g({audio:!0,video:!1}).then((function(n){return t.mediaStreamSource=c.createMediaStreamSource(n),A.micConsent=!0,M(t,e),t})).catch((function(t){p("Error setting up microphone input: ",t)}))},M=function(t,e){t.nodes=[],t.gain=c.createGain(),t.gain.gain.value=s.a.get(e,"volume",t.volume),t.nodes.push(t.mediaStreamSource),t.nodes.push(t.gain),(t.filter||e.filter)&&G(t,e),(t.reverb||e.reverb)&&q(t,e),T(t,e),D(t,e),(t.delay||e.delay)&&B(t,e),z(t,e),t.setUpExternalFxOnPlay(e,c)},S=function(t,e){t.filter.forEach((function(t,n){t.node.frequency.linearRampToValueAtTime(t.frequency,e.exactTime),t.node.frequency.linearRampToValueAtTime(t.env.frequency,e.exactTime+t.env.attack)}))},L=function(t,e){let n,r=e.loop||e.loop;n=-1!==t.env.hold&&(!r||t.userSetHold||e.env&&e.env.hold)?t.env.hold:999,t.gain[0].gain.linearRampToValueAtTime(1e-4,e.exactTime),t.gain[0].gain.linearRampToValueAtTime(t.volume,e.exactTime+t.env.attack+1e-5),t.gain[0].gain.linearRampToValueAtTime(t.volume*t.env.sustain,e.exactTime+t.env.attack+t.env.decay+2e-5),t.gain[0].gain.linearRampToValueAtTime(t.volume*t.env.sustain,e.exactTime+t.env.attack+t.env.decay+n+3e-5),t.gain[0].gain.linearRampToValueAtTime(1e-4,e.exactTime+t.env.attack+t.env.decay+n+t.env.release+4e-5),t.soundSource.start(e.exactTime,e.offset),t.soundSource.playbackRate||t.soundSource.stop(e.exactTime+t.env.attack+t.env.decay+n+t.env.release+5e-5)},R=function(t,e){let n,r=e&&e.destination||t.destination;for(let e=1;e * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var a="Expected a function",o="__lodash_placeholder__",u=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],s="[object Arguments]",c="[object Array]",l="[object Boolean]",f="[object Date]",h="[object Error]",p="[object Function]",d="[object GeneratorFunction]",v="[object Map]",g="[object Number]",y="[object Object]",m="[object RegExp]",b="[object Set]",_="[object String]",w="[object Symbol]",x="[object WeakMap]",k="[object ArrayBuffer]",T="[object DataView]",O="[object Float32Array]",A="[object Float64Array]",j="[object Int8Array]",M="[object Int16Array]",S="[object Int32Array]",L="[object Uint8Array]",R="[object Uint16Array]",C="[object Uint32Array]",P=/\b__p \+= '';/g,G=/\b(__p \+=) '' \+/g,F=/(__e\(.*?\)|\b__t\)) \+\n'';/g,q=/&(?:amp|lt|gt|quot|#39);/g,D=/[&<>"']/g,N=RegExp(q.source),E=RegExp(D.source),B=/<%-([\s\S]+?)%>/g,I=/<%([\s\S]+?)%>/g,U=/<%=([\s\S]+?)%>/g,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,V=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Z=/[\\^$.*+?()[\]{}|]/g,Y=RegExp(Z.source),$=/^\s+/,X=/\s/,H=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Q=/\{\n\/\* \[wrapped with (.+)\] \*/,K=/,? & /,J=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,tt=/[()=,{}\[\]\/\s]/,et=/\\(\\)?/g,nt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rt=/\w*$/,it=/^[-+]0x[0-9a-f]+$/i,at=/^0b[01]+$/i,ot=/^\[object .+?Constructor\]$/,ut=/^0o[0-7]+$/i,st=/^(?:0|[1-9]\d*)$/,ct=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lt=/($^)/,ft=/['\n\r\u2028\u2029\\]/g,ht="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",pt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",dt="[\\ud800-\\udfff]",vt="["+pt+"]",gt="["+ht+"]",yt="\\d+",mt="[\\u2700-\\u27bf]",bt="[a-z\\xdf-\\xf6\\xf8-\\xff]",_t="[^\\ud800-\\udfff"+pt+yt+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",wt="\\ud83c[\\udffb-\\udfff]",xt="[^\\ud800-\\udfff]",kt="(?:\\ud83c[\\udde6-\\uddff]){2}",Tt="[\\ud800-\\udbff][\\udc00-\\udfff]",Ot="[A-Z\\xc0-\\xd6\\xd8-\\xde]",At="(?:"+bt+"|"+_t+")",jt="(?:"+Ot+"|"+_t+")",Mt="(?:"+gt+"|"+wt+")"+"?",St="[\\ufe0e\\ufe0f]?"+Mt+("(?:\\u200d(?:"+[xt,kt,Tt].join("|")+")[\\ufe0e\\ufe0f]?"+Mt+")*"),Lt="(?:"+[mt,kt,Tt].join("|")+")"+St,Rt="(?:"+[xt+gt+"?",gt,kt,Tt,dt].join("|")+")",Ct=RegExp("['’]","g"),Pt=RegExp(gt,"g"),Gt=RegExp(wt+"(?="+wt+")|"+Rt+St,"g"),Ft=RegExp([Ot+"?"+bt+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[vt,Ot,"$"].join("|")+")",jt+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[vt,Ot+At,"$"].join("|")+")",Ot+"?"+At+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Ot+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",yt,Lt].join("|"),"g"),qt=RegExp("[\\u200d\\ud800-\\udfff"+ht+"\\ufe0e\\ufe0f]"),Dt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nt=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Et=-1,Bt={};Bt[O]=Bt[A]=Bt[j]=Bt[M]=Bt[S]=Bt[L]=Bt["[object Uint8ClampedArray]"]=Bt[R]=Bt[C]=!0,Bt[s]=Bt[c]=Bt[k]=Bt[l]=Bt[T]=Bt[f]=Bt[h]=Bt[p]=Bt[v]=Bt[g]=Bt[y]=Bt[m]=Bt[b]=Bt[_]=Bt[x]=!1;var It={};It[s]=It[c]=It[k]=It[T]=It[l]=It[f]=It[O]=It[A]=It[j]=It[M]=It[S]=It[v]=It[g]=It[y]=It[m]=It[b]=It[_]=It[w]=It[L]=It["[object Uint8ClampedArray]"]=It[R]=It[C]=!0,It[h]=It[p]=It[x]=!1;var Ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zt=parseFloat,Wt=parseInt,Vt="object"==typeof t&&t&&t.Object===Object&&t,Zt="object"==typeof self&&self&&self.Object===Object&&self,Yt=Vt||Zt||Function("return this")(),$t=e&&!e.nodeType&&e,Xt=$t&&"object"==typeof r&&r&&!r.nodeType&&r,Ht=Xt&&Xt.exports===$t,Qt=Ht&&Vt.process,Kt=function(){try{var t=Xt&&Xt.require&&Xt.require("util").types;return t||Qt&&Qt.binding&&Qt.binding("util")}catch(t){}}(),Jt=Kt&&Kt.isArrayBuffer,te=Kt&&Kt.isDate,ee=Kt&&Kt.isMap,ne=Kt&&Kt.isRegExp,re=Kt&&Kt.isSet,ie=Kt&&Kt.isTypedArray;function ae(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function oe(t,e,n,r){for(var i=-1,a=null==t?0:t.length;++i-1}function he(t,e,n){for(var r=-1,i=null==t?0:t.length;++r-1;);return n}function Fe(t,e){for(var n=t.length;n--&&we(e,t[n],0)>-1;);return n}function qe(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}var De=Ae({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Ne=Ae({"&":"&","<":"<",">":">",'"':""","'":"'"});function Ee(t){return"\\"+Ut[t]}function Be(t){return qt.test(t)}function Ie(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function Ue(t,e){return function(n){return t(e(n))}}function ze(t,e){for(var n=-1,r=t.length,i=0,a=[];++n",""":'"',"'":"'"});var He=function t(e){var n,r=(e=null==e?Yt:He.defaults(Yt.Object(),e,He.pick(Yt,Nt))).Array,i=e.Date,X=e.Error,ht=e.Function,pt=e.Math,dt=e.Object,vt=e.RegExp,gt=e.String,yt=e.TypeError,mt=r.prototype,bt=ht.prototype,_t=dt.prototype,wt=e["__core-js_shared__"],xt=bt.toString,kt=_t.hasOwnProperty,Tt=0,Ot=(n=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",At=_t.toString,jt=xt.call(dt),Mt=Yt._,St=vt("^"+xt.call(kt).replace(Z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Lt=Ht?e.Buffer:void 0,Rt=e.Symbol,Gt=e.Uint8Array,qt=Lt?Lt.allocUnsafe:void 0,Ut=Ue(dt.getPrototypeOf,dt),Vt=dt.create,Zt=_t.propertyIsEnumerable,$t=mt.splice,Xt=Rt?Rt.isConcatSpreadable:void 0,Qt=Rt?Rt.iterator:void 0,Kt=Rt?Rt.toStringTag:void 0,me=function(){try{var t=ta(dt,"defineProperty");return t({},"",{}),t}catch(t){}}(),Ae=e.clearTimeout!==Yt.clearTimeout&&e.clearTimeout,Qe=i&&i.now!==Yt.Date.now&&i.now,Ke=e.setTimeout!==Yt.setTimeout&&e.setTimeout,Je=pt.ceil,tn=pt.floor,en=dt.getOwnPropertySymbols,nn=Lt?Lt.isBuffer:void 0,rn=e.isFinite,an=mt.join,on=Ue(dt.keys,dt),un=pt.max,sn=pt.min,cn=i.now,ln=e.parseInt,fn=pt.random,hn=mt.reverse,pn=ta(e,"DataView"),dn=ta(e,"Map"),vn=ta(e,"Promise"),gn=ta(e,"Set"),yn=ta(e,"WeakMap"),mn=ta(dt,"create"),bn=yn&&new yn,_n={},wn=ja(pn),xn=ja(dn),kn=ja(vn),Tn=ja(gn),On=ja(yn),An=Rt?Rt.prototype:void 0,jn=An?An.valueOf:void 0,Mn=An?An.toString:void 0;function Sn(t){if(Vo(t)&&!Go(t)&&!(t instanceof Pn)){if(t instanceof Cn)return t;if(kt.call(t,"__wrapped__"))return Ma(t)}return new Cn(t)}var Ln=function(){function t(){}return function(e){if(!Wo(e))return{};if(Vt)return Vt(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function Rn(){}function Cn(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=void 0}function Pn(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function Gn(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e=e?t:e)),t}function Qn(t,e,n,r,i,a){var o,u=1&e,c=2&e,h=4&e;if(n&&(o=i?n(t,r,i,a):n(t)),void 0!==o)return o;if(!Wo(t))return t;var x=Go(t);if(x){if(o=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&kt.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!u)return mi(t,o)}else{var P=ra(t),G=P==p||P==d;if(No(t))return hi(t,u);if(P==y||P==s||G&&!i){if(o=c||G?{}:aa(t),!u)return c?function(t,e){return bi(t,na(t),e)}(t,function(t,e){return t&&bi(e,xu(e),t)}(o,t)):function(t,e){return bi(t,ea(t),e)}(t,Yn(o,t))}else{if(!It[P])return i?t:{};o=function(t,e,n){var r=t.constructor;switch(e){case k:return pi(t);case l:case f:return new r(+t);case T:return function(t,e){var n=e?pi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case O:case A:case j:case M:case S:case L:case"[object Uint8ClampedArray]":case R:case C:return di(t,n);case v:return new r;case g:case _:return new r(t);case m:return function(t){var e=new t.constructor(t.source,rt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case b:return new r;case w:return i=t,jn?dt(jn.call(i)):{}}var i}(t,P,u)}}a||(a=new Nn);var F=a.get(t);if(F)return F;a.set(t,o),Ho(t)?t.forEach((function(r){o.add(Qn(r,e,n,r,t,a))})):Zo(t)&&t.forEach((function(r,i){o.set(i,Qn(r,e,n,i,t,a))}));var q=x?void 0:(h?c?Yi:Zi:c?xu:wu)(t);return ue(q||t,(function(r,i){q&&(r=t[i=r]),Wn(o,i,Qn(r,e,n,i,t,a))})),o}function Kn(t,e,n){var r=n.length;if(null==t)return!r;for(t=dt(t);r--;){var i=n[r],a=e[i],o=t[i];if(void 0===o&&!(i in t)||!a(o))return!1}return!0}function Jn(t,e,n){if("function"!=typeof t)throw new yt(a);return _a((function(){t.apply(void 0,n)}),e)}function tr(t,e,n,r){var i=-1,a=fe,o=!0,u=t.length,s=[],c=e.length;if(!u)return s;n&&(e=pe(e,Re(n))),r?(a=he,o=!1):e.length>=200&&(a=Pe,o=!1,e=new Dn(e));t:for(;++i-1},Fn.prototype.set=function(t,e){var n=this.__data__,r=Vn(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},qn.prototype.clear=function(){this.size=0,this.__data__={hash:new Gn,map:new(dn||Fn),string:new Gn}},qn.prototype.delete=function(t){var e=Ki(this,t).delete(t);return this.size-=e?1:0,e},qn.prototype.get=function(t){return Ki(this,t).get(t)},qn.prototype.has=function(t){return Ki(this,t).has(t)},qn.prototype.set=function(t,e){var n=Ki(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},Dn.prototype.add=Dn.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},Dn.prototype.has=function(t){return this.__data__.has(t)},Nn.prototype.clear=function(){this.__data__=new Fn,this.size=0},Nn.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},Nn.prototype.get=function(t){return this.__data__.get(t)},Nn.prototype.has=function(t){return this.__data__.has(t)},Nn.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Fn){var r=n.__data__;if(!dn||r.length<199)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new qn(r)}return n.set(t,e),this.size=n.size,this};var er=xi(cr),nr=xi(lr,!0);function rr(t,e){var n=!0;return er(t,(function(t,r,i){return n=!!e(t,r,i)})),n}function ir(t,e,n){for(var r=-1,i=t.length;++r0&&n(u)?e>1?or(u,e-1,n,r,i):de(i,u):r||(i[i.length]=u)}return i}var ur=ki(),sr=ki(!0);function cr(t,e){return t&&ur(t,e,wu)}function lr(t,e){return t&&sr(t,e,wu)}function fr(t,e){return le(e,(function(e){return Io(t[e])}))}function hr(t,e){for(var n=0,r=(e=si(e,t)).length;null!=t&&ne}function gr(t,e){return null!=t&&kt.call(t,e)}function yr(t,e){return null!=t&&e in dt(t)}function mr(t,e,n){for(var i=n?he:fe,a=t[0].length,o=t.length,u=o,s=r(o),c=1/0,l=[];u--;){var f=t[u];u&&e&&(f=pe(f,Re(e))),c=sn(f.length,c),s[u]=!n&&(e||a>=120&&f.length>=120)?new Dn(u&&f):void 0}f=t[0];var h=-1,p=s[0];t:for(;++h=u)return s;var c=n[r];return s*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)}))}function Gr(t,e,n){for(var r=-1,i=e.length,a={};++r-1;)u!==t&&$t.call(u,s,1),$t.call(t,s,1);return t}function qr(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==a){var a=i;ua(i)?$t.call(t,i,1):ti(t,i)}}return t}function Dr(t,e){return t+tn(fn()*(e-t+1))}function Nr(t,e){var n="";if(!t||e<1||e>9007199254740991)return n;do{e%2&&(n+=t),(e=tn(e/2))&&(t+=t)}while(e);return n}function Er(t,e){return wa(va(t,e,Yu),t+"")}function Br(t){return Bn(Lu(t))}function Ir(t,e){var n=Lu(t);return Ta(n,Hn(e,0,n.length))}function Ur(t,e,n,r){if(!Wo(t))return t;for(var i=-1,a=(e=si(e,t)).length,o=a-1,u=t;null!=u&&++ia?0:a+e),(n=n>a?a:n)<0&&(n+=a),a=e>n?0:n-e>>>0,e>>>=0;for(var o=r(a);++i>>1,o=t[a];null!==o&&!Ko(o)&&(n?o<=e:o=200){var c=e?null:Ni(t);if(c)return We(c);o=!1,i=Pe,s=new Dn}else s=e?[]:u;t:for(;++r=r?t:Zr(t,e,n)}var fi=Ae||function(t){return Yt.clearTimeout(t)};function hi(t,e){if(e)return t.slice();var n=t.length,r=qt?qt(n):new t.constructor(n);return t.copy(r),r}function pi(t){var e=new t.constructor(t.byteLength);return new Gt(e).set(new Gt(t)),e}function di(t,e){var n=e?pi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function vi(t,e){if(t!==e){var n=void 0!==t,r=null===t,i=t==t,a=Ko(t),o=void 0!==e,u=null===e,s=e==e,c=Ko(e);if(!u&&!c&&!a&&t>e||a&&o&&s&&!u&&!c||r&&o&&s||!n&&s||!i)return 1;if(!r&&!a&&!c&&t1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(i--,a):void 0,o&&sa(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),e=dt(e);++r-1?i[a?e[o]:o]:void 0}}function Mi(t){return Vi((function(e){var n=e.length,r=n,i=Cn.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new yt(a);if(i&&!u&&"wrapper"==Xi(o))var u=new Cn([],!0)}for(r=u?r:n;++r1&&b.reverse(),f&&cu))return!1;var c=a.get(t),l=a.get(e);if(c&&l)return c==e&&l==t;var f=-1,h=!0,p=2&n?new Dn:void 0;for(a.set(t,e),a.set(e,t);++f-1&&t%1==0&&t1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(H,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return ue(u,(function(n){var r="_."+n[0];e&n[1]&&!fe(t,r)&&t.push(r)})),t.sort()}(function(t){var e=t.match(Q);return e?e[1].split(K):[]}(r),n)))}function ka(t){var e=0,n=0;return function(){var r=cn(),i=16-(r-n);if(n=r,i>0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ta(t,e){var n=-1,r=t.length,i=r-1;for(e=void 0===e?r:e;++n1?t[e-1]:void 0;return n="function"==typeof n?(t.pop(),n):void 0,$a(t,n)}));function eo(t){var e=Sn(t);return e.__chain__=!0,e}function no(t,e){return e(t)}var ro=Vi((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return Xn(e,t)};return!(e>1||this.__actions__.length)&&r instanceof Pn&&ua(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:no,args:[i],thisArg:void 0}),new Cn(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(void 0),t}))):this.thru(i)}));var io=_i((function(t,e,n){kt.call(t,n)?++t[n]:$n(t,n,1)}));var ao=ji(Ca),oo=ji(Pa);function uo(t,e){return(Go(t)?ue:er)(t,Qi(e,3))}function so(t,e){return(Go(t)?se:nr)(t,Qi(e,3))}var co=_i((function(t,e,n){kt.call(t,n)?t[n].push(e):$n(t,n,[e])}));var lo=Er((function(t,e,n){var i=-1,a="function"==typeof e,o=qo(t)?r(t.length):[];return er(t,(function(t){o[++i]=a?ae(e,t,n):br(t,e,n)})),o})),fo=_i((function(t,e,n){$n(t,n,e)}));function ho(t,e){return(Go(t)?pe:Mr)(t,Qi(e,3))}var po=_i((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));var vo=Er((function(t,e){if(null==t)return[];var n=e.length;return n>1&&sa(t,e[0],e[1])?e=[]:n>2&&sa(e[0],e[1],e[2])&&(e=[e[0]]),Pr(t,or(e,1),[])})),go=Qe||function(){return Yt.Date.now()};function yo(t,e,n){return e=n?void 0:e,Bi(t,128,void 0,void 0,void 0,void 0,e=t&&null==e?t.length:e)}function mo(t,e){var n;if("function"!=typeof e)throw new yt(a);return t=iu(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=void 0),n}}var bo=Er((function(t,e,n){var r=1;if(n.length){var i=ze(n,Hi(bo));r|=32}return Bi(t,r,e,n,i)})),_o=Er((function(t,e,n){var r=3;if(n.length){var i=ze(n,Hi(_o));r|=32}return Bi(e,r,t,n,i)}));function wo(t,e,n){var r,i,o,u,s,c,l=0,f=!1,h=!1,p=!0;if("function"!=typeof t)throw new yt(a);function d(e){var n=r,a=i;return r=i=void 0,l=e,u=t.apply(a,n)}function v(t){return l=t,s=_a(y,e),f?d(t):u}function g(t){var n=t-c;return void 0===c||n>=e||n<0||h&&t-l>=o}function y(){var t=go();if(g(t))return m(t);s=_a(y,function(t){var n=e-(t-c);return h?sn(n,o-(t-l)):n}(t))}function m(t){return s=void 0,p&&r?d(t):(r=i=void 0,u)}function b(){var t=go(),n=g(t);if(r=arguments,i=this,c=t,n){if(void 0===s)return v(c);if(h)return fi(s),s=_a(y,e),d(c)}return void 0===s&&(s=_a(y,e)),u}return e=ou(e)||0,Wo(n)&&(f=!!n.leading,o=(h="maxWait"in n)?un(ou(n.maxWait)||0,e):o,p="trailing"in n?!!n.trailing:p),b.cancel=function(){void 0!==s&&fi(s),l=0,r=c=i=s=void 0},b.flush=function(){return void 0===s?u:m(go())},b}var xo=Er((function(t,e){return Jn(t,1,e)})),ko=Er((function(t,e,n){return Jn(t,ou(e)||0,n)}));function To(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new yt(a);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=t.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(To.Cache||qn),n}function Oo(t){if("function"!=typeof t)throw new yt(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}To.Cache=qn;var Ao=ci((function(t,e){var n=(e=1==e.length&&Go(e[0])?pe(e[0],Re(Qi())):pe(or(e,1),Re(Qi()))).length;return Er((function(r){for(var i=-1,a=sn(r.length,n);++i=e})),Po=_r(function(){return arguments}())?_r:function(t){return Vo(t)&&kt.call(t,"callee")&&!Zt.call(t,"callee")},Go=r.isArray,Fo=Jt?Re(Jt):function(t){return Vo(t)&&dr(t)==k};function qo(t){return null!=t&&zo(t.length)&&!Io(t)}function Do(t){return Vo(t)&&qo(t)}var No=nn||os,Eo=te?Re(te):function(t){return Vo(t)&&dr(t)==f};function Bo(t){if(!Vo(t))return!1;var e=dr(t);return e==h||"[object DOMException]"==e||"string"==typeof t.message&&"string"==typeof t.name&&!$o(t)}function Io(t){if(!Wo(t))return!1;var e=dr(t);return e==p||e==d||"[object AsyncFunction]"==e||"[object Proxy]"==e}function Uo(t){return"number"==typeof t&&t==iu(t)}function zo(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}function Wo(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Vo(t){return null!=t&&"object"==typeof t}var Zo=ee?Re(ee):function(t){return Vo(t)&&ra(t)==v};function Yo(t){return"number"==typeof t||Vo(t)&&dr(t)==g}function $o(t){if(!Vo(t)||dr(t)!=y)return!1;var e=Ut(t);if(null===e)return!0;var n=kt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&xt.call(n)==jt}var Xo=ne?Re(ne):function(t){return Vo(t)&&dr(t)==m};var Ho=re?Re(re):function(t){return Vo(t)&&ra(t)==b};function Qo(t){return"string"==typeof t||!Go(t)&&Vo(t)&&dr(t)==_}function Ko(t){return"symbol"==typeof t||Vo(t)&&dr(t)==w}var Jo=ie?Re(ie):function(t){return Vo(t)&&zo(t.length)&&!!Bt[dr(t)]};var tu=Fi(jr),eu=Fi((function(t,e){return t<=e}));function nu(t){if(!t)return[];if(qo(t))return Qo(t)?Ye(t):mi(t);if(Qt&&t[Qt])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Qt]());var e=ra(t);return(e==v?Ie:e==b?We:Lu)(t)}function ru(t){return t?(t=ou(t))===1/0||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0}function iu(t){var e=ru(t),n=e%1;return e==e?n?e-n:e:0}function au(t){return t?Hn(iu(t),0,4294967295):0}function ou(t){if("number"==typeof t)return t;if(Ko(t))return NaN;if(Wo(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Wo(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=Le(t);var n=at.test(t);return n||ut.test(t)?Wt(t.slice(2),n?2:8):it.test(t)?NaN:+t}function uu(t){return bi(t,xu(t))}function su(t){return null==t?"":Kr(t)}var cu=wi((function(t,e){if(ha(e)||qo(e))bi(e,wu(e),t);else for(var n in e)kt.call(e,n)&&Wn(t,n,e[n])})),lu=wi((function(t,e){bi(e,xu(e),t)})),fu=wi((function(t,e,n,r){bi(e,xu(e),t,r)})),hu=wi((function(t,e,n,r){bi(e,wu(e),t,r)})),pu=Vi(Xn);var du=Er((function(t,e){t=dt(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&sa(e[0],e[1],i)&&(r=1);++n1),e})),bi(t,Yi(t),n),r&&(n=Qn(n,7,zi));for(var i=e.length;i--;)ti(n,e[i]);return n}));var Au=Vi((function(t,e){return null==t?{}:function(t,e){return Gr(t,e,(function(e,n){return yu(t,n)}))}(t,e)}));function ju(t,e){if(null==t)return{};var n=pe(Yi(t),(function(t){return[t]}));return e=Qi(e),Gr(t,n,(function(t,n){return e(t,n[0])}))}var Mu=Ei(wu),Su=Ei(xu);function Lu(t){return null==t?[]:Ce(t,wu(t))}var Ru=Oi((function(t,e,n){return e=e.toLowerCase(),t+(n?Cu(e):e)}));function Cu(t){return Bu(su(t).toLowerCase())}function Pu(t){return(t=su(t))&&t.replace(ct,De).replace(Pt,"")}var Gu=Oi((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Fu=Oi((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),qu=Ti("toLowerCase");var Du=Oi((function(t,e,n){return t+(n?"_":"")+e.toLowerCase()}));var Nu=Oi((function(t,e,n){return t+(n?" ":"")+Bu(e)}));var Eu=Oi((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),Bu=Ti("toUpperCase");function Iu(t,e,n){return t=su(t),void 0===(e=n?void 0:e)?function(t){return Dt.test(t)}(t)?function(t){return t.match(Ft)||[]}(t):function(t){return t.match(J)||[]}(t):t.match(e)||[]}var Uu=Er((function(t,e){try{return ae(t,void 0,e)}catch(t){return Bo(t)?t:new X(t)}})),zu=Vi((function(t,e){return ue(e,(function(e){e=Aa(e),$n(t,e,bo(t[e],t))})),t}));function Wu(t){return function(){return t}}var Vu=Mi(),Zu=Mi(!0);function Yu(t){return t}function $u(t){return Tr("function"==typeof t?t:Qn(t,1))}var Xu=Er((function(t,e){return function(n){return br(n,t,e)}})),Hu=Er((function(t,e){return function(n){return br(t,n,e)}}));function Qu(t,e,n){var r=wu(e),i=fr(e,r);null!=n||Wo(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=fr(e,wu(e)));var a=!(Wo(n)&&"chain"in n&&!n.chain),o=Io(t);return ue(i,(function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(a||e){var n=t(this.__wrapped__),i=n.__actions__=mi(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,de([this.value()],arguments))})})),t}function Ku(){}var Ju=Ci(pe),ts=Ci(ce),es=Ci(ye);function ns(t){return ca(t)?Oe(Aa(t)):function(t){return function(e){return hr(e,t)}}(t)}var rs=Gi(),is=Gi(!0);function as(){return[]}function os(){return!1}var us=Ri((function(t,e){return t+e}),0),ss=Di("ceil"),cs=Ri((function(t,e){return t/e}),1),ls=Di("floor");var fs,hs=Ri((function(t,e){return t*e}),1),ps=Di("round"),ds=Ri((function(t,e){return t-e}),0);return Sn.after=function(t,e){if("function"!=typeof e)throw new yt(a);return t=iu(t),function(){if(--t<1)return e.apply(this,arguments)}},Sn.ary=yo,Sn.assign=cu,Sn.assignIn=lu,Sn.assignInWith=fu,Sn.assignWith=hu,Sn.at=pu,Sn.before=mo,Sn.bind=bo,Sn.bindAll=zu,Sn.bindKey=_o,Sn.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return Go(t)?t:[t]},Sn.chain=eo,Sn.chunk=function(t,e,n){e=(n?sa(t,e,n):void 0===e)?1:un(iu(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var a=0,o=0,u=r(Je(i/e));ai?0:i+n),(r=void 0===r||r>i?i:iu(r))<0&&(r+=i),r=n>r?0:au(r);n>>0)?(t=su(t))&&("string"==typeof e||null!=e&&!Xo(e))&&!(e=Kr(e))&&Be(t)?li(Ye(t),0,n):t.split(e,n):[]},Sn.spread=function(t,e){if("function"!=typeof t)throw new yt(a);return e=null==e?0:un(iu(e),0),Er((function(n){var r=n[e],i=li(n,0,e);return r&&de(i,r),ae(t,this,i)}))},Sn.tail=function(t){var e=null==t?0:t.length;return e?Zr(t,1,e):[]},Sn.take=function(t,e,n){return t&&t.length?Zr(t,0,(e=n||void 0===e?1:iu(e))<0?0:e):[]},Sn.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Zr(t,(e=r-(e=n||void 0===e?1:iu(e)))<0?0:e,r):[]},Sn.takeRightWhile=function(t,e){return t&&t.length?ni(t,Qi(e,3),!1,!0):[]},Sn.takeWhile=function(t,e){return t&&t.length?ni(t,Qi(e,3)):[]},Sn.tap=function(t,e){return e(t),t},Sn.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new yt(a);return Wo(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),wo(t,e,{leading:r,maxWait:e,trailing:i})},Sn.thru=no,Sn.toArray=nu,Sn.toPairs=Mu,Sn.toPairsIn=Su,Sn.toPath=function(t){return Go(t)?pe(t,Aa):Ko(t)?[t]:mi(Oa(su(t)))},Sn.toPlainObject=uu,Sn.transform=function(t,e,n){var r=Go(t),i=r||No(t)||Jo(t);if(e=Qi(e,4),null==n){var a=t&&t.constructor;n=i?r?new a:[]:Wo(t)&&Io(a)?Ln(Ut(t)):{}}return(i?ue:cr)(t,(function(t,r,i){return e(n,t,r,i)})),n},Sn.unary=function(t){return yo(t,1)},Sn.union=Wa,Sn.unionBy=Va,Sn.unionWith=Za,Sn.uniq=function(t){return t&&t.length?Jr(t):[]},Sn.uniqBy=function(t,e){return t&&t.length?Jr(t,Qi(e,2)):[]},Sn.uniqWith=function(t,e){return e="function"==typeof e?e:void 0,t&&t.length?Jr(t,void 0,e):[]},Sn.unset=function(t,e){return null==t||ti(t,e)},Sn.unzip=Ya,Sn.unzipWith=$a,Sn.update=function(t,e,n){return null==t?t:ei(t,e,ui(n))},Sn.updateWith=function(t,e,n,r){return r="function"==typeof r?r:void 0,null==t?t:ei(t,e,ui(n),r)},Sn.values=Lu,Sn.valuesIn=function(t){return null==t?[]:Ce(t,xu(t))},Sn.without=Xa,Sn.words=Iu,Sn.wrap=function(t,e){return jo(ui(e),t)},Sn.xor=Ha,Sn.xorBy=Qa,Sn.xorWith=Ka,Sn.zip=Ja,Sn.zipObject=function(t,e){return ai(t||[],e||[],Wn)},Sn.zipObjectDeep=function(t,e){return ai(t||[],e||[],Ur)},Sn.zipWith=to,Sn.entries=Mu,Sn.entriesIn=Su,Sn.extend=lu,Sn.extendWith=fu,Qu(Sn,Sn),Sn.add=us,Sn.attempt=Uu,Sn.camelCase=Ru,Sn.capitalize=Cu,Sn.ceil=ss,Sn.clamp=function(t,e,n){return void 0===n&&(n=e,e=void 0),void 0!==n&&(n=(n=ou(n))==n?n:0),void 0!==e&&(e=(e=ou(e))==e?e:0),Hn(ou(t),e,n)},Sn.clone=function(t){return Qn(t,4)},Sn.cloneDeep=function(t){return Qn(t,5)},Sn.cloneDeepWith=function(t,e){return Qn(t,5,e="function"==typeof e?e:void 0)},Sn.cloneWith=function(t,e){return Qn(t,4,e="function"==typeof e?e:void 0)},Sn.conformsTo=function(t,e){return null==e||Kn(t,e,wu(e))},Sn.deburr=Pu,Sn.defaultTo=function(t,e){return null==t||t!=t?e:t},Sn.divide=cs,Sn.endsWith=function(t,e,n){t=su(t),e=Kr(e);var r=t.length,i=n=void 0===n?r:Hn(iu(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},Sn.eq=Lo,Sn.escape=function(t){return(t=su(t))&&E.test(t)?t.replace(D,Ne):t},Sn.escapeRegExp=function(t){return(t=su(t))&&Y.test(t)?t.replace(Z,"\\$&"):t},Sn.every=function(t,e,n){var r=Go(t)?ce:rr;return n&&sa(t,e,n)&&(e=void 0),r(t,Qi(e,3))},Sn.find=ao,Sn.findIndex=Ca,Sn.findKey=function(t,e){return be(t,Qi(e,3),cr)},Sn.findLast=oo,Sn.findLastIndex=Pa,Sn.findLastKey=function(t,e){return be(t,Qi(e,3),lr)},Sn.floor=ls,Sn.forEach=uo,Sn.forEachRight=so,Sn.forIn=function(t,e){return null==t?t:ur(t,Qi(e,3),xu)},Sn.forInRight=function(t,e){return null==t?t:sr(t,Qi(e,3),xu)},Sn.forOwn=function(t,e){return t&&cr(t,Qi(e,3))},Sn.forOwnRight=function(t,e){return t&&lr(t,Qi(e,3))},Sn.get=gu,Sn.gt=Ro,Sn.gte=Co,Sn.has=function(t,e){return null!=t&&ia(t,e,gr)},Sn.hasIn=yu,Sn.head=Fa,Sn.identity=Yu,Sn.includes=function(t,e,n,r){t=qo(t)?t:Lu(t),n=n&&!r?iu(n):0;var i=t.length;return n<0&&(n=un(i+n,0)),Qo(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&we(t,e,n)>-1},Sn.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:iu(n);return i<0&&(i=un(r+i,0)),we(t,e,i)},Sn.inRange=function(t,e,n){return e=ru(e),void 0===n?(n=e,e=0):n=ru(n),function(t,e,n){return t>=sn(e,n)&&t=-9007199254740991&&t<=9007199254740991},Sn.isSet=Ho,Sn.isString=Qo,Sn.isSymbol=Ko,Sn.isTypedArray=Jo,Sn.isUndefined=function(t){return void 0===t},Sn.isWeakMap=function(t){return Vo(t)&&ra(t)==x},Sn.isWeakSet=function(t){return Vo(t)&&"[object WeakSet]"==dr(t)},Sn.join=function(t,e){return null==t?"":an.call(t,e)},Sn.kebabCase=Gu,Sn.last=Ea,Sn.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=iu(n))<0?un(r+i,0):sn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):_e(t,ke,i,!0)},Sn.lowerCase=Fu,Sn.lowerFirst=qu,Sn.lt=tu,Sn.lte=eu,Sn.max=function(t){return t&&t.length?ir(t,Yu,vr):void 0},Sn.maxBy=function(t,e){return t&&t.length?ir(t,Qi(e,2),vr):void 0},Sn.mean=function(t){return Te(t,Yu)},Sn.meanBy=function(t,e){return Te(t,Qi(e,2))},Sn.min=function(t){return t&&t.length?ir(t,Yu,jr):void 0},Sn.minBy=function(t,e){return t&&t.length?ir(t,Qi(e,2),jr):void 0},Sn.stubArray=as,Sn.stubFalse=os,Sn.stubObject=function(){return{}},Sn.stubString=function(){return""},Sn.stubTrue=function(){return!0},Sn.multiply=hs,Sn.nth=function(t,e){return t&&t.length?Cr(t,iu(e)):void 0},Sn.noConflict=function(){return Yt._===this&&(Yt._=Mt),this},Sn.noop=Ku,Sn.now=go,Sn.pad=function(t,e,n){t=su(t);var r=(e=iu(e))?Ze(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return Pi(tn(i),n)+t+Pi(Je(i),n)},Sn.padEnd=function(t,e,n){t=su(t);var r=(e=iu(e))?Ze(t):0;return e&&re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=fn();return sn(t+i*(e-t+zt("1e-"+((i+"").length-1))),e)}return Dr(t,e)},Sn.reduce=function(t,e,n){var r=Go(t)?ve:je,i=arguments.length<3;return r(t,Qi(e,4),n,i,er)},Sn.reduceRight=function(t,e,n){var r=Go(t)?ge:je,i=arguments.length<3;return r(t,Qi(e,4),n,i,nr)},Sn.repeat=function(t,e,n){return e=(n?sa(t,e,n):void 0===e)?1:iu(e),Nr(su(t),e)},Sn.replace=function(){var t=arguments,e=su(t[0]);return t.length<3?e:e.replace(t[1],t[2])},Sn.result=function(t,e,n){var r=-1,i=(e=si(e,t)).length;for(i||(i=1,t=void 0);++r9007199254740991)return[];var n=4294967295,r=sn(t,4294967295);t-=4294967295;for(var i=Se(r,e=Qi(e));++n=a)return t;var u=n-Ze(r);if(u<1)return r;var s=o?li(o,0,u).join(""):t.slice(0,u);if(void 0===i)return s+r;if(o&&(u+=s.length-u),Xo(i)){if(t.slice(u).search(i)){var c,l=s;for(i.global||(i=vt(i.source,su(rt.exec(i))+"g")),i.lastIndex=0;c=i.exec(l);)var f=c.index;s=s.slice(0,void 0===f?u:f)}}else if(t.indexOf(Kr(i),u)!=u){var h=s.lastIndexOf(i);h>-1&&(s=s.slice(0,h))}return s+r},Sn.unescape=function(t){return(t=su(t))&&N.test(t)?t.replace(q,Xe):t},Sn.uniqueId=function(t){var e=++Tt;return su(t)+e},Sn.upperCase=Eu,Sn.upperFirst=Bu,Sn.each=uo,Sn.eachRight=so,Sn.first=Fa,Qu(Sn,(fs={},cr(Sn,(function(t,e){kt.call(Sn.prototype,e)||(fs[e]=t)})),fs),{chain:!1}),Sn.VERSION="4.17.21",ue(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(t){Sn[t].placeholder=Sn})),ue(["drop","take"],(function(t,e){Pn.prototype[t]=function(n){n=void 0===n?1:un(iu(n),0);var r=this.__filtered__&&!e?new Pn(this):this.clone();return r.__filtered__?r.__takeCount__=sn(n,r.__takeCount__):r.__views__.push({size:sn(n,4294967295),type:t+(r.__dir__<0?"Right":"")}),r},Pn.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}})),ue(["filter","map","takeWhile"],(function(t,e){var n=e+1,r=1==n||3==n;Pn.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:Qi(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}})),ue(["head","last"],(function(t,e){var n="take"+(e?"Right":"");Pn.prototype[t]=function(){return this[n](1).value()[0]}})),ue(["initial","tail"],(function(t,e){var n="drop"+(e?"":"Right");Pn.prototype[t]=function(){return this.__filtered__?new Pn(this):this[n](1)}})),Pn.prototype.compact=function(){return this.filter(Yu)},Pn.prototype.find=function(t){return this.filter(t).head()},Pn.prototype.findLast=function(t){return this.reverse().find(t)},Pn.prototype.invokeMap=Er((function(t,e){return"function"==typeof t?new Pn(this):this.map((function(n){return br(n,t,e)}))})),Pn.prototype.reject=function(t){return this.filter(Oo(Qi(t)))},Pn.prototype.slice=function(t,e){t=iu(t);var n=this;return n.__filtered__&&(t>0||e<0)?new Pn(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),void 0!==e&&(n=(e=iu(e))<0?n.dropRight(-e):n.take(e-t)),n)},Pn.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Pn.prototype.toArray=function(){return this.take(4294967295)},cr(Pn.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=Sn[r?"take"+("last"==e?"Right":""):e],a=r||/^find/.test(e);i&&(Sn.prototype[e]=function(){var e=this.__wrapped__,o=r?[1]:arguments,u=e instanceof Pn,s=o[0],c=u||Go(e),l=function(t){var e=i.apply(Sn,de([t],o));return r&&f?e[0]:e};c&&n&&"function"==typeof s&&1!=s.length&&(u=c=!1);var f=this.__chain__,h=!!this.__actions__.length,p=a&&!f,d=u&&!h;if(!a&&c){e=d?e:new Pn(this);var v=t.apply(e,o);return v.__actions__.push({func:no,args:[l],thisArg:void 0}),new Cn(v,f)}return p&&d?t.apply(this,o):(v=this.thru(l),p?r?v.value()[0]:v.value():v)})})),ue(["pop","push","shift","sort","splice","unshift"],(function(t){var e=mt[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);Sn.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(Go(i)?i:[],t)}return this[n]((function(n){return e.apply(Go(n)?n:[],t)}))}})),cr(Pn.prototype,(function(t,e){var n=Sn[e];if(n){var r=n.name+"";kt.call(_n,r)||(_n[r]=[]),_n[r].push({name:e,func:n})}})),_n[Si(void 0,2).name]=[{name:"wrapper",func:void 0}],Pn.prototype.clone=function(){var t=new Pn(this.__wrapped__);return t.__actions__=mi(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=mi(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=mi(this.__views__),t},Pn.prototype.reverse=function(){if(this.__filtered__){var t=new Pn(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},Pn.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=Go(t),r=e<0,i=n?t.length:0,a=function(t,e,n){var r=-1,i=n.length;for(;++r=this.__values__.length;return{done:t,value:t?void 0:this.__values__[this.__index__++]}},Sn.prototype.plant=function(t){for(var e,n=this;n instanceof Rn;){var r=Ma(n);r.__index__=0,r.__values__=void 0,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},Sn.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof Pn){var e=t;return this.__actions__.length&&(e=new Pn(this)),(e=e.reverse()).__actions__.push({func:no,args:[za],thisArg:void 0}),new Cn(e,this.__chain__)}return this.thru(za)},Sn.prototype.toJSON=Sn.prototype.valueOf=Sn.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},Sn.prototype.first=Sn.prototype.head,Qt&&(Sn.prototype[Qt]=function(){return this}),Sn}();Yt._=He,void 0===(i=function(){return He}.call(e,n,e,r))||(r.exports=i)}).call(this)}).call(this,n(11),n(12)(t))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));let r={A0:27.5,"A#0":29.1352,Bb0:29.1352,B0:30.8677,"B#0":32.7032,Cb1:30.8677,C1:32.7032,"C#1":34.6478,Db1:34.6478,D1:36.7081,"D#1":38.8909,Eb1:38.8909,E1:41.2034,Fb1:41.2034,"E#1":43.6535,F1:43.6535,"F#1":46.2493,Gb1:46.2493,G1:48.9994,"G#1":51.9131,Ab1:51.9131,A1:55,"A#1":58.2705,Bb1:58.2705,B1:61.7354,Cb2:61.7354,"B#1":65.4064,C2:65.4064,"C#2":69.2957,Db2:69.2957,D2:73.4162,"D#2":77.7817,Eb2:77.7817,E2:82.4069,Fb2:82.4069,"E#2":87.3071,F2:87.3071,"F#2":92.4986,Gb2:92.4986,G2:97.9989,"G#2":103.826,Ab2:103.826,A2:110,"A#2":116.541,Bb2:116.541,B2:123.471,Cb3:123.471,"B#2":130.813,C3:130.813,"C#3":138.591,Db3:138.591,D3:146.832,"D#3":155.563,Eb3:155.563,E3:164.814,Fb3:164.814,"E#3":174.614,F3:174.614,"F#3":184.997,Gb3:184.997,G3:195.998,"G#3":207.652,Ab3:207.652,A3:220,"A#3":233.082,Bb3:233.082,B3:246.942,Cb4:246.942,"B#3":261.626,C4:261.626,"C#4":277.183,Db4:277.183,D4:293.665,"D#4":311.127,Eb4:311.127,E4:329.628,Fb4:329.628,"E#4":349.228,F4:349.228,"F#4":369.994,Gb4:369.994,G4:391.995,"G#4":415.305,Ab4:415.305,A4:440,"A#4":466.164,Bb4:466.164,B4:493.883,Cb5:493.883,"B#4":523.251,C5:523.251,"C#5":554.365,Db5:554.365,D5:587.33,"D#5":622.254,Eb5:622.254,E5:659.255,Fb5:659.255,"E#5":698.456,F5:698.456,"F#5":739.989,Gb5:739.989,G5:783.991,"G#5":830.609,Ab5:830.609,A5:880,"A#5":932.328,Bb5:932.328,B5:987.767,Cb6:987.767,"B#5":1046.5,C6:1046.5,"C#6":1108.73,Db6:1108.73,D6:1174.66,"D#6":1244.51,Eb6:1244.51,Fb6:1318.51,E6:1318.51,"E#6":1396.91,F6:1396.91,"F#6":1479.98,Gb6:1479.98,G6:1567.98,"G#6":1661.22,Ab6:1661.22,A6:1760,"A#6":1864.66,Bb6:1864.66,B6:1975.53,Cb7:1975.53,"B#6":2093,C7:2093,"C#7":2217.46,Db7:2217.46,D7:2349.32,"D#7":2489.02,Eb7:2489.02,E7:2637.02,Fb7:2637.02,"E#7":2793.83,F7:2793.83,"F#7":2959.96,Gb7:2959.96,G7:3135.96,"G#7":3322.44,Ab7:3322.44,A7:3520,"A#7":3729.31,Bb7:3729.31,B7:3951.07,Cb8:3951.07,"B#7":4186.01,C8:4186.01},i=["C0","C#0","D0","D#0","E0","F0","F#0","G0","G#0","A0","A#0","B0","C1","C#1","D1","D#1","E1","F1","F#1","G1","G#1","A1","A#1","B1","C2","C#2","D2","D#2","E2","F2","F#2","G2","G#2","A2","A#2","B2","C3","C#3","D3","D#3","E3","F3","F#3","G3","G#3","A3","A#3","B3","C4","C#4","D4","D#4","E4","F4","F#4","G4","G#4","A4","A#4","B4","C5","C#5","D5","D#5","E5","F5","F#5","G5","G#5","A5","A#5","B5","C6","C#6","D6","D#6","E6","F6","F#6","G6","G#6","A6","A#6","B6","C7","C#7","D7","D#7","E7","F7","F#7","G7","G#7","A7","A#7","B7","C8"]},function(t,e,n){!function(){var e,n,r=function(t,e){t.value=e},i=Object.create(null,{activate:{writable:!0,value:function(t){t?(this.input.disconnect(),this.input.connect(this.activateNode),this.activateCallback&&this.activateCallback(t)):(this.input.disconnect(),this.input.connect(this.output))}},bypass:{get:function(){return this._bypass},set:function(t){this._lastBypassValue!==t&&(this._bypass=t,this.activate(!t),this._lastBypassValue=t)}},connect:{value:function(t){this.output.connect(t)}},disconnect:{value:function(t){this.output.disconnect(t)}},connectInOrder:{value:function(t){for(var e=t.length-1;e--;){if(!t[e].connect)return console.error("AudioNode.connectInOrder: TypeError: Not an AudioNode.",t[e]);t[e+1].input?t[e].connect(t[e+1].input):t[e].connect(t[e+1])}}},getDefaults:{value:function(){var t={};for(var e in this.defaults)t[e]=this.defaults[e].value;return t}},automate:{value:function(t,n,r,i){var a,o=i?~~(i/1e3):e.currentTime,u=r?~~(r/1e3):0,s=this.defaults[t],c=this[t];c?s.automatable?(r?(a="linearRampToValueAtTime",c.cancelScheduledValues(o),c.setValueAtTime(c.value,o)):a="setValueAtTime",c[a](n,u+o)):c=n:console.error("Invalid Property for "+this.name)}}}),a="float",o="boolean",u="int";function s(t){if(!(this instanceof s))return new s(t);var r="undefined"==typeof window?{}:window;if(r.AudioContext||(r.AudioContext=r.webkitAudioContext),t||(console.log("tuna.js: Missing audio context! Creating a new context for you."),t=r.AudioContext&&new r.AudioContext),!t)throw new Error("Tuna cannot initialize because this environment does not support web audio.");!function(t){if(!0===t.__connectified__)return;var e=t.createGain(),n=Object.getPrototypeOf(Object.getPrototypeOf(e)),r=n.connect;n.connect=function(){var t=arguments[0];return arguments[0]=i.isPrototypeOf?i.isPrototypeOf(t)?t.input:t:t.input||t,r.apply(this,arguments),t},t.__connectified__=!0}(t),e=t,n=this}function c(t){return Math.max(0,Math.round(100*Math.pow(2,t/6))/100)}function l(t,e){var n,r,i,a=0,o=0,u=0;return n=t.toExponential().match(/^.\.?(.*)e(.+)$/),a=parseInt(n[2],10)-(n[1]+"").length,n=e.toExponential().match(/^.\.?(.*)e(.+)$/),(i=parseInt(n[2],10)-(n[1]+"").length)>a&&(a=i),r=t%e,a<-100||a>20?(o=Math.round(Math.log(r)/Math.log(10)),(r/(u=Math.pow(10,o))).toFixed(o-a)*u):parseFloat(r.toFixed(-a))}function f(t){return 0===t?1:Math.abs(t)/t}function h(t){return(Math.exp(t)-Math.exp(-t))/(Math.exp(t)+Math.exp(-t))}function p(t,e){return void 0===t?e:t}t.exports?t.exports=s:window.define("Tuna",(function(){return s})),s.prototype.Bitcrusher=function(t){t||(t=this.getDefaults()),this.bufferSize=t.bufferSize||this.defaults.bufferSize.value,this.input=e.createGain(),this.activateNode=e.createGain(),this.processor=e.createScriptProcessor(this.bufferSize,1,1),this.output=e.createGain(),this.activateNode.connect(this.processor),this.processor.connect(this.output);var n,r,i,a,o,u=0,s=0;this.processor.onaudioprocess=function(t){for(n=t.inputBuffer.getChannelData(0),r=t.outputBuffer.getChannelData(0),i=Math.pow(.5,this.bits),o=n.length,a=0;a=1&&(u-=1,s=i*Math.floor(n[a]/i+.5)),r[a]=s},this.bits=t.bits||this.defaults.bits.value,this.normfreq=p(t.normfreq,this.defaults.normfreq.value),this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.Bitcrusher.prototype=Object.create(i,{name:{value:"Bitcrusher"},defaults:{writable:!0,value:{bits:{value:4,min:1,max:16,automatable:!1,type:u},bufferSize:{value:4096,min:256,max:16384,automatable:!1,type:u},bypass:{value:!1,automatable:!1,type:o},normfreq:{value:.1,min:1e-4,max:1,automatable:!1,type:a}}},bits:{enumerable:!0,get:function(){return this.processor.bits},set:function(t){this.processor.bits=t}},normfreq:{enumerable:!0,get:function(){return this.processor.normfreq},set:function(t){this.processor.normfreq=t}}}),s.prototype.Cabinet=function(t){t||(t=this.getDefaults()),this.input=e.createGain(),this.activateNode=e.createGain(),this.convolver=this.newConvolver(t.impulsePath||"../impulses/impulse_guitar.wav"),this.makeupNode=e.createGain(),this.output=e.createGain(),this.activateNode.connect(this.convolver.input),this.convolver.output.connect(this.makeupNode),this.makeupNode.connect(this.output),this.makeupNode.gain.value=p(t.makeupGain,this.defaults.makeupGain.value),this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.Cabinet.prototype=Object.create(i,{name:{value:"Cabinet"},defaults:{writable:!0,value:{makeupGain:{value:1,min:0,max:20,automatable:!0,type:a},bypass:{value:!1,automatable:!1,type:o}}},makeupGain:{enumerable:!0,get:function(){return this.makeupNode.gain},set:function(t){this.makeupNode.gain.setTargetAtTime(t,e.currentTime,.01)}},newConvolver:{value:function(t){return new n.Convolver({impulse:t,dryLevel:0,wetLevel:1})}}}),s.prototype.Chorus=function(t){t||(t=this.getDefaults()),this.input=e.createGain(),this.attenuator=this.activateNode=e.createGain(),this.splitter=e.createChannelSplitter(2),this.delayL=e.createDelay(),this.delayR=e.createDelay(),this.feedbackGainNodeLR=e.createGain(),this.feedbackGainNodeRL=e.createGain(),this.merger=e.createChannelMerger(2),this.output=e.createGain(),this.lfoL=new n.LFO({target:this.delayL.delayTime,callback:r}),this.lfoR=new n.LFO({target:this.delayR.delayTime,callback:r}),this.input.connect(this.attenuator),this.attenuator.connect(this.output),this.attenuator.connect(this.splitter),this.splitter.connect(this.delayL,0),this.splitter.connect(this.delayR,1),this.delayL.connect(this.feedbackGainNodeLR),this.delayR.connect(this.feedbackGainNodeRL),this.feedbackGainNodeLR.connect(this.delayR),this.feedbackGainNodeRL.connect(this.delayL),this.delayL.connect(this.merger,0,0),this.delayR.connect(this.merger,0,1),this.merger.connect(this.output),this.feedback=p(t.feedback,this.defaults.feedback.value),this.rate=p(t.rate,this.defaults.rate.value),this.delay=p(t.delay,this.defaults.delay.value),this.depth=p(t.depth,this.defaults.depth.value),this.lfoR.phase=Math.PI/2,this.attenuator.gain.value=.6934,this.lfoL.activate(!0),this.lfoR.activate(!0),this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.Chorus.prototype=Object.create(i,{name:{value:"Chorus"},defaults:{writable:!0,value:{feedback:{value:.4,min:0,max:.95,automatable:!1,type:a},delay:{value:.0045,min:0,max:1,automatable:!1,type:a},depth:{value:.7,min:0,max:1,automatable:!1,type:a},rate:{value:1.5,min:0,max:8,automatable:!1,type:a},bypass:{value:!1,automatable:!1,type:o}}},delay:{enumerable:!0,get:function(){return this._delay},set:function(t){this._delay=2*Math.pow(10,t)*2e-4,this.lfoL.offset=this._delay,this.lfoR.offset=this._delay,this._depth=this._depth}},depth:{enumerable:!0,get:function(){return this._depth},set:function(t){this._depth=t,this.lfoL.oscillation=this._depth*this._delay,this.lfoR.oscillation=this._depth*this._delay}},feedback:{enumerable:!0,get:function(){return this._feedback},set:function(t){this._feedback=t,this.feedbackGainNodeLR.gain.setTargetAtTime(this._feedback,e.currentTime,.01),this.feedbackGainNodeRL.gain.setTargetAtTime(this._feedback,e.currentTime,.01)}},rate:{enumerable:!0,get:function(){return this._rate},set:function(t){this._rate=t,this.lfoL.frequency=this._rate,this.lfoR.frequency=this._rate}}}),s.prototype.Compressor=function(t){t||(t=this.getDefaults()),this.input=e.createGain(),this.compNode=this.activateNode=e.createDynamicsCompressor(),this.makeupNode=e.createGain(),this.output=e.createGain(),this.compNode.connect(this.makeupNode),this.makeupNode.connect(this.output),this.automakeup=p(t.automakeup,this.defaults.automakeup.value),this.automakeup?this.makeupNode.gain.value=c(this.computeMakeup()):this.makeupNode.gain.value=c(p(t.makeupGain,this.defaults.makeupGain.value)),this.threshold=p(t.threshold,this.defaults.threshold.value),this.release=p(t.release,this.defaults.release.value),this.attack=p(t.attack,this.defaults.attack.value),this.ratio=t.ratio||this.defaults.ratio.value,this.knee=p(t.knee,this.defaults.knee.value),this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.Compressor.prototype=Object.create(i,{name:{value:"Compressor"},defaults:{writable:!0,value:{threshold:{value:-20,min:-60,max:0,automatable:!0,type:a},release:{value:250,min:10,max:2e3,automatable:!0,type:a},makeupGain:{value:1,min:1,max:100,automatable:!0,type:a},attack:{value:1,min:0,max:1e3,automatable:!0,type:a},ratio:{value:4,min:1,max:50,automatable:!0,type:a},knee:{value:5,min:0,max:40,automatable:!0,type:a},automakeup:{value:!1,automatable:!1,type:o},bypass:{value:!1,automatable:!1,type:o}}},computeMakeup:{value:function(){var t=this.compNode;return-(t.threshold.value-t.threshold.value/t.ratio.value)/4}},automakeup:{enumerable:!0,get:function(){return this._automakeup},set:function(t){this._automakeup=t,this._automakeup&&(this.makeupGain=this.computeMakeup())}},threshold:{enumerable:!0,get:function(){return this.compNode.threshold},set:function(t){this.compNode.threshold.value=t,this._automakeup&&(this.makeupGain=this.computeMakeup())}},ratio:{enumerable:!0,get:function(){return this.compNode.ratio},set:function(t){this.compNode.ratio.value=t,this._automakeup&&(this.makeupGain=this.computeMakeup())}},knee:{enumerable:!0,get:function(){return this.compNode.knee},set:function(t){this.compNode.knee.value=t,this._automakeup&&(this.makeupGain=this.computeMakeup())}},attack:{enumerable:!0,get:function(){return this.compNode.attack},set:function(t){this.compNode.attack.value=t/1e3}},release:{enumerable:!0,get:function(){return this.compNode.release},set:function(t){this.compNode.release.value=t/1e3}},makeupGain:{enumerable:!0,get:function(){return this.makeupNode.gain},set:function(t){this.makeupNode.gain.setTargetAtTime(c(t),e.currentTime,.01)}}}),s.prototype.Convolver=function(t){t||(t=this.getDefaults()),this.input=e.createGain(),this.activateNode=e.createGain(),this.convolver=e.createConvolver(),this.dry=e.createGain(),this.filterLow=e.createBiquadFilter(),this.filterHigh=e.createBiquadFilter(),this.wet=e.createGain(),this.output=e.createGain(),this.activateNode.connect(this.filterLow),this.activateNode.connect(this.dry),this.filterLow.connect(this.filterHigh),this.filterHigh.connect(this.convolver),this.convolver.connect(this.wet),this.wet.connect(this.output),this.dry.connect(this.output),this.dry.gain.value=p(t.dryLevel,this.defaults.dryLevel.value),this.wet.gain.value=p(t.wetLevel,this.defaults.wetLevel.value),this.filterHigh.frequency.value=t.highCut||this.defaults.highCut.value,this.filterLow.frequency.value=t.lowCut||this.defaults.lowCut.value,this.output.gain.value=p(t.level,this.defaults.level.value),this.filterHigh.type="lowpass",this.filterLow.type="highpass",this.buffer=t.impulse||"../impulses/ir_rev_short.wav",this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.Convolver.prototype=Object.create(i,{name:{value:"Convolver"},defaults:{writable:!0,value:{highCut:{value:22050,min:20,max:22050,automatable:!0,type:a},lowCut:{value:20,min:20,max:22050,automatable:!0,type:a},dryLevel:{value:1,min:0,max:1,automatable:!0,type:a},wetLevel:{value:1,min:0,max:1,automatable:!0,type:a},level:{value:1,min:0,max:1,automatable:!0,type:a},bypass:{value:!1,automatable:!1,type:o}}},lowCut:{get:function(){return this.filterLow.frequency},set:function(t){this.filterLow.frequency.setTargetAtTime(t,e.currentTime,.01)}},highCut:{get:function(){return this.filterHigh.frequency},set:function(t){this.filterHigh.frequency.setTargetAtTime(t,e.currentTime,.01)}},level:{get:function(){return this.output.gain},set:function(t){this.output.gain.setTargetAtTime(t,e.currentTime,.01)}},dryLevel:{get:function(){return this.dry.gain},set:function(t){this.dry.gain.setTargetAtTime(t,e.currentTime,.01)}},wetLevel:{get:function(){return this.wet.gain},set:function(t){this.wet.gain.setTargetAtTime(t,e.currentTime,.01)}},buffer:{enumerable:!1,get:function(){return this.convolver.buffer},set:function(t){var n=this.convolver,r=new XMLHttpRequest;t?(r.open("GET",t,!0),r.responseType="arraybuffer",r.onreadystatechange=function(){4===r.readyState&&(r.status<300&&r.status>199||302===r.status)&&e.decodeAudioData(r.response,(function(t){n.buffer=t}),(function(t){t&&console.log("Tuna.Convolver.setBuffer: Error decoding data"+t)}))},r.send(null)):console.log("Tuna.Convolver.setBuffer: Missing impulse path!")}}}),s.prototype.Delay=function(t){t||(t=this.getDefaults()),this.input=e.createGain(),this.activateNode=e.createGain(),this.dry=e.createGain(),this.wet=e.createGain(),this.filter=e.createBiquadFilter(),this.delay=e.createDelay(10),this.feedbackNode=e.createGain(),this.output=e.createGain(),this.activateNode.connect(this.delay),this.activateNode.connect(this.dry),this.delay.connect(this.filter),this.filter.connect(this.feedbackNode),this.feedbackNode.connect(this.delay),this.feedbackNode.connect(this.wet),this.wet.connect(this.output),this.dry.connect(this.output),this.delayTime=t.delayTime||this.defaults.delayTime.value,this.feedbackNode.gain.value=p(t.feedback,this.defaults.feedback.value),this.wet.gain.value=p(t.wetLevel,this.defaults.wetLevel.value),this.dry.gain.value=p(t.dryLevel,this.defaults.dryLevel.value),this.filter.frequency.value=t.cutoff||this.defaults.cutoff.value,this.filter.type="lowpass",this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.Delay.prototype=Object.create(i,{name:{value:"Delay"},defaults:{writable:!0,value:{delayTime:{value:100,min:20,max:1e3,automatable:!1,type:a},feedback:{value:.45,min:0,max:.9,automatable:!0,type:a},cutoff:{value:2e4,min:20,max:2e4,automatable:!0,type:a},wetLevel:{value:.5,min:0,max:1,automatable:!0,type:a},dryLevel:{value:1,min:0,max:1,automatable:!0,type:a},bypass:{value:!1,automatable:!1,type:o}}},delayTime:{enumerable:!0,get:function(){return this.delay.delayTime},set:function(t){this.delay.delayTime.value=t/1e3}},wetLevel:{enumerable:!0,get:function(){return this.wet.gain},set:function(t){this.wet.gain.setTargetAtTime(t,e.currentTime,.01)}},dryLevel:{enumerable:!0,get:function(){return this.dry.gain},set:function(t){this.dry.gain.setTargetAtTime(t,e.currentTime,.01)}},feedback:{enumerable:!0,get:function(){return this.feedbackNode.gain},set:function(t){this.feedbackNode.gain.setTargetAtTime(t,e.currentTime,.01)}},cutoff:{enumerable:!0,get:function(){return this.filter.frequency},set:function(t){this.filter.frequency.setTargetAtTime(t,e.currentTime,.01)}}}),s.prototype.Filter=function(t){t||(t=this.getDefaults()),this.input=e.createGain(),this.activateNode=e.createGain(),this.filter=e.createBiquadFilter(),this.output=e.createGain(),this.activateNode.connect(this.filter),this.filter.connect(this.output),this.filter.frequency.value=t.frequency||this.defaults.frequency.value,this.Q=t.resonance||this.defaults.Q.value,this.filterType=p(t.filterType,this.defaults.filterType.value),this.filter.gain.value=p(t.gain,this.defaults.gain.value),this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.Filter.prototype=Object.create(i,{name:{value:"Filter"},defaults:{writable:!0,value:{frequency:{value:800,min:20,max:22050,automatable:!0,type:a},Q:{value:1,min:.001,max:100,automatable:!0,type:a},gain:{value:0,min:-40,max:40,automatable:!0,type:a},bypass:{value:!1,automatable:!1,type:o},filterType:{value:"lowpass",automatable:!1,type:"string"}}},filterType:{enumerable:!0,get:function(){return this.filter.type},set:function(t){this.filter.type=t}},Q:{enumerable:!0,get:function(){return this.filter.Q},set:function(t){this.filter.Q.value=t}},gain:{enumerable:!0,get:function(){return this.filter.gain},set:function(t){this.filter.gain.setTargetAtTime(t,e.currentTime,.01)}},frequency:{enumerable:!0,get:function(){return this.filter.frequency},set:function(t){this.filter.frequency.setTargetAtTime(t,e.currentTime,.01)}}}),s.prototype.Gain=function(t){t||(t=this.getDefaults()),this.input=e.createGain(),this.activateNode=e.createGain(),this.gainNode=e.createGain(),this.output=e.createGain(),this.activateNode.connect(this.gainNode),this.gainNode.connect(this.output),this.gainNode.gain.value=p(t.gain,this.defaults.gain.value),this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.Gain.prototype=Object.create(i,{name:{value:"Gain"},defaults:{writable:!0,value:{bypass:{value:!1,automatable:!1,type:o},gain:{value:1,automatable:!0,type:a}}},gain:{enumerable:!0,get:function(){return this.gainNode.gain},set:function(t){this.gainNode.gain.setTargetAtTime(t,e.currentTime,.01)}}}),s.prototype.MoogFilter=function(t){var n,r,i,a,o,u,s,c,l,f,h,d,v,g,y;t||(t=this.getDefaults()),this.bufferSize=t.bufferSize||this.defaults.bufferSize.value,this.input=e.createGain(),this.activateNode=e.createGain(),this.processor=e.createScriptProcessor(this.bufferSize,1,1),this.output=e.createGain(),this.activateNode.connect(this.processor),this.processor.connect(this.output),n=r=i=a=o=u=s=c=0,this.processor.onaudioprocess=function(t){for(l=t.inputBuffer.getChannelData(0),f=t.outputBuffer.getChannelData(0),h=1.16*this.cutoff,y=h*h*.35013*(h*h),d=this.resonance*(1-.15*h*h),g=l.length,v=0;v=0?5.8:1.2),n[r]=h(a)},function(t,e,n){var r,i,a,o=1-t;for(r=0;r.99?.99:1-t;for(r=0;ru?a=u+(o-u)/(1+Math.pow((o-u)/(1-u),2)):o>1&&(a=o),n[r]=f(i)*a*(1/((u+1)/2))},function(t,e,n){var r,i;for(r=0;r=-.08905&&i<.320018?i*i*-6.153+3.9375*i:.630035},function(t,e,n){var r,i,a=2+Math.round(14*t),o=Math.round(Math.pow(2,a-1));for(r=0;r1?1:t<0?0:t,this._sensitivity),this.setFilterFreq()}},baseFrequency:{enumerable:!0,get:function(){return this._baseFrequency},set:function(t){this._baseFrequency=50*Math.pow(10,2*t),this._excursionFrequency=Math.min(e.sampleRate/2,this.baseFrequency*Math.pow(2,this._excursionOctaves)),this.setFilterFreq()}},excursionOctaves:{enumerable:!0,get:function(){return this._excursionOctaves},set:function(t){this._excursionOctaves=t,this._excursionFrequency=Math.min(e.sampleRate/2,this.baseFrequency*Math.pow(2,this._excursionOctaves)),this.setFilterFreq()}},sensitivity:{enumerable:!0,get:function(){return this._sensitivity},set:function(t){this._sensitivity=Math.pow(10,t)}},resonance:{enumerable:!0,get:function(){return this._resonance},set:function(t){this._resonance=t,this.filterPeaking.Q.value=this._resonance}},init:{value:function(){this.output.gain.value=1,this.filterPeaking.type="peaking",this.filterBp.type="bandpass",this.filterPeaking.frequency.value=100,this.filterPeaking.gain.value=20,this.filterPeaking.Q.value=5,this.filterBp.frequency.value=100,this.filterBp.Q.value=1}}}),s.prototype.EnvelopeFollower=function(t){t||(t=this.getDefaults()),this.input=e.createGain(),this.jsNode=this.output=e.createScriptProcessor(this.buffersize,1,1),this.input.connect(this.output),this.attackTime=p(t.attackTime,this.defaults.attackTime.value),this.releaseTime=p(t.releaseTime,this.defaults.releaseTime.value),this._envelope=0,this.target=t.target||{},this.callback=t.callback||function(){},this.bypass=t.bypass||this.defaults.bypass.value},s.prototype.EnvelopeFollower.prototype=Object.create(i,{name:{value:"EnvelopeFollower"},defaults:{value:{attackTime:{value:.003,min:0,max:.5,automatable:!1,type:a},releaseTime:{value:.5,min:0,max:.5,automatable:!1,type:a},bypass:{value:!1,automatable:!1,type:o}}},buffersize:{value:256},envelope:{value:0},sampleRate:{value:44100},attackTime:{enumerable:!0,get:function(){return this._attackTime},set:function(t){this._attackTime=t,this._attackC=Math.exp(-1/this._attackTime*this.sampleRate/this.buffersize)}},releaseTime:{enumerable:!0,get:function(){return this._releaseTime},set:function(t){this._releaseTime=t,this._releaseC=Math.exp(-1/this._releaseTime*this.sampleRate/this.buffersize)}},callback:{get:function(){return this._callback},set:function(t){"function"==typeof t?this._callback=t:console.error("tuna.js: "+this.name+": Callback must be a function!")}},target:{get:function(){return this._target},set:function(t){this._target=t}},activate:{value:function(t){this.activated=t,t?(this.jsNode.connect(e.destination),this.jsNode.onaudioprocess=this.returnCompute(this)):(this.jsNode.disconnect(),this.jsNode.onaudioprocess=null),this.activateCallback&&this.activateCallback(t)}},returnCompute:{value:function(t){return function(e){t.compute(e)}}},compute:{value:function(t){var e,n,r,i,a=t.inputBuffer.getChannelData(0).length,o=t.inputBuffer.numberOfChannels;for(n=r=i=0,n=0;n2*Math.PI&&(e._phase=0),t(e._target,e._offset+e._oscillation*Math.sin(e._phase))}}}}),s.toString=s.prototype.toString=function(){return"Please visit https://github.com/Theodeus/tuna/wiki for instructions on how to use Tuna.js"}}()},function(t,e,n){"use strict";n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return u}));var r=n(0),i=n(2);let a=function(t,e,n,r){e=e||0,navigator.requestMIDIAccess().then((function(){u[e]?(u[e].onmidimessage=t,"function"==typeof n&&n()):"function"==typeof r&&r()}))},o={play:function(){Object(r.logMessage)("playing midi")},stop:function(){Object(r.logMessage)("stopping midi")}},u=[],s=function(t){Object(r.logMessage)(t.receivedTime,t.data,2),144===t.data[0]?0===t.data[2]?(Object(r.logMessage)("Playing note: ",2),Object(r.logMessage)(i.b[t.data[1]-12],2),o.stop(i.b[t.data[1]-12])):t.data[2]>0&&(Object(r.logMessage)("Stopping note: ",2),Object(r.logMessage)(i.b[t.data[1]-12],2),o.play({pitch:i.b[t.data[1]-12],label:i.b[t.data[1]-12]})):176===t.data[0]?(Object(r.logMessage)("controller"),46==t.data[1]&&(127==t.data[2]?o.pedalMod=!0:0==t.data[2]&&(o.pedalMod=!1))):224===t.data[0]&&Object(r.logMessage)("pitch bend")};!async function(){if(navigator&&navigator.requestMIDIAccess)try{!function(t){u=[];for(var e=t.inputs.values(),n=e.next();!n.done;n=e.next())u.push(n.value);Object(r.logMessage)("MIDI inputs: "),Object(r.logMessage)(u);for(var i=0;i=this.clipLevel&&(this.clipping=!0,this.lastClip=window.performance.now()),i+=e*e;let a=Math.sqrt(i/r);this.volume=Math.max(a,this.volume*this.averaging)};class u{constructor(t){t||(t={}),this.isSetUp=!1,this.playable=1,t.reverb?this.reverb=Object(r.constructReverb)(this,t):this.setUp(t)}setUp(t){this.wads=[],this.input=r.context.createAnalyser(),this.input.fftSize=2048,this.nodes=[this.input],this.destination=t.destination||r.context.destination,this.volume=t.volume||1,this.gain=r.context.createGain(),this.gain.gain.value=this.volume,this.output=r.context.createAnalyser(),this.tuna=t.tuna||null,this.audioMeter=null,this.recorder=null,t.audioMeter&&(this.audioMeter=function(t,e,n,r){let i=t.createScriptProcessor(512);return i.onaudioprocess=o,i.clipping=!1,i.lastClip=0,i.volume=0,i.clipLevel=e||.98,i.averaging=n||.95,i.clipLag=r||750,i.connect(t.destination),i.checkClipping=function(){return!!this.clipping&&(this.lastClip+this.clipLag.9&&u>o)a=!0;else if(a)return e/n;o=u,u>r&&(r=u,n=i)}return r>.01?e/n:-1}(a,r.context.sampleRate);if(-1!==t&&11025!==t&&12e3!==t){let e=t;this.pitch=Math.floor(e);let n=function(t){let e=Math.log(t/440)/Math.log(2)*12;return Math.round(e)+69}(e);this.noteName=i.b[n-12]}let e=this;e.rafID=window.requestAnimationFrame((function(){e.updatePitch()}))}stopUpdatingPitch(){cancelAnimationFrame(this.rafID)}setVolume(t){return this.isSetUp?this.gain.gain.value=t:Object(r.logMessage)("This PolyWad is not set up yet."),this}setPitch(t){this.wads.forEach((function(e){return t in i.a?(e.soundSource&&(e.soundSource.frequency.value=i.a[t]),e.pitch=i.a[t]):(e.soundSource&&(e.soundSource.frequency.value=t),e.pitch=t),this}))}setPanning(t,e){Wad.prototype.setPanning.call(this,t,e)}play(t){if(this.isSetUp)if(this.playable<1)this.playOnLoad=!0,this.playOnLoadArg=t;else{t&&t.volume&&(this.gain.gain.value=t.volume,t.volume=void 0);for(var e=0;e3&&e.randomPlaysBeforeRepeat0&&void 0!==arguments[0]?arguments[0]:{};if(!this.sounds.length)return 0;if(this.random){var n=Math.floor(Math.random()*this.randomSounds.length),r=this.randomSounds[n];return this.index=this.sounds.indexOf(r),this.waitingSounds=this.waitingSounds.filter((function(e){return e.plays-=1,!(e.plays<1)||(t.randomSounds.push(e.sound),null)})),this.randomPlaysBeforeRepeat&&(this.randomSounds.splice(n,1),this.waitingSounds.push({plays:this.randomPlaysBeforeRepeat,sound:r})),r.play(e)}var i=this.sounds[this.index]?this.sounds[this.index].play(e):void 0;return this.index+=1,this.index>=this.sounds.length&&(this.index=0),i}},{key:"add",value:function(t){return t.play||(t=new this.Wad({source:t})),this.sounds.push(t),this.randomSounds.push(t),this}},{key:"remove",value:function(t){var e=this.sounds.indexOf(t);if(-1===e)throw new Error("That sound does not exist: ".concat(t));this.sounds.splice(e,1);var n=this.randomSounds.indexOf(t);return-1===n?this.waitingSounds=this.waitingSounds.filter((function(e){return e.sound!==t})):this.randomSounds.splice(n,1),this}}])&&i(e.prototype,n),a&&i(e,a),t}();u={files:[],random:!1,randomPlaysBeforeRepeat:0},(o="defaultArgs")in(a=s)?Object.defineProperty(a,o,{value:u,enumerable:!0,configurable:!0,writable:!0}):a[o]=u,e.a=s},function(t,e,n){"use strict";e.a={hiHatClosed:{source:"noise",env:{attack:.001,decay:.008,sustain:.2,hold:.03,release:.01},filter:{type:"highpass",frequency:400,q:1}},snare:{source:"noise",env:{attack:.001,decay:.01,sustain:.2,hold:.03,release:.02},filter:{type:"bandpass",frequency:300,q:.18}},hiHatOpen:{source:"noise",env:{attack:.001,decay:.008,sustain:.2,hold:.43,release:.01},filter:{type:"highpass",frequency:100,q:.2}},ghost:{source:"square",volume:.3,env:{attack:.01,decay:.002,sustain:.5,hold:2.5,release:.3},filter:{type:"lowpass",frequency:600,q:7,env:{attack:.7,frequency:1600}},vibrato:{attack:8,speed:8,magnitude:100}},piano:{source:"square",volume:1.4,env:{attack:.01,decay:.005,sustain:.2,hold:.015,release:.3},filter:{type:"lowpass",frequency:1200,q:8.5,env:{attack:.2,frequency:600}}}}},function(t,e,n){"use strict";var r=n(3),i=n.n(r);class a{constructor(t,e){this._setFunc=e,this.AudioParamautomationRate="a-rate",this.defaultValue=t,this.maxValue=34028234663852886e22,this.minValue=-34028234663852886e22,this._value=this.defaultValue}get value(){return this._value}set value(t){this._setFunc(t),this._value=t}}var o=n(0),u=n(1),s=n.n(u);class c{static stopAll(t){for(var e=0;e{this.play(t)}));else{this.nodes=[],t.wait||(t.wait=0),t.volume?this.volume=t.volume:this.volume=this.defaultVolume,t.offset=t.offset||this.offset||0,this.source in{sine:0,sawtooth:0,square:0,triangle:0}?Object(o.setUpOscillator)(this,t):(this.soundSource=o.context.createBufferSource(),this.soundSource.buffer=this.decodedBuffer,("noise"===this.source||this.loop||t.loop)&&(this.soundSource.loop=!0)),this.soundSource.detune&&(this.soundSource.detune.value=t.detune||this.detune),void 0===t.wait&&(t.wait=0),void 0===t.exactTime&&(t.exactTime=o.context.currentTime+t.wait),this.lastPlayedTime=t.exactTime-t.offset,this.nodes.push(this.soundSource),Object(o.setUpEnvOnPlay)(this,t),this.soundSource.playbackRate&&(this.soundSource.playbackRate.value=t.rate||this.rate,this.env.hold=this.env.hold*(1/this.soundSource.playbackRate.value)),Object(o.setUpFilterOnPlay)(this,t),Object(o.setUpTunaOnPlay)(this,t),this.setUpExternalFxOnPlay(t,o.context),this.gain.unshift(o.context.createGain()),this.gain[0].label=t.label,this.gain[0].soundSource=this.soundSource,this.nodes.push(this.gain[0]),this.gain.length>15&&(this.gain.length=15),this.reverb&&Object(o.setUpReverbOnPlay)(this,t),Object(o.setUpPanningOnPlay)(this,t),Object(o.setUpDelayOnPlay)(this,t),Object(o.plugEmIn)(this,t),this.filter&&this.filter[0].env&&Object(o.filterEnv)(this,t),Object(o.playEnv)(this,t),this.vibrato&&Object(o.setUpVibratoOnPlay)(this,t,c),this.tremolo&&Object(o.setUpTremoloOnPlay)(this,t,c);var e=this;if(this.soundSource.onended=function(t){e.playPromiseResolve(e)},!t.unpause)return this.playPromise=new Promise((function(t,n){e.playPromiseResolve=t})),this.playPromise}t.callback&&t.callback(this)}setVolume(t,e,n){if(e=e||.01,n){if(this.gain.length>0)for(let e=0;e0&&this.gain[0].gain.setValueAtTime(t,o.context.currentTime);return this}reverse(){this.decodedBuffer?(Array.prototype.reverse.call(this.decodedBuffer.getChannelData(0)),Array.prototype.reverse.call(this.decodedBuffer.getChannelData(1))):Object(o.logMessage)("You tried to reverse something that isn't reversible")}setRate(t){var e;return e=t&&t>0?t:0,this.soundSource?this.soundSource.playbackRate.value=e:Object(o.logMessage)("Sorry, but the wad does not contain a soundSource!"),this}setPitch(t,e,n){if(e=e||.01,n)for(let r=0;r0&&t<1?t:t>=1?1:0,this.reverb?(this.reverb.wet=e,this.reverb.node&&(this.reverb.node.wet.gain.value=e)):Object(o.logMessage)("Sorry, but the wad does not contain Reverb!"),this}setDelay(t,e,n){var r,i,a;return r=t&&t>0?t:0,i=e&&e>0&&e<1?e:e>=1?1:0,a=n&&n>0&&n<1?n:n>=1?1:0,this.delay?(this.delay.delayTime=r,this.delay.wet=i,this.delay.feedback=a,this.delay.delayNode&&(this.delay.delayNode.delayNode.delayTime.value=r,this.delay.delayNode.wetNode.gain.value=i,this.delay.delayNode.feedbackNode.gain.value=a)):Object(o.logMessage)("Sorry, but the wad does not contain delay!",2),this}pause(t){this.pauseTime=o.context.currentTime,this.soundSource.onended=null,this.stop(t)}unpause(t){(t=t||{}).unpause=!0,this.pauseTime&&null!=this.lastPlayedTime?t.offset=this.pauseTime-this.lastPlayedTime:Object(o.logMessage)("You tried to unpause a wad that was not played and paused, so it just played normally instead.",2),this.play(t)}stop(t){if("mic"!==this.source){if(!this.gain||!this.gain.length)return Object(o.logMessage)("You tried to stop a Wad that never played. ",2),void Object(o.logMessage)(this,2);if(t)for(var e=0;ethis._listener.setPosition(t,this.positionY.value,this.positionZ.value)),this.positionY=this._listener.positionY||new a(0,t=>this._listener.setPosition(this.positionX.value,t,this.positionZ.value)),this.positionZ=this._listener.positionZ||new a(0,t=>this._listener.setPosition(this.positionX.value,this.positionY.value,t)),this.forwardX=this._listener.forwardX||new a(0,t=>this._listener.setOrientation(t,this.forwardY.value,this.forwardZ.value,this.upX.value,this.upY.value,this.upZ.value)),this.forwardY=this._listener.ForwardY||new a(0,t=>this._listener.setOrientation(this.forwardX.value,t,this.forwardZ.value,this.upX.value,this.upY.value,this.upZ.value)),this.forwardZ=this._listener.forwardZ||new a(-1,t=>this._listener.setOrientation(this.forwardX.value,this.forwardY.value,t,this.upX.value,this.upY.value,this.upZ.value)),this.upX=this._listener.upZ||new a(0,t=>this._listener.setOrientation(this.forwardX.value,this.forwardY.value,this.forwardZ.value,t,this.upY.value,this.upZ.value)),this.upY=this._listener.upY||new a(1,t=>this._listener.setOrientation(this.forwardX.value,this.forwardY.value,this.forwardZ.value,this.upX.value,t,this.upZ.value)),this.upZ=this._listener.upZ||new a(0,t=>this._listener.setOrientation(this.forwardX.value,this.forwardY.value,this.forwardZ.value,this.upX.value,this.upY.value,t))}setPosition(t,e,n){this.positionX.value=t,this.positionY.value=e,this.positionZ.value=n}getPosition(){return[this.positionX.value,this.positionY.value,this.positionZ.value]}setOrientation(t,e,n,r,i,a){this.forwardX.value=t,this.forwardY.value=e,this.forwardZ.value=n,this.upX.value=r,this.upY.value=i,this.upZ.value=a}getOrientation(){return[this.forwardX.value,this.forwardY.value,this.forwardZ.value,this.upX.value,this.upY.value,this.upZ.value]}}(o.context),null!=typeof i.a&&(c.tuna=new i.a(c.audioContext));e.a=c},function(t,e,n){"use strict";n.r(e),function(t){var r=n(6),i=n(5),a=n(7),o=n(2),u=n(4),s=n(8),c=n(0);let l=s.a;l.Poly=i.a,l.SoundIterator=function(t){return new r.a(t,l)},l.pitches=o.a,l.pitchesArray=o.b,l.midiMap=u.d,l.assignMidiMap=u.a,l.midiInstrument=u.c,l.midiInputs=u.b,l.presets=a.a,l._common=c,l.logs=c.logStats,t.exports&&(t.exports=l),e.default=l}.call(this,n(10)(t))},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){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},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}}]).default}));