Commit c7ee829d authored by Joseph Larralde's avatar Joseph Larralde
Browse files

renamed waves-audio to wavesjs + added node-osc basic example

parent 423025ae
**/.DS_Store
**/Thumbs.db
node_modules/
\ No newline at end of file
{
"name": "node-osc",
"version": "1.0.0",
"description": "a simple ws osc bridge using osc.js",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "BSD-3-Clause",
"dependencies": {
"express": "^4.15.3"
}
}
#N canvas 370 138 655 437 10;
#X text 129 140 Send messages to "foo" on remote machine;
#X msg 31 59 disconnect;
#X floatatom 93 140 0 0 0 0 - - -;
#X obj 78 259 netsend -u -b;
#X msg 31 37 connect localhost 57121;
#X obj 93 185 list prepend send;
#X obj 93 210 list trim;
#X obj 93 163 oscformat foo;
#X obj 454 90 oscparse;
#X obj 454 198 print;
#X obj 454 120 list trim;
#X obj 454 62 netreceive -b -u 8081;
#X connect 1 0 3 0;
#X connect 2 0 7 0;
#X connect 4 0 3 0;
#X connect 5 0 6 0;
#X connect 6 0 3 0;
#X connect 7 0 5 0;
#X connect 8 0 10 0;
#X connect 10 0 9 0;
#X connect 11 0 8 0;
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta charset="utf-8">
<script src="js/osc-browser.min.js"></script>
</head>
<body>
<div>
<button id="butt" value="A"> A </button>
<br>
<input id="slider" type="range" min="0" max="1" step="0.01" value="0">
</div>
<script type="text/javascript">
window.onload = function() {
//>>>>>>>>>>>>>>>>>>>>>>>>>>
var oscPort = new osc.WebSocketPort({
url: "ws://localhost:8081"
});
oscPort.on('open', function() {
console.log('socket open');
});
oscPort.on('message', function (msg) {
console.log(msg['address'] + ' ' + msg['args']);
});
oscPort.on('close', function() {
console.log('socket closed');
});
oscPort.open();
oscPort.socket.onmessage = function (e) {
console.log("message", e);
};
var b = document.querySelector('#butt');
b.addEventListener('click', function(e) {
oscPort.send({
address: '/button',
args: [ e.target.value ],
});
});
var r = document.querySelector('#slider');
r.addEventListener('input', function(e) {
oscPort.send({
address: '/slider',
args: [ e.target.value ],
});
});
//<<<<<<<<<<<<<<<<<<<<<<<<<<
}
</script>
</body>
</html>
\ No newline at end of file
(function() {
window.onload = function() {
//>>>>>>>>>>>>>>>>>>>>>>>>>>
this.oscPort = new osc.WebSocketPort({
url: "ws://localhost:8081"
});
this.listen();
this.oscPort.open();
this.oscPort.socket.onmessage = function (e) {
console.log("message", e);
};
//<<<<<<<<<<<<<<<<<<<<<<<<<<
}
})();
\ No newline at end of file
/*! osc.js 2.2.0, Copyright 2017 Colin Clark | github.com/colinbdclark/osc.js */
var osc=osc||{};!function(){"use strict";osc.SECS_70YRS=2208988800,osc.TWO_32=4294967296,osc.defaults={metadata:!1,unpackSingleArgs:!0},osc.isCommonJS=!("undefined"==typeof module||!module.exports),osc.isNode=osc.isCommonJS&&"undefined"==typeof window,osc.isElectron=!("undefined"==typeof process||!process.versions||!process.versions.electron),osc.isBufferEnv=osc.isNode||osc.isElectron,osc.isArray=function(a){return a&&"[object Array]"===Object.prototype.toString.call(a)},osc.isTypedArrayView=function(a){return a.buffer&&a.buffer instanceof ArrayBuffer},osc.isBuffer=function(a){return osc.isBufferEnv&&a instanceof Buffer};var a="undefined"!=typeof dcodeIO?dcodeIO.Long:"undefined"!=typeof a?a:osc.isNode?require("long"):void 0;osc.dataView=function(a,b,c){return a.buffer?new DataView(a.buffer,b,c):a instanceof ArrayBuffer?new DataView(a,b,c):new DataView(new Uint8Array(a),b,c)},osc.byteArray=function(a){if(a instanceof Uint8Array)return a;var b=a.buffer?a.buffer:a;if(!(b instanceof ArrayBuffer||"undefined"!=typeof b.length&&"string"!=typeof b))throw new Error("Can't wrap a non-array-like object as Uint8Array. Object was: "+JSON.stringify(a,null,2));return new Uint8Array(b)},osc.nativeBuffer=function(a){return osc.isBufferEnv?osc.isBuffer(a)?a:new Buffer(a.buffer?a:new Uint8Array(a)):osc.isTypedArrayView(a)?a:new Uint8Array(a)},osc.copyByteArray=function(a,b,c){if(osc.isTypedArrayView(a)&&osc.isTypedArrayView(b))b.set(a,c);else for(var d=void 0===c?0:c,e=Math.min(b.length-c,a.length),f=0,g=d;f<e;f++,g++)b[g]=a[f];return b},osc.readString=function(a,b){for(var c=[],d=b.idx;d<a.byteLength;d++){var e=a.getUint8(d);if(0===e){d++;break}c.push(e)}return d=d+3&-4,b.idx=d,String.fromCharCode.apply(null,c)},osc.writeString=function(a){for(var b=a+"\0",c=b.length,d=c+3&-4,e=new Uint8Array(d),f=0;f<b.length;f++){var g=b.charCodeAt(f);e[f]=g}return e},osc.readPrimitive=function(a,b,c,d){var e=a[b](d.idx,!1);return d.idx+=c,e},osc.writePrimitive=function(a,b,c,d,e){e=void 0===e?0:e;var f;return b?f=new Uint8Array(b.buffer):(f=new Uint8Array(d),b=new DataView(f.buffer)),b[c](e,a,!1),f},osc.readInt32=function(a,b){return osc.readPrimitive(a,"getInt32",4,b)},osc.writeInt32=function(a,b,c){return osc.writePrimitive(a,b,"setInt32",4,c)},osc.readInt64=function(b,c){var d=osc.readPrimitive(b,"getInt32",4,c),e=osc.readPrimitive(b,"getInt32",4,c);return a?new a(e,d):{high:d,low:e,unsigned:!1}},osc.writeInt64=function(a,b,c){var d=new Uint8Array(8);return d.set(osc.writePrimitive(a.high,b,"setInt32",4,c),0),d.set(osc.writePrimitive(a.low,b,"setInt32",4,c+4),4),d},osc.readFloat32=function(a,b){return osc.readPrimitive(a,"getFloat32",4,b)},osc.writeFloat32=function(a,b,c){return osc.writePrimitive(a,b,"setFloat32",4,c)},osc.readFloat64=function(a,b){return osc.readPrimitive(a,"getFloat64",8,b)},osc.writeFloat64=function(a,b,c){return osc.writePrimitive(a,b,"setFloat64",8,c)},osc.readChar32=function(a,b){var c=osc.readPrimitive(a,"getUint32",4,b);return String.fromCharCode(c)},osc.writeChar32=function(a,b,c){var d=a.charCodeAt(0);if(!(void 0===d||d<-1))return osc.writePrimitive(d,b,"setUint32",4,c)},osc.readBlob=function(a,b){var c=osc.readInt32(a,b),d=c+3&-4,e=new Uint8Array(a.buffer,b.idx,c);return b.idx+=d,e},osc.writeBlob=function(a){a=osc.byteArray(a);var b=a.byteLength,c=b+3&-4,d=4,e=c+d,f=new Uint8Array(e),g=new DataView(f.buffer);return osc.writeInt32(b,g),f.set(a,d),f},osc.readMIDIBytes=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4);return b.idx+=4,c},osc.writeMIDIBytes=function(a){a=osc.byteArray(a);var b=new Uint8Array(4);return b.set(a),b},osc.readColor=function(a,b){var c=new Uint8Array(a.buffer,b.idx,4),d=c[3]/255;return b.idx+=4,{r:c[0],g:c[1],b:c[2],a:d}},osc.writeColor=function(a){var b=Math.round(255*a.a),c=new Uint8Array([a.r,a.g,a.b,b]);return c},osc.readTrue=function(){return!0},osc.readFalse=function(){return!1},osc.readNull=function(){return null},osc.readImpulse=function(){return 1},osc.readTimeTag=function(a,b){var c=osc.readPrimitive(a,"getUint32",4,b),d=osc.readPrimitive(a,"getUint32",4,b),e=0===c&&1===d?Date.now():osc.ntpToJSTime(c,d);return{raw:[c,d],"native":e}},osc.writeTimeTag=function(a){var b=a.raw?a.raw:osc.jsToNTPTime(a["native"]),c=new Uint8Array(8),d=new DataView(c.buffer);return osc.writeInt32(b[0],d,0),osc.writeInt32(b[1],d,4),c},osc.timeTag=function(a,b){a=a||0,b=b||Date.now();var c=b/1e3,d=Math.floor(c),e=c-d,f=Math.floor(a),g=a-f,h=e+g;if(h>1){var i=Math.floor(h),j=h-i;f+=i,h=j}var k=d+f+osc.SECS_70YRS,l=Math.round(osc.TWO_32*h);return{raw:[k,l]}},osc.ntpToJSTime=function(a,b){var c=a-osc.SECS_70YRS,d=b/osc.TWO_32,e=1e3*(c+d);return e},osc.jsToNTPTime=function(a){var b=a/1e3,c=Math.floor(b),d=b-c,e=c+osc.SECS_70YRS,f=Math.round(osc.TWO_32*d);return[e,f]},osc.readArguments=function(a,b,c){var d=osc.readString(a,c);if(0!==d.indexOf(","))throw new Error("A malformed type tag string was found while reading the arguments of an OSC message. String was: "+d," at offset: "+c.idx);var e=d.substring(1).split(""),f=[];return osc.readArgumentsIntoArray(f,e,d,a,b,c),f},osc.readArgument=function(a,b,c,d,e){var f=osc.argumentTypes[a];if(!f)throw new Error("'"+a+"' is not a valid OSC type tag. Type tag string was: "+b);var g=f.reader,h=osc[g](c,e);return d.metadata&&(h={type:a,value:h}),h},osc.readArgumentsIntoArray=function(a,b,c,d,e,f){for(var g=0;g<b.length;){var h,i=b[g];if("["===i){var j=b.slice(g+1),k=j.indexOf("]");if(k<0)throw new Error("Invalid argument type tag: an open array type tag ('[') was found without a matching close array tag ('[]'). Type tag was: "+c);var l=j.slice(0,k);h=osc.readArgumentsIntoArray([],l,c,d,e,f),g+=k+2}else h=osc.readArgument(i,c,d,e,f),g++;a.push(h)}return a},osc.writeArguments=function(a,b){var c=osc.collectArguments(a,b);return osc.joinParts(c)},osc.joinParts=function(a){for(var b=new Uint8Array(a.byteLength),c=a.parts,d=0,e=0;e<c.length;e++){var f=c[e];osc.copyByteArray(f,b,d),d+=f.length}return b},osc.addDataPart=function(a,b){b.parts.push(a),b.byteLength+=a.length},osc.writeArrayArguments=function(a,b){for(var c="[",d=0;d<a.length;d++){var e=a[d];c+=osc.writeArgument(e,b)}return c+="]"},osc.writeArgument=function(a,b){if(osc.isArray(a))return osc.writeArrayArguments(a,b);var c=a.type,d=osc.argumentTypes[c].writer;if(d){var e=osc[d](a.value);osc.addDataPart(e,b)}return a.type},osc.collectArguments=function(a,b,c){osc.isArray(a)||(a="undefined"==typeof a?[]:[a]),c=c||{byteLength:0,parts:[]},b.metadata||(a=osc.annotateArguments(a));for(var d=",",e=c.parts.length,f=0;f<a.length;f++){var g=a[f];d+=osc.writeArgument(g,c)}var h=osc.writeString(d);return c.byteLength+=h.byteLength,c.parts.splice(e,0,h),c},osc.readMessage=function(a,b,c){b=b||osc.defaults;var d=osc.dataView(a,a.byteOffset,a.byteLength);c=c||{idx:0};var e=osc.readString(d,c);return osc.readMessageContents(e,d,b,c)},osc.readMessageContents=function(a,b,c,d){if(0!==a.indexOf("/"))throw new Error("A malformed OSC address was found while reading an OSC message. String was: "+a);var e=osc.readArguments(b,c,d);return{address:a,args:1===e.length&&c.unpackSingleArgs?e[0]:e}},osc.collectMessageParts=function(a,b,c){return c=c||{byteLength:0,parts:[]},osc.addDataPart(osc.writeString(a.address),c),osc.collectArguments(a.args,b,c)},osc.writeMessage=function(a,b){if(b=b||osc.defaults,!osc.isValidMessage(a))throw new Error("An OSC message must contain a valid address. Message was: "+JSON.stringify(a,null,2));var c=osc.collectMessageParts(a,b);return osc.joinParts(c)},osc.isValidMessage=function(a){return a.address&&0===a.address.indexOf("/")},osc.readBundle=function(a,b,c){return osc.readPacket(a,b,c)},osc.collectBundlePackets=function(a,b,c){c=c||{byteLength:0,parts:[]},osc.addDataPart(osc.writeString("#bundle"),c),osc.addDataPart(osc.writeTimeTag(a.timeTag),c);for(var d=0;d<a.packets.length;d++){var e=a.packets[d],f=e.address?osc.collectMessageParts:osc.collectBundlePackets,g=f(e,b);c.byteLength+=g.byteLength,osc.addDataPart(osc.writeInt32(g.byteLength),c),c.parts=c.parts.concat(g.parts)}return c},osc.writeBundle=function(a,b){if(!osc.isValidBundle(a))throw new Error("An OSC bundle must contain 'timeTag' and 'packets' properties. Bundle was: "+JSON.stringify(a,null,2));b=b||osc.defaults;var c=osc.collectBundlePackets(a,b);return osc.joinParts(c)},osc.isValidBundle=function(a){return void 0!==a.timeTag&&void 0!==a.packets},osc.readBundleContents=function(a,b,c,d){for(var e=osc.readTimeTag(a,c),f=[];c.idx<d;){var g=osc.readInt32(a,c),h=c.idx+g,i=osc.readPacket(a,b,c,h);f.push(i)}return{timeTag:e,packets:f}},osc.readPacket=function(a,b,c,d){var e=osc.dataView(a,a.byteOffset,a.byteLength);d=void 0===d?e.byteLength:d,c=c||{idx:0};var f=osc.readString(e,c),g=f[0];if("#"===g)return osc.readBundleContents(e,b,c,d);if("/"===g)return osc.readMessageContents(f,e,b,c);throw new Error("The header of an OSC packet didn't contain an OSC address or a #bundle string. Header was: "+f)},osc.writePacket=function(a,b){if(osc.isValidMessage(a))return osc.writeMessage(a,b);if(osc.isValidBundle(a))return osc.writeBundle(a,b);throw new Error("The specified packet was not recognized as a valid OSC message or bundle. Packet was: "+JSON.stringify(a,null,2))},osc.argumentTypes={i:{reader:"readInt32",writer:"writeInt32"},h:{reader:"readInt64",writer:"writeInt64"},f:{reader:"readFloat32",writer:"writeFloat32"},s:{reader:"readString",writer:"writeString"},S:{reader:"readString",writer:"writeString"},b:{reader:"readBlob",writer:"writeBlob"},t:{reader:"readTimeTag",writer:"writeTimeTag"},T:{reader:"readTrue"},F:{reader:"readFalse"},N:{reader:"readNull"},I:{reader:"readImpulse"},d:{reader:"readFloat64",writer:"writeFloat64"},c:{reader:"readChar32",writer:"writeChar32"},r:{reader:"readColor",writer:"writeColor"},m:{reader:"readMIDIBytes",writer:"writeMIDIBytes"}},osc.inferTypeForArgument=function(a){var b=typeof a;switch(b){case"boolean":return a?"T":"F";case"string":return"s";case"number":return"f";case"undefined":return"N";case"object":if(null===a)return"N";if(a instanceof Uint8Array||a instanceof ArrayBuffer)return"b";if("number"==typeof a.high&&"number"==typeof a.low)return"h"}throw new Error("Can't infer OSC argument type for value: "+JSON.stringify(a,null,2))},osc.annotateArguments=function(a){for(var b=[],c=0;c<a.length;c++){var d,e=a[c];if("object"==typeof e&&e.type&&void 0!==e.value)d=e;else if(osc.isArray(e))d=osc.annotateArguments(e);else{var f=osc.inferTypeForArgument(e);d={type:f,value:e}}b.push(d)}return b},osc.isCommonJS&&(module.exports=osc)}(),function(a,b){"function"==typeof define&&define.amd?define([],b):"function"==typeof require&&"object"==typeof module&&module&&module.exports?module.exports=b():(a.dcodeIO=a.dcodeIO||{}).Long=b()}(this,function(){"use strict";function a(a,b,c){this.low=0|a,this.high=0|b,this.unsigned=!!c}function b(a){return(a&&a.__isLong__)===!0}function c(a,b){var c,d,f;return b?(a>>>=0,(f=0<=a&&a<256)&&(d=i[a])?d:(c=e(a,(0|a)<0?-1:0,!0),f&&(i[a]=c),c)):(a|=0,(f=-128<=a&&a<128)&&(d=h[a])?d:(c=e(a,a<0?-1:0,!1),f&&(h[a]=c),c))}function d(a,b){if(isNaN(a)||!isFinite(a))return b?q:p;if(b){if(a<0)return q;if(a>=m)return v}else{if(a<=-n)return w;if(a+1>=n)return u}return a<0?d(-a,b).neg():e(a%l|0,a/l|0,b)}function e(b,c,d){return new a(b,c,d)}function f(a,b,c){if(0===a.length)throw Error("empty string");if("NaN"===a||"Infinity"===a||"+Infinity"===a||"-Infinity"===a)return p;if("number"==typeof b?(c=b,b=!1):b=!!b,c=c||10,c<2||36<c)throw RangeError("radix");var e;if((e=a.indexOf("-"))>0)throw Error("interior hyphen");if(0===e)return f(a.substring(1),b,c).neg();for(var g=d(j(c,8)),h=p,i=0;i<a.length;i+=8){var k=Math.min(8,a.length-i),l=parseInt(a.substring(i,i+k),c);if(k<8){var m=d(j(c,k));h=h.mul(m).add(d(l))}else h=h.mul(g),h=h.add(d(l))}return h.unsigned=b,h}function g(b){return b instanceof a?b:"number"==typeof b?d(b):"string"==typeof b?f(b):e(b.low,b.high,b.unsigned)}a.prototype.__isLong__,Object.defineProperty(a.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),a.isLong=b;var h={},i={};a.fromInt=c,a.fromNumber=d,a.fromBits=e;var j=Math.pow;a.fromString=f,a.fromValue=g;var k=1<<24,l=4294967296,m=0x10000000000000000,n=m/2,o=c(k),p=c(0);a.ZERO=p;var q=c(0,!0);a.UZERO=q;var r=c(1);a.ONE=r;var s=c(1,!0);a.UONE=s;var t=c(-1);a.NEG_ONE=t;var u=e(-1,2147483647,!1);a.MAX_VALUE=u;var v=e(-1,-1,!0);a.MAX_UNSIGNED_VALUE=v;var w=e(0,-2147483648,!1);a.MIN_VALUE=w;var x=a.prototype;return x.toInt=function(){return this.unsigned?this.low>>>0:this.low},x.toNumber=function(){return this.unsigned?(this.high>>>0)*l+(this.low>>>0):this.high*l+(this.low>>>0)},x.toString=function(a){if(a=a||10,a<2||36<a)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(w)){var b=d(a),c=this.div(b),e=c.mul(b).sub(this);return c.toString(a)+e.toInt().toString(a)}return"-"+this.neg().toString(a)}for(var f=d(j(a,6),this.unsigned),g=this,h="";;){var i=g.div(f),k=g.sub(i.mul(f)).toInt()>>>0,l=k.toString(a);if(g=i,g.isZero())return l+h;for(;l.length<6;)l="0"+l;h=""+l+h}},x.getHighBits=function(){return this.high},x.getHighBitsUnsigned=function(){return this.high>>>0},x.getLowBits=function(){return this.low},x.getLowBitsUnsigned=function(){return this.low>>>0},x.getNumBitsAbs=function(){if(this.isNegative())return this.eq(w)?64:this.neg().getNumBitsAbs();for(var a=0!=this.high?this.high:this.low,b=31;b>0&&0==(a&1<<b);b--);return 0!=this.high?b+33:b+1},x.isZero=function(){return 0===this.high&&0===this.low},x.isNegative=function(){return!this.unsigned&&this.high<0},x.isPositive=function(){return this.unsigned||this.high>=0},x.isOdd=function(){return 1===(1&this.low)},x.isEven=function(){return 0===(1&this.low)},x.equals=function(a){return b(a)||(a=g(a)),(this.unsigned===a.unsigned||this.high>>>31!==1||a.high>>>31!==1)&&(this.high===a.high&&this.low===a.low)},x.eq=x.equals,x.notEquals=function(a){return!this.eq(a)},x.neq=x.notEquals,x.lessThan=function(a){return this.comp(a)<0},x.lt=x.lessThan,x.lessThanOrEqual=function(a){return this.comp(a)<=0},x.lte=x.lessThanOrEqual,x.greaterThan=function(a){return this.comp(a)>0},x.gt=x.greaterThan,x.greaterThanOrEqual=function(a){return this.comp(a)>=0},x.gte=x.greaterThanOrEqual,x.compare=function(a){if(b(a)||(a=g(a)),this.eq(a))return 0;var c=this.isNegative(),d=a.isNegative();return c&&!d?-1:!c&&d?1:this.unsigned?a.high>>>0>this.high>>>0||a.high===this.high&&a.low>>>0>this.low>>>0?-1:1:this.sub(a).isNegative()?-1:1},x.comp=x.compare,x.negate=function(){return!this.unsigned&&this.eq(w)?w:this.not().add(r)},x.neg=x.negate,x.add=function(a){b(a)||(a=g(a));var c=this.high>>>16,d=65535&this.high,f=this.low>>>16,h=65535&this.low,i=a.high>>>16,j=65535&a.high,k=a.low>>>16,l=65535&a.low,m=0,n=0,o=0,p=0;return p+=h+l,o+=p>>>16,p&=65535,o+=f+k,n+=o>>>16,o&=65535,n+=d+j,m+=n>>>16,n&=65535,m+=c+i,m&=65535,e(o<<16|p,m<<16|n,this.unsigned)},x.subtract=function(a){return b(a)||(a=g(a)),this.add(a.neg())},x.sub=x.subtract,x.multiply=function(a){if(this.isZero())return p;if(b(a)||(a=g(a)),a.isZero())return p;if(this.eq(w))return a.isOdd()?w:p;if(a.eq(w))return this.isOdd()?w:p;if(this.isNegative())return a.isNegative()?this.neg().mul(a.neg()):this.neg().mul(a).neg();if(a.isNegative())return this.mul(a.neg()).neg();if(this.lt(o)&&a.lt(o))return d(this.toNumber()*a.toNumber(),this.unsigned);var c=this.high>>>16,f=65535&this.high,h=this.low>>>16,i=65535&this.low,j=a.high>>>16,k=65535&a.high,l=a.low>>>16,m=65535&a.low,n=0,q=0,r=0,s=0;return s+=i*m,r+=s>>>16,s&=65535,r+=h*m,q+=r>>>16,r&=65535,r+=i*l,q+=r>>>16,r&=65535,q+=f*m,n+=q>>>16,q&=65535,q+=h*l,n+=q>>>16,q&=65535,q+=i*k,n+=q>>>16,q&=65535,n+=c*m+f*l+h*k+i*j,n&=65535,e(r<<16|s,n<<16|q,this.unsigned)},x.mul=x.multiply,x.divide=function(a){if(b(a)||(a=g(a)),a.isZero())throw Error("division by zero");if(this.isZero())return this.unsigned?q:p;var c,e,f;if(this.unsigned){if(a.unsigned||(a=a.toUnsigned()),a.gt(this))return q;if(a.gt(this.shru(1)))return s;f=q}else{if(this.eq(w)){if(a.eq(r)||a.eq(t))return w;if(a.eq(w))return r;var h=this.shr(1);return c=h.div(a).shl(1),c.eq(p)?a.isNegative()?r:t:(e=this.sub(a.mul(c)),f=c.add(e.div(a)))}if(a.eq(w))return this.unsigned?q:p;if(this.isNegative())return a.isNegative()?this.neg().div(a.neg()):this.neg().div(a).neg();if(a.isNegative())return this.div(a.neg()).neg();f=p}for(e=this;e.gte(a);){c=Math.max(1,Math.floor(e.toNumber()/a.toNumber()));for(var i=Math.ceil(Math.log(c)/Math.LN2),k=i<=48?1:j(2,i-48),l=d(c),m=l.mul(a);m.isNegative()||m.gt(e);)c-=k,l=d(c,this.unsigned),m=l.mul(a);l.isZero()&&(l=r),f=f.add(l),e=e.sub(m)}return f},x.div=x.divide,x.modulo=function(a){return b(a)||(a=g(a)),this.sub(this.div(a).mul(a))},x.mod=x.modulo,x.not=function(){return e(~this.low,~this.high,this.unsigned)},x.and=function(a){return b(a)||(a=g(a)),e(this.low&a.low,this.high&a.high,this.unsigned)},x.or=function(a){return b(a)||(a=g(a)),e(this.low|a.low,this.high|a.high,this.unsigned)},x.xor=function(a){return b(a)||(a=g(a)),e(this.low^a.low,this.high^a.high,this.unsigned)},x.shiftLeft=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:a<32?e(this.low<<a,this.high<<a|this.low>>>32-a,this.unsigned):e(0,this.low<<a-32,this.unsigned)},x.shl=x.shiftLeft,x.shiftRight=function(a){return b(a)&&(a=a.toInt()),0===(a&=63)?this:a<32?e(this.low>>>a|this.high<<32-a,this.high>>a,this.unsigned):e(this.high>>a-32,this.high>=0?0:-1,this.unsigned)},x.shr=x.shiftRight,x.shiftRightUnsigned=function(a){if(b(a)&&(a=a.toInt()),a&=63,0===a)return this;var c=this.high;if(a<32){var d=this.low;return e(d>>>a|c<<32-a,c>>>a,this.unsigned)}return 32===a?e(c,0,this.unsigned):e(c>>>a-32,0,this.unsigned)},x.shru=x.shiftRightUnsigned,x.toSigned=function(){return this.unsigned?e(this.low,this.high,!1):this},x.toUnsigned=function(){return this.unsigned?this:e(this.low,this.high,!0)},x.toBytes=function(a){return a?this.toBytesLE():this.toBytesBE()},x.toBytesLE=function(){var a=this.high,b=this.low;return[255&b,b>>>8&255,b>>>16&255,b>>>24&255,255&a,a>>>8&255,a>>>16&255,a>>>24&255]},x.toBytesBE=function(){var a=this.high,b=this.low;return[a>>>24&255,a>>>16&255,a>>>8&255,255&a,b>>>24&255,b>>>16&255,b>>>8&255,255&b]},a}),function(a,b){"use strict";"object"==typeof exports?(a.slip=exports,b(exports)):"function"==typeof define&&define.amd?define(["exports"],function(c){return a.slip=c,a.slip,b(c)}):(a.slip={},b(a.slip))}(this,function(a){"use strict";var b=a;b.END=192,b.ESC=219,b.ESC_END=220,b.ESC_ESC=221,b.byteArray=function(a,b,c){return a instanceof ArrayBuffer?new Uint8Array(a,b,c):a},b.expandByteArray=function(a){var b=new Uint8Array(2*a.length);return b.set(a),b},b.sliceByteArray=function(a,b,c){var d=a.buffer.slice?a.buffer.slice(b,c):a.subarray(b,c);return new Uint8Array(d)},b.encode=function(a,c){c=c||{},c.bufferPadding=c.bufferPadding||4,a=b.byteArray(a,c.offset,c.byteLength);var d=a.length+c.bufferPadding+3&-4,e=new Uint8Array(d),f=1;e[0]=b.END;for(var g=0;g<a.length;g++){f>e.length-3&&(e=b.expandByteArray(e));var h=a[g];h===b.END?(e[f++]=b.ESC,h=b.ESC_END):h===b.ESC&&(e[f++]=b.ESC,h=b.ESC_ESC),e[f++]=h}return e[f]=b.END,b.sliceByteArray(e,0,f+1)},b.Decoder=function(a){a="function"!=typeof a?a||{}:{onMessage:a},this.maxMessageSize=a.maxMessageSize||10485760,this.bufferSize=a.bufferSize||1024,this.msgBuffer=new Uint8Array(this.bufferSize),this.msgBufferIdx=0,this.onMessage=a.onMessage,this.onError=a.onError,this.escape=!1};var c=b.Decoder.prototype;return c.decode=function(a){a=b.byteArray(a);for(var c,d=0;d<a.length;d++){var e=a[d];if(this.escape)e===b.ESC_ESC?e=b.ESC:e===b.ESC_END&&(e=b.END);else{if(e===b.ESC){this.escape=!0;continue}if(e===b.END){c=this.handleEnd();continue}}var f=this.addByte(e);f||this.handleMessageMaxError()}return c},c.handleMessageMaxError=function(){this.onError&&this.onError(this.msgBuffer.subarray(0),"The message is too large; the maximum message size is "+this.maxMessageSize/1024+"KB. Use a larger maxMessageSize if necessary."),this.msgBufferIdx=0,this.escape=!1},c.addByte=function(a){return this.msgBufferIdx>this.msgBuffer.length-1&&(this.msgBuffer=b.expandByteArray(this.msgBuffer)),this.msgBuffer[this.msgBufferIdx++]=a,this.escape=!1,this.msgBuffer.length<this.maxMessageSize},c.handleEnd=function(){if(0!==this.msgBufferIdx){var a=b.sliceByteArray(this.msgBuffer,0,this.msgBufferIdx);return this.onMessage&&this.onMessage(a),this.msgBufferIdx=0,a}},b}),function(){"use strict";function a(){}function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1}function c(a){return function(){return this[a].apply(this,arguments)}}var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;b<a.length;b+=1)c.push(a[b].listener);return c},d.getListenersAsObject=function(a){var b,c=this.getListeners(a);return c instanceof Array&&(b={},b[a]=c),b||c},d.addListener=function(a,c){var d,e=this.getListenersAsObject(a),f="object"==typeof c;for(d in e)e.hasOwnProperty(d)&&b(e[d],c)===-1&&e[d].push(f?c:{listener:c,once:!1});return this},d.on=c("addListener"),d.addOnceListener=function(a,b){return this.addListener(a,{listener:b,once:!0})},d.once=c("addOnceListener"),d.defineEvent=function(a){return this.getListeners(a),this},d.defineEvents=function(a){for(var b=0;b<a.length;b+=1)this.defineEvent(a[b]);return this},d.removeListener=function(a,c){var d,e,f=this.getListenersAsObject(a);for(e in f)f.hasOwnProperty(e)&&(d=b(f[e],c),d!==-1&&f[e].splice(d,1));return this},d.off=c("removeListener"),d.addListeners=function(a,b){return this.manipulateListeners(!1,a,b)},d.removeListeners=function(a,b){return this.manipulateListeners(!0,a,b)},d.manipulateListeners=function(a,b,c){var d,e,f=a?this.removeListener:this.addListener,g=a?this.removeListeners:this.addListeners;if("object"!=typeof b||b instanceof RegExp)for(d=c.length;d--;)f.call(this,b,c[d]);else for(d in b)b.hasOwnProperty(d)&&(e=b[d])&&("function"==typeof e?f.call(this,d,e):g.call(this,d,e));return this},d.removeEvent=function(a){var b,c=typeof a,d=this._getEvents();if("string"===c)delete d[a];else if(a instanceof RegExp)for(b in d)d.hasOwnProperty(b)&&a.test(b)&&delete d[b];else delete this._events;return this},d.removeAllListeners=c("removeEvent"),d.emitEvent=function(a,b){var c,d,e,f,g,h=this.getListenersAsObject(a);for(f in h)if(h.hasOwnProperty(f))for(c=h[f].slice(0),e=0;e<c.length;e++)d=c[e],d.once===!0&&this.removeListener(a,d.listener),g=d.listener.apply(this,b||[]),g===this._getOnceReturnValue()&&this.removeListener(a,d.listener);return this},d.trigger=c("emitEvent"),d.emit=function(a){var b=Array.prototype.slice.call(arguments,1);return this.emitEvent(a,b)},d.setOnceReturnValue=function(a){return this._onceReturnValue=a,this},d._getOnceReturnValue=function(){return!this.hasOwnProperty("_onceReturnValue")||this._onceReturnValue},d._getEvents=function(){return this._events||(this._events={})},a.noConflict=function(){return e.EventEmitter=f,a},"function"==typeof define&&define.amd?define(function(){return a}):"object"==typeof module&&module.exports?module.exports=a:e.EventEmitter=a}.call(this);var osc=osc||require("./osc.js"),slip=slip||require("slip"),EventEmitter=EventEmitter||require("events").EventEmitter;!function(){"use strict";osc.firePacketEvents=function(a,b,c,d){b.address?a.emit("message",b,c,d):osc.fireBundleEvents(a,b,c,d)},osc.fireBundleEvents=function(a,b,c,d){a.emit("bundle",b,c,d);for(var e=0;e<b.packets.length;e++){var f=b.packets[e];osc.firePacketEvents(a,f,b.timeTag,d)}},osc.fireClosedPortSendError=function(a,b){b=b||"Can't send packets on a closed osc.Port object. Please open (or reopen) this Port by calling open().",a.emit("error",b)},osc.Port=function(a){this.options=a||{},this.on("data",this.decodeOSC.bind(this))};var a=osc.Port.prototype=Object.create(EventEmitter.prototype);a.constructor=osc.Port,a.send=function(a){var b=Array.prototype.slice.call(arguments),c=this.encodeOSC(a),d=osc.nativeBuffer(c);b[0]=d,this.sendRaw.apply(this,b)},a.encodeOSC=function(a){a=a.buffer?a.buffer:a;var b;try{b=osc.writePacket(a,this.options)}catch(c){this.emit("error",c)}return b},a.decodeOSC=function(a,b){a=osc.byteArray(a),this.emit("raw",a,b);try{var c=osc.readPacket(a,this.options);this.emit("osc",c,b),osc.firePacketEvents(this,c,void 0,b)}catch(d){this.emit("error",d)}},osc.SLIPPort=function(a){var b=this,c=this.options=a||{};c.useSLIP=void 0===c.useSLIP||c.useSLIP,this.decoder=new slip.Decoder({onMessage:this.decodeOSC.bind(this),onError:function(a){b.emit("error",a)}});var d=c.useSLIP?this.decodeSLIPData:this.decodeOSC;this.on("data",d.bind(this))},a=osc.SLIPPort.prototype=Object.create(osc.Port.prototype),a.constructor=osc.SLIPPort,a.encodeOSC=function(a){a=a.buffer?a.buffer:a;var b;try{var c=osc.writePacket(a,this.options);b=slip.encode(c)}catch(d){this.emit("error",d)}return b},a.decodeSLIPData=function(a,b){this.decoder.decode(a,b)},osc.relay=function(a,b,c,d,e,f){c=c||"message",d=d||"send",e=e||function(){},f=f?[null].concat(f):[];var g=function(a){f[0]=a,a=e(a),b[d].apply(b,f)};return a.on(c,g),{eventName:c,listener:g}},osc.relayPorts=function(a,b,c){var d=c.raw?"raw":"osc",e=c.raw?"sendRaw":"send";return osc.relay(a,b,d,e,c.transform)},osc.stopRelaying=function(a,b){a.removeListener(b.eventName,b.listener)},osc.Relay=function(a,b,c){var d=this.options=c||{};d.raw=!1,this.port1=a,this.port2=b,this.listen()},a=osc.Relay.prototype=Object.create(EventEmitter.prototype),a.constructor=osc.Relay,a.open=function(){this.port1.open(),this.port2.open()},a.listen=function(){this.port1Spec&&this.port2Spec&&this.close(),this.port1Spec=osc.relayPorts(this.port1,this.port2,this.options),this.port2Spec=osc.relayPorts(this.port2,this.port1,this.options);var a=this.close.bind(this);this.port1.on("close",a),this.port2.on("close",a)},a.close=function(){osc.stopRelaying(this.port1,this.port1Spec),osc.stopRelaying(this.port2,this.port2Spec),this.emit("close",this.port1,this.port2)},"undefined"!=typeof module&&module.exports&&(module.exports=osc)}();var osc=osc||require("../osc.js");!function(){"use strict";osc.WebSocket="undefined"!=typeof WebSocket?WebSocket:require("ws"),osc.WebSocketPort=function(a){osc.Port.call(this,a),this.on("open",this.listen.bind(this)),this.socket=a.socket,this.socket&&(1===this.socket.readyState?(osc.WebSocketPort.setupSocketForBinary(this.socket),this.emit("open",this.socket)):this.open())};var a=osc.WebSocketPort.prototype=Object.create(osc.Port.prototype);a.constructor=osc.WebSocketPort,a.open=function(){(!this.socket||this.socket.readyState>1)&&(this.socket=new osc.WebSocket(this.options.url)),osc.WebSocketPort.setupSocketForBinary(this.socket);var a=this;this.socket.onopen=function(){a.emit("open",a.socket)}},a.listen=function(){var a=this;this.socket.onmessage=function(b){a.emit("data",b.data,b)},this.socket.onerror=function(b){a.emit("error",b)},this.socket.onclose=function(b){a.emit("close",b)},a.emit("ready")},a.sendRaw=function(a){return this.socket&&1===this.socket.readyState?void this.socket.send(a):void osc.fireClosedPortSendError(this)},a.close=function(a,b){this.socket.close(a,b)},osc.WebSocketPort.setupSocketForBinary=function(a){a.binaryType=osc.isNode?"nodebuffer":"arraybuffer"}}();
\ No newline at end of file
var osc = require("osc"),
express = require("express"),
WebSocket = require("ws");
var cwd = process.cwd();
var getIPAddresses = function () {
var os = require("os"),
interfaces = os.networkInterfaces(),
ipAddresses = [];
for (var deviceName in interfaces) {
var addresses = interfaces[deviceName];
for (var i = 0; i < addresses.length; i++) {
var addressInfo = addresses[i];
if (addressInfo.family === "IPv4" && !addressInfo.internal) {
ipAddresses.push(addressInfo.address);
}
}
}
return ipAddresses;
};
// Bind to a UDP socket to listen for incoming OSC events.
var udpPort = new osc.UDPPort({
localAddress: "0.0.0.0",
localPort: 57121
});
udpPort.on("ready", function () {
var ipAddresses = getIPAddresses();
console.log("Listening for OSC over UDP.");
ipAddresses.forEach(function (address) {
console.log(" Host:", address + ", Port:", udpPort.options.localPort);
});
console.log("To start the demo, go to http://localhost:8081 in your web browser.");
});
udpPort.open();
// Create an Express-based Web Socket server to which OSC messages will be relayed.
// var appResources = __dirname + "/web",
var appResources = cwd + "/public",
app = express(),
server = app.listen(8081),
wss = new WebSocket.Server({
server: server
});
app.use("/", express.static(appResources));
wss.on("connection", function (socket) {
console.log("A Web Socket connection has been established!");
var socketPort = new osc.WebSocketPort({
socket: socket
});
var relay = new osc.Relay(udpPort, socketPort, {
raw: true
});
});
<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>
<canvas width="100%" height="100%"></canvas>
<script type="text/javascript">
(function() {
var AudioContext = window.AudioContext || window.webkitAudioContext;
var audioContext = new AudioContext();
var modOsc = audioContext.createOscillator();
var modFreq = audioContext.createConstantSource();
var modGain = audioContext.createGain();
var addOffset = audioContext.createChannelMerger();
var carOsc = audioContext.createOscillator();
var carGain = audioContext.createGain();
modOsc.frequency.value = 100;
modGain.gain.value = 1000;
carGain.gain.value = 0.5;
carOsc.frequency.value = 100;
modOsc.connect(modGain);
modGain.connect(carOsc.frequency);
carOsc.connect(carGain);
carGain.connect(audioContext.destination);
modOsc.start();
carOsc.start();
setInterval(function() {
carOsc.frequency.value = Math.random() * 100 + 1000;
modOsc.frequency.value = Math.random() * 20 + 1000;
// modOsc.frequency.value = carOsc.frequency.value * 2.321;
}, 120);
})();
</script>
</body>
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i;i="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,i.motionFeatures=t()}}(function(){return function t(i,e,n){function r(o,a){if(!e[o]){if(!i[o]){var c="function"==typeof require&&require;if(!a&&c)return c(o,!0);if(s)return s(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var u=e[o]={exports:{}};i[o][0].call(u.exports,function(t){var e=i[o][1][t];return r(e?e:t)},u,u.exports,t,i,e,n)}return e[o].exports}for(var s="function"==typeof require&&require,o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,i,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=t("./motion-features");Object.defineProperty(e,"MotionFeatures",{enumerable:!0,get:function(){return n(r).default}});var s=t("./zero-crossing-rate");Object.defineProperty(e,"ZeroCrossingRate",{enumerable:!0,get:function(){return n(s).default}})},{"./motion-features":2,"./zero-crossing-rate":3}],2:[function(t,i,e){(function(i){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function r(){return"undefined"==typeof window?function(){var t=i.hrtime();return t[0]+1e-9*t[1]}:"undefined"===window.performance?"undefined"===Date.now?function(){return new Date.getTime}:function(){return Date.now()}:function(){return window.performance.now()}}Object.defineProperty(e,"__esModule",{value:!0});var s=t("babel-runtime/core-js/get-iterator"),o=n(s),a=t("babel-runtime/core-js/object/assign"),c=n(a),h=t("babel-runtime/helpers/classCallCheck"),u=n(h),_=t("babel-runtime/helpers/createClass"),l=n(_),f=t("./zero-crossing-rate"),d=n(f),p=r(),y=function(){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,u.default)(this,t);var e={descriptors:["accRaw","gyrRaw","accIntensity","gyrIntensity","freefall","kick","shake","spin","still","gyrZcr","accZcr"],gyrIsInDegrees:!0,accIntensityParam1:.8,accIntensityParam2:.1,gyrIntensityParam1:.9,gyrIntensityParam2:1,freefallAccThresh:.15,freefallGyrThresh:750,freefallGyrDeltaThresh:40,kickThresh:.01,kickSpeedGate:200,kickMedianFiltersize:9,kickCallback:null,shakeThresh:.1,shakeWindowSize:200,shakeSlideFactor:10,spinThresh:200,stillThresh:5e3,stillSlideFactor:5,gyrZcrNoiseThresh:.01,gyrZcrFrameSize:100,gyrZcrHopSize:10,accZcrNoiseThresh:.01,accZcrFrameSize:100,accZcrHopSize:10};this._params=(0,c.default)({},e,i),this._methods={accRaw:this._updateAccRaw.bind(this),gyrRaw:this._updateGyrRaw.bind(this),accIntensity:this._updateAccIntensity.bind(this),gyrIntensity:this._updateGyrIntensity.bind(this),freefall:this._updateFreefall.bind(this),kick:this._updateKick.bind(this),shake:this._updateShake.bind(this),spin:this._updateSpin.bind(this),still:this._updateStill.bind(this),gyrZcr:this._updateGyrZcr.bind(this),accZcr:this._updateAccZcr.bind(this)},this._kickCallback=this._params.kickCallback,this.acc=[0,0,0],this.gyr=[0,0,0],this._accLast=[[0,0,0],[0,0,0],[0,0,0]],this._accIntensityLast=[[0,0],[0,0],[0,0]],this._accIntensity=[0,0,0],this._accIntensityNorm=0,this._accNorm=0,this._gyrDelta=[0,0,0],this._gyrNorm=0,this._gyrDeltaNorm=0,this._fallBegin=p(),this._fallEnd=p(),this._fallDuration=0,this._isFalling=!1,this._gyrLast=[[0,0,0],[0,0,0],[0,0,0]],this._gyrIntensityLast=[[0,0],[0,0],[0,0]],this._gyrIntensity=[0,0,0],this._gyrIntensityNorm=0,this._kickIntensity=0,this._lastKick=0,this._isKicking=!1,this._medianValues=[0,0,0,0,0,0,0,0,0],this._medianLinking=[3,4,1,5,7,8,0,2,6],this._medianFifo=[6,2,7,0,1,3,8,4,5],this._i1=0,this._i2=0,this._i3=0,this._accIntensityNormMedian=0,this._accDelta=[0,0,0],this._shakeWindow=[new Array(this._params.shakeWindowSize),new Array(this._params.shakeWindowSize),new Array(this._params.shakeWindowSize)];for(var n=0;n<3;n++)for(var r=0;r<this._params.shakeWindowSize;r++)this._shakeWindow[n][r]=0;this._shakeNb=[0,0,0],this._shakingRaw=0,this._shakeSlidePrev=0,this._shaking=0,this._spinBegin=p(),this._spinEnd=p(),this._spinDuration=0,this._isSpinning=!1,this._stillCrossProd=0,this._stillSlide=0,this._stillSlidePrev=0,this._isStill=!1,this._loopIndexPeriod=this._lcm(this._lcm(this._lcm(2,3),this._params.kickMedianFiltersize),this._params.shakeWindowSize),this._loopIndex=0;var s=this._params.descriptors.indexOf("gyrZcr")>-1,o=this._params.descriptors.indexOf("accZcr")>-1;s&&(this._gyrZcr=new d.default({noiseThreshold:this._params.gyrZcrNoiseThresh,frameSize:this._params.gyrZcrFrameSize,hopSize:this._params.gyrZcrHopSize})),o&&(this._accZcr=new d.default({noiseThreshold:this._params.accZcrNoiseThresh,frameSize:this._params.accZcrFrameSize,hopSize:this._params.accZcrHopSize}))}return(0,l.default)(t,[{key:"updateParams",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};for(var i in t)"descriptors"!==i&&(this._params[i]=t[i])}},{key:"setAccelerometer",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;this.acc[0]=t,this.acc[1]=i,this.acc[2]=e}},{key:"setGyroscope",value:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(this.gyr[0]=t,this.gyr[1]=i,this.gyr[2]=e,this._params.gyrIsInDegrees)for(var n=0;n<3;n++)this.gyr[n]*=2*Math.PI/360}},{key:"update",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;this._elapsedTime=p(),this._accNorm=this._magnitude3D(this.acc),this._gyrNorm=this._magnitude3D(this.gyr);var i=null,e=null;try{e={};var n=!0,r=!1,s=void 0;try{for(var a,c=(0,o.default)(this._params.descriptors);!(n=(a=c.next()).done);n=!0){var h=a.value;this._methods[h]&&this._methods[h](e)}}catch(t){r=!0,s=t}finally{try{!n&&c.return&&c.return()}finally{if(r)throw s}}}catch(t){i=t}return this._loopIndex=(this._loopIndex+1)%this._loopIndexPeriod,t&&t(i,e),e}},{key:"_updateAccRaw",value:function(t){t.accRaw={x:this.acc[0],y:this.acc[1],z:this.acc[2]}}},{key:"_updateGyrRaw",value:function(t){t.gyrRaw={x:this.gyr[0],y:this.gyr[1],z:this.gyr[2]}}},{key:"_updateAccIntensity",value:function(t){this._accIntensityNorm=0;for(var i=0;i<3;i++)this._accLast[i][this._loopIndex%3]=this.acc[i],this._accIntensity[i]=this._intensity1D(this.acc[i],this._accLast[i][(this._loopIndex+1)%3],this._accIntensityLast[i][(this._loopIndex+1)%2],this._params.accIntensityParam1,this._params.accIntensityParam2,1),this._accIntensityLast[i][this._loopIndex%2]=this._accIntensity[i],this._accIntensityNorm+=this._accIntensity[i];t.accIntensity={norm:this._accIntensityNorm,x:this._accIntensity[0],y:this._accIntensity[1],z:this._accIntensity[2]}}},{key:"_updateGyrIntensity",value:function(t){this._gyrIntensityNorm=0;for(var i=0;i<3;i++)this._gyrLast[i][this._loopIndex%3]=this.gyr[i],this._gyrIntensity[i]=this._intensity1D(this.gyr[i],this._gyrLast[i][(this._loopIndex+1)%3],this._gyrIntensityLast[i][(this._loopIndex+1)%2],this._params.gyrIntensityParam1,this._params.gyrIntensityParam2,1),this._gyrIntensityLast[i][this._loopIndex%2]=this._gyrIntensity[i],this._gyrIntensityNorm+=this._gyrIntensity[i];t.gyrIntensity={norm:this._gyrIntensityNorm,x:this._gyrIntensity[0],y:this._gyrIntensity[1],z:this._gyrIntensity[2]}}},{key:"_updateFreefall",value:function(t){for(var i=0;i<3;i++)this._gyrDelta[i]=this._delta(this._gyrLast[i][(this._loopIndex+1)%3],this.gyr[i],1);this._gyrDeltaNorm=this._magnitude3D(this._gyrDelta),this._accNorm<this._params.freefallAccThresh||this._gyrNorm>this._params.freefallGyrThresh&&this._gyrDeltaNorm<this._params.freefallGyrDeltaThresh?(this._isFalling||(this._isFalling=!0,this._fallBegin=p()),this._fallEnd=p()):this._isFalling&&(this._isFalling=!1),this._fallDuration=this._fallEnd-this._fallBegin,t.freefall={accNorm:this._accNorm,falling:this._isFalling,duration:this._fallDuration}}},{key:"_updateKick",value:function(t){if(this._i3=this._loopIndex%this._params.kickMedianFiltersize,this._i1=this._medianFifo[this._i3],this._i2=1,this._i1<this._params.kickMedianFiltersize-1&&this._accIntensityNorm>this._medianValues[this._i1+this._i2]){for(;this._i1+this._i2<this.kickMedianFiltersize&&this._accIntensityNorm>this._medianValues[this._i1+this._i2];)this._medianFifo[this._medianLinking[this._i1+this._i2]]=this._medianFifo[this._medianLinking[this._i1+this._i2]]-1,this._medianValues[this._i1+this._i2-1]=this._medianValues[this._i1+this._i2],this._medianLinking[this._i1+this._i2-1]=this._medianLinking[this._i1+this._i2],this._i2++;this._medianValues[this._i1+this._i2-1]=this._accIntensityNorm,this._medianLinking[this._i1+this._i2-1]=this._i3,this._medianFifo[this._i3]=this._i1+this._i2-1}else{for(;this._i2<this._i1+1&&this._accIntensityNorm<this._medianValues[this._i1-this._i2];)this._medianFifo[this._medianLinking[this._i1-this._i2]]=this._medianFifo[this._medianLinking[this._i1-this._i2]]+1,this._medianValues[this._i1-this._i2+1]=this._medianValues[this._i1-this._i2],this._medianLinking[this._i1-this._i2+1]=this._medianLinking[this._i1-this._i2],this._i2++;this._medianValues[this._i1-this._i2+1]=this._accIntensityNorm,this._medianLinking[this._i1-this._i2+1]=this._i3,this._medianFifo[this._i3]=this._i1-this._i2+1}this._accIntensityNorm-this._accIntensityNormMedian>this._params.kickThresh?this._isKicking?(this._kickIntensity<this._accIntensityNorm&&(this._kickIntensity=this._accIntensityNorm),this._kickCallback&&this._kickCallback({state:"middle",intensity:this._kickIntensity})):(this._isKicking=!0,this._kickIntensity=this._accIntensityNorm,this._lastKick=this._elapsedTime,this._kickCallback&&this._kickCallback({state:"start",intensity:this._kickIntensity})):this._elapsedTime-this._lastKick>this._params.kickSpeedGate&&(this._isKicking&&this._kickCallback&&this._kickCallback({state:"stop",intensity:this._kickIntensity}),this._isKicking=!1),this._accIntensityNormMedian=this._medianValues[Math.ceil(.5*this._params.kickMedianFiltersize)],t.kick={intensity:this._kickIntensity,kicking:this._isKicking}}},{key:"_updateShake",value:function(t){for(var i=0;i<3;i++)this._accDelta[i]=this._delta(this._accLast[i][(this._loopIndex+1)%3],this.acc[i],1);for(var e=0;e<3;e++)this._shakeWindow[e][this._loopIndex%this._params.shakeWindowSize]&&this._shakeNb[e]--,this._accDelta[e]>this._params.shakeThresh?(this._shakeWindow[e][this._loopIndex%this._params.shakeWindowSize]=1,this._shakeNb[e]++):this._shakeWindow[e][this._loopIndex%this._params.shakeWindowSize]=0;this._shakingRaw=this._magnitude3D(this._shakeNb)/this._params.shakeWindowSize,this._shakeSlidePrev=this._shaking,this._shaking=this._slide(this._shakeSlidePrev,this._shakingRaw,this._params.shakeSlideFactor),t.shake={shaking:this._shaking}}},{key:"_updateSpin",value:function(t){this._gyrNorm>this._params.spinThresh?(this._isSpinning||(this._isSpinning=!0,this._spinBegin=p()),this._spinEnd=p()):this._isSpinning&&(this._isSpinning=!1),this._spinDuration=this._spinEnd-this._spinBegin,t.spin={spinning:this._isSpinning,duration:this._spinDuration,gyrNorm:this._gyrNorm}}},{key:"_updateStill",value:function(t){this._stillCrossProd=this._stillCrossProduct(this.gyr),this._stillSlidePrev=this._stillSlide,this._stillSlide=this._slide(this._stillSlidePrev,this._stillCrossProd,this._params.stillSlideFactor),this._stillSlide>this._params.stillThresh?this._isStill=!1:this._isStill=!0,t.still={still:this._isStill,slide:this._stillSlide}}},{key:"_updateGyrZcr",value:function(t){var i=this._gyrZcr.process(this._gyrNorm);t.gyrZcr={amplitude:i.amplitude,frequency:i.frequency,periodicity:i.periodicity}}},{key:"_updateAccZcr",value:function(t){this._accZcr.process(this._accNorm);t.accZcr={amplitude:accZcr.amplitude,frequency:accZcr.frequency,periodicity:accZcr.periodicity}}},{key:"_delta",value:function(t,i,e){return(i-t)/(2*e)}},{key:"_intensity1D",value:function(t,i,e,n,r,s){var o=this._delta(t,i,s);return r*o*o+n*e}},{key:"_magnitude3D",value:function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2])}},{key:"_lcm",value:function(t,i){for(var e=t,n=i;e!=n;)e<n?e+=t:n+=i;return e}},{key:"_slide",value:function(t,i,e){return t+(i-t)/e}},{key:"_stillCrossProduct",value:function(t){return(t[1]-t[2])*(t[1]-t[2])+(t[0]-t[1])*(t[0]-t[1])+(t[2]-t[0])*(t[2]-t[0])}}]),t}();e.default=y}).call(this,t("_process"))},{"./zero-crossing-rate":3,_process:68,"babel-runtime/core-js/get-iterator":4,"babel-runtime/core-js/object/assign":5,"babel-runtime/helpers/classCallCheck":7,"babel-runtime/helpers/createClass":8}],3:[function(t,i,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0});var r=t("babel-runtime/core-js/object/assign"),s=n(r),o=t("babel-runtime/helpers/classCallCheck"),a=n(o),c=t("babel-runtime/helpers/createClass"),h=n(c),u={noiseThreshold:.1,frameSize:50,hopSize:5},_=function(){function t(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,a.default)(this,t),(0,s.default)(i,u),this.mean=0,this.magnitude=0,this.stdDev=0,this.crossings=[],this.periodMean=0,this.periodStdDev=0,this.inputFrame=[],this.setConfig(i)}return(0,h.default)(t,[{key:"setConfig",value:function(t){t.noiseThreshold&&(this.noiseThreshold=t.noiseThreshold),t.frameSize&&(this.frameSize=t.frameSize),t.hopSize&&(this.hopSize=t.hopSize),this.inputBuffer=new Array(this.frameSize);for(var i=0;i<this.frameSize;i++)this.inputBuffer[i]=0;this.hopCounter=0,this.bufferIndex=0,this.results={amplitude:0,frequency:0,periodicity:0}}},{key:"process",value:function(t){return this.inputBuffer[this.bufferIndex]=t,this.bufferIndex=(this.bufferIndex+1)%this.frameSize,this.hopCounter===this.hopSize-1?(this.hopCounter=0,this.processFrame(this.inputBuffer,this.bufferIndex)):this.hopCounter++,this.results}},{key:"processFrame",value:function(t){arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return this.inputFrame=t,this._mainAlgorithm(),this.amplitude=2*this.stdDev,this.frequency=this.crossings.length/(this.inputFrame.length-1),this.crossings.length>2?this.periodicity=1-Math.sqrt(this.periodStdDev/this.inputFrame.length):this.periodicity=0,this.results.amplitude=this.amplitude,this.results.frequency=this.frequency,this.results.periodicity=this.periodicity,this.results}},{key:"_mainAlgorithm",value:function(){var t=void 0,i=void 0;t=i=this.inputFrame[0],this.mean=0,this.magnitude=0;for(var e in this.inputFrame){var n=this.inputFrame[e];this.magnitude+=n*n,this.mean+=n,n>i?i=n:n<t&&(t=n)}this.mean=t+.5*(i-t),this.magnitude/=this.inputFrame.length,this.magnitude=Math.sqrt(this.magnitude),this.crossings=[],this.stdDev=0;for(var r=this.inputFrame[0]-this.mean,s=1;s<this.inputFrame.length;s++){var o=this.inputFrame[s]-this.mean;this.stdDev+=o*o,r>this.noiseThreshold&&o<this.noiseThreshold?this.crossings.push(s):r<this.noiseThreshold&&o>this.noiseThreshold&&this.crossings.push(s),r=o}this.stdDev/=this.inputFrame.length-1,this.stdDev=Math.sqrt(this.stdDev),this.periodMean=0;for(var a=1;a<this.crossings.length;a++)this.periodMean+=this.crossings[a]-this.crossings[a-1];this.periodMean/=this.crossings.length-1,this.periodStdDev=0;for(var c=1;c<this.crossings.length;c++){var h=this.crossings[c]-this.crossings[c-1]-this.periodMean;this.periodStdDev+=h*h}this.crossings.length>2&&(this.periodStdDev=Math.sqrt(this.periodStdDev/(this.crossings.length-2)))}}]),t}();e.default=_},{"babel-runtime/core-js/object/assign":5,"babel-runtime/helpers/classCallCheck":7,"babel-runtime/helpers/createClass":8}],4:[function(t,i,e){i.exports={default:t("core-js/library/fn/get-iterator"),__esModule:!0}},{"core-js/library/fn/get-iterator":9}],5:[function(t,i,e){i.exports={default:t("core-js/library/fn/object/assign"),__esModule:!0}},{"core-js/library/fn/object/assign":10}],6:[function(t,i,e){i.exports={default:t("core-js/library/fn/object/define-property"),__esModule:!0}},{"core-js/library/fn/object/define-property":11}],7:[function(t,i,e){"use strict";e.__esModule=!0,e.default=function(t,i){if(!(t instanceof i))throw new TypeError("Cannot call a class as a function")}},{}],8:[function(t,i,e){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var r=t("../core-js/object/define-property"),s=n(r);e.default=function(){function t(t,i){for(var e=0;e<i.length;e++){var n=i[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),(0,s.default)(t,n.key,n)}}return function(i,e,n){return e&&t(i.prototype,e),n&&t(i,n),i}}()},{"../core-js/object/define-property":6}],9:[function(t,i,e){t("../modules/web.dom.iterable"),t("../modules/es6.string.iterator"),i.exports=t("../modules/core.get-iterator")},{"../modules/core.get-iterator":62,"../modules/es6.string.iterator":66,"../modules/web.dom.iterable":67}],10:[function(t,i,e){t("../../modules/es6.object.assign"),i.exports=t("../../modules/_core").Object.assign},{"../../modules/_core":18,"../../modules/es6.object.assign":64}],11:[function(t,i,e){t("../../modules/es6.object.define-property");var n=t("../../modules/_core").Object;i.exports=function(t,i,e){return n.defineProperty(t,i,e)}},{"../../modules/_core":18,"../../modules/es6.object.define-property":65}],12:[function(t,i,e){i.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},{}],13:[function(t,i,e){i.exports=function(){}},{}],14:[function(t,i,e){var n=t("./_is-object");i.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},{"./_is-object":32}],15:[function(t,i,e){var n=t("./_to-iobject"),r=t("./_to-length"),s=t("./_to-index");i.exports=function(t){return function(i,e,o){var a,c=n(i),h=r(c.length),u=s(o,h);if(t&&e!=e){for(;h>u;)if(a=c[u++],a!=a)return!0}else for(;h>u;u++)if((t||u in c)&&c[u]===e)return t||u||0;return!t&&-1}}},{"./_to-index":53,"./_to-iobject":55,"./_to-length":56}],16:[function(t,i,e){var n=t("./_cof"),r=t("./_wks")("toStringTag"),s="Arguments"==n(function(){return arguments}()),o=function(t,i){try{return t[i]}catch(t){}};i.exports=function(t){var i,e,a;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=o(i=Object(t),r))?e:s?n(i):"Object"==(a=n(i))&&"function"==typeof i.callee?"Arguments":a}},{"./_cof":17,"./_wks":60}],17:[function(t,i,e){var n={}.toString;i.exports=function(t){return n.call(t).slice(8,-1)}},{}],18:[function(t,i,e){var n=i.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)},{}],19:[function(t,i,e){var n=t("./_a-function");i.exports=function(t,i,e){if(n(t),void 0===i)return t;switch(e){case 1:return function(e){return t.call(i,e)};case 2:return function(e,n){return t.call(i,e,n)};case 3:return function(e,n,r){return t.call(i,e,n,r)}}return function(){return t.apply(i,arguments)}}},{"./_a-function":12}],20:[function(t,i,e){i.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},{}],21:[function(t,i,e){i.exports=!t("./_fails")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},{"./_fails":25}],22:[function(t,i,e){var n=t("./_is-object"),r=t("./_global").document,s=n(r)&&n(r.createElement);i.exports=function(t){return s?r.createElement(t):{}}},{"./_global":26,"./_is-object":32}],23:[function(t,i,e){i.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},{}],24:[function(t,i,e){var n=t("./_global"),r=t("./_core"),s=t("./_ctx"),o=t("./_hide"),a="prototype",c=function(t,i,e){var h,u,_,l=t&c.F,f=t&c.G,d=t&c.S,p=t&c.P,y=t&c.B,m=t&c.W,g=f?r:r[i]||(r[i]={}),b=g[a],v=f?n:d?n[i]:(n[i]||{})[a];f&&(e=i);for(h in e)u=!l&&v&&void 0!==v[h],u&&h in g||(_=u?v[h]:e[h],g[h]=f&&"function"!=typeof v[h]?e[h]:y&&u?s(_,n):m&&v[h]==_?function(t){var i=function(i,e,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(i);case 2:return new t(i,e)}return new t(i,e,n)}return t.apply(this,arguments)};return i[a]=t[a],i}(_):p&&"function"==typeof _?s(Function.call,_):_,p&&((g.virtual||(g.virtual={}))[h]=_,t&c.R&&b&&!b[h]&&o(b,h,_)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,i.exports=c},{"./_core":18,"./_ctx":19,"./_global":26,"./_hide":28}],25:[function(t,i,e){i.exports=function(t){try{return!!t()}catch(t){return!0}}},{}],26:[function(t,i,e){var n=i.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},{}],27:[function(t,i,e){var n={}.hasOwnProperty;i.exports=function(t,i){return n.call(t,i)}},{}],28:[function(t,i,e){var n=t("./_object-dp"),r=t("./_property-desc");i.exports=t("./_descriptors")?function(t,i,e){return n.f(t,i,r(1,e))}:function(t,i,e){return t[i]=e,t}},{"./_descriptors":21,"./_object-dp":40,"./_property-desc":47}],29:[function(t,i,e){i.exports=t("./_global").document&&document.documentElement},{"./_global":26}],30:[function(t,i,e){i.exports=!t("./_descriptors")&&!t("./_fails")(function(){return 7!=Object.defineProperty(t("./_dom-create")("div"),"a",{get:function(){return 7}}).a})},{"./_descriptors":21,"./_dom-create":22,"./_fails":25}],31:[function(t,i,e){var n=t("./_cof");i.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==n(t)?t.split(""):Object(t)}},{"./_cof":17}],32:[function(t,i,e){i.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},{}],33:[function(t,i,e){"use strict";var n=t("./_object-create"),r=t("./_property-desc"),s=t("./_set-to-string-tag"),o={};t("./_hide")(o,t("./_wks")("iterator"),function(){return this}),i.exports=function(t,i,e){t.prototype=n(o,{next:r(1,e)}),s(t,i+" Iterator")}},{"./_hide":28,"./_object-create":39,"./_property-desc":47,"./_set-to-string-tag":49,"./_wks":60}],34:[function(t,i,e){"use strict";var n=t("./_library"),r=t("./_export"),s=t("./_redefine"),o=t("./_hide"),a=t("./_has"),c=t("./_iterators"),h=t("./_iter-create"),u=t("./_set-to-string-tag"),_=t("./_object-gpo"),l=t("./_wks")("iterator"),f=!([].keys&&"next"in[].keys()),d="@@iterator",p="keys",y="values",m=function(){return this};i.exports=function(t,i,e,g,b,v,k){h(e,i,g);var j,w,x,I=function(t){if(!f&&t in N)return N[t];switch(t){case p:return function(){return new e(this,t)};case y:return function(){return new e(this,t)}}return function(){return new e(this,t)}},S=i+" Iterator",T=b==y,F=!1,N=t.prototype,z=N[l]||N[d]||b&&N[b],O=z||I(b),M=b?T?I("entries"):O:void 0,D="Array"==i?N.entries||z:z;if(D&&(x=_(D.call(new t)),x!==Object.prototype&&(u(x,S,!0),n||a(x,l)||o(x,l,m))),T&&z&&z.name!==y&&(F=!0,O=function(){return z.call(this)}),n&&!k||!f&&!F&&N[l]||o(N,l,O),c[i]=O,c[S]=m,b)if(j={values:T?O:I(y),keys:v?O:I(p),entries:M},k)for(w in j)w in N||s(N,w,j[w]);else r(r.P+r.F*(f||F),i,j);return j}},{"./_export":24,"./_has":27,"./_hide":28,"./_iter-create":33,"./_iterators":36,"./_library":37,"./_object-gpo":43,"./_redefine":48,"./_set-to-string-tag":49,"./_wks":60}],35:[function(t,i,e){i.exports=function(t,i){return{value:i,done:!!t}}},{}],36:[function(t,i,e){i.exports={}},{}],37:[function(t,i,e){i.exports=!0},{}],38:[function(t,i,e){"use strict";var n=t("./_object-keys"),r=t("./_object-gops"),s=t("./_object-pie"),o=t("./_to-object"),a=t("./_iobject"),c=Object.assign;i.exports=!c||t("./_fails")(function(){var t={},i={},e=Symbol(),n="abcdefghijklmnopqrst";return t[e]=7,n.split("").forEach(function(t){i[t]=t}),7!=c({},t)[e]||Object.keys(c({},i)).join("")!=n})?function(t,i){for(var e=o(t),c=arguments.length,h=1,u=r.f,_=s.f;c>h;)for(var l,f=a(arguments[h++]),d=u?n(f).concat(u(f)):n(f),p=d.length,y=0;p>y;)_.call(f,l=d[y++])&&(e[l]=f[l]);return e}:c},{"./_fails":25,"./_iobject":31,"./_object-gops":42,"./_object-keys":45,"./_object-pie":46,"./_to-object":57}],39:[function(t,i,e){var n=t("./_an-object"),r=t("./_object-dps"),s=t("./_enum-bug-keys"),o=t("./_shared-key")("IE_PROTO"),a=function(){},c="prototype",h=function(){var i,e=t("./_dom-create")("iframe"),n=s.length,r="<",o=">";for(e.style.display="none",t("./_html").appendChild(e),e.src="javascript:",i=e.contentWindow.document,i.open(),i.write(r+"script"+o+"document.F=Object"+r+"/script"+o),i.close(),h=i.F;n--;)delete h[c][s[n]];return h()};i.exports=Object.create||function(t,i){var e;return null!==t?(a[c]=n(t),e=new a,a[c]=null,e[o]=t):e=h(),void 0===i?e:r(e,i)}},{"./_an-object":14,"./_dom-create":22,"./_enum-bug-keys":23,"./_html":29,"./_object-dps":41,"./_shared-key":50}],40:[function(t,i,e){var n=t("./_an-object"),r=t("./_ie8-dom-define"),s=t("./_to-primitive"),o=Object.defineProperty;e.f=t("./_descriptors")?Object.defineProperty:function(t,i,e){if(n(t),i=s(i,!0),n(e),r)try{return o(t,i,e)}catch(t){}if("get"in e||"set"in e)throw TypeError("Accessors not supported!");return"value"in e&&(t[i]=e.value),t}},{"./_an-object":14,"./_descriptors":21,"./_ie8-dom-define":30,"./_to-primitive":58}],41:[function(t,i,e){var n=t("./_object-dp"),r=t("./_an-object"),s=t("./_object-keys");i.exports=t("./_descriptors")?Object.defineProperties:function(t,i){r(t);for(var e,o=s(i),a=o.length,c=0;a>c;)n.f(t,e=o[c++],i[e]);return t}},{"./_an-object":14,"./_descriptors":21,"./_object-dp":40,"./_object-keys":45}],42:[function(t,i,e){e.f=Object.getOwnPropertySymbols},{}],43:[function(t,i,e){var n=t("./_has"),r=t("./_to-object"),s=t("./_shared-key")("IE_PROTO"),o=Object.prototype;i.exports=Object.getPrototypeOf||function(t){return t=r(t),n(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?o:null}},{"./_has":27,"./_shared-key":50,"./_to-object":57}],44:[function(t,i,e){var n=t("./_has"),r=t("./_to-iobject"),s=t("./_array-includes")(!1),o=t("./_shared-key")("IE_PROTO");i.exports=function(t,i){var e,a=r(t),c=0,h=[];for(e in a)e!=o&&n(a,e)&&h.push(e);for(;i.length>c;)n(a,e=i[c++])&&(~s(h,e)||h.push(e));return h}},{"./_array-includes":15,"./_has":27,"./_shared-key":50,"./_to-iobject":55}],45:[function(t,i,e){var n=t("./_object-keys-internal"),r=t("./_enum-bug-keys");i.exports=Object.keys||function(t){return n(t,r)}},{"./_enum-bug-keys":23,"./_object-keys-internal":44}],46:[function(t,i,e){e.f={}.propertyIsEnumerable},{}],47:[function(t,i,e){i.exports=function(t,i){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:i}}},{}],48:[function(t,i,e){i.exports=t("./_hide")},{"./_hide":28}],49:[function(t,i,e){var n=t("./_object-dp").f,r=t("./_has"),s=t("./_wks")("toStringTag");i.exports=function(t,i,e){t&&!r(t=e?t:t.prototype,s)&&n(t,s,{configurable:!0,value:i})}},{"./_has":27,"./_object-dp":40,"./_wks":60}],50:[function(t,i,e){var n=t("./_shared")("keys"),r=t("./_uid");i.exports=function(t){return n[t]||(n[t]=r(t))}},{"./_shared":51,"./_uid":59}],51:[function(t,i,e){var n=t("./_global"),r="__core-js_shared__",s=n[r]||(n[r]={});i.exports=function(t){return s[t]||(s[t]={})}},{"./_global":26}],52:[function(t,i,e){var n=t("./_to-integer"),r=t("./_defined");i.exports=function(t){return function(i,e){var s,o,a=String(r(i)),c=n(e),h=a.length;return c<0||c>=h?t?"":void 0:(s=a.charCodeAt(c),s<55296||s>56319||c+1===h||(o=a.charCodeAt(c+1))<56320||o>57343?t?a.charAt(c):s:t?a.slice(c,c+2):(s-55296<<10)+(o-56320)+65536)}}},{"./_defined":20,"./_to-integer":54}],53:[function(t,i,e){var n=t("./_to-integer"),r=Math.max,s=Math.min;i.exports=function(t,i){return t=n(t),t<0?r(t+i,0):s(t,i)}},{"./_to-integer":54}],54:[function(t,i,e){var n=Math.ceil,r=Math.floor;i.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},{}],55:[function(t,i,e){var n=t("./_iobject"),r=t("./_defined");i.exports=function(t){return n(r(t))}},{"./_defined":20,"./_iobject":31}],56:[function(t,i,e){var n=t("./_to-integer"),r=Math.min;i.exports=function(t){return t>0?r(n(t),9007199254740991):0}},{"./_to-integer":54}],57:[function(t,i,e){var n=t("./_defined");i.exports=function(t){return Object(n(t))}},{"./_defined":20}],58:[function(t,i,e){var n=t("./_is-object");i.exports=function(t,i){if(!n(t))return t;var e,r;if(i&&"function"==typeof(e=t.toString)&&!n(r=e.call(t)))return r;if("function"==typeof(e=t.valueOf)&&!n(r=e.call(t)))return r;if(!i&&"function"==typeof(e=t.toString)&&!n(r=e.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},{"./_is-object":32}],59:[function(t,i,e){var n=0,r=Math.random();i.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},{}],60:[function(t,i,e){var n=t("./_shared")("wks"),r=t("./_uid"),s=t("./_global").Symbol,o="function"==typeof s,a=i.exports=function(t){return n[t]||(n[t]=o&&s[t]||(o?s:r)("Symbol."+t))};a.store=n},{"./_global":26,"./_shared":51,"./_uid":59}],61:[function(t,i,e){var n=t("./_classof"),r=t("./_wks")("iterator"),s=t("./_iterators");i.exports=t("./_core").getIteratorMethod=function(t){if(void 0!=t)return t[r]||t["@@iterator"]||s[n(t)]}},{"./_classof":16,"./_core":18,"./_iterators":36,"./_wks":60}],62:[function(t,i,e){var n=t("./_an-object"),r=t("./core.get-iterator-method");i.exports=t("./_core").getIterator=function(t){var i=r(t);if("function"!=typeof i)throw TypeError(t+" is not iterable!");return n(i.call(t))}},{"./_an-object":14,"./_core":18,"./core.get-iterator-method":61}],63:[function(t,i,e){"use strict";var n=t("./_add-to-unscopables"),r=t("./_iter-step"),s=t("./_iterators"),o=t("./_to-iobject");i.exports=t("./_iter-define")(Array,"Array",function(t,i){this._t=o(t),this._i=0,this._k=i},function(){var t=this._t,i=this._k,e=this._i++;return!t||e>=t.length?(this._t=void 0,r(1)):"keys"==i?r(0,e):"values"==i?r(0,t[e]):r(0,[e,t[e]])},"values"),s.Arguments=s.Array,n("keys"),n("values"),n("entries")},{"./_add-to-unscopables":13,"./_iter-define":34,"./_iter-step":35,"./_iterators":36,"./_to-iobject":55}],64:[function(t,i,e){var n=t("./_export");n(n.S+n.F,"Object",{assign:t("./_object-assign")})},{"./_export":24,"./_object-assign":38}],65:[function(t,i,e){var n=t("./_export");n(n.S+n.F*!t("./_descriptors"),"Object",{defineProperty:t("./_object-dp").f})},{"./_descriptors":21,"./_export":24,"./_object-dp":40}],66:[function(t,i,e){"use strict";var n=t("./_string-at")(!0);t("./_iter-define")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,i=this._t,e=this._i;return e>=i.length?{value:void 0,done:!0}:(t=n(i,e),this._i+=t.length,{value:t,done:!1})})},{"./_iter-define":34,"./_string-at":52}],67:[function(t,i,e){t("./es6.array.iterator");for(var n=t("./_global"),r=t("./_hide"),s=t("./_iterators"),o=t("./_wks")("toStringTag"),a=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],c=0;c<5;c++){var h=a[c],u=n[h],_=u&&u.prototype;_&&!_[o]&&r(_,o,h),s[h]=s.Array}},{"./_global":26,"./_hide":28,"./_iterators":36,"./_wks":60,"./es6.array.iterator":63}],68:[function(t,i,e){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function s(t){if(_===setTimeout)return setTimeout(t,0);if((_===n||!_)&&setTimeout)return _=setTimeout,setTimeout(t,0);try{return _(t,0)}catch(i){try{return _.call(null,t,0)}catch(i){return _.call(this,t,0)}}}function o(t){if(l===clearTimeout)return clearTimeout(t);if((l===r||!l)&&clearTimeout)return l=clearTimeout,clearTimeout(t);try{return l(t)}catch(i){try{return l.call(null,t)}catch(i){return l.call(this,t)}}}function a(){y&&d&&(y=!1,d.length?p=d.concat(p):m=-1,p.length&&c())}function c(){if(!y){var t=s(a);y=!0;for(var i=p.length;i;){for(d=p,p=[];++m<i;)d&&d[m].run();m=-1,i=p.length}d=null,y=!1,o(t)}}function h(t,i){this.fun=t,this.array=i}function u(){}var _,l,f=i.exports={};!function(){try{_="function"==typeof setTimeout?setTimeout:n}catch(t){_=n}try{l="function"==typeof clearTimeout?clearTimeout:r}catch(t){l=r}}();var d,p=[],y=!1,m=-1;f.nextTick=function(t){var i=new Array(arguments.length-1);if(arguments.length>1)for(var