text: !function(t,e,n){"use strict";function r(t){t&&(t.setTargetAtTime||(t.setTargetAtTime=t.setTargetValueAtTime))}window.hasOwnProperty("webkitAudioContext")&&!window.hasOwnProperty("AudioContext")&&(window.AudioContext=webkitAudioContext,AudioContext.prototype.hasOwnProperty("createGain")||(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),AudioContext.prototype.hasOwnProperty("createDelay")||(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode),AudioContext.prototype.hasOwnProperty("createScriptProcessor")||(AudioContext.prototype.createScriptProcessor=AudioContext.prototype.createJavaScriptNode),AudioContext.prototype.hasOwnProperty("createPeriodicWave")||(AudioContext.prototype.createPeriodicWave=AudioContext.prototype.createWaveTable),AudioContext.prototype.internal_createGain=AudioContext.prototype.createGain,AudioContext.prototype.createGain=function(){var t=this.internal_createGain();return r(t.gain),t},AudioContext.prototype.internal_createDelay=AudioContext.prototype.createDelay,AudioContext.prototype.createDelay=function(t){var e=t?this.internal_createDelay(t):this.internal_createDelay();return r(e.delayTime),e},AudioContext.prototype.internal_createBufferSource=AudioContext.prototype.createBufferSource,AudioContext.prototype.createBufferSource=function(){var t=this.internal_createBufferSource();return t.start?(t.internal_start=t.start,t.start=function(e,n,r){"undefined"!=typeof r?t.internal_start(e||0,n,r):t.internal_start(e||0,n)}):t.start=function(t,e,n){e||n?this.noteGrainOn(t||0,e,n):this.noteOn(t||0)},t.stop?(t.internal_stop=t.stop,t.stop=function(e){t.internal_stop(e||0)}):t.stop=function(t){this.noteOff(t||0)},r(t.playbackRate),t},AudioContext.prototype.internal_createDynamicsCompressor=AudioContext.prototype.createDynamicsCompressor,AudioContext.prototype.createDynamicsCompressor=function(){var t=this.internal_createDynamicsCompressor();return r(t.threshold),r(t.knee),r(t.ratio),r(t.reduction),r(t.attack),r(t.release),t},AudioContext.prototype.internal_createBiquadFilter=AudioContext.prototype.createBiquadFilter,AudioContext.prototype.createBiquadFilter=function(){var t=this.internal_createBiquadFilter();return r(t.frequency),r(t.detune),r(t.Q),r(t.gain),t},AudioContext.prototype.hasOwnProperty("createOscillator")&&(AudioContext.prototype.internal_createOscillator=AudioContext.prototype.createOscillator,AudioContext.prototype.createOscillator=function(){var t=this.internal_createOscillator();return t.start?(t.internal_start=t.start,t.start=function(e){t.internal_start(e||0)}):t.start=function(t){this.noteOn(t||0)},t.stop?(t.internal_stop=t.stop,t.stop=function(e){t.internal_stop(e||0)}):t.stop=function(t){this.noteOff(t||0)},t.setPeriodicWave||(t.setPeriodicWave=t.setWaveTable),r(t.frequency),r(t.detune),t})),window.hasOwnProperty("webkitOfflineAudioContext")&&!window.hasOwnProperty("OfflineAudioContext")&&(window.OfflineAudioContext=webkitOfflineAudioContext)}(window),function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(t,e,n){var r=t("underscore"),i=t("pd-fileutils"),o=t("./lib/core/Patch"),a=t("./lib/core/PdObject"),s=t("./lib/core/utils"),u=t("./lib/objects/portlets"),c=t("./lib/waa"),l=t("./lib/global"),f=t("./lib/core/interfaces"),h=r.extend({},s.UniqueIdsMixin);t("./lib/objects").declareObjects(l.library);var p=e.exports={getSampleRate:function(){return l.settings.sampleRate},start:function(t){if(t=t||{},!l.isStarted){"undefined"!=typeof AudioContext?(l.audio=t.audio||new c.Audio({channelCount:l.settings.channelCount,audioContext:t.audioContext}),l.clock=t.clock||new c.Clock({audioContext:l.audio.context,waaClock:t.waaClock})):(l.audio=t.audio||f.Audio,l.clock=t.clock||f.Clock),l.storage=t.storage?t.storage:"undefined"!=typeof window?new c.Storage:f.Storage,l.audio.start();for(var e in l.patches)l.patches[e].start();l.isStarted=!0}},stop:function(){if(l.isStarted){l.isStarted=!1;for(var t in l.patches)l.patches[t].stop();l.audio.stop()}},isStarted:function(){return l.isStarted},send:function(t,e){l.emitter.emit("msg:"+t,e)},receive:function(t,e){l.emitter.on("msg:"+t,e)},registerAbstraction:function(t,e){r.isString(e)&&(e=i.parse(e));var n=function(t,n,r){var t=new o(t,n,r);return p._preparePatch(t,e),t};n.prototype=o.prototype,l.library[t]=n},createPatch:function(){var t=this._createPatch();return l.isStarted&&t.start(),t},destroyPatch:function(t){t.stop(),t.destroy(),delete l.patches[t.patchId]},loadPatch:function(t){var e=this._createPatch();return r.isString(t)&&(t=i.parse(t)),this._preparePatch(e,t),l.isStarted&&e.start(),e},_createPatch:function(){var t=new o;return t.patchId=h._generateId(),l.patches[t.patchId]=t,t},_preparePatch:function(t,e){var n={};e.nodes.forEach(function(e){var r,i=e.proto;if("graph"===i){var o=e.subpatch.nodes[0];r=t._createObject("array",o.args||[]),r.setData(new Float32Array(o.data),!0),i="array"}else r=t._createObject(i,e.args||[]);"pd"===i&&p._preparePatch(r,e.subpatch),n[e.id]=r}),e.connections.forEach(function(t){var e=n[t.source.id],r=n[t.sink.id];if(!e||!r)throw new Error("invalid connection");e.o(t.source.port).connect(r.i(t.sink.port))})},core:{PdObject:a,portlets:u},_glob:l};"undefined"!=typeof window&&(window.Pd=p)},{"./lib/core/Patch":3,"./lib/core/PdObject":4,"./lib/core/interfaces":5,"./lib/core/utils":8,"./lib/global":9,"./lib/objects":13,"./lib/objects/portlets":14,"./lib/waa":18,"pd-fileutils":62,underscore:70}],2:[function(t,e,n){var r=t("underscore"),i=(t("util").inherits,t("./portlets"),t("./utils"),e.exports=function(t,e,n){n=n||[];var r=this;this.id=e,this.patch=t,this.inlets=this.inletDefs.map(function(t,e){return new t(r,e)}),this.outlets=this.outletDefs.map(function(t,e){return new t(r,e)}),this.init(n)});r.extend(i.prototype,{endPoint:!1,doResolveArgs:!1,outletDefs:[],inletDefs:[],init:function(){},start:function(){},stop:function(){},destroy:function(){},i:function(t){if(t<this.inlets.length)return this.inlets[t];throw new Error("invalid inlet "+t)},o:function(t){if(t<this.outlets.length)return this.outlets[t];throw new Error("invalid outlet "+t)},startPortlets:function(){this.outlets.forEach(function(t){t.start()}),this.inlets.forEach(function(t){t.start()})},stopPortlets:function(){this.outlets.forEach(function(t){t.stop()}),this.inlets.forEach(function(t){t.stop()})}})},{"./portlets":7,"./utils":8,underscore:70,util:29}],3:[function(t,e,n){var r=t("underscore"),i=t("events").EventEmitter,o=t("./utils"),a=t("./BaseNode"),s=t("../global"),u=e.exports=function(){a.apply(this,arguments),this.objects=[],this.endPoints=[],this.patchId=null,this.sampleRate=s.settings.sampleRate,this.blockSize=s.settings.blockSize};r.extend(u.prototype,a.prototype,o.UniqueIdsMixin,i.prototype,{type:"patch",init:function(t){this.args=t},start:function(){this._startStopGeneric("start","startPortlets"),this.emit("started")},stop:function(){this._startStopGeneric("stop","stopPortlets"),this.emit("stopped")},destroy:function(){this.objects.forEach(function(t){t.destroy()})},_startStopGeneric:function(t,e){var n=function(e){e instanceof u?(r.push(e),e.objects.forEach(n)):e[t]()},r=[this];this.objects.forEach(n),r.forEach(function(t){t.objects.forEach(function(t){t instanceof u||t[e]()})})},createObject:function(t,e){var n=this._createObject(t,e);return s.isStarted&&(n.start(),n.startPortlets()),n},_createObject:function(t,e){var n;if(e=e||[],!s.library.hasOwnProperty(t))throw new Error("unknown object "+t);var r=s.library[t];return r.prototype.doResolveArgs&&(e=this.resolveArgs(e)),n=new r(this,this._generateId(),e),this.objects[n.id]=n,n.endPoint&&this.endPoints.push(n),c(n)&&this.inlets.push(n.inlets[0]),l(n)&&this.outlets.push(n.outlets[0]),n},resolveArgs:function(t){var e=t.slice(0),n=[this.patchId].concat(this.args);return t.forEach(function(t,n){"b"===t?e[n]="bang":"f"===t?e[n]="float":"s"===t?e[n]="symbol":"a"===t?e[n]="anything":"l"===t&&(e[n]="list")}),o.getDollarResolver(e)(n)}});var c=function(t){return[s.library.inlet,s.library["inlet~"]].some(function(e){return t instanceof e})},l=function(t){return[s.library.outlet,s.library["outlet~"]].some(function(e){return t instanceof e})}},{"../global":9,"./BaseNode":2,"./utils":8,events:24,underscore:70}],4:[function(t,e,n){var r=t("underscore"),i=(t("util").inherits,t("./portlets"),t("./utils")),o=t("./BaseNode"),a=(t("./Patch"),t("../global"),e.exports=function(){o.apply(this,arguments)});a.extend=i.chainExtend,r.extend(a.prototype,o.prototype,{doResolveArgs:!0})},{"../global":9,"./BaseNode":2,"./Patch":3,"./portlets":7,"./utils":8,underscore:70,util:29}],5:[function(t,e,n){n.Clock={time:0,schedule:function(t,e,n){},unschedule:function(t){}},n.Audio={start:function(){},stop:function(){},decode:function(t,e){e(null,t)}},n.Storage={get:function(t,e){}}},{}],6:[function(t,e,n){var r=t("events").EventEmitter,i=t("underscore"),o=t("chai").expect,a=t("../global");n.NamedMixin={nameIsUnique:!1,setName:function(t){o(t).to.be.a("string","name");var e=this.name;this.emit("changing:name",e,t),this.name=t,a.namedObjects.register(this,this.type,t,this.nameIsUnique,e),this.emit("changed:name",e,t)},destroy:function(){a.namedObjects.unregister(this,this.type,this.name)}};var s=n.Reference=function(t){this.referencedType=t,this._onNewObject=null,this._onChangedName=null,this.resolved=null,this._eventName="namedObjects:registered:"+this.referencedType};i.extend(s.prototype,r.prototype,{set:function(t){var e=this,n=a.namedObjects.get(this.referencedType,t)[0];this.name=t,this._stopListening(),n?this._setResolved(n):(this._setResolved(null),this._onNewObject=function(n){n.name===t&&(e._stopListening(),e._setResolved(n))},a.emitter.on(this._eventName,this._onNewObject))},destroy:function(){this._stopListening(),this.resolved&&this.resolved.removeListener("changing:name",this._onChangedName),this.removeAllListeners()},_setResolved:function(t){var e=this,n=this.resolved;this.resolved=t,n&&n.removeListener("changing:name",e._onChangedName),t&&(this._onChangedName=function(){e._setResolved(null)},t.on("changing:name",this._onChangedName)),this.emit("changed",t,n)},_stopListening:function(){this._onNewObject&&(a.emitter.removeListener(this._eventName,this._onNewObject),this._onNewObject=null)}})},{"../global":9,chai:30,events:24,underscore:70}],7:[function(t,e,n){var r=t("underscore"),i=t("./utils"),o=n.Portlet=function(t,e){this.obj=t,this.id=e,this.connections=[],this.init()};r.extend(o.prototype,{crossPatch:!1,init:function(){},start:function(){},stop:function(){},message:function(t){},connection:function(t){},disconnection:function(t){},connect:function(t){if(-1!==this.connections.indexOf(t))return!1;if(!this.crossPatch&&!t.crossPatch&&this.obj.patch!==t.obj.patch)throw new Error("cannot connect objects that belong to different patches");return this.connections.push(t),t.connect(this),this.connection(t),!0},disconnect:function(t){var e=this.connections.indexOf(t);return-1===e?!1:(this.connections.splice(e,1),t.disconnect(this),this.disconnection(t),!0)}}),o.extend=i.chainExtend;n.Inlet=o.extend({}),n.Outlet=o.extend({})},{"./utils":8,underscore:70}],8:[function(t,e,n){var r=t("underscore"),i=(t("chai").expect,/\$(\d+)/),o=/\$(\d+)/g;n.getDollarResolver=function(t){t=t.slice(0);var e=function(t,e){if(e>=t.length||0>e)throw new Error("$"+(e+1)+": argument number out of range");return t[e]},n=t.map(function(t){var n=i.exec(t);return n&&n[0]===t?function(t){var r=parseInt(n[1],10);return function(t){return e(t,r)}}(t):n?function(t){for(var n,r=[];n=o.exec(t);)r.push([n[0],parseInt(n[1],10)]);return function(n){var i=t.substr(0);return r.forEach(function(t){i=i.replace(t[0],e(n,t[1]))}),i}}(t):function(t){return function(){return t}}(t)});return function(t){return n.map(function(e,n){return e(t)})}},n.chainExtend=function(){var t=Array.prototype.slice.call(arguments,0),e=this,n=function(){e.apply(this,arguments)};return n.prototype=new e,r.extend.apply(this,[n.prototype,e.prototype].concat(t)),n.extend=this.extend,n},n.UniqueIdsMixin={_generateId:function(){return this._idCounter++,this._idCounter},_idCounter:-1}},{chai:30,underscore:70}],9:[function(t,e,n){var r=t("underscore"),i=t("events").EventEmitter;n.settings={sampleRate:44100,blockSize:16384,channelCount:2},n.isStarted=!1;var o=n.emitter=new i;o.emit=function(t){if(!r.contains([],t)&&0!==t.indexOf("msg:")&&0!==t.indexOf("namedObjects:registered")&&0!==t.indexOf("namedObjects:unregistered"))throw new Error("unknown event : "+t);i.prototype.emit.apply(this,arguments)},n.library={},n.patches={},n.audio=null,n.clock=null,n.storage=null,n.namedObjects={register:function(t,e,r,i,o){var a,s;if(this._store[e]=a=this._store[e]||{},a[r]=s=a[r]||[],-1===s.indexOf(t)){if(i&&s.length>0)throw new Error("there is already a "+e+' with name "'+r+'"');s.push(t)}o&&(s=a[o],s.splice(s.indexOf(t),1)),n.emitter.emit("namedObjects:registered:"+e,t)},unregister:function(t,e,r){var i,o=this._store[e],a=o?o[r]:null;a&&(i=a.indexOf(t),-1!==i&&(a.splice(i,1),n.emitter.emit("namedObjects:unregistered:"+e,t)))},get:function(t,e){return(this._store[t]||{})[e]||[]},reset:function(){this._store={}},_store:{}}},{events:24,underscore:70}],10:[function(t,e,n){var r=(t("events").EventEmitter,t("underscore")),i=(t("chai").expect,t("../core/utils"),t("../core/mixins"),t("../core/PdObject")),o=(t("../core/Patch"),t("../global")),a=t("./portlets");n.declareObjects=function(t){var e=i.extend({inletDefs:[a.Inlet.extend({message:function(t){this.obj._onMessageReceived(t)}})],outletDefs:[a.Outlet],init:function(t,e,n){if(t&&"-"!==t&&"empty"!==t&&(this.receiveName=t,this._onMessageReceived&&(this._onMessageReceived=this._onMessageReceived.bind(this),o.emitter.on("msg:"+this.receiveName,this._onMessageReceived))),e&&"-"!==e&&"empty"!==e&&(this.sendName=e),n&&this.patch){var r=this;this._onPatchStarted=function(){r._sendMessage([r.value])},this.patch.on("started",this._onPatchStarted)}},destroy:function(){o.emitter.removeListener("msg:"+this.receiveName,this._onMessageReceived),this._onPatchStarted&&this.patch.removeListener("started",this._onPatchStarted)},_sendMessage:function(t){this.o(0).message(t),this.sendName&&o.emitter.emit("msg:"+this.sendName,t)}});t.symbolatom=e.extend({type:"symbolatom",init:function(t){var n=(t[0]||void 0,t[1]||void 0,t[2]),r=t[3];this.value="symbol",e.prototype.init.apply(this,[n,r,0])},_onMessageReceived:function(t){var e=t[0];return"bang"===e||r.isNumber(e)||"symbol"===e?(r.isNumber(e)?this.value="float":"symbol"===e&&(this.value=t[1]),t=["symbol",this.value],void this._sendMessage(t)):console.error("invalid "+e)}});var n=e.extend({init:function(t,n,i,o,a,s){this.value=s,this._limitInput=function(t){return r.isNumber(a)&&(t=Math.min(t,a)),r.isNumber(o)&&(t=Math.max(t,o)),t},e.prototype.init.apply(this,[n,i,t])},_onMessageReceived:function(t){var e=t[0];return"bang"===e||r.isNumber(e)?(r.isNumber(e)&&(this.value=e),t=[this._limitInput(this.value)],void this._sendMessage(t)):console.error("invalid "+e)}});t.floatatom=n.extend({type:"floatatom",init:function(t){var e=t[0]||void 0,r=t[1]||void 0,i=t[2],o=t[3];n.prototype.init.apply(this,[0,i,o,e,r,0])}}),t.nbx=n.extend({type:"nbx",init:function(t){var e=t[0]||void 0,r=t[1]||void 0,i=t[2]||0,o=t[3],a=t[4],s=t[5]||0;n.prototype.init.apply(this,[i,o,a,e,r,s])}}),t.bng=e.extend({type:"bng",init:function(t){var n=t[0]||0,r=t[1],i=t[2];e.prototype.init.apply(this,[r,i,n]),this.value="bang"},_onMessageReceived:function(){this._sendMessage(["bang"])}}),t.tgl=e.extend({type:"tgl",init:function(t){var n=t[0]||0,i=t[1],o=t[2],a=t[3]||0,s=r.isNumber(t[4])?t[4]:1;e.prototype.init.apply(this,[i,o,n]),this.nonZeroValue=s,this.value=a},_onMessageReceived:function(t){var e=t[0];if("bang"===e)this.value=0===this.value?this.nonZeroValue:0,this._sendMessage([this.value]);else{if(!r.isNumber(e))return console.error("invalid message received "+t);this.value=0===e?0:this.nonZeroValue,this._sendMessage([e])}}});var s=n.extend({init:function(t){var e=t[0]||0,i=r.isNumber(t[1])?t[1]:127,o=t[2]||0,a=t[3],s=t[4],u=t[5]||0;n.prototype.init.apply(this,[o,a,s,e,i,u])}});t.hsl=s.extend({type:"hsl"}),t.vsl=s.extend({type:"vsl"});var u=e.extend({init:function(t){var n=(t[0],t[1]),i=r.isNumber(t[2])?t[2]:8,o=t[3],a=t[4],s=t[5]||0;this.value=s,this._limitInput=function(t){return Math.floor(Math.min(Math.max(t,0),i-1))},e.prototype.init.apply(this,[o,a,n])},_onMessageReceived:function(t){var e=t[0];return"bang"===e||r.isNumber(e)?(r.isNumber(e)&&(this.value=e),t=[this._limitInput(this.value)],void this._sendMessage(t)):console.error("invalid "+e)}});t.hradio=u.extend({type:"hradio"}),t.vradio=u.extend({type:"vradio"}),t.vu=e.extend({init:function(t){var n=t[0];e.prototype.init.apply(this,[n,void 0,0])},_onMessageReceived:function(t){this._sendMessage(t)}})}},{"../core/Patch":3,"../core/PdObject":4,"../core/mixins":6,"../core/utils":8,"../global":9,"./portlets":14,chai:30,events:24,underscore:70}],11:[function(t,e,n){var r=t("events").EventEmitter,i=(t("underscore"),t("chai").expect),o=t("waaoffsetnode"),a=t("waawhitenoisenode"),s=t("waatablenode"),u=(t("../core/utils"),t("../core/mixins")),c=t("../core/PdObject"),l=t("./portlets"),f=t("../global");n.declareObjects=function(t){var e=c.extend({inletDefs:[l.DspInlet.extend({message:function(t){var e=t[0];this.hasDspSource()||(i(e).to.be.a("number",this.obj.type+"::frequency"),e===1/0&&(e=0),this.obj.frequency=e,this.obj._updateFrequency())}}),l.Inlet.extend({message:function(t){var e=t[0];i(e).to.be.a("number","osc~::phase"),this.obj._updatePhase(e)}})],outletDefs:[l.DspOutlet],init:function(t){this.frequency=t[0]||0},start:function(){this._createOscillator(0)},stop:function(){this._destroyOscillator()},_updateFrequency:function(){this._oscNode&&this._oscNode.frequency.setValueAtTime(this.frequency,f.futureTime/1e3||0)},_updatePhase:function(t){f.isStarted&&this._createOscillator(t)}});t["osc~"]=e.extend({type:"osc~",_createOscillator:function(t){t=2*t*Math.PI,this._oscNode=f.audio.context.createOscillator(),this._oscNode.setPeriodicWave(f.audio.context.createPeriodicWave(new Float32Array([0,Math.cos(t)]),new Float32Array([0,Math.sin(-t)]))),this._oscNode.start(f.futureTime/1e3||0),this.o(0).setWaa(this._oscNode,0),this.i(0).setWaa(this._oscNode.frequency,0),this.i(0).message([this.frequency])},_destroyOscillator:function(){this._oscNode.stop(0),this._oscNode=null}}),t["phasor~"]=e.extend({type:"phasor~",_createOscillator:function(t){this._gainNode=f.audio.context.createGain(),this._gainNode.gain.value=.5,this._oscNode=f.audio.context.createOscillator(),this._oscNode.type="sawtooth",this._oscNode.start(f.futureTime/1e3||0),this._oscNode.connect(this._gainNode),this._offsetNode=new o(f.audio.context),this._offsetNode.offset.value=1,this._offsetNode.connect(this._gainNode),this.o(0).setWaa(this._gainNode,0),this.i(0).setWaa(this._oscNode.frequency,0),this.i(0).message([this.frequency])},_destroyOscillator:function(){this._oscNode.stop(0),this._oscNode=null,this._gainNode=null,this._offsetNode=null}}),t["triangle~"]=e.extend({type:"triangle~",_createOscillator:function(t){this._oscNode=f.audio.context.createOscillator(),this._oscNode.type="triangle",this._oscNode.start(f.futureTime/1e3||0),this.o(0).setWaa(this._oscNode,0),this.i(0).setWaa(this._oscNode.frequency,0),this.i(0).message([this.frequency])},_destroyOscillator:function(){this._oscNode.stop(0),this._oscNode=null}}),t["square~"]=e.extend({type:"square~",_createOscillator:function(t){this._oscNode=f.audio.context.createOscillator(),this._oscNode.type="square",this._oscNode.start(f.futureTime/1e3||0),this.o(0).setWaa(this._oscNode,0),this.i(0).setWaa(this._oscNode.frequency,0),this.i(0).message([this.frequency])},_destroyOscillator:function(){this._oscNode.stop(0),this._oscNode=null}}),t["noise~"]=c.extend({type:"noise~",outletDefs:[l.DspOutlet],start:function(){this._noiseNode=new a(f.audio.context),this._noiseNode.start(0),this.o(0).setWaa(this._noiseNode,0)},stop:function(){this._noiseNode.stop(0),this._noiseNode.disconnect(),this._noiseNode=null}}),t["line~"]=c.extend({type:"line~",inletDefs:[l.Inlet.extend({init:function(){this._queue=[],this._lastValue=0},message:function(t){var e=this;if(this.obj._offsetNode){var n=t[0],r=f.futureTime||f.audio.time,o=t[1]||0;i(n).to.be.a("number","line~::target"),o&&i(o).to.be.a("number","line~::duration"),this._refreshQueue(f.audio.time);var a=this._pushToQueue(r,n,o);this.obj._offsetNode.offset.cancelScheduledValues(a[0].t1/1e3+1e-6),a.forEach(function(t){t.t1!==t.t2?e.obj._offsetNode.offset.linearRampToValueAtTime(t.v2,t.t2/1e3):e.obj._offsetNode.offset.setValueAtTime(t.v2,t.t2/1e3)})}},_interpolate:function(t,e){return(e-t.t1)*(t.v2-t.v1)/(t.t2-t.t1)+t.v1},_refreshQueue:function(t){if(0!==this._queue.length){for(var e,n,r=0;(e=this._queue[r++])&&t>=e.t2;);n=this._queue.slice(0,r-1),this._queue=this._queue.slice(r-1),0===this._queue.length&&(this._lastValue=n[n.length-1].v2)}},_pushToQueue:function(t,e,n){for(var r,i=0,o=[];(r=this._queue[i++])&&t>=r.t2;);if(this._queue=this._queue.slice(0),this._queue.length){var a=this._queue[this._queue.length-1];t<a.t2?(this._queue=this._queue.slice(0,-1),r={t1:a.t1,v1:a.v1,t2:t,v2:this._interpolate(a,t)},o.push(r),this._queue.push(r)):t>a.t2&&(r={t1:a.t2,v1:a.v2,t2:t,v2:a.v2},o.push(r),this._queue.push(r))}else r={t1:0,v1:this._lastValue,t2:t,v2:this._lastValue},o.push(r),this._queue.push(r);return r={t1:t,v1:this._queue[this._queue.length-1].v2,t2:t+n,v2:e},o.push(r),this._queue.push(r),o}})],outletDefs:[l.DspOutlet],start:function(){this._offsetNode=new o(f.audio.context),this._offsetNode.offset.setValueAtTime(0,0),this.o(0).setWaa(this._offsetNode,0)},stop:function(){this._offsetNode=null}}),t["sig~"]=c.extend({type:"sig~",inletDefs:[l.Inlet.extend({message:function(t){var e=t[0];i(e).to.be.a("number","sig~::value"),this.obj.value=e,this.obj._offsetNode&&this.obj._offsetNode.offset.setValueAtTime(e,f.futureTime/1e3||0)}})],outletDefs:[l.DspOutlet],init:function(t){this.value=t[0]||0},start:function(){this._offsetNode=new o(f.audio.context),this._offsetNode.offset.setValueAtTime(0,0),this.o(0).setWaa(this._offsetNode,0),this.i(0).message([this.value])},stop:function(){this._offsetNode=null}});var n={message:function(t){var e=t[0];i(e).to.be.a("number",this.obj.type+"::frequency"),this.obj.frequency=e,this.obj._filterNode&&this.obj._filterNode.frequency.setValueAtTime(e,f.futureTime/1e3||0)}},h={message:function(t){var e=t[0];i(e).to.be.a("number",this.obj.type+"::Q"),this.obj.Q=e,this.obj._filterNode&&this.obj._filterNode.Q.setValueAtTime(e,f.futureTime/1e3||0)}},p=c.extend({inletDefs:[l.DspInlet,l.Inlet.extend(n)],outletDefs:[l.DspOutlet],init:function(t){this.frequency=t[0]||0},start:function(){this._filterNode=f.audio.context.createBiquadFilter(),this._filterNode.frequency.setValueAtTime(this.frequency,0),this._filterNode.type=this.waaFilterType,this.i(0).setWaa(this._filterNode,0),this.o(0).setWaa(this._filterNode,0),this.i(1).message([this.frequency])},stop:function(){this._filterNode=null}}),d=p.extend({waaFilterType:"bandpass",init:function(t){p.prototype.init.call(this,t),this.Q=t[1]||1},start:function(t){p.prototype.start.call(this,t),this._filterNode.Q.setValueAtTime(this.Q,0),this.i(2).message([this.Q])}});t["lop~"]=p.extend({type:"lop~",waaFilterType:"lowpass"}),t["hip~"]=p.extend({type:"hip~",waaFilterType:"highpass"}),t["bp~"]=d.extend({type:"bp~",inletDefs:[l.DspInlet,l.Inlet.extend(n),l.Inlet.extend(h)]}),t["vcf~"]=d.extend({type:"vcf~",inletDefs:[l.DspInlet,l.DspInlet.extend(n),l.Inlet.extend(h)],start:function(t){d.prototype.start.call(this,t),this.i(1).setWaa(this._filterNode.frequency,0)}});var g=c.extend({outletDefs:[l.DspOutlet],init:function(t){var e=t[0];this.setVal(e||0)},setVal:function(t){i(t).to.be.a("number",this.type+"::val"),this.val=t}}),m={message:function(t){var e=t[0];this.obj.setVal(e),this.hasDspSource()||this._setValNoDsp(e)},disconnection:function(t){l.DspInlet.prototype.disconnection.apply(this,arguments),t instanceof l.DspOutlet&&!this.hasDspSource()&&this._setValNoDsp(this.obj.val)}};t["*~"]=g.extend({type:"*~",inletDefs:[l.DspInlet,l.DspInlet.extend(m,{_setValNoDsp:function(t){this.obj._gainNode&&this.obj._gainNode.gain.setValueAtTime(t,f.futureTime/1e3||0)}})],start:function(){this._gainNode=f.audio.context.createGain(),this.i(0).setWaa(this._gainNode,0),this.i(1).setWaa(this._gainNode.gain,0),this.o(0).setWaa(this._gainNode,0),this.i(1).hasDspSource()||this.i(1)._setValNoDsp(this.val)},stop:function(){this._gainNode=null}}),t["+~"]=g.extend({type:"+~",inletDefs:[l.DspInlet,l.DspInlet.extend(m,{_setValNoDsp:function(t){this.obj._offsetNode&&this.obj._offsetNode.offset.setValueAtTime(t,f.futureTime/1e3||0)}})],start:function(){this._offsetNode=new o(f.audio.context),this._gainNode=f.audio.context.createGain(),this._gainNode.gain.value=1,this._offsetNode.offset.value=0,this._offsetNode.connect(this._gainNode,0,0),this.i(0).setWaa(this._gainNode,0),this.i(1).setWaa(this._offsetNode.offset,0),this.o(0).setWaa(this._gainNode,0),this.i(1).hasDspSource()||this.i(1)._setValNoDsp(this.val)},stop:function(){this._offsetNode.disconnect(),this._gainNode=null,this._offsetNode=null}}),t["-~"]=g.extend({type:"-~",inletDefs:[l.DspInlet,l.DspInlet.extend(m,{_setValNoDsp:function(t){this.obj._offsetNode&&this.obj._offsetNode.offset.setValueAtTime(t,f.futureTime/1e3||0)}})],start:function(){this._offsetNode=new o(f.audio.context),this._gainNode=f.audio.context.createGain(),this._negateGainNode=f.audio.context.createGain(),this._gainNode.gain.value=1,this._negateGainNode.gain.value=-1,this._offsetNode.offset.value=0,this._offsetNode.connect(this._negateGainNode,0,0),this._negateGainNode.connect(this._gainNode,0,0),this.i(0).setWaa(this._gainNode,0),this.i(1).setWaa(this._offsetNode.offset,0),this.o(0).setWaa(this._gainNode,0),this.i(1).hasDspSource()||this.i(1)._setValNoDsp(this.val)},stop:function(){this._negateGainNode.disconnect(),this._offsetNode.disconnect(),this._gainNode=null,this._negateGainNode=null,this._offsetNode=null}});var v=c.extend({init:function(t){var e=this;this.array=new u.Reference("array"),this._onDataChangedHandler=null,this.array.on("changed",function(t,n){n&&n.removeListener("changed:data",e._onDataChangedHandler),t&&(e._onDataChangedHandler=function(){e.dataChanged()},t.on("changed:data",e._onDataChangedHandler))})},dataChanged:function(){},destroy:function(){this.array.resolved&&this.array.resolved.removeListener("changed:data",this._onDataChangedHandler),this.array.destroy()}});t["tabread~"]=t["tabread4~"]=v.extend({type:"tabread~",inletDefs:[l.DspInlet.extend({message:function(t){var e=t[0];"set"===e?this.obj.array.set(t[1]):console.error("unknown method "+e)},connection:function(){l.DspInlet.prototype.connection.apply(this,arguments),this.obj._updateDsp()},disconnection:function(){l.DspInlet.prototype.disconnection.apply(this,arguments),this.obj._updateDsp()}})],outletDefs:[l.DspOutlet],init:function(t){var e=this,n=t[0];v.prototype.init.apply(this,arguments),this.array.on("changed",function(){e._updateDsp()}),n&&this.array.set(n)},start:function(){this._tableNode=new s(f.audio.context),this._gainNode=f.audio.context.createGain(),this.i(0).setWaa(this._tableNode.position,0),this.o(0).setWaa(this._gainNode,0),this._updateDsp()},stop:function(){this._tableNode=null,this._gainNode=null},destroy:function(){v.prototype.destroy.apply(this,arguments)},dataChanged:function(){this._tableNode&&(this._tableNode.table=this.array.resolved.data)},_updateDsp:function(){this._tableNode&&this.array.resolved&&this.i(0).hasDspSource()?(this._tableNode.table=this.array.resolved.data,this._tableNode.connect(this._gainNode)):this._tableNode&&this._tableNode.disconnect()}}),t["delwrite~"]=c.extend(u.NamedMixin,r.prototype,{type:"delwrite~",inletDefs:[l.DspInlet],init:function(t){var e=t[0],n=t[1];this.maxDelayTime=n||1e3,e&&this.setName(e)},start:function(){this._pipeNode=f.audio.context.createGain(),this.i(0).setWaa(this._pipeNode,0),this.emit("started")},stop:function(){this._pipeNode.disconnect(),this._pipeNode=null},destroy:function(){u.NamedMixin.destroy.apply(this,arguments),this.removeAllListeners()}}),t["delread~"]=t["vd~"]=c.extend({type:"delread~",inletDefs:[l.DspInlet.extend({message:function(t){var e=t[0];this.obj.setDelayTime(e)}})],outletDefs:[l.DspOutlet],init:function(t){var e=t[0],n=t[1];this._delayTime=n||0,this._delWrite=new u.Reference("delwrite~"),this._onDelWriteStarted=null,e&&this._delWrite.set(e)},start:function(){this._createDelay(),this._onDelWriteChanged=function(t,e){f.isStarted&&t&&self._createDelay()},this._delWrite.on("changed",this._onDelWriteChanged)},stop:function(){this._toSecondsGain=null,this._delayNode.disconnect(),this._delayNode=null,this._delWrite.removeListener("changed",this._onDelWriteChanged),this._onDelWriteChanged=null},destroy:function(){this._delWrite.destroy(),this._delWrite.resolved&&this._onDelWriteStarted&&this._delWrite.resolved.removeListener("started",this._onDelWriteStarted)},setDelayTime:function(t){i(t).to.be.a("number"),this._delayTime=t,this._delayNode&&!this.i(0).hasDspSource()&&this._delayNode.delayTime.setValueAtTime(this._delayTime/1e3,f.futureTime/1e3||0)},_createDelay:function(){this._delayNode&&this._delayNode.disconnect();var t=this._delWrite.resolved?this._delWrite.resolved.maxDelayTime/1e3:1,e=this;if(this._delayNode=f.audio.context.createDelay(t),this._toSecondsGain||(this._toSecondsGain=f.audio.context.createGain(),this._toSecondsGain.gain.value=.001,this.i(0).setWaa(this._toSecondsGain,0)),this._toSecondsGain.connect(this._delayNode.delayTime),this.o(0).setWaa(this._delayNode,0),this.setDelayTime(this._delayTime),this._delWrite.resolved){var n=function(){e._delWrite.resolved._pipeNode.connect(e._delayNode)};this._delWrite.resolved._pipeNode?n():(this._onDelWriteStarted=n,this._delWrite.resolved.once("started",this._onDelWriteStarted))}}}),t["clip~"]=c.extend({type:"clip~",inletDefs:[l.DspInlet,l.Inlet.extend({message:function(t){var e=t[0];i(e).to.be.a("number","clip~::min"),this.obj.minValue=e,this.obj._updateGains()}}),l.Inlet.extend({message:function(t){var e=t[0];i(e).to.be.a("number","clip~::max"),this.obj.maxValue=e,this.obj._updateGains()}})],outletDefs:[l.DspOutlet],init:function(t){this.minValue=t[0]||0,this.maxValue=t[1]||0},start:function(){this._gainInNode=f.audio.context.createGain(),this._gainOutNode=f.audio.context.createGain(),this._waveShaperNode=f.audio.context.createWaveShaper(),this._gainInNode.connect(this._waveShaperNode),this.i(0).setWaa(this._gainInNode,0),this.o(0).setWaa(this._waveShaperNode,0),this._updateGains()},stop:function(){this._gainInNode=null,this._waveShaperNode=null,this._gainOutNode.disconnect(),this._gainOutNode=null},_updateGains:function(){if(this._waveShaperNode){var t,e=Math.max(Math.abs(this.minValue),Math.abs(this.maxValue)),n=Pd.getSampleRate(),r=new Float32Array(n),i=-e,o=2*e/n;for(t=0;n>t;t++)r[t]=i>=this.minValue&&i<=this.maxValue?i:i>this.maxValue?this.maxValue:this.minValue,i+=o;this._waveShaperNode.curve=r,this._gainInNode.gain.setValueAtTime(0!==e?1/e:0,0)}}}),t["dac~"]=c.extend({type:"dac~",endPoint:!0,inletDefs:[l.DspInlet,l.DspInlet],start:function(){this.i(0).setWaa(f.audio.channels[0],0),this.i(1).setWaa(f.audio.channels[1],0)}})}},{"../core/PdObject":4,"../core/mixins":6,"../core/utils":8,"../global":9,"./portlets":14,chai:30,events:24,underscore:70,waaoffsetnode:73,waatablenode:75,waawhitenoisenode:79}],12:[function(t,e,n){var r=t("events").EventEmitter,i=t("underscore"),o=t("chai").expect,a=t("../core/utils"),s=t("../core/mixins"),u=t("../core/PdObject"),c=t("../core/Patch"),l=t("../global"),f=t("./portlets");
  
  n.declareObjects=function(t){t.receive=t.r=u.extend(s.NamedMixin,r.prototype,{type:"receive",outletDefs:[f.Outlet],abbreviations:["r"],init:function(t){var e=t[0],n=this;this._onMessageReceived=this._onMessageReceived.bind(this),this.on("changed:name",function(t,e){t&&l.emitter.removeListener("msg:"+t,n._onMessageReceived),l.emitter.on("msg:"+e,n._onMessageReceived)}),this.setName(e)},destroy:function(){s.NamedMixin.destroy.apply(this,arguments),l.emitter.removeListener("msg:"+this.name,this._onMessageReceived),this.removeAllListeners()},_onMessageReceived:function(t){this.o(0).message(t)}}),t.send=t.s=u.extend(s.NamedMixin,r.prototype,{type:"send",inletDefs:[f.Inlet.extend({message:function(t){l.emitter.emit("msg:"+this.obj.name,t)}})],abbreviations:["s"],init:function(t){this.setName(t[0])},destroy:function(){s.NamedMixin.destroy.apply(this,arguments),this.removeAllListeners()}}),t.msg=u.extend({type:"msg",doResolveArgs:!1,inletDefs:[f.Inlet.extend({message:function(t){t=t.slice(0),t.unshift(0),this.obj.outlets[0].message(this.obj.resolver(t))}})],outletDefs:[f.Outlet],init:function(t){this.resolver=a.getDollarResolver(t)}}),t.print=u.extend({type:"print",inletDefs:[f.Inlet.extend({message:function(t){console.log(this.obj.prefix?[this.obj.prefix].concat(t):t)}})],init:function(t){this.prefix=t[0]||"print"}}),t.text=u.extend({type:"text",init:function(t){this.text=t[0]}}),t.loadbang=u.extend({type:"loadbang",outletDefs:[f.Outlet],init:function(){var t=this;this._onPatchStarted=function(){t.o(0).message(["bang"])},this.patch.on("started",this._onPatchStarted)},destroy:function(){this.patch.removeListener("started",this._onPatchStarted)}});var e=u.extend({inletDefs:[f.Inlet.extend({message:function(t){var e=t[0];"bang"!==e&&this.obj.setVal(e),this.obj.o(0).message([this.obj.val])}}),f.Inlet.extend({message:function(t){var e=t[0];this.obj.setVal(e)}})],outletDefs:[f.Outlet],init:function(t){var e=t[0];this.setVal(e||0)},setVal:function(t){this.val=t}});t["float"]=t.f=e.extend({type:"float",setVal:function(t){o(t).to.be.a("number","float::value"),this.val=t}}),t["int"]=t.i=e.extend({type:"int",setVal:function(t){o(t).to.be.a("number","float::value"),this.val=Math.floor(t)}});var n=u.extend({inletDefs:[f.Inlet.extend({message:function(t){var e=t[0];i.isNumber(e)?this.obj.valLeft=e:"bang"!==e&&console.error("invalid message : "+t),this.obj.o(0).message([this.obj.compute()])}}),f.Inlet.extend({message:function(t){var e=t[0];o(e).to.be.a("number",this.obj.type+"::value"),this.obj.valRight=e}})],outletDefs:[f.Outlet],init:function(t){this.valRight=t[0]||0,this.valLeft=0},compute:function(){}});t["+"]=n.extend({type:"+",compute:function(){return this.valLeft+this.valRight}}),t["-"]=n.extend({type:"-",compute:function(){return this.valLeft-this.valRight}}),t["*"]=n.extend({type:"*",compute:function(){return this.valLeft*this.valRight}}),t["/"]=n.extend({type:"/",compute:function(){return this.valLeft/this.valRight}}),t.mod=t["%"]=n.extend({type:"mod",compute:function(){return this.valLeft%this.valRight}}),t.pow=n.extend({type:"pow",compute:function(){return Math.pow(this.valLeft,this.valRight)}}),t.spigot=u.extend({type:"spigot",inletDefs:[f.Inlet.extend({message:function(t){this.obj.passing&&this.obj.o(0).message(t)}}),f.Inlet.extend({message:function(t){var e=t[0];this.obj.setPassing(e)}})],outletDefs:[f.Outlet],init:function(t){var e=t[0];this.setPassing(e||0)},setPassing:function(t){o(t).to.be.a("number","spigot::passing"),this.passing=Boolean(t)}}),t.trigger=t.t=u.extend({type:"trigger",inletDefs:[f.Inlet.extend({message:function(t){var e,n,r;for(e=this.obj.filters.length-1;e>=0;e--)if(n=this.obj.filters[e],"bang"===n)this.obj.o(e).message(["bang"]);else if("list"===n||"anything"===n)this.obj.o(e).message(t);else if("float"===n||i.isNumber(n))r=t[0],this.obj.o(e).message(i.isNumber(r)?[r]:[0]);else if("symbol"===n)if(r=t[0],"bang"===r)this.obj.o(e).message(["symbol"]);else if(i.isNumber(r))this.obj.o(e).message(["float"]);else{if(!i.isString(r))throw new Error("Got unexpected input "+t);this.obj.o(e).message([r])}else this.obj.o(e).message(["bang"])}})],init:function(t){var e,n;for(0===t.length&&(t=["bang","bang"]),e=0,n=t.length;n>e;e++)this.outlets.push(new f.Outlet(this,e));this.filters=t}});var h=f.Inlet.extend({message:function(t){var e=t[0];"bang"!==e&&(this.obj.memory[0]=e),this.obj.o(0).message(this.obj.memory.slice(0))}}),p=f.Inlet.extend({message:function(t){var e=t[0];this.obj.memory[this.id]=e}});t.pack=u.extend({type:"pack",outletDefs:[f.Outlet],init:function(t){var e,n=t.length;for(0===n&&(t=["float","float"]),n=t.length,this.filters=t,this.memory=new Array(n),e=0;n>e;e++)this.inlets[e]=0===e?new h(this,e):new p(this,e),this.memory[e]="float"===t[e]?0:"symbol"===t[e]?"symbol":t[e]}}),t.select=t.sel=u.extend({type:"select",inletDefs:[f.Inlet.extend({message:function(t){var e,n=t[0];-1!==(e=this.obj.filters.indexOf(n))?this.obj.o(e).message(["bang"]):this.obj.outlets.slice(-1)[0].message([n])}}),f.Inlet.extend({message:function(t){this.obj.filters.length<=1&&(this.obj.filters=t)}})],init:function(t){var e,n;for(0===t.length&&(t=[0]),t.length>1&&this.inlets.pop(),e=0,n=t.length;n>e;e++)this.outlets[e]=new f.Outlet(this,e);this.outlets[e]=new f.Outlet(this,e),this.filters=t}}),t.moses=u.extend({type:"moses",inletDefs:[f.Inlet.extend({message:function(t){var e=t[0];o(e).to.be.a("number","moses::value"),e<this.obj.val?this.obj.o(0).message([e]):this.obj.o(1).message([e])}}),f.Inlet.extend({message:function(t){var e=t[0];this.obj.setVal(e)}})],outletDefs:[f.Outlet,f.Outlet],init:function(t){var e=t[0];this.setVal(e||0)},setVal:function(t){o(t).to.be.a("number","moses::value"),this.val=t}}),t.mtof=u.extend({type:"mtof",inletDefs:[f.Inlet.extend({message:function(t){var e=0,n=t[0];o(n).to.be.a("number","mtof::value"),e=-1500>=n?0:n>1499?this.obj.maxMidiNote:8.17579891564*Math.exp(.057762265*n),this.obj.o(0).message([e])}})],outletDefs:[f.Outlet],maxMidiNote:8.17579891564*Math.exp(86.585635235)}),t["samplerate~"]=u.extend({type:"samplerate~",inletDefs:[f.Inlet.extend({message:function(t){this.obj.o(0).message([l.settings.sampleRate])}})],outletDefs:[f.Outlet]}),t.random=u.extend({type:"random",inletDefs:[f.Inlet.extend({message:function(t){var e=t[0];"bang"===e&&this.obj.o(0).message([Math.floor(Math.random()*this.obj.max)])}}),f.Inlet.extend({message:function(t){var e=t[0];this.obj.setMax(e)}})],outletDefs:[f.Outlet],init:function(t){var e=t[0];this.setMax(e||1)},setMax:function(t){o(t).to.be.a("number","random::max"),this.max=t}}),t.metro=u.extend({type:"metro",inletDefs:[f.Inlet.extend({message:function(t){var e=t[0];"bang"===e?this.obj._restartMetroTick():"stop"===e?this.obj._stopMetroTick():(o(e).to.be.a("number","metro::command"),0===e?this.obj._stopMetroTick():this.obj._restartMetroTick())}}),f.Inlet.extend({message:function(t){var e=t[0];this.obj.setRate(e),this.obj._metroTick=this.obj._metroTickRateChange}})],outletDefs:[f.Outlet],init:function(t){var e=t[0];this.setRate(e||0),this._metroHandle=null,this._metroTick=this._metroTickNormal},setRate:function(t){o(t).to.be.a("number","metro::rate"),this.rate=Math.max(t,1)},destroy:function(){this._stopMetroTick()},_startMetroTick:function(){var t=this;null===this._metroHandle&&(this._metroHandle=l.clock.schedule(function(e){t._metroTick()},l.futureTime||l.clock.time,this.rate))},_stopMetroTick:function(){null!==this._metroHandle&&(l.clock.unschedule(this._metroHandle),this._metroHandle=null)},_restartMetroTick:function(){this._metroTick===this._metroTickRateChange&&(this._metroTick=this._metroTickNormal),this._stopMetroTick(),this._startMetroTick()},_metroTickNormal:function(){this.outlets[0].message(["bang"])},_metroTickRateChange:function(){this._metroTick=this._metroTickNormal,this._restartMetroTick()}}),t.delay=t.del=u.extend({type:"delay",inletDefs:[f.Inlet.extend({message:function(t){var e=t[0];"bang"===e?(this.obj._stopDelay(),this.obj._startDelay()):"stop"===e?this.obj._stopDelay():(this.obj.setDelay(e),this.obj._stopDelay(),this.obj._startDelay())}}),f.Inlet.extend({message:function(t){var e=t[0];this.obj.setDelay(e)}})],outletDefs:[f.Outlet],init:function(t){var e=t[0];this.setDelay(e||0),this._delayHandle=null},setDelay:function(t){o(t).to.be.a("number","delay::time"),this.delay=t},destroy:function(){this._stopDelay()},_startDelay:function(){var t=this;null===this._delayHandle&&(this._delayHandle=l.clock.schedule(function(){t.outlets[0].message(["bang"])},(l.futureTime||l.clock.time)+this.delay))},_stopDelay:function(){null!==this._delayHandle&&(l.clock.unschedule(this._delayHandle),this._delayHandle=null)}}),t.timer=u.extend({type:"timer",inletDefs:[f.Inlet.extend({message:function(t){var e=t[0];o(e).to.be.equal("bang","timer::startStop"),this.obj.refTime=l.futureTime||l.clock.time}}),f.Inlet.extend({message:function(t){var e=t[0];o(e).to.be.equal("bang","timer::measure"),this.obj.outlets[0].message([(l.futureTime||l.clock.time)-this.obj.refTime])}})],outletDefs:[f.Outlet],init:function(){this.refTime=0}}),t.change=u.extend({type:"change",inletDefs:[f.Inlet.extend({message:function(t){var e=t[0];e!==this.obj.last&&(this.obj.last=e,this.obj.o(0).message([e]))}})],outletDefs:[f.Outlet],init:function(){this.last=null}}),t.array=t.table=u.extend(s.NamedMixin,r.prototype,{type:"array",nameIsUnique:!0,init:function(t){var e=t[0],n=t[1]||100;e&&this.setName(e),this.size=n,this.data=new Float32Array(n)},destroy:function(){s.NamedMixin.destroy.apply(this,arguments),this.removeAllListeners()},setData:function(t,e){e&&(this.data=new Float32Array(t.length)),this.data.set(t.subarray(0,Math.min(this.data.length,t.length))),this.size=this.data.length,this.emit("changed:data")}}),t.soundfiler=u.extend({type:"soundfiler",inletDefs:[f.Inlet.extend({message:function(t){var e,n,r,o=this,a=t[0],s=!1;if(t=t.slice(1),"read"===a){for(;t.length&&"-"===t[0][0];){if(e=t.shift(),"-resize"!==e)return console.error("-wave"===e&&"-aiff"===e&&"-nextstep"===e&&"-raw"===e&&"-bytes"===e&&"-nframes"===e?e+" not supported":e+" not understood");s=!0}n=t.shift(),r=t,l.storage.get(n,function(t,e){return t?console.error("could not load file : "+t):void l.audio.decode(e,function(t,e){if(t)return console.error("Could not decode file : "+t);var n,a,u;a=r.map(function(t){return n=l.namedObjects.get("array",t)[0],n?n:(console.error('array "'+t+'" not found'),null)}),i.contains(a,null)||(1!==i.uniq(i.pluck(a,"size")).length&&(s=!0),a.forEach(function(t,n){u=e[n],u&&t.setData(u,s)}),o.obj.o(0).message([Math.min(a[0].size,e[0].length)]))})})}else console.error('command "'+a+'" is not supported')}})],outletDefs:[f.Outlet]}),t.pd=c}},{"../core/Patch":3,"../core/PdObject":4,"../core/mixins":6,"../core/utils":8,"../global":9,"./portlets":14,chai:30,events:24,underscore:70}],13:[function(t,e,n){t("underscore");n.declareObjects=function(e){t("./glue").declareObjects(e),t("./controls").declareObjects(e),t("./dsp").declareObjects(e),t("./portlets").declareObjects(e)}},{"./controls":10,"./dsp":11,"./glue":12,"./portlets":14,underscore:70}],14:[function(t,e,n){var r=t("underscore"),i=(t("chai").expect,t("waawire")),o=(t("../core/utils"),t("../core/PdObject")),a=t("../core/portlets").Inlet,s=t("../core/portlets").Outlet,u=t("../global"),c="undefined"!=typeof window?window.AudioParam:function(){},l={future:function(t,e){u.futureTime=t,this.message(e),delete u.futureTime}},f=n.Inlet=a.extend(l),h=n.Outlet=s.extend({message:function(t){this.connections.forEach(function(e){e.message(t)})}}),p=n.DspInlet=a.extend(l,{hasDspSource:function(){return r.filter(this.connections,function(t){return t instanceof d}).length>0},init:function(){this._started=!1},start:function(){this._started=!0},stop:function(){this._waa=null,this._started=!1},setWaa:function(t,e){var n=this;this._waa={node:t,input:e},t instanceof c&&t.setValueAtTime(0,0),this._started&&r.chain(this.connections).filter(function(t){return t instanceof d}).forEach(function(t){t._waaUpdate(n)}).value()}}),d=n.DspOutlet=s.extend({init:function(){this._waaConnections={},this._started=!1},start:function(){this._started=!0,this.connections.forEach(this._waaConnect.bind(this))},stop:function(){this._started=!1,this.connections.forEach(this._waaDisconnect.bind(this)),this._waaConnections={}},connection:function(t){if(!(t instanceof p))throw new Error("can only connect to DSP inlet");this._started&&this._waaConnect(t)},disconnection:function(t){this._started&&this._waaDisconnect(t)},message:function(){throw new Error("dsp outlet received a message")},setWaa:function(t,e){this._waa={node:t,output:e},t instanceof c&&t.setValueAtTime(0,0),this._started&&r.values(this._waaConnections).forEach(function(n){n.swapSource(t,e)})},_waaConnect:function(t){var e=new i(u.audio.context);this._waaConnections[this._getConnectionId(t)]=e,e.connect(this._waa.node,t._waa.node,this._waa.output,t._waa.input)},_waaDisconnect:function(t){var e=this._waaConnections[this._getConnectionId(t)];delete this._waaConnections[this._getConnectionId(t)],e.close()},_waaUpdate:function(t){this._waaConnections[this._getConnectionId(t)].swapDestination(t._waa.node,t._waa.input)},_getConnectionId:function(t){return t.obj.id+":"+t.id}});n.declareObjects=function(t){var e=f.extend({message:function(t){this.obj.outlets[0].message(t)}}),n=p.extend({message:function(t){this.obj.outlets[0].message(t)}}),r=d.extend({message:function(t){this.sinks.forEach(function(e){e.message(t)})}});t.outlet=o.extend({type:"outlet",inletDefs:[e],outletDefs:[h.extend({crossPatch:!0})]}),t.inlet=o.extend({type:"inlet",inletDefs:[e.extend({crossPatch:!0})],outletDefs:[h]}),t["outlet~"]=o.extend({type:"outlet~",inletDefs:[n],outletDefs:[r.extend({crossPatch:!0})],start:function(){this._gainNode=u.audio.context.createGain(),this._gainNode.gain.value=1,this.i(0).setWaa(this._gainNode,0),this.o(0).setWaa(this._gainNode,0)},stop:function(){this._gainNode=null}}),t["inlet~"]=o.extend({type:"inlet~",inletDefs:[n.extend({crossPatch:!0})],outletDefs:[r]})}},{"../core/PdObject":4,"../core/portlets":7,"../core/utils":8,"../global":9,chai:30,underscore:70,waawire:81}],15:[function(t,e,n){var r=t("../global"),i=e.exports=function(t){return"undefined"==typeof AudioContext?console.error("this environment doesn't support Web Audio API"):(this.channelCount=t.channelCount,this.setContext(t.audioContext||new AudioContext),r.settings.sampleRate=this.context.sampleRate,void Object.defineProperty(this,"time",{get:function(){return 1e3*this.context.currentTime}}))};i.prototype.start=function(){},i.prototype.stop=function(){},i.prototype.decode=function(t,e){this.context.decodeAudioData(t,function(t){var n,r=[];for(n=0;n<t.numberOfChannels;n++)r.push(t.getChannelData(n));e(null,r)},function(t){e(new Error("error decoding "+t))})},i.prototype.setContext=function(t){var e;for(this.context=t,this._channelMerger=this.context.createChannelMerger(this.channelCount),this._channelMerger.connect(this.context.destination),this.channels=[],e=0;e<this.channelCount;e++)this.channels.push(this.context.createGain()),this.channels[e].connect(this._channelMerger,0,e)}},{"../global":9}],16:[function(t,e,n){var r=t("underscore"),i=t("waaclock"),o=e.exports=function(t){var e=this;this._audioContext=t.audioContext,this._waaClock=t.waaClock||new i(t.audioContext),this._waaClock.start(),Object.defineProperty(this,"time",{get:function(){return 1e3*e._audioContext.currentTime}})};o.prototype.schedule=function(t,e,n){var i=this._waaClock.callbackAtTime(t,e/1e3);return r.isNumber(n)&&i.repeat(n/1e3),i},o.prototype.unschedule=function(t){t.clear()}},{underscore:70,waaclock:71}],17:[function(t,e,n){var r=e.exports=function(){};r.prototype.get=function(t,e){var n=new XMLHttpRequest;n.onload=function(t){200===this.status?e(null,this.response):e(new Error("HTTP "+this.status+": "+this.statusText))},n.onerror=function(t){e(t)},n.open("GET",t,!0),n.responseType="arraybuffer",n.send()}},{}],18:[function(t,e,n){n.Clock=t("./Clock"),n.Audio=t("./Audio"),n.Storage=t("./Storage")},{"./Audio":15,"./Clock":16,"./Storage":17}],19:[function(t,e,n){},{}],20:[function(t,e,n){function r(t,e,n){if(!(this instanceof r))return new r(t,e,n);var i,o=typeof t;if("number"===o)i=t>0?t>>>0:0;else if("string"===o)"base64"===e&&(t=M(t)),i=r.byteLength(t,e);else{if("object"!==o||null===t)throw new TypeError("must start with number, buffer, array or string");"Buffer"===t.type&&I(t.data)&&(t=t.data),i=+t.length>0?Math.floor(+t.length):0}if(this.length>R)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+R.toString(16)+" bytes");var a;r.TYPED_ARRAY_SUPPORT?a=r._augment(new Uint8Array(i)):(a=this,a.length=i,a._isBuffer=!0);var s;if(r.TYPED_ARRAY_SUPPORT&&"number"==typeof t.byteLength)a._set(t);else if(N(t))if(r.isBuffer(t))for(s=0;i>s;s++)a[s]=t.readUInt8(s);else for(s=0;i>s;s++)a[s]=(t[s]%256+256)%256;else if("string"===o)a.write(t,0,e);else if("number"===o&&!r.TYPED_ARRAY_SUPPORT&&!n)for(s=0;i>s;s++)a[s]=0;return a}function i(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r),r>i&&(r=i)):r=i;var o=e.length;if(o%2!==0)throw new Error("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;r>a;a++){var s=parseInt(e.substr(2*a,2),16);if(isNaN(s))throw new Error("Invalid hex string");t[n+a]=s}return a}function o(t,e,n,r){var i=O(j(e),t,n,r);return i}function a(t,e,n,r){var i=O(S(e),t,n,r);return i}function s(t,e,n,r){return a(t,e,n,r)}function u(t,e,n,r){var i=O(T(e),t,n,r);return i}function c(t,e,n,r){var i=O(k(e),t,n,r,2);return i}function l(t,e,n){return C.fromByteArray(0===e&&n===t.length?t:t.slice(e,n))}function f(t,e,n){var r="",i="";n=Math.min(t.length,n);for(var o=e;n>o;o++)t[o]<=127?(r+=D(i)+String.fromCharCode(t[o]),i=""):i+="%"+t[o].toString(16);return r+D(i)}function h(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;n>i;i++)r+=String.fromCharCode(t[i]);return r}function p(t,e,n){return h(t,e,n)}function d(t,e,n){var r=t.length;(!e||0>e)&&(e=0),(!n||0>n||n>r)&&(n=r);for(var i="",o=e;n>o;o++)i+=E(t[o]);return i}function g(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function m(t,e,n){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function v(t,e,n,i,o,a){if(!r.isBuffer(t))throw new TypeError("buffer must be a Buffer instance");if(e>o||a>e)throw new TypeError("value is out of bounds");if(n+i>t.length)throw new TypeError("index out of range")}function y(t,e,n,r){0>e&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);o>i;i++)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function b(t,e,n,r){0>e&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);o>i;i++)t[n+i]=e>>>8*(r?i:3-i)&255}function _(t,e,n,r,i,o){if(e>i||o>e)throw new TypeError("value is out of bounds");if(n+r>t.length)throw new TypeError("index out of range")}function x(t,e,n,r,i){return i||_(t,e,n,4,3.4028234663852886e38,-3.4028234663852886e38),P.write(t,e,n,r,23,4),n+4}function w(t,e,n,r,i){return i||_(t,e,n,8,1.7976931348623157e308,-1.7976931348623157e308),P.write(t,e,n,r,52,8),n+8}function M(t){for(t=A(t).replace(L,"");t.length%4!==0;)t+="=";return t}function A(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function N(t){return I(t)||r.isBuffer(t)||t&&"object"==typeof t&&"number"==typeof t.length}function E(t){return 16>t?"0"+t.toString(16):t.toString(16)}function j(t){for(var e=[],n=0;n<t.length;n++){var r=t.charCodeAt(n);if(127>=r)e.push(r);else{var i=n;r>=55296&&57343>=r&&n++;for(var o=encodeURIComponent(t.slice(i,n+1)).substr(1).split("%"),a=0;a<o.length;a++)e.push(parseInt(o[a],16))}}return e}function S(t){for(var e=[],n=0;n<t.length;n++)e.push(255&t.charCodeAt(n));return e}function k(t){for(var e,n,r,i=[],o=0;o<t.length;o++)e=t.charCodeAt(o),n=e>>8,r=e%256,i.push(r),i.push(n);return i}function T(t){return C.toByteArray(t)}function O(t,e,n,r,i){i&&(r-=r%i);for(var o=0;r>o&&!(o+n>=e.length||o>=t.length);o++)e[o+n]=t[o];return o}function D(t){try{return decodeURIComponent(t)}catch(e){return String.fromCharCode(65533)}}var C=t("base64-js"),P=t("ieee754"),I=t("is-array");n.Buffer=r,n.SlowBuffer=r,n.INSPECT_MAX_BYTES=50,r.poolSize=8192;var R=1073741823;r.TYPED_ARRAY_SUPPORT=function(){try{var t=new ArrayBuffer(0),e=new Uint8Array(t);return e.foo=function(){return 42},42===e.foo()&&"function"==typeof e.subarray&&0===new Uint8Array(1).subarray(1,1).byteLength}catch(n){return!1}}(),r.isBuffer=function(t){return!(null==t||!t._isBuffer)},r.compare=function(t,e){if(!r.isBuffer(t)||!r.isBuffer(e))throw new TypeError("Arguments must be Buffers");for(var n=t.length,i=e.length,o=0,a=Math.min(n,i);a>o&&t[o]===e[o];o++);return o!==a&&(n=t[o],i=e[o]),i>n?-1:n>i?1:0},r.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},r.concat=function(t,e){if(!I(t))throw new TypeError("Usage: Buffer.concat(list[, length])");if(0===t.length)return new r(0);if(1===t.length)return t[0];var n;if(void 0===e)for(e=0,n=0;n<t.length;n++)e+=t[n].length;var i=new r(e),o=0;for(n=0;n<t.length;n++){var a=t[n];a.copy(i,o),o+=a.length}return i},r.byteLength=function(t,e){var n;switch(t+="",e||"utf8"){case"ascii":case"binary":case"raw":n=t.length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*t.length;break;case"hex":n=t.length>>>1;break;case"utf8":case"utf-8":n=j(t).length;break;case"base64":n=T(t).length;break;default:n=t.length}return n},r.prototype.length=void 0,r.prototype.parent=void 0,r.prototype.toString=function(t,e,n){var r=!1;if(e>>>=0,n=void 0===n||n===1/0?this.length:n>>>0,t||(t="utf8"),0>e&&(e=0),n>this.length&&(n=this.length),e>=n)return"";for(;;)switch(t){case"hex":return d(this,e,n);case"utf8":case"utf-8":return f(this,e,n);case"ascii":return h(this,e,n);case"binary":return p(this,e,n);case"base64":return l(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}},r.prototype.equals=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return 0===r.compare(this,t)},r.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},r.prototype.compare=function(t){if(!r.isBuffer(t))throw new TypeError("Argument must be a Buffer");return r.compare(this,t)},r.prototype.get=function(t){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(t)},r.prototype.set=function(t,e){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(t,e)},r.prototype.write=function(t,e,n,r){if(isFinite(e))isFinite(n)||(r=n,n=void 0);else{var l=r;r=e,e=n,n=l}e=Number(e)||0;var f=this.length-e;n?(n=Number(n),n>f&&(n=f)):n=f,r=String(r||"utf8").toLowerCase();var h;switch(r){case"hex":h=i(this,t,e,n);break;case"utf8":case"utf-8":h=o(this,t,e,n);break;case"ascii":h=a(this,t,e,n);break;case"binary":h=s(this,t,e,n);break;case"base64":h=u(this,t,e,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=c(this,t,e,n);break;default:throw new TypeError("Unknown encoding: "+r)}return h},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},r.prototype.slice=function(t,e){var n=this.length;if(t=~~t,e=void 0===e?n:~~e,0>t?(t+=n,0>t&&(t=0)):t>n&&(t=n),0>e?(e+=n,0>e&&(e=0)):e>n&&(e=n),t>e&&(e=t),r.TYPED_ARRAY_SUPPORT)return r._augment(this.subarray(t,e));for(var i=e-t,o=new r(i,void 0,!0),a=0;i>a;a++)o[a]=this[a+t];return o},r.prototype.readUInt8=function(t,e){return e||m(t,1,this.length),this[t]},r.prototype.readUInt16LE=function(t,e){return e||m(t,2,this.length),this[t]|this[t+1]<<8},r.prototype.readUInt16BE=function(t,e){return e||m(t,2,this.length),this[t]<<8|this[t+1]},r.prototype.readUInt32LE=function(t,e){return e||m(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},r.prototype.readUInt32BE=function(t,e){return e||m(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},r.prototype.readInt8=function(t,e){return e||m(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},r.prototype.readInt16LE=function(t,e){e||m(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt16BE=function(t,e){e||m(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},r.prototype.readInt32LE=function(t,e){return e||m(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},r.prototype.readInt32BE=function(t,e){return e||m(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},r.prototype.readFloatLE=function(t,e){return e||m(t,4,this.length),P.read(this,t,!0,23,4)},r.prototype.readFloatBE=function(t,e){return e||m(t,4,this.length),P.read(this,t,!1,23,4)},r.prototype.readDoubleLE=function(t,e){return e||m(t,8,this.length),P.read(this,t,!0,52,8)},r.prototype.readDoubleBE=function(t,e){return e||m(t,8,this.length),P.read(this,t,!1,52,8)},r.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,1,255,0),r.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=t,e+1},r.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):y(this,t,e,!0),e+2},r.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,2,65535,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):y(this,t,e,!1),e+2},r.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=t):b(this,t,e,!0),e+4},r.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,4,4294967295,0),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):b(this,t,e,!1),e+4},r.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,1,127,-128),r.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[e]=t,e+1},r.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8):y(this,t,e,!0),e+2},r.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,2,32767,-32768),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=t):y(this,t,e,!1),e+2},r.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,4,2147483647,-2147483648),r.TYPED_ARRAY_SUPPORT?(this[e]=t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):b(this,t,e,!0),e+4},r.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||v(this,t,e,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),r.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=t):b(this,t,e,!1),e+4},r.prototype.writeFloatLE=function(t,e,n){return x(this,t,e,!0,n)},r.prototype.writeFloatBE=function(t,e,n){return x(this,t,e,!1,n)},r.prototype.writeDoubleLE=function(t,e,n){return w(this,t,e,!0,n)},r.prototype.writeDoubleBE=function(t,e,n){return w(this,t,e,!1,n)},r.prototype.copy=function(t,e,n,i){var o=this;if(n||(n=0),i||0===i||(i=this.length),e||(e=0),i!==n&&0!==t.length&&0!==o.length){if(n>i)throw new TypeError("sourceEnd < sourceStart");if(0>e||e>=t.length)throw new TypeError("targetStart out of bounds");if(0>n||n>=o.length)throw new TypeError("sourceStart out of bounds");if(0>i||i>o.length)throw new TypeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e<i-n&&(i=t.length-e+n);var a=i-n;if(1e3>a||!r.TYPED_ARRAY_SUPPORT)for(var s=0;a>s;s++)t[s+e]=this[s+n];else t._set(this.subarray(n,n+a),e)}},r.prototype.fill=function(t,e,n){if(t||(t=0),e||(e=0),n||(n=this.length),e>n)throw new TypeError("end < start");if(n!==e&&0!==this.length){if(0>e||e>=this.length)throw new TypeError("start out of bounds");if(0>n||n>this.length)throw new TypeError("end out of bounds");var r;if("number"==typeof t)for(r=e;n>r;r++)this[r]=t;else{var i=j(t.toString()),o=i.length;for(r=e;n>r;r++)this[r]=i[r%o]}return this}},r.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(r.TYPED_ARRAY_SUPPORT)return new r(this).buffer;for(var t=new Uint8Array(this.length),e=0,n=t.length;n>e;e+=1)t[e]=this[e];return t.buffer}throw new TypeError("Buffer.toArrayBuffer not supported in this browser")};var q=r.prototype;r._augment=function(t){return t.constructor=r,t._isBuffer=!0,t._get=t.get,t._set=t.set,t.get=q.get,t.set=q.set,t.write=q.write,t.toString=q.toString,t.toLocaleString=q.toString,t.toJSON=q.toJSON,t.equals=q.equals,t.compare=q.compare,t.copy=q.copy,t.slice=q.slice,t.readUInt8=q.readUInt8,t.readUInt16LE=q.readUInt16LE,t.readUInt16BE=q.readUInt16BE,t.readUInt32LE=q.readUInt32LE,t.readUInt32BE=q.readUInt32BE,t.readInt8=q.readInt8,t.readInt16LE=q.readInt16LE,t.readInt16BE=q.readInt16BE,t.readInt32LE=q.readInt32LE,t.readInt32BE=q.readInt32BE,t.readFloatLE=q.readFloatLE,t.readFloatBE=q.readFloatBE,t.readDoubleLE=q.readDoubleLE,t.readDoubleBE=q.readDoubleBE,t.writeUInt8=q.writeUInt8,t.writeUInt16LE=q.writeUInt16LE,t.writeUInt16BE=q.writeUInt16BE,t.writeUInt32LE=q.writeUInt32LE,t.writeUInt32BE=q.writeUInt32BE,t.writeInt8=q.writeInt8,t.writeInt16LE=q.writeInt16LE,t.writeInt16BE=q.writeInt16BE,t.writeInt32LE=q.writeInt32LE,t.writeInt32BE=q.writeInt32BE,t.writeFloatLE=q.writeFloatLE,t.writeFloatBE=q.writeFloatBE,t.writeDoubleLE=q.writeDoubleLE,t.writeDoubleBE=q.writeDoubleBE,t.fill=q.fill,t.inspect=q.inspect,t.toArrayBuffer=q.toArrayBuffer,t};var L=/[^+\/0-9A-z]/g},{"base64-js":21,ieee754:22,"is-array":23}],21:[function(t,e,n){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(t){"use strict";function e(t){var e=t.charCodeAt(0);return e===a?62:e===s?63:u>e?-1:u+10>e?e-u+26+26:l+26>e?e-l:c+26>e?e-c+26:void 0}function n(t){function n(t){c[f++]=t}var r,i,a,s,u,c;if(t.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=t.length;u="="===t.charAt(l-2)?2:"="===t.charAt(l-1)?1:0,c=new o(3*t.length/4-u),a=u>0?t.length-4:t.length;var f=0;for(r=0,i=0;a>r;r+=4,i+=3)s=e(t.charAt(r))<<18|e(t.charAt(r+1))<<12|e(t.charAt(r+2))<<6|e(t.charAt(r+3)),n((16711680&s)>>16),n((65280&s)>>8),n(255&s);return 2===u?(s=e(t.charAt(r))<<2|e(t.charAt(r+1))>>4,n(255&s)):1===u&&(s=e(t.charAt(r))<<10|e(t.charAt(r+1))<<4|e(t.charAt(r+2))>>2,n(s>>8&255),n(255&s)),c}function i(t){function e(t){return r.charAt(t)}function n(t){return e(t>>18&63)+e(t>>12&63)+e(t>>6&63)+e(63&t)}var i,o,a,s=t.length%3,u="";for(i=0,a=t.length-s;a>i;i+=3)o=(t[i]<<16)+(t[i+1]<<8)+t[i+2],u+=n(o);switch(s){case 1:o=t[t.length-1],u+=e(o>>2),u+=e(o<<4&63),u+="==";break;case 2:o=(t[t.length-2]<<8)+t[t.length-1],u+=e(o>>10),u+=e(o>>4&63),u+=e(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="+".charCodeAt(0),s="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0);t.toByteArray=n,t.fromByteArray=i}("undefined"==typeof n?this.base64js={}:n)},{}],22:[function(t,e,n){n.read=function(t,e,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,c=u>>1,l=-7,f=n?i-1:0,h=n?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=h,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=r;l>0;a=256*a+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return a?0/0:(p?-1:1)*(1/0);a+=Math.pow(2,r),o-=c}return(p?-1:1)*a*Math.pow(2,o-r)},n.write=function(t,e,n,r,i,o){var a,s,u,c=8*o-i-1,l=(1<<c)-1,f=l>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=0>e||0===e&&0>1/e?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),e+=a+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(a++,u/=2),a+f>=l?(s=0,a=l):a+f>=1?(s=(e*u-1)*Math.pow(2,i),a+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;t[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;t[n+p]=255&a,p+=d,a/=256,c-=8);t[n+p-d]|=128*g}},{}],23:[function(t,e,n){var r=Array.isArray,i=Object.prototype.toString;
  
  e.exports=r||function(t){return!!t&&"[object Array]"==i.call(t)}},{}],24:[function(t,e,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function o(t){return"number"==typeof t}function a(t){return"object"==typeof t&&null!==t}function s(t){return void 0===t}e.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!o(t)||0>t||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,n,r,o,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if(e=arguments[1],e instanceof Error)throw e;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[t],s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,o=new Array(r-1),u=1;r>u;u++)o[u-1]=arguments[u];n.apply(this,o)}else if(a(n)){for(r=arguments.length,o=new Array(r-1),u=1;r>u;u++)o[u-1]=arguments[u];for(c=n.slice(),r=c.length,u=0;r>u;u++)c[u].apply(this,o)}return!0},r.prototype.addListener=function(t,e){var n;if(!i(e))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",t,i(e.listener)?e.listener:e),this._events[t]?a(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,a(this._events[t])&&!this._events[t].warned){var n;n=s(this._maxListeners)?r.defaultMaxListeners:this._maxListeners,n&&n>0&&this._events[t].length>n&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())}return this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function n(){this.removeListener(t,n),r||(r=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var r=!1;return n.listener=e,this.on(t,n),this},r.prototype.removeListener=function(t,e){var n,r,o,s;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(n=this._events[t],o=n.length,r=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(n)){for(s=o;s-->0;)if(n[s]===e||n[s].listener&&n[s].listener===e){r=s;break}if(0>r)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[t],i(n))this.removeListener(t,n);else for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.listenerCount=function(t,e){var n;return n=t._events&&t._events[e]?i(t._events[e])?1:t._events[e].length:0}},{}],25:[function(t,e,n){e.exports="function"==typeof Object.create?function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}},{}],26:[function(t,e,n){(function(t){function e(t,e){for(var n=0,r=t.length-1;r>=0;r--){var i=t[r];"."===i?t.splice(r,1):".."===i?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r<t.length;r++)e(t[r],r,t)&&n.push(t[r]);return n}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(t){return i.exec(t).slice(1)};n.resolve=function(){for(var n="",i=!1,o=arguments.length-1;o>=-1&&!i;o--){var a=o>=0?arguments[o]:t.cwd();if("string"!=typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(n=a+"/"+n,i="/"===a.charAt(0))}return n=e(r(n.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+n||"."},n.normalize=function(t){var i=n.isAbsolute(t),o="/"===a(t,-1);return t=e(r(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},n.isAbsolute=function(t){return"/"===t.charAt(0)},n.join=function(){var t=Array.prototype.slice.call(arguments,0);return n.normalize(r(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},n.relative=function(t,e){function r(t){for(var e=0;e<t.length&&""===t[e];e++);for(var n=t.length-1;n>=0&&""===t[n];n--);return e>n?[]:t.slice(e,n-e+1)}t=n.resolve(t).substr(1),e=n.resolve(e).substr(1);for(var i=r(t.split("/")),o=r(e.split("/")),a=Math.min(i.length,o.length),s=a,u=0;a>u;u++)if(i[u]!==o[u]){s=u;break}for(var c=[],u=s;u<i.length;u++)c.push("..");return c=c.concat(o.slice(s)),c.join("/")},n.sep="/",n.delimiter=":",n.dirname=function(t){var e=o(t),n=e[0],r=e[1];return n||r?(r&&(r=r.substr(0,r.length-1)),n+r):"."},n.basename=function(t,e){var n=o(t)[2];return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},n.extname=function(t){return o(t)[3]};var a="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return 0>e&&(e=t.length+e),t.substr(e,n)}}).call(this,t("_process"))},{_process:27}],27:[function(t,e,n){function r(){}var i=e.exports={};i.nextTick=function(){var t="undefined"!=typeof window&&window.setImmediate,e="undefined"!=typeof window&&window.MutationObserver,n="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(t)return function(t){return window.setImmediate(t)};var r=[];if(e){var i=document.createElement("div"),o=new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})});return o.observe(i,{attributes:!0}),function(t){r.length||i.setAttribute("yes","no"),r.push(t)}}return n?(window.addEventListener("message",function(t){var e=t.source;if((e===window||null===e)&&"process-tick"===t.data&&(t.stopPropagation(),r.length>0)){var n=r.shift();n()}},!0),function(t){r.push(t),window.postMessage("process-tick","*")}):function(t){setTimeout(t,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=r,i.addListener=r,i.once=r,i.off=r,i.removeListener=r,i.removeAllListeners=r,i.emit=r,i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")}},{}],28:[function(t,e,n){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],29:[function(t,e,n){(function(e,r){function i(t,e){var r={seen:[],stylize:a};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(e)?r.showHidden=e:e&&n._extend(r,e),x(r.showHidden)&&(r.showHidden=!1),x(r.depth)&&(r.depth=2),x(r.colors)&&(r.colors=!1),x(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,t,r.depth)}function o(t,e){var n=i.styles[e];return n?"["+i.colors[n][0]+"m"+t+"["+i.colors[n][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,n){e[t]=!0}),e}function u(t,e,r){if(t.customInspect&&e&&E(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return b(i)||(i=u(t,i,r)),i}var o=c(t,e);if(o)return o;var a=Object.keys(e),g=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),N(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(e);if(0===a.length){if(E(e)){var m=e.name?": "+e.name:"";return t.stylize("[Function"+m+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(A(e))return t.stylize(Date.prototype.toString.call(e),"date");if(N(e))return l(e)}var v="",y=!1,_=["{","}"];if(d(e)&&(y=!0,_=["[","]"]),E(e)){var x=e.name?": "+e.name:"";v=" [Function"+x+"]"}if(w(e)&&(v=" "+RegExp.prototype.toString.call(e)),A(e)&&(v=" "+Date.prototype.toUTCString.call(e)),N(e)&&(v=" "+l(e)),0===a.length&&(!y||0==e.length))return _[0]+v+_[1];if(0>r)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var M;return M=y?f(t,e,r,g,a):a.map(function(n){return h(t,e,r,g,n,y)}),t.seen.pop(),p(M,v,_)}function c(t,e){if(x(e))return t.stylize("undefined","undefined");if(b(e)){var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string")}return y(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,n,r,i){for(var o=[],a=0,s=e.length;s>a;++a)o.push(O(e,String(a))?h(t,e,n,r,String(a),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(t,e,n,r,i,!0))}),o}function h(t,e,n,r,i,o){var a,s,c;if(c=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},c.get?s=c.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):c.set&&(s=t.stylize("[Setter]","special")),O(r,i)||(a="["+i+"]"),s||(t.seen.indexOf(c.value)<0?(s=m(n)?u(t,c.value,null):u(t,c.value,n-1),s.indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return"  "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return"   "+t}).join("\n"))):s=t.stylize("[Circular]","special")),x(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function p(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function d(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function m(t){return null===t}function v(t){return null==t}function y(t){return"number"==typeof t}function b(t){return"string"==typeof t}function _(t){return"symbol"==typeof t}function x(t){return void 0===t}function w(t){return M(t)&&"[object RegExp]"===S(t)}function M(t){return"object"==typeof t&&null!==t}function A(t){return M(t)&&"[object Date]"===S(t)}function N(t){return M(t)&&("[object Error]"===S(t)||t instanceof Error)}function E(t){return"function"==typeof t}function j(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function S(t){return Object.prototype.toString.call(t)}function k(t){return 10>t?"0"+t.toString(10):t.toString(10)}function T(){var t=new Date,e=[k(t.getHours()),k(t.getMinutes()),k(t.getSeconds())].join(":");return[t.getDate(),I[t.getMonth()],e].join(" ")}function O(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var D=/%[sdj%]/g;n.format=function(t){if(!b(t)){for(var e=[],n=0;n<arguments.length;n++)e.push(i(arguments[n]));return e.join(" ")}for(var n=1,r=arguments,o=r.length,a=String(t).replace(D,function(t){if("%%"===t)return"%";if(n>=o)return t;switch(t){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return t}}),s=r[n];o>n;s=r[++n])a+=m(s)||!M(s)?" "+s:" "+i(s);return a},n.deprecate=function(t,i){function o(){if(!a){if(e.throwDeprecation)throw new Error(i);e.traceDeprecation?console.trace(i):console.error(i),a=!0}return t.apply(this,arguments)}if(x(r.process))return function(){return n.deprecate(t,i).apply(this,arguments)};if(e.noDeprecation===!0)return t;var a=!1;return o};var C,P={};n.debuglog=function(t){if(x(C)&&(C=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!P[t])if(new RegExp("\\b"+t+"\\b","i").test(C)){var r=e.pid;P[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else P[t]=function(){};return P[t]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=d,n.isBoolean=g,n.isNull=m,n.isNullOrUndefined=v,n.isNumber=y,n.isString=b,n.isSymbol=_,n.isUndefined=x,n.isRegExp=w,n.isObject=M,n.isDate=A,n.isError=N,n.isFunction=E,n.isPrimitive=j,n.isBuffer=t("./support/isBuffer");var I=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",T(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!M(e))return t;for(var n=Object.keys(e),r=n.length;r--;)t[n[r]]=e[n[r]];return t}}).call(this,t("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":28,_process:27,inherits:25}],30:[function(t,e,n){e.exports=t("./lib/chai")},{"./lib/chai":31}],31:[function(t,e,n){var r=[],n=e.exports={};n.version="1.10.0",n.AssertionError=t("assertion-error");var i=t("./chai/utils");n.use=function(t){return~r.indexOf(t)||(t(this,i),r.push(t)),this};var o=t("./chai/config");n.config=o;var a=t("./chai/assertion");n.use(a);var s=t("./chai/core/assertions");n.use(s);var u=t("./chai/interface/expect");n.use(u);var c=t("./chai/interface/should");n.use(c);var l=t("./chai/interface/assert");n.use(l)},{"./chai/assertion":32,"./chai/config":33,"./chai/core/assertions":34,"./chai/interface/assert":35,"./chai/interface/expect":36,"./chai/interface/should":37,"./chai/utils":48,"assertion-error":57}],32:[function(t,e,n){var r=t("./config"),i=function(){};e.exports=function(t,e){function n(t,e,n){a(this,"ssfi",n||arguments.callee),a(this,"object",t),a(this,"message",e)}var o=t.AssertionError,a=e.flag;t.Assertion=n,Object.defineProperty(n,"includeStack",{get:function(){return console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),r.includeStack},set:function(t){console.warn("Assertion.includeStack is deprecated, use chai.config.includeStack instead."),r.includeStack=t}}),Object.defineProperty(n,"showDiff",{get:function(){return console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),r.showDiff},set:function(t){console.warn("Assertion.showDiff is deprecated, use chai.config.showDiff instead."),r.showDiff=t}}),n.addProperty=function(t,n){e.addProperty(this.prototype,t,n)},n.addMethod=function(t,n){e.addMethod(this.prototype,t,n)},n.addChainableMethod=function(t,n,r){e.addChainableMethod(this.prototype,t,n,r)},n.addChainableNoop=function(t,n){e.addChainableMethod(this.prototype,t,i,n)},n.overwriteProperty=function(t,n){e.overwriteProperty(this.prototype,t,n)},n.overwriteMethod=function(t,n){e.overwriteMethod(this.prototype,t,n)},n.overwriteChainableMethod=function(t,n,r){e.overwriteChainableMethod(this.prototype,t,n,r)},n.prototype.assert=function(t,n,i,s,u,c){var l=e.test(this,arguments);if(!0!==c&&(c=!1),!0!==r.showDiff&&(c=!1),!l){var n=e.getMessage(this,arguments),f=e.getActual(this,arguments);throw new o(n,{actual:f,expected:s,showDiff:c},r.includeStack?this.assert:a(this,"ssfi"))}},Object.defineProperty(n.prototype,"_obj",{get:function(){return a(this,"object")},set:function(t){a(this,"object",t)}})}},{"./config":33}],33:[function(t,e,n){e.exports={includeStack:!1,showDiff:!0,truncateThreshold:40}},{}],34:[function(t,e,n){e.exports=function(t,e){function n(t,n){n&&_(this,"message",n),t=t.toLowerCase();var r=_(this,"object"),i=~["a","e","i","o","u"].indexOf(t.charAt(0))?"an ":"a ";this.assert(t===e.type(r),"expected #{this} to be "+i+t,"expected #{this} not to be "+i+t)}function r(){_(this,"contains",!0)}function i(t,n){n&&_(this,"message",n);var r=_(this,"object"),i=!1;if("array"===e.type(r)&&"object"===e.type(t)){for(var o in r)if(e.eql(r[o],t)){i=!0;break}}else if("object"===e.type(t)){if(!_(this,"negate")){for(var a in t)new b(r).property(a,t[a]);return}var s={};for(var a in t)s[a]=r[a];i=e.eql(s,t)}else i=r&&~r.indexOf(t);this.assert(i,"expected #{this} to include "+e.inspect(t),"expected #{this} to not include "+e.inspect(t))}function o(){var t=_(this,"object"),e=Object.prototype.toString.call(t);this.assert("[object Arguments]"===e,"expected #{this} to be arguments but got "+e,"expected #{this} to not be arguments")}function a(t,e){e&&_(this,"message",e);var n=_(this,"object");return _(this,"deep")?this.eql(t):void this.assert(t===n,"expected #{this} to equal #{exp}","expected #{this} to not equal #{exp}",t,this._obj,!0)}function s(t,n){n&&_(this,"message",n),this.assert(e.eql(t,_(this,"object")),"expected #{this} to deeply equal #{exp}","expected #{this} to not deeply equal #{exp}",t,this._obj,!0)}function u(t,e){e&&_(this,"message",e);var n=_(this,"object");if(_(this,"doLength")){new b(n,e).to.have.property("length");var r=n.length;this.assert(r>t,"expected #{this} to have a length above #{exp} but got #{act}","expected #{this} to not have a length above #{exp}",t,r)}else this.assert(n>t,"expected #{this} to be above "+t,"expected #{this} to be at most "+t)}function c(t,e){e&&_(this,"message",e);var n=_(this,"object");if(_(this,"doLength")){new b(n,e).to.have.property("length");var r=n.length;this.assert(r>=t,"expected #{this} to have a length at least #{exp} but got #{act}","expected #{this} to have a length below #{exp}",t,r)}else this.assert(n>=t,"expected #{this} to be at least "+t,"expected #{this} to be below "+t)}function l(t,e){e&&_(this,"message",e);var n=_(this,"object");if(_(this,"doLength")){new b(n,e).to.have.property("length");var r=n.length;this.assert(t>r,"expected #{this} to have a length below #{exp} but got #{act}","expected #{this} to not have a length below #{exp}",t,r)}else this.assert(t>n,"expected #{this} to be below "+t,"expected #{this} to be at least "+t)}function f(t,e){e&&_(this,"message",e);var n=_(this,"object");if(_(this,"doLength")){new b(n,e).to.have.property("length");var r=n.length;this.assert(t>=r,"expected #{this} to have a length at most #{exp} but got #{act}","expected #{this} to have a length above #{exp}",t,r)}else this.assert(t>=n,"expected #{this} to be at most "+t,"expected #{this} to be above "+t)}function h(t,n){n&&_(this,"message",n);var r=e.getName(t);this.assert(_(this,"object")instanceof t,"expected #{this} to be an instance of "+r,"expected #{this} to not be an instance of "+r)}function p(t,n){n&&_(this,"message",n);var r=_(this,"object");this.assert(r.hasOwnProperty(t),"expected #{this} to have own property "+e.inspect(t),"expected #{this} to not have own property "+e.inspect(t))}function d(){_(this,"doLength",!0)}function g(t,e){e&&_(this,"message",e);var n=_(this,"object");new b(n,e).to.have.property("length");var r=n.length;this.assert(r==t,"expected #{this} to have a length of #{exp} but got #{act}","expected #{this} to not have a length of #{act}",t,r)}function m(t){var n,r=_(this,"object"),i=!0;if(t=t instanceof Array?t:Array.prototype.slice.call(arguments),!t.length)throw new Error("keys required");var o=Object.keys(r),a=t,s=t.length;if(i=t.every(function(t){return~o.indexOf(t)}),_(this,"negate")||_(this,"contains")||(i=i&&t.length==o.length),s>1){t=t.map(function(t){return e.inspect(t)});var u=t.pop();n=t.join(", ")+", and "+u}else n=e.inspect(t[0]);n=(s>1?"keys ":"key ")+n,n=(_(this,"contains")?"contain ":"have ")+n,this.assert(i,"expected #{this} to "+n,"expected #{this} to not "+n,a.sort(),o.sort(),!0)}function v(t,n,r){r&&_(this,"message",r);var i=_(this,"object");new b(i,r).is.a("function");var o=!1,a=null,s=null,u=null;0===arguments.length?(n=null,t=null):t&&(t instanceof RegExp||"string"==typeof t)?(n=t,t=null):t&&t instanceof Error?(a=t,t=null,n=null):"function"==typeof t?(s=t.prototype.name||t.name,"Error"===s&&t!==Error&&(s=(new t).name)):t=null;try{i()}catch(c){if(a)return this.assert(c===a,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}",a instanceof Error?a.toString():a,c instanceof Error?c.toString():c),_(this,"object",c),this;if(t&&(this.assert(c instanceof t,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp} but #{act} was thrown",s,c instanceof Error?c.toString():c),!n))return _(this,"object",c),this;var l="object"===e.type(c)&&"message"in c?c.message:""+c;if(null!=l&&n&&n instanceof RegExp)return this.assert(n.exec(l),"expected #{this} to throw error matching #{exp} but got #{act}","expected #{this} to throw error not matching #{exp}",n,l),_(this,"object",c),this;if(null!=l&&n&&"string"==typeof n)return this.assert(~l.indexOf(n),"expected #{this} to throw error including #{exp} but got #{act}","expected #{this} to throw error not including #{act}",n,l),_(this,"object",c),this;o=!0,u=c}var f="",h=null!==s?s:a?"#{exp}":"an error";o&&(f=" but #{act} was thrown"),this.assert(o===!0,"expected #{this} to throw "+h+f,"expected #{this} to not throw "+h+f,a instanceof Error?a.toString():a,u instanceof Error?u.toString():u),_(this,"object",u)}function y(t,e,n){return t.every(function(t){return n?e.some(function(e){return n(t,e)}):-1!==e.indexOf(t)})}var b=t.Assertion,_=(Object.prototype.toString,e.flag);["to","be","been","is","and","has","have","with","that","at","of","same"].forEach(function(t){b.addProperty(t,function(){return this})}),b.addProperty("not",function(){_(this,"negate",!0)}),b.addProperty("deep",function(){_(this,"deep",!0)}),b.addChainableMethod("an",n),b.addChainableMethod("a",n),b.addChainableMethod("include",i,r),b.addChainableMethod("contain",i,r),b.addChainableNoop("ok",function(){this.assert(_(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),b.addChainableNoop("true",function(){this.assert(!0===_(this,"object"),"expected #{this} to be true","expected #{this} to be false",this.negate?!1:!0)}),b.addChainableNoop("false",function(){this.assert(!1===_(this,"object"),"expected #{this} to be false","expected #{this} to be true",this.negate?!0:!1)}),b.addChainableNoop("null",function(){this.assert(null===_(this,"object"),"expected #{this} to be null","expected #{this} not to be null")}),b.addChainableNoop("undefined",function(){this.assert(void 0===_(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")}),b.addChainableNoop("exist",function(){this.assert(null!=_(this,"object"),"expected #{this} to exist","expected #{this} to not exist")}),b.addChainableNoop("empty",function(){var t=_(this,"object"),e=t;Array.isArray(t)||"string"==typeof object?e=t.length:"object"==typeof t&&(e=Object.keys(t).length),this.assert(!e,"expected #{this} to be empty","expected #{this} not to be empty")}),b.addChainableNoop("arguments",o),b.addChainableNoop("Arguments",o),b.addMethod("equal",a),b.addMethod("equals",a),b.addMethod("eq",a),b.addMethod("eql",s),b.addMethod("eqls",s),b.addMethod("above",u),b.addMethod("gt",u),b.addMethod("greaterThan",u),b.addMethod("least",c),b.addMethod("gte",c),b.addMethod("below",l),b.addMethod("lt",l),b.addMethod("lessThan",l),b.addMethod("most",f),b.addMethod("lte",f),b.addMethod("within",function(t,e,n){n&&_(this,"message",n);var r=_(this,"object"),i=t+".."+e;if(_(this,"doLength")){new b(r,n).to.have.property("length");var o=r.length;this.assert(o>=t&&e>=o,"expected #{this} to have a length within "+i,"expected #{this} to not have a length within "+i)}else this.assert(r>=t&&e>=r,"expected #{this} to be within "+i,"expected #{this} to not be within "+i)}),b.addMethod("instanceof",h),b.addMethod("instanceOf",h),b.addMethod("property",function(t,n,r){r&&_(this,"message",r);var i=_(this,"deep")?"deep property ":"property ",o=_(this,"negate"),a=_(this,"object"),s=_(this,"deep")?e.getPathValue(t,a):a[t];if(o&&void 0!==n){if(void 0===s)throw r=null!=r?r+": ":"",new Error(r+e.inspect(a)+" has no "+i+e.inspect(t))}else this.assert(void 0!==s,"expected #{this} to have a "+i+e.inspect(t),"expected #{this} to not have "+i+e.inspect(t));void 0!==n&&this.assert(n===s,"expected #{this} to have a "+i+e.inspect(t)+" of #{exp}, but got #{act}","expected #{this} to not have a "+i+e.inspect(t)+" of #{act}",n,s),_(this,"object",s)}),b.addMethod("ownProperty",p),b.addMethod("haveOwnProperty",p),b.addChainableMethod("length",g,d),b.addMethod("lengthOf",g),b.addMethod("match",function(t,e){e&&_(this,"message",e);var n=_(this,"object");this.assert(t.exec(n),"expected #{this} to match "+t,"expected #{this} not to match "+t)}),b.addMethod("string",function(t,n){n&&_(this,"message",n);var r=_(this,"object");new b(r,n).is.a("string"),this.assert(~r.indexOf(t),"expected #{this} to contain "+e.inspect(t),"expected #{this} to not contain "+e.inspect(t))}),b.addMethod("keys",m),b.addMethod("key",m),b.addMethod("throw",v),b.addMethod("throws",v),b.addMethod("Throw",v),b.addMethod("respondTo",function(t,n){n&&_(this,"message",n);var r=_(this,"object"),i=_(this,"itself"),o="function"!==e.type(r)||i?r[t]:r.prototype[t];this.assert("function"==typeof o,"expected #{this} to respond to "+e.inspect(t),"expected #{this} to not respond to "+e.inspect(t))}),b.addProperty("itself",function(){_(this,"itself",!0)}),b.addMethod("satisfy",function(t,n){n&&_(this,"message",n);var r=_(this,"object"),i=t(r);this.assert(i,"expected #{this} to satisfy "+e.objDisplay(t),"expected #{this} to not satisfy"+e.objDisplay(t),this.negate?!1:!0,i)}),b.addMethod("closeTo",function(t,n,r){r&&_(this,"message",r);var i=_(this,"object");if(new b(i,r).is.a("number"),"number"!==e.type(t)||"number"!==e.type(n))throw new Error("the arguments to closeTo must be numbers");this.assert(Math.abs(i-t)<=n,"expected #{this} to be close to "+t+" +/- "+n,"expected #{this} not to be close to "+t+" +/- "+n)}),b.addMethod("members",function(t,n){n&&_(this,"message",n);var r=_(this,"object");new b(r).to.be.an("array"),new b(t).to.be.an("array");var i=_(this,"deep")?e.eql:void 0;return _(this,"contains")?this.assert(y(t,r,i),"expected #{this} to be a superset of #{act}","expected #{this} to not be a superset of #{act}",r,t):void this.assert(y(r,t,i)&&y(t,r,i),"expected #{this} to have the same members as #{act}","expected #{this} to not have the same members as #{act}",r,t)})}},{}],35:[function(require,module,exports){module.exports=function(chai,util){var Assertion=chai.Assertion,flag=util.flag,assert=chai.assert=function(t,e){var n=new Assertion(null,null,chai.assert);n.assert(t,e,"[ negation message unavailable ]")};assert.fail=function(t,e,n,r){throw n=n||"assert.fail()",new chai.AssertionError(n,{actual:t,expected:e,operator:r},assert.fail)},assert.ok=function(t,e){new Assertion(t,e).is.ok},assert.notOk=function(t,e){new Assertion(t,e).is.not.ok},assert.equal=function(t,e,n){var r=new Assertion(t,n,assert.equal);r.assert(e==flag(r,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",e,t)},assert.notEqual=function(t,e,n){var r=new Assertion(t,n,assert.notEqual);r.assert(e!=flag(r,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",e,t)},assert.strictEqual=function(t,e,n){new Assertion(t,n).to.equal(e)},assert.notStrictEqual=function(t,e,n){new Assertion(t,n).to.not.equal(e)},assert.deepEqual=function(t,e,n){new Assertion(t,n).to.eql(e)},assert.notDeepEqual=function(t,e,n){new Assertion(t,n).to.not.eql(e)},assert.isTrue=function(t,e){new Assertion(t,e).is["true"]},assert.isFalse=function(t,e){new Assertion(t,e).is["false"]},assert.isNull=function(t,e){new Assertion(t,e).to.equal(null)},assert.isNotNull=function(t,e){new Assertion(t,e).to.not.equal(null)},assert.isUndefined=function(t,e){new Assertion(t,e).to.equal(void 0)},assert.isDefined=function(t,e){new Assertion(t,e).to.not.equal(void 0)},assert.isFunction=function(t,e){new Assertion(t,e).to.be.a("function")},assert.isNotFunction=function(t,e){new Assertion(t,e).to.not.be.a("function")},assert.isObject=function(t,e){new Assertion(t,e).to.be.a("object")},assert.isNotObject=function(t,e){new Assertion(t,e).to.not.be.a("object")},assert.isArray=function(t,e){new Assertion(t,e).to.be.an("array")},assert.isNotArray=function(t,e){new Assertion(t,e).to.not.be.an("array")},assert.isString=function(t,e){new Assertion(t,e).to.be.a("string")},assert.isNotString=function(t,e){new Assertion(t,e).to.not.be.a("string")},assert.isNumber=function(t,e){new Assertion(t,e).to.be.a("number")},assert.isNotNumber=function(t,e){new Assertion(t,e).to.not.be.a("number")},assert.isBoolean=function(t,e){new Assertion(t,e).to.be.a("boolean")},assert.isNotBoolean=function(t,e){new Assertion(t,e).to.not.be.a("boolean")},assert.typeOf=function(t,e,n){new Assertion(t,n).to.be.a(e)},assert.notTypeOf=function(t,e,n){new Assertion(t,n).to.not.be.a(e)},assert.instanceOf=function(t,e,n){new Assertion(t,n).to.be.instanceOf(e)},assert.notInstanceOf=function(t,e,n){new Assertion(t,n).to.not.be.instanceOf(e)},assert.include=function(t,e,n){new Assertion(t,n,assert.include).include(e)},assert.notInclude=function(t,e,n){new Assertion(t,n,assert.notInclude).not.include(e)},assert.match=function(t,e,n){new Assertion(t,n).to.match(e)},assert.notMatch=function(t,e,n){new Assertion(t,n).to.not.match(e)},assert.property=function(t,e,n){new Assertion(t,n).to.have.property(e)},assert.notProperty=function(t,e,n){new Assertion(t,n).to.not.have.property(e)},assert.deepProperty=function(t,e,n){new Assertion(t,n).to.have.deep.property(e)},assert.notDeepProperty=function(t,e,n){new Assertion(t,n).to.not.have.deep.property(e)},assert.propertyVal=function(t,e,n,r){new Assertion(t,r).to.have.property(e,n)},assert.propertyNotVal=function(t,e,n,r){new Assertion(t,r).to.not.have.property(e,n)},assert.deepPropertyVal=function(t,e,n,r){new Assertion(t,r).to.have.deep.property(e,n)},assert.deepPropertyNotVal=function(t,e,n,r){new Assertion(t,r).to.not.have.deep.property(e,n)},assert.lengthOf=function(t,e,n){new Assertion(t,n).to.have.length(e)},assert.Throw=function(t,e,n,r){("string"==typeof e||e instanceof RegExp)&&(n=e,e=null);var i=new Assertion(t,r).to.Throw(e,n);return flag(i,"object")},assert.doesNotThrow=function(t,e,n){"string"==typeof e&&(n=e,e=null),new Assertion(t,n).to.not.Throw(e)},assert.operator=function(val,operator,val2,msg){if(!~["==","===",">",">=","<","<=","!=","!=="].indexOf(operator))throw new Error('Invalid operator "'+operator+'"');var test=new Assertion(eval(val+operator+val2),msg);test.assert(!0===flag(test,"object"),"expected "+util.inspect(val)+" to be "+operator+" "+util.inspect(val2),"expected "+util.inspect(val)+" to not be "+operator+" "+util.inspect(val2))},assert.closeTo=function(t,e,n,r){new Assertion(t,r).to.be.closeTo(e,n)},assert.sameMembers=function(t,e,n){new Assertion(t,n).to.have.same.members(e)},assert.includeMembers=function(t,e,n){new Assertion(t,n).to.include.members(e)},assert.ifError=function(t,e){new Assertion(t,e).to.not.be.ok},function t(e,n){return assert[n]=assert[e],t}("Throw","throw")("Throw","throws")}},{}],36:[function(t,e,n){e.exports=function(t,e){t.expect=function(e,n){return new t.Assertion(e,n)}}},{}],37:[function(t,e,n){e.exports=function(t,e){function n(){function t(){return this instanceof String||this instanceof Number?new r(this.constructor(this),null,t):this instanceof Boolean?new r(1==this,null,t):new r(this,null,t)}function e(t){Object.defineProperty(this,"should",{value:t,enumerable:!0,configurable:!0,writable:!0})}Object.defineProperty(Object.prototype,"should",{
  set:e,get:t,configurable:!0});var n={};return n.equal=function(t,e,n){new r(t,n).to.equal(e)},n.Throw=function(t,e,n,i){new r(t,i).to.Throw(e,n)},n.exist=function(t,e){new r(t,e).to.exist},n.not={},n.not.equal=function(t,e,n){new r(t,n).to.not.equal(e)},n.not.Throw=function(t,e,n,i){new r(t,i).to.not.Throw(e,n)},n.not.exist=function(t,e){new r(t,e).to.not.exist},n["throw"]=n.Throw,n.not["throw"]=n.not.Throw,n}var r=t.Assertion;t.should=n,t.Should=n}},{}],38:[function(t,e,n){var r=t("./transferFlags"),i=t("./flag"),o=t("../config"),a="__proto__"in Object,s=/^(?:length|name|arguments|caller)$/,u=Function.prototype.call,c=Function.prototype.apply;e.exports=function(t,e,n,l){"function"!=typeof l&&(l=function(){});var f={method:n,chainingBehavior:l};t.__methods||(t.__methods={}),t.__methods[e]=f,Object.defineProperty(t,e,{get:function(){f.chainingBehavior.call(this);var e=function h(){var t=i(this,"ssfi");t&&o.includeStack===!1&&i(this,"ssfi",h);var e=f.method.apply(this,arguments);return void 0===e?this:e};if(a){var n=e.__proto__=Object.create(this);n.call=u,n.apply=c}else{var l=Object.getOwnPropertyNames(t);l.forEach(function(n){if(!s.test(n)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r)}})}return r(this,e),e},configurable:!0})}},{"../config":33,"./flag":41,"./transferFlags":55}],39:[function(t,e,n){var r=t("../config"),i=t("./flag");e.exports=function(t,e,n){t[e]=function(){var o=i(this,"ssfi");o&&r.includeStack===!1&&i(this,"ssfi",t[e]);var a=n.apply(this,arguments);return void 0===a?this:a}}},{"../config":33,"./flag":41}],40:[function(t,e,n){e.exports=function(t,e,n){Object.defineProperty(t,e,{get:function(){var t=n.call(this);return void 0===t?this:t},configurable:!0})}},{}],41:[function(t,e,n){e.exports=function(t,e,n){var r=t.__flags||(t.__flags=Object.create(null));return 3!==arguments.length?r[e]:void(r[e]=n)}},{}],42:[function(t,e,n){e.exports=function(t,e){return e.length>4?e[4]:t._obj}},{}],43:[function(t,e,n){e.exports=function(t){var e=[];for(var n in t)e.push(n);return e}},{}],44:[function(t,e,n){var r=t("./flag"),i=t("./getActual"),o=(t("./inspect"),t("./objDisplay"));e.exports=function(t,e){var n=r(t,"negate"),a=r(t,"object"),s=e[3],u=i(t,e),c=n?e[2]:e[1],l=r(t,"message");return"function"==typeof c&&(c=c()),c=c||"",c=c.replace(/#{this}/g,o(a)).replace(/#{act}/g,o(u)).replace(/#{exp}/g,o(s)),l?l+": "+c:c}},{"./flag":41,"./getActual":42,"./inspect":49,"./objDisplay":50}],45:[function(t,e,n){e.exports=function(t){if(t.name)return t.name;var e=/^\s?function ([^(]*)\(/.exec(t);return e&&e[1]?e[1]:""}},{}],46:[function(t,e,n){function r(t){var e=t.replace(/\[/g,".["),n=e.match(/(\\\.|[^.]+?)+/g);return n.map(function(t){var e=/\[(\d+)\]$/,n=e.exec(t);return n?{i:parseFloat(n[1])}:{p:t}})}function i(t,e){for(var n,r=e,i=0,o=t.length;o>i;i++){var a=t[i];r?("undefined"!=typeof a.p?r=r[a.p]:"undefined"!=typeof a.i&&(r=r[a.i]),i==o-1&&(n=r)):n=void 0}return n}e.exports=function(t,e){var n=r(t);return i(n,e)}},{}],47:[function(t,e,n){e.exports=function(t){function e(t){-1===n.indexOf(t)&&n.push(t)}for(var n=Object.getOwnPropertyNames(subject),r=Object.getPrototypeOf(subject);null!==r;)Object.getOwnPropertyNames(r).forEach(e),r=Object.getPrototypeOf(r);return n}},{}],48:[function(t,e,n){var n=e.exports={};n.test=t("./test"),n.type=t("./type"),n.getMessage=t("./getMessage"),n.getActual=t("./getActual"),n.inspect=t("./inspect"),n.objDisplay=t("./objDisplay"),n.flag=t("./flag"),n.transferFlags=t("./transferFlags"),n.eql=t("deep-eql"),n.getPathValue=t("./getPathValue"),n.getName=t("./getName"),n.addProperty=t("./addProperty"),n.addMethod=t("./addMethod"),n.overwriteProperty=t("./overwriteProperty"),n.overwriteMethod=t("./overwriteMethod"),n.addChainableMethod=t("./addChainableMethod"),n.overwriteChainableMethod=t("./overwriteChainableMethod")},{"./addChainableMethod":38,"./addMethod":39,"./addProperty":40,"./flag":41,"./getActual":42,"./getMessage":44,"./getName":45,"./getPathValue":46,"./inspect":49,"./objDisplay":50,"./overwriteChainableMethod":51,"./overwriteMethod":52,"./overwriteProperty":53,"./test":54,"./transferFlags":55,"./type":56,"deep-eql":58}],49:[function(t,e,n){function r(t,e,n,r){var o={showHidden:e,seen:[],stylize:function(t){return t}};return i(o,t,"undefined"==typeof n?2:n)}function i(t,e,r){if(e&&"function"==typeof e.inspect&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var d=e.inspect(r);return"string"!=typeof d&&(d=i(t,d,r)),d}var b=o(t,e);if(b)return b;if(y(e)){if("outerHTML"in e)return e.outerHTML;try{if(document.xmlVersion){var _=new XMLSerializer;return _.serializeToString(e)}var x="http://www.w3.org/1999/xhtml",w=document.createElementNS(x,"_");return w.appendChild(e.cloneNode(!1)),html=w.innerHTML.replace("><",">"+e.innerHTML+"<"),w.innerHTML="",html}catch(M){}}var A=v(e),N=t.showHidden?m(e):A;if(0===N.length||p(e)&&(1===N.length&&"stack"===N[0]||2===N.length&&"description"===N[0]&&"stack"===N[1])){if("function"==typeof e){var E=g(e),j=E?": "+E:"";return t.stylize("[Function"+j+"]","special")}if(f(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(h(e))return t.stylize(Date.prototype.toUTCString.call(e),"date");if(p(e))return a(e)}var S="",k=!1,T=["{","}"];if(l(e)&&(k=!0,T=["[","]"]),"function"==typeof e){var E=g(e),j=E?": "+E:"";S=" [Function"+j+"]"}if(f(e)&&(S=" "+RegExp.prototype.toString.call(e)),h(e)&&(S=" "+Date.prototype.toUTCString.call(e)),p(e))return a(e);if(0===N.length&&(!k||0==e.length))return T[0]+S+T[1];if(0>r)return f(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var O;return O=k?s(t,e,r,A,N):N.map(function(n){return u(t,e,r,A,n,k)}),t.seen.pop(),c(O,S,T)}function o(t,e){switch(typeof e){case"undefined":return t.stylize("undefined","undefined");case"string":var n="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(n,"string");case"number":return 0===e&&1/e===-(1/0)?t.stylize("-0","number"):t.stylize(""+e,"number");case"boolean":return t.stylize(""+e,"boolean")}return null===e?t.stylize("null","null"):void 0}function a(t){return"["+Error.prototype.toString.call(t)+"]"}function s(t,e,n,r,i){for(var o=[],a=0,s=e.length;s>a;++a)o.push(Object.prototype.hasOwnProperty.call(e,String(a))?u(t,e,n,r,String(a),!0):"");return i.forEach(function(i){i.match(/^\d+$/)||o.push(u(t,e,n,r,i,!0))}),o}function u(t,e,n,r,o,a){var s,u;if(e.__lookupGetter__&&(e.__lookupGetter__(o)?u=e.__lookupSetter__(o)?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):e.__lookupSetter__(o)&&(u=t.stylize("[Setter]","special"))),r.indexOf(o)<0&&(s="["+o+"]"),u||(t.seen.indexOf(e[o])<0?(u=null===n?i(t,e[o],null):i(t,e[o],n-1),u.indexOf("\n")>-1&&(u=a?u.split("\n").map(function(t){return"  "+t}).join("\n").substr(2):"\n"+u.split("\n").map(function(t){return"   "+t}).join("\n"))):u=t.stylize("[Circular]","special")),"undefined"==typeof s){if(a&&o.match(/^\d+$/))return u;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+u}function c(t,e,n){var r=0,i=t.reduce(function(t,e){return r++,e.indexOf("\n")>=0&&r++,t+e.length+1},0);return i>60?n[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+n[1]:n[0]+e+" "+t.join(", ")+" "+n[1]}function l(t){return Array.isArray(t)||"object"==typeof t&&"[object Array]"===d(t)}function f(t){return"object"==typeof t&&"[object RegExp]"===d(t)}function h(t){return"object"==typeof t&&"[object Date]"===d(t)}function p(t){return"object"==typeof t&&"[object Error]"===d(t)}function d(t){return Object.prototype.toString.call(t)}var g=t("./getName"),m=t("./getProperties"),v=t("./getEnumerableProperties");e.exports=r;var y=function(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName}},{"./getEnumerableProperties":43,"./getName":45,"./getProperties":47}],50:[function(t,e,n){var r=t("./inspect"),i=t("../config");e.exports=function(t){var e=r(t),n=Object.prototype.toString.call(t);if(i.truncateThreshold&&e.length>=i.truncateThreshold){if("[object Function]"===n)return t.name&&""!==t.name?"[Function: "+t.name+"]":"[Function]";if("[object Array]"===n)return"[ Array("+t.length+") ]";if("[object Object]"===n){var o=Object.keys(t),a=o.length>2?o.splice(0,2).join(", ")+", ...":o.join(", ");return"{ Object ("+a+") }"}return e}return e}},{"../config":33,"./inspect":49}],51:[function(t,e,n){e.exports=function(t,e,n,r){var i=t.__methods[e],o=i.chainingBehavior;i.chainingBehavior=function(){var t=r(o).call(this);return void 0===t?this:t};var a=i.method;i.method=function(){var t=n(a).apply(this,arguments);return void 0===t?this:t}}},{}],52:[function(t,e,n){e.exports=function(t,e,n){var r=t[e],i=function(){return this};r&&"function"==typeof r&&(i=r),t[e]=function(){var t=n(i).apply(this,arguments);return void 0===t?this:t}}},{}],53:[function(t,e,n){e.exports=function(t,e,n){var r=Object.getOwnPropertyDescriptor(t,e),i=function(){};r&&"function"==typeof r.get&&(i=r.get),Object.defineProperty(t,e,{get:function(){var t=n(i).call(this);return void 0===t?this:t},configurable:!0})}},{}],54:[function(t,e,n){var r=t("./flag");e.exports=function(t,e){var n=r(t,"negate"),i=e[0];return n?!i:i}},{"./flag":41}],55:[function(t,e,n){e.exports=function(t,e,n){var r=t.__flags||(t.__flags=Object.create(null));e.__flags||(e.__flags=Object.create(null)),n=3===arguments.length?n:!0;for(var i in r)(n||"object"!==i&&"ssfi"!==i&&"message"!=i)&&(e.__flags[i]=r[i])}},{}],56:[function(t,e,n){var r={"[object Arguments]":"arguments","[object Array]":"array","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object RegExp]":"regexp","[object String]":"string"};e.exports=function(t){var e=Object.prototype.toString.call(t);return r[e]?r[e]:null===t?"null":void 0===t?"undefined":t===Object(t)?"object":typeof t}},{}],57:[function(t,e,n){function r(){function t(t,n){Object.keys(n).forEach(function(r){~e.indexOf(r)||(t[r]=n[r])})}var e=[].slice.call(arguments);return function(){for(var e=[].slice.call(arguments),n=0,r={};n<e.length;n++)t(r,e[n]);return r}}function i(t,e,n){var i=r("name","message","stack","constructor","toJSON"),o=i(e||{});this.message=t||"Unspecified AssertionError",this.showDiff=!1;for(var a in o)this[a]=o[a];n=n||arguments.callee,n&&Error.captureStackTrace&&Error.captureStackTrace(this,n)}e.exports=i,i.prototype=Object.create(Error.prototype),i.prototype.name="AssertionError",i.prototype.constructor=i,i.prototype.toJSON=function(t){var e=r("constructor","toJSON","stack"),n=e({name:this.name},this);return!1!==t&&this.stack&&(n.stack=this.stack),n}},{}],58:[function(t,e,n){e.exports=t("./lib/eql")},{"./lib/eql":59}],59:[function(t,e,n){function r(t,e,n){return i(t,e)?!0:"date"===g(t)?a(t,e):"regexp"===g(t)?s(t,e):d.isBuffer(t)?f(t,e):"arguments"===g(t)?u(t,e,n):o(t,e)?"object"!==g(t)&&"object"!==g(e)&&"array"!==g(t)&&"array"!==g(e)?i(t,e):p(t,e,n):!1}function i(t,e){return t===e?0!==t||1/t===1/e:t!==t&&e!==e}function o(t,e){return g(t)===g(e)}function a(t,e){return"date"!==g(e)?!1:i(t.getTime(),e.getTime())}function s(t,e){return"regexp"!==g(e)?!1:i(t.toString(),e.toString())}function u(t,e,n){return"arguments"!==g(e)?!1:(t=[].slice.call(t),e=[].slice.call(e),r(t,e,n))}function c(t){var e=[];for(var n in t)e.push(n);return e}function l(t,e){if(t.length!==e.length)return!1;for(var n=0,r=!0;n<t.length;n++)if(t[n]!==e[n]){r=!1;break}return r}function f(t,e){return d.isBuffer(e)?l(t,e):!1}function h(t){return null!==t&&void 0!==t}function p(t,e,n){if(!h(t)||!h(e))return!1;if(t.prototype!==e.prototype)return!1;var i;if(n){for(i=0;i<n.length;i++)if(n[i][0]===t&&n[i][1]===e||n[i][0]===e&&n[i][1]===t)return!0}else n=[];try{var o=c(t),a=c(e)}catch(s){return!1}if(o.sort(),a.sort(),!l(o,a))return!1;n.push([t,e]);var u;for(i=o.length-1;i>=0;i--)if(u=o[i],!r(t[u],e[u],n))return!1;return!0}var d,g=t("type-detect");try{d=t("buffer").Buffer}catch(m){d={},d.isBuffer=function(){return!1}}e.exports=r},{buffer:20,"type-detect":60}],60:[function(t,e,n){e.exports=t("./lib/type")},{"./lib/type":61}],61:[function(t,e,n){function r(t){var e=Object.prototype.toString.call(t);return o[e]?o[e]:null===t?"null":void 0===t?"undefined":t===Object(t)?"object":typeof t}function i(){this.tests={}}var n=e.exports=r,o={"[object Array]":"array","[object RegExp]":"regexp","[object Function]":"function","[object Arguments]":"arguments","[object Date]":"date"};n.Library=i,i.prototype.of=r,i.prototype.define=function(t,e){return 1===arguments.length?this.tests[t]:(this.tests[t]=e,this)},i.prototype.test=function(t,e){if(e===r(t))return!0;var n=this.tests[e];if(n&&"regexp"===r(n))return n.test(t);if(n&&"function"===r(n))return n(t);throw new ReferenceError('Type test "'+e+'" not defined or invalid.')}},{}],62:[function(t,e,n){n.parse=t("./lib/parsing").parse,n.renderSvg=t("./lib/svg-rendering").render,n.renderPd=t("./lib/pd-rendering").render,n.Patch=t("./lib/Patch"),"undefined"!=typeof window&&(window.pdfu=n)},{"./lib/Patch":63,"./lib/parsing":64,"./lib/pd-rendering":65,"./lib/svg-rendering":66}],63:[function(t,e,n){var r=t("underscore"),i=e.exports=function(t){r.extend(this,t)};r.extend(i.prototype,{getNode:function(t){return r.find(this.nodes,function(e){return e.id===t})||null},guessPortlets:function(){var t=this;r.each(this.nodes,function(e){e.outlets=r.reduce(t.connections,function(t,n){return n.source.id===e.id?Math.max(t,n.source.port):t},-1)+1,e.inlets=r.reduce(t.connections,function(t,n){return n.sink.id===e.id?Math.max(t,n.sink.port):t},-1)+1})},getSinks:function(t){var e=r.filter(this.connections,function(e){return e.source.id===t.id}),n=r.uniq(r.map(e,function(t){return t.sink.id})),i=this;return r.map(n,function(t){return i.getNode(t)})},getSources:function(t){var e=r.filter(this.connections,function(e){return e.sink.id===t.id}),n=r.uniq(r.map(e,function(t){return t.source.id})),i=this;return r.map(n,function(t){return i.getNode(t)})},addNode:function(t){if(void 0===t.id)t.id=this.nextId();else if(null!==this.getNode(t.id))return;this.nodes.push(t)},nextId:function(){return this.nodes.length?Math.max.apply(Math,r.pluck(this.nodes,"id"))+1:0}})},{underscore:70}],64:[function(t,e,n){var r=t("underscore"),i=["obj","floatatom","symbolatom","msg","text"],o=/ |\r\n?|\n/,a=/,(?!\\)/,s=/\\(\$\d+)/g,u=/\\\,/g,c=/\\\;/g,l=/(#((.|\r|\n)*?)[^\\\\])\r{0,1}\n{0,1};\r{0,1}(\n|$)/i,f=function(t){return t.split("").reverse().join("")},h=n.parseArg=function(t){var e=p(t);if(r.isNumber(e)&&!isNaN(e))return e;if(r.isString(t)){var n,t=t.substr(0);for(t=t.replace(u,","),t=t.replace(c,";");n=s.exec(t);)t=t.replace(n[0],n[1]);return t}throw new Error("couldn't parse arg "+t)},p=n.parseFloat=function(t){return r.isNumber(t)&&!isNaN(t)?t:r.isString(t)?parseFloat(t):0/0},d=n.parseArgs=function(t){if(r.isNumber(t)&&!isNaN(t))return[t];var e,n,i,a=r.isString(t)?t.split(o):t,s=[];for(n=0,i=a.length;i>n;n++)""!==(e=a[n])&&s.push(h(e));return s};n.parse=function(t){return g(t)[0]};var g=function(t){var e,n=null,s=-1,u=function(){return s++,s},c={nodes:[],connections:[],layout:void 0,args:[]},h=!0,p=function(){t=t.slice(e.index+e[0].length)};for(l.lastIndex=0;e=t.match(l);){var v=f(e[1]).split(a).reverse().map(f),y=v[1],b=v[0].split(o),_=b[0];if("#N"===_){var x=b[1];if("canvas"!==x)throw new Error("invalid element type for chunk #N : "+x);if(h)c.layout={x:parseInt(b[2],10),y:parseInt(b[3],10),width:parseInt(b[4],10),height:parseInt(b[5],10),openOnLoad:b[7]},c.args=[b[6]],p();else{var w=g(t),M=w[0],A=w[2];c.nodes.push(r.extend({id:u(),subpatch:M},A)),t=w[1]}}else if("#X"===_){var x=b[1];if("restore"===x){var N={x:parseInt(b[2],10),y:parseInt(b[3],10)},E=b[4],j=[];if("pd"===E&&j.push(b[5]),n){for(var S=n.args[1];n.data.length<S;)n.data.push(0);n=null}return p(),[c,t,{proto:E,args:j,layout:N}]}if(r.contains(i,x)){var k,j,w,N={x:parseInt(b[2],10),y:parseInt(b[3],10)};if("obj"===x?(k=b[4],j=b.slice(5)):(k=x,j=b.slice(4)),"text"===x&&(j=[b.slice(4).join(" ")]),w=m(k,j,N),j=w[0],N=w[1],y)for(var T=y.split(o);T.length;){var O=T.shift();"f"===O&&(N.width=T.shift())}c.nodes.push({id:u(),proto:k,layout:N,args:d(j)})}else if("array"===x){var D=b[2],C=parseFloat(b[3]),P={id:u(),proto:"table",args:[D,C],data:[]};c.nodes.push(P),n=P}else if("connect"===x){var I=parseInt(b[2],10),R=parseInt(b[4],10),q=parseInt(b[3],10),L=parseInt(b[5],10);c.connections.push({source:{id:I,port:q},sink:{id:R,port:L}})}else if("coords"!==x)throw new Error("invalid element type for chunk #X : "+x);p()}else{if("#A"!==_)throw new Error("invalid chunk : "+_);var B,z,W,F=parseFloat(b[1]);if(n)for(B=2,z=b.length;z>B;B++,F++)W=parseFloat(b[B]),r.isNumber(W)&&!isNaN(W)&&(n.data[F]=W);else console.error("got table data outside of a table.");p()}h=!1}return[c,""]},m=function(t,e,n){return"floatatom"===t?(n.width=e[0],n.labelPos=e[3],n.label=e[4],e=[e[1],e[2],e[5],e[6]]):"symbolatom"===t?(n.width=e[0],n.labelPos=e[3],n.label=e[4],e=[e[1],e[2],e[5],e[6]]):"bng"===t?(n.size=e[0],n.hold=e[1],n.interrupt=e[2],n.label=e[6],n.labelX=e[7],n.labelY=e[8],n.labelFont=e[9],n.labelFontSize=e[10],n.bgColor=e[11],n.fgColor=e[12],n.labelColor=e[13],e=[e[3],e[4],e[5]]):"tgl"===t?(n.size=e[0],n.label=e[4],n.labelX=e[5],n.labelY=e[6],n.labelFont=e[7],n.labelFontSize=e[8],n.bgColor=e[9],n.fgColor=e[10],n.labelColor=e[11],e=[e[1],e[2],e[3],e[12],e[13]]):"nbx"===t?(n.size=e[0],n.height=e[1],n.log=e[4],n.label=e[8],n.labelX=e[9],n.labelY=e[10],n.labelFont=e[11],n.labelFontSize=e[12],n.bgColor=e[13],n.fgColor=e[14],n.labelColor=e[15],n.logHeight=e[17],e=[e[2],e[3],e[5],e[6],e[7],e[16]]):"vsl"===t?(n.width=e[0],n.height=e[1],n.log=e[4],n.label=e[8],n.labelX=e[9],n.labelY=e[10],n.labelFont=e[11],n.labelFontSize=e[12],n.bgColor=e[13],n.fgColor=e[14],n.labelColor=e[15],n.steadyOnClick=e[17],e=[e[2],e[3],e[5],e[6],e[7],e[2]+(e[3]-e[2])*e[16]/12700]):"hsl"===t?(n.width=e[0],n.height=e[1],n.log=e[4],n.label=e[8],n.labelX=e[9],n.labelY=e[10],n.labelFont=e[11],n.labelFontSize=e[12],n.bgColor=e[13],n.fgColor=e[14],n.labelColor=e[15],n.steadyOnClick=e[17],e=[e[2],e[3],e[5],e[6],e[7],e[2]+(e[3]-e[2])*e[16]/12700]):"vradio"===t?(n.size=e[0],n.label=e[6],n.labelX=e[7],n.labelY=e[8],n.labelFont=e[9],n.labelFontSize=e[10],n.bgColor=e[11],n.fgColor=e[12],n.labelColor=e[13],e=[e[1],e[2],e[3],e[4],e[5],e[14]]):"hradio"===t?(n.size=e[0],n.label=e[6],n.labelX=e[7],n.labelY=e[8],n.labelFont=e[9],n.labelFontSize=e[10],n.bgColor=e[11],n.fgColor=e[12],n.labelColor=e[13],e=[e[1],e[2],e[3],e[4],e[5],e[14]]):"vu"===t?(n.width=e[0],n.height=e[1],n.label=e[3],n.labelX=e[4],n.labelY=e[5],n.labelFont=e[6],n.labelFontSize=e[7],n.bgColor=e[8],n.labelColor=e[9],n.log=e[10],e=[e[2],e[11]]):"cnv"===t&&(n.size=e[0],n.width=e[1],n.height=e[2],n.label=e[5],n.labelX=e[6],n.labelY=e[7],n.labelFont=e[8],n.labelFontSize=e[9],n.bgColor=e[10],n.labelColor=e[11],e=[e[3],e[4],e[12]]),[e,n]}},{underscore:70}],65:[function(t,e,n){var r=t("mustache"),i=t("underscore");n.render=function(t){var e="",n=i.clone(t.layout||{});return i.defaults(n,{x:0,y:0,width:500,height:500}),e+=r.render(o,{args:t.args,layout:n})+";\n",i.forEach(t.nodes.sort(function(t,e){return t.id-e.id}),function(t){var n=i.clone(t.layout||{});i.defaults(n,{x:0,y:0}),e+=r.render(s,{args:t.args,layout:n,proto:t.proto})+";\n"}),i.forEach(t.connections,function(t){e+=r.render(a,t)+";\n"}),e};var o="#N canvas {{{layout.x}}} {{{layout.y}}} {{{layout.width}}} {{{layout.height}}} {{{args.0}}}{{#layout.openOnLoad}} {{{.}}}{{/layout.openOnLoad}}",a="#X connect {{{source.id}}} {{{source.port}}} {{{sink.id}}} {{{sink.port}}}",s="#X obj {{{layout.x}}} {{{layout.y}}} {{{proto}}}{{#args}} {{.}}{{/args}}"},{mustache:69,underscore:70}],66:[function(t,e,n){(function(e){var r=t("underscore"),i=t("d3"),o=t("./Patch"),a="undefined"!=typeof window;if(!a)var s=t("fs"),u=t("path"),c=s.readFileSync(u.join(e,"svg-default-style.css")).toString();var l={portletWidth:5,portletHeight:3.5,objMinWidth:25,objMinHeight:20,ratio:1.2,padding:10,glyphWidth:8,glyphHeight:9,textPadding:6,svgFile:!0,style:a?null:c};n.render=function(t,e){e=e||{},r.defaults(e,l),i.select("svg").remove();var n,a,s=i.select("body").append("div"),u=s.append("svg").attr("xmlns","http://www.w3.org/2000/svg").attr("version","1.1"),c=u.append("g");e.style&&u.append("style").text(e.style),t=new o(t),t.guessPortlets(),t.nodes=r.map(t.nodes,function(t){var n=t.proto;return"msg"===n?new d(t,e):"text"===n?new E(t,e):"floatatom"===n?new m(t,e):"symbolatom"===n?new v(t,e):"bng"===n?new y(t,e):"tgl"===n?new b(t,e):"nbx"===n?new _(t,e):"hsl"===n?new x(t,e):"vsl"===n?new w(t,e):"hradio"===n?new M(t,e):"vradio"===n?new A(t,e):"vu"===n?new N(t,e):new p(t,e)}),a=c.selectAll("g.node").data(t.nodes).enter().append("g").attr("transform",function(t){return"translate("+t.getX()+" "+t.getY()+")"}).attr("class","node").attr("id",function(t){return t.id}).each(function(t,e){t.render(i.select(this))}),n=c.selectAll("line.connection").data(t.connections).enter().append("line").attr("class","connection").attr("style","stroke:black;stroke-width:2px;").each(function(n){var r=t.getNode(n.source.id),o=t.getNode(n.sink.id);i.select(this).attr("x1",function(t){return r.getOutletX(t.source.port)+e.portletWidth/2}).attr("y1",function(t){return r.getOutletY(t.source.port)+e.portletHeight}).attr("x2",function(t){return o.getInletX(t.sink.port)+e.portletWidth/2}).attr("y2",function(t){return o.getInletY(t.sink.port)})});var f=[],h=[],g=[],j=[],S={},k={};r.forEach(t.nodes,function(t){f.push(t.getX()),h.push(t.getY()),g.push(t.getX()+t.getW()),j.push(t.getY()+t.getH())}),S.x=r.min(f),S.y=r.min(h),k.x=r.max(g),k.y=r.max(j),u.attr("width",k.x-S.x+2*e.padding),u.attr("height",k.y-S.y+2*e.padding),c.attr("transform","translate("+(-S.x+e.padding)+" "+(-S.y+e.padding)+")");var T=s[0][0].innerHTML;return e.svgFile?T='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">'+T:s.remove(),T};var f=function(t,e){var n=t[e],r=void 0;if(n.length>0)throw new Error("This memoization is valid only for methods with 0 arguments");t[e]=function(){return r=n.apply(t,arguments),t[e]=function(){return r},r}},h=function(t,e){this.opts=e,this.node=t,this.id=t.id,f(this,"getX"),f(this,"getY")};r.extend(h.prototype,{getX:function(){return this.node.layout.x*this.opts.ratio},getY:function(){return this.node.layout.y*this.opts.ratio},getOutletX:function(t){return this.getOutletRelX(t)+this.getX()},getInletX:function(t){return this.getInletRelX(t)+this.getX()},getOutletY:function(t){return this.getOutletRelY(t)+this.getY()},getInletY:function(t){return this.getInletRelY(t)+this.getY()},render:function(t){throw new Error("Implement me")},getW:function(){throw new Error("Implement me")},getH:function(){throw new Error("Implement me")},getOutletRelX:function(t){throw new Error("Implement me")},getInletRelX:function(t){throw new Error("Implement me")},getOutletRelY:function(t){throw new Error("Implement me")},getInletRelY:function(t){throw new Error("Implement me")}});var p=function(){h.prototype.constructor.apply(this,arguments),f(this,"getW"),f(this,"getH")};r.extend(p.prototype,h.prototype,{render:function(t){this.renderBox(t),this.renderText(t),this.renderOutlets(t),this.renderInlets(t)},renderBox:function(t){t.append("rect").attr("class","box").attr("width",this.getW()).attr("height",this.getH()).attr("style","stroke:black;fill:white;")},renderText:function(t){t.append("text").attr("class","proto").text(this.getText()).attr("dy",this.getTextY()).attr("dx",this.opts.textPadding)},renderInlets:function(t){this._genericRenderPortlets("inlet",t)},renderOutlets:function(t){this._genericRenderPortlets("outlet",t)},_genericRenderPortlets:function(t,e){var n=t.substr(0,1).toUpperCase()+t.substr(1),i=this;e.selectAll("rect."+t).data(r.range(this.node[t+"s"])).enter().append("rect").classed(t,!0).classed("portlet",!0).attr("width",this.opts.portletWidth).attr("height",this.opts.portletHeight).attr("x",function(t){return i["get"+n+"RelX"](t)}).attr("y",function(t){return i["get"+n+"RelY"](t)})},getH:function(){return this.opts.objMinHeight},getW:function(){var t=Math.max(this.node.inlets,this.node.outlets),e=this.getText().length*this.opts.glyphWidth+2*this.opts.textPadding;return Math.max((t-1)*this.opts.objMinWidth,this.opts.objMinWidth,e)},getText:function(){return this.node.proto+" "+this.node.args.join(" ")},getTextY:function(){return this.getH()/2+this.opts.glyphHeight/2},getOutletRelX:function(t){return this._genericPortletRelX("outlets",t)},getInletRelX:function(t){return this._genericPortletRelX("inlets",t)},getOutletRelY:function(t){return this.getH()-this.opts.portletHeight},getInletRelY:function(t){return 0},_genericPortletRelX:function(t,e){var n=this.getW(),r=this.node[t];if(0===e)return 0;if(e===r-1)return n-this.opts.portletWidth;var i=(n-r*this.opts.portletWidth)/(r-1);return e*(this.opts.portletWidth+i)}});var d=function(){p.prototype.constructor.apply(this,arguments)};r.extend(d.prototype,p.prototype,{renderBox:function(t){var e=.75*this.getH(),n=Math.asin(this.getH()/(2*e)),r=i.svg.arc()({innerRadius:e,outerRadius:e,startAngle:-Math.PI/2-n,endAngle:-Math.PI/2+n}),o=i.svg.line()([[this.getW(),0],[0,0],[0,this.getH()],[this.getW(),this.getH()]]);t.append("svg:path").attr("d",o).attr("style","stroke:black;fill:white;"),t.append("svg:path").attr("d",r).attr("transform","translate("+(this.getW()+e*Math.cos(n))+" "+this.getH()/2+")").attr("style","stroke:black;fill:white;")},getText:function(){return this.node.args.join(" ")}});var g=function(){p.prototype.constructor.apply(this,arguments)};r.extend(g.prototype,p.prototype,{renderBox:function(t){var e=.4*this.getH(),n=i.svg.arc()({innerRadius:e,outerRadius:e,startAngle:0,endAngle:Math.PI/2}),r=i.svg.line()([[this.getW()-e,0],[0,0],[0,this.getH()],[this.getW(),this.getH()],[this.getW(),e]]);t.append("svg:path").attr("d",r).attr("style","stroke:black;fill:white;"),t.append("svg:path").attr("d",n).attr("transform","translate("+(this.getW()-e)+" "+e+")").attr("style","stroke:black;fill:white;")}});var m=function(){g.prototype.constructor.apply(this,arguments)};r.extend(m.prototype,g.prototype,{getText:function(){return"0"}});var v=function(){g.prototype.constructor.apply(this,arguments)};r.extend(v.prototype,g.prototype,{getText:function(){return"symbol"}});var y=function(){p.prototype.constructor.apply(this,arguments)};r.extend(y.prototype,p.prototype,{render:function(t){t.append("rect").attr("class","box").attr("width",this.getW()).attr("height",this.getH()).attr("style","stroke:black;fill:white;"),t.append("circle").attr("cx",this.getW()/2).attr("cy",this.getH()/2).attr("r",this.getW()/3).attr("style","stroke:black;fill:white;"),this.renderOutlets(t),this.renderInlets(t)},getW:function(){return 20},getH:function(){return 20}});var b=function(){p.prototype.constructor.apply(this,arguments)};r.extend(b.prototype,p.prototype,{render:function(t){var e=i.svg.symbol().size(this.getW()*this.getH()/3.5).type("cross")([1]);t.append("rect").attr("class","box").attr("width",this.getW()).attr("height",this.getH()).attr("style","stroke:black;fill:white;"),t.append("svg:path").attr("d",e).attr("transform","rotate(45 "+this.getW()/2+" "+this.getH()/2+") translate("+this.getW()/2+" "+this.getH()/2+")").attr("style","stroke:black;fill:white;"),this.renderOutlets(t),this.renderInlets(t)},getW:function(){return 20},getH:function(){return 20}});var _=function(){g.prototype.constructor.apply(this,arguments)};r.extend(_.prototype,g.prototype,{renderBox:function(t){g.prototype.renderBox.apply(this,arguments);var e=i.svg.line()([[0,0],[this.getW()/6,this.getH()/2],[0,this.getH()]]);t.append("svg:path").attr("d",e).attr("style","stroke:black;fill:white;")},getText:function(){return"0"}});var x=function(){p.prototype.constructor.apply(this,arguments)};r.extend(x.prototype,p.prototype,{renderBox:function(t){p.prototype.renderBox.apply(this,arguments);var e=i.svg.line()([[5,0],[10,0],[10,this.getH()],[5,this.getH()],[5,0]]);t.append("svg:path").attr("d",e).attr("style","stroke:black;fill:black;")},getText:function(){return""},getW:function(){return 200},getH:function(){return 20}});var w=function(){p.prototype.constructor.apply(this,arguments)};r.extend(w.prototype,p.prototype,{renderBox:function(t){p.prototype.renderBox.apply(this,arguments);var e=i.svg.line()([[0,5],[0,10],[this.getW(),10],[this.getW(),5],[0,5]]);t.append("svg:path").attr("d",e).attr("style","stroke:black;fill:black;")},getText:function(){return""},getW:function(){return 20},getH:function(){return 200}});var M=function(){p.prototype.constructor.apply(this,arguments)};r.extend(M.prototype,p.prototype,{renderBox:function(t){var e,n=this.getNBoxes(),r=this.getBoxSize()/1.5;for(e=0;n>e;e++)t.append("rect").attr("width",this.getBoxSize()).attr("height",this.getBoxSize()).attr("transform","translate("+e*this.getBoxSize()+" 0)").attr("style","stroke:black;fill:white;");t.append("rect").attr("width",r).attr("height",r).attr("transform","translate("+(this.getBoxSize()-r)/2+" "+(this.getBoxSize()-r)/2+")").attr("style","stroke:black;fill:black;")},getW:function(){return this.getBoxSize()*this.getNBoxes()},getH:function(){return this.getBoxSize()},getBoxSize:function(){return 20},getNBoxes:function(){return this.node.args[2]},getText:function(){return""}});var A=function(){p.prototype.constructor.apply(this,arguments)};r.extend(A.prototype,p.prototype,{renderBox:function(t){var e,n=this.getNBoxes(),r=this.getBoxSize()/1.5;for(e=0;n>e;e++)t.append("rect").attr("width",this.getBoxSize()).attr("height",this.getBoxSize()).attr("transform","translate(0 "+e*this.getBoxSize()+")").attr("style","stroke:black;fill:white;");t.append("rect").attr("width",r).attr("height",r).attr("transform","translate("+(this.getBoxSize()-r)/2+" "+(this.getBoxSize()-r)/2+")").attr("style","stroke:black;fill:black;")},getW:function(){return this.getBoxSize()},getH:function(){return this.getBoxSize()*this.getNBoxes()},getBoxSize:function(){return 20},getNBoxes:function(){return this.node.args[2]},getText:function(){return""}});var N=function(){p.prototype.constructor.apply(this,arguments)};r.extend(N.prototype,p.prototype,{renderBox:function(t){t.append("rect").attr("class","box").attr("width",this.getW()).attr("height",this.getH()).attr("style","stroke:black;fill:grey;")},getText:function(){return""},getW:function(){return 20},getH:function(){return 200}});var E=function(){h.prototype.constructor.apply(this,arguments)};r.extend(E.prototype,h.prototype,{render:function(t){t.append("text").attr("class","comment").text(this.node.args[0]).attr("dy",this.getH()/2+this.opts.glyphHeight/2)},getW:function(){return this.node.args[0].length*this.opts.glyphWidth+2*this.opts.textPadding},getH:function(){return this.opts.objMinHeight}})}).call(this,"/node_modules/pd-fileutils/lib")},{"./Patch":63,d3:68,fs:19,path:26,underscore:70}],67:[function(t,e,n){d3=function(){function t(t){return t.target}function e(t){return t.source}function n(t,e){try{for(var n in e)Object.defineProperty(t.prototype,n,{value:e[n],enumerable:!1})}catch(r){t.prototype=e}}function r(t){for(var e=-1,n=t.length,r=[];++e<n;)r.push(t[e]);return r}function i(t){return Array.prototype.slice.call(t)}function o(){}function a(t){return t}function s(){return!0}function u(t){return"function"==typeof t?t:function(){return t}}function c(t,e,n){return function(){var r=n.apply(e,arguments);return r===e?t:r}}function l(t){return null!=t&&!isNaN(t)}function f(t){return t.length}function h(t){return t.trim().replace(/\s+/g," ")}function p(t){for(var e=1;t*e%1;)e*=10;return e}function d(t){return 1===t.length?function(e,n){t(null==e?n:null)}:t}function g(t){return t.responseText}function m(t){return JSON.parse(t.responseText)}function v(t){var e=Pi.createRange();return e.selectNode(Pi.body),e.createContextualFragment(t.responseText);
  
  }function y(t){return t.responseXML}function b(){}function _(t){function e(){for(var e,r=n,i=-1,o=r.length;++i<o;)(e=r[i].on)&&e.apply(this,arguments);return t}var n=[],r=new o;return e.on=function(e,i){var o,a=r.get(e);return arguments.length<2?a&&a.on:(a&&(a.on=null,n=n.slice(0,o=n.indexOf(a)).concat(n.slice(o+1)),r.remove(e)),i&&n.push(r.set(e,{on:i})),t)},e}function x(t,e){return e-(t?Math.ceil(Math.log(t)/Math.LN10):1)}function w(t){return t+""}function M(t,e){var n=Math.pow(10,3*Math.abs(8-e));return{scale:e>8?function(t){return t/n}:function(t){return t*n},symbol:t}}function A(t){return function(e){return 0>=e?0:e>=1?1:t(e)}}function N(t){return function(e){return 1-t(1-e)}}function E(t){return function(e){return.5*(.5>e?t(2*e):2-t(2-2*e))}}function j(t){return t*t}function S(t){return t*t*t}function k(t){if(0>=t)return 0;if(t>=1)return 1;var e=t*t,n=e*t;return 4*(.5>t?n:3*(t-e)+n-.75)}function T(t){return function(e){return Math.pow(e,t)}}function O(t){return 1-Math.cos(t*ki/2)}function D(t){return Math.pow(2,10*(t-1))}function C(t){return 1-Math.sqrt(1-t*t)}function P(t,e){var n;return arguments.length<2&&(e=.45),arguments.length?n=e/(2*ki)*Math.asin(1/t):(t=1,n=e/4),function(r){return 1+t*Math.pow(2,10*-r)*Math.sin(2*(r-n)*ki/e)}}function I(t){return t||(t=1.70158),function(e){return e*e*((t+1)*e-t)}}function R(t){return 1/2.75>t?7.5625*t*t:2/2.75>t?7.5625*(t-=1.5/2.75)*t+.75:2.5/2.75>t?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375}function q(){Oi.event.stopPropagation(),Oi.event.preventDefault()}function L(){for(var t,e=Oi.event;t=e.sourceEvent;)e=t;return e}function B(t){for(var e=new b,n=0,r=arguments.length;++n<r;)e[arguments[n]]=_(e);return e.of=function(n,r){return function(i){try{var o=i.sourceEvent=Oi.event;i.target=t,Oi.event=i,e[i.type].apply(n,r)}finally{Oi.event=o}}},e}function z(t){var e=[t.a,t.b],n=[t.c,t.d],r=F(e),i=W(e,n),o=F(U(n,e,-i))||0;e[0]*n[1]<n[0]*e[1]&&(e[0]*=-1,e[1]*=-1,r*=-1,i*=-1),this.rotate=(r?Math.atan2(e[1],e[0]):Math.atan2(-n[0],n[1]))*Ci,this.translate=[t.e,t.f],this.scale=[r,o],this.skew=o?Math.atan2(i,o)*Ci:0}function W(t,e){return t[0]*e[0]+t[1]*e[1]}function F(t){var e=Math.sqrt(W(t,t));return e&&(t[0]/=e,t[1]/=e),e}function U(t,e,n){return t[0]+=n*e[0],t[1]+=n*e[1],t}function H(t){return"transform"==t?Oi.interpolateTransform:Oi.interpolate}function Y(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return(n-t)*e}}function V(t,e){return e=e-(t=+t)?1/(e-t):0,function(n){return Math.max(0,Math.min(1,(n-t)*e))}}function G(){}function X(t,e,n){return new $(t,e,n)}function $(t,e,n){this.r=t,this.g=e,this.b=n}function Z(t){return 16>t?"0"+Math.max(0,t).toString(16):Math.min(255,t).toString(16)}function J(t,e,n){var r,i,o,a=0,s=0,u=0;if(r=/([a-z]+)\((.*)\)/i.exec(t))switch(i=r[2].split(","),r[1]){case"hsl":return n(parseFloat(i[0]),parseFloat(i[1])/100,parseFloat(i[2])/100);case"rgb":return e(et(i[0]),et(i[1]),et(i[2]))}return(o=so.get(t))?e(o.r,o.g,o.b):(null!=t&&"#"===t.charAt(0)&&(4===t.length?(a=t.charAt(1),a+=a,s=t.charAt(2),s+=s,u=t.charAt(3),u+=u):7===t.length&&(a=t.substring(1,3),s=t.substring(3,5),u=t.substring(5,7)),a=parseInt(a,16),s=parseInt(s,16),u=parseInt(u,16)),e(a,s,u))}function Q(t,e,n){var r,i,o=Math.min(t/=255,e/=255,n/=255),a=Math.max(t,e,n),s=a-o,u=(a+o)/2;return s?(i=.5>u?s/(a+o):s/(2-a-o),r=t==a?(e-n)/s+(n>e?6:0):e==a?(n-t)/s+2:(t-e)/s+4,r*=60):i=r=0,nt(r,i,u)}function K(t,e,n){t=tt(t),e=tt(e),n=tt(n);var r=pt((.4124564*t+.3575761*e+.1804375*n)/fo),i=pt((.2126729*t+.7151522*e+.072175*n)/ho),o=pt((.0193339*t+.119192*e+.9503041*n)/po);return ut(116*i-16,500*(r-i),200*(i-o))}function tt(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function et(t){var e=parseFloat(t);return"%"===t.charAt(t.length-1)?Math.round(2.55*e):e}function nt(t,e,n){return new rt(t,e,n)}function rt(t,e,n){this.h=t,this.s=e,this.l=n}function it(t,e,n){function r(t){return t>360?t-=360:0>t&&(t+=360),60>t?o+(a-o)*t/60:180>t?a:240>t?o+(a-o)*(240-t)/60:o}function i(t){return Math.round(255*r(t))}var o,a;return t%=360,0>t&&(t+=360),e=0>e?0:e>1?1:e,n=0>n?0:n>1?1:n,a=.5>=n?n*(1+e):n+e-n*e,o=2*n-a,X(i(t+120),i(t),i(t-120))}function ot(t,e,n){return new at(t,e,n)}function at(t,e,n){this.h=t,this.c=e,this.l=n}function st(t,e,n){return ut(n,Math.cos(t*=Di)*e,Math.sin(t)*e)}function ut(t,e,n){return new ct(t,e,n)}function ct(t,e,n){this.l=t,this.a=e,this.b=n}function lt(t,e,n){var r=(t+16)/116,i=r+e/500,o=r-n/200;return i=ht(i)*fo,r=ht(r)*ho,o=ht(o)*po,X(dt(3.2404542*i-1.5371385*r-.4985314*o),dt(-.969266*i+1.8760108*r+.041556*o),dt(.0556434*i-.2040259*r+1.0572252*o))}function ft(t,e,n){return ot(Math.atan2(n,e)/ki*180,Math.sqrt(e*e+n*n),t)}function ht(t){return t>.206893034?t*t*t:(t-4/29)/7.787037}function pt(t){return t>.008856?Math.pow(t,1/3):7.787037*t+4/29}function dt(t){return Math.round(255*(.00304>=t?12.92*t:1.055*Math.pow(t,1/2.4)-.055))}function gt(t){return Hi(t,xo),t}function mt(t){return function(){return mo(t,this)}}function vt(t){return function(){return vo(t,this)}}function yt(t,e){function n(){this.removeAttribute(t)}function r(){this.removeAttributeNS(t.space,t.local)}function i(){this.setAttribute(t,e)}function o(){this.setAttributeNS(t.space,t.local,e)}function a(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}function s(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}return t=Oi.ns.qualify(t),null==e?t.local?r:n:"function"==typeof e?t.local?s:a:t.local?o:i}function bt(t){return new RegExp("(?:^|\\s+)"+Oi.requote(t)+"(?:\\s+|$)","g")}function _t(t,e){function n(){for(var n=-1;++n<i;)t[n](this,e)}function r(){for(var n=-1,r=e.apply(this,arguments);++n<i;)t[n](this,r)}t=t.trim().split(/\s+/).map(xt);var i=t.length;return"function"==typeof e?r:n}function xt(t){var e=bt(t);return function(n,r){if(i=n.classList)return r?i.add(t):i.remove(t);var i=n.className,o=null!=i.baseVal,a=o?i.baseVal:i;r?(e.lastIndex=0,e.test(a)||(a=h(a+" "+t),o?i.baseVal=a:n.className=a)):a&&(a=h(a.replace(e," ")),o?i.baseVal=a:n.className=a)}}function wt(t,e,n){function r(){this.style.removeProperty(t)}function i(){this.style.setProperty(t,e,n)}function o(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}return null==e?r:"function"==typeof e?o:i}function Mt(t,e){function n(){delete this[t]}function r(){this[t]=e}function i(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}return null==e?n:"function"==typeof e?i:r}function At(t){return{__data__:t}}function Nt(t){return function(){return _o(this,t)}}function Et(t){return arguments.length||(t=Oi.ascending),function(e,n){return!e-!n||t(e.__data__,n.__data__)}}function jt(t,e,n){function r(){var e=this[o];e&&(this.removeEventListener(t,e,e.$),delete this[o])}function i(){function i(t){var n=Oi.event;Oi.event=t,s[0]=a.__data__;try{e.apply(a,s)}finally{Oi.event=n}}var a=this,s=Fi(arguments);r.call(this),this.addEventListener(t,this[o]=i,i.$=n),i._=e}var o="__on"+t,a=t.indexOf(".");return a>0&&(t=t.substring(0,a)),e?i:r}function St(t,e){for(var n=0,r=t.length;r>n;n++)for(var i,o=t[n],a=0,s=o.length;s>a;a++)(i=o[a])&&e(i,a,n);return t}function kt(t){return Hi(t,Mo),t}function Tt(t,e){return Hi(t,No),t.id=e,t}function Ot(t,e,n,r){var i=t.__transition__||(t.__transition__={active:0,count:0}),a=i[n];if(!a){var s=r.time;return a=i[n]={tween:new o,event:Oi.dispatch("start","end"),time:s,ease:r.ease,delay:r.delay,duration:r.duration},++i.count,Oi.timer(function(r){function o(r){return i.active>n?c():(i.active=n,h.start.call(t,l,e),a.tween.forEach(function(n,r){(r=r.call(t,l,e))&&g.push(r)}),u(r)||Oi.timer(u,0,s),1)}function u(r){if(i.active!==n)return c();for(var o=(r-p)/d,a=f(o),s=g.length;s>0;)g[--s].call(t,a);return o>=1?(c(),h.end.call(t,l,e),1):void 0}function c(){return--i.count?delete i[n]:delete t.__transition__,1}var l=t.__data__,f=a.ease,h=a.event,p=a.delay,d=a.duration,g=[];return r>=p?o(r):Oi.timer(o,p,s),1},0,s),a}}function Dt(t){return null==t&&(t=""),function(){this.textContent=t}}function Ct(t,e,n,r){var i=t.id;return St(t,"function"==typeof n?function(t,o,a){t.__transition__[i].tween.set(e,r(n.call(t,t.__data__,o,a)))}:(n=r(n),function(t){t.__transition__[i].tween.set(e,n)}))}function Pt(){for(var t,e=Date.now(),n=Do;n;)t=e-n.then,t>=n.delay&&(n.flush=n.callback(t)),n=n.next;var r=It()-e;r>24?(isFinite(r)&&(clearTimeout(ko),ko=setTimeout(Pt,r)),So=0):(So=1,Co(Pt))}function It(){for(var t=null,e=Do,n=1/0;e;)e.flush?(delete Oo[e.callback.id],e=t?t.next=e.next:Do=e.next):(n=Math.min(n,e.then+e.delay),e=(t=e).next);return n}function Rt(t,e){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();if(0>Po&&(Ii.scrollX||Ii.scrollY)){n=Oi.select(Pi.body).append("svg").style("position","absolute").style("top",0).style("left",0);var i=n[0][0].getScreenCTM();Po=!(i.f||i.e),n.remove()}return Po?(r.x=e.pageX,r.y=e.pageY):(r.x=e.clientX,r.y=e.clientY),r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}function qt(){}function Lt(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Bt(t){return t.rangeExtent?t.rangeExtent():Lt(t.range())}function zt(t,e){var n,r=0,i=t.length-1,o=t[r],a=t[i];return o>a&&(n=r,r=i,i=n,n=o,o=a,a=n),(e=e(a-o))&&(t[r]=e.floor(o),t[i]=e.ceil(a)),t}function Wt(){return Math}function Ft(t,e,n,r){function i(){var i=Math.min(t.length,e.length)>2?$t:Xt,u=r?V:Y;return a=i(t,e,u,n),s=i(e,t,u,Oi.interpolate),o}function o(t){return a(t)}var a,s;return o.invert=function(t){return s(t)},o.domain=function(e){return arguments.length?(t=e.map(Number),i()):t},o.range=function(t){return arguments.length?(e=t,i()):e},o.rangeRound=function(t){return o.range(t).interpolate(Oi.interpolateRound)},o.clamp=function(t){return arguments.length?(r=t,i()):r},o.interpolate=function(t){return arguments.length?(n=t,i()):n},o.ticks=function(e){return Vt(t,e)},o.tickFormat=function(e){return Gt(t,e)},o.nice=function(){return zt(t,Ht),i()},o.copy=function(){return Ft(t,e,n,r)},i()}function Ut(t,e){return Oi.rebind(t,e,"range","rangeRound","interpolate","clamp")}function Ht(t){return t=Math.pow(10,Math.round(Math.log(t)/Math.LN10)-1),t&&{floor:function(e){return Math.floor(e/t)*t},ceil:function(e){return Math.ceil(e/t)*t}}}function Yt(t,e){var n=Lt(t),r=n[1]-n[0],i=Math.pow(10,Math.floor(Math.log(r/e)/Math.LN10)),o=e/r*i;return.15>=o?i*=10:.35>=o?i*=5:.75>=o&&(i*=2),n[0]=Math.ceil(n[0]/i)*i,n[1]=Math.floor(n[1]/i)*i+.5*i,n[2]=i,n}function Vt(t,e){return Oi.range.apply(Oi,Yt(t,e))}function Gt(t,e){return Oi.format(",."+Math.max(0,-Math.floor(Math.log(Yt(t,e)[2])/Math.LN10+.01))+"f")}function Xt(t,e,n,r){var i=n(t[0],t[1]),o=r(e[0],e[1]);return function(t){return o(i(t))}}function $t(t,e,n,r){var i=[],o=[],a=0,s=Math.min(t.length,e.length)-1;for(t[s]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++a<=s;)i.push(n(t[a-1],t[a])),o.push(r(e[a-1],e[a]));return function(e){var n=Oi.bisect(t,e,1,s)-1;return o[n](i[n](e))}}function Zt(t,e){function n(n){return t(e(n))}var r=e.pow;return n.invert=function(e){return r(t.invert(e))},n.domain=function(i){return arguments.length?(e=i[0]<0?Qt:Jt,r=e.pow,t.domain(i.map(e)),n):t.domain().map(r)},n.nice=function(){return t.domain(zt(t.domain(),Wt)),n},n.ticks=function(){var n=Lt(t.domain()),i=[];if(n.every(isFinite)){var o=Math.floor(n[0]),a=Math.ceil(n[1]),s=r(n[0]),u=r(n[1]);if(e===Qt)for(i.push(r(o));o++<a;)for(var c=9;c>0;c--)i.push(r(o)*c);else{for(;a>o;o++)for(var c=1;10>c;c++)i.push(r(o)*c);i.push(r(o))}for(o=0;i[o]<s;o++);for(a=i.length;i[a-1]>u;a--);i=i.slice(o,a)}return i},n.tickFormat=function(t,i){if(arguments.length<2&&(i=Io),!arguments.length)return i;var o,a=Math.max(.1,t/n.ticks().length),s=e===Qt?(o=-1e-12,Math.floor):(o=1e-12,Math.ceil);return function(t){return t/r(s(e(t)+o))<=a?i(t):""}},n.copy=function(){return Zt(t.copy(),e)},Ut(n,t)}function Jt(t){return Math.log(0>t?0:t)/Math.LN10}function Qt(t){return-Math.log(t>0?0:-t)/Math.LN10}function Kt(t,e){function n(e){return t(r(e))}var r=te(e),i=te(1/e);return n.invert=function(e){return i(t.invert(e))},n.domain=function(e){return arguments.length?(t.domain(e.map(r)),n):t.domain().map(i)},n.ticks=function(t){return Vt(n.domain(),t)},n.tickFormat=function(t){return Gt(n.domain(),t)},n.nice=function(){return n.domain(zt(n.domain(),Ht))},n.exponent=function(t){if(!arguments.length)return e;var o=n.domain();return r=te(e=t),i=te(1/e),n.domain(o)},n.copy=function(){return Kt(t.copy(),e)},Ut(n,t)}function te(t){return function(e){return 0>e?-Math.pow(-e,t):Math.pow(e,t)}}function ee(t,e){function n(e){return a[((i.get(e)||i.set(e,t.push(e)))-1)%a.length]}function r(e,n){return Oi.range(t.length).map(function(t){return e+n*t})}var i,a,s;return n.domain=function(r){if(!arguments.length)return t;t=[],i=new o;for(var a,s=-1,u=r.length;++s<u;)i.has(a=r[s])||i.set(a,t.push(a));return n[e.t].apply(n,e.a)},n.range=function(t){return arguments.length?(a=t,s=0,e={t:"range",a:arguments},n):a},n.rangePoints=function(i,o){arguments.length<2&&(o=0);var u=i[0],c=i[1],l=(c-u)/(Math.max(1,t.length-1)+o);return a=r(t.length<2?(u+c)/2:u+l*o/2,l),s=0,e={t:"rangePoints",a:arguments},n},n.rangeBands=function(i,o,u){arguments.length<2&&(o=0),arguments.length<3&&(u=o);var c=i[1]<i[0],l=i[c-0],f=i[1-c],h=(f-l)/(t.length-o+2*u);return a=r(l+h*u,h),c&&a.reverse(),s=h*(1-o),e={t:"rangeBands",a:arguments},n},n.rangeRoundBands=function(i,o,u){arguments.length<2&&(o=0),arguments.length<3&&(u=o);var c=i[1]<i[0],l=i[c-0],f=i[1-c],h=Math.floor((f-l)/(t.length-o+2*u)),p=f-l-(t.length-o)*h;return a=r(l+Math.round(p/2),h),c&&a.reverse(),s=Math.round(h*(1-o)),e={t:"rangeRoundBands",a:arguments},n},n.rangeBand=function(){return s},n.rangeExtent=function(){return Lt(e.a[0])},n.copy=function(){return ee(t,e)},n.domain(t)}function ne(t,e){function n(){var n=0,o=e.length;for(i=[];++n<o;)i[n-1]=Oi.quantile(t,n/o);return r}function r(t){return isNaN(t=+t)?0/0:e[Oi.bisect(i,t)]}var i;return r.domain=function(e){return arguments.length?(t=e.filter(function(t){return!isNaN(t)}).sort(Oi.ascending),n()):t},r.range=function(t){return arguments.length?(e=t,n()):e},r.quantiles=function(){return i},r.copy=function(){return ne(t,e)},n()}function re(t,e,n){function r(e){return n[Math.max(0,Math.min(a,Math.floor(o*(e-t))))]}function i(){return o=n.length/(e-t),a=n.length-1,r}var o,a;return r.domain=function(n){return arguments.length?(t=+n[0],e=+n[n.length-1],i()):[t,e]},r.range=function(t){return arguments.length?(n=t,i()):n},r.copy=function(){return re(t,e,n)},i()}function ie(t,e){function n(n){return e[Oi.bisect(t,n)]}return n.domain=function(e){return arguments.length?(t=e,n):t},n.range=function(t){return arguments.length?(e=t,n):e},n.copy=function(){return ie(t,e)},n}function oe(t){function e(t){return+t}return e.invert=e,e.domain=e.range=function(n){return arguments.length?(t=n.map(e),e):t},e.ticks=function(e){return Vt(t,e)},e.tickFormat=function(e){return Gt(t,e)},e.copy=function(){return oe(t)},e}function ae(t){return t.innerRadius}function se(t){return t.outerRadius}function ue(t){return t.startAngle}function ce(t){return t.endAngle}function le(t){function e(e){function a(){l.push("M",o(t(f),c))}for(var s,l=[],f=[],h=-1,p=e.length,d=u(n),g=u(r);++h<p;)i.call(this,s=e[h],h)?f.push([+d.call(this,s,h),+g.call(this,s,h)]):f.length&&(a(),f=[]);return f.length&&a(),l.length?l.join(""):null}var n=fe,r=he,i=s,o=pe,a=o.key,c=.7;return e.x=function(t){return arguments.length?(n=t,e):n},e.y=function(t){return arguments.length?(r=t,e):r},e.defined=function(t){return arguments.length?(i=t,e):i},e.interpolate=function(t){return arguments.length?(a="function"==typeof t?o=t:(o=Fo.get(t)||pe).key,e):a},e.tension=function(t){return arguments.length?(c=t,e):c},e}function fe(t){return t[0]}function he(t){return t[1]}function pe(t){return t.join("L")}function de(t){return pe(t)+"Z"}function ge(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("V",(r=t[e])[1],"H",r[0]);return i.join("")}function me(t){for(var e=0,n=t.length,r=t[0],i=[r[0],",",r[1]];++e<n;)i.push("H",(r=t[e])[0],"V",r[1]);return i.join("")}function ve(t,e){return t.length<4?pe(t):t[1]+_e(t.slice(1,t.length-1),xe(t,e))}function ye(t,e){return t.length<3?pe(t):t[0]+_e((t.push(t[0]),t),xe([t[t.length-2]].concat(t,[t[1]]),e))}function be(t,e){return t.length<3?pe(t):t[0]+_e(t,xe(t,e))}function _e(t,e){if(e.length<1||t.length!=e.length&&t.length!=e.length+2)return pe(t);var n=t.length!=e.length,r="",i=t[0],o=t[1],a=e[0],s=a,u=1;if(n&&(r+="Q"+(o[0]-2*a[0]/3)+","+(o[1]-2*a[1]/3)+","+o[0]+","+o[1],i=t[1],u=2),e.length>1){s=e[1],o=t[u],u++,r+="C"+(i[0]+a[0])+","+(i[1]+a[1])+","+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1];for(var c=2;c<e.length;c++,u++)o=t[u],s=e[c],r+="S"+(o[0]-s[0])+","+(o[1]-s[1])+","+o[0]+","+o[1]}if(n){var l=t[u];r+="Q"+(o[0]+2*s[0]/3)+","+(o[1]+2*s[1]/3)+","+l[0]+","+l[1]}return r}function xe(t,e){for(var n,r=[],i=(1-e)/2,o=t[0],a=t[1],s=1,u=t.length;++s<u;)n=o,o=a,a=t[s],r.push([i*(a[0]-n[0]),i*(a[1]-n[1])]);return r}function we(t){if(t.length<3)return pe(t);var e=1,n=t.length,r=t[0],i=r[0],o=r[1],a=[i,i,i,(r=t[1])[0]],s=[o,o,o,r[1]],u=[i,",",o];for(je(u,a,s);++e<n;)r=t[e],a.shift(),a.push(r[0]),s.shift(),s.push(r[1]),je(u,a,s);for(e=-1;++e<2;)a.shift(),a.push(r[0]),s.shift(),s.push(r[1]),je(u,a,s);return u.join("")}function Me(t){if(t.length<4)return pe(t);for(var e,n=[],r=-1,i=t.length,o=[0],a=[0];++r<3;)e=t[r],o.push(e[0]),a.push(e[1]);for(n.push(Ee(Yo,o)+","+Ee(Yo,a)),--r;++r<i;)e=t[r],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),je(n,o,a);return n.join("")}function Ae(t){for(var e,n,r=-1,i=t.length,o=i+4,a=[],s=[];++r<4;)n=t[r%i],a.push(n[0]),s.push(n[1]);for(e=[Ee(Yo,a),",",Ee(Yo,s)],--r;++r<o;)n=t[r%i],a.shift(),a.push(n[0]),s.shift(),s.push(n[1]),je(e,a,s);return e.join("")}function Ne(t,e){var n=t.length-1;if(n)for(var r,i,o=t[0][0],a=t[0][1],s=t[n][0]-o,u=t[n][1]-a,c=-1;++c<=n;)r=t[c],i=c/n,r[0]=e*r[0]+(1-e)*(o+i*s),r[1]=e*r[1]+(1-e)*(a+i*u);return we(t)}function Ee(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function je(t,e,n){t.push("C",Ee(Uo,e),",",Ee(Uo,n),",",Ee(Ho,e),",",Ee(Ho,n),",",Ee(Yo,e),",",Ee(Yo,n))}function Se(t,e){return(e[1]-t[1])/(e[0]-t[0])}function ke(t){for(var e=0,n=t.length-1,r=[],i=t[0],o=t[1],a=r[0]=Se(i,o);++e<n;)r[e]=(a+(a=Se(i=o,o=t[e+1])))/2;return r[e]=a,r}function Te(t){for(var e,n,r,i,o=[],a=ke(t),s=-1,u=t.length-1;++s<u;)e=Se(t[s],t[s+1]),Math.abs(e)<1e-6?a[s]=a[s+1]=0:(n=a[s]/e,r=a[s+1]/e,i=n*n+r*r,i>9&&(i=3*e/Math.sqrt(i),a[s]=i*n,a[s+1]=i*r));for(s=-1;++s<=u;)i=(t[Math.min(u,s+1)][0]-t[Math.max(0,s-1)][0])/(6*(1+a[s]*a[s])),o.push([i||0,a[s]*i||0]);return o}function Oe(t){return t.length<3?pe(t):t[0]+_e(t,Te(t))}function De(t){for(var e,n,r,i=-1,o=t.length;++i<o;)e=t[i],n=e[0],r=e[1]+zo,e[0]=n*Math.cos(r),e[1]=n*Math.sin(r);return t}function Ce(t){function e(e){function s(){m.push("M",c(t(y),p),h,f(t(v.reverse()),p),"Z")}for(var l,d,g,m=[],v=[],y=[],b=-1,_=e.length,x=u(n),w=u(i),M=n===r?function(){return d}:u(r),A=i===o?function(){return g}:u(o);++b<_;)a.call(this,l=e[b],b)?(v.push([d=+x.call(this,l,b),g=+w.call(this,l,b)]),y.push([+M.call(this,l,b),+A.call(this,l,b)])):v.length&&(s(),v=[],y=[]);return v.length&&s(),m.length?m.join(""):null}var n=fe,r=fe,i=0,o=he,a=s,c=pe,l=c.key,f=c,h="L",p=.7;return e.x=function(t){return arguments.length?(n=r=t,e):r},e.x0=function(t){return arguments.length?(n=t,e):n},e.x1=function(t){return arguments.length?(r=t,e):r},e.y=function(t){return arguments.length?(i=o=t,e):o},e.y0=function(t){return arguments.length?(i=t,e):i},e.y1=function(t){return arguments.length?(o=t,e):o},e.defined=function(t){return arguments.length?(a=t,e):a},e.interpolate=function(t){return arguments.length?(l="function"==typeof t?c=t:(c=Fo.get(t)||pe).key,f=c.reverse||c,h=c.closed?"M":"L",e):l},e.tension=function(t){return arguments.length?(p=t,e):p},e}function Pe(t){return t.radius}function Ie(t){return[t.x,t.y]}function Re(t){return function(){var e=t.apply(this,arguments),n=e[0],r=e[1]+zo;return[n*Math.cos(r),n*Math.sin(r)]}}function qe(){return 64}function Le(){return"circle"}function Be(t){var e=Math.sqrt(t/ki);return"M0,"+e+"A"+e+","+e+" 0 1,1 0,"+-e+"A"+e+","+e+" 0 1,1 0,"+e+"Z"}function ze(t,e){t.attr("transform",function(t){return"translate("+e(t)+",0)"})}function We(t,e){t.attr("transform",function(t){return"translate(0,"+e(t)+")"})}function Fe(t,e,n){if(r=[],n&&e.length>1){for(var r,i,o,a=Lt(t.domain()),s=-1,u=e.length,c=(e[1]-e[0])/++n;++s<u;)for(i=n;--i>0;)(o=+e[s]-i*c)>=a[0]&&r.push(o);for(--s,i=0;++i<n&&(o=+e[s]+i*c)<a[1];)r.push(o)}return r}function Ue(t){for(var e=t.source,n=t.target,r=Ye(e,n),i=[e];e!==r;)e=e.parent,i.push(e);for(var o=i.length;n!==r;)i.splice(o,0,n),n=n.parent;return i}function He(t){for(var e=[],n=t.parent;null!=n;)e.push(t),t=n,n=n.parent;return e.push(t),e}function Ye(t,e){if(t===e)return t;for(var n=He(t),r=He(e),i=n.pop(),o=r.pop(),a=null;i===o;)a=i,i=n.pop(),o=r.pop();return a}function Ve(t){t.fixed|=2}function Ge(t){t.fixed&=-7}function Xe(t){t.fixed|=4,t.px=t.x,t.py=t.y}function $e(t){t.fixed&=-5}function Ze(t,e,n){var r=0,i=0;if(t.charge=0,!t.leaf)for(var o,a=t.nodes,s=a.length,u=-1;++u<s;)o=a[u],null!=o&&(Ze(o,e,n),t.charge+=o.charge,r+=o.charge*o.cx,i+=o.charge*o.cy);if(t.point){t.leaf||(t.point.x+=Math.random()-.5,t.point.y+=Math.random()-.5);var c=e*n[t.point.index];t.charge+=t.pointCharge=c,r+=c*t.point.x,i+=c*t.point.y}t.cx=r/t.charge,t.cy=i/t.charge}function Je(t){return t.x}function Qe(t){return t.y}function Ke(t,e,n){t.y0=e,t.y=n}function tn(t){return Oi.range(t.length)}function en(t){for(var e=-1,n=t[0].length,r=[];++e<n;)r[e]=0;return r}function nn(t){for(var e,n=1,r=0,i=t[0][1],o=t.length;o>n;++n)(e=t[n][1])>i&&(r=n,i=e);return r}function rn(t){return t.reduce(on,0)}function on(t,e){return t+e[1]}function an(t,e){return sn(t,Math.ceil(Math.log(e.length)/Math.LN2+1))}function sn(t,e){for(var n=-1,r=+t[0],i=(t[1]-r)/e,o=[];++n<=e;)o[n]=i*n+r;return o}function un(t){return[Oi.min(t),Oi.max(t)]}function cn(t,e){return Oi.rebind(t,e,"sort","children","value"),t.nodes=t,t.links=pn,t}function ln(t){return t.children}function fn(t){return t.value}function hn(t,e){return e.value-t.value}function pn(t){return Oi.merge(t.map(function(t){return(t.children||[]).map(function(e){return{source:t,target:e}})}))}function dn(t,e){return t.value-e.value}function gn(t,e){var n=t._pack_next;t._pack_next=e,e._pack_prev=t,e._pack_next=n,n._pack_prev=e}function mn(t,e){t._pack_next=e,e._pack_prev=t}function vn(t,e){var n=e.x-t.x,r=e.y-t.y,i=t.r+e.r;return i*i-n*n-r*r>.001}function yn(t){function e(t){l=Math.min(t.x-t.r,l),f=Math.max(t.x+t.r,f),h=Math.min(t.y-t.r,h),p=Math.max(t.y+t.r,p)}if((n=t.children)&&(c=n.length)){var n,r,i,o,a,s,u,c,l=1/0,f=-(1/0),h=1/0,p=-(1/0);if(n.forEach(bn),r=n[0],r.x=-r.r,r.y=0,e(r),c>1&&(i=n[1],i.x=i.r,i.y=0,e(i),c>2))for(o=n[2],wn(r,i,o),e(o),gn(r,o),r._pack_prev=o,gn(o,i),i=r._pack_next,a=3;c>a;a++){wn(r,i,o=n[a]);var d=0,g=1,m=1;for(s=i._pack_next;s!==i;s=s._pack_next,g++)if(vn(s,o)){d=1;break}if(1==d)for(u=r._pack_prev;u!==s._pack_prev&&!vn(u,o);u=u._pack_prev,m++);d?(m>g||g==m&&i.r<r.r?mn(r,i=s):mn(r=u,i),a--):(gn(r,o),i=o,e(o))}var v=(l+f)/2,y=(h+p)/2,b=0;for(a=0;c>a;a++)o=n[a],o.x-=v,o.y-=y,b=Math.max(b,o.r+Math.sqrt(o.x*o.x+o.y*o.y));t.r=b,n.forEach(_n)}}function bn(t){t._pack_next=t._pack_prev=t}function _n(t){delete t._pack_next,delete t._pack_prev}function xn(t,e,n,r){var i=t.children;if(t.x=e+=r*t.x,t.y=n+=r*t.y,t.r*=r,i)for(var o=-1,a=i.length;++o<a;)xn(i[o],e,n,r)}function wn(t,e,n){var r=t.r+n.r,i=e.x-t.x,o=e.y-t.y;if(r&&(i||o)){var a=e.r+n.r,s=i*i+o*o;a*=a,r*=r;var u=.5+(r-a)/(2*s),c=Math.sqrt(Math.max(0,2*a*(r+s)-(r-=s)*r-a*a))/(2*s);n.x=t.x+u*i+c*o,n.y=t.y+u*o-c*i}else n.x=t.x+r,n.y=t.y}function Mn(t){return 1+Oi.max(t,function(t){return t.y})}function An(t){return t.reduce(function(t,e){return t+e.x},0)/t.length}function Nn(t){var e=t.children;return e&&e.length?Nn(e[0]):t}function En(t){var e,n=t.children;return n&&(e=n.length)?En(n[e-1]):t}function jn(t,e){return t.parent==e.parent?1:2}function Sn(t){var e=t.children;return e&&e.length?e[0]:t._tree.thread}function kn(t){var e,n=t.children;return n&&(e=n.length)?n[e-1]:t._tree.thread}function Tn(t,e){var n=t.children;if(n&&(i=n.length))for(var r,i,o=-1;++o<i;)e(r=Tn(n[o],e),t)>0&&(t=r);return t}function On(t,e){return t.x-e.x}function Dn(t,e){return e.x-t.x}function Cn(t,e){return t.depth-e.depth}function Pn(t,e){function n(t,r){var i=t.children;if(i&&(a=i.length))for(var o,a,s=null,u=-1;++u<a;)o=i[u],n(o,s),s=o;e(t,r)}n(t,null)}function In(t){for(var e,n=0,r=0,i=t.children,o=i.length;--o>=0;)e=i[o]._tree,e.prelim+=n,e.mod+=n,n+=e.shift+(r+=e.change)}function Rn(t,e,n){t=t._tree,e=e._tree;var r=n/(e.number-t.number);t.change+=r,e.change-=r,e.shift+=n,e.prelim+=n,e.mod+=n}function qn(t,e,n){return t._tree.ancestor.parent==e.parent?t._tree.ancestor:n}function Ln(t){return{x:t.x,y:t.y,dx:t.dx,dy:t.dy}}function Bn(t,e){var n=t.x+e[3],r=t.y+e[0],i=t.dx-e[1]-e[3],o=t.dy-e[0]-e[2];return 0>i&&(n+=i/2,i=0),0>o&&(r+=o/2,o=0),{x:n,y:r,dx:i,dy:o}}function zn(t,e){function n(t,n){return Oi.xhr(t,e,n).response(r)}function r(t){return n.parse(t.responseText)}function i(e){return e.map(o).join(t)}function o(t){return a.test(t)?'"'+t.replace(/\"/g,'""')+'"':t}var a=new RegExp('["'+t+"\n]"),s=t.charCodeAt(0);return n.parse=function(t){var e;return n.parseRows(t,function(t){return e?e(t):void(e=new Function("d","return {"+t.map(function(t,e){return JSON.stringify(t)+": d["+e+"]"}).join(",")+"}"))})},n.parseRows=function(t,e){function n(){if(l>=c)return a;if(i)return i=!1,o;var e=l;if(34===t.charCodeAt(e)){for(var n=e;n++<c;)if(34===t.charCodeAt(n)){if(34!==t.charCodeAt(n+1))break;++n}l=n+2;var r=t.charCodeAt(n+1);return 13===r?(i=!0,10===t.charCodeAt(n+2)&&++l):10===r&&(i=!0),t.substring(e+1,n).replace(/""/g,'"')}for(;c>l;){var r=t.charCodeAt(l++),u=1;if(10===r)i=!0;else if(13===r)i=!0,10===t.charCodeAt(l)&&(++l,++u);else if(r!==s)continue;return t.substring(e,l-u)}return t.substring(e)}for(var r,i,o={},a={},u=[],c=t.length,l=0,f=0;(r=n())!==a;){for(var h=[];r!==o&&r!==a;)h.push(r),r=n();(!e||(h=e(h,f++)))&&u.push(h)}return u},n.format=function(t){return t.map(i).join("\n")},n}function Wn(t,e){ua.hasOwnProperty(t.type)&&ua[t.type](t,e)}function Fn(t,e,n){var r,i=-1,o=t.length-n;for(e.lineStart();++i<o;)r=t[i],e.point(r[0],r[1]);e.lineEnd()}function Un(t,e){var n=-1,r=t.length;for(e.polygonStart();++n<r;)Fn(t[n],e,1);e.polygonEnd()}function Hn(t){return[Math.atan2(t[1],t[0]),Math.asin(Math.max(-1,Math.min(1,t[2])))]}function Yn(t,e){return Math.abs(t[0]-e[0])<Ti&&Math.abs(t[1]-e[1])<Ti}function Vn(t){var e=t[0],n=t[1],r=Math.cos(n);return[r*Math.cos(e),r*Math.sin(e),Math.sin(n)]}function Gn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Xn(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function $n(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function Zn(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function Jn(t){var e=Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function Qn(t){function e(e){function r(n,r){n=t(n,r),e.point(n[0],n[1])}function o(){l=0/0,g.point=a,e.lineStart()}function a(r,o){var a=Vn([r,o]),s=t(r,o);n(l,f,c,h,p,d,l=s[0],f=s[1],c=r,h=a[0],p=a[1],d=a[2],i,e),e.point(l,f)}function s(){g.point=r,e.lineEnd()}function u(){var t,r,u,m,v,y,b;o(),g.point=function(e,n){a(t=e,r=n),u=l,m=f,v=h,y=p,b=d,g.point=a},g.lineEnd=function(){n(l,f,c,h,p,d,u,m,t,v,y,b,i,e),g.lineEnd=s,s()}}var c,l,f,h,p,d,g={point:r,lineStart:o,lineEnd:s,polygonStart:function(){e.polygonStart(),g.lineStart=u},polygonEnd:function(){e.polygonEnd(),g.lineStart=o}};return g}function n(e,i,o,a,s,u,c,l,f,h,p,d,g,m){var v=c-e,y=l-i,b=v*v+y*y;if(b>4*r&&g--){var _=a+h,x=s+p,w=u+d,M=Math.sqrt(_*_+x*x+w*w),A=Math.asin(w/=M),N=Math.abs(Math.abs(w)-1)<Ti?(o+f)/2:Math.atan2(x,_),E=t(N,A),j=E[0],S=E[1],k=j-e,T=S-i,O=y*k-v*T;(O*O/b>r||Math.abs((v*k+y*T)/b-.5)>.3)&&(n(e,i,o,a,s,u,j,S,N,_/=M,x/=M,w,g,m),m.point(j,S),n(j,S,N,_,x,w,c,l,f,h,p,d,g,m))}}var r=.5,i=16;return e.precision=function(t){return arguments.length?(i=(r=t*t)>0&&16,e):Math.sqrt(r)},e}function Kn(t,e){function n(t,e){var n=Math.sqrt(o-2*i*Math.sin(e))/i;return[n*Math.sin(t*=i),a-n*Math.cos(t)]}var r=Math.sin(t),i=(r+Math.sin(e))/2,o=1+r*(2*i-r),a=Math.sqrt(o)/i;return n.invert=function(t,e){var n=a-e;return[Math.atan2(t,n)/i,Math.asin((o-(t*t+n*n)*i*i)/(2*i))]},n}function tr(t){function e(t,e){r>t&&(r=t),t>o&&(o=t),i>e&&(i=e),e>a&&(a=e)}function n(){s.point=s.lineEnd=qt}var r,i,o,a,s={point:e,lineStart:qt,lineEnd:qt,polygonStart:function(){s.lineEnd=n},polygonEnd:function(){s.point=e}};return function(e){return a=o=-(r=i=1/0),Oi.geo.stream(e,t(s)),[[r,i],[o,a]]}}function er(t,e){if(!fa){++ha,t*=Di;var n=Math.cos(e*=Di);pa+=(n*Math.cos(t)-pa)/ha,da+=(n*Math.sin(t)-da)/ha,ga+=(Math.sin(e)-ga)/ha}}function nr(){var t,e;fa=1,rr(),fa=2;var n=ma.point;ma.point=function(r,i){n(t=r,e=i)},ma.lineEnd=function(){ma.point(t,e),ir(),ma.lineEnd=ir}}function rr(){function t(t,i){t*=Di;var o=Math.cos(i*=Di),a=o*Math.cos(t),s=o*Math.sin(t),u=Math.sin(i),c=Math.atan2(Math.sqrt((c=n*u-r*s)*c+(c=r*a-e*u)*c+(c=e*s-n*a)*c),e*a+n*s+r*u);ha+=c,pa+=c*(e+(e=a)),da+=c*(n+(n=s)),ga+=c*(r+(r=u))}var e,n,r;fa>1||(1>fa&&(fa=1,ha=pa=da=ga=0),ma.point=function(i,o){i*=Di;var a=Math.cos(o*=Di);e=a*Math.cos(i),n=a*Math.sin(i),r=Math.sin(o),ma.point=t})}function ir(){ma.point=er}function or(t,e){var n=Math.cos(t),r=Math.sin(t);return function(i,o,a,s){null!=i?(i=ar(n,i),o=ar(n,o),(a>0?o>i:i>o)&&(i+=2*a*ki)):(i=t+2*a*ki,o=t);for(var u,c=a*e,l=i;a>0?l>o:o>l;l-=c)s.point((u=Hn([n,-r*Math.cos(l),-r*Math.sin(l)]))[0],u[1])}}function ar(t,e){var n=Vn(e);n[0]-=t,Jn(n);var r=Math.acos(Math.max(-1,Math.min(1,-n[1])));return((-n[2]<0?-r:r)+2*Math.PI-Ti)%(2*Math.PI)}function sr(t,e,n){return function(r){function i(e,n){t(e,n)&&r.point(e,n)}function o(t,e){m.point(t,e)}function a(){v.point=o,m.lineStart()}function s(){v.point=i,m.lineEnd()}function u(t,e){b.point(t,e),g.push([t,e])}function c(){b.lineStart(),g=[]}function l(){u(g[0][0],g[0][1]),b.lineEnd();var t,e=b.clean(),n=y.buffer(),i=n.length;if(!i)return d=!0,p+=pr(g,-1),void(g=null);if(g=null,1&e){t=n[0],h+=pr(t,1);var o,i=t.length-1,a=-1;for(r.lineStart();++a<i;)r.point((o=t[a])[0],o[1]);return void r.lineEnd()}i>1&&2&e&&n.push(n.pop().concat(n.shift())),f.push(n.filter(fr))}var f,h,p,d,g,m=e(r),v={point:i,lineStart:a,lineEnd:s,polygonStart:function(){v.point=u,v.lineStart=c,v.lineEnd=l,d=!1,p=h=0,f=[],r.polygonStart()},polygonEnd:function(){v.point=i,v.lineStart=a,v.lineEnd=s,f=Oi.merge(f),f.length?ur(f,n,r):(-Ti>h||d&&-Ti>p)&&(r.lineStart(),n(null,null,1,r),r.lineEnd()),r.polygonEnd(),f=null},sphere:function(){r.polygonStart(),r.lineStart(),n(null,null,1,r),r.lineEnd(),r.polygonEnd()}},y=hr(),b=e(y);return v}}function ur(t,e,n){var r=[],i=[];if(t.forEach(function(t){if(!((e=t.length)<=1)){var e,o=t[0],a=t[e-1];if(Yn(o,a)){n.lineStart();for(var s=0;e>s;++s)n.point((o=t[s])[0],o[1]);return void n.lineEnd()}var u={point:o,points:t,other:null,visited:!1,entry:!0,subject:!0},c={point:o,points:[o],other:u,visited:!1,entry:!1,subject:!1};u.other=c,r.push(u),i.push(c),u={point:a,points:[a],other:null,visited:!1,entry:!1,subject:!0},c={point:a,points:[a],other:u,visited:!1,entry:!0,subject:!1},u.other=c,r.push(u),i.push(c)}}),i.sort(lr),cr(r),cr(i),r.length)for(var o,a,s,u=r[0];;){for(o=u;o.visited;)if((o=o.next)===u)return;a=o.points,n.lineStart();do{if(o.visited=o.other.visited=!0,o.entry){if(o.subject)for(var c=0;c<a.length;c++)n.point((s=a[c])[0],s[1]);else e(o.point,o.next.point,1,n);o=o.next}else{if(o.subject){a=o.prev.points;for(var c=a.length;--c>=0;)n.point((s=a[c])[0],s[1])}else e(o.point,o.prev.point,-1,n);o=o.prev}o=o.other,a=o.points}while(!o.visited);n.lineEnd()}}function cr(t){if(e=t.length){for(var e,n,r=0,i=t[0];++r<e;)i.next=n=t[r],n.prev=i,
  i=n;i.next=n=t[0],n.prev=i}}function lr(t,e){return((t=t.point)[0]<0?t[1]-ki/2-Ti:ki/2-t[1])-((e=e.point)[0]<0?e[1]-ki/2-Ti:ki/2-e[1])}function fr(t){return t.length>1}function hr(){var t,e=[];return{lineStart:function(){e.push(t=[])},point:function(e,n){t.push([e,n])},lineEnd:qt,buffer:function(){var n=e;return e=[],t=null,n}}}function pr(t,e){if(!(n=t.length))return 0;for(var n,r,i,o=0,a=0,s=t[0],u=s[0],c=s[1],l=Math.cos(c),f=Math.atan2(e*Math.sin(u)*l,Math.sin(c)),h=1-e*Math.cos(u)*l,p=f;++o<n;)s=t[o],l=Math.cos(c=s[1]),r=Math.atan2(e*Math.sin(u=s[0])*l,Math.sin(c)),i=1-e*Math.cos(u)*l,Math.abs(h-2)<Ti&&Math.abs(i-2)<Ti||(Math.abs(i)<Ti||Math.abs(h)<Ti||(Math.abs(Math.abs(r-f)-ki)<Ti?i+h>2&&(a+=4*(r-f)):a+=Math.abs(h-2)<Ti?4*(r-p):((3*ki+r-f)%(2*ki)-ki)*(h+i)),p=f,f=r,h=i);return a}function dr(t){var e,n=0/0,r=0/0,i=0/0;return{lineStart:function(){t.lineStart(),e=1},point:function(o,a){var s=o>0?ki:-ki,u=Math.abs(o-n);Math.abs(u-ki)<Ti?(t.point(n,r=(r+a)/2>0?ki/2:-ki/2),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),t.point(o,r),e=0):i!==s&&u>=ki&&(Math.abs(n-i)<Ti&&(n-=i*Ti),Math.abs(o-s)<Ti&&(o-=s*Ti),r=gr(n,r,o,a),t.point(i,r),t.lineEnd(),t.lineStart(),t.point(s,r),e=0),t.point(n=o,r=a),i=s},lineEnd:function(){t.lineEnd(),n=r=0/0},clean:function(){return 2-e}}}function gr(t,e,n,r){var i,o,a=Math.sin(t-n);return Math.abs(a)>Ti?Math.atan((Math.sin(e)*(o=Math.cos(r))*Math.sin(n)-Math.sin(r)*(i=Math.cos(e))*Math.sin(t))/(i*o*a)):(e+r)/2}function mr(t,e,n,r){var i;if(null==t)i=n*ki/2,r.point(-ki,i),r.point(0,i),r.point(ki,i),r.point(ki,0),r.point(ki,-i),r.point(0,-i),r.point(-ki,-i),r.point(-ki,0),r.point(-ki,i);else if(Math.abs(t[0]-e[0])>Ti){var o=(t[0]<e[0]?1:-1)*ki;i=n*o/2,r.point(-o,i),r.point(0,i),r.point(o,i)}else r.point(e[0],e[1])}function vr(t){function e(t,e){return Math.cos(t)*Math.cos(e)>o}function n(t){var n,i,o,a;return{lineStart:function(){o=i=!1,a=1},point:function(s,u){var c,l=[s,u],f=e(s,u);!n&&(o=i=f)&&t.lineStart(),f!==i&&(c=r(n,l),(Yn(n,c)||Yn(l,c))&&(l[0]+=Ti,l[1]+=Ti,f=e(l[0],l[1]))),f!==i&&(a=0,(i=f)?(t.lineStart(),c=r(l,n),t.point(c[0],c[1])):(c=r(n,l),t.point(c[0],c[1]),t.lineEnd()),n=c),!f||n&&Yn(n,l)||t.point(l[0],l[1]),n=l},lineEnd:function(){i&&t.lineEnd(),n=null},clean:function(){return a|(o&&i)<<1}}}function r(t,e){var n=Vn(t,0),r=Vn(e,0),i=[1,0,0],a=Xn(n,r),s=Gn(a,a),u=a[0],c=s-u*u;if(!c)return t;var l=o*s/c,f=-o*u/c,h=Xn(i,a),p=Zn(i,l),d=Zn(a,f);$n(p,d);var g=h,m=Gn(p,g),v=Gn(g,g),y=Math.sqrt(m*m-v*(Gn(p,p)-1)),b=Zn(g,(-m-y)/v);return $n(b,p),Hn(b)}var i=t*Di,o=Math.cos(i),a=or(i,6*Di);return sr(e,n,a)}function yr(t,e){function n(n,r){return n=t(n,r),e(n[0],n[1])}return t.invert&&e.invert&&(n.invert=function(n,r){return n=e.invert(n,r),n&&t.invert(n[0],n[1])}),n}function br(t,e){return[t,e]}function _r(t,e,n){var r=Oi.range(t,e-Ti,n).concat(e);return function(t){return r.map(function(e){return[t,e]})}}function xr(t,e,n){var r=Oi.range(t,e-Ti,n).concat(e);return function(t){return r.map(function(e){return[e,t]})}}function wr(t){return(t=Math.sin(t/2))*t}function Mr(t,e,n,r){var i=Math.cos(e),o=Math.sin(e),a=Math.cos(r),s=Math.sin(r),u=i*Math.cos(t),c=i*Math.sin(t),l=a*Math.cos(n),f=a*Math.sin(n),h=2*Math.asin(Math.sqrt(wr(r-e)+i*a*wr(n-t))),p=1/Math.sin(h),d=h?function(t){var e=Math.sin(t*=h)*p,n=Math.sin(h-t)*p,r=n*u+e*l,i=n*c+e*f,a=n*o+e*s;return[Math.atan2(i,r)*Ci,Math.atan2(a,Math.sqrt(r*r+i*i))*Ci]}:function(){return[t*Ci,e*Ci]};return d.distance=h,d}function Ar(t,e){return[t/(2*ki),Math.max(-.5,Math.min(.5,Math.log(Math.tan(ki/4+e/2))/(2*ki)))]}function Nr(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Er(t){var e=Qn(function(e,n){return t([e*Ci,n*Ci])});return function(t){return t=e(t),{point:function(e,n){t.point(e*Di,n*Di)},sphere:function(){t.sphere()},lineStart:function(){t.lineStart()},lineEnd:function(){t.lineEnd()},polygonStart:function(){t.polygonStart()},polygonEnd:function(){t.polygonEnd()}}}}function jr(){function t(t,e){a.push("M",t,",",e,o)}function e(t,e){a.push("M",t,",",e),s.point=n}function n(t,e){a.push("L",t,",",e)}function r(){s.point=t}function i(){a.push("Z")}var o=Nr(4.5),a=[],s={point:t,lineStart:function(){s.point=e},lineEnd:r,polygonStart:function(){s.lineEnd=i},polygonEnd:function(){s.lineEnd=r,s.point=t},pointRadius:function(t){return o=Nr(t),s},result:function(){if(a.length){var t=a.join("");return a=[],t}}};return s}function Sr(t){function e(e,n){t.moveTo(e,n),t.arc(e,n,a,0,2*ki)}function n(e,n){t.moveTo(e,n),s.point=r}function r(e,n){t.lineTo(e,n)}function i(){s.point=e}function o(){t.closePath()}var a=4.5,s={point:e,lineStart:function(){s.point=n},lineEnd:i,polygonStart:function(){s.lineEnd=o},polygonEnd:function(){s.lineEnd=i,s.point=e},pointRadius:function(t){return a=t,s},result:qt};return s}function kr(){function t(t,e){xa+=i*t-r*e,r=t,i=e}var e,n,r,i;wa.point=function(o,a){wa.point=t,e=r=o,n=i=a},wa.lineEnd=function(){t(e,n)}}function Tr(t,e){fa||(pa+=t,da+=e,++ga)}function Or(){function t(t,r){var i=t-e,o=r-n,a=Math.sqrt(i*i+o*o);pa+=a*(e+t)/2,da+=a*(n+r)/2,ga+=a,e=t,n=r}var e,n;if(1!==fa){if(!(1>fa))return;fa=1,pa=da=ga=0}Ma.point=function(r,i){Ma.point=t,e=r,n=i}}function Dr(){Ma.point=Tr}function Cr(){function t(t,e){var n=i*t-r*e;pa+=n*(r+t),da+=n*(i+e),ga+=3*n,r=t,i=e}var e,n,r,i;2>fa&&(fa=2,pa=da=ga=0),Ma.point=function(o,a){Ma.point=t,e=r=o,n=i=a},Ma.lineEnd=function(){t(e,n)}}function Pr(){function t(t,e){t*=Di,e=e*Di/2+ki/4;var n=t-r,a=Math.cos(e),s=Math.sin(e),u=o*s,c=Na,l=Ea,f=i*a+u*Math.cos(n),h=u*Math.sin(n);Na=c*f-l*h,Ea=l*f+c*h,r=t,i=a,o=s}var e,n,r,i,o;ja.point=function(a,s){ja.point=t,r=(e=a)*Di,i=Math.cos(s=(n=s)*Di/2+ki/4),o=Math.sin(s)},ja.lineEnd=function(){t(e,n)}}function Ir(t){return Rr(function(){return t})()}function Rr(t){function e(t){return t=a(t[0]*Di,t[1]*Di),[t[0]*l+s,u-t[1]*l]}function n(t){return t=a.invert((t[0]-s)/l,(u-t[1])/l),t&&[t[0]*Ci,t[1]*Ci]}function r(){a=yr(o=Lr(g,m,v),i);var t=i(p,d);return s=f-t[0]*l,u=h+t[1]*l,e}var i,o,a,s,u,c=Qn(function(t,e){return t=i(t,e),[t[0]*l+s,u-t[1]*l]}),l=150,f=480,h=250,p=0,d=0,g=0,m=0,v=0,y=va,b=null;return e.stream=function(t){return qr(o,y(c(t)))},e.clipAngle=function(t){return arguments.length?(y=null==t?(b=t,va):vr(b=+t),e):b},e.scale=function(t){return arguments.length?(l=+t,r()):l},e.translate=function(t){return arguments.length?(f=+t[0],h=+t[1],r()):[f,h]},e.center=function(t){return arguments.length?(p=t[0]%360*Di,d=t[1]%360*Di,r()):[p*Ci,d*Ci]},e.rotate=function(t){return arguments.length?(g=t[0]%360*Di,m=t[1]%360*Di,v=t.length>2?t[2]%360*Di:0,r()):[g*Ci,m*Ci,v*Ci]},Oi.rebind(e,c,"precision"),function(){return i=t.apply(this,arguments),e.invert=i.invert&&n,r()}}function qr(t,e){return{point:function(n,r){r=t(n*Di,r*Di),n=r[0],e.point(n>ki?n-2*ki:-ki>n?n+2*ki:n,r[1])},sphere:function(){e.sphere()},lineStart:function(){e.lineStart()},lineEnd:function(){e.lineEnd()},polygonStart:function(){e.polygonStart()},polygonEnd:function(){e.polygonEnd()}}}function Lr(t,e,n){return t?e||n?yr(zr(t),Wr(e,n)):zr(t):e||n?Wr(e,n):br}function Br(t){return function(e,n){return e+=t,[e>ki?e-2*ki:-ki>e?e+2*ki:e,n]}}function zr(t){var e=Br(t);return e.invert=Br(-t),e}function Wr(t,e){function n(t,e){var n=Math.cos(e),s=Math.cos(t)*n,u=Math.sin(t)*n,c=Math.sin(e),l=c*r+s*i;return[Math.atan2(u*o-l*a,s*r-c*i),Math.asin(Math.max(-1,Math.min(1,l*o+u*a)))]}var r=Math.cos(t),i=Math.sin(t),o=Math.cos(e),a=Math.sin(e);return n.invert=function(t,e){var n=Math.cos(e),s=Math.cos(t)*n,u=Math.sin(t)*n,c=Math.sin(e),l=c*o-u*a;return[Math.atan2(u*o+c*a,s*r+l*i),Math.asin(Math.max(-1,Math.min(1,l*r-s*i)))]},n}function Fr(t,e){function n(e,n){var r=Math.cos(e),i=Math.cos(n),o=t(r*i);return[o*i*Math.sin(e),o*Math.sin(n)]}return n.invert=function(t,n){var r=Math.sqrt(t*t+n*n),i=e(r),o=Math.sin(i),a=Math.cos(i);return[Math.atan2(t*o,r*a),Math.asin(r&&n*o/r)]},n}function Ur(t,e,n,r){var i,o,a,s,u,c,l;return i=r[t],o=i[0],a=i[1],i=r[e],s=i[0],u=i[1],i=r[n],c=i[0],l=i[1],(l-a)*(s-o)-(u-a)*(c-o)>0}function Hr(t,e,n){return(n[0]-e[0])*(t[1]-e[1])<(n[1]-e[1])*(t[0]-e[0])}function Yr(t,e,n,r){var i=t[0],o=n[0],a=e[0]-i,s=r[0]-o,u=t[1],c=n[1],l=e[1]-u,f=r[1]-c,h=(s*(u-c)-f*(i-o))/(f*a-s*l);return[i+h*a,u+h*l]}function Vr(t,e){var n={list:t.map(function(t,e){return{index:e,x:t[0],y:t[1]}}).sort(function(t,e){return t.y<e.y?-1:t.y>e.y?1:t.x<e.x?-1:t.x>e.x?1:0}),bottomSite:null},r={list:[],leftEnd:null,rightEnd:null,init:function(){r.leftEnd=r.createHalfEdge(null,"l"),r.rightEnd=r.createHalfEdge(null,"l"),r.leftEnd.r=r.rightEnd,r.rightEnd.l=r.leftEnd,r.list.unshift(r.leftEnd,r.rightEnd)},createHalfEdge:function(t,e){return{edge:t,side:e,vertex:null,l:null,r:null}},insert:function(t,e){e.l=t,e.r=t.r,t.r.l=e,t.r=e},leftBound:function(t){var e=r.leftEnd;do e=e.r;while(e!=r.rightEnd&&i.rightOf(e,t));return e=e.l},del:function(t){t.l.r=t.r,t.r.l=t.l,t.edge=null},right:function(t){return t.r},left:function(t){return t.l},leftRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[t.side]},rightRegion:function(t){return null==t.edge?n.bottomSite:t.edge.region[ka[t.side]]}},i={bisect:function(t,e){var n={region:{l:t,r:e},ep:{l:null,r:null}},r=e.x-t.x,i=e.y-t.y,o=r>0?r:-r,a=i>0?i:-i;return n.c=t.x*r+t.y*i+.5*(r*r+i*i),o>a?(n.a=1,n.b=i/r,n.c/=r):(n.b=1,n.a=r/i,n.c/=i),n},intersect:function(t,e){var n=t.edge,r=e.edge;if(!n||!r||n.region.r==r.region.r)return null;var i=n.a*r.b-n.b*r.a;if(Math.abs(i)<1e-10)return null;var o,a,s=(n.c*r.b-r.c*n.b)/i,u=(r.c*n.a-n.c*r.a)/i,c=n.region.r,l=r.region.r;c.y<l.y||c.y==l.y&&c.x<l.x?(o=t,a=n):(o=e,a=r);var f=s>=a.region.r.x;return f&&"l"===o.side||!f&&"r"===o.side?null:{x:s,y:u}},rightOf:function(t,e){var n=t.edge,r=n.region.r,i=e.x>r.x;if(i&&"l"===t.side)return 1;if(!i&&"r"===t.side)return 0;if(1===n.a){var o=e.y-r.y,a=e.x-r.x,s=0,u=0;if(!i&&n.b<0||i&&n.b>=0?u=s=o>=n.b*a:(u=e.x+e.y*n.b>n.c,n.b<0&&(u=!u),u||(s=1)),!s){var c=r.x-n.region.l.x;u=n.b*(a*a-o*o)<c*o*(1+2*a/c+n.b*n.b),n.b<0&&(u=!u)}}else{var l=n.c-n.a*e.x,f=e.y-l,h=e.x-r.x,p=l-r.y;u=f*f>h*h+p*p}return"l"===t.side?u:!u},endPoint:function(t,n,r){t.ep[n]=r,t.ep[ka[n]]&&e(t)},distance:function(t,e){var n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}},o={list:[],insert:function(t,e,n){t.vertex=e,t.ystar=e.y+n;for(var r=0,i=o.list,a=i.length;a>r;r++){var s=i[r];if(!(t.ystar>s.ystar||t.ystar==s.ystar&&e.x>s.vertex.x))break}i.splice(r,0,t)},del:function(t){for(var e=0,n=o.list,r=n.length;r>e&&n[e]!=t;++e);n.splice(e,1)},empty:function(){return 0===o.list.length},nextEvent:function(t){for(var e=0,n=o.list,r=n.length;r>e;++e)if(n[e]==t)return n[e+1];return null},min:function(){var t=o.list[0];return{x:t.vertex.x,y:t.ystar}},extractMin:function(){return o.list.shift()}};r.init(),n.bottomSite=n.list.shift();for(var a,s,u,c,l,f,h,p,d,g,m,v,y,b=n.list.shift();;)if(o.empty()||(a=o.min()),b&&(o.empty()||b.y<a.y||b.y==a.y&&b.x<a.x))s=r.leftBound(b),u=r.right(s),h=r.rightRegion(s),v=i.bisect(h,b),f=r.createHalfEdge(v,"l"),r.insert(s,f),g=i.intersect(s,f),g&&(o.del(s),o.insert(s,g,i.distance(g,b))),s=f,f=r.createHalfEdge(v,"r"),r.insert(s,f),g=i.intersect(f,u),g&&o.insert(f,g,i.distance(g,b)),b=n.list.shift();else{if(o.empty())break;s=o.extractMin(),c=r.left(s),u=r.right(s),l=r.right(u),h=r.leftRegion(s),p=r.rightRegion(u),m=s.vertex,i.endPoint(s.edge,s.side,m),i.endPoint(u.edge,u.side,m),r.del(s),o.del(u),r.del(u),y="l",h.y>p.y&&(d=h,h=p,p=d,y="r"),v=i.bisect(h,p),f=r.createHalfEdge(v,y),r.insert(c,f),i.endPoint(v,ka[y],m),g=i.intersect(c,f),g&&(o.del(c),o.insert(c,g,i.distance(g,h))),g=i.intersect(f,l),g&&o.insert(f,g,i.distance(g,h))}for(s=r.right(r.leftEnd);s!=r.rightEnd;s=r.right(s))e(s.edge)}function Gr(){return{leaf:!0,nodes:[],point:null}}function Xr(t,e,n,r,i,o){if(!t(e,n,r,i,o)){var a=.5*(n+i),s=.5*(r+o),u=e.nodes;u[0]&&Xr(t,u[0],n,r,a,s),u[1]&&Xr(t,u[1],a,r,i,s),u[2]&&Xr(t,u[2],n,s,a,o),u[3]&&Xr(t,u[3],a,s,i,o)}}function $r(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Zr(t,e,n,r){for(var i,o,a=0,s=e.length,u=n.length;s>a;){if(r>=u)return-1;if(i=e.charCodeAt(a++),37===i){if(o=Xa[e.charAt(a++)],!o||(r=o(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}function Jr(t){return new RegExp("^(?:"+t.map(Oi.requote).join("|")+")","i")}function Qr(t){for(var e=new o,n=-1,r=t.length;++n<r;)e.set(t[n].toLowerCase(),n);return e}function Kr(t,e,n){t+="";var r=t.length;return n>r?new Array(n-r+1).join(e)+t:t}function ti(t,e,n){Wa.lastIndex=0;var r=Wa.exec(e.substring(n));return r?n+=r[0].length:-1}function ei(t,e,n){za.lastIndex=0;var r=za.exec(e.substring(n));return r?n+=r[0].length:-1}function ni(t,e,n){Ha.lastIndex=0;var r=Ha.exec(e.substring(n));return r?(t.m=Ya.get(r[0].toLowerCase()),n+=r[0].length):-1}function ri(t,e,n){Fa.lastIndex=0;var r=Fa.exec(e.substring(n));return r?(t.m=Ua.get(r[0].toLowerCase()),n+=r[0].length):-1}function ii(t,e,n){return Zr(t,Ga.c.toString(),e,n)}function oi(t,e,n){return Zr(t,Ga.x.toString(),e,n)}function ai(t,e,n){return Zr(t,Ga.X.toString(),e,n)}function si(t,e,n){$a.lastIndex=0;var r=$a.exec(e.substring(n,n+4));return r?(t.y=+r[0],n+=r[0].length):-1}function ui(t,e,n){$a.lastIndex=0;var r=$a.exec(e.substring(n,n+2));return r?(t.y=ci(+r[0]),n+=r[0].length):-1}function ci(t){return t+(t>68?1900:2e3)}function li(t,e,n){$a.lastIndex=0;var r=$a.exec(e.substring(n,n+2));return r?(t.m=r[0]-1,n+=r[0].length):-1}function fi(t,e,n){$a.lastIndex=0;var r=$a.exec(e.substring(n,n+2));return r?(t.d=+r[0],n+=r[0].length):-1}function hi(t,e,n){$a.lastIndex=0;var r=$a.exec(e.substring(n,n+2));return r?(t.H=+r[0],n+=r[0].length):-1}function pi(t,e,n){$a.lastIndex=0;var r=$a.exec(e.substring(n,n+2));return r?(t.M=+r[0],n+=r[0].length):-1}function di(t,e,n){$a.lastIndex=0;var r=$a.exec(e.substring(n,n+2));return r?(t.S=+r[0],n+=r[0].length):-1}function gi(t,e,n){$a.lastIndex=0;var r=$a.exec(e.substring(n,n+3));return r?(t.L=+r[0],n+=r[0].length):-1}function mi(t,e,n){var r=Za.get(e.substring(n,n+=2).toLowerCase());return null==r?-1:(t.p=r,n)}function vi(t){var e=t.getTimezoneOffset(),n=e>0?"-":"+",r=~~(Math.abs(e)/60),i=Math.abs(e)%60;return n+Kr(r,"0",2)+Kr(i,"0",2)}function yi(t){return t.toISOString()}function bi(t,e,n){function r(e){var n=t(e),r=o(n,1);return r-e>e-n?n:r}function i(n){return e(n=t(new Ta(n-1)),1),n}function o(t,n){return e(t=new Ta(+t),n),t}function a(t,r,o){var a=i(t),s=[];if(o>1)for(;r>a;)n(a)%o||s.push(new Date(+a)),e(a,1);else for(;r>a;)s.push(new Date(+a)),e(a,1);return s}function s(t,e,n){try{Ta=$r;var r=new $r;return r._=t,a(r,e,n)}finally{Ta=Date}}t.floor=t,t.round=r,t.ceil=i,t.offset=o,t.range=a;var u=t.utc=_i(t);return u.floor=u,u.round=_i(r),u.ceil=_i(i),u.offset=_i(o),u.range=s,t}function _i(t){return function(e,n){try{Ta=$r;var r=new $r;return r._=e,t(r,n)._}finally{Ta=Date}}}function xi(t,e,n){function r(e){return t(e)}return r.invert=function(e){return Mi(t.invert(e))},r.domain=function(e){return arguments.length?(t.domain(e),r):t.domain().map(Mi)},r.nice=function(t){return r.domain(zt(r.domain(),function(){return t}))},r.ticks=function(n,i){var o=wi(r.domain());if("function"!=typeof n){var a=o[1]-o[0],s=a/n,u=Oi.bisect(Qa,s);if(u==Qa.length)return e.year(o,n);if(!u)return t.ticks(n).map(Mi);Math.log(s/Qa[u-1])<Math.log(Qa[u]/s)&&--u,n=e[u],i=n[1],n=n[0].range}return n(o[0],new Date(+o[1]+1),i)},r.tickFormat=function(){return n},r.copy=function(){return xi(t.copy(),e,n)},Oi.rebind(r,t,"range","rangeRound","interpolate","clamp")}function wi(t){var e=t[0],n=t[t.length-1];return n>e?[e,n]:[n,e]}function Mi(t){return new Date(t)}function Ai(t){return function(e){for(var n=t.length-1,r=t[n];!r[1](e);)r=t[--n];return r[0](e)}}function Ni(t){var e=new Date(t,0,1);return e.setFullYear(t),e}function Ei(t){var e=t.getFullYear(),n=Ni(e),r=Ni(e+1);return e+(t-n)/(r-n)}function ji(t){var e=new Date(Date.UTC(t,0,1));return e.setUTCFullYear(t),e}function Si(t){var e=t.getUTCFullYear(),n=ji(e),r=ji(e+1);return e+(t-n)/(r-n)}var ki=Math.PI,Ti=1e-6,Oi={version:"3.0.8"},Di=ki/180,Ci=180/ki,Pi=document,Ii=window,Ri=".",qi=",",Li=[3,3];Date.now||(Date.now=function(){return+new Date});try{Pi.createElement("div").style.setProperty("opacity",0,"")}catch(Bi){var zi=Ii.CSSStyleDeclaration.prototype,Wi=zi.setProperty;zi.setProperty=function(t,e,n){Wi.call(this,t,e+"",n)}}var Fi=i;try{Fi(Pi.documentElement.childNodes)[0].nodeType}catch(Ui){Fi=r}var Hi=[].__proto__?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)t[n]=e[n]};Oi.map=function(t){var e=new o;for(var n in t)e.set(n,t[n]);return e},n(o,{has:function(t){return Yi+t in this},get:function(t){return this[Yi+t]},set:function(t,e){return this[Yi+t]=e},remove:function(t){return t=Yi+t,t in this&&delete this[t]},keys:function(){var t=[];return this.forEach(function(e){t.push(e)}),t},values:function(){var t=[];return this.forEach(function(e,n){t.push(n)}),t},entries:function(){var t=[];return this.forEach(function(e,n){t.push({key:e,value:n})}),t},forEach:function(t){for(var e in this)e.charCodeAt(0)===Vi&&t.call(this,e.substring(1),this[e])}});var Yi="\x00",Vi=Yi.charCodeAt(0);Oi.functor=u,Oi.rebind=function(t,e){for(var n,r=1,i=arguments.length;++r<i;)t[n=arguments[r]]=c(t,e,e[n]);return t},Oi.ascending=function(t,e){return e>t?-1:t>e?1:t>=e?0:0/0},Oi.descending=function(t,e){return t>e?-1:e>t?1:e>=t?0:0/0},Oi.mean=function(t,e){var n,r=t.length,i=0,o=-1,a=0;if(1===arguments.length)for(;++o<r;)l(n=t[o])&&(i+=(n-i)/++a);else for(;++o<r;)l(n=e.call(t,t[o],o))&&(i+=(n-i)/++a);return a?i:void 0},Oi.median=function(t,e){return arguments.length>1&&(t=t.map(e)),t=t.filter(l),t.length?Oi.quantile(t.sort(Oi.ascending),.5):void 0},Oi.min=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o&&(null==(n=t[i])||n!=n);)n=void 0;for(;++i<o;)null!=(r=t[i])&&n>r&&(n=r)}else{for(;++i<o&&(null==(n=e.call(t,t[i],i))||n!=n);)n=void 0;for(;++i<o;)null!=(r=e.call(t,t[i],i))&&n>r&&(n=r)}return n},Oi.max=function(t,e){var n,r,i=-1,o=t.length;if(1===arguments.length){for(;++i<o&&(null==(n=t[i])||n!=n);)n=void 0;for(;++i<o;)null!=(r=t[i])&&r>n&&(n=r)}else{for(;++i<o&&(null==(n=e.call(t,t[i],i))||n!=n);)n=void 0;for(;++i<o;)null!=(r=e.call(t,t[i],i))&&r>n&&(n=r)}return n},Oi.extent=function(t,e){var n,r,i,o=-1,a=t.length;if(1===arguments.length){for(;++o<a&&(null==(n=i=t[o])||n!=n);)n=i=void 0;for(;++o<a;)null!=(r=t[o])&&(n>r&&(n=r),r>i&&(i=r))}else{for(;++o<a&&(null==(n=i=e.call(t,t[o],o))||n!=n);)n=void 0;for(;++o<a;)null!=(r=e.call(t,t[o],o))&&(n>r&&(n=r),r>i&&(i=r))}return[n,i]},Oi.random={normal:function(t,e){var n=arguments.length;return 2>n&&(e=1),1>n&&(t=0),function(){var n,r,i;do n=2*Math.random()-1,r=2*Math.random()-1,i=n*n+r*r;while(!i||i>1);return t+e*n*Math.sqrt(-2*Math.log(i)/i)}},logNormal:function(){var t=Oi.random.normal.apply(Oi,arguments);return function(){return Math.exp(t())}},irwinHall:function(t){return function(){for(var e=0,n=0;t>n;n++)e+=Math.random();return e/t}}},Oi.sum=function(t,e){var n,r=0,i=t.length,o=-1;if(1===arguments.length)for(;++o<i;)isNaN(n=+t[o])||(r+=n);else for(;++o<i;)isNaN(n=+e.call(t,t[o],o))||(r+=n);return r},Oi.quantile=function(t,e){var n=(t.length-1)*e+1,r=Math.floor(n),i=+t[r-1],o=n-r;return o?i+o*(t[r]-i):i},Oi.shuffle=function(t){for(var e,n,r=t.length;r;)n=Math.random()*r--|0,e=t[r],t[r]=t[n],t[n]=e;return t},Oi.transpose=function(t){return Oi.zip.apply(Oi,t)},Oi.zip=function(){if(!(r=arguments.length))return[];for(var t=-1,e=Oi.min(arguments,f),n=new Array(e);++t<e;)for(var r,i=-1,o=n[t]=new Array(r);++i<r;)o[i]=arguments[i][t];return n},Oi.bisector=function(t){return{left:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var o=r+i>>>1;t.call(e,e[o],o)<n?r=o+1:i=o}return r},right:function(e,n,r,i){for(arguments.length<3&&(r=0),arguments.length<4&&(i=e.length);i>r;){var o=r+i>>>1;n<t.call(e,e[o],o)?i=o:r=o+1}return r}}};var Gi=Oi.bisector(function(t){return t});Oi.bisectLeft=Gi.left,Oi.bisect=Oi.bisectRight=Gi.right,Oi.nest=function(){function t(e,s){if(s>=a.length)return r?r.call(i,e):n?e.sort(n):e;for(var u,c,l,f=-1,h=e.length,p=a[s++],d=new o,g={};++f<h;)(l=d.get(u=p(c=e[f])))?l.push(c):d.set(u,[c]);return d.forEach(function(e,n){g[e]=t(n,s)}),g}function e(t,n){if(n>=a.length)return t;var r,i=[],o=s[n++];for(r in t)i.push({key:r,values:e(t[r],n)});return o&&i.sort(function(t,e){return o(t.key,e.key)}),i}var n,r,i={},a=[],s=[];return i.map=function(e){return t(e,0)},i.entries=function(n){return e(t(n,0),0)},i.key=function(t){return a.push(t),i},i.sortKeys=function(t){return s[a.length-1]=t,i},i.sortValues=function(t){return n=t,i},i.rollup=function(t){return r=t,i},i},Oi.keys=function(t){var e=[];for(var n in t)e.push(n);return e},Oi.values=function(t){var e=[];for(var n in t)e.push(t[n]);return e},Oi.entries=function(t){var e=[];for(var n in t)e.push({key:n,value:t[n]});return e},Oi.permute=function(t,e){for(var n=[],r=-1,i=e.length;++r<i;)n[r]=t[e[r]];return n},Oi.merge=function(t){return Array.prototype.concat.apply([],t)},Oi.range=function(t,e,n){if(arguments.length<3&&(n=1,arguments.length<2&&(e=t,t=0)),(e-t)/n===1/0)throw new Error("infinite range");var r,i=[],o=p(Math.abs(n)),a=-1;if(t*=o,e*=o,n*=o,0>n)for(;(r=t+n*++a)>e;)i.push(r/o);else for(;(r=t+n*++a)<e;)i.push(r/o);return i},Oi.requote=function(t){return t.replace(Xi,"\\$&")};var Xi=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;Oi.round=function(t,e){return e?Math.round(t*(e=Math.pow(10,e)))/e:Math.round(t)},Oi.xhr=function(t,e,n){function r(){var t=c.status;!t&&c.responseText||t>=200&&300>t||304===t?o.load.call(i,u.call(i,c)):o.error.call(i,c)}var i={},o=Oi.dispatch("progress","load","error"),s={},u=a,c=new(Ii.XDomainRequest&&/^(http(s)?:)?\/\//.test(t)?XDomainRequest:XMLHttpRequest);return"onload"in c?c.onload=c.onerror=r:c.onreadystatechange=function(){c.readyState>3&&r()},c.onprogress=function(t){var e=Oi.event;Oi.event=t;try{o.progress.call(i,c)}finally{Oi.event=e}},i.header=function(t,e){return t=(t+"").toLowerCase(),arguments.length<2?s[t]:(null==e?delete s[t]:s[t]=e+"",i)},i.mimeType=function(t){return arguments.length?(e=null==t?null:t+"",i):e},i.response=function(t){return u=t,i},["get","post"].forEach(function(t){i[t]=function(){return i.send.apply(i,[t].concat(Fi(arguments)))}}),i.send=function(n,r,o){if(2===arguments.length&&"function"==typeof r&&(o=r,r=null),c.open(n,t,!0),null==e||"accept"in s||(s.accept=e+",*/*"),c.setRequestHeader)for(var a in s)c.setRequestHeader(a,s[a]);return null!=e&&c.overrideMimeType&&c.overrideMimeType(e),null!=o&&i.on("error",o).on("load",function(t){o(null,t)}),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},Oi.rebind(i,o,"on"),2===arguments.length&&"function"==typeof e&&(n=e,e=null),null==n?i:i.get(d(n))},Oi.text=function(){return Oi.xhr.apply(Oi,arguments).response(g)},Oi.json=function(t,e){return Oi.xhr(t,"application/json",e).response(m)},Oi.html=function(t,e){return Oi.xhr(t,"text/html",e).response(v)},Oi.xml=function(){return Oi.xhr.apply(Oi,arguments).response(y)};var $i={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};Oi.ns={prefix:$i,qualify:function(t){var e=t.indexOf(":"),n=t;return e>=0&&(n=t.substring(0,e),t=t.substring(e+1)),$i.hasOwnProperty(n)?{space:$i[n],local:t}:t}},Oi.dispatch=function(){for(var t=new b,e=-1,n=arguments.length;++e<n;)t[arguments[e]]=_(t);return t},b.prototype.on=function(t,e){var n=t.indexOf("."),r="";return n>0&&(r=t.substring(n+1),t=t.substring(0,n)),arguments.length<2?this[t].on(r):this[t].on(r,e)},Oi.format=function(t){var e=Zi.exec(t),n=e[1]||" ",r=e[2]||">",i=e[3]||"",o=e[4]||"",a=e[5],s=+e[6],u=e[7],c=e[8],l=e[9],f=1,h="",p=!1;switch(c&&(c=+c.substring(1)),(a||"0"===n&&"="===r)&&(a=n="0",r="=",u&&(s-=Math.floor((s-1)/4))),l){case"n":u=!0,l="g";break;case"%":f=100,h="%",l="f";break;case"p":f=100,h="%",l="r";break;case"b":case"o":case"x":case"X":o&&(o="0"+l.toLowerCase());case"c":case"d":p=!0,c=0;break;case"s":f=-1,l="r"}"#"===o&&(o=""),"r"!=l||c||(l="g"),l=Ji.get(l)||w;var d=a&&u;return function(t){if(p&&t%1)return"";var e=0>t||0===t&&0>1/t?(t=-t,"-"):i;if(0>f){var g=Oi.formatPrefix(t,c);t=g.scale(t),h=g.symbol}else t*=f;t=l(t,c),!a&&u&&(t=Qi(t));var m=o.length+t.length+(d?0:e.length),v=s>m?new Array(m=s-m+1).join(n):"";return d&&(t=Qi(v+t)),Ri&&t.replace(".",Ri),e+=o,("<"===r?e+t+v:">"===r?v+e+t:"^"===r?v.substring(0,m>>=1)+e+t+v.substring(m):e+(d?t:v+t))+h}};var Zi=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,Ji=Oi.map({b:function(t){return t.toString(2)},c:function(t){return String.fromCharCode(t)},o:function(t){return t.toString(8)},x:function(t){return t.toString(16)},X:function(t){return t.toString(16).toUpperCase()},g:function(t,e){return t.toPrecision(e)},e:function(t,e){return t.toExponential(e)},f:function(t,e){return t.toFixed(e)},r:function(t,e){return(t=Oi.round(t,x(t,e))).toFixed(Math.max(0,Math.min(20,x(t*(1+1e-15),e))))}}),Qi=a;if(Li){var Ki=Li.length;Qi=function(t){for(var e=t.lastIndexOf("."),n=e>=0?"."+t.substring(e+1):(e=t.length,""),r=[],i=0,o=Li[0];e>0&&o>0;)r.push(t.substring(e-=o,e+o)),o=Li[i=(i+1)%Ki];return r.reverse().join(qi||"")+n}}var to=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"].map(M);Oi.formatPrefix=function(t,e){var n=0;return t&&(0>t&&(t*=-1),e&&(t=Oi.round(t,x(t,e))),n=1+Math.floor(1e-12+Math.log(t)/Math.LN10),n=Math.max(-24,Math.min(24,3*Math.floor((0>=n?n+1:n-1)/3)))),to[8+n/3]};var eo=function(){return a},no=Oi.map({linear:eo,poly:T,quad:function(){return j},cubic:function(){return S},sin:function(){return O},exp:function(){return D},circle:function(){return C},elastic:P,back:I,bounce:function(){return R}}),ro=Oi.map({"in":a,out:N,"in-out":E,"out-in":function(t){return E(N(t))}});Oi.ease=function(t){var e=t.indexOf("-"),n=e>=0?t.substring(0,e):t,r=e>=0?t.substring(e+1):"in";return n=no.get(n)||eo,r=ro.get(r)||a,A(r(n.apply(null,Array.prototype.slice.call(arguments,1))))},Oi.event=null,Oi.transform=function(t){var e=Pi.createElementNS(Oi.ns.prefix.svg,"g");return(Oi.transform=function(t){e.setAttribute("transform",t);var n=e.transform.baseVal.consolidate();return new z(n?n.matrix:io)})(t)},z.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var io={a:1,b:0,c:0,d:1,e:0,f:0};Oi.interpolate=function(t,e){for(var n,r=Oi.interpolators.length;--r>=0&&!(n=Oi.interpolators[r](t,e)););return n},Oi.interpolateNumber=function(t,e){return e-=t,function(n){return t+e*n}},Oi.interpolateRound=function(t,e){return e-=t,function(n){return Math.round(t+e*n)}},Oi.interpolateString=function(t,e){var n,r,i,o,a,s=0,u=0,c=[],l=[];for(oo.lastIndex=0,r=0;n=oo.exec(e);++r)n.index&&c.push(e.substring(s,u=n.index)),l.push({i:c.length,x:n[0]}),c.push(null),s=oo.lastIndex;for(s<e.length&&c.push(e.substring(s)),r=0,o=l.length;(n=oo.exec(t))&&o>r;++r)if(a=l[r],a.x==n[0]){if(a.i)if(null==c[a.i+1])for(c[a.i-1]+=a.x,c.splice(a.i,1),i=r+1;o>i;++i)l[i].i--;else for(c[a.i-1]+=a.x+c[a.i+1],c.splice(a.i,2),i=r+1;o>i;++i)l[i].i-=2;else if(null==c[a.i+1])c[a.i]=a.x;else for(c[a.i]=a.x+c[a.i+1],c.splice(a.i+1,1),i=r+1;o>i;++i)l[i].i--;l.splice(r,1),o--,r--}else a.x=Oi.interpolateNumber(parseFloat(n[0]),parseFloat(a.x));for(;o>r;)a=l.pop(),null==c[a.i+1]?c[a.i]=a.x:(c[a.i]=a.x+c[a.i+1],c.splice(a.i+1,1)),o--;return 1===c.length?null==c[0]?l[0].x:function(){return e}:function(t){for(r=0;o>r;++r)c[(a=l[r]).i]=a.x(t);return c.join("")}},Oi.interpolateTransform=function(t,e){var n,r=[],i=[],o=Oi.transform(t),a=Oi.transform(e),s=o.translate,u=a.translate,c=o.rotate,l=a.rotate,f=o.skew,h=a.skew,p=o.scale,d=a.scale;return s[0]!=u[0]||s[1]!=u[1]?(r.push("translate(",null,",",null,")"),i.push({i:1,x:Oi.interpolateNumber(s[0],u[0])},{i:3,x:Oi.interpolateNumber(s[1],u[1])})):r.push(u[0]||u[1]?"translate("+u+")":""),c!=l?(c-l>180?l+=360:l-c>180&&(c+=360),i.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:Oi.interpolateNumber(c,l)})):l&&r.push(r.pop()+"rotate("+l+")"),f!=h?i.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:Oi.interpolateNumber(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),p[0]!=d[0]||p[1]!=d[1]?(n=r.push(r.pop()+"scale(",null,",",null,")"),i.push({i:n-4,x:Oi.interpolateNumber(p[0],d[0])},{i:n-2,x:Oi.interpolateNumber(p[1],d[1])})):(1!=d[0]||1!=d[1])&&r.push(r.pop()+"scale("+d+")"),n=i.length,function(t){for(var e,o=-1;++o<n;)r[(e=i[o]).i]=e.x(t);return r.join("")}},Oi.interpolateRgb=function(t,e){t=Oi.rgb(t),e=Oi.rgb(e);var n=t.r,r=t.g,i=t.b,o=e.r-n,a=e.g-r,s=e.b-i;return function(t){return"#"+Z(Math.round(n+o*t))+Z(Math.round(r+a*t))+Z(Math.round(i+s*t))}},Oi.interpolateHsl=function(t,e){t=Oi.hsl(t),e=Oi.hsl(e);var n=t.h,r=t.s,i=t.l,o=e.h-n,a=e.s-r,s=e.l-i;return o>180?o-=360:-180>o&&(o+=360),function(t){return it(n+o*t,r+a*t,i+s*t)+""}},Oi.interpolateLab=function(t,e){t=Oi.lab(t),e=Oi.lab(e);var n=t.l,r=t.a,i=t.b,o=e.l-n,a=e.a-r,s=e.b-i;return function(t){return lt(n+o*t,r+a*t,i+s*t)+""}},Oi.interpolateHcl=function(t,e){t=Oi.hcl(t),e=Oi.hcl(e);var n=t.h,r=t.c,i=t.l,o=e.h-n,a=e.c-r,s=e.l-i;return o>180?o-=360:-180>o&&(o+=360),function(t){return st(n+o*t,r+a*t,i+s*t)+""}},Oi.interpolateArray=function(t,e){var n,r=[],i=[],o=t.length,a=e.length,s=Math.min(t.length,e.length);for(n=0;s>n;++n)r.push(Oi.interpolate(t[n],e[n]));for(;o>n;++n)i[n]=t[n];for(;a>n;++n)i[n]=e[n];return function(t){for(n=0;s>n;++n)i[n]=r[n](t);return i}},Oi.interpolateObject=function(t,e){var n,r={},i={};for(n in t)n in e?r[n]=H(n)(t[n],e[n]):i[n]=t[n];for(n in e)n in t||(i[n]=e[n]);return function(t){for(n in r)i[n]=r[n](t);return i}};var oo=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g;Oi.interpolators=[Oi.interpolateObject,function(t,e){return e instanceof Array&&Oi.interpolateArray(t,e)},function(t,e){return("string"==typeof t||"string"==typeof e)&&Oi.interpolateString(t+"",e+"")},function(t,e){return("string"==typeof e?so.has(e)||/^(#|rgb\(|hsl\()/.test(e):e instanceof G)&&Oi.interpolateRgb(t,e)},function(t,e){return!isNaN(t=+t)&&!isNaN(e=+e)&&Oi.interpolateNumber(t,e)}],G.prototype.toString=function(){return this.rgb()+""},Oi.rgb=function(t,e,n){return 1===arguments.length?t instanceof $?X(t.r,t.g,t.b):J(""+t,X,it):X(~~t,~~e,~~n)};var ao=$.prototype=new G;ao.brighter=function(t){t=Math.pow(.7,arguments.length?t:1);var e=this.r,n=this.g,r=this.b,i=30;return e||n||r?(e&&i>e&&(e=i),n&&i>n&&(n=i),r&&i>r&&(r=i),X(Math.min(255,Math.floor(e/t)),Math.min(255,Math.floor(n/t)),Math.min(255,Math.floor(r/t)))):X(i,i,i)},ao.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),X(Math.floor(t*this.r),Math.floor(t*this.g),Math.floor(t*this.b))},ao.hsl=function(){return Q(this.r,this.g,this.b)},ao.toString=function(){return"#"+Z(this.r)+Z(this.g)+Z(this.b)};var so=Oi.map({aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",
  ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"});so.forEach(function(t,e){so.set(t,J(e,X,it))}),Oi.hsl=function(t,e,n){return 1===arguments.length?t instanceof rt?nt(t.h,t.s,t.l):J(""+t,Q,nt):nt(+t,+e,+n)};var uo=rt.prototype=new G;uo.brighter=function(t){return t=Math.pow(.7,arguments.length?t:1),nt(this.h,this.s,this.l/t)},uo.darker=function(t){return t=Math.pow(.7,arguments.length?t:1),nt(this.h,this.s,t*this.l)},uo.rgb=function(){return it(this.h,this.s,this.l)},Oi.hcl=function(t,e,n){return 1===arguments.length?t instanceof at?ot(t.h,t.c,t.l):t instanceof ct?ft(t.l,t.a,t.b):ft((t=K((t=Oi.rgb(t)).r,t.g,t.b)).l,t.a,t.b):ot(+t,+e,+n)};var co=at.prototype=new G;co.brighter=function(t){return ot(this.h,this.c,Math.min(100,this.l+lo*(arguments.length?t:1)))},co.darker=function(t){return ot(this.h,this.c,Math.max(0,this.l-lo*(arguments.length?t:1)))},co.rgb=function(){return st(this.h,this.c,this.l).rgb()},Oi.lab=function(t,e,n){return 1===arguments.length?t instanceof ct?ut(t.l,t.a,t.b):t instanceof at?st(t.l,t.c,t.h):K((t=Oi.rgb(t)).r,t.g,t.b):ut(+t,+e,+n)};var lo=18,fo=.95047,ho=1,po=1.08883,go=ct.prototype=new G;go.brighter=function(t){return ut(Math.min(100,this.l+lo*(arguments.length?t:1)),this.a,this.b)},go.darker=function(t){return ut(Math.max(0,this.l-lo*(arguments.length?t:1)),this.a,this.b)},go.rgb=function(){return lt(this.l,this.a,this.b)};var mo=function(t,e){return e.querySelector(t)},vo=function(t,e){return e.querySelectorAll(t)},yo=Pi.documentElement,bo=yo.matchesSelector||yo.webkitMatchesSelector||yo.mozMatchesSelector||yo.msMatchesSelector||yo.oMatchesSelector,_o=function(t,e){return bo.call(t,e)};"function"==typeof Sizzle&&(mo=function(t,e){return Sizzle(t,e)[0]||null},vo=function(t,e){return Sizzle.uniqueSort(Sizzle(t,e))},_o=Sizzle.matchesSelector);var xo=[];Oi.selection=function(){return wo},Oi.selection.prototype=xo,xo.select=function(t){var e,n,r,i,o=[];"function"!=typeof t&&(t=mt(t));for(var a=-1,s=this.length;++a<s;){o.push(e=[]),e.parentNode=(r=this[a]).parentNode;for(var u=-1,c=r.length;++u<c;)(i=r[u])?(e.push(n=t.call(i,i.__data__,u)),n&&"__data__"in i&&(n.__data__=i.__data__)):e.push(null)}return gt(o)},xo.selectAll=function(t){var e,n,r=[];"function"!=typeof t&&(t=vt(t));for(var i=-1,o=this.length;++i<o;)for(var a=this[i],s=-1,u=a.length;++s<u;)(n=a[s])&&(r.push(e=Fi(t.call(n,n.__data__,s))),e.parentNode=n);return gt(r)},xo.attr=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node();return t=Oi.ns.qualify(t),t.local?n.getAttributeNS(t.space,t.local):n.getAttribute(t)}for(e in t)this.each(yt(e,t[e]));return this}return this.each(yt(t,e))},xo.classed=function(t,e){if(arguments.length<2){if("string"==typeof t){var n=this.node(),r=(t=t.trim().split(/^|\s+/g)).length,i=-1;if(e=n.classList){for(;++i<r;)if(!e.contains(t[i]))return!1}else for(e=n.className,null!=e.baseVal&&(e=e.baseVal);++i<r;)if(!bt(t[i]).test(e))return!1;return!0}for(e in t)this.each(_t(e,t[e]));return this}return this.each(_t(t,e))},xo.style=function(t,e,n){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(e="");for(n in t)this.each(wt(n,t[n],e));return this}if(2>r)return Ii.getComputedStyle(this.node(),null).getPropertyValue(t);n=""}return this.each(wt(t,e,n))},xo.property=function(t,e){if(arguments.length<2){if("string"==typeof t)return this.node()[t];for(e in t)this.each(Mt(e,t[e]));return this}return this.each(Mt(t,e))},xo.text=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.textContent=null==e?"":e}:null==t?function(){this.textContent=""}:function(){this.textContent=t}):this.node().textContent},xo.html=function(t){return arguments.length?this.each("function"==typeof t?function(){var e=t.apply(this,arguments);this.innerHTML=null==e?"":e}:null==t?function(){this.innerHTML=""}:function(){this.innerHTML=t}):this.node().innerHTML},xo.append=function(t){function e(){return this.appendChild(Pi.createElementNS(this.namespaceURI,t))}function n(){return this.appendChild(Pi.createElementNS(t.space,t.local))}return t=Oi.ns.qualify(t),this.select(t.local?n:e)},xo.insert=function(t,e){function n(){return this.insertBefore(Pi.createElementNS(this.namespaceURI,t),mo(e,this))}function r(){return this.insertBefore(Pi.createElementNS(t.space,t.local),mo(e,this))}return t=Oi.ns.qualify(t),this.select(t.local?r:n)},xo.remove=function(){return this.each(function(){var t=this.parentNode;t&&t.removeChild(this)})},xo.data=function(t,e){function n(t,n){var r,i,a,s=t.length,f=n.length,h=Math.min(s,f),p=new Array(f),d=new Array(f),g=new Array(s);if(e){var m,v=new o,y=new o,b=[];for(r=-1;++r<s;)m=e.call(i=t[r],i.__data__,r),v.has(m)?g[r]=i:v.set(m,i),b.push(m);for(r=-1;++r<f;)m=e.call(n,a=n[r],r),(i=v.get(m))?(p[r]=i,i.__data__=a):y.has(m)||(d[r]=At(a)),y.set(m,a),v.remove(m);for(r=-1;++r<s;)v.has(b[r])&&(g[r]=t[r])}else{for(r=-1;++r<h;)i=t[r],a=n[r],i?(i.__data__=a,p[r]=i):d[r]=At(a);for(;f>r;++r)d[r]=At(n[r]);for(;s>r;++r)g[r]=t[r]}d.update=p,d.parentNode=p.parentNode=g.parentNode=t.parentNode,u.push(d),c.push(p),l.push(g)}var r,i,a=-1,s=this.length;if(!arguments.length){for(t=new Array(s=(r=this[0]).length);++a<s;)(i=r[a])&&(t[a]=i.__data__);return t}var u=kt([]),c=gt([]),l=gt([]);if("function"==typeof t)for(;++a<s;)n(r=this[a],t.call(r,r.parentNode.__data__,a));else for(;++a<s;)n(r=this[a],t);return c.enter=function(){return u},c.exit=function(){return l},c},xo.datum=function(t){return arguments.length?this.property("__data__",t):this.property("__data__")},xo.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=Nt(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]),e.parentNode=(n=this[o]).parentNode;for(var s=0,u=n.length;u>s;s++)(r=n[s])&&t.call(r,r.__data__,s)&&e.push(r)}return gt(i)},xo.order=function(){for(var t=-1,e=this.length;++t<e;)for(var n,r=this[t],i=r.length-1,o=r[i];--i>=0;)(n=r[i])&&(o&&o!==n.nextSibling&&o.parentNode.insertBefore(n,o),o=n);return this},xo.sort=function(t){t=Et.apply(this,arguments);for(var e=-1,n=this.length;++e<n;)this[e].sort(t);return this.order()},xo.on=function(t,e,n){var r=arguments.length;if(3>r){if("string"!=typeof t){2>r&&(e=!1);for(n in t)this.each(jt(n,t[n],e));return this}if(2>r)return(r=this.node()["__on"+t])&&r._;n=!1}return this.each(jt(t,e,n))},xo.each=function(t){return St(this,function(e,n,r){t.call(e,e.__data__,n,r)})},xo.call=function(t){var e=Fi(arguments);return t.apply(e[0]=this,e),this},xo.empty=function(){return!this.node()},xo.node=function(){for(var t=0,e=this.length;e>t;t++)for(var n=this[t],r=0,i=n.length;i>r;r++){var o=n[r];if(o)return o}return null},xo.transition=function(){var t,e,n=Ao||++Eo,r=[],i=Object.create(jo);i.time=Date.now();for(var o=-1,a=this.length;++o<a;){r.push(t=[]);for(var s=this[o],u=-1,c=s.length;++u<c;)(e=s[u])&&Ot(e,u,n,i),t.push(e)}return Tt(r,n)};var wo=gt([[Pi]]);wo[0].parentNode=yo,Oi.select=function(t){return"string"==typeof t?wo.select(t):gt([[t]])},Oi.selectAll=function(t){return"string"==typeof t?wo.selectAll(t):gt([Fi(t)])};var Mo=[];Oi.selection.enter=kt,Oi.selection.enter.prototype=Mo,Mo.append=xo.append,Mo.insert=xo.insert,Mo.empty=xo.empty,Mo.node=xo.node,Mo.select=function(t){for(var e,n,r,i,o,a=[],s=-1,u=this.length;++s<u;){r=(i=this[s]).update,a.push(e=[]),e.parentNode=i.parentNode;for(var c=-1,l=i.length;++c<l;)(o=i[c])?(e.push(r[c]=n=t.call(i.parentNode,o.__data__,c)),n.__data__=o.__data__):e.push(null)}return gt(a)};var Ao,No=[],Eo=0,jo={ease:k,delay:0,duration:250};No.call=xo.call,No.empty=xo.empty,No.node=xo.node,Oi.transition=function(t){return arguments.length?Ao?t.transition():t:wo.transition()},Oi.transition.prototype=No,No.select=function(t){var e,n,r,i=this.id,o=[];"function"!=typeof t&&(t=mt(t));for(var a=-1,s=this.length;++a<s;){o.push(e=[]);for(var u=this[a],c=-1,l=u.length;++c<l;)(r=u[c])&&(n=t.call(r,r.__data__,c))?("__data__"in r&&(n.__data__=r.__data__),Ot(n,c,i,r.__transition__[i]),e.push(n)):e.push(null)}return Tt(o,i)},No.selectAll=function(t){var e,n,r,i,o,a=this.id,s=[];"function"!=typeof t&&(t=vt(t));for(var u=-1,c=this.length;++u<c;)for(var l=this[u],f=-1,h=l.length;++f<h;)if(r=l[f]){o=r.__transition__[a],n=t.call(r,r.__data__,f),s.push(e=[]);for(var p=-1,d=n.length;++p<d;)Ot(i=n[p],p,a,o),e.push(i)}return Tt(s,a)},No.filter=function(t){var e,n,r,i=[];"function"!=typeof t&&(t=Nt(t));for(var o=0,a=this.length;a>o;o++){i.push(e=[]);for(var n=this[o],s=0,u=n.length;u>s;s++)(r=n[s])&&t.call(r,r.__data__,s)&&e.push(r)}return Tt(i,this.id,this.time).ease(this.ease())},No.attr=function(t,e){function n(){this.removeAttribute(o)}function r(){this.removeAttributeNS(o.space,o.local)}if(arguments.length<2){for(e in t)this.attr(e,t[e]);return this}var i=H(t),o=Oi.ns.qualify(t);return Ct(this,"attr."+t,e,function(t){function e(){var e,n=this.getAttribute(o);return n!==t&&(e=i(n,t),function(t){this.setAttribute(o,e(t))})}function a(){var e,n=this.getAttributeNS(o.space,o.local);return n!==t&&(e=i(n,t),function(t){this.setAttributeNS(o.space,o.local,e(t))})}return null==t?o.local?r:n:(t+="",o.local?a:e)})},No.attrTween=function(t,e){function n(t,n){var r=e.call(this,t,n,this.getAttribute(i));return r&&function(t){this.setAttribute(i,r(t))}}function r(t,n){var r=e.call(this,t,n,this.getAttributeNS(i.space,i.local));return r&&function(t){this.setAttributeNS(i.space,i.local,r(t))}}var i=Oi.ns.qualify(t);return this.tween("attr."+t,i.local?r:n)},No.style=function(t,e,n){function r(){this.style.removeProperty(t)}var i=arguments.length;if(3>i){if("string"!=typeof t){2>i&&(e="");for(n in t)this.style(n,t[n],e);return this}n=""}var o=H(t);return Ct(this,"style."+t,e,function(e){function i(){var r,i=Ii.getComputedStyle(this,null).getPropertyValue(t);return i!==e&&(r=o(i,e),function(e){this.style.setProperty(t,r(e),n)})}return null==e?r:(e+="",i)})},No.styleTween=function(t,e,n){return arguments.length<3&&(n=""),this.tween("style."+t,function(r,i){var o=e.call(this,r,i,Ii.getComputedStyle(this,null).getPropertyValue(t));return o&&function(e){this.style.setProperty(t,o(e),n)}})},No.text=function(t){return Ct(this,"text",t,Dt)},No.remove=function(){return this.each("end.transition",function(){var t;!this.__transition__&&(t=this.parentNode)&&t.removeChild(this)})},No.ease=function(t){var e=this.id;return arguments.length<1?this.node().__transition__[e].ease:("function"!=typeof t&&(t=Oi.ease.apply(Oi,arguments)),St(this,function(n){n.__transition__[e].ease=t}))},No.delay=function(t){var e=this.id;return St(this,"function"==typeof t?function(n,r,i){n.__transition__[e].delay=0|t.call(n,n.__data__,r,i)}:(t|=0,function(n){n.__transition__[e].delay=t}))},No.duration=function(t){var e=this.id;return St(this,"function"==typeof t?function(n,r,i){n.__transition__[e].duration=Math.max(1,0|t.call(n,n.__data__,r,i))}:(t=Math.max(1,0|t),function(n){n.__transition__[e].duration=t}))},No.each=function(t,e){var n=this.id;if(arguments.length<2){var r=jo,i=Ao;Ao=n,St(this,function(e,r,i){jo=e.__transition__[n],t.call(e,e.__data__,r,i)}),jo=r,Ao=i}else St(this,function(r){r.__transition__[n].event.on(t,e)});return this},No.transition=function(){for(var t,e,n,r,i=this.id,o=++Eo,a=[],s=0,u=this.length;u>s;s++){a.push(t=[]);for(var e=this[s],c=0,l=e.length;l>c;c++)(n=e[c])&&(r=Object.create(n.__transition__[i]),r.delay+=r.duration,Ot(n,c,o,r)),t.push(n)}return Tt(a,o)},No.tween=function(t,e){var n=this.id;return arguments.length<2?this.node().__transition__[n].tween.get(t):St(this,null==e?function(e){e.__transition__[n].tween.remove(t)}:function(r){r.__transition__[n].tween.set(t,e)})};var So,ko,To=0,Oo={},Do=null;Oi.timer=function(t,e,n){if(arguments.length<3){if(arguments.length<2)e=0;else if(!isFinite(e))return;n=Date.now()}var r=Oo[t.id];r&&r.callback===t?(r.then=n,r.delay=e):Oo[t.id=++To]=Do={callback:t,then:n,delay:e,next:Do},So||(ko=clearTimeout(ko),So=1,Co(Pt))},Oi.timer.flush=function(){for(var t,e=Date.now(),n=Do;n;)t=e-n.then,n.delay||(n.flush=n.callback(t)),n=n.next;It()};var Co=Ii.requestAnimationFrame||Ii.webkitRequestAnimationFrame||Ii.mozRequestAnimationFrame||Ii.oRequestAnimationFrame||Ii.msRequestAnimationFrame||function(t){setTimeout(t,17)};Oi.mouse=function(t){return Rt(t,L())};var Po=/WebKit/.test(Ii.navigator.userAgent)?-1:0;Oi.touches=function(t,e){return arguments.length<2&&(e=L().touches),e?Fi(e).map(function(e){var n=Rt(t,e);return n.identifier=e.identifier,n}):[]},Oi.scale={},Oi.scale.linear=function(){return Ft([0,1],[0,1],Oi.interpolate,!1)},Oi.scale.log=function(){return Zt(Oi.scale.linear(),Jt)};var Io=Oi.format(".0e");Jt.pow=function(t){return Math.pow(10,t)},Qt.pow=function(t){return-Math.pow(10,-t)},Oi.scale.pow=function(){return Kt(Oi.scale.linear(),1)},Oi.scale.sqrt=function(){return Oi.scale.pow().exponent(.5)},Oi.scale.ordinal=function(){return ee([],{t:"range",a:[[]]})},Oi.scale.category10=function(){return Oi.scale.ordinal().range(Ro)},Oi.scale.category20=function(){return Oi.scale.ordinal().range(qo)},Oi.scale.category20b=function(){return Oi.scale.ordinal().range(Lo)},Oi.scale.category20c=function(){return Oi.scale.ordinal().range(Bo)};var Ro=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],qo=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],Lo=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],Bo=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];Oi.scale.quantile=function(){return ne([],[])},Oi.scale.quantize=function(){return re(0,1,[0,1])},Oi.scale.threshold=function(){return ie([.5],[0,1])},Oi.scale.identity=function(){return oe([0,1])},Oi.svg={},Oi.svg.arc=function(){function t(){var t=e.apply(this,arguments),o=n.apply(this,arguments),a=r.apply(this,arguments)+zo,s=i.apply(this,arguments)+zo,u=(a>s&&(u=a,a=s,s=u),s-a),c=ki>u?"0":"1",l=Math.cos(a),f=Math.sin(a),h=Math.cos(s),p=Math.sin(s);return u>=Wo?t?"M0,"+o+"A"+o+","+o+" 0 1,1 0,"+-o+"A"+o+","+o+" 0 1,1 0,"+o+"M0,"+t+"A"+t+","+t+" 0 1,0 0,"+-t+"A"+t+","+t+" 0 1,0 0,"+t+"Z":"M0,"+o+"A"+o+","+o+" 0 1,1 0,"+-o+"A"+o+","+o+" 0 1,1 0,"+o+"Z":t?"M"+o*l+","+o*f+"A"+o+","+o+" 0 "+c+",1 "+o*h+","+o*p+"L"+t*h+","+t*p+"A"+t+","+t+" 0 "+c+",0 "+t*l+","+t*f+"Z":"M"+o*l+","+o*f+"A"+o+","+o+" 0 "+c+",1 "+o*h+","+o*p+"L0,0Z"}var e=ae,n=se,r=ue,i=ce;return t.innerRadius=function(n){return arguments.length?(e=u(n),t):e},t.outerRadius=function(e){return arguments.length?(n=u(e),t):n},t.startAngle=function(e){return arguments.length?(r=u(e),t):r},t.endAngle=function(e){return arguments.length?(i=u(e),t):i},t.centroid=function(){var t=(e.apply(this,arguments)+n.apply(this,arguments))/2,o=(r.apply(this,arguments)+i.apply(this,arguments))/2+zo;return[Math.cos(o)*t,Math.sin(o)*t]},t};var zo=-ki/2,Wo=2*ki-1e-6;Oi.svg.line=function(){return le(a)};var Fo=Oi.map({linear:pe,"linear-closed":de,"step-before":ge,"step-after":me,basis:we,"basis-open":Me,"basis-closed":Ae,bundle:Ne,cardinal:be,"cardinal-open":ve,"cardinal-closed":ye,monotone:Oe});Fo.forEach(function(t,e){e.key=t,e.closed=/-closed$/.test(t)});var Uo=[0,2/3,1/3,0],Ho=[0,1/3,2/3,0],Yo=[0,1/6,2/3,1/6];Oi.svg.line.radial=function(){var t=le(De);return t.radius=t.x,delete t.x,t.angle=t.y,delete t.y,t},ge.reverse=me,me.reverse=ge,Oi.svg.area=function(){return Ce(a)},Oi.svg.area.radial=function(){var t=Ce(De);return t.radius=t.x,delete t.x,t.innerRadius=t.x0,delete t.x0,t.outerRadius=t.x1,delete t.x1,t.angle=t.y,delete t.y,t.startAngle=t.y0,delete t.y0,t.endAngle=t.y1,delete t.y1,t},Oi.svg.chord=function(){function n(t,e){var n=r(this,s,t,e),u=r(this,c,t,e);return"M"+n.p0+o(n.r,n.p1,n.a1-n.a0)+(i(n,u)?a(n.r,n.p1,n.r,n.p0):a(n.r,n.p1,u.r,u.p0)+o(u.r,u.p1,u.a1-u.a0)+a(u.r,u.p1,n.r,n.p0))+"Z"}function r(t,e,n,r){var i=e.call(t,n,r),o=l.call(t,i,r),a=f.call(t,i,r)+zo,s=h.call(t,i,r)+zo;return{r:o,a0:a,a1:s,p0:[o*Math.cos(a),o*Math.sin(a)],p1:[o*Math.cos(s),o*Math.sin(s)]}}function i(t,e){return t.a0==e.a0&&t.a1==e.a1}function o(t,e,n){return"A"+t+","+t+" 0 "+ +(n>ki)+",1 "+e}function a(t,e,n,r){return"Q 0,0 "+r}var s=e,c=t,l=Pe,f=ue,h=ce;return n.radius=function(t){return arguments.length?(l=u(t),n):l},n.source=function(t){return arguments.length?(s=u(t),n):s},n.target=function(t){return arguments.length?(c=u(t),n):c},n.startAngle=function(t){return arguments.length?(f=u(t),n):f},n.endAngle=function(t){return arguments.length?(h=u(t),n):h},n},Oi.svg.diagonal=function(){function n(t,e){var n=r.call(this,t,e),a=i.call(this,t,e),s=(n.y+a.y)/2,u=[n,{x:n.x,y:s},{x:a.x,y:s},a];return u=u.map(o),"M"+u[0]+"C"+u[1]+" "+u[2]+" "+u[3]}var r=e,i=t,o=Ie;return n.source=function(t){return arguments.length?(r=u(t),n):r},n.target=function(t){return arguments.length?(i=u(t),n):i},n.projection=function(t){return arguments.length?(o=t,n):o},n},Oi.svg.diagonal.radial=function(){var t=Oi.svg.diagonal(),e=Ie,n=t.projection;return t.projection=function(t){return arguments.length?n(Re(e=t)):e},t},Oi.svg.symbol=function(){function t(t,r){return(Vo.get(e.call(this,t,r))||Be)(n.call(this,t,r))}var e=Le,n=qe;return t.type=function(n){return arguments.length?(e=u(n),t):e},t.size=function(e){return arguments.length?(n=u(e),t):n},t};var Vo=Oi.map({circle:Be,cross:function(t){var e=Math.sqrt(t/5)/2;return"M"+-3*e+","+-e+"H"+-e+"V"+-3*e+"H"+e+"V"+-e+"H"+3*e+"V"+e+"H"+e+"V"+3*e+"H"+-e+"V"+e+"H"+-3*e+"Z"},diamond:function(t){var e=Math.sqrt(t/(2*Xo)),n=e*Xo;return"M0,"+-e+"L"+n+",0 0,"+e+" "+-n+",0Z"},square:function(t){var e=Math.sqrt(t)/2;return"M"+-e+","+-e+"L"+e+","+-e+" "+e+","+e+" "+-e+","+e+"Z"},"triangle-down":function(t){var e=Math.sqrt(t/Go),n=e*Go/2;return"M0,"+n+"L"+e+","+-n+" "+-e+","+-n+"Z"},"triangle-up":function(t){var e=Math.sqrt(t/Go),n=e*Go/2;return"M0,"+-n+"L"+e+","+n+" "+-e+","+n+"Z"}});Oi.svg.symbolTypes=Vo.keys();var Go=Math.sqrt(3),Xo=Math.tan(30*Di);Oi.svg.axis=function(){function t(t){t.each(function(){var t,f=Oi.select(this),h=null==c?n.ticks?n.ticks.apply(n,u):n.domain():c,p=null==e?n.tickFormat?n.tickFormat.apply(n,u):String:e,d=Fe(n,h,l),g=f.selectAll(".tick.minor").data(d,String),m=g.enter().insert("line",".tick").attr("class","tick minor").style("opacity",1e-6),v=Oi.transition(g.exit()).style("opacity",1e-6).remove(),y=Oi.transition(g).style("opacity",1),b=f.selectAll(".tick.major").data(h,String),_=b.enter().insert("g","path").attr("class","tick major").style("opacity",1e-6),x=Oi.transition(b.exit()).style("opacity",1e-6).remove(),w=Oi.transition(b).style("opacity",1),M=Bt(n),A=f.selectAll(".domain").data([0]),N=(A.enter().append("path").attr("class","domain"),Oi.transition(A)),E=n.copy(),j=this.__chart__||E;this.__chart__=E,_.append("line"),_.append("text");var S=_.select("line"),k=w.select("line"),T=b.select("text").text(p),O=_.select("text"),D=w.select("text");switch(r){case"bottom":t=ze,m.attr("y2",o),y.attr("x2",0).attr("y2",o),S.attr("y2",i),O.attr("y",Math.max(i,0)+s),k.attr("x2",0).attr("y2",i),D.attr("x",0).attr("y",Math.max(i,0)+s),T.attr("dy",".71em").style("text-anchor","middle"),N.attr("d","M"+M[0]+","+a+"V0H"+M[1]+"V"+a);break;case"top":t=ze,m.attr("y2",-o),y.attr("x2",0).attr("y2",-o),S.attr("y2",-i),O.attr("y",-(Math.max(i,0)+s)),k.attr("x2",0).attr("y2",-i),D.attr("x",0).attr("y",-(Math.max(i,0)+s)),T.attr("dy","0em").style("text-anchor","middle"),N.attr("d","M"+M[0]+","+-a+"V0H"+M[1]+"V"+-a);break;case"left":t=We,m.attr("x2",-o),y.attr("x2",-o).attr("y2",0),S.attr("x2",-i),O.attr("x",-(Math.max(i,0)+s)),k.attr("x2",-i).attr("y2",0),D.attr("x",-(Math.max(i,0)+s)).attr("y",0),T.attr("dy",".32em").style("text-anchor","end"),N.attr("d","M"+-a+","+M[0]+"H0V"+M[1]+"H"+-a);break;case"right":t=We,m.attr("x2",o),y.attr("x2",o).attr("y2",0),S.attr("x2",i),O.attr("x",Math.max(i,0)+s),k.attr("x2",i).attr("y2",0),D.attr("x",Math.max(i,0)+s).attr("y",0),T.attr("dy",".32em").style("text-anchor","start"),N.attr("d","M"+a+","+M[0]+"H0V"+M[1]+"H"+a)}if(n.ticks)_.call(t,j),w.call(t,E),x.call(t,E),m.call(t,j),y.call(t,E),v.call(t,E);else{var C=E.rangeBand()/2,P=function(t){return E(t)+C};_.call(t,P),w.call(t,P)}})}var e,n=Oi.scale.linear(),r=$o,i=6,o=6,a=6,s=3,u=[10],c=null,l=0;return t.scale=function(e){return arguments.length?(n=e,t):n},t.orient=function(e){return arguments.length?(r=e in Zo?e+"":$o,t):r},t.ticks=function(){return arguments.length?(u=arguments,t):u},t.tickValues=function(e){return arguments.length?(c=e,t):c},t.tickFormat=function(n){return arguments.length?(e=n,t):e},t.tickSize=function(e,n){if(!arguments.length)return i;var r=arguments.length-1;return i=+e,o=r>1?+n:i,a=r>0?+arguments[r]:i,t},t.tickPadding=function(e){return arguments.length?(s=+e,t):s},t.tickSubdivide=function(e){return arguments.length?(l=+e,t):l},t};var $o="bottom",Zo={top:1,right:1,bottom:1,left:1};Oi.svg.brush=function(){function t(o){o.each(function(){var o,a=Oi.select(this),l=a.selectAll(".background").data([0]),f=a.selectAll(".extent").data([0]),h=a.selectAll(".resize").data(c,String);a.style("pointer-events","all").on("mousedown.brush",i).on("touchstart.brush",i),l.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),f.enter().append("rect").attr("class","extent").style("cursor","move"),h.enter().append("g").attr("class",function(t){return"resize "+t}).style("cursor",function(t){return Jo[t]}).append("rect").attr("x",function(t){return/[ew]$/.test(t)?-3:null}).attr("y",function(t){return/^[ns]/.test(t)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),h.style("display",t.empty()?"none":null),h.exit().remove(),s&&(o=Bt(s),l.attr("x",o[0]).attr("width",o[1]-o[0]),n(a)),u&&(o=Bt(u),l.attr("y",o[0]).attr("height",o[1]-o[0]),r(a)),e(a)})}function e(t){t.selectAll(".resize").attr("transform",function(t){return"translate("+l[+/e$/.test(t)][0]+","+l[+/^s/.test(t)][1]+")"})}function n(t){t.select(".extent").attr("x",l[0][0]),t.selectAll(".extent,.n>rect,.s>rect").attr("width",l[1][0]-l[0][0])}function r(t){t.select(".extent").attr("y",l[0][1]),t.selectAll(".extent,.e>rect,.w>rect").attr("height",l[1][1]-l[0][1])}function i(){function i(){var t=Oi.event.changedTouches;return t?Oi.touches(v,t)[0]:Oi.mouse(v)}function c(){32==Oi.event.keyCode&&(A||(g=null,N[0]-=l[1][0],N[1]-=l[1][1],A=2),q())}function f(){32==Oi.event.keyCode&&2==A&&(N[0]+=l[1][0],N[1]+=l[1][1],A=0,q())}function h(){var t=i(),o=!1;m&&(t[0]+=m[0],t[1]+=m[1]),A||(Oi.event.altKey?(g||(g=[(l[0][0]+l[1][0])/2,(l[0][1]+l[1][1])/2]),N[0]=l[+(t[0]<g[0])][0],N[1]=l[+(t[1]<g[1])][1]):g=null),w&&p(t,s,0)&&(n(_),o=!0),M&&p(t,u,1)&&(r(_),o=!0),o&&(e(_),b({type:"brush",mode:A?"move":"resize"}))}function p(t,e,n){var r,i,a=Bt(e),s=a[0],u=a[1],c=N[n],f=l[1][n]-l[0][n];return A&&(s-=c,u-=f+c),r=Math.max(s,Math.min(u,t[n])),A?i=(r+=c)+f:(g&&(c=Math.max(s,Math.min(u,2*g[n]-r))),r>c?(i=r,r=c):i=c),l[0][n]!==r||l[1][n]!==i?(o=null,l[0][n]=r,l[1][n]=i,!0):void 0}function d(){h(),_.style("pointer-events","all").selectAll(".resize").style("display",t.empty()?"none":null),Oi.select("body").style("cursor",null),E.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),b({type:"brushend"}),q()}var g,m,v=this,y=Oi.select(Oi.event.target),b=a.of(v,arguments),_=Oi.select(v),x=y.datum(),w=!/^(n|s)$/.test(x)&&s,M=!/^(e|w)$/.test(x)&&u,A=y.classed("extent"),N=i(),E=Oi.select(Ii).on("mousemove.brush",h).on("mouseup.brush",d).on("touchmove.brush",h).on("touchend.brush",d).on("keydown.brush",c).on("keyup.brush",f);if(A)N[0]=l[0][0]-N[0],N[1]=l[0][1]-N[1];else if(x){var j=+/w$/.test(x),S=+/^n/.test(x);m=[l[1-j][0]-N[0],l[1-S][1]-N[1]],N[0]=l[j][0],N[1]=l[S][1]}else Oi.event.altKey&&(g=N.slice());_.style("pointer-events","none").selectAll(".resize").style("display",null),Oi.select("body").style("cursor",y.style("cursor")),b({type:"brushstart"}),h(),q()}var o,a=B(t,"brushstart","brush","brushend"),s=null,u=null,c=Qo[0],l=[[0,0],[0,0]];return t.x=function(e){return arguments.length?(s=e,c=Qo[!s<<1|!u],t):s},t.y=function(e){return arguments.length?(u=e,c=Qo[!s<<1|!u],t):u},t.extent=function(e){var n,r,i,a,c;return arguments.length?(o=[[0,0],[0,0]],s&&(n=e[0],r=e[1],u&&(n=n[0],r=r[0]),o[0][0]=n,o[1][0]=r,s.invert&&(n=s(n),r=s(r)),n>r&&(c=n,n=r,r=c),l[0][0]=0|n,l[1][0]=0|r),u&&(i=e[0],a=e[1],s&&(i=i[1],a=a[1]),o[0][1]=i,o[1][1]=a,u.invert&&(i=u(i),a=u(a)),i>a&&(c=i,i=a,a=c),l[0][1]=0|i,l[1][1]=0|a),t):(e=o||l,s&&(n=e[0][0],r=e[1][0],o||(n=l[0][0],r=l[1][0],s.invert&&(n=s.invert(n),r=s.invert(r)),n>r&&(c=n,n=r,r=c))),u&&(i=e[0][1],a=e[1][1],o||(i=l[0][1],a=l[1][1],u.invert&&(i=u.invert(i),a=u.invert(a)),i>a&&(c=i,i=a,a=c))),s&&u?[[n,i],[r,a]]:s?[n,r]:u&&[i,a])},t.clear=function(){return o=null,l[0][0]=l[0][1]=l[1][0]=l[1][1]=0,t},t.empty=function(){return s&&l[0][0]===l[1][0]||u&&l[0][1]===l[1][1]},Oi.rebind(t,a,"on")};var Jo={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Qo=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]];Oi.behavior={},Oi.behavior.drag=function(){function t(){this.on("mousedown.drag",e).on("touchstart.drag",e)}function e(){function t(){var t=s.parentNode;return null!=l?Oi.touches(t).filter(function(t){return t.identifier===l})[0]:Oi.mouse(t)}function e(){if(!s.parentNode)return i();var e=t(),n=e[0]-f[0],r=e[1]-f[1];h|=n|r,f=e,q(),u({type:"drag",x:e[0]+a[0],y:e[1]+a[1],dx:n,dy:r})}function i(){u({type:"dragend"}),h&&(q(),Oi.event.target===c&&p.on("click.drag",o,!0)),p.on(null!=l?"touchmove.drag-"+l:"mousemove.drag",null).on(null!=l?"touchend.drag-"+l:"mouseup.drag",null)}function o(){q(),p.on("click.drag",null)}var a,s=this,u=n.of(s,arguments),c=Oi.event.target,l=Oi.event.touches?Oi.event.changedTouches[0].identifier:null,f=t(),h=0,p=Oi.select(Ii).on(null!=l?"touchmove.drag-"+l:"mousemove.drag",e).on(null!=l?"touchend.drag-"+l:"mouseup.drag",i,!0);r?(a=r.apply(s,arguments),a=[a.x-f[0],a.y-f[1]]):a=[0,0],null==l&&q(),u({type:"dragstart"})}var n=B(t,"drag","dragstart","dragend"),r=null;return t.origin=function(e){return arguments.length?(r=e,t):r},Oi.rebind(t,n,"on")},Oi.behavior.zoom=function(){function t(){this.on("mousedown.zoom",s).on("mousemove.zoom",c).on(ea+".zoom",u).on("dblclick.zoom",l).on("touchstart.zoom",f).on("touchmove.zoom",h).on("touchend.zoom",f)}function e(t){return[(t[0]-_[0])/x,(t[1]-_[1])/x]}function n(t){return[t[0]*x+_[0],t[1]*x+_[1]]}function r(t){x=Math.max(w[0],Math.min(w[1],t))}function i(t,e){e=n(e),_[0]+=t[0]-e[0],_[1]+=t[1]-e[1]}function o(){m&&m.domain(g.range().map(function(t){return(t-_[0])/x}).map(g.invert)),y&&y.domain(v.range().map(function(t){return(t-_[1])/x}).map(v.invert))}function a(t){o(),Oi.event.preventDefault(),t({type:"zoom",scale:x,translate:_})}function s(){function t(){c=1,i(Oi.mouse(o),f),a(s)}function n(){c&&q(),l.on("mousemove.zoom",null).on("mouseup.zoom",null),c&&Oi.event.target===u&&l.on("click.zoom",r,!0)}function r(){q(),l.on("click.zoom",null)}var o=this,s=M.of(o,arguments),u=Oi.event.target,c=0,l=Oi.select(Ii).on("mousemove.zoom",t).on("mouseup.zoom",n),f=e(Oi.mouse(o));Ii.focus(),q()}function u(){p||(p=e(Oi.mouse(this))),r(Math.pow(2,.002*Ko())*x),i(Oi.mouse(this),p),a(M.of(this,arguments))}function c(){p=null}function l(){var t=Oi.mouse(this),n=e(t),o=Math.log(x)/Math.LN2;r(Math.pow(2,Oi.event.shiftKey?Math.ceil(o)-1:Math.floor(o)+1)),i(t,n),a(M.of(this,arguments))}function f(){var t=Oi.touches(this),n=Date.now();if(d=x,p={},t.forEach(function(t){p[t.identifier]=e(t)}),q(),1===t.length){if(500>n-b){var o=t[0],s=e(t[0]);r(2*x),i(o,s),a(M.of(this,arguments))}b=n}}function h(){var t=Oi.touches(this),e=t[0],n=p[e.identifier];if(o=t[1]){var o,s=p[o.identifier];e=[(e[0]+o[0])/2,(e[1]+o[1])/2],n=[(n[0]+s[0])/2,(n[1]+s[1])/2],r(Oi.event.scale*d)}i(e,n),b=null,a(M.of(this,arguments))}var p,d,g,m,v,y,b,_=[0,0],x=1,w=ta,M=B(t,"zoom");return t.translate=function(e){return arguments.length?(_=e.map(Number),o(),t):_},t.scale=function(e){return arguments.length?(x=+e,o(),t):x},t.scaleExtent=function(e){return arguments.length?(w=null==e?ta:e.map(Number),t):w},t.x=function(e){return arguments.length?(m=e,g=e.copy(),_=[0,0],x=1,t):m},t.y=function(e){return arguments.length?(y=e,v=e.copy(),_=[0,0],x=1,t):y},Oi.rebind(t,M,"on")};var Ko,ta=[0,1/0],ea="onwheel"in document?(Ko=function(){return-Oi.event.deltaY*(Oi.event.deltaMode?120:1)},"wheel"):"onmousewheel"in document?(Ko=function(){return Oi.event.wheelDelta},"mousewheel"):(Ko=function(){return-Oi.event.detail},"MozMousePixelScroll");Oi.layout={},Oi.layout.bundle=function(){return function(t){for(var e=[],n=-1,r=t.length;++n<r;)e.push(Ue(t[n]));return e}},Oi.layout.chord=function(){function t(){var t,c,f,h,p,d={},g=[],m=Oi.range(o),v=[];for(n=[],r=[],t=0,h=-1;++h<o;){for(c=0,p=-1;++p<o;)c+=i[h][p];g.push(c),v.push(Oi.range(o)),t+=c}for(a&&m.sort(function(t,e){return a(g[t],g[e])}),s&&v.forEach(function(t,e){t.sort(function(t,n){return s(i[e][t],i[e][n])})}),t=(2*ki-l*o)/t,c=0,h=-1;++h<o;){for(f=c,p=-1;++p<o;){var y=m[h],b=v[y][p],_=i[y][b],x=c,w=c+=_*t;d[y+"-"+b]={index:y,subindex:b,startAngle:x,endAngle:w,value:_}}r[y]={index:y,startAngle:f,endAngle:c,value:(c-f)/t},c+=l}for(h=-1;++h<o;)for(p=h-1;++p<o;){var M=d[h+"-"+p],A=d[p+"-"+h];(M.value||A.value)&&n.push(M.value<A.value?{source:A,target:M}:{source:M,target:A})}u&&e()}function e(){n.sort(function(t,e){return u((t.source.value+t.target.value)/2,(e.source.value+e.target.value)/2)})}var n,r,i,o,a,s,u,c={},l=0;return c.matrix=function(t){return arguments.length?(o=(i=t)&&i.length,n=r=null,c):i},c.padding=function(t){return arguments.length?(l=t,n=r=null,c):l},c.sortGroups=function(t){return arguments.length?(a=t,n=r=null,c):a},c.sortSubgroups=function(t){return arguments.length?(s=t,n=null,c):s},c.sortChords=function(t){return arguments.length?(u=t,n&&e(),c):u},c.chords=function(){return n||t(),n},c.groups=function(){return r||t(),r},c},Oi.layout.force=function(){function t(t){return function(e,n,r,i){if(e.point!==t){var o=e.cx-t.x,a=e.cy-t.y,s=1/Math.sqrt(o*o+a*a);
  
  if(m>(i-n)*s){var u=e.charge*s*s;return t.px-=o*u,t.py-=a*u,!0}if(e.point&&isFinite(s)){var u=e.pointCharge*s*s;t.px-=o*u,t.py-=a*u}}return!e.charge}}function e(t){t.px=Oi.event.x,t.py=Oi.event.y,u.resume()}var n,r,i,o,s,u={},c=Oi.dispatch("start","tick","end"),l=[1,1],f=.9,h=na,p=ra,d=-30,g=.1,m=.8,v=[],y=[];return u.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var e,n,a,u,h,p,m,b,_,x=v.length,w=y.length;for(n=0;w>n;++n)a=y[n],u=a.source,h=a.target,b=h.x-u.x,_=h.y-u.y,(p=b*b+_*_)&&(p=r*o[n]*((p=Math.sqrt(p))-i[n])/p,b*=p,_*=p,h.x-=b*(m=u.weight/(h.weight+u.weight)),h.y-=_*m,u.x+=b*(m=1-m),u.y+=_*m);if((m=r*g)&&(b=l[0]/2,_=l[1]/2,n=-1,m))for(;++n<x;)a=v[n],a.x+=(b-a.x)*m,a.y+=(_-a.y)*m;if(d)for(Ze(e=Oi.geom.quadtree(v),r,s),n=-1;++n<x;)(a=v[n]).fixed||e.visit(t(a));for(n=-1;++n<x;)a=v[n],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*f,a.y-=(a.py-(a.py=a.y))*f);c.tick({type:"tick",alpha:r})},u.nodes=function(t){return arguments.length?(v=t,u):v},u.links=function(t){return arguments.length?(y=t,u):y},u.size=function(t){return arguments.length?(l=t,u):l},u.linkDistance=function(t){return arguments.length?(h="function"==typeof t?t:+t,u):h},u.distance=u.linkDistance,u.linkStrength=function(t){return arguments.length?(p="function"==typeof t?t:+t,u):p},u.friction=function(t){return arguments.length?(f=+t,u):f},u.charge=function(t){return arguments.length?(d="function"==typeof t?t:+t,u):d},u.gravity=function(t){return arguments.length?(g=+t,u):g},u.theta=function(t){return arguments.length?(m=+t,u):m},u.alpha=function(t){return arguments.length?(t=+t,r?r=t>0?t:0:t>0&&(c.start({type:"start",alpha:r=t}),Oi.timer(u.tick)),u):r},u.start=function(){function t(t,r){for(var i,o=e(n),a=-1,s=o.length;++a<s;)if(!isNaN(i=o[a][t]))return i;return Math.random()*r}function e(){if(!a){for(a=[],r=0;f>r;++r)a[r]=[];for(r=0;g>r;++r){var t=y[r];a[t.source.index].push(t.target),a[t.target.index].push(t.source)}}return a[n]}var n,r,a,c,f=v.length,g=y.length,m=l[0],b=l[1];for(n=0;f>n;++n)(c=v[n]).index=n,c.weight=0;for(n=0;g>n;++n)c=y[n],"number"==typeof c.source&&(c.source=v[c.source]),"number"==typeof c.target&&(c.target=v[c.target]),++c.source.weight,++c.target.weight;for(n=0;f>n;++n)c=v[n],isNaN(c.x)&&(c.x=t("x",m)),isNaN(c.y)&&(c.y=t("y",b)),isNaN(c.px)&&(c.px=c.x),isNaN(c.py)&&(c.py=c.y);if(i=[],"function"==typeof h)for(n=0;g>n;++n)i[n]=+h.call(this,y[n],n);else for(n=0;g>n;++n)i[n]=h;if(o=[],"function"==typeof p)for(n=0;g>n;++n)o[n]=+p.call(this,y[n],n);else for(n=0;g>n;++n)o[n]=p;if(s=[],"function"==typeof d)for(n=0;f>n;++n)s[n]=+d.call(this,v[n],n);else for(n=0;f>n;++n)s[n]=d;return u.resume()},u.resume=function(){return u.alpha(.1)},u.stop=function(){return u.alpha(0)},u.drag=function(){return n||(n=Oi.behavior.drag().origin(a).on("dragstart.force",Ve).on("drag.force",e).on("dragend.force",Ge)),arguments.length?void this.on("mouseover.force",Xe).on("mouseout.force",$e).call(n):n},Oi.rebind(u,c,"on")};var na=20,ra=1;Oi.layout.partition=function(){function t(e,n,r,i){var o=e.children;if(e.x=n,e.y=e.depth*i,e.dx=r,e.dy=i,o&&(a=o.length)){var a,s,u,c=-1;for(r=e.value?r/e.value:0;++c<a;)t(s=o[c],n,u=s.value*r,i),n+=u}}function e(t){var n=t.children,r=0;if(n&&(i=n.length))for(var i,o=-1;++o<i;)r=Math.max(r,e(n[o]));return 1+r}function n(n,o){var a=r.call(this,n,o);return t(a[0],0,i[0],i[1]/e(a[0])),a}var r=Oi.layout.hierarchy(),i=[1,1];return n.size=function(t){return arguments.length?(i=t,n):i},cn(n,r)},Oi.layout.pie=function(){function t(o){var a=o.map(function(n,r){return+e.call(t,n,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),u=(("function"==typeof i?i.apply(this,arguments):i)-r)/Oi.sum(a),c=Oi.range(o.length);null!=n&&c.sort(n===ia?function(t,e){return a[e]-a[t]}:function(t,e){return n(o[t],o[e])});var l=[];return c.forEach(function(t){var e;l[t]={data:o[t],value:e=a[t],startAngle:s,endAngle:s+=e*u}}),l}var e=Number,n=ia,r=0,i=2*ki;return t.value=function(n){return arguments.length?(e=n,t):e},t.sort=function(e){return arguments.length?(n=e,t):n},t.startAngle=function(e){return arguments.length?(r=e,t):r},t.endAngle=function(e){return arguments.length?(i=e,t):i},t};var ia={};Oi.layout.stack=function(){function t(a,u){var c=a.map(function(n,r){return e.call(t,n,r)}),l=c.map(function(e){return e.map(function(e,n){return[o.call(t,e,n),s.call(t,e,n)]})}),f=n.call(t,l,u);c=Oi.permute(c,f),l=Oi.permute(l,f);var h,p,d,g=r.call(t,l,u),m=c.length,v=c[0].length;for(p=0;v>p;++p)for(i.call(t,c[0][p],d=g[p],l[0][p][1]),h=1;m>h;++h)i.call(t,c[h][p],d+=l[h-1][p][1],l[h][p][1]);return a}var e=a,n=tn,r=en,i=Ke,o=Je,s=Qe;return t.values=function(n){return arguments.length?(e=n,t):e},t.order=function(e){return arguments.length?(n="function"==typeof e?e:oa.get(e)||tn,t):n},t.offset=function(e){return arguments.length?(r="function"==typeof e?e:aa.get(e)||en,t):r},t.x=function(e){return arguments.length?(o=e,t):o},t.y=function(e){return arguments.length?(s=e,t):s},t.out=function(e){return arguments.length?(i=e,t):i},t};var oa=Oi.map({"inside-out":function(t){var e,n,r=t.length,i=t.map(nn),o=t.map(rn),a=Oi.range(r).sort(function(t,e){return i[t]-i[e]}),s=0,u=0,c=[],l=[];for(e=0;r>e;++e)n=a[e],u>s?(s+=o[n],c.push(n)):(u+=o[n],l.push(n));return l.reverse().concat(c)},reverse:function(t){return Oi.range(t.length).reverse()},"default":tn}),aa=Oi.map({silhouette:function(t){var e,n,r,i=t.length,o=t[0].length,a=[],s=0,u=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];r>s&&(s=r),a.push(r)}for(n=0;o>n;++n)u[n]=(s-a[n])/2;return u},wiggle:function(t){var e,n,r,i,o,a,s,u,c,l=t.length,f=t[0],h=f.length,p=[];for(p[0]=u=c=0,n=1;h>n;++n){for(e=0,i=0;l>e;++e)i+=t[e][n][1];for(e=0,o=0,s=f[n][0]-f[n-1][0];l>e;++e){for(r=0,a=(t[e][n][1]-t[e][n-1][1])/(2*s);e>r;++r)a+=(t[r][n][1]-t[r][n-1][1])/s;o+=a*t[e][n][1]}p[n]=u-=i?o/i*s:0,c>u&&(c=u)}for(n=0;h>n;++n)p[n]-=c;return p},expand:function(t){var e,n,r,i=t.length,o=t[0].length,a=1/i,s=[];for(n=0;o>n;++n){for(e=0,r=0;i>e;e++)r+=t[e][n][1];if(r)for(e=0;i>e;e++)t[e][n][1]/=r;else for(e=0;i>e;e++)t[e][n][1]=a}for(n=0;o>n;++n)s[n]=0;return s},zero:en});Oi.layout.histogram=function(){function t(t,o){for(var a,s,u=[],c=t.map(n,this),l=r.call(this,c,o),f=i.call(this,l,c,o),o=-1,h=c.length,p=f.length-1,d=e?1:1/h;++o<p;)a=u[o]=[],a.dx=f[o+1]-(a.x=f[o]),a.y=0;if(p>0)for(o=-1;++o<h;)s=c[o],s>=l[0]&&s<=l[1]&&(a=u[Oi.bisect(f,s,1,p)-1],a.y+=d,a.push(t[o]));return u}var e=!0,n=Number,r=un,i=an;return t.value=function(e){return arguments.length?(n=e,t):n},t.range=function(e){return arguments.length?(r=u(e),t):r},t.bins=function(e){return arguments.length?(i="number"==typeof e?function(t){return sn(t,e)}:u(e),t):i},t.frequency=function(n){return arguments.length?(e=!!n,t):e},t},Oi.layout.hierarchy=function(){function t(e,a,s){var u=i.call(n,e,a);if(e.depth=a,s.push(e),u&&(c=u.length)){for(var c,l,f=-1,h=e.children=[],p=0,d=a+1;++f<c;)l=t(u[f],d,s),l.parent=e,h.push(l),p+=l.value;r&&h.sort(r),o&&(e.value=p)}else o&&(e.value=+o.call(n,e,a)||0);return e}function e(t,r){var i=t.children,a=0;if(i&&(s=i.length))for(var s,u=-1,c=r+1;++u<s;)a+=e(i[u],c);else o&&(a=+o.call(n,t,r)||0);return o&&(t.value=a),a}function n(e){var n=[];return t(e,0,n),n}var r=hn,i=ln,o=fn;return n.sort=function(t){return arguments.length?(r=t,n):r},n.children=function(t){return arguments.length?(i=t,n):i},n.value=function(t){return arguments.length?(o=t,n):o},n.revalue=function(t){return e(t,0),t},n},Oi.layout.pack=function(){function t(t,i){var o=e.call(this,t,i),a=o[0];a.x=0,a.y=0,Pn(a,function(t){t.r=Math.sqrt(t.value)}),Pn(a,yn);var s=r[0],u=r[1],c=Math.max(2*a.r/s,2*a.r/u);if(n>0){var l=n*c/2;Pn(a,function(t){t.r+=l}),Pn(a,yn),Pn(a,function(t){t.r-=l}),c=Math.max(2*a.r/s,2*a.r/u)}return xn(a,s/2,u/2,1/c),o}var e=Oi.layout.hierarchy().sort(dn),n=0,r=[1,1];return t.size=function(e){return arguments.length?(r=e,t):r},t.padding=function(e){return arguments.length?(n=+e,t):n},cn(t,e)},Oi.layout.cluster=function(){function t(t,i){var o,a=e.call(this,t,i),s=a[0],u=0;Pn(s,function(t){var e=t.children;e&&e.length?(t.x=An(e),t.y=Mn(e)):(t.x=o?u+=n(t,o):0,t.y=0,o=t)});var c=Nn(s),l=En(s),f=c.x-n(c,l)/2,h=l.x+n(l,c)/2;return Pn(s,function(t){t.x=(t.x-f)/(h-f)*r[0],t.y=(1-(s.y?t.y/s.y:1))*r[1]}),a}var e=Oi.layout.hierarchy().sort(null).value(null),n=jn,r=[1,1];return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(r=e,t):r},cn(t,e)},Oi.layout.tree=function(){function t(t,i){function o(t,e){var r=t.children,i=t._tree;if(r&&(a=r.length)){for(var a,u,c,l=r[0],f=l,h=-1;++h<a;)c=r[h],o(c,u),f=s(c,u,f),u=c;In(t);var p=.5*(l._tree.prelim+c._tree.prelim);e?(i.prelim=e._tree.prelim+n(t,e),i.mod=i.prelim-p):i.prelim=p}else e&&(i.prelim=e._tree.prelim+n(t,e))}function a(t,e){t.x=t._tree.prelim+e;var n=t.children;if(n&&(r=n.length)){var r,i=-1;for(e+=t._tree.mod;++i<r;)a(n[i],e)}}function s(t,e,r){if(e){for(var i,o=t,a=t,s=e,u=t.parent.children[0],c=o._tree.mod,l=a._tree.mod,f=s._tree.mod,h=u._tree.mod;s=kn(s),o=Sn(o),s&&o;)u=Sn(u),a=kn(a),a._tree.ancestor=t,i=s._tree.prelim+f-o._tree.prelim-c+n(s,o),i>0&&(Rn(qn(s,t,r),t,i),c+=i,l+=i),f+=s._tree.mod,c+=o._tree.mod,h+=u._tree.mod,l+=a._tree.mod;s&&!kn(a)&&(a._tree.thread=s,a._tree.mod+=f-l),o&&!Sn(u)&&(u._tree.thread=o,u._tree.mod+=c-h,r=t)}return r}var u=e.call(this,t,i),c=u[0];Pn(c,function(t,e){t._tree={ancestor:t,prelim:0,mod:0,change:0,shift:0,number:e?e._tree.number+1:0}}),o(c),a(c,-c._tree.prelim);var l=Tn(c,Dn),f=Tn(c,On),h=Tn(c,Cn),p=l.x-n(l,f)/2,d=f.x+n(f,l)/2,g=h.depth||1;return Pn(c,function(t){t.x=(t.x-p)/(d-p)*r[0],t.y=t.depth/g*r[1],delete t._tree}),u}var e=Oi.layout.hierarchy().sort(null).value(null),n=jn,r=[1,1];return t.separation=function(e){return arguments.length?(n=e,t):n},t.size=function(e){return arguments.length?(r=e,t):r},cn(t,e)},Oi.layout.treemap=function(){function t(t,e){for(var n,r,i=-1,o=t.length;++i<o;)r=(n=t[i]).value*(0>e?0:e),n.area=isNaN(r)||0>=r?0:r}function e(n){var o=n.children;if(o&&o.length){var a,s,u,c=f(n),l=[],h=o.slice(),d=1/0,g="slice"===p?c.dx:"dice"===p?c.dy:"slice-dice"===p?1&n.depth?c.dy:c.dx:Math.min(c.dx,c.dy);for(t(h,c.dx*c.dy/n.value),l.area=0;(u=h.length)>0;)l.push(a=h[u-1]),l.area+=a.area,"squarify"!==p||(s=r(l,g))<=d?(h.pop(),d=s):(l.area-=l.pop().area,i(l,g,c,!1),g=Math.min(c.dx,c.dy),l.length=l.area=0,d=1/0);l.length&&(i(l,g,c,!0),l.length=l.area=0),o.forEach(e)}}function n(e){var r=e.children;if(r&&r.length){var o,a=f(e),s=r.slice(),u=[];for(t(s,a.dx*a.dy/e.value),u.area=0;o=s.pop();)u.push(o),u.area+=o.area,null!=o.z&&(i(u,o.z?a.dx:a.dy,a,!s.length),u.length=u.area=0);r.forEach(n)}}function r(t,e){for(var n,r=t.area,i=0,o=1/0,a=-1,s=t.length;++a<s;)(n=t[a].area)&&(o>n&&(o=n),n>i&&(i=n));return r*=r,e*=e,r?Math.max(e*i*d/r,r/(e*o*d)):1/0}function i(t,e,n,r){var i,o=-1,a=t.length,s=n.x,c=n.y,l=e?u(t.area/e):0;if(e==n.dx){for((r||l>n.dy)&&(l=n.dy);++o<a;)i=t[o],i.x=s,i.y=c,i.dy=l,s+=i.dx=Math.min(n.x+n.dx-s,l?u(i.area/l):0);i.z=!0,i.dx+=n.x+n.dx-s,n.y+=l,n.dy-=l}else{for((r||l>n.dx)&&(l=n.dx);++o<a;)i=t[o],i.x=s,i.y=c,i.dx=l,c+=i.dy=Math.min(n.y+n.dy-c,l?u(i.area/l):0);i.z=!1,i.dy+=n.y+n.dy-c,n.x+=l,n.dx-=l}}function o(r){var i=a||s(r),o=i[0];return o.x=0,o.y=0,o.dx=c[0],o.dy=c[1],a&&s.revalue(o),t([o],o.dx*o.dy/o.value),(a?n:e)(o),h&&(a=i),i}var a,s=Oi.layout.hierarchy(),u=Math.round,c=[1,1],l=null,f=Ln,h=!1,p="squarify",d=.5*(1+Math.sqrt(5));return o.size=function(t){return arguments.length?(c=t,o):c},o.padding=function(t){function e(e){var n=t.call(o,e,e.depth);return null==n?Ln(e):Bn(e,"number"==typeof n?[n,n,n,n]:n)}function n(e){return Bn(e,t)}if(!arguments.length)return l;var r;return f=null==(l=t)?Ln:"function"==(r=typeof t)?e:"number"===r?(t=[t,t,t,t],n):n,o},o.round=function(t){return arguments.length?(u=t?Math.round:Number,o):u!=Number},o.sticky=function(t){return arguments.length?(h=t,a=null,o):h},o.ratio=function(t){return arguments.length?(d=t,o):d},o.mode=function(t){return arguments.length?(p=t+"",o):p},cn(o,s)},Oi.csv=zn(",","text/csv"),Oi.tsv=zn("	","text/tab-separated-values"),Oi.geo={},Oi.geo.stream=function(t,e){sa.hasOwnProperty(t.type)?sa[t.type](t,e):Wn(t,e)};var sa={Feature:function(t,e){Wn(t.geometry,e)},FeatureCollection:function(t,e){for(var n=t.features,r=-1,i=n.length;++r<i;)Wn(n[r].geometry,e)}},ua={Sphere:function(t,e){e.sphere()},Point:function(t,e){var n=t.coordinates;e.point(n[0],n[1])},MultiPoint:function(t,e){for(var n,r=t.coordinates,i=-1,o=r.length;++i<o;)n=r[i],e.point(n[0],n[1])},LineString:function(t,e){Fn(t.coordinates,e,0)},MultiLineString:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Fn(n[r],e,0)},Polygon:function(t,e){Un(t.coordinates,e)},MultiPolygon:function(t,e){for(var n=t.coordinates,r=-1,i=n.length;++r<i;)Un(n[r],e)},GeometryCollection:function(t,e){for(var n=t.geometries,r=-1,i=n.length;++r<i;)Wn(n[r],e)}};Oi.geo.albersUsa=function(){function t(t){return e(t)(t)}function e(t){var e=t[0],a=t[1];return a>50?r:-140>e?i:21>a?o:n}var n=Oi.geo.albers(),r=Oi.geo.albers().rotate([160,0]).center([0,60]).parallels([55,65]),i=Oi.geo.albers().rotate([160,0]).center([0,20]).parallels([8,18]),o=Oi.geo.albers().rotate([60,0]).center([0,10]).parallels([8,18]);return t.scale=function(e){return arguments.length?(n.scale(e),r.scale(.6*e),i.scale(e),o.scale(1.5*e),t.translate(n.translate())):n.scale()},t.translate=function(e){if(!arguments.length)return n.translate();var a=n.scale(),s=e[0],u=e[1];return n.translate(e),r.translate([s-.4*a,u+.17*a]),i.translate([s-.19*a,u+.2*a]),o.translate([s+.58*a,u+.43*a]),t},t.scale(n.scale())},(Oi.geo.albers=function(){var t=29.5*Di,e=45.5*Di,n=Rr(Kn),r=n(t,e);return r.parallels=function(r){return arguments.length?n(t=r[0]*Di,e=r[1]*Di):[t*Ci,e*Ci]},r.rotate([98,0]).center([0,38]).scale(1e3)}).raw=Kn;var ca=Fr(function(t){return Math.sqrt(2/(1+t))},function(t){return 2*Math.asin(t/2)});(Oi.geo.azimuthalEqualArea=function(){return Ir(ca)}).raw=ca;var la=Fr(function(t){var e=Math.acos(t);return e&&e/Math.sin(e)},a);(Oi.geo.azimuthalEquidistant=function(){return Ir(la)}).raw=la,Oi.geo.bounds=tr(a),Oi.geo.centroid=function(t){fa=ha=pa=da=ga=0,Oi.geo.stream(t,ma);var e;return ha&&Math.abs(e=Math.sqrt(pa*pa+da*da+ga*ga))>Ti?[Math.atan2(da,pa)*Ci,Math.asin(Math.max(-1,Math.min(1,ga/e)))*Ci]:void 0};var fa,ha,pa,da,ga,ma={sphere:function(){2>fa&&(fa=2,ha=pa=da=ga=0)},point:er,lineStart:rr,lineEnd:ir,polygonStart:function(){2>fa&&(fa=2,ha=pa=da=ga=0),ma.lineStart=nr},polygonEnd:function(){ma.lineStart=rr}};Oi.geo.circle=function(){function t(){var t="function"==typeof r?r.apply(this,arguments):r,e=Lr(-t[0]*Di,-t[1]*Di,0).invert,i=[];return n(null,null,1,{point:function(t,n){i.push(t=e(t,n)),t[0]*=Ci,t[1]*=Ci}}),{type:"Polygon",coordinates:[i]}}var e,n,r=[0,0],i=6;return t.origin=function(e){return arguments.length?(r=e,t):r},t.angle=function(r){return arguments.length?(n=or((e=+r)*Di,i*Di),t):e},t.precision=function(r){return arguments.length?(n=or(e*Di,(i=+r)*Di),t):i},t.angle(90)};var va=sr(s,dr,mr);(Oi.geo.equirectangular=function(){return Ir(br).scale(250/ki)}).raw=br.invert=br;var ya=Fr(function(t){return 1/t},Math.atan);(Oi.geo.gnomonic=function(){return Ir(ya)}).raw=ya,Oi.geo.graticule=function(){function t(){return{type:"MultiLineString",coordinates:e()}}function e(){return Oi.range(Math.ceil(r/u)*u,n,u).map(a).concat(Oi.range(Math.ceil(o/c)*c,i,c).map(s))}var n,r,i,o,a,s,u=22.5,c=u,l=2.5;return t.lines=function(){return e().map(function(t){return{type:"LineString",coordinates:t}})},t.outline=function(){return{type:"Polygon",coordinates:[a(r).concat(s(i).slice(1),a(n).reverse().slice(1),s(o).reverse().slice(1))]}},t.extent=function(e){return arguments.length?(r=+e[0][0],n=+e[1][0],o=+e[0][1],i=+e[1][1],r>n&&(e=r,r=n,n=e),o>i&&(e=o,o=i,i=e),t.precision(l)):[[r,o],[n,i]]},t.step=function(e){return arguments.length?(u=+e[0],c=+e[1],t):[u,c]},t.precision=function(e){return arguments.length?(l=+e,a=_r(o,i,l),s=xr(r,n,l),t):l},t.extent([[-180+Ti,-90+Ti],[180-Ti,90-Ti]])},Oi.geo.interpolate=function(t,e){return Mr(t[0]*Di,t[1]*Di,e[0]*Di,e[1]*Di)},Oi.geo.greatArc=function(){function n(){for(var t=r||a.apply(this,arguments),e=i||s.apply(this,arguments),n=o||Oi.geo.interpolate(t,e),c=0,l=u/n.distance,f=[t];(c+=l)<1;)f.push(n(c));return f.push(e),{type:"LineString",coordinates:f}}var r,i,o,a=e,s=t,u=6*Di;return n.distance=function(){return(o||Oi.geo.interpolate(r||a.apply(this,arguments),i||s.apply(this,arguments))).distance},n.source=function(t){return arguments.length?(a=t,r="function"==typeof t?null:t,o=r&&i?Oi.geo.interpolate(r,i):null,n):a},n.target=function(t){return arguments.length?(s=t,i="function"==typeof t?null:t,o=r&&i?Oi.geo.interpolate(r,i):null,n):s},n.precision=function(t){return arguments.length?(u=t*Di,n):u/Di},n},Ar.invert=function(t,e){return[2*ki*t,2*Math.atan(Math.exp(2*ki*e))-ki/2]},(Oi.geo.mercator=function(){return Ir(Ar).scale(500)}).raw=Ar;var ba=Fr(function(){return 1},Math.asin);(Oi.geo.orthographic=function(){return Ir(ba)}).raw=ba,Oi.geo.path=function(){function t(t){return t&&Oi.geo.stream(t,r(i.pointRadius("function"==typeof o?+o.apply(this,arguments):o))),i.result()}var e,n,r,i,o=4.5;return t.area=function(t){return _a=0,Oi.geo.stream(t,r(wa)),_a},t.centroid=function(t){return fa=pa=da=ga=0,Oi.geo.stream(t,r(Ma)),ga?[pa/ga,da/ga]:void 0},t.bounds=function(t){return tr(r)(t)},t.projection=function(n){return arguments.length?(r=(e=n)?n.stream||Er(n):a,t):e},t.context=function(e){return arguments.length?(i=null==(n=e)?new jr:new Sr(e),t):n},t.pointRadius=function(e){return arguments.length?(o="function"==typeof e?e:+e,t):o},t.projection(Oi.geo.albersUsa()).context(null)};var _a,xa,wa={point:qt,lineStart:qt,lineEnd:qt,polygonStart:function(){xa=0,wa.lineStart=kr},polygonEnd:function(){wa.lineStart=wa.lineEnd=wa.point=qt,_a+=Math.abs(xa/2)}},Ma={point:Tr,lineStart:Or,lineEnd:Dr,polygonStart:function(){Ma.lineStart=Cr},polygonEnd:function(){Ma.point=Tr,Ma.lineStart=Or,Ma.lineEnd=Dr}};Oi.geo.area=function(t){return Aa=0,Oi.geo.stream(t,ja),Aa};var Aa,Na,Ea,ja={sphere:function(){Aa+=4*ki},point:qt,lineStart:qt,lineEnd:qt,polygonStart:function(){Na=1,Ea=0,ja.lineStart=Pr},polygonEnd:function(){var t=2*Math.atan2(Ea,Na);Aa+=0>t?4*ki+t:t,ja.lineStart=ja.lineEnd=ja.point=qt}};Oi.geo.projection=Ir,Oi.geo.projectionMutator=Rr;var Sa=Fr(function(t){return 1/(1+t)},function(t){return 2*Math.atan(t)});(Oi.geo.stereographic=function(){return Ir(Sa)}).raw=Sa,Oi.geom={},Oi.geom.hull=function(t){if(t.length<3)return[];var e,n,r,i,o,a,s,u,c,l,f=t.length,h=f-1,p=[],d=[],g=0;for(e=1;f>e;++e)t[e][1]<t[g][1]?g=e:t[e][1]==t[g][1]&&(g=t[e][0]<t[g][0]?e:g);for(e=0;f>e;++e)e!==g&&(i=t[e][1]-t[g][1],r=t[e][0]-t[g][0],p.push({angle:Math.atan2(i,r),index:e}));for(p.sort(function(t,e){return t.angle-e.angle}),c=p[0].angle,u=p[0].index,s=0,e=1;h>e;++e)n=p[e].index,c==p[e].angle?(r=t[u][0]-t[g][0],i=t[u][1]-t[g][1],o=t[n][0]-t[g][0],a=t[n][1]-t[g][1],r*r+i*i>=o*o+a*a?p[e].index=-1:(p[s].index=-1,c=p[e].angle,s=e,u=n)):(c=p[e].angle,s=e,u=n);for(d.push(g),e=0,n=0;2>e;++n)-1!==p[n].index&&(d.push(p[n].index),e++);for(l=d.length;h>n;++n)if(-1!==p[n].index){for(;!Ur(d[l-2],d[l-1],p[n].index,t);)--l;d[l++]=p[n].index}var m=[];for(e=0;l>e;++e)m.push(t[d[e]]);return m},Oi.geom.polygon=function(t){return t.area=function(){for(var e=0,n=t.length,r=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];++e<n;)r+=t[e-1][1]*t[e][0]-t[e-1][0]*t[e][1];return.5*r},t.centroid=function(e){var n,r,i=-1,o=t.length,a=0,s=0,u=t[o-1];for(arguments.length||(e=-1/(6*t.area()));++i<o;)n=u,u=t[i],r=n[0]*u[1]-u[0]*n[1],a+=(n[0]+u[0])*r,s+=(n[1]+u[1])*r;return[a*e,s*e]},t.clip=function(e){for(var n,r,i,o,a,s,u=-1,c=t.length,l=t[c-1];++u<c;){for(n=e.slice(),e.length=0,o=t[u],a=n[(i=n.length)-1],r=-1;++r<i;)s=n[r],Hr(s,l,o)?(Hr(a,l,o)||e.push(Yr(a,s,l,o)),e.push(s)):Hr(a,l,o)&&e.push(Yr(a,s,l,o)),a=s;l=o}return e},t},Oi.geom.voronoi=function(t){var e=t.map(function(){return[]}),n=1e6;return Vr(t,function(t){var r,i,o,a,s,u;1===t.a&&t.b>=0?(r=t.ep.r,i=t.ep.l):(r=t.ep.l,i=t.ep.r),1===t.a?(s=r?r.y:-n,o=t.c-t.b*s,u=i?i.y:n,a=t.c-t.b*u):(o=r?r.x:-n,s=t.c-t.a*o,a=i?i.x:n,u=t.c-t.a*a);var c=[o,s],l=[a,u];e[t.region.l.index].push(c,l),e[t.region.r.index].push(c,l)}),e=e.map(function(e,n){var r=t[n][0],i=t[n][1],o=e.map(function(t){return Math.atan2(t[0]-r,t[1]-i)}),a=Oi.range(e.length).sort(function(t,e){return o[t]-o[e]});return a.filter(function(t,e){return!e||o[t]-o[a[e-1]]>Ti}).map(function(t){return e[t]})}),e.forEach(function(e,r){var i=e.length;if(!i)return e.push([-n,-n],[-n,n],[n,n],[n,-n]);if(!(i>2)){var o=t[r],a=e[0],s=e[1],u=o[0],c=o[1],l=a[0],f=a[1],h=s[0],p=s[1],d=Math.abs(h-l),g=p-f;if(Math.abs(g)<Ti){var m=f>c?-n:n;e.push([-n,m],[n,m])}else if(Ti>d){var v=l>u?-n:n;e.push([v,-n],[v,n])}else{var m=(l-u)*(p-f)>(h-l)*(f-c)?n:-n,y=Math.abs(g)-d;Math.abs(y)<Ti?e.push([0>g?m:-m,m]):(y>0&&(m*=-1),e.push([-n,m],[n,m]))}}}),e};var ka={l:"r",r:"l"};Oi.geom.delaunay=function(t){var e=t.map(function(){return[]}),n=[];return Vr(t,function(n){e[n.region.l.index].push(t[n.region.r.index])}),e.forEach(function(e,r){var i=t[r],o=i[0],a=i[1];e.forEach(function(t){t.angle=Math.atan2(t[0]-o,t[1]-a)}),e.sort(function(t,e){return t.angle-e.angle});for(var s=0,u=e.length-1;u>s;s++)n.push([i,e[s],e[s+1]])}),n},Oi.geom.quadtree=function(t,e,n,r,i){function o(t,e,n,r,i,o){if(!isNaN(e.x)&&!isNaN(e.y))if(t.leaf){var s=t.point;s?Math.abs(s.x-e.x)+Math.abs(s.y-e.y)<.01?a(t,e,n,r,i,o):(t.point=null,a(t,s,n,r,i,o),a(t,e,n,r,i,o)):t.point=e}else a(t,e,n,r,i,o)}function a(t,e,n,r,i,a){var s=.5*(n+i),u=.5*(r+a),c=e.x>=s,l=e.y>=u,f=(l<<1)+c;t.leaf=!1,t=t.nodes[f]||(t.nodes[f]=Gr()),c?n=s:i=s,l?r=u:a=u,o(t,e,n,r,i,a)}var s,u=-1,c=t.length;if(arguments.length<5)if(3===arguments.length)i=n,r=e,n=e=0;else for(e=n=1/0,r=i=-(1/0);++u<c;)s=t[u],s.x<e&&(e=s.x),s.y<n&&(n=s.y),s.x>r&&(r=s.x),s.y>i&&(i=s.y);var l=r-e,f=i-n;l>f?i=n+l:r=e+f;var h=Gr();return h.add=function(t){o(h,t,e,n,r,i)},h.visit=function(t){Xr(t,h,e,n,r,i)},t.forEach(h.add),h},Oi.time={};var Ta=Date,Oa=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];$r.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){Da.setUTCDate.apply(this._,arguments)},setDay:function(){Da.setUTCDay.apply(this._,arguments)},setFullYear:function(){Da.setUTCFullYear.apply(this._,arguments)},setHours:function(){Da.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){Da.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){Da.setUTCMinutes.apply(this._,arguments)},setMonth:function(){Da.setUTCMonth.apply(this._,arguments)},setSeconds:function(){Da.setUTCSeconds.apply(this._,arguments)},setTime:function(){Da.setTime.apply(this._,arguments)}};var Da=Date.prototype,Ca="%a %b %e %X %Y",Pa="%m/%d/%Y",Ia="%H:%M:%S",Ra=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],qa=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],La=["January","February","March","April","May","June","July","August","September","October","November","December"],Ba=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];Oi.time.format=function(t){function e(e){for(var r,i,o,a=[],s=-1,u=0;++s<n;)37===t.charCodeAt(s)&&(a.push(t.substring(u,s)),null!=(i=Va[r=t.charAt(++s)])&&(r=t.charAt(++s)),(o=Ga[r])&&(r=o(e,null==i?"e"===r?" ":"0":i)),a.push(r),u=s+1);return a.push(t.substring(u,s)),a.join("")}var n=t.length;return e.parse=function(e){var n={y:1900,m:0,d:1,H:0,M:0,S:0,L:0},r=Zr(n,t,e,0);if(r!=e.length)return null;"p"in n&&(n.H=n.H%12+12*n.p);var i=new Ta;return i.setFullYear(n.y,n.m,n.d),i.setHours(n.H,n.M,n.S,n.L),i},e.toString=function(){return t},e};var za=Jr(Ra),Wa=Jr(qa),Fa=Jr(La),Ua=Qr(La),Ha=Jr(Ba),Ya=Qr(Ba),Va={"-":"",_:" ",0:"0"},Ga={a:function(t){return qa[t.getDay()]},A:function(t){return Ra[t.getDay()]},b:function(t){return Ba[t.getMonth()]},B:function(t){return La[t.getMonth()]},c:Oi.time.format(Ca),d:function(t,e){return Kr(t.getDate(),e,2)},e:function(t,e){return Kr(t.getDate(),e,2)},H:function(t,e){return Kr(t.getHours(),e,2)},I:function(t,e){return Kr(t.getHours()%12||12,e,2)},j:function(t,e){return Kr(1+Oi.time.dayOfYear(t),e,3)},L:function(t,e){return Kr(t.getMilliseconds(),e,3)},m:function(t,e){return Kr(t.getMonth()+1,e,2)},M:function(t,e){return Kr(t.getMinutes(),e,2)},p:function(t){return t.getHours()>=12?"PM":"AM"},S:function(t,e){return Kr(t.getSeconds(),e,2)},U:function(t,e){return Kr(Oi.time.sundayOfYear(t),e,2)},w:function(t){return t.getDay()},W:function(t,e){return Kr(Oi.time.mondayOfYear(t),e,2)},x:Oi.time.format(Pa),X:Oi.time.format(Ia),y:function(t,e){return Kr(t.getFullYear()%100,e,2)},Y:function(t,e){return Kr(t.getFullYear()%1e4,e,4)},Z:vi,"%":function(){return"%"}},Xa={a:ti,A:ei,b:ni,B:ri,c:ii,d:fi,e:fi,H:hi,I:hi,L:gi,m:li,M:pi,p:mi,S:di,x:oi,X:ai,y:ui,Y:si},$a=/^\s*\d+/,Za=Oi.map({am:0,pm:1});Oi.time.format.utc=function(t){function e(t){try{Ta=$r;var e=new Ta;return e._=t,n(e)}finally{Ta=Date}}var n=Oi.time.format(t);return e.parse=function(t){try{Ta=$r;var e=n.parse(t);return e&&e._}finally{Ta=Date}},e.toString=n.toString,e};var Ja=Oi.time.format.utc("%Y-%m-%dT%H:%M:%S.%LZ");Oi.time.format.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?yi:Ja,yi.parse=function(t){var e=new Date(t);return isNaN(e)?null:e},yi.toString=Ja.toString,Oi.time.second=bi(function(t){return new Ta(1e3*Math.floor(t/1e3))},function(t,e){t.setTime(t.getTime()+1e3*Math.floor(e))},function(t){return t.getSeconds()}),Oi.time.seconds=Oi.time.second.range,Oi.time.seconds.utc=Oi.time.second.utc.range,Oi.time.minute=bi(function(t){return new Ta(6e4*Math.floor(t/6e4))},function(t,e){t.setTime(t.getTime()+6e4*Math.floor(e))},function(t){return t.getMinutes()}),Oi.time.minutes=Oi.time.minute.range,Oi.time.minutes.utc=Oi.time.minute.utc.range,Oi.time.hour=bi(function(t){var e=t.getTimezoneOffset()/60;return new Ta(36e5*(Math.floor(t/36e5-e)+e))},function(t,e){t.setTime(t.getTime()+36e5*Math.floor(e))},function(t){return t.getHours()}),Oi.time.hours=Oi.time.hour.range,Oi.time.hours.utc=Oi.time.hour.utc.range,Oi.time.day=bi(function(t){var e=new Ta(1970,0);return e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e},function(t,e){t.setDate(t.getDate()+e)},function(t){return t.getDate()-1}),Oi.time.days=Oi.time.day.range,Oi.time.days.utc=Oi.time.day.utc.range,Oi.time.dayOfYear=function(t){var e=Oi.time.year(t);return Math.floor((t-e-6e4*(t.getTimezoneOffset()-e.getTimezoneOffset()))/864e5)},Oa.forEach(function(t,e){t=t.toLowerCase(),e=7-e;var n=Oi.time[t]=bi(function(t){return(t=Oi.time.day(t)).setDate(t.getDate()-(t.getDay()+e)%7),t},function(t,e){t.setDate(t.getDate()+7*Math.floor(e))},function(t){var n=Oi.time.year(t).getDay();return Math.floor((Oi.time.dayOfYear(t)+(n+e)%7)/7)-(n!==e)});Oi.time[t+"s"]=n.range,Oi.time[t+"s"].utc=n.utc.range,Oi.time[t+"OfYear"]=function(t){var n=Oi.time.year(t).getDay();return Math.floor((Oi.time.dayOfYear(t)+(n+e)%7)/7)}}),Oi.time.week=Oi.time.sunday,Oi.time.weeks=Oi.time.sunday.range,Oi.time.weeks.utc=Oi.time.sunday.utc.range,Oi.time.weekOfYear=Oi.time.sundayOfYear,Oi.time.month=bi(function(t){return t=Oi.time.day(t),t.setDate(1),t},function(t,e){t.setMonth(t.getMonth()+e)},function(t){return t.getMonth()}),Oi.time.months=Oi.time.month.range,Oi.time.months.utc=Oi.time.month.utc.range,Oi.time.year=bi(function(t){return t=Oi.time.day(t),t.setMonth(0,1),t},function(t,e){t.setFullYear(t.getFullYear()+e)},function(t){return t.getFullYear()}),Oi.time.years=Oi.time.year.range,Oi.time.years.utc=Oi.time.year.utc.range;var Qa=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Ka=[[Oi.time.second,1],[Oi.time.second,5],[Oi.time.second,15],[Oi.time.second,30],[Oi.time.minute,1],[Oi.time.minute,5],[Oi.time.minute,15],[Oi.time.minute,30],[Oi.time.hour,1],[Oi.time.hour,3],[Oi.time.hour,6],[Oi.time.hour,12],[Oi.time.day,1],[Oi.time.day,2],[Oi.time.week,1],[Oi.time.month,1],[Oi.time.month,3],[Oi.time.year,1]],ts=[[Oi.time.format("%Y"),s],[Oi.time.format("%B"),function(t){return t.getMonth()}],[Oi.time.format("%b %d"),function(t){return 1!=t.getDate()}],[Oi.time.format("%a %d"),function(t){return t.getDay()&&1!=t.getDate()}],[Oi.time.format("%I %p"),function(t){return t.getHours()}],[Oi.time.format("%I:%M"),function(t){return t.getMinutes()}],[Oi.time.format(":%S"),function(t){return t.getSeconds()}],[Oi.time.format(".%L"),function(t){return t.getMilliseconds()}]],es=Oi.scale.linear(),ns=Ai(ts);Ka.year=function(t,e){return es.domain(t.map(Ei)).ticks(e).map(Ni)},Oi.time.scale=function(){return xi(Oi.scale.linear(),Ka,ns)};var rs=Ka.map(function(t){return[t[0].utc,t[1]]}),is=[[Oi.time.format.utc("%Y"),s],[Oi.time.format.utc("%B"),function(t){return t.getUTCMonth()}],[Oi.time.format.utc("%b %d"),function(t){return 1!=t.getUTCDate()}],[Oi.time.format.utc("%a %d"),function(t){return t.getUTCDay()&&1!=t.getUTCDate()}],[Oi.time.format.utc("%I %p"),function(t){return t.getUTCHours()}],[Oi.time.format.utc("%I:%M"),function(t){return t.getUTCMinutes()}],[Oi.time.format.utc(":%S"),function(t){return t.getUTCSeconds()}],[Oi.time.format.utc(".%L"),function(t){return t.getUTCMilliseconds()}]],os=Ai(is);return rs.year=function(t,e){return es.domain(t.map(Si)).ticks(e).map(ji)},Oi.time.scale.utc=function(){return xi(Oi.scale.linear(),rs,os)},Oi}()},{}],68:[function(t,e,n){t("./d3"),e.exports=d3},{"./d3":67}],69:[function(t,e,n){!function(t,e){if("object"==typeof n&&n)e(n);else{var r={};e(r),"function"==typeof define&&define.amd?define(r):t.Mustache=r}}(this,function(t){function e(t,e){return _.call(t,e)}function n(t){return!e(m,t)}function r(t){return"function"==typeof t}function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(t){return String(t).replace(/[&<>"'\/]/g,function(t){return M[t]})}function a(t){this.string=t,this.tail=t,this.pos=0}function s(t,e){this.view=null==t?{}:t,this.parent=e,this._cache={".":this.view}}function u(){this.clearCache()}function c(e,n,i,o){function a(t){return n.render(t,i)}for(var s,u,l,f="",h=0,p=e.length;p>h;++h)switch(s=e[h],u=s[1],s[0]){case"#":if(l=i.lookup(u),"object"==typeof l||"string"==typeof l)if(w(l))for(var d=0,g=l.length;g>d;++d)f+=c(s[4],n,i.push(l[d]),o);else l&&(f+=c(s[4],n,i.push(l),o));else if(r(l)){var m=null==o?null:o.slice(s[3],s[5]);l=l.call(i.view,m,a),null!=l&&(f+=l)}else l&&(f+=c(s[4],n,i,o));break;case"^":l=i.lookup(u),(!l||w(l)&&0===l.length)&&(f+=c(s[4],n,i,o));break;case">":l=n.getPartial(u),r(l)&&(f+=l(i));break;case"&":l=i.lookup(u),null!=l&&(f+=l);break;case"name":l=i.lookup(u),null!=l&&(f+=t.escape(l));break;case"text":f+=u}return f}function l(t){for(var e,n=[],r=n,i=[],o=0,a=t.length;a>o;++o)switch(e=t[o],e[0]){case"#":case"^":i.push(e),r.push(e),r=e[4]=[];break;case"/":var s=i.pop();s[5]=e[2],r=i.length>0?i[i.length-1][4]:n;break;default:r.push(e)}return n}function f(t){for(var e,n,r=[],i=0,o=t.length;o>i;++i)e=t[i],e&&("text"===e[0]&&n&&"text"===n[0]?(n[1]+=e[1],n[3]=e[3]):(n=e,r.push(e)));return r}function h(t){return[new RegExp(i(t[0])+"\\s*"),new RegExp("\\s*"+i(t[1]))]}function p(e,r){function o(){if(E&&!j)for(;N.length;)delete A[N.pop()];else N=[];E=!1,j=!1}if(e=e||"",r=r||t.tags,"string"==typeof r&&(r=r.split(g)),2!==r.length)throw new Error("Invalid tags: "+r.join(", "));for(var s,u,c,p,m,_,x=h(r),w=new a(e),M=[],A=[],N=[],E=!1,j=!1;!w.eos();){if(s=w.pos,c=w.scanUntil(x[0]))for(var S=0,k=c.length;k>S;++S)p=c.charAt(S),n(p)?N.push(A.length):j=!0,A.push(["text",p,s,s+1]),s+=1,"\n"==p&&o();if(!w.scan(x[0]))break;
  
  if(E=!0,u=w.scan(b)||"name",w.scan(d),"="===u?(c=w.scanUntil(v),w.scan(v),w.scanUntil(x[1])):"{"===u?(c=w.scanUntil(new RegExp("\\s*"+i("}"+r[1]))),w.scan(y),w.scanUntil(x[1]),u="&"):c=w.scanUntil(x[1]),!w.scan(x[1]))throw new Error("Unclosed tag at "+w.pos);if(m=[u,c,s,w.pos],A.push(m),"#"===u||"^"===u)M.push(m);else if("/"===u){if(_=M.pop(),!_)throw new Error('Unopened section "'+c+'" at '+s);if(_[1]!==c)throw new Error('Unclosed section "'+_[1]+'" at '+s)}else if("name"===u||"{"===u||"&"===u)j=!0;else if("="===u){if(r=c.split(g),2!==r.length)throw new Error("Invalid tags at "+s+": "+r.join(", "));x=h(r)}}if(_=M.pop())throw new Error('Unclosed section "'+_[1]+'" at '+w.pos);return l(f(A))}var d=/\s*/,g=/\s+/,m=/\S/,v=/\s*=/,y=/\s*\}/,b=/#|\^|\/|>|\{|&|=|!/,_=RegExp.prototype.test,x=Object.prototype.toString,w=Array.isArray||function(t){return"[object Array]"===x.call(t)},M={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};a.prototype.eos=function(){return""===this.tail},a.prototype.scan=function(t){var e=this.tail.match(t);if(e&&0===e.index){var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n}return""},a.prototype.scanUntil=function(t){var e,n=this.tail.search(t);switch(n){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=e.length,e},s.make=function(t){return t instanceof s?t:new s(t)},s.prototype.push=function(t){return new s(t,this)},s.prototype.lookup=function(t){var e;if(t in this._cache)e=this._cache[t];else{for(var n=this;n;){if(t.indexOf(".")>0){e=n.view;for(var i=t.split("."),o=0;null!=e&&o<i.length;)e=e[i[o++]]}else e=n.view[t];if(null!=e)break;n=n.parent}this._cache[t]=e}return r(e)&&(e=e.call(this.view)),e},u.prototype.clearCache=function(){this._cache={},this._partialCache={}},u.prototype.compile=function(e,n){var r=this._cache[e];if(!r){var i=t.parse(e,n);r=this._cache[e]=this.compileTokens(i,e)}return r},u.prototype.compilePartial=function(t,e,n){var r=this.compile(e,n);return this._partialCache[t]=r,r},u.prototype.getPartial=function(t){return t in this._partialCache||!this._loadPartial||this.compilePartial(t,this._loadPartial(t)),this._partialCache[t]},u.prototype.compileTokens=function(t,e){var n=this;return function(i,o){if(o)if(r(o))n._loadPartial=o;else for(var a in o)n.compilePartial(a,o[a]);return c(t,n,s.make(i),e)}},u.prototype.render=function(t,e,n){return this.compile(t)(e,n)},t.name="mustache.js",t.version="0.7.3",t.tags=["{{","}}"],t.Scanner=a,t.Context=s,t.Writer=u,t.parse=p,t.escape=o;var A=new u;t.clearCache=function(){return A.clearCache()},t.compile=function(t,e){return A.compile(t,e)},t.compilePartial=function(t,e,n){return A.compilePartial(t,e,n)},t.compileTokens=function(t,e){return A.compileTokens(t,e)},t.render=function(t,e,n){return A.render(t,e,n)},t.to_html=function(e,n,i,o){var a=t.render(e,n,i);return r(o)?void o(a):a}})},{}],70:[function(t,e,n){(function(){var t=this,r=t._,i={},o=Array.prototype,a=Object.prototype,s=Function.prototype,u=o.push,c=o.slice,l=o.concat,f=a.toString,h=a.hasOwnProperty,p=o.forEach,d=o.map,g=o.reduce,m=o.reduceRight,v=o.filter,y=o.every,b=o.some,_=o.indexOf,x=o.lastIndexOf,w=Array.isArray,M=Object.keys,A=s.bind,N=function(t){return t instanceof N?t:this instanceof N?void(this._wrapped=t):new N(t)};"undefined"!=typeof n?("undefined"!=typeof e&&e.exports&&(n=e.exports=N),n._=N):t._=N,N.VERSION="1.4.4";var E=N.each=N.forEach=function(t,e,n){if(null!=t)if(p&&t.forEach===p)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(e.call(n,t[r],r,t)===i)return}else for(var a in t)if(N.has(t,a)&&e.call(n,t[a],a,t)===i)return};N.map=N.collect=function(t,e,n){var r=[];return null==t?r:d&&t.map===d?t.map(e,n):(E(t,function(t,i,o){r[r.length]=e.call(n,t,i,o)}),r)};var j="Reduce of empty array with no initial value";N.reduce=N.foldl=N.inject=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),g&&t.reduce===g)return r&&(e=N.bind(e,r)),i?t.reduce(e,n):t.reduce(e);if(E(t,function(t,o,a){i?n=e.call(r,n,t,o,a):(n=t,i=!0)}),!i)throw new TypeError(j);return n},N.reduceRight=N.foldr=function(t,e,n,r){var i=arguments.length>2;if(null==t&&(t=[]),m&&t.reduceRight===m)return r&&(e=N.bind(e,r)),i?t.reduceRight(e,n):t.reduceRight(e);var o=t.length;if(o!==+o){var a=N.keys(t);o=a.length}if(E(t,function(s,u,c){u=a?a[--o]:--o,i?n=e.call(r,n,t[u],u,c):(n=t[u],i=!0)}),!i)throw new TypeError(j);return n},N.find=N.detect=function(t,e,n){var r;return S(t,function(t,i,o){return e.call(n,t,i,o)?(r=t,!0):void 0}),r},N.filter=N.select=function(t,e,n){var r=[];return null==t?r:v&&t.filter===v?t.filter(e,n):(E(t,function(t,i,o){e.call(n,t,i,o)&&(r[r.length]=t)}),r)},N.reject=function(t,e,n){return N.filter(t,function(t,r,i){return!e.call(n,t,r,i)},n)},N.every=N.all=function(t,e,n){e||(e=N.identity);var r=!0;return null==t?r:y&&t.every===y?t.every(e,n):(E(t,function(t,o,a){return(r=r&&e.call(n,t,o,a))?void 0:i}),!!r)};var S=N.some=N.any=function(t,e,n){e||(e=N.identity);var r=!1;return null==t?r:b&&t.some===b?t.some(e,n):(E(t,function(t,o,a){return r||(r=e.call(n,t,o,a))?i:void 0}),!!r)};N.contains=N.include=function(t,e){return null==t?!1:_&&t.indexOf===_?-1!=t.indexOf(e):S(t,function(t){return t===e})},N.invoke=function(t,e){var n=c.call(arguments,2),r=N.isFunction(e);return N.map(t,function(t){return(r?e:t[e]).apply(t,n)})},N.pluck=function(t,e){return N.map(t,function(t){return t[e]})},N.where=function(t,e,n){return N.isEmpty(e)?n?null:[]:N[n?"find":"filter"](t,function(t){for(var n in e)if(e[n]!==t[n])return!1;return!0})},N.findWhere=function(t,e){return N.where(t,e,!0)},N.max=function(t,e,n){if(!e&&N.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.max.apply(Math,t);if(!e&&N.isEmpty(t))return-(1/0);var r={computed:-(1/0),value:-(1/0)};return E(t,function(t,i,o){var a=e?e.call(n,t,i,o):t;a>=r.computed&&(r={value:t,computed:a})}),r.value},N.min=function(t,e,n){if(!e&&N.isArray(t)&&t[0]===+t[0]&&t.length<65535)return Math.min.apply(Math,t);if(!e&&N.isEmpty(t))return 1/0;var r={computed:1/0,value:1/0};return E(t,function(t,i,o){var a=e?e.call(n,t,i,o):t;a<r.computed&&(r={value:t,computed:a})}),r.value},N.shuffle=function(t){var e,n=0,r=[];return E(t,function(t){e=N.random(n++),r[n-1]=r[e],r[e]=t}),r};var k=function(t){return N.isFunction(t)?t:function(e){return e[t]}};N.sortBy=function(t,e,n){var r=k(e);return N.pluck(N.map(t,function(t,e,i){return{value:t,index:e,criteria:r.call(n,t,e,i)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(n>r||void 0===n)return 1;if(r>n||void 0===r)return-1}return t.index<e.index?-1:1}),"value")};var T=function(t,e,n,r){var i={},o=k(e||N.identity);return E(t,function(e,a){var s=o.call(n,e,a,t);r(i,s,e)}),i};N.groupBy=function(t,e,n){return T(t,e,n,function(t,e,n){(N.has(t,e)?t[e]:t[e]=[]).push(n)})},N.countBy=function(t,e,n){return T(t,e,n,function(t,e){N.has(t,e)||(t[e]=0),t[e]++})},N.sortedIndex=function(t,e,n,r){n=null==n?N.identity:k(n);for(var i=n.call(r,e),o=0,a=t.length;a>o;){var s=o+a>>>1;n.call(r,t[s])<i?o=s+1:a=s}return o},N.toArray=function(t){return t?N.isArray(t)?c.call(t):t.length===+t.length?N.map(t,N.identity):N.values(t):[]},N.size=function(t){return null==t?0:t.length===+t.length?t.length:N.keys(t).length},N.first=N.head=N.take=function(t,e,n){return null==t?void 0:null==e||n?t[0]:c.call(t,0,e)},N.initial=function(t,e,n){return c.call(t,0,t.length-(null==e||n?1:e))},N.last=function(t,e,n){return null==t?void 0:null==e||n?t[t.length-1]:c.call(t,Math.max(t.length-e,0))},N.rest=N.tail=N.drop=function(t,e,n){return c.call(t,null==e||n?1:e)},N.compact=function(t){return N.filter(t,N.identity)};var O=function(t,e,n){return E(t,function(t){N.isArray(t)?e?u.apply(n,t):O(t,e,n):n.push(t)}),n};N.flatten=function(t,e){return O(t,e,[])},N.without=function(t){return N.difference(t,c.call(arguments,1))},N.uniq=N.unique=function(t,e,n,r){N.isFunction(e)&&(r=n,n=e,e=!1);var i=n?N.map(t,n,r):t,o=[],a=[];return E(i,function(n,r){(e?r&&a[a.length-1]===n:N.contains(a,n))||(a.push(n),o.push(t[r]))}),o},N.union=function(){return N.uniq(l.apply(o,arguments))},N.intersection=function(t){var e=c.call(arguments,1);return N.filter(N.uniq(t),function(t){return N.every(e,function(e){return N.indexOf(e,t)>=0})})},N.difference=function(t){var e=l.apply(o,c.call(arguments,1));return N.filter(t,function(t){return!N.contains(e,t)})},N.zip=function(){for(var t=c.call(arguments),e=N.max(N.pluck(t,"length")),n=new Array(e),r=0;e>r;r++)n[r]=N.pluck(t,""+r);return n},N.object=function(t,e){if(null==t)return{};for(var n={},r=0,i=t.length;i>r;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n},N.indexOf=function(t,e,n){if(null==t)return-1;var r=0,i=t.length;if(n){if("number"!=typeof n)return r=N.sortedIndex(t,e),t[r]===e?r:-1;r=0>n?Math.max(0,i+n):n}if(_&&t.indexOf===_)return t.indexOf(e,n);for(;i>r;r++)if(t[r]===e)return r;return-1},N.lastIndexOf=function(t,e,n){if(null==t)return-1;var r=null!=n;if(x&&t.lastIndexOf===x)return r?t.lastIndexOf(e,n):t.lastIndexOf(e);for(var i=r?n:t.length;i--;)if(t[i]===e)return i;return-1},N.range=function(t,e,n){arguments.length<=1&&(e=t||0,t=0),n=arguments[2]||1;for(var r=Math.max(Math.ceil((e-t)/n),0),i=0,o=new Array(r);r>i;)o[i++]=t,t+=n;return o},N.bind=function(t,e){if(t.bind===A&&A)return A.apply(t,c.call(arguments,1));var n=c.call(arguments,2);return function(){return t.apply(e,n.concat(c.call(arguments)))}},N.partial=function(t){var e=c.call(arguments,1);return function(){return t.apply(this,e.concat(c.call(arguments)))}},N.bindAll=function(t){var e=c.call(arguments,1);return 0===e.length&&(e=N.functions(t)),E(e,function(e){t[e]=N.bind(t[e],t)}),t},N.memoize=function(t,e){var n={};return e||(e=N.identity),function(){var r=e.apply(this,arguments);return N.has(n,r)?n[r]:n[r]=t.apply(this,arguments)}},N.delay=function(t,e){var n=c.call(arguments,2);return setTimeout(function(){return t.apply(null,n)},e)},N.defer=function(t){return N.delay.apply(N,[t,1].concat(c.call(arguments,1)))},N.throttle=function(t,e){var n,r,i,o,a=0,s=function(){a=new Date,i=null,o=t.apply(n,r)};return function(){var u=new Date,c=e-(u-a);return n=this,r=arguments,0>=c?(clearTimeout(i),i=null,a=u,o=t.apply(n,r)):i||(i=setTimeout(s,c)),o}},N.debounce=function(t,e,n){var r,i;return function(){var o=this,a=arguments,s=function(){r=null,n||(i=t.apply(o,a))},u=n&&!r;return clearTimeout(r),r=setTimeout(s,e),u&&(i=t.apply(o,a)),i}},N.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},N.wrap=function(t,e){return function(){var n=[t];return u.apply(n,arguments),e.apply(this,n)}},N.compose=function(){var t=arguments;return function(){for(var e=arguments,n=t.length-1;n>=0;n--)e=[t[n].apply(this,e)];return e[0]}},N.after=function(t,e){return 0>=t?e():function(){return--t<1?e.apply(this,arguments):void 0}},N.keys=M||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var e=[];for(var n in t)N.has(t,n)&&(e[e.length]=n);return e},N.values=function(t){var e=[];for(var n in t)N.has(t,n)&&e.push(t[n]);return e},N.pairs=function(t){var e=[];for(var n in t)N.has(t,n)&&e.push([n,t[n]]);return e},N.invert=function(t){var e={};for(var n in t)N.has(t,n)&&(e[t[n]]=n);return e},N.functions=N.methods=function(t){var e=[];for(var n in t)N.isFunction(t[n])&&e.push(n);return e.sort()},N.extend=function(t){return E(c.call(arguments,1),function(e){if(e)for(var n in e)t[n]=e[n]}),t},N.pick=function(t){var e={},n=l.apply(o,c.call(arguments,1));return E(n,function(n){n in t&&(e[n]=t[n])}),e},N.omit=function(t){var e={},n=l.apply(o,c.call(arguments,1));for(var r in t)N.contains(n,r)||(e[r]=t[r]);return e},N.defaults=function(t){return E(c.call(arguments,1),function(e){if(e)for(var n in e)null==t[n]&&(t[n]=e[n])}),t},N.clone=function(t){return N.isObject(t)?N.isArray(t)?t.slice():N.extend({},t):t},N.tap=function(t,e){return e(t),t};var D=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return t===e;t instanceof N&&(t=t._wrapped),e instanceof N&&(e=e._wrapped);var i=f.call(t);if(i!=f.call(e))return!1;switch(i){case"[object String]":return t==String(e);case"[object Number]":return t!=+t?e!=+e:0==t?1/t==1/e:t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object RegExp]":return t.source==e.source&&t.global==e.global&&t.multiline==e.multiline&&t.ignoreCase==e.ignoreCase}if("object"!=typeof t||"object"!=typeof e)return!1;for(var o=n.length;o--;)if(n[o]==t)return r[o]==e;n.push(t),r.push(e);var a=0,s=!0;if("[object Array]"==i){if(a=t.length,s=a==e.length)for(;a--&&(s=D(t[a],e[a],n,r)););}else{var u=t.constructor,c=e.constructor;if(u!==c&&!(N.isFunction(u)&&u instanceof u&&N.isFunction(c)&&c instanceof c))return!1;for(var l in t)if(N.has(t,l)&&(a++,!(s=N.has(e,l)&&D(t[l],e[l],n,r))))break;if(s){for(l in e)if(N.has(e,l)&&!a--)break;s=!a}}return n.pop(),r.pop(),s};N.isEqual=function(t,e){return D(t,e,[],[])},N.isEmpty=function(t){if(null==t)return!0;if(N.isArray(t)||N.isString(t))return 0===t.length;for(var e in t)if(N.has(t,e))return!1;return!0},N.isElement=function(t){return!(!t||1!==t.nodeType)},N.isArray=w||function(t){return"[object Array]"==f.call(t)},N.isObject=function(t){return t===Object(t)},E(["Arguments","Function","String","Number","Date","RegExp"],function(t){N["is"+t]=function(e){return f.call(e)=="[object "+t+"]"}}),N.isArguments(arguments)||(N.isArguments=function(t){return!(!t||!N.has(t,"callee"))}),"function"!=typeof/./&&(N.isFunction=function(t){return"function"==typeof t}),N.isFinite=function(t){return isFinite(t)&&!isNaN(parseFloat(t))},N.isNaN=function(t){return N.isNumber(t)&&t!=+t},N.isBoolean=function(t){return t===!0||t===!1||"[object Boolean]"==f.call(t)},N.isNull=function(t){return null===t},N.isUndefined=function(t){return void 0===t},N.has=function(t,e){return h.call(t,e)},N.noConflict=function(){return t._=r,this},N.identity=function(t){return t},N.times=function(t,e,n){for(var r=Array(t),i=0;t>i;i++)r[i]=e.call(n,i);return r},N.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))};var C={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"}};C.unescape=N.invert(C.escape);var P={escape:new RegExp("["+N.keys(C.escape).join("")+"]","g"),unescape:new RegExp("("+N.keys(C.unescape).join("|")+")","g")};N.each(["escape","unescape"],function(t){N[t]=function(e){return null==e?"":(""+e).replace(P[t],function(e){return C[t][e]})}}),N.result=function(t,e){if(null==t)return null;var n=t[e];return N.isFunction(n)?n.call(t):n},N.mixin=function(t){E(N.functions(t),function(e){var n=N[e]=t[e];N.prototype[e]=function(){var t=[this._wrapped];return u.apply(t,arguments),B.call(this,n.apply(N,t))}})};var I=0;N.uniqueId=function(t){var e=++I+"";return t?t+e:e},N.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var R=/(.)^/,q={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},L=/\\|'|\r|\n|\t|\u2028|\u2029/g;N.template=function(t,e,n){var r;n=N.defaults({},n,N.templateSettings);var i=new RegExp([(n.escape||R).source,(n.interpolate||R).source,(n.evaluate||R).source].join("|")+"|$","g"),o=0,a="__p+='";t.replace(i,function(e,n,r,i,s){return a+=t.slice(o,s).replace(L,function(t){return"\\"+q[t]}),n&&(a+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'"),r&&(a+="'+\n((__t=("+r+"))==null?'':__t)+\n'"),i&&(a+="';\n"+i+"\n__p+='"),o=s+e.length,e}),a+="';\n",n.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{r=new Function(n.variable||"obj","_",a)}catch(s){throw s.source=a,s}if(e)return r(e,N);var u=function(t){return r.call(this,t,N)};return u.source="function("+(n.variable||"obj")+"){\n"+a+"}",u},N.chain=function(t){return N(t).chain()};var B=function(t){return this._chain?N(t).chain():t};N.mixin(N),E(["pop","push","reverse","shift","sort","splice","unshift"],function(t){var e=o[t];N.prototype[t]=function(){var n=this._wrapped;return e.apply(n,arguments),"shift"!=t&&"splice"!=t||0!==n.length||delete n[0],B.call(this,n)}}),E(["concat","join","slice"],function(t){var e=o[t];N.prototype[t]=function(){return B.call(this,e.apply(this._wrapped,arguments))}}),N.extend(N.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}})}).call(this)},{}],71:[function(t,e,n){var r=t("./lib/WAAClock");e.exports=r,"undefined"!=typeof window&&(window.WAAClock=r)},{"./lib/WAAClock":72}],72:[function(t,e,n){(function(t){var n="undefined"!=typeof window;if(n&&!AudioContext)throw new Error("This browser doesn't seem to support web audio API");var r={toleranceLate:.1,toleranceEarly:.001},i=function(t,e,n){this.clock=t,this.func=n,this._cleared=!1,this.toleranceLate=t.toleranceLate,this.toleranceEarly=t.toleranceEarly,this._latestTime=null,this._earliestTime=null,this.deadline=null,this.repeatTime=null,this.schedule(e)};i.prototype.clear=function(){return this.clock._removeEvent(this),this._cleared=!0,this},i.prototype.repeat=function(t){if(0===t)throw new Error("delay cannot be 0");return this.repeatTime=t,this.clock._hasEvent(this)||this.schedule(this.deadline+this.repeatTime),this},i.prototype.tolerance=function(t){return"number"==typeof t.late&&(this.toleranceLate=t.late),"number"==typeof t.early&&(this.toleranceEarly=t.early),this._refreshEarlyLateDates(),this.clock._hasEvent(this)&&(this.clock._removeEvent(this),this.clock._insertEvent(this)),this},i.prototype.isRepeated=function(){return null!==this.repeatTime},i.prototype.schedule=function(t){this._cleared=!1,this.deadline=t,this._refreshEarlyLateDates(),this.clock.context.currentTime>=this._earliestTime?this._execute():this.clock._hasEvent(this)?(this.clock._removeEvent(this),this.clock._insertEvent(this)):this.clock._insertEvent(this)},i.prototype.timeStretch=function(t,e){this.isRepeated()&&(this.repeatTime=this.repeatTime*e);var n=t+e*(this.deadline-t);if(this.isRepeated())for(;this.clock.context.currentTime>=n-this.toleranceEarly;)n+=this.repeatTime;this.schedule(n)},i.prototype._execute=function(){this.clock._started!==!1&&(this.clock._removeEvent(this),this.clock.context.currentTime<this._latestTime?this.func(this):(this.onexpired&&this.onexpired(this),console.warn("event expired")),this.clock._hasEvent(this)||!this.isRepeated()||this._cleared||this.schedule(this.deadline+this.repeatTime))},i.prototype._refreshEarlyLateDates=function(){this._latestTime=this.deadline+this.toleranceLate,this._earliestTime=this.deadline-this.toleranceEarly};var o=e.exports=function(t,e){e=e||{},this.tickMethod=e.tickMethod||"ScriptProcessorNode",this.toleranceEarly=e.toleranceEarly||r.toleranceEarly,this.toleranceLate=e.toleranceLate||r.toleranceLate,this.context=t,this._events=[],this._started=!1};o.prototype.setTimeout=function(t,e){return this._createEvent(t,this._absTime(e))},o.prototype.callbackAtTime=function(t,e){return this._createEvent(t,e)},o.prototype.timeStretch=function(t,e,n){return e.forEach(function(e){e.timeStretch(t,n)}),e},o.prototype.start=function(){if(this._started===!1){var e=this;if(this._started=!0,this._events=[],"ScriptProcessorNode"===this.tickMethod){var n=256;this._clockNode=this.context.createScriptProcessor(n,1,1),this._clockNode.connect(this.context.destination),this._clockNode.onaudioprocess=function(){t.nextTick(function(){e._tick()})}}else if("manual"!==this.tickMethod)throw new Error("invalid tickMethod "+this.tickMethod)}},o.prototype.stop=function(){this._started===!0&&(this._started=!1,this._clockNode.disconnect())},o.prototype._tick=function(){for(var t=this._events.shift();t&&t._earliestTime<=this.context.currentTime;)t._execute(),t=this._events.shift();t&&this._events.unshift(t)},o.prototype._createEvent=function(t,e){return new i(this,e,t)},o.prototype._insertEvent=function(t){this._events.splice(this._indexByTime(t._earliestTime),0,t)},o.prototype._removeEvent=function(t){var e=this._events.indexOf(t);-1!==e&&this._events.splice(e,1)},o.prototype._hasEvent=function(t){return-1!==this._events.indexOf(t)},o.prototype._indexByTime=function(t){for(var e,n=0,r=this._events.length;r>n;)e=Math.floor((n+r)/2),this._events[e]._earliestTime<t?n=e+1:r=e;return n},o.prototype._absTime=function(t){return t+this.context.currentTime},o.prototype._relTime=function(t){return t-this.context.currentTime}}).call(this,t("_process"))},{_process:27}],73:[function(t,e,n){var r=t("./lib/WAAOffsetNode");e.exports=r,"undefined"!=typeof window&&(window.WAAOffsetNode=r)},{"./lib/WAAOffsetNode":74}],74:[function(t,e,n){var r=e.exports=function(t){this.context=t,this._ones=r._ones.filter(function(e){return e.context===t})[0],this._ones?this._ones=this._ones.ones:(this._ones=t.createOscillator(),this._ones.frequency.value=0,this._ones.setPeriodicWave(t.createPeriodicWave(new Float32Array([0,1]),new Float32Array([0,0]))),this._ones.start(0),r._ones.push({context:t,ones:this._ones})),this._output=t.createGain(),this._ones.connect(this._output),this.offset=this._output.gain,this.offset.value=0};r.prototype.connect=function(){this._output.connect.apply(this._output,arguments)},r.prototype.disconnect=function(){this._output.disconnect.apply(this._output,arguments)},r._ones=[]},{}],75:[function(t,e,n){var r=t("./lib/WAATableNode");e.exports=r,"undefined"!=typeof window&&(window.WAATableNode=r)},{"./lib/WAATableNode":76}],76:[function(t,e,n){var r=t("waaoffset"),i=e.exports=function(t){this.context=t,this._output=t.createWaveShaper(),this._positionNode=new r(t),this._positionNode.connect(this._output),this._positionNode.offset.value=-1,this.position=t.createGain(),this.position.connect(this._positionNode.offset),this.position.gain.value=0,this._table=null,Object.defineProperty(this,"table",{get:function(){return this._table},set:function(t){this._setTable(t)}})};i.prototype.connect=function(){this._output.connect.apply(this._output,arguments)},i.prototype.disconnect=function(){this._output.disconnect.apply(this._output,arguments)},i.prototype._setTable=function(t){t instanceof AudioBuffer&&(t=t.getChannelData(0)),this._table=t,null!==t&&(this._output.curve=t,this.position.gain.setValueAtTime(2/(t.length-1),0))}},{waaoffset:77}],77:[function(t,e,n){var r=t("./lib/WAAOffset");e.exports=r,"undefined"!=typeof window&&(window.WAAOffset=r)},{"./lib/WAAOffset":78}],78:[function(t,e,n){var r=e.exports=function(t){this.context=t,this._ones=t.createOscillator(),this._ones.frequency.value=0,this._ones.setPeriodicWave(t.createPeriodicWave(new Float32Array([0,1]),new Float32Array([0,0]))),this._ones.start(0),this._output=t.createGain(),this._ones.connect(this._output),this.offset=this._output.gain,this.offset.value=0};r.prototype.connect=function(){this._output.connect.apply(this._output,arguments)},r.prototype.disconnect=function(){this._output.disconnect.apply(this._output,arguments)}},{}],79:[function(t,e,n){var r=t("./lib/WAAWhiteNoiseNode");e.exports=r,"undefined"!=typeof window&&(window.WAAWhiteNoiseNode=r)},{"./lib/WAAWhiteNoiseNode":80}],80:[function(t,e,n){var r=e.exports=function(t){this.context=t,this._buffer=t.createBuffer(1,131072,t.sampleRate);var e,n=this._buffer.getChannelData(0);for(e=0;131072>e;e++)n[e]=2*Math.random()-1;this._prepareOutput()};r.prototype.connect=function(){this._output.connect.apply(this._output,arguments)},r.prototype.disconnect=function(){this._output.disconnect.apply(this._output,arguments)},r.prototype.start=function(){this._output.start.apply(this._output,arguments)},r.prototype.stop=function(){this._output.stop.apply(this._output,arguments),this._prepareOutput()},r.prototype._prepareOutput=function(){this._output=this.context.createBufferSource(),this._output.buffer=this._buffer,this._output.loop=!0}},{}],81:[function(t,e,n){var r=t("./lib/WAAWire");e.exports=r,"undefined"!=typeof window&&(window.WAAWire=r)},{"./lib/WAAWire":82}],82:[function(t,e,n){var r=e.exports=function(t){this.context=t,this._source=null,this._output=null,this._destination=null,this._input=null,this._gainNode=null,this._discardedGainNode=null,this._atTime=0,this._closed=!1},i=function(t){return function(){return this._clean(),this[t].apply(this,[this._atTime].concat([].slice.call(arguments,0))),this._atTime=0,this}};r.prototype.connect=i("_connect"),r.prototype.swapSource=i("_swapSource"),r.prototype.swapDestination=i("_swapDestination"),r.prototype.close=i("_close"),r.prototype.atTime=function(t){return this._atTime=t,this},r.prototype._connect=function(t,e,n,r,i){if(this._gainNode)throw new Error("Wire already connected");this._source=e,this._destination=n,this._output=r||0,this._input=i||0,this._doConnections(t)},r.prototype._swapSource=function(t,e,n){this._discardedGainNode=this._gainNode,this._discardedGainNode.gain.setValueAtTime(0,t),this._source=e,this._output=n||0,this._doConnections(t)},r.prototype._swapDestination=function(t,e,n){this._discardedGainNode=this._gainNode,this._discardedGainNode.gain.setValueAtTime(0,t),this._destination=e,this._input=n||0,this._doConnections(t)},r.prototype._close=function(t){if(this._closed===!0)throw new Error("Wire already closed");this._discardedGainNode=this._gainNode,this._gainNode.gain.setValueAtTime(0,t),this._gainNode=null,this._closed=!0},r.prototype._doConnections=function(t){var e=this.context.createGain();e.gain.setValueAtTime(0,0),e.gain.setValueAtTime(1,t),this._gainNode=e,this._source.connect(e,this._output),this._destination instanceof AudioParam?e.connect(this._destination,0):e.connect(this._destination,0,this._input)},r.prototype._clean=function(){this._discardedGainNode&&0===this._discardedGainNode.gain.value&&(this._discardedGainNode.disconnect(),this._discardedGainNode=null)};var o=function(){if("undefined"!=typeof window&&window.OfflineAudioContext){var t=new OfflineAudioContext(1,1,44100),e=t.createBufferSource(),n=t.createGain(),r=t.createBuffer(1,1,44100);r.getChannelData(0)[0]=1,e.buffer=r,e.connect(n),e.connect(t.destination),e.start(0),n.connect(t.destination),e.disconnect(n),t.oncomplete=function(t){a=!!t.renderedBuffer.getChannelData(0)[0]},t.startRendering()}},a=null;o()},{}]},{},[1]);