-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
bitlisten.min.js
3 lines (3 loc) · 65.6 KB
/
bitlisten.min.js
1
2
3
/*! BitListen Copyright (c) 2022 Maximillian Laumeister, see README.md for license info. */
var Konami=function(e){var o={addEvent:function(e,t,n,o){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&(e["e"+t+n]=n,e[t+n]=function(){e["e"+t+n](window.event,o)},e.attachEvent("on"+t,e[t+n]))},input:"",pattern:"38384040373937396665",load:function(n){this.addEvent(document,"keydown",function(e,t){if((o=t?t:o).input+=(e||event).keyCode,o.input.length>o.pattern.length&&(o.input=o.input.substr(o.input.length-o.pattern.length)),o.input==o.pattern)return o.code(n),o.input="",e.preventDefault(),!1},this),this.iphone.load(n)},code:function(e){window.location=e},iphone:{start_x:0,start_y:0,stop_x:0,stop_y:0,tap:!1,capture:!1,orig_keys:"",keys:["UP","UP","DOWN","DOWN","LEFT","RIGHT","LEFT","RIGHT","TAP","TAP"],code:function(e){o.code(e)},load:function(t){this.orig_keys=this.keys,o.addEvent(document,"touchmove",function(e){1==e.touches.length&&1==o.iphone.capture&&(e=e.touches[0],o.iphone.stop_x=e.pageX,o.iphone.stop_y=e.pageY,o.iphone.tap=!1,o.iphone.capture=!1,o.iphone.check_direction())}),o.addEvent(document,"touchend",function(e){1==o.iphone.tap&&o.iphone.check_direction(t)},!1),o.addEvent(document,"touchstart",function(e){o.iphone.start_x=e.changedTouches[0].pageX,o.iphone.start_y=e.changedTouches[0].pageY,o.iphone.tap=!0,o.iphone.capture=!0})},check_direction:function(e){x_magnitude=Math.abs(this.start_x-this.stop_x),y_magnitude=Math.abs(this.start_y-this.stop_y),x=this.start_x-this.stop_x<0?"RIGHT":"LEFT",y=this.start_y-this.stop_y<0?"DOWN":"UP",result=x_magnitude>y_magnitude?x:y,(result=1==this.tap?"TAP":result)==this.keys[0]&&(this.keys=this.keys.slice(1,this.keys.length)),0==this.keys.length&&(this.keys=this.orig_keys,this.code(e))}}};return"string"==typeof e&&o.load(e),"function"==typeof e&&(o.code=e,o.load()),o};function surrogateCtor(){}function extend(e,t){surrogateCtor.prototype=e.prototype,t.prototype=new surrogateCtor,t.prototype.constructor=t}function Block(e,t,n,o){"visible"===document.visibilityState&&(Floatable.call(this),n=Math.floor(n/satoshi)+" BTC",o=Math.floor(o/1024)+" KB",this.width=this.height=500,this.addImage(blockImage,this.width,this.height),this.addText("Block #"+e+"<br />Number of Transactions: "+t+"<br />Transaction Volume: "+n+"<br />Block Size: "+o),this.initPosition(),Sound.playRandomSwell())}function Floatable(){this.velocity={x:0,y:-1},this.pageDiv=document.getElementById("bubbleDiv"),this.updateContainerSize(),this.div=document.createElement("div"),this.div.className="floatableDiv",this.pageDiv.appendChild(this.div),this.innerDiv=document.createElement("div"),this.div.appendChild(this.innerDiv),this.innerDiv.className="innerDiv",updateTargets.push(this)}!function(){"use strict";function e(){this.init()}function t(e){e.src&&0!==e.src.length?this.init(e):console.error("An array of source files must be passed with any new Howl.")}e.prototype={init:function(){var e=this||v;return e._counter=1e3,e._html5AudioPool=[],e.html5PoolSize=10,e._codecs={},e._howls=[],e._muted=!1,e._volume=1,e._canPlayEvent="canplaythrough",e._navigator="undefined"!=typeof window&&window.navigator?window.navigator:null,e.masterGain=null,e.noAudio=!1,e.usingWebAudio=!0,e.autoSuspend=!0,e.ctx=null,e.autoUnlock=!0,e._setup(),e},volume:function(e){var t=this||v;if(e=parseFloat(e),t.ctx||d(),void 0!==e&&0<=e&&e<=1){if(t._volume=e,t._muted)return t;t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e,v.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var o=t._howls[n]._getSoundIds(),i=0;i<o.length;i++){var r=t._howls[n]._soundById(o[i]);r&&r._node&&(r._node.volume=r._volume*e)}return t}return t._volume},mute:function(e){var t=this||v;t.ctx||d(),t._muted=e,t.usingWebAudio&&t.masterGain.gain.setValueAtTime(e?0:t._volume,v.ctx.currentTime);for(var n=0;n<t._howls.length;n++)if(!t._howls[n]._webAudio)for(var o=t._howls[n]._getSoundIds(),i=0;i<o.length;i++){var r=t._howls[n]._soundById(o[i]);r&&r._node&&(r._node.muted=!!e||r._muted)}return t},unload:function(){for(var e=this||v,t=e._howls.length-1;0<=t;t--)e._howls[t].unload();return e.usingWebAudio&&e.ctx&&void 0!==e.ctx.close&&(e.ctx.close(),e.ctx=null,d()),e},codecs:function(e){return(this||v)._codecs[e.replace(/^x-/,"")]},_setup:function(){var t=this||v;if(t.state=t.ctx&&t.ctx.state||"suspended",t._autoSuspend(),!t.usingWebAudio)if("undefined"!=typeof Audio)try{void 0===(new Audio).oncanplaythrough&&(t._canPlayEvent="canplay")}catch(e){t.noAudio=!0}else t.noAudio=!0;try{(new Audio).muted&&(t.noAudio=!0)}catch(t){}return t.noAudio||t._setupCodecs(),t},_setupCodecs:function(){var t=this||v,e=null;try{e="undefined"!=typeof Audio?new Audio:null}catch(e){return t}if(!e||"function"!=typeof e.canPlayType)return t;var n=e.canPlayType("audio/mpeg;").replace(/^no$/,""),o=t._navigator&&t._navigator.userAgent.match(/OPR\/([0-6].)/g),o=o&&parseInt(o[0].split("/")[1],10)<33;return t._codecs={mp3:!(o||!n&&!e.canPlayType("audio/mp3;").replace(/^no$/,"")),mpeg:!!n,opus:!!e.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),aac:!!e.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!e.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(e.canPlayType("audio/x-mp4;")||e.canPlayType("audio/mp4;")||e.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),webm:!!e.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,""),dolby:!!e.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(e.canPlayType("audio/x-flac;")||e.canPlayType("audio/flac;")).replace(/^no$/,"")},t},_unlockAudio:function(){var s,u=this||v;if(!u._audioUnlocked&&u.ctx)return u._audioUnlocked=!1,u.autoUnlock=!1,u._mobileUnloaded||44100===u.ctx.sampleRate||(u._mobileUnloaded=!0,u.unload()),u._scratchBuffer=u.ctx.createBuffer(1,1,22050),s=function(e){for(var t=0;t<u.html5PoolSize;t++)try{var n=new Audio;n._unlocked=!0,u._releaseHtml5Audio(n)}catch(e){u.noAudio=!0}for(t=0;t<u._howls.length;t++)if(!u._howls[t]._webAudio)for(var o=u._howls[t]._getSoundIds(),i=0;i<o.length;i++){var r=u._howls[t]._soundById(o[i]);r&&r._node&&!r._node._unlocked&&(r._node._unlocked=!0,r._node.load())}u._autoResume();var a=u.ctx.createBufferSource();a.buffer=u._scratchBuffer,a.connect(u.ctx.destination),void 0===a.start?a.noteOn(0):a.start(0),"function"==typeof u.ctx.resume&&u.ctx.resume(),a.onended=function(){a.disconnect(0),u._audioUnlocked=!0,document.removeEventListener("touchstart",s,!0),document.removeEventListener("touchend",s,!0),document.removeEventListener("click",s,!0);for(var e=0;e<u._howls.length;e++)u._howls[e]._emit("unlock")}},document.addEventListener("touchstart",s,!0),document.addEventListener("touchend",s,!0),document.addEventListener("click",s,!0),u},_obtainHtml5Audio:function(){var e=this||v;if(e._html5AudioPool.length)return e._html5AudioPool.pop();e=(new Audio).play();return e&&"undefined"!=typeof Promise&&(e instanceof Promise||"function"==typeof e.then)&&e.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(e){var t=this||v;return e._unlocked&&t._html5AudioPool.push(e),t},_autoSuspend:function(){var e=this;if(e.autoSuspend&&e.ctx&&void 0!==e.ctx.suspend&&v.usingWebAudio){for(var t=0;t<e._howls.length;t++)if(e._howls[t]._webAudio)for(var n=0;n<e._howls[t]._sounds.length;n++)if(!e._howls[t]._sounds[n]._paused)return e;return e._suspendTimer&&clearTimeout(e._suspendTimer),e._suspendTimer=setTimeout(function(){e.autoSuspend&&(e._suspendTimer=null,e.state="suspending",e.ctx.suspend().then(function(){e.state="suspended",e._resumeAfterSuspend&&(delete e._resumeAfterSuspend,e._autoResume())}))},3e4),e}},_autoResume:function(){var t=this;if(t.ctx&&void 0!==t.ctx.resume&&v.usingWebAudio)return"running"===t.state&&t._suspendTimer?(clearTimeout(t._suspendTimer),t._suspendTimer=null):"suspended"===t.state?(t.ctx.resume().then(function(){t.state="running";for(var e=0;e<t._howls.length;e++)t._howls[e]._emit("resume")}),t._suspendTimer&&(clearTimeout(t._suspendTimer),t._suspendTimer=null)):"suspending"===t.state&&(t._resumeAfterSuspend=!0),t}};var v=new e,r=(t.prototype={init:function(e){var t=this;return v.ctx||d(),t._autoplay=e.autoplay||!1,t._format="string"!=typeof e.format?e.format:[e.format],t._html5=e.html5||!1,t._muted=e.mute||!1,t._loop=e.loop||!1,t._pool=e.pool||5,t._preload="boolean"!=typeof e.preload||e.preload,t._rate=e.rate||1,t._sprite=e.sprite||{},t._src="string"!=typeof e.src?e.src:[e.src],t._volume=void 0!==e.volume?e.volume:1,t._xhrWithCredentials=e.xhrWithCredentials||!1,t._duration=0,t._state="unloaded",t._sounds=[],t._endTimers={},t._queue=[],t._playLock=!1,t._onend=e.onend?[{fn:e.onend}]:[],t._onfade=e.onfade?[{fn:e.onfade}]:[],t._onload=e.onload?[{fn:e.onload}]:[],t._onloaderror=e.onloaderror?[{fn:e.onloaderror}]:[],t._onplayerror=e.onplayerror?[{fn:e.onplayerror}]:[],t._onpause=e.onpause?[{fn:e.onpause}]:[],t._onplay=e.onplay?[{fn:e.onplay}]:[],t._onstop=e.onstop?[{fn:e.onstop}]:[],t._onmute=e.onmute?[{fn:e.onmute}]:[],t._onvolume=e.onvolume?[{fn:e.onvolume}]:[],t._onrate=e.onrate?[{fn:e.onrate}]:[],t._onseek=e.onseek?[{fn:e.onseek}]:[],t._onunlock=e.onunlock?[{fn:e.onunlock}]:[],t._onresume=[],t._webAudio=v.usingWebAudio&&!t._html5,void 0!==v.ctx&&v.ctx&&v.autoUnlock&&v._unlockAudio(),v._howls.push(t),t._autoplay&&t._queue.push({event:"play",action:function(){t.play()}}),t._preload&&t.load(),t},load:function(){var e=this,t=null;if(!v.noAudio){"string"==typeof e._src&&(e._src=[e._src]);for(var n,o,i=0;i<e._src.length;i++){if(e._format&&e._format[i])n=e._format[i];else{if("string"!=typeof(o=e._src[i])){e._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}n=(n=(n=/^data:audio\/([^;,]+);/i.exec(o))||/\.([^.]+)$/.exec(o.split("?",1)[0]))&&n[1].toLowerCase()}if(n||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),n&&v.codecs(n)){t=e._src[i];break}}return t?(e._src=t,e._state="loading","https:"===window.location.protocol&&"http:"===t.slice(0,5)&&(e._html5=!0,e._webAudio=!1),new r(e),e._webAudio&&s(e),e):void e._emit("loaderror",null,"No codec support for selected audio sources.")}e._emit("loaderror",null,"No audio support.")},play:function(t,n){var o=this,e=null;if("number"==typeof t)e=t,t=null;else{if("string"==typeof t&&"loaded"===o._state&&!o._sprite[t])return null;if(void 0===t&&(t="__default",!o._playLock)){for(var i=0,r=0;r<o._sounds.length;r++)o._sounds[r]._paused&&!o._sounds[r]._ended&&(i++,e=o._sounds[r]._id);1===i?t=null:e=null}}var a,s=e?o._soundById(e):o._inactiveSound();if(!s)return null;if(e&&!t&&(t=s._sprite||"__default"),"loaded"!==o._state)return s._sprite=t,s._ended=!1,a=s._id,o._queue.push({event:"play",action:function(){o.play(a)}}),a;if(e&&!s._paused)return n||o._loadQueue("play"),s._id;o._webAudio&&v._autoResume();var u,l,c,d,p=Math.max(0,0<s._seek?s._seek:o._sprite[t][0]/1e3),_=Math.max(0,(o._sprite[t][0]+o._sprite[t][1])/1e3-p),h=1e3*_/Math.abs(s._rate),f=o._sprite[t][0]/1e3,m=(o._sprite[t][0]+o._sprite[t][1])/1e3,g=(s._sprite=t,s._ended=!1,function(){s._paused=!1,s._seek=p,s._start=f,s._stop=m,s._loop=!(!s._loop&&!o._sprite[t][2])});{if(!(m<=p))return u=s._node,o._webAudio?(c=function(){o._playLock=!1,g(),o._refreshBuffer(s);var e=s._muted||o._muted?0:s._volume;u.gain.setValueAtTime(e,v.ctx.currentTime),s._playStart=v.ctx.currentTime,void 0===u.bufferSource.start?s._loop?u.bufferSource.noteGrainOn(0,p,86400):u.bufferSource.noteGrainOn(0,p,_):s._loop?u.bufferSource.start(0,p,86400):u.bufferSource.start(0,p,_),h!==1/0&&(o._endTimers[s._id]=setTimeout(o._ended.bind(o,s),h)),n||setTimeout(function(){o._emit("play",s._id),o._loadQueue()},0)},"running"===v.state?c():(o._playLock=!0,o.once("resume",c),o._clearTimer(s._id))):(l=function(){u.currentTime=p,u.muted=s._muted||o._muted||v._muted||u.muted,u.volume=s._volume*v.volume(),u.playbackRate=s._rate;try{var e=u.play();if(e&&"undefined"!=typeof Promise&&(e instanceof Promise||"function"==typeof e.then)?(o._playLock=!0,g(),e.then(function(){o._playLock=!1,u._unlocked=!0,n||(o._emit("play",s._id),o._loadQueue())}).catch(function(){o._playLock=!1,o._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),s._ended=!0,s._paused=!0})):n||(o._playLock=!1,g(),o._emit("play",s._id),o._loadQueue()),u.playbackRate=s._rate,u.paused)return void o._emit("playerror",s._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");"__default"!==t||s._loop?o._endTimers[s._id]=setTimeout(o._ended.bind(o,s),h):(o._endTimers[s._id]=function(){o._ended(s),u.removeEventListener("ended",o._endTimers[s._id],!1)},u.addEventListener("ended",o._endTimers[s._id],!1))}catch(e){o._emit("playerror",s._id,e)}},"data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"===u.src&&(u.src=o._src,u.load()),c=window&&window.ejecta||!u.readyState&&v._navigator.isCocoonJS,3<=u.readyState||c?l():(o._playLock=!0,d=function(){l(),u.removeEventListener(v._canPlayEvent,d,!1)},u.addEventListener(v._canPlayEvent,d,!1),o._clearTimer(s._id))),s._id;o._ended(s)}},pause:function(e){var t=this;if("loaded"!==t._state||t._playLock)return t._queue.push({event:"pause",action:function(){t.pause(e)}}),t;for(var n=t._getSoundIds(e),o=0;o<n.length;o++){t._clearTimer(n[o]);var i=t._soundById(n[o]);if(i&&!i._paused&&(i._seek=t.seek(n[o]),i._rateSeek=0,i._paused=!0,t._stopFade(n[o]),i._node))if(t._webAudio){if(!i._node.bufferSource)continue;void 0===i._node.bufferSource.stop?i._node.bufferSource.noteOff(0):i._node.bufferSource.stop(0),t._cleanBuffer(i._node)}else isNaN(i._node.duration)&&i._node.duration!==1/0||i._node.pause();arguments[1]||t._emit("pause",i?i._id:null)}return t},stop:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"stop",action:function(){n.stop(e)}}),n;for(var o=n._getSoundIds(e),i=0;i<o.length;i++){n._clearTimer(o[i]);var r=n._soundById(o[i]);r&&(r._seek=r._start||0,r._rateSeek=0,r._paused=!0,r._ended=!0,n._stopFade(o[i]),r._node&&(n._webAudio?r._node.bufferSource&&(void 0===r._node.bufferSource.stop?r._node.bufferSource.noteOff(0):r._node.bufferSource.stop(0),n._cleanBuffer(r._node)):isNaN(r._node.duration)&&r._node.duration!==1/0||(r._node.currentTime=r._start||0,r._node.pause(),r._node.duration===1/0&&n._clearSound(r._node))),t||n._emit("stop",r._id))}return n},mute:function(e,t){var n=this;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"mute",action:function(){n.mute(e,t)}}),n;if(void 0===t){if("boolean"!=typeof e)return n._muted;n._muted=e}for(var o=n._getSoundIds(t),i=0;i<o.length;i++){var r=n._soundById(o[i]);r&&(r._muted=e,r._interval&&n._stopFade(r._id),n._webAudio&&r._node?r._node.gain.setValueAtTime(e?0:r._volume,v.ctx.currentTime):r._node&&(r._node.muted=!!v._muted||e),n._emit("mute",r._id))}return n},volume:function(){var e,t,n=this,o=arguments;if(0===o.length)return n._volume;if(1===o.length||2===o.length&&void 0===o[1]?0<=n._getSoundIds().indexOf(o[0])?i=parseInt(o[0],10):e=parseFloat(o[0]):2<=o.length&&(e=parseFloat(o[0]),i=parseInt(o[1],10)),!(void 0!==e&&0<=e&&e<=1))return(t=i?n._soundById(i):n._sounds[0])?t._volume:0;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"volume",action:function(){n.volume.apply(n,o)}}),n;void 0===i&&(n._volume=e);for(var i=n._getSoundIds(i),r=0;r<i.length;r++)(t=n._soundById(i[r]))&&(t._volume=e,o[2]||n._stopFade(i[r]),n._webAudio&&t._node&&!t._muted?t._node.gain.setValueAtTime(e,v.ctx.currentTime):t._node&&!t._muted&&(t._node.volume=e*v.volume()),n._emit("volume",t._id));return n},fade:function(e,t,n,o){var i=this;if("loaded"!==i._state||i._playLock)return i._queue.push({event:"fade",action:function(){i.fade(e,t,n,o)}}),i;e=parseFloat(e),t=parseFloat(t),n=parseFloat(n),i.volume(e,o);for(var r=i._getSoundIds(o),a=0;a<r.length;a++){var s,u,l=i._soundById(r[a]);l&&(o||i._stopFade(r[a]),i._webAudio&&!l._muted&&(u=(s=v.ctx.currentTime)+n/1e3,l._volume=e,l._node.gain.setValueAtTime(e,s),l._node.gain.linearRampToValueAtTime(t,u)),i._startFadeInterval(l,e,t,n,r[a],void 0===o))}return i},_startFadeInterval:function(t,n,o,i,e,r){var a=this,s=n,u=o-n,l=Math.abs(u/.01),l=Math.max(4,0<l?i/l:i),c=Date.now();t._fadeTo=o,t._interval=setInterval(function(){var e=(Date.now()-c)/i;c=Date.now(),s+=u*e,s=Math.max(0,s),s=Math.min(1,s),s=Math.round(100*s)/100,a._webAudio?t._volume=s:a.volume(s,t._id,!0),r&&(a._volume=s),(o<n&&s<=o||n<o&&o<=s)&&(clearInterval(t._interval),t._interval=null,t._fadeTo=null,a.volume(o,t._id),a._emit("fade",t._id))},l)},_stopFade:function(e){var t=this,n=t._soundById(e);return n&&n._interval&&(t._webAudio&&n._node.gain.cancelScheduledValues(v.ctx.currentTime),clearInterval(n._interval),n._interval=null,t.volume(n._fadeTo,e),n._fadeTo=null,t._emit("fade",e)),t},loop:function(){var e,t,n,o=this,i=arguments;if(0===i.length)return o._loop;if(1===i.length){if("boolean"!=typeof i[0])return!!(n=o._soundById(parseInt(i[0],10)))&&n._loop;o._loop=e=i[0]}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var r=o._getSoundIds(t),a=0;a<r.length;a++)(n=o._soundById(r[a]))&&(n._loop=e,o._webAudio&&n._node&&n._node.bufferSource&&((n._node.bufferSource.loop=e)&&(n._node.bufferSource.loopStart=n._start||0,n._node.bufferSource.loopEnd=n._stop)));return o},rate:function(){var e,t,n=this,o=arguments;if(0===o.length?r=n._sounds[0]._id:1===o.length?0<=n._getSoundIds().indexOf(o[0])?r=parseInt(o[0],10):e=parseFloat(o[0]):2===o.length&&(e=parseFloat(o[0]),r=parseInt(o[1],10)),"number"!=typeof e)return((t=n._soundById(r))||n)._rate;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"rate",action:function(){n.rate.apply(n,o)}}),n;void 0===r&&(n._rate=e);for(var i,r=n._getSoundIds(r),a=0;a<r.length;a++)(t=n._soundById(r[a]))&&(n.playing(r[a])&&(t._rateSeek=n.seek(r[a]),t._playStart=n._webAudio?v.ctx.currentTime:t._playStart),t._rate=e,n._webAudio&&t._node&&t._node.bufferSource?t._node.bufferSource.playbackRate.setValueAtTime(e,v.ctx.currentTime):t._node&&(t._node.playbackRate=e),i=n.seek(r[a]),i=1e3*((n._sprite[t._sprite][0]+n._sprite[t._sprite][1])/1e3-i)/Math.abs(t._rate),!n._endTimers[r[a]]&&t._paused||(n._clearTimer(r[a]),n._endTimers[r[a]]=setTimeout(n._ended.bind(n,t),i)),n._emit("rate",t._id));return n},seek:function(){var e,t,n=this,o=arguments;if(0===o.length?t=n._sounds[0]._id:1===o.length?0<=n._getSoundIds().indexOf(o[0])?t=parseInt(o[0],10):n._sounds.length&&(t=n._sounds[0]._id,e=parseFloat(o[0])):2===o.length&&(e=parseFloat(o[0]),t=parseInt(o[1],10)),void 0===t)return n;if("loaded"!==n._state||n._playLock)return n._queue.push({event:"seek",action:function(){n.seek.apply(n,o)}}),n;var i,r,a=n._soundById(t);if(a){if(!("number"==typeof e&&0<=e))return n._webAudio?(i=n.playing(t)?v.ctx.currentTime-a._playStart:0,r=a._rateSeek?a._rateSeek-a._seek:0,a._seek+(r+i*Math.abs(a._rate))):a._node.currentTime;var s,u=n.playing(t),l=(u&&n.pause(t,!0),a._seek=e,a._ended=!1,n._clearTimer(t),n._webAudio||!a._node||isNaN(a._node.duration)||(a._node.currentTime=e),function(){n._emit("seek",t),u&&n.play(t,!0)});u&&!n._webAudio?(s=function(){n._playLock?setTimeout(s,0):l()},setTimeout(s,0)):l()}return n},playing:function(e){if("number"==typeof e)return!!(e=this._soundById(e))&&!e._paused;for(var t=0;t<this._sounds.length;t++)if(!this._sounds[t]._paused)return!0;return!1},duration:function(e){var t=this._duration,e=this._soundById(e);return t=e?this._sprite[e._sprite][1]/1e3:t},state:function(){return this._state},unload:function(){for(var e=this,t=e._sounds,n=0;n<t.length;n++)t[n]._paused||e.stop(t[n]._id),e._webAudio||(e._clearSound(t[n]._node),t[n]._node.removeEventListener("error",t[n]._errorFn,!1),t[n]._node.removeEventListener(v._canPlayEvent,t[n]._loadFn,!1),v._releaseHtml5Audio(t[n]._node)),delete t[n]._node,e._clearTimer(t[n]._id);for(var o=v._howls.indexOf(e),i=(0<=o&&v._howls.splice(o,1),!0),n=0;n<v._howls.length;n++)if(v._howls[n]._src===e._src||0<=e._src.indexOf(v._howls[n]._src)){i=!1;break}return a&&i&&delete a[e._src],v.noAudio=!1,e._state="unloaded",e._sounds=[],null},on:function(e,t,n,o){e=this["_on"+e];return"function"==typeof t&&e.push(o?{id:n,fn:t,once:o}:{id:n,fn:t}),this},off:function(e,t,n){var o=this,i=o["_on"+e],r=0;if("number"==typeof t&&(n=t,t=null),t||n)for(r=0;r<i.length;r++){var a=n===i[r].id;if(t===i[r].fn&&a||!t&&a){i.splice(r,1);break}}else if(e)o["_on"+e]=[];else for(var s=Object.keys(o),r=0;r<s.length;r++)0===s[r].indexOf("_on")&&Array.isArray(o[s[r]])&&(o[s[r]]=[]);return o},once:function(e,t,n){return this.on(e,t,n,1),this},_emit:function(e,t,n){for(var o=this,i=o["_on"+e],r=i.length-1;0<=r;r--)i[r].id&&i[r].id!==t&&"load"!==e||(setTimeout(function(e){e.call(this,t,n)}.bind(o,i[r].fn),0),i[r].once&&o.off(e,i[r].fn,i[r].id));return o._loadQueue(e),o},_loadQueue:function(e){var t,n=this;return 0<n._queue.length&&((t=n._queue[0]).event===e&&(n._queue.shift(),n._loadQueue()),e||t.action()),n},_ended:function(e){var t=this,n=e._sprite;if(!t._webAudio&&e._node&&!e._node.paused&&!e._node.ended&&e._node.currentTime<e._stop)return setTimeout(t._ended.bind(t,e),100),t;var o,n=!(!e._loop&&!t._sprite[n][2]);return t._emit("end",e._id),!t._webAudio&&n&&t.stop(e._id,!0).play(e._id),t._webAudio&&n&&(t._emit("play",e._id),e._seek=e._start||0,e._rateSeek=0,e._playStart=v.ctx.currentTime,o=1e3*(e._stop-e._start)/Math.abs(e._rate),t._endTimers[e._id]=setTimeout(t._ended.bind(t,e),o)),t._webAudio&&!n&&(e._paused=!0,e._ended=!0,e._seek=e._start||0,e._rateSeek=0,t._clearTimer(e._id),t._cleanBuffer(e._node),v._autoSuspend()),t._webAudio||n||t.stop(e._id,!0),t},_clearTimer:function(e){var t,n=this;return n._endTimers[e]&&("function"!=typeof n._endTimers[e]?clearTimeout(n._endTimers[e]):(t=n._soundById(e))&&t._node&&t._node.removeEventListener("ended",n._endTimers[e],!1),delete n._endTimers[e]),n},_soundById:function(e){for(var t=0;t<this._sounds.length;t++)if(e===this._sounds[t]._id)return this._sounds[t];return null},_inactiveSound:function(){var e=this;e._drain();for(var t=0;t<e._sounds.length;t++)if(e._sounds[t]._ended)return e._sounds[t].reset();return new r(e)},_drain:function(){var e=this,t=e._pool,n=0,o=0;if(!(e._sounds.length<t)){for(o=0;o<e._sounds.length;o++)e._sounds[o]._ended&&n++;for(o=e._sounds.length-1;0<=o;o--){if(n<=t)return;e._sounds[o]._ended&&(e._webAudio&&e._sounds[o]._node&&e._sounds[o]._node.disconnect(0),e._sounds.splice(o,1),n--)}}},_getSoundIds:function(e){if(void 0!==e)return[e];for(var t=[],n=0;n<this._sounds.length;n++)t.push(this._sounds[n]._id);return t},_refreshBuffer:function(e){return e._node.bufferSource=v.ctx.createBufferSource(),e._node.bufferSource.buffer=a[this._src],e._panner?e._node.bufferSource.connect(e._panner):e._node.bufferSource.connect(e._node),e._node.bufferSource.loop=e._loop,e._loop&&(e._node.bufferSource.loopStart=e._start||0,e._node.bufferSource.loopEnd=e._stop||0),e._node.bufferSource.playbackRate.setValueAtTime(e._rate,v.ctx.currentTime),this},_cleanBuffer:function(e){var t=v._navigator&&0<=v._navigator.vendor.indexOf("Apple");if(v._scratchBuffer&&e.bufferSource&&(e.bufferSource.onended=null,e.bufferSource.disconnect(0),t))try{e.bufferSource.buffer=v._scratchBuffer}catch(e){}return e.bufferSource=null,this},_clearSound:function(e){/MSIE |Trident\//.test(v._navigator&&v._navigator.userAgent)||(e.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}},function(e){this._parent=e,this.init()}),a=(r.prototype={init:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++v._counter,t._sounds.push(e),e.create(),e},create:function(){var e=this,t=e._parent,n=v._muted||e._muted||e._parent._muted?0:e._volume;return t._webAudio?(e._node=void 0===v.ctx.createGain?v.ctx.createGainNode():v.ctx.createGain(),e._node.gain.setValueAtTime(n,v.ctx.currentTime),e._node.paused=!0,e._node.connect(v.masterGain)):v.noAudio||(e._node=v._obtainHtml5Audio(),e._errorFn=e._errorListener.bind(e),e._node.addEventListener("error",e._errorFn,!1),e._loadFn=e._loadListener.bind(e),e._node.addEventListener(v._canPlayEvent,e._loadFn,!1),e._node.src=t._src,e._node.preload="auto",e._node.volume=n*v.volume(),e._node.load()),e},reset:function(){var e=this,t=e._parent;return e._muted=t._muted,e._loop=t._loop,e._volume=t._volume,e._rate=t._rate,e._seek=0,e._rateSeek=0,e._paused=!0,e._ended=!0,e._sprite="__default",e._id=++v._counter,e},_errorListener:function(){var e=this;e._parent._emit("loaderror",e._id,e._node.error?e._node.error.code:0),e._node.removeEventListener("error",e._errorFn,!1)},_loadListener:function(){var e=this._parent;e._duration=Math.ceil(10*this._node.duration)/10,0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue()),this._node.removeEventListener(v._canPlayEvent,this._loadFn,!1)}},{}),s=function(t){var e=t._src;if(a[e])return t._duration=a[e].duration,void c(t);if(/^data:[^;]+;base64,/.test(e)){for(var n=atob(e.split(",")[1]),o=new Uint8Array(n.length),i=0;i<n.length;++i)o[i]=n.charCodeAt(i);l(o.buffer,t)}else{var r=new XMLHttpRequest;r.open("GET",e,!0),r.withCredentials=t._xhrWithCredentials,r.responseType="arraybuffer",r.onload=function(){var e=(r.status+"")[0];"0"!==e&&"2"!==e&&"3"!==e?t._emit("loaderror",null,"Failed loading audio file with status: "+r.status+"."):l(r.response,t)},r.onerror=function(){t._webAudio&&(t._html5=!0,t._webAudio=!1,t._sounds=[],delete a[e],t.load())},u(r)}},u=function(t){try{t.send()}catch(e){t.onerror()}},l=function(e,t){function n(){t._emit("loaderror",null,"Decoding audio data failed.")}function o(e){e&&0<t._sounds.length?(a[t._src]=e,c(t,e)):n()}"undefined"!=typeof Promise&&1===v.ctx.decodeAudioData.length?v.ctx.decodeAudioData(e).then(o).catch(n):v.ctx.decodeAudioData(e,o,n)},c=function(e,t){t&&!e._duration&&(e._duration=t.duration),0===Object.keys(e._sprite).length&&(e._sprite={__default:[0,1e3*e._duration]}),"loaded"!==e._state&&(e._state="loaded",e._emit("load"),e._loadQueue())},d=function(){if(v.usingWebAudio){try{"undefined"!=typeof AudioContext?v.ctx=new AudioContext:"undefined"!=typeof webkitAudioContext?v.ctx=new webkitAudioContext:v.usingWebAudio=!1}catch(e){v.usingWebAudio=!1}v.ctx||(v.usingWebAudio=!1);var e=/iP(hone|od|ad)/.test(v._navigator&&v._navigator.platform),t=v._navigator&&v._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),t=t?parseInt(t[1],10):null;e&&t&&t<9&&(t=/safari/.test(v._navigator&&v._navigator.userAgent.toLowerCase()),(v._navigator&&v._navigator.standalone&&!t||v._navigator&&!v._navigator.standalone&&!t)&&(v.usingWebAudio=!1)),v.usingWebAudio&&(v.masterGain=void 0===v.ctx.createGain?v.ctx.createGainNode():v.ctx.createGain(),v.masterGain.gain.setValueAtTime(v._muted?0:v._volume,v.ctx.currentTime),v.masterGain.connect(v.ctx.destination)),v._setup()}};"function"==typeof define&&define.amd&&define([],function(){return{Howler:v,Howl:t}}),"undefined"!=typeof exports&&(exports.Howler=v,exports.Howl=t),"undefined"!=typeof window?(window.HowlerGlobal=e,window.Howler=v,window.Howl=t,window.Sound=r):"undefined"!=typeof global&&(global.HowlerGlobal=e,global.Howler=v,global.Howl=t,global.Sound=r)}(),function(){"use strict";HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(e){var t=this;if(!t.ctx||!t.ctx.listener)return t;for(var n=t._howls.length-1;0<=n;n--)t._howls[n].stereo(e);return t},HowlerGlobal.prototype.pos=function(e,t,n){var o=this;return o.ctx&&o.ctx.listener?(t="number"!=typeof t?o._pos[1]:t,n="number"!=typeof n?o._pos[2]:n,"number"!=typeof e?o._pos:(o._pos=[e,t,n],void 0!==o.ctx.listener.positionX?(o.ctx.listener.positionX.setTargetAtTime(o._pos[0],Howler.ctx.currentTime,.1),o.ctx.listener.positionY.setTargetAtTime(o._pos[1],Howler.ctx.currentTime,.1),o.ctx.listener.positionZ.setTargetAtTime(o._pos[2],Howler.ctx.currentTime,.1)):o.ctx.listener.setPosition(o._pos[0],o._pos[1],o._pos[2]),o)):o},HowlerGlobal.prototype.orientation=function(e,t,n,o,i,r){var a=this;if(!a.ctx||!a.ctx.listener)return a;var s=a._orientation;return t="number"!=typeof t?s[1]:t,n="number"!=typeof n?s[2]:n,o="number"!=typeof o?s[3]:o,i="number"!=typeof i?s[4]:i,r="number"!=typeof r?s[5]:r,"number"!=typeof e?s:(a._orientation=[e,t,n,o,i,r],void 0!==a.ctx.listener.forwardX?(a.ctx.listener.forwardX.setTargetAtTime(e,Howler.ctx.currentTime,.1),a.ctx.listener.forwardY.setTargetAtTime(t,Howler.ctx.currentTime,.1),a.ctx.listener.forwardZ.setTargetAtTime(n,Howler.ctx.currentTime,.1),a.ctx.listener.upX.setTargetAtTime(o,Howler.ctx.currentTime,.1),a.ctx.listener.upY.setTargetAtTime(i,Howler.ctx.currentTime,.1),a.ctx.listener.upZ.setTargetAtTime(r,Howler.ctx.currentTime,.1)):a.ctx.listener.setOrientation(e,t,n,o,i,r),a)},Howl.prototype.init=(i=Howl.prototype.init,function(e){var t=this;return t._orientation=e.orientation||[1,0,0],t._stereo=e.stereo||null,t._pos=e.pos||null,t._pannerAttr={coneInnerAngle:void 0!==e.coneInnerAngle?e.coneInnerAngle:360,coneOuterAngle:void 0!==e.coneOuterAngle?e.coneOuterAngle:360,coneOuterGain:void 0!==e.coneOuterGain?e.coneOuterGain:0,distanceModel:void 0!==e.distanceModel?e.distanceModel:"inverse",maxDistance:void 0!==e.maxDistance?e.maxDistance:1e4,panningModel:void 0!==e.panningModel?e.panningModel:"HRTF",refDistance:void 0!==e.refDistance?e.refDistance:1,rolloffFactor:void 0!==e.rolloffFactor?e.rolloffFactor:1},t._onstereo=e.onstereo?[{fn:e.onstereo}]:[],t._onpos=e.onpos?[{fn:e.onpos}]:[],t._onorientation=e.onorientation?[{fn:e.onorientation}]:[],i.call(this,e)}),Howl.prototype.stereo=function(e,t){var n=this;if(!n._webAudio)return n;if("loaded"!==n._state)return n._queue.push({event:"stereo",action:function(){n.stereo(e,t)}}),n;var o=void 0===Howler.ctx.createStereoPanner?"spatial":"stereo";if(void 0===t){if("number"!=typeof e)return n._stereo;n._stereo=e,n._pos=[e,0,0]}for(var i=n._getSoundIds(t),r=0;r<i.length;r++){var a=n._soundById(i[r]);if(a){if("number"!=typeof e)return a._stereo;a._stereo=e,a._pos=[e,0,0],a._node&&(a._pannerAttr.panningModel="equalpower",a._panner&&a._panner.pan||l(a,o),"spatial"==o?void 0!==a._panner.positionX?(a._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):a._panner.setPosition(e,0,0):a._panner.pan.setValueAtTime(e,Howler.ctx.currentTime)),n._emit("stereo",a._id)}}return n},Howl.prototype.pos=function(e,t,n,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"pos",action:function(){i.pos(e,t,n,o)}}),i;if(t="number"!=typeof t?0:t,n="number"!=typeof n?-.5:n,void 0===o){if("number"!=typeof e)return i._pos;i._pos=[e,t,n]}for(var r=i._getSoundIds(o),a=0;a<r.length;a++){var s=i._soundById(r[a]);if(s){if("number"!=typeof e)return s._pos;s._pos=[e,t,n],s._node&&(s._panner&&!s._panner.pan||l(s,"spatial"),void 0!==s._panner.positionX?(s._panner.positionX.setValueAtTime(e,Howler.ctx.currentTime),s._panner.positionY.setValueAtTime(t,Howler.ctx.currentTime),s._panner.positionZ.setValueAtTime(n,Howler.ctx.currentTime)):s._panner.setPosition(e,t,n)),i._emit("pos",s._id)}}return i},Howl.prototype.orientation=function(e,t,n,o){var i=this;if(!i._webAudio)return i;if("loaded"!==i._state)return i._queue.push({event:"orientation",action:function(){i.orientation(e,t,n,o)}}),i;if(t="number"!=typeof t?i._orientation[1]:t,n="number"!=typeof n?i._orientation[2]:n,void 0===o){if("number"!=typeof e)return i._orientation;i._orientation=[e,t,n]}for(var r=i._getSoundIds(o),a=0;a<r.length;a++){var s=i._soundById(r[a]);if(s){if("number"!=typeof e)return s._orientation;s._orientation=[e,t,n],s._node&&(s._panner||(s._pos||(s._pos=i._pos||[0,0,-.5]),l(s,"spatial")),void 0!==s._panner.orientationX?(s._panner.orientationX.setValueAtTime(e,Howler.ctx.currentTime),s._panner.orientationY.setValueAtTime(t,Howler.ctx.currentTime),s._panner.orientationZ.setValueAtTime(n,Howler.ctx.currentTime)):s._panner.setOrientation(e,t,n)),i._emit("orientation",s._id)}}return i},Howl.prototype.pannerAttr=function(){var e,t,n,o=this,i=arguments;if(!o._webAudio)return o;if(0===i.length)return o._pannerAttr;if(1===i.length){if("object"!=typeof i[0])return((n=o._soundById(parseInt(i[0],10)))||o)._pannerAttr;e=i[0],void 0===t&&(e.pannerAttr||(e.pannerAttr={coneInnerAngle:e.coneInnerAngle,coneOuterAngle:e.coneOuterAngle,coneOuterGain:e.coneOuterGain,distanceModel:e.distanceModel,maxDistance:e.maxDistance,refDistance:e.refDistance,rolloffFactor:e.rolloffFactor,panningModel:e.panningModel}),o._pannerAttr={coneInnerAngle:void 0!==e.pannerAttr.coneInnerAngle?e.pannerAttr.coneInnerAngle:o._coneInnerAngle,coneOuterAngle:void 0!==e.pannerAttr.coneOuterAngle?e.pannerAttr.coneOuterAngle:o._coneOuterAngle,coneOuterGain:void 0!==e.pannerAttr.coneOuterGain?e.pannerAttr.coneOuterGain:o._coneOuterGain,distanceModel:void 0!==e.pannerAttr.distanceModel?e.pannerAttr.distanceModel:o._distanceModel,maxDistance:void 0!==e.pannerAttr.maxDistance?e.pannerAttr.maxDistance:o._maxDistance,refDistance:void 0!==e.pannerAttr.refDistance?e.pannerAttr.refDistance:o._refDistance,rolloffFactor:void 0!==e.pannerAttr.rolloffFactor?e.pannerAttr.rolloffFactor:o._rolloffFactor,panningModel:void 0!==e.pannerAttr.panningModel?e.pannerAttr.panningModel:o._panningModel})}else 2===i.length&&(e=i[0],t=parseInt(i[1],10));for(var r,a,s=o._getSoundIds(t),u=0;u<s.length;u++)(n=o._soundById(s[u]))&&(r=n._pannerAttr,r={coneInnerAngle:(void 0!==e.coneInnerAngle?e:r).coneInnerAngle,coneOuterAngle:(void 0!==e.coneOuterAngle?e:r).coneOuterAngle,coneOuterGain:(void 0!==e.coneOuterGain?e:r).coneOuterGain,distanceModel:(void 0!==e.distanceModel?e:r).distanceModel,maxDistance:(void 0!==e.maxDistance?e:r).maxDistance,refDistance:(void 0!==e.refDistance?e:r).refDistance,rolloffFactor:(void 0!==e.rolloffFactor?e:r).rolloffFactor,panningModel:(void 0!==e.panningModel?e:r).panningModel},(a=n._panner)?(a.coneInnerAngle=r.coneInnerAngle,a.coneOuterAngle=r.coneOuterAngle,a.coneOuterGain=r.coneOuterGain,a.distanceModel=r.distanceModel,a.maxDistance=r.maxDistance,a.refDistance=r.refDistance,a.rolloffFactor=r.rolloffFactor,a.panningModel=r.panningModel):(n._pos||(n._pos=o._pos||[0,0,-.5]),l(n,"spatial")));return o},Sound.prototype.init=(o=Sound.prototype.init,function(){var e=this,t=e._parent;e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,o.call(this),e._stereo?t.stereo(e._stereo):e._pos&&t.pos(e._pos[0],e._pos[1],e._pos[2],e._id)}),Sound.prototype.reset=(n=Sound.prototype.reset,function(){var e=this,t=e._parent;return e._orientation=t._orientation,e._stereo=t._stereo,e._pos=t._pos,e._pannerAttr=t._pannerAttr,e._stereo?t.stereo(e._stereo):e._pos?t.pos(e._pos[0],e._pos[1],e._pos[2],e._id):e._panner&&(e._panner.disconnect(0),e._panner=void 0,t._refreshBuffer(e)),n.call(this)});var n,o,i,l=function(e,t){"spatial"===(t=t||"spatial")?(e._panner=Howler.ctx.createPanner(),e._panner.coneInnerAngle=e._pannerAttr.coneInnerAngle,e._panner.coneOuterAngle=e._pannerAttr.coneOuterAngle,e._panner.coneOuterGain=e._pannerAttr.coneOuterGain,e._panner.distanceModel=e._pannerAttr.distanceModel,e._panner.maxDistance=e._pannerAttr.maxDistance,e._panner.refDistance=e._pannerAttr.refDistance,e._panner.rolloffFactor=e._pannerAttr.rolloffFactor,e._panner.panningModel=e._pannerAttr.panningModel,void 0!==e._panner.positionX?(e._panner.positionX.setValueAtTime(e._pos[0],Howler.ctx.currentTime),e._panner.positionY.setValueAtTime(e._pos[1],Howler.ctx.currentTime),e._panner.positionZ.setValueAtTime(e._pos[2],Howler.ctx.currentTime)):e._panner.setPosition(e._pos[0],e._pos[1],e._pos[2]),void 0!==e._panner.orientationX?(e._panner.orientationX.setValueAtTime(e._orientation[0],Howler.ctx.currentTime),e._panner.orientationY.setValueAtTime(e._orientation[1],Howler.ctx.currentTime),e._panner.orientationZ.setValueAtTime(e._orientation[2],Howler.ctx.currentTime)):e._panner.setOrientation(e._orientation[0],e._orientation[1],e._orientation[2])):(e._panner=Howler.ctx.createStereoPanner(),e._panner.pan.setValueAtTime(e._stereo,Howler.ctx.currentTime)),e._panner.connect(e._node),e._paused||e._parent.pause(e._id,!0).play(e._id,!0)}}(),function(o){o.fn.qr=function(e){return this.each(function(){var t={size:"230",delay:"0"},n=(e&&o.extend(t,e),o(this));n.qr_div=function(e,t){var n=escape(e);for(;-1!=n.indexOf("/");)n=n.replace("/","%2f");e=document.createElement("div");return($qr=o(e)).css({background:"url('https://chart.apis.google.com/chart?cht=qr&chs="+t+"x"+t+"&chl="+n+"') no-repeat",width:t+"px",height:t+"px",display:"none","border-style":"solid","border-width":"1px",position:"absolute","z-index":"1000"}),o("body").append($qr),e}(n.attr("qrtarget"),t.size),n.mouseenter(function(e){n.qr_timeout_id=window.setTimeout(function(){o(n.qr_div).css({display:"block",top:e.pageY+5,left:e.pageX+15})},t.delay)}),n.mouseleave(function(e){null!=n.qr_timeout_id&&(window.clearTimeout(n.qr_timeout_id),n.qr_timeout_id=null),o(n.qr_div).css({display:"none"})})})}}(jQuery),function(A){"use strict";var S=A(document),T=".nui",a=A.fn.val,k=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},D=["noUi-target","noUi-base","noUi-origin","noUi-handle","noUi-horizontal","noUi-vertical","noUi-background","noUi-connect","noUi-ltr","noUi-rtl","noUi-dragable","","noUi-state-drag","","noUi-state-tap","noUi-active","noUi-extended","noUi-stacking"],e=["decimals","mark","thousand","prefix","postfix","encoder","decoder","negative","negativeBefore"],i=[2,".","","","",function(e){return e},function(e){return e},"-",""];function s(e){throw new RangeError("noUiSlider: "+e)}function t(e,t,n){(e[t]||e[n])&&e[t]===e[n]&&s("(Link) '"+t+"' can't match '"+n+"'.'")}function I(e){return Math.max(Math.min(e,100),0)}function u(e,t){return 100/(t-e)}function o(e){return"number"==typeof e&&!isNaN(e)&&isFinite(e)}function O(e,t,n){e.addClass(t),setTimeout(function(){e.removeClass(t)},n)}function l(e,t){return 100*t/(e[1]-e[0])}function C(e,t){if(t>=e.xVal.slice(-1)[0])return 100;for(var n,o,i,r,a,s=1;t>=e.xVal[s];)s++;return r=e.xVal[s-1],n=e.xVal[s],o=e.xPct[s-1],i=e.xPct[s],o+(a=t,l(r=[r,n],r[0]<0?a+Math.abs(r[0]):a-r[0])/u(o,i))}function B(e,t){for(var n,o,i=1;t>=e.xPct[i];)i++;return e.snap?(o=e.xPct[i-1],((n=e.xPct[i])-o)/2<t-o?n:o):e.xSteps[i-1]?e.xPct[i-1]+(n=t-e.xPct[i-1],o=e.xSteps[i-1],Math.round(n/o)*o):t}function r(n){"object"!=typeof(n=void 0===n?{}:n)&&s("(Format) 'format' option must be an object.");var o={};A(e).each(function(e,t){void 0===n[t]?o[t]=i[e]:typeof n[t]==typeof i[e]?("decimals"===t&&(n[t]<0||7<n[t])&&s("(Format) 'format.decimals' option must be between 0 and 7."),o[t]=n[t]):s("(Format) 'format."+t+"' must be a "+typeof i[e]+".")}),t(o,"mark","thousand"),t(o,"prefix","negative"),t(o,"prefix","negativeBefore"),this.settings=o}function c(e,t){if(!(this instanceof c))throw new Error("Link: Don't use Link as a function. Use the 'new' keyword.");if(!e)throw new RangeError("Link: missing parameters.");this.formatting=e.format||{},this.update=!t;var o=this,t=e.target||function(){},e=e.method,n="string"==typeof t&&0===t.indexOf("-tooltip-"),i="string"==typeof t&&0!==t.indexOf("-"),r="function"==typeof t,a=(a=t)instanceof A||A.zepto&&A.zepto.isZ(a),s=a&&t.is("input, select, textarea"),u=a&&"function"==typeof e,l=a&&"string"==typeof e&&t[e];if(n)return this.method=e||"html",void(this.el=A(t.replace("-tooltip-","")||"<div/>")[0]);if(i)return this.method="val",this.el=document.createElement("input"),this.el.name=t,void(this.el.type="hidden");if(r)return this.target=!1,void(this.method=t);if(a){if(e&&(u||l))return this.target=t,void(this.method=e);if(!e&&s)return this.method="val",this.target=t,void this.target.on("change",function(e){t=null,e=A(e.target).val();var t,n=[(n=o.N)?t:e,n?e:t];o.obj.val(n,{link:o})});if(!e&&!s)return this.method="html",void(this.target=t)}throw new RangeError("Link: Invalid Link.")}function d(e,t){o(t)||s("'step' is not numeric."),e.xSteps[0]=t}function p(n,e){"object"==typeof e&&!A.isArray(e)||s("'range' is not an object."),A.each(e,function(e,t){A.isArray(t="number"==typeof t?[t]:t)||s("'range' contains invalid value."),o(e="min"===e?0:"max"===e?100:parseFloat(e))&&o(t[0])||s("'range' value isn't numeric."),n.xPct.push(e),n.xVal.push(t[0]),e?n.xSteps.push(!isNaN(t[1])&&t[1]):isNaN(t[1])||(n.xSteps[0]=t[1])}),A.each(n.xSteps,function(e,t){if(!t)return!0;n.xSteps[e]=l([n.xVal[e],n.xVal[e+1]],t)/u(n.xPct[e],n.xPct[e+1])})}function _(e,t){A.isArray(t="number"==typeof t?[t]:t)&&t.length&&!(2<t.length)||s("'start' option is incorrect."),e.handles=t.length,e.start=t}function h(e,t){"boolean"!=typeof(e.snap=t)&&s("'snap' option must be a boolean.")}function f(e,t){"lower"===t&&1===e.handles?e.connect=1:"upper"===t&&1===e.handles?e.connect=2:!0===t&&2===e.handles?e.connect=3:!1===t?e.connect=0:s("'connect' option was doesn't match handle count.")}function m(e,t){switch(t){case"horizontal":e.ort=0;break;case"vertical":e.ort=1;break;default:s("'orientation' option is invalid.")}}function g(e,t){2<e.xPct.length&&s("'margin' option is only supported on linear sliders."),e.margin=l(e.xVal,t),o(t)||s("'margin' option must be numeric.")}function v(e,t){switch(t){case"ltr":e.dir=0;break;case"rtl":e.dir=1,e.connect=[0,2,1,3][e.connect];break;default:s("'direction' option was not recognized.")}}function b(e,t){"string"!=typeof t&&s("'behaviour' must be a string containing options.");var n=0<=t.indexOf("tap"),o=0<=t.indexOf("extend"),i=0<=t.indexOf("drag"),r=0<=t.indexOf("fixed"),t=0<=t.indexOf("snap");e.events={tap:n||t,extend:o,drag:i,fixed:r,snap:t}}function y(e,n,o){e.ser=[n.lower,n.upper],e.formatting=new r(n.format),A.each(e.ser,function(e,t){A.isArray(t)||s("'serialization."+(e?"upper":"lower")+"' must be an array."),A.each(t,function(){this instanceof c||s("'serialization."+(e?"upper":"lower")+"' can only contain Link instances."),this.N=e,this.obj=o,this.scope=this.scope||o,this.formatting=new r(A.extend({},n.format,this.formatting))})}),e.dir&&1<e.handles&&e.ser.reverse()}function E(e,t,n){var o,i,r,a=[];for(a.push(new c({format:n},!0)),o=0;o<e.length;o++)a.push((i=t,r=(r=e[o]).el?new c({target:A(r.el).clone().appendTo(i),method:r.method,format:r.formatting},!0):r));return a}function M(e,t){for(var n,o,i,r,a=[],s=0;s<e.handles;s++)a.push((n=e,o=s,r=i=void 0,i=A("<div><div/></div>").addClass(D[2]),r=["-lower","-upper"],n.dir&&r.reverse(),i.children().addClass(D[3]+" "+D[3]+r[o]),i.appendTo(t)));return a}function w(e,c,t){var n,o,d=A(e),s=[-1,-1];function u(){return g[["width","height"][c.ort]]()}function l(e){for(var t=[d.val()],n=0;n<e.length;n++)d.trigger(e[n],t)}function p(e,t,n){var o=e[0]!==v[0][0]?1:0,i=s[0]+c.margin,r=s[1]-c.margin;return(t=n&&1<v.length?o?Math.max(t,i):Math.min(t,r):t)<100&&(t=B(c,t)),(t=I(parseFloat(t.toFixed(7))))===s[o]?1!==v.length&&((t===i||t===r)&&0):(e.css(c.style,t+"%"),e.is(":first-child")&&e.toggleClass(D[17],50<t),s[o]=t,c.dir&&(t=100-t),A(b[o]).each(function(){this.write(c,t,e.children(),d)}),!0)}function i(e,t,n){n||O(d,D[14],300),p(e,t,!1),l(["slide","set","change"])}function r(e,t,u,l){e=e.replace(/\s/g,T+" ")+T,t.on(e,function(e){var t,n,o,i,r,a,s=!(null==(s=d.attr("disabled")));if(d.hasClass(D[14])||s)return!1;(s=e).preventDefault(),o=0===s.type.indexOf("touch"),i=0===s.type.indexOf("mouse"),r=0===s.type.indexOf("pointer"),0===(a=s).type.indexOf("MSPointer")&&(r=!0),s.originalEvent&&(s=s.originalEvent),o&&(t=s.changedTouches[0].pageX,n=s.changedTouches[0].pageY),(i||r)&&(r||void 0!==window.pageXOffset||(window.pageXOffset=document.documentElement.scrollLeft,window.pageYOffset=document.documentElement.scrollTop),t=s.clientX+window.pageXOffset,n=s.clientY+window.pageYOffset),a.points=[t,n],a.cursor=i,(e=a).calcPoint=e.points[c.ort],u(e,l)})}function a(e,t){var n,o,i=t.handles||v,r=!1,e=100*(e.calcPoint-t.start)/u(),a=i[0][0]!==v[0][0]?1:0;e=e,t=t.positions,n=1<i.length,o=e+t[0],e+=t[1],t=n?(o<0&&(e+=Math.abs(o)),100<e&&(o-=e-100),[I(o),I(e)]):[o,e],r=p(i[0],t[a],1===i.length),(r=1<i.length?p(i[1],t[a?0:1],!1)||r:r)&&l(["slide"])}function _(e){A("."+D[15]).removeClass(D[15]),e.cursor&&A("body").css("cursor","").off(T),S.off(T),d.removeClass(D[12]),l(["set","change"])}function h(e,t){1===t.handles.length&&t.handles[0].children().addClass(D[15]),e.stopPropagation(),r(k.move,S,a,{start:e.calcPoint,handles:t.handles,positions:[s[0],s[v.length-1]]}),r(k.end,S,_,null),e.cursor&&(A("body").css("cursor",A(e.target).css("cursor")),1<v.length&&d.addClass(D[12]),A("body").on("selectstart"+T,!1))}function f(e){var t=e.calcPoint,n=0;e.stopPropagation(),A.each(v,function(){n+=this.offset()[c.style]}),n=t<n/2||1===v.length?0:1,t=100*(t-=g.offset()[c.style])/u(),i(v[n],t,c.events.snap),c.events.snap&&h(e,{handles:[v[n]]})}function m(e){var t=(e=e.calcPoint<g.offset()[c.style])?0:100,e=e?0:v.length-1;i(v[e],t,!1)}if(!d.is(":empty"))throw new Error("Slider was already initialized.");(y=d).addClass([D[0],D[8+c.dir],D[4+c.ort]].join(" "));var g=A("<div/>").appendTo(y).addClass(D[1]),v=M(c,g),b=function(e,t){for(var n=[],o=0;o<e.handles;o++)n[o]=E(e.ser[o],t[o].children(),e.formatting);return n}(c,v),y=c.connect,w=d,x=v;switch(y){case 1:w.addClass(D[7]),x[0].addClass(D[6]);break;case 3:x[1].addClass(D[6]);case 2:x[0].addClass(D[7]);case 0:w.addClass(D[6])}y=c.events;if(!y.fixed)for(n=0;n<v.length;n++)r(k.start,v[n].children(),h,{handles:[v[n]]});y.tap&&r(k.start,g,f,{handles:v}),y.extend&&(d.addClass(D[16]),y.tap&&r(k.start,d,m,{handles:v})),y.drag&&(o=g.find("."+D[7]).addClass(D[10]),y.fixed&&(o=o.add(g.children().not(o).children())),r(k.start,o,h,{handles:v})),e.vSet=function(e,t,n,o,i){var r,a;for(c.dir&&1<c.handles&&e.reverse(),i&&O(d,D[14],300),r=0;r<(1<v.length?3:1);r++)!1!==(a=(a=n||b[r%2][0]).valueOf(e[r%2]))&&(a=C(c,a),c.dir&&(a=100-a),!0!==p(v[r%2],a,!0)&&A(b[r%2]).each(function(){this.write(c,s[r%2],v[r%2].children(),d,o)}));return!0===t&&l(["set"]),this},e.vGet=function(){for(var e=[],t=0;t<c.handles;t++)e[t]=b[t][0].saved;return 1===e.length?e[0]:c.dir&&1<c.handles?e.reverse():e},e.destroy=function(){return A.each(b,function(){A.each(this,function(){this.target&&this.target.off(T)})}),A(this).off(T).removeClass(D.join(" ")).empty(),t},d.val(c.start)}function n(e){this.length||s("Can't initialize slider on empty selection.");n=e,o=this,t={step:{r:!(i={xPct:[],xVal:[],xSteps:[!1],margin:0}),t:d},range:{r:!0,t:p},start:{r:!0,t:_},snap:{r:!1,t:h},connect:{r:!0,t:f},orientation:{r:!1,t:m},margin:{r:!1,t:g},direction:{r:!0,t:v},behaviour:{r:!0,t:b},serialization:{r:!0,t:y}},(n=A.extend({connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal"},n)).serialization=A.extend({lower:[],upper:[],format:{}},n.serialization),A.each(t,function(e,t){if(void 0===n[e]){if(!t.r)return!0;s("'"+e+"' is required.")}t.t(i,n[e],o)}),i.style=i.ort?"top":"left";var n,o,i,t,r=i;return this.each(function(){w(this,r,e)})}r.prototype.v=function(e){return this.settings[e]},r.prototype.to=function(e){function t(e){return e.split("").reverse().join("")}var n="",o="",i="",r="";return(e=this.v("encoder")(e))<0&&(n=this.v("negative"),o=this.v("negativeBefore")),e=(e=Math.abs(e).toFixed(this.v("decimals")).toString()).split("."),0===parseFloat(e)&&(e[0]="0"),i=this.v("thousand")?(i=t(e[0]).match(/.{1,3}/g),t(i.join(t(this.v("thousand"))))):e[0],this.v("mark")&&1<e.length&&(r=this.v("mark")+e[1]),o+this.v("prefix")+n+i+r+this.v("postfix")},r.prototype.from=function(e){function t(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}var n;return null!=e&&(n=(e=e.toString()).replace(new RegExp("^"+t(this.v("negativeBefore"))),""),n=e!==n?(e=n,"-"):"",e=e.replace(new RegExp("^"+t(this.v("prefix"))),""),this.v.negative&&(n="",e=e.replace(new RegExp("^"+t(this.v("negative"))),"-")),e=e.replace(new RegExp(t(this.v("postfix"))+"$"),"").replace(new RegExp(t(this.v("thousand")),"g"),"").replace(this.v("mark"),"."),e=this.v("decoder")(parseFloat(n+e)),!isNaN(e)&&e)},c.prototype.write=function(e,t,n,o,i){this.update&&!1===i||(t=function(e,t){if(100<=t)return e.xVal.slice(-1)[0];for(var n,o,i,r,a=1;t>=e.xPct[a];)a++;return n=e.xVal[a-1],o=e.xVal[a],r=e.xPct[a-1],i=e.xPct[a],(t-r)*u(r,i)*((r=[n,o])[1]-r[0])/100+r[0]}(e,t),t=this.format(t),this.saved=t,"function"==typeof this.method?this.method.call(this.target[0]||o[0],t,n,o):this.target[this.method](t,n,o))},c.prototype.format=function(e){return this.formatting.to(e)},c.prototype.valueOf=function(e){return this.formatting.from(e)},A.noUiSlider={Link:c},A.fn.noUiSlider=function(e,t){return(t?function(o){return this.each(function(){var e=A(this).val(),t=this.destroy(),n=A.extend({},t,o);A(this).noUiSlider(n),t.start===n.start&&A(this).val(e)})}:n).call(this,e)},A.fn.val=function(){var t,n,o,i,r=Array.prototype.slice.call(arguments,0);return r.length?("object"==typeof r[1]?(t=r[1].set,n=r[1].link,o=r[1].update,i=r[1].animate):!0===r[1]&&(t=!0),this.each(function(){var e;A(this).hasClass(D[0])?this.vSet((e=r[0],A.isArray(e)?e:[e]),t,n,o,i):a.apply(A(this),r)})):this.hasClass(D[0])?this[0].vGet():a.apply(this)}}(window.jQuery||window.Zepto),window.requestAnimationFrame||(window.requestAnimationFrame=window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e,t){window.setTimeout(e,1e3/60)}),function(){window.visibly={b:null,q:document,p:void 0,prefixes:["webkit","ms"],props:["VisibilityState","visibilitychange","Hidden"],m:["focus","blur"],visibleCallbacks:[],hiddenCallbacks:[],_callbacks:[],onVisible:function(e){this.visibleCallbacks.push(e)},onHidden:function(e){this.hiddenCallbacks.push(e)},isSupported:function(){return this._supports(0)||this._supports(1)},_supports:function(e){return this.prefixes[e]+this.props[2]in this.q},runCallbacks:function(e){if(e){this._callbacks=1==e?this.visibleCallbacks:this.hiddenCallbacks;for(var t=0;t<this._callbacks.length;t++)this._callbacks[t]()}},_visible:function(){window.visibly.runCallbacks(1)},_hidden:function(){window.visibly.runCallbacks(2)},_nativeSwitch:function(){!0===this.q[this.b+this.props[2]]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?(this.b=this._supports(0)==this.p?this.prefixes[1]:this.prefixes[0],this.q.addEventListener(this.b+this.props[1],function(){window.visibly._nativeSwitch.apply(window.visibly,arguments)},1)):document.addEventListener?(window.addEventListener(this.m[0],this._visible,1),window.addEventListener(this.m[1],this._hidden,1)):(this.q.attachEvent("onfocusin",this._visible),this.q.attachEvent("onfocusout",this._hidden))}catch(e){}},init:function(){this.listen()}},this.visibly.init()}(),function(e,t){"function"==typeof define&&define.amd?define([],t):"undefined"!=typeof module&&module.exports?module.exports=t():e.ReconnectingWebSocket=t()}(this,function(){function c(i,r){r=r||[],this.debug=!1,this.reconnectInterval=1e3,this.reconnectDecay=1.5,this.reconnectAttempts=0,this.timeoutInterval=2e3;var a,s=this,u=!1,l=!1;this.url=i,this.protocols=r,this.readyState=WebSocket.CONNECTING,this.URL=i,this.onopen=function(e){},this.onclose=function(e){},this.onconnecting=function(e){},this.onmessage=function(e){},function t(n){a=new WebSocket(i,r),s.onconnecting(),(s.debug||c.debugAll)&&console.debug("ReconnectingWebSocket","attempt-connect",i);var e=a,o=setTimeout(function(){(s.debug||c.debugAll)&&console.debug("ReconnectingWebSocket","connection-timeout",i),l=!0,e.close(),l=!1},s.timeoutInterval);a.onopen=function(e){clearTimeout(o),(s.debug||c.debugAll)&&console.debug("ReconnectingWebSocket","onopen",i),s.readyState=WebSocket.OPEN,n=!1,s.reconnectAttempts=0,s.onopen(e)},a.onclose=function(e){clearTimeout(o),a=null,u?(s.readyState=WebSocket.CLOSED,s.onclose(e)):(s.readyState=WebSocket.CONNECTING,s.onconnecting(),n||l||((s.debug||c.debugAll)&&console.debug("ReconnectingWebSocket","onclose",i),s.onclose(e)),setTimeout(function(){s.reconnectAttempts++,t(!0)},s.reconnectInterval*Math.pow(s.reconnectDecay,s.reconnectAttempts)))},a.onmessage=function(e){(s.debug||c.debugAll)&&console.debug("ReconnectingWebSocket","onmessage",i,e.data),s.onmessage(e)},a.onerror=function(e){(s.debug||c.debugAll)&&console.debug("ReconnectingWebSocket","onerror",i,e),s.onerror(e)}}(!(this.onerror=function(e){})),this.send=function(e){if(a)return(s.debug||c.debugAll)&&console.debug("ReconnectingWebSocket","send",i,e),a.send(e);throw"INVALID_STATE_ERR : Pausing to reconnect websocket"},this.close=function(){u=!0,a&&a.close()},this.refresh=function(){a&&a.close()}}return c.debugAll=!1,c}),extend(Floatable,Block),Floatable.prototype.updateContainerSize=function(){this.pageDivWidth=$(this.pageDiv).width(),this.pageDivHeight=$(this.pageDiv).height()},Floatable.prototype.update=function(e){e/=50;this.x+=this.velocity.x*e,this.y+=this.velocity.y*e,this.velocity.x+=(.1*Math.random()-.05)*e,1<this.velocity.x?this.velocity.x=1:this.velocity.x<-1&&(this.velocity.x=-1),this.x<0?this.velocity.x+=.005*e:this.x>this.pageDivWidth-this.width&&(this.velocity.x-=.005*e),this.updateDiv(),this.y<-this.height&&this.removeSelf()},Floatable.prototype.updateDiv=function(){this.div.style["-webkit-transform"]="translate("+this.x+"px,"+this.y+"px)",this.div.style.transform="translate("+this.x+"px,"+this.y+"px)"},Floatable.prototype.removeSelf=function(){this.pageDiv.removeChild(this.div),updateTargets.splice(updateTargets.indexOf(this),1)},Floatable.prototype.addImage=function(e,t,n){this.canvas=document.createElement("canvas"),this.image=e,this.canvas.height=n,this.canvas.width=t,this.canvas.style.position="absolute",this.canvas.style.top="0px",this.canvas.style.left="0px",this.canvas.getContext("2d").drawImage(this.image,0,0,t-1,n-1),this.div.appendChild(this.canvas)},Floatable.prototype.addText=function(e){this.innerDiv.innerHTML+=e},Floatable.prototype.initPosition=function(){this.x=Math.random()*(this.pageDivWidth-this.width),this.y=this.pageDivHeight,this.updateDiv(),this.div.style.width=this.width+"px",this.div.style.height=this.height+"px",this.innerDiv.style.top=this.height/2-this.innerDiv.offsetHeight/2+"px"};var DONATION_ADDRESS,SOUND_DONATION_ADDRESS,debugSpawner,rateboxTimeout,currentExchange,easterSuccess=function(){var t=new Floatable;t.width=53,t.height=48,t.image=document.createElement("img"),t.image.src="images/easteregg.gif",t.image.height=t.height,t.image.width=t.width,t.image.style.position="absolute",t.image.style.top="0px",t.image.style.left="0px",t.div.appendChild(t.image),t.initPosition(),t.update=function(e){Floatable.prototype.update.call(t,e),t.velocity.x+=.3*Math.random()-.15,.1<t.velocity.x&&$(t.image).css({"-moz-transform":"scaleX(-1)","-o-transform":"scaleX(-1)","-webkit-transform":"scaleX(-1)",transform:"scaleX(-1)"}),t.velocity.x<-.1&&$(t.image).css({"-moz-transform":"scaleX(1)","-o-transform":"scaleX(1)","-webkit-transform":"scaleX(1)",transform:"scaleX(1)"})}},DEBUG_MODE=(new Konami(easterSuccess),!1),globalMute=!1,instanceId=0,pageDivId="pageDiv",last_update=0,updateTargets=[],transaction_count=0,bubbleImage=new Image,blockImage=(bubbleImage.src="images/bubble.png",new Image),updateLayoutWidth=(blockImage.src="images/block.png",function(){$(".chartMask").css("visibility","visible")}),updateLayoutHeight=function(){var e=window.innerHeight;"none"!=$("#header").css("display")&&(e-=$("#header").outerHeight()),$("#pageSplitter").height(e)},toggleInterface=($(document).ready(function(){prevChartWidth=$("#pageSplitter").width()/2,$("#chartCell").hide(),DONATION_ADDRESS=$("#donationAddress").html(),$("#noJavascript").css("display","none"),updateLayoutHeight(),StatusBox.init(DEBUG_MODE),$(".clickSuppress").click(function(){$(".clickSuppress").parent().slideUp(300)}),debugSpawner=function(){var e;Math.random()<=.1&&(e=(e=Math.random())<.6?Math.random():e<.8?10*Math.random():e<.95?100*Math.random():1e3*Math.random(),Math.random()<.5?new Transaction(e,!1):new Transaction(e,!1,75*e,"USD"))},switchExchange("coinbase"),$("#donationAddress").qr()}),function(){0===$(".interface:hidden").length?($(".interface").fadeOut(500,updateLayoutHeight),$("#hideInterface").html("[ Show Interface ]"),$("#hideInterface").css("opacity","0.5")):($(".interface").fadeIn(500),$("#hideInterface").html("[ Hide Interface ]"),$("#hideInterface").css("opacity","1"),updateLayoutHeight())}),globalUpdate=function(e){window.requestAnimationFrame(globalUpdate);var t=e-last_update;last_update=e;for(var n=0;n<updateTargets.length;n++)updateTargets[n].update(t)},endResize=($(window).bind("load",function(){DEBUG_MODE?setInterval(debugSpawner,100):($("#blockchainCheckBox").prop("checked")&&TransactionSocket.init(),$("#mtgoxCheckBox").prop("checked")&&TradeSocket.init()),window.requestAnimationFrame(globalUpdate),Sound.loadup(),Sound.init()}),function(){$(".chartMask").css("visibility","hidden");for(var e=0;e<updateTargets.length;e++)updateTargets[e].updateContainerSize()}),hideChart=function(){$("#chartElement").hide(),$("#showChart").show(),prevChartWidth=$("#chartCell").width(),$("#chartCell").width(0),$("#chartCell").hide(),$("#pageSplitter").colResizable({disable:!0})},showChart=function(){$("#chartElement").show(),$("#showChart").hide(),$("#chartCell").width(prevChartWidth),$("#chartCell").show(),$(window).trigger("resize"),0===$("#bitcoinChart").length&&$("#chartHolder").html('<iframe id="bitcoinChart" scrolling="no" frameBorder="0" src="http://bitcoin.clarkmoody.com/widget/chart/zeroblock/"></iframe>'),$("#pageSplitter").colResizable({liveDrag:!0,onDrag:updateLayoutWidth,onResize:endResize})},ratebox_ms=($(window).resize(function(){updateLayoutHeight()}),window.onbeforeunload=function(e){clearInterval(globalUpdate),TransactionSocket.close(),TradeSocket.close()},1e4),globalRate=-1;function setGlobalRate(e){var t;-1===globalRate&&((t=$("#showDollarCheckBox")).prop("disabled",!1),t.parent().removeClass("disabled")),$("#rate").html(parseFloat(e).toFixed(2)),globalRate=e}rateboxGetRate=function(){$.ajax({dataType:"json",cache:!1,url:"https://api.coinbase.com/v2/prices/BTC-USD/buy",success:function(e){setGlobalRate(e.data.amount),rateboxTimeout=setTimeout(rateboxGetRate,ratebox_ms)}})},switchExchange=function(e){clearTimeout(rateboxTimeout),currentExchange=e,$("#rate").html("---"),"coinbase"==e&&$("#coinbaseRate").css("color","white"),rateboxGetRate()};var satoshi=1e8,DELAY_CAP=2e4,lastBlockHeight=0,provider_name="blockchain.info",transactionSocketDelay=1e3;function TransactionSocket(){}TransactionSocket.init=function(){var e;TransactionSocket.connection&&TransactionSocket.connection.close(),"WebSocket"in window?(e=new ReconnectingWebSocket("wss://ws.blockchain.info/inv"),TransactionSocket.connection=e,StatusBox.reconnecting("blockchain"),e.onopen=function(){console.log("Blockchain.info: Connection open!"),StatusBox.connected("blockchain");e.send(JSON.stringify({op:"unconfirmed_sub"})),e.send(JSON.stringify({op:"blocks_sub"})),e.send(JSON.stringify({op:"ping_tx"}))},e.onclose=function(){console.log("Blockchain.info: Connection closed"),$("#blockchainCheckBox").prop("checked")?StatusBox.reconnecting("blockchain"):StatusBox.closed("blockchain")},e.onerror=function(e){console.log("Blockchain.info: Connection Error: "+e)},e.onmessage=function(e){var t,n,o,i=JSON.parse(e.data);if("no_data"==i.op&&(TransactionSocket.close(),setTimeout(TransactionSocket.init,transactionSocketDelay),transactionSocketDelay*=2,console.log("connection borked, reconnecting")),"utx"==i.op){for(var r=0,a=0;a<i.x.out.length;a++)r+=i.x.out[a].value;for(var s=r/satoshi,u=i.x.out,l=0;l<u.length;l++)if(u[l].addr==DONATION_ADDRESS)return void new Transaction(s=i.x.out[l].value/satoshi,!0);0===transaction_count?new Transaction(s):setTimeout(function(){new Transaction(s)},Math.random()*DELAY_CAP)}else"block"==i.op&&(e=i.x.height,t=i.x.nTx,n=i.x.estimatedBTCSent,o=i.x.size,lastBlockHeight<e&&(lastBlockHeight=e,console.log("New Block"),new Block(e,t,n,o)))}):(console.log("No websocket support."),StatusBox.nosupport("blockchain"))},TransactionSocket.close=function(){TransactionSocket.connection&&TransactionSocket.connection.close(),StatusBox.closed("blockchain")};var globalScalePitch,globalBank,globalVolume=50,globalShowDollar=!1,globalAudioUnlocked=!1;function Sound(){}Howler.volume(.01*globalVolume),document.addEventListener("DOMContentLoaded",function(e){document.body.addEventListener("click",function(){document.getElementById("waitingForTransactions").style.opacity="0"},!0)});var soundBank=[];function zeroPad(e,t){t=t-e.toString().length+1;return Array(+(0<t&&t)).join("0")+e}soundBank[0]=["celesta",22],soundBank[1]=["planet",33],soundBank[2]=["wikki",13],Sound.loadup=function(){sound0=[],sound1=[],sound2=[],swells0=[],swells1=[],swells2=[]},Sound.init=function(){$("#volumeControl").click(function(){globalMute?(globalMute=!1,Howler.mute(!1),$("#volumeControl").css("background-position","0 -46px")):(globalMute=!0,Howler.mute(),$("#volumeControl").css("background-position","0 0"))}),$("#volumeSlider").noUiSlider({range:{min:0,max:100},start:50,handles:1,step:1,orientation:"vertical"}).on("slide",function(){globalVolume=100-$(this).val(),Howler.volume(.01*globalVolume)}),globalScalePitch=$("#scalePitchCheckBox").attr("checked"),Sound.change(0)},Sound.change=function(e){var t="Donate to instrument creator: ";if(0===e){if(0===sound0.length)for(var n=!0,o=1;o<=22;o++)istring=zeroPad(o,3),newSound=new Howl({src:["sounds/celesta/celesta"+istring+".ogg","sounds/celesta/celesta"+istring+".mp3"],autoplay:!1}),n&&(n=!1,newSound.once("unlock",function(){globalAudioUnlocked=!0})),sound0.push(newSound);if(0===swells0.length)for(o=1;o<=3;o++)newSound=new Howl({src:["sounds/swells0/swell"+o+".ogg","sounds/swells0/swell"+o+".mp3"],autoplay:!1}),swells0.push(newSound);currentSound=sound0,currentSwells=swells0,$("#musicianDonation").text("")}else if(1===e){if(0===sound1.length)for(o=1;o<=33;o++)istring=zeroPad(o,3),newSound=new Howl({src:["sounds/planet/planet"+istring+".ogg","sounds/planet/planet"+istring+".mp3"],autoplay:!1}),sound1.push(newSound);if(0===swells1.length)for(o=1;o<=3;o++)newSound=new Howl({urls:["sounds/swells1/planetswell"+o+".ogg","sounds/swells1/planetswell"+o+".mp3"],autoplay:!1}),swells1.push(newSound);currentSound=sound1,currentSwells=swells1,SOUND_DONATION_ADDRESS="144b31mmaWQVDQFiUPo6HEzxc2Dm83WXrW",$("#musicianDonation").html(t+"<span>"+SOUND_DONATION_ADDRESS+"</span>")}else if(2===e){if(0===sound2.length)for(o=1;o<=13;o++)istring=zeroPad(o,3),newSound=new Howl({src:["sounds/wikki/wikki"+istring+".ogg","sounds/wikki/wikki"+istring+".mp3"],autoplay:!1}),sound2.push(newSound);if(0===swells2.length)for(o=1;o<=3;o++)newSound=new Howl({src:["sounds/swells2/wikkiswell"+o+".ogg","sounds/swells2/wikkiswell"+o+".mp3"],autoplay:!1}),swells2.push(newSound);currentSound=sound2,currentSwells=swells2,SOUND_DONATION_ADDRESS="1JFaYRGkDmhpSTbFKwqDWKr2ncvvrgYEAV",$("#musicianDonation").html(t+"<span>"+SOUND_DONATION_ADDRESS+"</span>")}};var currentNotes=0,noteTimeout=500,lastBlockSound=(Sound.playRandomAtVolume=function(e){var t;globalMute||(t=Math.floor(100*Math.random()),Sound.playPitchAtVolume(e,t))},Sound.playPitchAtVolume=function(e,t){globalMute||(t=Math.floor(t/100*currentSound.length),t+=Math.floor(4*Math.random())-2,t=Math.min(currentSound.length-1,t),t=Math.max(0,t),currentNotes<5&&(currentSound[t].volume(e),globalAudioUnlocked&¤tSound[t].play(),currentNotes++,setTimeout(function(){currentNotes--},noteTimeout)))},-1),CONNECTED=(Sound.playRandomSwell=function(){if(!globalMute){for(var e;(e=Math.floor(Math.random()*currentSwells.length))==lastBlockSound;);lastBlockSound=e,globalAudioUnlocked&¤tSwells[e].play()}},"Connected."),CONNECTING="Connecting...",NO_SUPPORT="No browser support.",CLOSED="Click to connect.",provider_name="blockchain.info";function StatusBox(){}StatusBox.init=function(e){StatusBox.blockchain=$("#blockchainStatus"),StatusBox.mtgox=$("#mtgoxStatus"),e&&(StatusBox.blockchain.html(""),StatusBox.mtgox.html("Debug mode.")),$("#blockchainCheckBox").is(":checked")?StatusBox.reconnecting("blockchain"):StatusBox.closed("blockchain"),$("#mtgoxCheckBox").is(":checked")?StatusBox.reconnecting("mtgox"):StatusBox.closed("mtgox")},StatusBox.connected=function(e){"blockchain"==e&&StatusBox.blockchain.html("Transactions ("+provider_name+'): <span style="color: green;">'+CONNECTED+"</span>"),"mtgox"==e&&StatusBox.mtgox.html('Mt.Gox Trades: <span style="color: green;">'+CONNECTED+"</span>")},StatusBox.reconnecting=function(e){"blockchain"==e&&StatusBox.blockchain.html("Transactions ("+provider_name+'): <span style="color: yellow;">'+CONNECTING+"</span>"),"mtgox"==e&&StatusBox.mtgox.html('Mt.Gox Trades: <span style="color: yellow;">'+CONNECTING+"</span>")},StatusBox.nosupport=function(e){"blockchain"==e&&StatusBox.blockchain.html("Transactions ("+provider_name+'): <span style="color: red;">'+NO_SUPPORT+"</span>"),"mtgox"==e&&StatusBox.mtgox.html('Mt.Gox Trades: <span style="color: red;">'+NO_SUPPORT+"</span>")},StatusBox.closed=function(e){"blockchain"==e&&StatusBox.blockchain.html("Transactions ("+provider_name+'): <span style="color: gray;">'+CLOSED+"</span>"),"mtgox"==e&&StatusBox.mtgox.html('Mt.Gox Trades: <span style="color: gray;">'+CLOSED+"</span>")};const currencyFormatter=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0,maximumFractionDigits:0});function Transaction(e,t,n,o){var i;"visible"===document.visibilityState&&(Floatable.call(this),this.area=100*e+3e3,this.width=this.height=2*Math.sqrt(this.area/Math.PI),this.addImage(bubbleImage,this.width,this.height),i=e.toFixed(2),i=!0===globalShowDollar?currencyFormatter.format(e*globalRate):"0.00"===i?"<<span class='bitcoinsymbol'>B</span>0.01":"<span class='bitcoinsymbol'>B</span>"+i,t?this.addText('<span style="color: yellow;">'+i+'</span><br /><span style="color: cyan;">Donation</span><br /><span style="color: lime;">Thanks!</span>'):this.addText(i),n&&o&&this.addText("<br />"+n.toFixed(2)+" "+o),this.initPosition(),.7<(t=e/2500+.3)&&(t=.7),i=1.0715307808111487,n=100-(n=Math.min(100,Math.log(e+i)/Math.log(i))),globalScalePitch?Sound.playPitchAtVolume(t,n):Sound.playRandomAtVolume(t),transaction_count++)}extend(Floatable,Transaction);
//# sourceMappingURL=bitlisten.min.js.map