diff --git a/README.md b/README.md
index 59e5dba..6b2fc18 100644
--- a/README.md
+++ b/README.md
@@ -42,6 +42,21 @@ board.on("ready", function() {
}.bind(this), 500);
});
```
+
+You can configure WebJack with a profile object (see [docs](https://github.com/publiclab/webjack#individual-profile-options)) by passing it as a constructor option:
+
+```js
+var board = new Firmata(new WebJackPort({
+ profile: {
+ baud : 1225,
+ freqLow : 4900,
+ freqHigh : 7350,
+ echoCancellation : false,
+ softmodem : true
+ }
+}));
+```
+
Also take a look at the demo site in the example folder.
### Sketches
diff --git a/dist/webjackport.js b/dist/webjackport.js
index ae3bd34..88d9cfa 100644
--- a/dist/webjackport.js
+++ b/dist/webjackport.js
@@ -10,7 +10,7 @@ var WebJack = require("webjack");
var Emitter = require("events").EventEmitter;
var priv = new Map();
-function WebJackPort() {
+function WebJackPort(options) {
Emitter.call(this);
@@ -37,7 +37,10 @@ function WebJackPort() {
}
};
- var connection = new WebJack.Connection({raw : true});
+ options = options || {};
+ options.profile = options.profile || {};
+ options.profile.raw = true;
+ var connection = new WebJack.Connection(options.profile);
state.flushTo(connection);
connection.listen(function(data) {
diff --git a/example/Demo.js b/example/Demo.js
index 8307c4f..0798d06 100644
--- a/example/Demo.js
+++ b/example/Demo.js
@@ -13,6 +13,10 @@ var CAPABILITY_QUERY = 0x6B;
var ANALOG_MAPPING_QUERY = 0x69;
var SAMPLING_INTERVAL = 0x7A;
+function setOptions(options) {
+ board = new Board(new WebJackPort(options), opts);
+}
+
$(document).ready(function($) {
var log = $('.webjack-log');
log.appends = function(text){
@@ -109,5 +113,8 @@ $(document).ready(function($) {
});
});
-module.exports = { board: board };
+module.exports = {
+ board: board,
+ setOptions: setOptions
+};
diff --git a/example/bundle.js b/example/bundle.js
index 940ce26..685eccd 100644
--- a/example/bundle.js
+++ b/example/bundle.js
@@ -1,9 +1,9 @@
-var Demo=function(t){function e(n){if(r[n])return r[n].exports;var i=r[n]={exports:{},id:n,loaded:!1};return t[n].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var r={};return e.m=t,e.c=r,e.p="",e(0)}([function(t,e,r){"use strict";var n=r(1),i=n.Board,o=r(56),a={reportVersionTimeout:2500,skipCapabilities:!0},s=new i(new o,a),u=107,c=105,l=122;$(document).ready(function(t){function e(){var t=s.firmware.name+"-"+s.firmware.version.major+"."+s.firmware.version.minor;console.log(t),r.appends("Firmware: "+t)}var r=t(".webjack-log");r.appends=function(t){this.append(t+"
"),this.scrollTop(this[0].scrollHeight)},s.sysexResponse(u,function(t){}),s.sysexResponse(c,function(t){}),s.sysexResponse(l,function(t){});var n=t("#digital")[0],i=t("#analog")[0];n.disabled=!0,i.disabled=!0,s.on("ready",function(){e(),r.appends("READY! Press 'Query Capabilities' to enable analogRead."),n.disabled=!1,s.queryAnalogMapping(function(t){i.disabled=!1})}),t("#capab").click(function(){s.queryCapabilities(function(){r.appends("Received capabilities."),s.queryAnalogMapping(function(t){r.appends("Received analog mapping. Ready to read."),i.disabled=!1})})}),t("#firmware").click(function(){s.queryFirmware(function(){e()})}),n.onclick=function(){if(s.isReady){var e=t("#pin").val(),r="0"==t("#state").val()?s.LOW:s.HIGH;console.log("digitalWrite("+e+","+r+")"),s.pinMode(e,s.MODES.OUTPUT),s.digitalWrite(e,r)}},i.onclick=function(){if(s.isReady){var e=t("#apin").val();console.log("analogRead("+e+")"),s.setSamplingInterval(200),s.analogRead(e,function(t){console.log("Received analog value: "+t),r.appends("Analog Pin "+e+": "+t)})}},t("#reset").click(function(){s.reset()})}),t.exports={board:s}},function(t,e,r){(function(e,n,i){function o(t,e,r){function n(){i.isReady=!0,i.emit("ready"),"function"==typeof r&&r()}if("function"!=typeof e&&"undefined"!=typeof e||(r=e,e={}),!(this instanceof o))return new o(t,e,r);u.call(this);var i=this,a={reportVersionTimeout:5e3,samplingInterval:19,serialport:{baudRate:57600,bufferSize:1}},s=Object.assign({},a,e);this.isReady=!1,this.MODES={INPUT:0,OUTPUT:1,ANALOG:2,PWM:3,SERVO:4,SHIFT:5,I2C:6,ONEWIRE:7,STEPPER:8,SERIAL:10,IGNORE:127,PING_READ:117,UNKOWN:16},this.I2C_MODES={WRITE:0,READ:1,CONTINUOUS_READ:2,STOP_READING:3},this.STEPPER={TYPE:{DRIVER:1,TWO_WIRE:2,FOUR_WIRE:4},RUNSTATE:{STOP:0,ACCEL:1,DECEL:2,RUN:3},DIRECTION:{CCW:0,CW:1}},this.SERIAL_MODES={CONTINUOUS_READ:0,STOP_READING:1},this.SERIAL_PORT_IDs={HW_SERIAL0:0,HW_SERIAL1:1,HW_SERIAL2:2,HW_SERIAL3:3,SW_SERIAL0:8,SW_SERIAL1:9,SW_SERIAL2:16,SW_SERIAL3:17,DEFAULT:8},this.SERIAL_PIN_TYPES={RES_RX0:0,RES_TX0:1,RES_RX1:2,RES_TX1:3,RES_RX2:4,RES_TX2:5,RES_RX3:6,RES_TX3:7},this.HIGH=1,this.LOW=0,this.pins=[],this.analogPins=[],this.version={},this.firmware={},this.currentBuffer=[],this.versionReceived=!1,this.name="Firmata",this.settings=s,"object"==typeof t?this.transport=t:this.transport=new f.SerialPort(t,s.serialport),this.sp=this.transport,this.transport.on("close",function(){this.emit("close")}.bind(this)),this.transport.on("disconnect",function(){this.emit("disconnect")}.bind(this)),this.transport.on("open",function(){this.emit("open"),this.emit("connect")}.bind(this)),this.transport.on("error",function(t){this.isReady||"function"!=typeof r?this.emit("error",t):r(t)}.bind(this)),this.transport.on("data",function(t){for(var e,r,n,i,o,a,s=0;s0?(r=this.currentBuffer[s],r>127&&(this.currentBuffer.length=0,this.currentBuffer.push(r))):i!==et&&(n=i=.13?14:n.IS_TEST_MODE?!function(){var t=new Error('Cannot find module "../test/MockSerialPort"');throw t.code="MODULE_NOT_FOUND",t}():15)}catch(t){}if(null==f)throw console.log("It looks like serialport didn't compile properly. This is a common problem and its fix is well documented here https://github.com/voodootikigod/node-serialport#to-install"),"Missing serialport dependency";var h=105,d=106,y=224,v=107,g=108,b=144,m=247,_=111,w=120,E=119,O=118,j=24,S=65,T=115,C=16,x=67,P=8,R=1,A=69,k=68,I=66,M=64,N=60,F=32,B=244,L=109,D=110,U=117,W=121,z=192,q=208,H=249,V=122,$=112,G=96,Y=16,X=32,Q=48,J=64,Z=80,K=96,tt=112,et=240,rt=114,nt=113,it=255,ot=128,at={};at[H]=function(t){t.version.major=t.currentBuffer[1],t.version.minor=t.currentBuffer[2],t.emit("reportversion")},at[y]=function(t){var e=t.currentBuffer[1]|t.currentBuffer[2]<<7,r=15&t.currentBuffer[0];t.pins[t.analogPins[r]]&&(t.pins[t.analogPins[r]].value=e),t.emit("analog-read-"+r,e),t.emit("analog-read",{pin:r,value:e})},at[b]=function(t){for(var e=15&t.currentBuffer[0],r=t.currentBuffer[1]|t.currentBuffer[2]<<7,n=0;n<8;n++){var i=8*e+n,o=t.pins[i];o&&o.mode===t.MODES.INPUT&&(o.value=r>>(7&n)&1,t.emit("digital-read-"+i,o.value),t.emit("digital-read",{pin:i,value:o.value}))}};var st={};st[W]=function(t){for(var e=t.currentBuffer.length-2,r=new i(Math.round((e-4)/2)),n=0,o=0,a=4;a6&&(t.pins[e].state|=t.currentBuffer[5]<<7),t.currentBuffer.length>7&&(t.pins[e].state|=t.currentBuffer[6]<<14),t.emit("pin-state-"+e)},st[d]=function(t){for(var e,r=0,n=2;n15?(r[0]=et,r[1]=_,r[2]=t,r[3]=127&e,r[4]=e>>7&127,e>16384&&(r[r.length]=e>>14&127),e>2097152&&(r[r.length]=e>>21&127),e>268435456&&(r[r.length]=e>>28&127),r[r.length]=m):r.push(y|t,127&e,e>>7&127),this.transport.write(new i(r))},o.prototype.pwmWrite=o.prototype.analogWrite,o.prototype.servoConfig=function(t,e,r){var n;if("object"==typeof t&&null!==t&&(n=t,t=n.pin,e=n.min,r=n.max),"undefined"==typeof t)throw new Error("servoConfig: pin must be specified");if("undefined"==typeof e)throw new Error("servoConfig: min must be specified");if("undefined"==typeof r)throw new Error("servoConfig: max must be specified");var o=[et,$,t,127&e,e>>7&127,127&r,r>>7&127,m];this.pins[t].mode=this.MODES.SERVO,this.transport.write(new i(o))},o.prototype.servoWrite=function(t,e){this.analogWrite.apply(this,arguments)},o.prototype.pinMode=function(t,e){this.pins[t].mode=e,this.transport.write(new i([B,t,e]))},o.prototype.digitalWrite=function(t,e){var r,n=Math.floor(t/8),o=0;this.pins[t].value=e;for(var a=0;a<8;a++)r=this.pins[8*n+a],r&&r.value&&(o|=1<>7&127]))},o.prototype.digitalRead=function(t,e){this.reportDigitalPin(t,1),this.addListener("digital-read-"+t,e)},o.prototype.queryCapabilities=function(t){this.once("capability-query",t),this.transport.write(new i([et,v,m]))},o.prototype.queryAnalogMapping=function(t){this.once("analog-mapping-query",t),this.transport.write(new i([et,h,m]))},o.prototype.queryPinState=function(t,e){this.once("pin-state-"+t,e),this.transport.write(new i([et,L,t,m]))},o.prototype.sendString=function(t){var e=new i(t+"\0","utf8"),r=[];r.push(et),r.push(nt);for(var n=0,o=e.length;n>7&127);r.push(m),this.transport.write(r)},o.prototype.sendI2CConfig=function(t){return this.i2cConfig(t)},o.prototype.i2cConfig=function(t){var e,r=p.get(this);return r||(r={},p.set(this,r)),"number"==typeof t?e=t:"object"==typeof t&&null!==t&&(e=Number(t.delay),"undefined"!=typeof t.address&&(r[t.address]||(r[t.address]={stopTX:!0}),t.settings,Object.assign(r[t.address],t.settings))),r.delay=e=e||0,a(this,[et,w,255&e,e>>8&255,m]),this},o.prototype.sendI2CWriteRequest=function(t,e){var r=[];e=e||[],r.push(et,O,t,this.I2C_MODES.WRITE<<3);for(var n=0,i=e.length;n>7&127);r.push(m),a(this,r)},o.prototype.i2cWrite=function(t,e,r){var n,o=[et,O,t,this.I2C_MODES.WRITE<<3];if(3===arguments.length&&!Array.isArray(e)&&!Array.isArray(r))return this.i2cWriteReg(t,e,r);2===arguments.length&&(Array.isArray(e)?(r=e.slice(),e=r.shift()):r=[]),n=new i([e].concat(r));for(var s=0,u=n.length;s>7&127);return o.push(m),a(this,o),this},o.prototype.i2cWriteReg=function(t,e,r){return a(this,[et,O,t,this.I2C_MODES.WRITE<<3,127&e,e>>7&127,127&r,r>>7&127,m]),this},o.prototype.sendI2CReadRequest=function(t,e,r){a(this,[et,O,t,this.I2C_MODES.READ<<3,127&e,e>>7&127,m]),this.once("I2C-reply-"+t+"-0",r)},o.prototype.i2cRead=function(t,e,r,n){3===arguments.length&&"number"==typeof e&&"function"==typeof r&&(n=r,r=e,e=null);var i="I2C-reply-"+t+"-",o=[et,O,t,this.I2C_MODES.CONTINUOUS_READ<<3];return null!==e?o.push(127&e,e>>7&127):e=0,i+=e,o.push(127&r,r>>7&127,m),this.on(i,n),a(this,o),this},o.prototype.i2cReadOnce=function(t,e,r,n){3===arguments.length&&"number"==typeof e&&"function"==typeof r&&(n=r,r=e,e=null);var i="I2C-reply-"+t+"-",o=[et,O,t,this.I2C_MODES.READ<<3];return null!==e?o.push(127&e,e>>7&127):e=0,i+=e,o.push(127&r,r>>7&127,m),this.once(i,n),a(this,o),this},o.prototype.sendOneWireConfig=function(t,e){this.transport.write(new i([et,T,S,t,e?1:0,m]))},o.prototype.sendOneWireSearch=function(t,e){this._sendOneWireSearch(M,"1-wire-search-reply-"+t,t,e)},o.prototype.sendOneWireAlarmsSearch=function(t,e){this._sendOneWireSearch(k,"1-wire-search-alarms-reply-"+t,t,e)},o.prototype._sendOneWireSearch=function(t,e,r,n){this.transport.write(new i([et,T,t,r,m]));var o=setTimeout(function(){n(new Error("1-Wire device search timeout - are you running ConfigurableFirmata?"))},5e3);this.once(e,function(t){clearTimeout(o),n(null,t)})},o.prototype.sendOneWireRead=function(t,e,r,n){var i=Math.floor(255*Math.random()),o=setTimeout(function(){n(new Error("1-Wire device read timeout - are you running ConfigurableFirmata?"))},5e3);this._sendOneWireRequest(t,P,e,r,i,null,null,"1-wire-read-reply-"+i,function(t){clearTimeout(o),n(null,t)})},o.prototype.sendOneWireReset=function(t){this._sendOneWireRequest(t,R)},o.prototype.sendOneWireWrite=function(t,e,r){this._sendOneWireRequest(t,F,e,null,null,null,Array.isArray(r)?r:[r])},o.prototype.sendOneWireDelay=function(t,e){this._sendOneWireRequest(t,C,null,null,null,e)},o.prototype.sendOneWireWriteAndRead=function(t,e,r,n,i){var o=Math.floor(255*Math.random()),a=setTimeout(function(){i(new Error("1-Wire device read timeout - are you running ConfigurableFirmata?"))},5e3);this._sendOneWireRequest(t,F|P,e,n,o,null,Array.isArray(r)?r:[r],"1-wire-read-reply-"+o,function(t){clearTimeout(a),i(null,t)})},o.prototype._sendOneWireRequest=function(t,e,r,n,o,a,s,u,l){var f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];(r||n||o||a||s)&&(e|=N),r&&f.splice.apply(f,[0,8].concat(r)),n&&(f[8]=255&n,f[9]=n>>8&255),o&&(f[10]=255&o,f[11]=o>>8&255),a&&(f[12]=255&a,f[13]=a>>8&255,f[14]=a>>16&255,f[15]=a>>24&255),s&&s.forEach(function(t){f.push(t)});var p=[et,T,e,t];p=p.concat(c.to7BitArray(f)),p.push(m),this.transport.write(new i(p)),u&&l&&this.once(u,l)},o.prototype.setSamplingInterval=function(t){var e=t<10?10:t>65535?65535:t;this.settings.samplingInterval=e,this.transport.write(new i([et,V,127&e,e>>7&127,m]))},o.prototype.getSamplingInterval=function(t){return this.settings.samplingInterval},o.prototype.reportAnalogPin=function(t,e){0!==e&&1!==e||(this.pins[this.analogPins[t]].report=e,this.transport.write(new i([z|t,e])))},o.prototype.reportDigitalPin=function(t,e){var r=Math.floor(t/8);0!==e&&1!==e||(this.pins[t].report=e,this.transport.write(new i([q|r,e])))},o.prototype.pingRead=function(t,e){if(this.pins[t.pin].supportedModes.indexOf(U)===-1)throw new Error("Please upload PingFirmata to the board");var r=t.pin,n=t.value,o=t.pulseOut||0,a=t.timeout||1e6,s=[o>>24&255,o>>16&255,o>>8&255,255&o],u=[a>>24&255,a>>16&255,a>>8&255,255&a],c=[et,U,r,n,127&s[0],s[0]>>7&127,127&s[1],s[1]>>7&127,127&s[2],s[2]>>7&127,127&s[3],s[3]>>7&127,127&u[0],u[0]>>7&127,127&u[1],u[1]>>7&127,127&u[2],u[2]>>7&127,127&u[3],u[3]>>7&127,m];this.transport.write(new i(c)),this.once("ping-read-"+r,e)},o.prototype.stepperConfig=function(t,e,r,n,o,a,s){var u=[et,rt,0,t,e,127&r,r>>7&127,n,o];e===this.STEPPER.TYPE.FOUR_WIRE&&u.push(a,s),u.push(m),this.transport.write(new i(u))},o.prototype.stepperStep=function(t,e,r,n,o,a,s){"function"==typeof o&&(s=o,o=0,a=0);var u=[et,rt,1,t,e,127&r,r>>7&127,r>>14&127,127&n,n>>7&127];(o>0||a>0)&&u.push(127&o,o>>7&127,127&a,a>>7&127),u.push(m),this.transport.write(new i(u)),this.once("stepper-done-"+t,s)},o.prototype.serialConfig=function(t){var e,r,n,o;if("object"==typeof t&&null!==t&&(e=t.portId,r=t.baud,n=t.rxPin,o=t.txPin),"undefined"==typeof e)throw new Error("portId must be specified, see SERIAL_PORT_IDs for options.");r=r||57600;var a=[et,G,Y|e,127&r,r>>7&127,r>>14&127];if(e>7&&"undefined"!=typeof n&&"undefined"!=typeof o)a.push(n),a.push(o);else if(e>7)throw new Error("Both RX and TX pins must be defined when using Software Serial.");a.push(m),this.transport.write(new i(a))},o.prototype.serialWrite=function(t,e){for(var r=[et,G,X|t],n=0,o=e.length;n>7&127);r.push(m),r.length>0&&this.transport.write(new i(r))},o.prototype.serialRead=function(t,e,r){var n=[et,G,Q|t,this.SERIAL_MODES.CONTINUOUS_READ];2===arguments.length&&"function"==typeof e?r=e:(n.push(127&e),n.push(e>>7&127)),n.push(m),this.transport.write(new i(n)),this.on("serial-data-"+t,r)},o.prototype.serialStop=function(t){var e=[et,G,Q|t,this.SERIAL_MODES.STOP_READING,m];this.transport.write(new i(e)),this.removeAllListeners("serial-data-"+t)},o.prototype.serialClose=function(t){var e=[et,G,Z|t,m];this.transport.write(new i(e))},o.prototype.serialFlush=function(t){var e=[et,G,K|t,m];this.transport.write(new i(e))},o.prototype.serialListen=function(t){if(!(t<8)){var e=[et,G,tt|t,m];this.transport.write(new i(e))}},o.prototype.sysexResponse=function(t,e){if(o.SYSEX_RESPONSE[t])throw new Error(t+" is not an available SYSEX_RESPONSE byte");return o.SYSEX_RESPONSE[t]=function(t){e(t.currentBuffer.slice(2,-1))},this},o.prototype.sysexCommand=function(t){if(!t.length)throw new Error("Sysex Command cannot be empty");var e=t.slice();return e.unshift(et),e.push(m),this.transport.write(new i(e)),this},o.prototype.reset=function(){this.transport.write(new i([it]))},o.isAcceptablePort=function(t){var e=/usb|acm|^com/i;return!!e.test(t.comName)},o.requestPort=function(t){f.list(function(e,r){var n=r.find(function(t){if(o.isAcceptablePort(t))return t});n?t(null,n):t(new Error("No Acceptable Port Found"),null)})},o.Board=o,o.SYSEX_RESPONSE=st,o.MIDI_RESPONSE=at,o.encode=function(t){for(var e=[],r=t.length,n=0;n>7&127);return e},o.decode=function(t){var e=[];if(t.length%2!==0)throw new Error("Board.decode(data) called with odd number of data bytes");for(;t.length;){var r=t.shift(),n=t.shift();e.push(r|n<<7)}return e},n.IS_TEST_MODE&&(o.test={i2cPeripheralSettings:function(t){return p.get(t)},get i2cActive(){return p}}),t.exports=o}).call(e,r(2),function(){return this}(),r(3).Buffer)},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function a(){y&&h&&(y=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!y){var t=i(a);y=!0;for(var e=d.length;e;){for(h=d,d=[];++v1)for(var r=1;r=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function v(e){return+e!=e&&(e=0),t.alloc(+e)}function g(e,r){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(i)return V(e).length;r=(""+r).toLowerCase(),i=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:w(e,r,n,i,o);if("number"==typeof r)return r&=255,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):w(e,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var c;if(i){var l=-1;for(c=r;cs&&(r=s-u),c=r;c>=0;c--){for(var f=!0,p=0;pi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,c,l,f;switch(s){case 1:o<128&&(a=o);break;case 2:u=t[i+1],128===(192&u)&&(f=(31&o)<<6|63&u,f>127&&(a=f));break;case 3:u=t[i+1],c=t[i+2],128===(192&u)&&128===(192&c)&&(f=(15&o)<<12|(63&u)<<6|63&c,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:u=t[i+1],c=t[i+2],l=t[i+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(f=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&l,f>65535&&f<1114112&&(a=f))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return R(n)}function R(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function F(e,r,n,i,o,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||re.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,i){return i||D(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function W(t,e,r,n,i){return i||D(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function z(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function $(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function Y(t){return J.toByteArray(z(t))}function X(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Q(t){return t!==t}var J=r(4),Z=r(5),K=r(6);e.Buffer=t,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=o(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,r){return s(null,t,e,r)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,r){return c(null,t,e,r)},t.allocUnsafe=function(t){return l(null,t)},t.allocUnsafeSlow=function(t){return l(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),
-this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e,r,n,i,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,s=n-r,u=Math.min(a,s),c=this.slice(i,o),l=e.slice(r,n),f=0;fi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return O(this,t,e,r);case"ascii":return j(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(i*=256);)n+=this[t+--e]*i;return n},t.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},t.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),Z.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),Z.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),Z.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),Z.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;F(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+o]=t/a&255;return e+r},t.prototype.writeUInt8=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):B(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):B(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):L(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):L(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);F(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},t.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);F(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},t.prototype.writeInt8=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):B(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):B(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):L(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):L(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return W(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return W(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--o)e[o+r]=this[o+n];else if(a<1e3||!t.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=r;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-r(t)}function i(t){var e,n,i,o,a,s,u=t.length;a=r(t),s=new l(3*u/4-a),i=a>0?u-4:u;var f=0;for(e=0,n=0;e>16&255,s[f++]=o>>8&255,s[f++]=255&o;return 2===a?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[f++]=255&o):1===a&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[f++]=o>>8&255,s[f++]=255&o),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,r){for(var n,i=[],a=e;al?l:c+s));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=n,e.toByteArray=i,e.fromByteArray=s;for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,h=f.length;p>1,l=-7,f=r?i-1:0,p=r?-1:1,h=t[e+f];for(f+=p,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:(h?-1:1)*(1/0);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?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?p/u:p*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[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n,i;(function(o,a){!function(o,a){n=a,i="function"==typeof n?n.call(e,r,e,t):n,!(void 0!==i&&(t.exports=i))}(this,function(){"use strict";var t,e=Function.call.bind(Function.apply),r=Function.call.bind(Function.call),n=Array.isArray,i=function(t){return function(){return!e(t,this,arguments)}},s=function(t){try{return t(),!1}catch(t){return!0}},u=function(t){try{return t()}catch(t){return!1}},c=i(s),l=function(){return!s(function(){Object.defineProperty({},"x",{get:function(){}})})},f=!!Object.defineProperty&&l(),p="foo"===function(){}.name,h=Function.call.bind(Array.prototype.forEach),d=Function.call.bind(Array.prototype.reduce),y=Function.call.bind(Array.prototype.filter),v=Function.call.bind(Array.prototype.some),g=function(t,e,r,n){!n&&e in t||(f?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:!0,value:r}):t[e]=r)},b=function(t,e){h(Object.keys(e),function(r){var n=e[r];g(t,r,n,!1)})},m=Object.create||function(t,e){var r=function(){};r.prototype=t;var n=new r;return"undefined"!=typeof e&&Object.keys(e).forEach(function(t){Q.defineByDescriptor(n,t,e[t])}),n},_=function(t,e){return!!Object.setPrototypeOf&&u(function(){var r=function e(r){var n=new t(r);return Object.setPrototypeOf(n,e.prototype),n};return Object.setPrototypeOf(r,t),r.prototype=m(t.prototype,{constructor:{value:r}}),e(r)})},w=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof o)return o;throw new Error("unable to locate global object")},E=w(),O=E.isFinite,j=Function.call.bind(String.prototype.indexOf),S=Function.call.bind(Object.prototype.toString),T=Function.call.bind(Array.prototype.concat),C=Function.call.bind(String.prototype.slice),x=Function.call.bind(Array.prototype.push),P=Function.apply.bind(Array.prototype.push),R=Function.call.bind(Array.prototype.shift),A=Math.max,k=Math.min,I=Math.floor,M=Math.abs,N=Math.log,F=Math.sqrt,B=Function.call.bind(Object.prototype.hasOwnProperty),L=function(){},D=E.Symbol||{},U=D.species||"@@species",W=Number.isNaN||function(t){return t!==t},z=Number.isFinite||function(t){return"number"==typeof t&&O(t)},q=function(t){return"[object Arguments]"===S(t)},H=function(t){return null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==S(t)&&"[object Function]"===S(t.callee)},V=q(arguments)?q:H,$={primitive:function(t){return null===t||"function"!=typeof t&&"object"!=typeof t},object:function(t){return null!==t&&"object"==typeof t},string:function(t){return"[object String]"===S(t)},regex:function(t){return"[object RegExp]"===S(t)},symbol:function(t){return"function"==typeof E.Symbol&&"symbol"==typeof t}},G=$.symbol(D.iterator)?D.iterator:"_es6-shim iterator_";E.Set&&"function"==typeof(new E.Set)["@@iterator"]&&(G="@@iterator"),E.Reflect||g(E,"Reflect",{});var Y=E.Reflect,X={Call:function(t,r){var n=arguments.length>2?arguments[2]:[];if(!X.IsCallable(t))throw new TypeError(t+" is not a function");return e(t,r,n)},RequireObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t)},TypeIsObject:function(t){return null!=t&&Object(t)===t},ToObject:function(t,e){return X.RequireObjectCoercible(t,e),Object(t)},IsCallable:function(t){return"function"==typeof t&&"[object Function]"===S(t)},IsConstructor:function(t){return X.IsCallable(t)},ToInt32:function(t){return X.ToNumber(t)>>0},ToUint32:function(t){return X.ToNumber(t)>>>0},ToNumber:function(t){if("[object Symbol]"===S(t))throw new TypeError("Cannot convert a Symbol value to a number");return+t},ToInteger:function(t){var e=X.ToNumber(t);return W(e)?0:0!==e&&z(e)?(e>0?1:-1)*I(M(e)):e},ToLength:function(t){var e=X.ToInteger(t);return e<=0?0:e>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e},SameValue:function(t,e){return t===e?0!==t||1/t===1/e:W(t)&&W(e)},SameValueZero:function(t,e){return t===e||W(t)&&W(e)},IsIterable:function(t){return X.TypeIsObject(t)&&("undefined"!=typeof t[G]||V(t))},GetIterator:function(e){if(V(e))return new t(e,"value");var n=X.GetMethod(e,G);if(!X.IsCallable(n))throw new TypeError("value is not an iterable");var i=r(n,e);if(!X.TypeIsObject(i))throw new TypeError("bad iterator");return i},GetMethod:function(t,e){var r=X.ToObject(t)[e];if(void 0!==r&&null!==r){if(!X.IsCallable(r))throw new TypeError("Method not callable: "+e);return r}},IteratorComplete:function(t){return!!t.done},IteratorClose:function(t,e){var n=X.GetMethod(t,"return");if(void 0!==n){var i,o;try{i=r(n,t)}catch(t){o=t}if(!e){if(o)throw o;if(!X.TypeIsObject(i))throw new TypeError("Iterator's return method returned a non-object.")}}},IteratorNext:function(t){var e=arguments.length>1?t.next(arguments[1]):t.next();if(!X.TypeIsObject(e))throw new TypeError("bad iterator");return e},IteratorStep:function(t){var e=X.IteratorNext(t),r=X.IteratorComplete(e);return!r&&e},Construct:function(t,e,r,n){var i="undefined"==typeof r?t:r;if(!n)return Y.construct(t,e,i);var o=i.prototype;X.TypeIsObject(o)||(o=Object.prototype);var a=m(o),s=X.Call(t,a,e);return X.TypeIsObject(s)?s:a},SpeciesConstructor:function(t,e){var r=t.constructor;if(void 0===r)return e;if(!X.TypeIsObject(r))throw new TypeError("Bad constructor");var n=r[U];if(void 0===n||null===n)return e;if(!X.IsConstructor(n))throw new TypeError("Bad @@species");return n},CreateHTML:function(t,e,r,n){var i=String(t),o="<"+e;if(""!==r){var a=String(n),s=a.replace(/"/g,""");o+=" "+r+'="'+s+'"'}var u=o+">",c=u+i;return c+""+e+">"}},Q={getter:function(t,e,r){if(!f)throw new TypeError("getters require true ES5 support");Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get:r})},proxy:function(t,e,r){if(!f)throw new TypeError("getters require true ES5 support");var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,{configurable:n.configurable,enumerable:n.enumerable,get:function(){return t[e]},set:function(r){t[e]=r}})},redefine:function(t,e,r){if(f){var n=Object.getOwnPropertyDescriptor(t,e);n.value=r,Object.defineProperty(t,e,n)}else t[e]=r},defineByDescriptor:function(t,e,r){f?Object.defineProperty(t,e,r):"value"in r&&(t[e]=r.value)},preserveToString:function(t,e){e&&X.IsCallable(e.toString)&&g(t,"toString",e.toString.bind(e),!0)}},J=function(t,e,r){Q.preserveToString(e,t),Object.setPrototypeOf&&Object.setPrototypeOf(t,e),f?h(Object.getOwnPropertyNames(t),function(n){n in L||r[n]||Q.proxy(t,n,e)}):h(Object.keys(t),function(n){n in L||r[n]||(e[n]=t[n])}),e.prototype=t.prototype,Q.redefine(t.prototype,"constructor",e)},Z=function(){return this},K=function(t){f&&!B(t,U)&&Q.getter(t,U,Z)},tt=function(t,e,r){var n=t[e];g(t,e,r,!0),Q.preserveToString(t[e],n)},et=function(t,e){var r=e||function(){return this};g(t,G,r),!t[G]&&$.symbol(G)&&(t[G]=r)},rt=function(t,e,r){f?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r},nt=function(t,e,r){if(rt(t,e,r),!X.SameValue(t[e],r))throw new TypeError("property is nonconfigurable")},it=function(t,e,r,n){if(!X.TypeIsObject(t))throw new TypeError("Constructor requires `new`: "+e.name);var i=e.prototype;X.TypeIsObject(i)||(i=r);var o=m(i);for(var a in n)if(B(n,a)){var s=n[a];g(o,a,s,!0)}return o};if(String.fromCodePoint&&1!==String.fromCodePoint.length){var ot=String.fromCodePoint;tt(String,"fromCodePoint",function(t){return e(ot,this,arguments)})}var at={fromCodePoint:function(t){for(var e,r=[],n=0,i=arguments.length;n1114111)throw new RangeError("Invalid code point "+e);e<65536?x(r,String.fromCharCode(e)):(e-=65536,x(r,String.fromCharCode((e>>10)+55296)),x(r,String.fromCharCode(e%1024+56320)))}return r.join("")},raw:function(t){var e=X.ToObject(t,"bad callSite"),r=X.ToObject(e.raw,"bad raw value"),n=r.length,i=X.ToLength(n);if(i<=0)return"";for(var o,a,s,u,c=[],l=0;l=i));)a=l+1=ut)throw new RangeError("repeat count must be less than infinity and not overflow maximum string size");return st(e,r)},startsWith:function(t){X.RequireObjectCoercible(this);var e=String(this);if($.regex(t))throw new TypeError('Cannot call method "startsWith" with a regex');var r=String(t),n=arguments.length>1?arguments[1]:void 0,i=A(X.ToInteger(n),0);return C(e,i,i+r.length)===r},endsWith:function(t){X.RequireObjectCoercible(this);var e=String(this);if($.regex(t))throw new TypeError('Cannot call method "endsWith" with a regex');var r=String(t),n=e.length,i=arguments.length>1?arguments[1]:void 0,o="undefined"==typeof i?n:X.ToInteger(i),a=k(A(o,0),n);return C(e,a-r.length,a)===r},includes:function(t){if($.regex(t))throw new TypeError('"includes" does not accept a RegExp');var e;return arguments.length>1&&(e=arguments[1]),j(this,t,e)!==-1},codePointAt:function(t){X.RequireObjectCoercible(this);var e=String(this),r=X.ToInteger(t),n=e.length;if(r>=0&&r56319||o)return i;var a=e.charCodeAt(r+1);return a<56320||a>57343?i:1024*(i-55296)+(a-56320)+65536}}};if(String.prototype.includes&&"a".includes("a",1/0)!==!1&&tt(String.prototype,"includes",ct.includes),String.prototype.startsWith&&String.prototype.endsWith){var lt=s(function(){"/a/".startsWith(/a/)}),ft="abc".startsWith("a",1/0)===!1;lt&&ft||(tt(String.prototype,"startsWith",ct.startsWith),tt(String.prototype,"endsWith",ct.endsWith))}b(String.prototype,ct);var pt=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),ht=new RegExp("(^["+pt+"]+)|(["+pt+"]+$)","g"),dt=function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(ht,"")},yt=["
","",""].join(""),vt=new RegExp("["+yt+"]","g"),gt=/^[\-+]0x[0-9a-f]+$/i,bt=yt.trim().length!==yt.length;g(String.prototype,"trim",dt,bt);var mt=function(t){X.RequireObjectCoercible(t),this._s=String(t),this._i=0};mt.prototype.next=function(){var t=this._s,e=this._i;if("undefined"==typeof t||e>=t.length)return this._s=void 0,{value:void 0,done:!0};var r,n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===t.length?n=1:(r=t.charCodeAt(e+1),n=r<56320||r>57343?1:2),this._i=e+n,{value:t.substr(e,n),done:!1}},et(mt.prototype),et(String.prototype,function(){return new mt(this)});var _t={from:function(t){var e,n,i=this,o=arguments.length>1?arguments[1]:void 0;if(void 0===o)e=!1;else{if(!X.IsCallable(o))throw new TypeError("Array.from: when provided, the second argument must be a function");n=arguments.length>2?arguments[2]:void 0,e=!0}var a,s,u,c="undefined"!=typeof(V(t)||X.GetMethod(t,G));if(c){s=X.IsConstructor(i)?Object(new i):[];var l,f,p=X.GetIterator(t);for(u=0;;){if(l=X.IteratorStep(p),l===!1)break;f=l.value;try{e&&(f=void 0===n?o(f,u):r(o,n,f,u)),s[u]=f}catch(t){throw X.IteratorClose(p,!0),t}u+=1}a=u}else{var h=X.ToObject(t);a=X.ToLength(h.length),s=X.IsConstructor(i)?Object(new i(a)):new Array(a);var d;for(u=0;u0;)if(t=R(e),t in this.object)return wt("key"===this.kind?t:"value"===this.kind?this.object[t]:[t,this.object[t]]);return wt()}}),et(Ot.prototype);var jt=Array.of===_t.of||function(){var t=function(t){this.length=t};t.prototype=[];var e=Array.of.apply(t,[1,2]);return e instanceof t&&2===e.length}();jt||tt(Array,"of",_t.of);var St={copyWithin:function(t,e){var r=arguments[2],n=X.ToObject(this),i=X.ToLength(n.length),o=X.ToInteger(t),a=X.ToInteger(e),s=o<0?A(i+o,0):k(o,i),u=a<0?A(i+a,0):k(a,i);r="undefined"==typeof r?i:X.ToInteger(r);var c=r<0?A(i+r,0):k(r,i),l=k(c-u,i-s),f=1;for(u0;)B(n,u)?n[s]=n[u]:delete n[u],u+=f,s+=f,l-=1;return n},fill:function(t){var e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=X.ToObject(this),i=X.ToLength(n.length);e=X.ToInteger("undefined"==typeof e?0:e),r=X.ToInteger("undefined"==typeof r?i:r);for(var o=e<0?A(i+e,0):k(e,i),a=r<0?i+r:r,s=o;s1?arguments[1]:null,a=0;a1?arguments[1]:null,o=0;o0&&"undefined"!=typeof arguments[1]?e(Rt,this,arguments):r(Rt,this,t)})}var At=function(t,e){var n={length:-1};return n[e?4294967294:0]=!0,u(function(){r(t,n,function(){throw new RangeError("should not reach here")},[])})};if(!At(Array.prototype.forEach)){var kt=Array.prototype.forEach;tt(Array.prototype,"forEach",function(t){return e(kt,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.map)){var It=Array.prototype.map;tt(Array.prototype,"map",function(t){return e(It,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.filter)){var Mt=Array.prototype.filter;tt(Array.prototype,"filter",function(t){return e(Mt,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.some)){var Nt=Array.prototype.some;tt(Array.prototype,"some",function(t){return e(Nt,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.every)){var Ft=Array.prototype.every;tt(Array.prototype,"every",function(t){return e(Ft,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.reduce)){var Bt=Array.prototype.reduce;tt(Array.prototype,"reduce",function(t){return e(Bt,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.reduceRight,!0)){var Lt=Array.prototype.reduceRight;tt(Array.prototype,"reduceRight",function(t){return e(Lt,this.length>=0?this:[],arguments)},!0)}var Dt=8!==Number("0o10"),Ut=2!==Number("0b10"),Wt=v(yt,function(t){return 0===Number(t+0+t)});if(Dt||Ut||Wt){var zt=Number,qt=/^0b[01]+$/i,Ht=/^0o[0-7]+$/i,Vt=qt.test.bind(qt),$t=Ht.test.bind(Ht),Gt=function(t){var e;if("function"==typeof t.valueOf&&(e=t.valueOf(),$.primitive(e)))return e;if("function"==typeof t.toString&&(e=t.toString(),$.primitive(e)))return e;throw new TypeError("No default value")},Yt=vt.test.bind(vt),Xt=gt.test.bind(gt),Qt=function(){var t=function(e){var n;n=arguments.length>0?$.primitive(e)?e:Gt(e,"number"):0,"string"==typeof n&&(n=r(dt,n),Vt(n)?n=parseInt(C(n,2),2):$t(n)?n=parseInt(C(n,2),8):(Yt(n)||Xt(n))&&(n=NaN));var i=this,o=u(function(){return zt.prototype.valueOf.call(i),!0});return i instanceof t&&!o?new zt(n):zt(n)};return t}();J(zt,Qt,{}),Number=Qt,Q.redefine(E,"Number",Qt)}var Jt=Math.pow(2,53)-1;b(Number,{MAX_SAFE_INTEGER:Jt,MIN_SAFE_INTEGER:-Jt,EPSILON:2.220446049250313e-16,parseInt:E.parseInt,parseFloat:E.parseFloat,isFinite:z,isInteger:function(t){return z(t)&&X.ToInteger(t)===t},isSafeInteger:function(t){return Number.isInteger(t)&&M(t)<=Number.MAX_SAFE_INTEGER},isNaN:W}),g(Number,"parseInt",E.parseInt,Number.parseInt!==E.parseInt),[,1].find(function(t,e){return 0===e})||tt(Array.prototype,"find",St.find),0!==[,1].findIndex(function(t,e){return 0===e})&&tt(Array.prototype,"findIndex",St.findIndex);var Zt=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable),Kt=function(){for(var t=Number(this),e=arguments.length,r=e-t,n=new Array(r<0?0:r),i=t;i1?NaN:e===-1?-(1/0):1===e?1/0:0===e?e:.5*N((1+e)/(1-e))},cbrt:function(t){var e=Number(t);if(0===e)return e;var r,n=e<0;return n&&(e=-e),e===1/0?r=1/0:(r=Math.exp(N(e)/3),r=(e/(r*r)+2*r)/3),n?-r:r},clz32:function(t){var e=Number(t),n=X.ToUint32(e);return 0===n?32:Be?r(Be,n):31-I(N(n+.5)*Math.LOG2E)},cosh:function(t){var e=Number(t);return 0===e?1:Number.isNaN(e)?NaN:O(e)?(e<0&&(e=-e),e>21?Math.exp(e)/2:(Math.exp(e)+Math.exp(-e))/2):1/0},expm1:function(t){var e=Number(t);if(e===-(1/0))return-1;if(!O(e)||0===e)return e;if(M(e)>.5)return Math.exp(e)-1;for(var r=e,n=0,i=1;n+r!==n;)n+=r,i+=1,r*=e/i;return n},hypot:function(t,e){for(var r=0,n=0,i=0;i0?o/n*(o/n):o}return n===1/0?1/0:n*F(r)},log2:function(t){return N(t)*Math.LOG2E},log10:function(t){return N(t)*Math.LOG10E},log1p:function(t){var e=Number(t);return e<-1||Number.isNaN(e)?NaN:0===e||e===1/0?e:e===-1?-(1/0):1+e-1===0?e:e*(N(1+e)/(1+e-1))},sign:function(t){var e=Number(t);return 0===e?e:Number.isNaN(e)?e:e<0?-1:1},sinh:function(t){var e=Number(t);return O(e)&&0!==e?M(e)<1?(Math.expm1(e)-Math.expm1(-e))/2:(Math.exp(e-1)-Math.exp(-e-1))*Math.E/2:e},tanh:function(t){var e=Number(t);if(Number.isNaN(e)||0===e)return e;if(e===1/0)return 1;if(e===-(1/0))return-1;var r=Math.expm1(e),n=Math.expm1(-e);return r===1/0?1:n===1/0?-1:(r-n)/(Math.exp(e)+Math.exp(-e))},trunc:function(t){var e=Number(t);return e<0?-I(-e):I(e)},imul:function(t,e){var r=X.ToUint32(t),n=X.ToUint32(e),i=r>>>16&65535,o=65535&r,a=n>>>16&65535,s=65535&n;return o*s+(i*s+o*a<<16>>>0)|0},fround:function(t){var e=Number(t);if(0===e||e===1/0||e===-(1/0)||W(e))return e;var r=Math.sign(e),n=M(e);if(nNe||W(o)?r*(1/0):r*o}};b(Math,Le),g(Math,"log1p",Le.log1p,Math.log1p(-1e-17)!==-1e-17),g(Math,"asinh",Le.asinh,Math.asinh(-1e7)!==-Math.asinh(1e7)),g(Math,"tanh",Le.tanh,Math.tanh(-2e-17)!==-2e-17),g(Math,"acosh",Le.acosh,Math.acosh(Number.MAX_VALUE)===1/0),g(Math,"cbrt",Le.cbrt,Math.abs(1-Math.cbrt(1e-300)/1e-100)/Number.EPSILON>8),g(Math,"sinh",Le.sinh,Math.sinh(-2e-17)!==-2e-17);var De=Math.expm1(10);g(Math,"expm1",Le.expm1,De>22025.465794806718||De<22025.465794806718);var Ue=Math.round,We=0===Math.round(.5-Number.EPSILON/4)&&1===Math.round(-.5+Number.EPSILON/3.99),ze=ke+1,qe=2*ke-1,He=[ze,qe].every(function(t){return Math.round(t)===t});g(Math,"round",function(t){var e=I(t),r=e===-1?-0:e+1;return t-e<.5?e:r},!We||!He),Q.preserveToString(Math.round,Ue);var Ve=Math.imul;Math.imul(4294967295,5)!==-5&&(Math.imul=Le.imul,Q.preserveToString(Math.imul,Ve)),2!==Math.imul.length&&tt(Math,"imul",function(t,r){return e(Ve,Math,arguments)});var $e=function(){var t=E.setTimeout;if("function"==typeof t||"object"==typeof t){X.IsPromise=function(t){return!!X.TypeIsObject(t)&&"undefined"!=typeof t._promise};var e,n=function(t){if(!X.IsConstructor(t))throw new TypeError("Bad promise constructor");var e=this,r=function(t,r){if(void 0!==e.resolve||void 0!==e.reject)throw new TypeError("Bad Promise implementation!");e.resolve=t,e.reject=r};if(e.promise=new t(r),!X.IsCallable(e.resolve)||!X.IsCallable(e.reject))throw new TypeError("Bad promise constructor")};"undefined"!=typeof window&&X.IsCallable(window.postMessage)&&(e=function(){var t=[],e="zero-timeout-message",r=function(r){x(t,r),window.postMessage(e,"*")},n=function(r){if(r.source===window&&r.data===e){if(r.stopPropagation(),0===t.length)return;var n=R(t);n()}};return window.addEventListener("message",n,!0),r});var i,o=function(){var t=E.Promise;return t&&t.resolve&&function(e){return t.resolve().then(e)}},s=X.IsCallable(E.setImmediate)?E.setImmediate.bind(E):"object"==typeof a&&a.nextTick?a.nextTick:o()||(X.IsCallable(e)?e():function(e){t(e,0)}),u=1,c=2,l=3,f=4,p=5,d=function(t,e){var r,n,i=t.capabilities,o=t.handler,a=!1;if(o===u)r=e;else if(o===c)r=e,a=!0;else try{r=o(e)}catch(t){r=t,a=!0}(n=a?i.reject:i.resolve)(r)},y=function(t,e){h(t,function(t){s(function(){d(t,e)})})},v=function(t,e){var r=t._promise,n=r.fulfillReactions;r.result=e,r.fulfillReactions=void 0,r.rejectReactions=void 0,r.state=f,y(n,e)},g=function(t,e){var r=t._promise,n=r.rejectReactions;r.result=e,r.fulfillReactions=void 0,r.rejectReactions=void 0,r.state=p,y(n,e)},m=function(t){var e=!1,r=function(r){var n;if(!e){if(e=!0,r===t)return g(t,new TypeError("Self resolution"));if(!X.TypeIsObject(r))return v(t,r);try{n=r.then}catch(e){return g(t,e)}return X.IsCallable(n)?void s(function(){_(t,r,n)}):v(t,r)}},n=function(r){if(!e)return e=!0,g(t,r)};return{resolve:r,reject:n}},_=function(t,e,n){var i=m(t),o=i.resolve,a=i.reject;try{r(n,e,o,a)}catch(t){a(t)}},w=function(t){if(!X.TypeIsObject(t))throw new TypeError("Promise is not object");var e=t[U];return void 0!==e&&null!==e?e:t},O=function(){var t=function(e){if(!(this instanceof t))throw new TypeError('Constructor Promise requires "new"');if(this&&this._promise)throw new TypeError("Bad construction");if(!X.IsCallable(e))throw new TypeError("not a valid resolver");var r=it(this,t,i,{_promise:{result:void 0,state:l,fulfillReactions:[],rejectReactions:[]}}),n=m(r),o=n.reject;try{e(n.resolve,o)}catch(t){o(t)}return r};return t}();i=O.prototype;var j=function(t,e,r,n){var i=!1;return function(o){if(!i&&(i=!0,e[t]=o,0===--n.count)){var a=r.resolve;a(e)}}},S=function(t,e,r){for(var n,i,o=t.iterator,a=[],s={count:1},u=0;;){try{if(n=X.IteratorStep(o),n===!1){t.done=!0;break}i=n.value}catch(e){throw t.done=!0,e}a[u]=void 0;var c=e.resolve(i),l=j(u,a,r,s);s.count+=1,c.then(l,r.reject),u+=1}if(0===--s.count){var f=r.resolve;f(a)}return r.promise},T=function(t,e,r){for(var n,i,o,a=t.iterator;;){try{if(n=X.IteratorStep(a),n===!1){t.done=!0;break}i=n.value}catch(e){throw t.done=!0,e}o=e.resolve(i),o.then(r.resolve,r.reject)}return r.promise};return b(O,{all:function(t){var e,r,i=w(this),o=new n(i);try{return e=X.GetIterator(t),r={iterator:e,done:!1},S(r,i,o)}catch(t){var a=t;if(r&&!r.done)try{X.IteratorClose(e,!0)}catch(t){a=t}var s=o.reject;return s(a),o.promise}},race:function(t){var e,r,i=w(this),o=new n(i);try{return e=X.GetIterator(t),r={iterator:e,done:!1},T(r,i,o)}catch(t){var a=t;if(r&&!r.done)try{X.IteratorClose(e,!0)}catch(t){a=t}var s=o.reject;return s(a),o.promise}},reject:function(t){var e=this,r=new n(e),i=r.reject;return i(t),r.promise},resolve:function(t){var e=this;if(X.IsPromise(t)){var r=t.constructor;if(r===e)return t}var i=new n(e),o=i.resolve;return o(t),i.promise}}),b(i,{catch:function(t){return this.then(void 0,t)},then:function(t,e){var r=this;if(!X.IsPromise(r))throw new TypeError("not a promise");var i,o=X.SpeciesConstructor(r,O),a=new n(o),h={capabilities:a,handler:X.IsCallable(t)?t:u},y={capabilities:a,handler:X.IsCallable(e)?e:c},v=r._promise;if(v.state===l)x(v.fulfillReactions,h),x(v.rejectReactions,y);else if(v.state===f)i=v.result,s(function(){d(h,i)});else{if(v.state!==p)throw new TypeError("unexpected Promise state");i=v.result,s(function(){d(y,i)})}return a.promise}}),O}}();if(E.Promise&&(delete E.Promise.accept,delete E.Promise.defer,delete E.Promise.prototype.chain),"function"==typeof $e){b(E,{Promise:$e});var Ge=_(E.Promise,function(t){return t.resolve(42).then(function(){})instanceof t}),Ye=!s(function(){E.Promise.reject(42).then(null,5).then(null,L)}),Xe=s(function(){E.Promise.call(3,L)}),Qe=function(t){var e=t.resolve(5);e.constructor={};var r=t.resolve(e);return e===r}(E.Promise);Ge&&Ye&&Xe&&!Qe||(Promise=$e,tt(E,"Promise",$e)),K(Promise)}var Je=function(t){var e=Object.keys(d(t,function(t,e){return t[e]=!0,t},{}));return t.join(":")===e.join(":")},Ze=Je(["z","a","bb"]),Ke=Je(["z",1,"a","3",2]);if(f){var tr=function(t){if(!Ze)return null;var e=typeof t;return"undefined"===e||null===t?"^"+String(t):"string"===e?"$"+t:"number"===e?Ke?t:"n"+t:"boolean"===e?"b"+t:null},er=function(){return Object.create?Object.create(null):{}},rr=function(t,e,i){if(n(i)||$.string(i))h(i,function(t){e.set(t[0],t[1])});else if(i instanceof t)r(t.prototype.forEach,i,function(t,r){e.set(r,t)});else{var o,a;if(null!==i&&"undefined"!=typeof i){if(a=e.set,!X.IsCallable(a))throw new TypeError("bad map");o=X.GetIterator(i)}if("undefined"!=typeof o)for(;;){var s=X.IteratorStep(o);if(s===!1)break;var u=s.value;try{if(!X.TypeIsObject(u))throw new TypeError("expected iterable of pairs");r(a,e,u[0],u[1])}catch(t){throw X.IteratorClose(o,!0),t}}}},nr=function(t,e,i){if(n(i)||$.string(i))h(i,function(t){e.add(t)});else if(i instanceof t)r(t.prototype.forEach,i,function(t){e.add(t)});else{var o,a;if(null!==i&&"undefined"!=typeof i){if(a=e.add,!X.IsCallable(a))throw new TypeError("bad set");o=X.GetIterator(i)}if("undefined"!=typeof o)for(;;){var s=X.IteratorStep(o);if(s===!1)break;var u=s.value;try{r(a,e,u)}catch(t){throw X.IteratorClose(o,!0),t}}}},ir={Map:function(){var t={},e=function(t,e){this.key=t,this.value=e,this.next=null,this.prev=null};e.prototype.isRemoved=function(){return this.key===t};var n=function(t){return!!t._es6map},i=function(t,e){if(!X.TypeIsObject(t)||!n(t))throw new TypeError("Method Map.prototype."+e+" called on incompatible receiver "+String(t))},o=function(t,e){i(t,"[[MapIterator]]"),this.head=t._head,this.i=this.head,this.kind=e};o.prototype={next:function(){var t,e=this.i,r=this.kind,n=this.head;if("undefined"==typeof this.i)return{value:void 0,done:!0};for(;e.isRemoved()&&e!==n;)e=e.prev;for(;e.next!==n;)if(e=e.next,!e.isRemoved())return t="key"===r?e.key:"value"===r?e.value:[e.key,e.value],this.i=e,{value:t,done:!1};return this.i=void 0,{value:void 0,done:!0}}},et(o.prototype);var a,s=function t(){if(!(this instanceof t))throw new TypeError('Constructor Map requires "new"');if(this&&this._es6map)throw new TypeError("Bad construction");var r=it(this,t,a,{_es6map:!0,_head:null,_storage:er(),_size:0}),n=new e(null,null);return n.next=n.prev=n,r._head=n,arguments.length>0&&rr(t,r,arguments[0]),r};return a=s.prototype,Q.getter(a,"size",function(){if("undefined"==typeof this._size)throw new TypeError("size method called on incompatible Map");return this._size}),b(a,{get:function(t){i(this,"get");var e=tr(t);if(null!==e){var r=this._storage[e];return r?r.value:void 0}for(var n=this._head,o=n;(o=o.next)!==n;)if(X.SameValueZero(o.key,t))return o.value},has:function(t){i(this,"has");var e=tr(t);if(null!==e)return"undefined"!=typeof this._storage[e];for(var r=this._head,n=r;(n=n.next)!==r;)if(X.SameValueZero(n.key,t))return!0;return!1},set:function(t,r){i(this,"set");var n,o=this._head,a=o,s=tr(t);if(null!==s){if("undefined"!=typeof this._storage[s])return this._storage[s].value=r,this;n=this._storage[s]=new e(t,r),a=o.prev}for(;(a=a.next)!==o;)if(X.SameValueZero(a.key,t))return a.value=r,this;return n=n||new e(t,r),X.SameValue(-0,t)&&(n.key=0),n.next=this._head,n.prev=this._head.prev,n.prev.next=n,n.next.prev=n,this._size+=1,this},delete:function(e){i(this,"delete");var r=this._head,n=r,o=tr(e);if(null!==o){if("undefined"==typeof this._storage[o])return!1;n=this._storage[o].prev,delete this._storage[o]}for(;(n=n.next)!==r;)if(X.SameValueZero(n.key,e))return n.key=n.value=t,n.prev.next=n.next,n.next.prev=n.prev,this._size-=1,!0;return!1},clear:function(){i(this,"clear"),this._size=0,this._storage=er();for(var e=this._head,r=e,n=r.next;(r=n)!==e;)r.key=r.value=t,n=r.next,r.next=r.prev=e;e.next=e.prev=e},keys:function(){return i(this,"keys"),new o(this,"key")},values:function(){return i(this,"values"),new o(this,"value")},entries:function(){return i(this,"entries"),new o(this,"key+value")},forEach:function(t){i(this,"forEach");for(var e=arguments.length>1?arguments[1]:null,n=this.entries(),o=n.next();!o.done;o=n.next())e?r(t,e,o.value[1],o.value[0],this):t(o.value[1],o.value[0],this)}}),et(a,a.entries),s}(),Set:function(){var t,e=function(t){return t._es6set&&"undefined"!=typeof t._storage},n=function(t,r){if(!X.TypeIsObject(t)||!e(t))throw new TypeError("Set.prototype."+r+" called on incompatible receiver "+String(t))},i=function e(){if(!(this instanceof e))throw new TypeError('Constructor Set requires "new"');if(this&&this._es6set)throw new TypeError("Bad construction");var r=it(this,e,t,{_es6set:!0,"[[SetData]]":null,_storage:er()});if(!r._es6set)throw new TypeError("bad set");return arguments.length>0&&nr(e,r,arguments[0]),r};t=i.prototype;var o=function(t){if(!t["[[SetData]]"]){var e=t["[[SetData]]"]=new ir.Map;h(Object.keys(t._storage),function(t){var r=t;if("^null"===r)r=null;else if("^undefined"===r)r=void 0;else{var n=r.charAt(0);r="$"===n?C(r,1):"n"===n?+C(r,1):"b"===n?"btrue"===r:+r}e.set(r,r)}),t._storage=null}};return Q.getter(i.prototype,"size",function(){return n(this,"size"),o(this),this["[[SetData]]"].size}),b(i.prototype,{has:function(t){n(this,"has");var e;return this._storage&&null!==(e=tr(t))?!!this._storage[e]:(o(this),this["[[SetData]]"].has(t))},add:function(t){n(this,"add");var e;return this._storage&&null!==(e=tr(t))?(this._storage[e]=!0,this):(o(this),this["[[SetData]]"].set(t,t),this)},delete:function(t){n(this,"delete");var e;if(this._storage&&null!==(e=tr(t))){var r=B(this._storage,e);return delete this._storage[e]&&r}return o(this),this["[[SetData]]"].delete(t)},clear:function(){n(this,"clear"),this._storage?this._storage=er():this["[[SetData]]"].clear()},values:function(){return n(this,"values"),o(this),this["[[SetData]]"].values()},entries:function(){return n(this,"entries"),o(this),this["[[SetData]]"].entries()},forEach:function(t){n(this,"forEach");var e=arguments.length>1?arguments[1]:null,i=this;o(i),this["[[SetData]]"].forEach(function(n,o){e?r(t,e,o,o,i):t(o,o,i)})}}),g(i.prototype,"keys",i.prototype.values,!0),et(i.prototype,i.prototype.values),i}()};if(E.Map||E.Set){var or=u(function(){return 2===new Map([[1,2]]).get(1)});if(!or){var ar=E.Map;E.Map=function t(){if(!(this instanceof t))throw new TypeError('Constructor Map requires "new"');var e=new ar;return arguments.length>0&&rr(t,e,arguments[0]),Object.setPrototypeOf(e,E.Map.prototype),g(e,"constructor",t,!0),e},E.Map.prototype=m(ar.prototype),Q.preserveToString(E.Map,ar)}var sr=new Map,ur=function(t){return t.delete(0),t.delete(-0),t.set(0,3),t.get(-0,4),3===t.get(0)&&4===t.get(-0)}(sr),cr=sr.set(1,2)===sr;if(!ur||!cr){var lr=Map.prototype.set;tt(Map.prototype,"set",function(t,e){return r(lr,this,0===t?0:t,e),this})}if(!ur){var fr=Map.prototype.get,pr=Map.prototype.has;b(Map.prototype,{get:function(t){return r(fr,this,0===t?0:t)},has:function(t){return r(pr,this,0===t?0:t)}},!0),Q.preserveToString(Map.prototype.get,fr),Q.preserveToString(Map.prototype.has,pr)}var hr=new Set,dr=function(t){return t.delete(0),t.add(-0),!t.has(0)}(hr),yr=hr.add(1)===hr;if(!dr||!yr){var vr=Set.prototype.add;Set.prototype.add=function(t){return r(vr,this,0===t?0:t),this},Q.preserveToString(Set.prototype.add,vr)}if(!dr){var gr=Set.prototype.has;Set.prototype.has=function(t){return r(gr,this,0===t?0:t)},Q.preserveToString(Set.prototype.has,gr);var br=Set.prototype.delete;Set.prototype.delete=function(t){return r(br,this,0===t?0:t)},Q.preserveToString(Set.prototype.delete,br)}var mr=_(E.Map,function(t){var e=new t([]);return e.set(42,42),e instanceof t}),_r=Object.setPrototypeOf&&!mr,wr=function(){try{return!(E.Map()instanceof E.Map)}catch(t){return t instanceof TypeError}}();if(0!==E.Map.length||_r||!wr){var Er=E.Map;E.Map=function t(){if(!(this instanceof t))throw new TypeError('Constructor Map requires "new"');var e=new Er;return arguments.length>0&&rr(t,e,arguments[0]),Object.setPrototypeOf(e,t.prototype),g(e,"constructor",t,!0),e},E.Map.prototype=Er.prototype,Q.preserveToString(E.Map,Er)}var Or=_(E.Set,function(t){var e=new t([]);return e.add(42,42),e instanceof t}),jr=Object.setPrototypeOf&&!Or,Sr=function(){try{return!(E.Set()instanceof E.Set)}catch(t){return t instanceof TypeError}}();if(0!==E.Set.length||jr||!Sr){var Tr=E.Set;E.Set=function t(){if(!(this instanceof t))throw new TypeError('Constructor Set requires "new"');var e=new Tr;return arguments.length>0&&nr(t,e,arguments[0]),Object.setPrototypeOf(e,t.prototype),g(e,"constructor",t,!0),e},E.Set.prototype=Tr.prototype,Q.preserveToString(E.Set,Tr)}var Cr=!u(function(){return(new Map).keys().next().done});if(("function"!=typeof E.Map.prototype.clear||0!==(new E.Set).size||0!==(new E.Map).size||"function"!=typeof E.Map.prototype.keys||"function"!=typeof E.Set.prototype.keys||"function"!=typeof E.Map.prototype.forEach||"function"!=typeof E.Set.prototype.forEach||c(E.Map)||c(E.Set)||"function"!=typeof(new E.Map).keys().next||Cr||!mr)&&(delete E.Map,delete E.Set,b(E,{Map:ir.Map,Set:ir.Set},!0)),E.Set.prototype.keys!==E.Set.prototype.values&&g(E.Set.prototype,"keys",E.Set.prototype.values,!0),et(Object.getPrototypeOf((new E.Map).keys())),et(Object.getPrototypeOf((new E.Set).keys())),p&&"has"!==E.Set.prototype.has.name){var xr=E.Set.prototype.has;tt(E.Set.prototype,"has",function(t){return r(xr,this,t)})}}b(E,ir),K(E.Map),K(E.Set)}var Pr=function(t){if(!X.TypeIsObject(t))throw new TypeError("target must be an object")},Rr={apply:function(){return e(X.Call,null,arguments)},construct:function(t,e){if(!X.IsConstructor(t))throw new TypeError("First argument must be a constructor.");var r=arguments.length<3?t:arguments[2];if(!X.IsConstructor(r))throw new TypeError("new.target must be a constructor.");return X.Construct(t,e,r,"internal")},deleteProperty:function(t,e){if(Pr(t),f){var r=Object.getOwnPropertyDescriptor(t,e);if(r&&!r.configurable)return!1}return delete t[e]},enumerate:function(t){return Pr(t),new Ot(t,"key")},has:function(t,e){return Pr(t),e in t}};Object.getOwnPropertyNames&&Object.assign(Rr,{ownKeys:function(t){Pr(t);var e=Object.getOwnPropertyNames(t);return X.IsCallable(Object.getOwnPropertySymbols)&&P(e,Object.getOwnPropertySymbols(t)),e}});var Ar=function(t){return!s(t)};if(Object.preventExtensions&&Object.assign(Rr,{isExtensible:function(t){return Pr(t),Object.isExtensible(t)},preventExtensions:function(t){return Pr(t),Ar(function(){Object.preventExtensions(t)})}}),f){var kr=function(t,e,n){var i=Object.getOwnPropertyDescriptor(t,e);if(!i){var o=Object.getPrototypeOf(t);if(null===o)return;return kr(o,e,n)}return"value"in i?i.value:i.get?r(i.get,n):void 0},Ir=function(t,e,n,i){var o=Object.getOwnPropertyDescriptor(t,e);if(!o){var a=Object.getPrototypeOf(t);if(null!==a)return Ir(a,e,n,i);o={value:void 0,writable:!0,enumerable:!0,configurable:!0}}if("value"in o){if(!o.writable)return!1;if(!X.TypeIsObject(i))return!1;var s=Object.getOwnPropertyDescriptor(i,e);return s?Y.defineProperty(i,e,{value:n}):Y.defineProperty(i,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}return!!o.set&&(r(o.set,i,n),!0)};Object.assign(Rr,{defineProperty:function(t,e,r){return Pr(t),Ar(function(){Object.defineProperty(t,e,r)})},getOwnPropertyDescriptor:function(t,e){return Pr(t),Object.getOwnPropertyDescriptor(t,e)},get:function(t,e){Pr(t);var r=arguments.length>2?arguments[2]:t;return kr(t,e,r)},set:function(t,e,r){Pr(t);var n=arguments.length>3?arguments[3]:t;return Ir(t,e,r,n)}})}if(Object.getPrototypeOf){var Mr=Object.getPrototypeOf;Rr.getPrototypeOf=function(t){return Pr(t),Mr(t)}}if(Object.setPrototypeOf&&Rr.getPrototypeOf){var Nr=function(t,e){for(var r=e;r;){if(t===r)return!0;r=Rr.getPrototypeOf(r)}return!1};Object.assign(Rr,{setPrototypeOf:function(t,e){if(Pr(t),null!==e&&!X.TypeIsObject(e))throw new TypeError("proto must be an object or null");return e===Y.getPrototypeOf(t)||!(Y.isExtensible&&!Y.isExtensible(t))&&(!Nr(t,e)&&(Object.setPrototypeOf(t,e),!0))}})}var Fr=function(t,e){if(X.IsCallable(E.Reflect[t])){var r=u(function(){return E.Reflect[t](1),E.Reflect[t](NaN),E.Reflect[t](!0),!0});r&&tt(E.Reflect,t,e)}else g(E.Reflect,t,e)};if(Object.keys(Rr).forEach(function(t){Fr(t,Rr[t])}),p&&"getPrototypeOf"!==E.Reflect.getPrototypeOf.name){var Br=E.Reflect.getPrototypeOf;tt(E.Reflect,"getPrototypeOf",function(t){return r(Br,E.Reflect,t)})}if(E.Reflect.setPrototypeOf&&u(function(){return E.Reflect.setPrototypeOf(1,{}),!0})&&tt(E.Reflect,"setPrototypeOf",Rr.setPrototypeOf),E.Reflect.defineProperty&&(u(function(){var t=!E.Reflect.defineProperty(1,"test",{value:1}),e="function"!=typeof Object.preventExtensions||!E.Reflect.defineProperty(Object.preventExtensions({}),"test",{});return t&&e})||tt(E.Reflect,"defineProperty",Rr.defineProperty)),E.Reflect.construct&&(u(function(){var t=function(){};return E.Reflect.construct(function(){},[],t)instanceof t})||tt(E.Reflect,"construct",Rr.construct)),"Invalid Date"!==String(new Date(NaN))){var Lr=Date.prototype.toString,Dr=function(){var t=+this;return t!==t?"Invalid Date":r(Lr,this)};tt(Date.prototype,"toString",Dr)}var Ur={anchor:function(t){return X.CreateHTML(this,"a","name",t)},big:function(){return X.CreateHTML(this,"big","","")},blink:function(){return X.CreateHTML(this,"blink","","")},bold:function(){return X.CreateHTML(this,"b","","")},fixed:function(){return X.CreateHTML(this,"tt","","")},fontcolor:function(t){return X.CreateHTML(this,"font","color",t)},fontsize:function(t){return X.CreateHTML(this,"font","size",t)},italics:function(){return X.CreateHTML(this,"i","","")},link:function(t){return X.CreateHTML(this,"a","href",t)},small:function(){return X.CreateHTML(this,"small","","")},strike:function(){return X.CreateHTML(this,"strike","","")},sub:function(){return X.CreateHTML(this,"sub","","")},sup:function(){return X.CreateHTML(this,"sup","","")}};h(Object.keys(Ur),function(t){var e=String.prototype[t],n=!1;if(X.IsCallable(e)){var i=r(e,"",' " '),o=T([],i.match(/"/g)).length;n=i!==i.toLowerCase()||o>2}else n=!0;n&&tt(String.prototype,t,Ur[t])});var Wr=function(){if(!$.symbol(D.iterator))return!1;var t="object"==typeof JSON&&"function"==typeof JSON.stringify?JSON.stringify:null;if(!t)return!1;if("undefined"!=typeof t(D()))return!0;if("[null]"!==t([D()]))return!0;var e={a:D()};return e[D()]=!0,"{}"!==t(e)}(),zr=u(function(){return!$.symbol(D.iterator)||"{}"===JSON.stringify(Object(D()))&&"[{}]"===JSON.stringify([Object(D())])});if(Wr||!zr){var qr=JSON.stringify;tt(JSON,"stringify",function(t){if("symbol"!=typeof t){var e;arguments.length>1&&(e=arguments[1]);var i=[t];if(n(e))i.push(e);else{var o=(X.IsCallable(e)?e:null,function(t,n){var i=e?r(e,this,t,n):n;if("symbol"!=typeof i)return $.symbol(i)?te({})(i):i});i.push(o)}return arguments.length>2&&i.push(arguments[2]),qr.apply(this,i)}})}return E})}).call(e,function(){return this}(),r(2))},function(t,e,r){(function(t,n){function i(t,r){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,t,n.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,r,n){if(t.customInspect&&r&&T(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return m(i)||(i=u(t,i,n)),i}var o=c(t,r);if(o)return o;var a=Object.keys(r),y=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(T(r)){var v=r.name?": "+r.name:"";return t.stylize("[Function"+v+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(j(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return l(r)}var g="",b=!1,_=["{","}"];if(d(r)&&(b=!0,_=["[","]"]),T(r)){var w=r.name?": "+r.name:"";g=" [Function"+w+"]"}if(E(r)&&(g=" "+RegExp.prototype.toString.call(r)),j(r)&&(g=" "+Date.prototype.toUTCString.call(r)),S(r)&&(g=" "+l(r)),0===a.length&&(!b||0==r.length))return _[0]+g+_[1];if(n<0)return E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special");t.seen.push(r);var O;return O=b?f(t,r,n,y,a):a.map(function(e){return p(t,r,n,y,e,b)}),t.seen.pop(),h(O,g,_)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var o=[],a=0,s=e.length;a-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")),w(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 h(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return null==t}function b(t){return"number"==typeof t}function m(t){return"string"==typeof t}function _(t){return"symbol"==typeof t}function w(t){return void 0===t}function E(t){return O(t)&&"[object RegExp]"===x(t)}function O(t){return"object"==typeof t&&null!==t}function j(t){return O(t)&&"[object Date]"===x(t)}function S(t){return O(t)&&("[object Error]"===x(t)||t instanceof Error)}function T(t){return"function"==typeof t}function C(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function x(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}function R(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),N[t.getMonth()],e].join(" ")}function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r0&&this._events[t].length>i&&(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())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,a,s;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;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(r=this._events[t],n(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e){t.exports={to7BitArray:function(t){var e=0,r=0,n=[];return t.forEach(function(t){0===e?(n.push(127&t),e++,r=t>>7):(n.push(t<>1),e=0):(e++,r=t>>8-e))}),e>0&&n.push(r),n},from7BitArray:function(t){for(var e=7*t.length>>3,r=[],n=0;n>a|t[o+1]<<7-a&255}return r}}},function(t,e,r){var n=r(12),i={crc8:function(t){for(var e=0,r=0;r>=1,o&&(e^=140),n>>=1}return e},readDevices:function(t){for(var e=n.from7BitArray(t),r=[],o=0;o=0&&a.close();break;case"timeout":}}),this.path=t,n&&e.nextTick(function(){a.open(o)})}function a(t){"undefined"!=typeof chrome&&chrome.serial?chrome.serial.getDevices(function(e){for(var r=new Array(e.length),n=0;n=0;f--){var h=l[f].toLowerCase();if(!(b.indexOf(h)>-1))return o(new Error("Invalid flowControl option: "+h));c[h]=!0}c.dataCallback=r.dataCallback||function(t){c.parser(this,t)}.bind(this),c.disconnectedCallback=r.disconnectedCallback||function(t){this.closing||(t||(t=new Error("Disconnected")),this.emit("disconnect",t))}.bind(this),this.fd=null,this.paused=!0,this.opening=!1,this.closing=!1,"win32"!==e.platform&&(this.bufferSize=c.bufferSize,this.readable=!0,this.reading=!1),this.options=c,n&&e.nextTick(function(){this.open(o)}.bind(this))}var a=r(16)("serialport"),s=r(19).getPolyfill(),u=r(30),c=r(38),l=r(11).EventEmitter,f=r(36),p=r(39),h=r(8),d=new l;d.parsers=c,d.list=u.list;var y=[5,6,7,8],v=[1,1.5,2],g=["none","even","mark","odd","space"],b=["xon","xoff","xany","rtscts"],m=["brk","cts","dtr","dts","rts"],_=40960,w=128,E={baudRate:9600,parity:"none",xon:!1,xoff:!1,xany:!1,rtscts:!1,hupcl:!0,dataBits:8,stopBits:1,bufferSize:65536,parser:c.raw,platformOptions:u.platformOptions},O={brk:!1,cts:!1,dtr:!0,dts:!1,rts:!0},j=["baudRate","dataBits","stopBits","bufferSize","platformOptions","flowControl"];d.SerialPort=o,h.inherits(o,p.Stream),o.prototype._error=function(t,e){e?e(t):this.emit("error",t)},o.prototype.open=function(t){if(this.isOpen())return this._error(new Error("Port is already open"),t);if(this.opening)return this._error(new Error("Port is opening"),t);this.paused=!0,this.readable=!0,this.reading=!1,this.opening=!0;var r=this;u.open(this.path,this.options,function(n,i){return n?(a("SerialPortBinding.open had an error",n),r._error(n,t)):(r.fd=i,r.paused=!1,r.opening=!1,"win32"!==e.platform&&(r.serialPoller=new u.SerialportPoller(r.fd,function(t){t?r.disconnected(t):r._read()}),r.serialPoller.start()),r.emit("open"),void(t&&t()))})},o.prototype.update=function(t,e){if(!this.isOpen())return a("update attempted, but port is not open"),this._error(new Error("Port is not open"),e);var r=i(t),n=s({},E,r);this.options.baudRate=n.baudRate,u.update(this.fd,this.options,function(t){return t?this._error(t,e):(this.emit("open"),void(e&&e()))}.bind(this))},o.prototype.isOpen=function(){return null!==this.fd&&!this.closing},o.prototype.write=function(t,e){if(!this.isOpen())return a("write attempted, but port is not open"),this._error(new Error("Port is not open"),e);n.isBuffer(t)||(t=new n(t)),a("write data: "+JSON.stringify(t));var r=this;u.write(this.fd,t,function(t,n){e?e(t,n):t&&r.emit("error",t)})},"win32"!==e.platform&&(o.prototype._read=function(){function t(t,r,o,a){if(e.reading=!1,t)t.code&&"EAGAIN"===t.code?!e.closing&&e.isOpen()&&e.serialPoller.start():!t.code||"EBADF"!==t.code&&"ENXIO"!==t.code&&t.errno!==-1&&"UNKNOWN"!==t.code?(e.fd=null,e.readable=!1,e.emit("error",t)):e.disconnected(t);else if(e.pool.used-=a-r,0===r)e.isOpen()&&e.serialPoller.start();else{var s=e.pool.slice(i,i+r);if(e.paused)return void(e.buffer=n.concat([e.buffer,s]));if(e._emitData(s),!e.readable)return;e._read()}}var e=this;if(e.readable&&!e.paused&&!e.reading&&!this.closing){e.reading=!0,(!e.pool||e.pool.length-e.pool.used=0;n--){var i=m[n];void 0!==t[i]?r[i]=t[i]:r[i]=O[i]}u.set(this.fd,r,function(t,r){return t?(a("SerialPortBinding.set had an error",t),this._error(t,e)):void(e&&e(null,r))}.bind(this))},o.prototype.drain=function(t){var e=this,r=this.fd;return this.isOpen()?void u.drain(r,function(r,n){t?t(r,n):r&&e.emit("error",r)}):(a("drain attempted, but port is not open"),this._error(new Error("Port is not open"),t))},t.exports=d}).call(e,r(2),r(3).Buffer)},function(t,e,r){function n(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var t=arguments,r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),!r)return t;var n="color: "+this.color;t=[t[0],n,"color: inherit"].concat(Array.prototype.slice.call(t,1));var i=0,o=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,n),t}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function s(){var t;try{t=e.storage.debug}catch(t){}return t}function u(){try{return window.localStorage}catch(t){}}e=t.exports=r(17),e.log=o,e.formatArgs=i,e.save=a,e.load=s,e.useColors=n,e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){return JSON.stringify(t)},e.enable(s())},function(t,e,r){function n(){return e.colors[l++%e.colors.length]}function i(t){function r(){}function i(){var t=i,r=+new Date,o=r-(c||r);t.diff=o,t.prev=c,t.curr=r,c=r,null==t.useColors&&(t.useColors=e.useColors()),null==t.color&&t.useColors&&(t.color=n());var a=Array.prototype.slice.call(arguments);a[0]=e.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(r,n){if("%%"===r)return r;s++;var i=e.formatters[n];if("function"==typeof i){var o=a[s];r=i.call(t,o),a.splice(s,1),s--}return r}),"function"==typeof e.formatArgs&&(a=e.formatArgs.apply(t,a));var u=i.log||e.log||console.log.bind(console);u.apply(t,a)}r.enabled=!1,i.enabled=!0;var o=e.enabled(t)?i:r;return o.namespace=t,o}function o(t){e.save(t);for(var r=(t||"").split(/[\s,]+/),n=r.length,i=0;i1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*l;case"days":case"day":case"d":return r*c;case"hours":case"hour":case"hrs":case"hr":case"h":return r*u;case"minutes":case"minute":case"mins":case"min":case"m":return r*s;case"seconds":case"second":case"secs":case"sec":case"s":return r*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}}}function n(t){return t>=c?Math.round(t/c)+"d":t>=u?Math.round(t/u)+"h":t>=s?Math.round(t/s)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function i(t){return o(t,c,"day")||o(t,u,"hour")||o(t,s,"minute")||o(t,a,"second")||t+" ms"}function o(t,e,r){if(!(t2?arguments[2]:{},a=n(e);o&&(a=a.concat(Object.getOwnPropertySymbols(e))),i(a,function(n){l(t,n,e[n],r[n])})};f.supportsDescriptors=!!c,t.exports=f},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Array.prototype.slice,a=r(22),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),d=function(t){if("undefined"==typeof window||!h)return f(t);try{return f(t)}catch(t){return!1}},y=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),o=a(t),s=e&&"[object String]"===i.call(t),f=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(s&&t.length>0&&!n.call(t,0))for(var h=0;h0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},function(t,e){var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString;t.exports=function(t,e,i){if("[object Function]"!==n.call(e))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var a=0;a0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},i.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},i.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},i.prototype._reset=function(){this._isTickUsed=!1},r.exports=i,r.exports.firstLineError=u},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var c=r(o),l=new t(e);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(c),c instanceof t){var p={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:c};f._then(e,a,void 0,l,p),c._then(s,u,void 0,l,p),l._setOnCancel(c)}else l._resolveCallback(f);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=this._bitField&-2097153},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";function n(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=n,e.exports=o},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+s.classString(t)+" has no method '"+s.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}var a,s=t("./util"),u=s.canEvaluate;s.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(n,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=a(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0;
-},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var r=0;r=0)return o[t]}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=r,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var r=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=n,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,r,n){"use strict";r.exports=function(r,n){function i(t,e){return{promise:e}}function o(){return!1}function a(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+D.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?D.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function u(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(t,e){if(0!==(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function d(){this._trace=new k(this._peekContext())}function y(t,e){if(U(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=j(t);D.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),D.notEnumerableProp(t,"__stackCleaned__",!0)}}}function v(t,e,r,n,i){if(void 0===t&&null!==e&&Q){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&n._bitField))return;r&&(r+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=E(s),c=u.length-1;c>=0;--c){var l=u[c];if(!z.test(l)){var f=l.match(q);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0)for(var p=u[0],c=0;c0&&(a="\n"+s[c-1]);break}}var h="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(h,!0,e)}}function g(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),b(r)}function b(t,e,n){if(at.warnings){var i,o=new L(t);if(e)n._attachExtraTrace(o);else if(at.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var a=j(o);o.stack=a.message+"\n"+a.stack.join("\n")}et("warning",o)||S(o,"",!0)}}function m(t,e){for(var r=0;r=0;--s)if(n[s]===o){a=s;break}for(var s=a;s>=0;--s){var u=n[s];if(e[i]!==u)break;e.pop(),i--}e=n}}function E(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function j(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?O(t):[" (No stack trace)"],{message:r,stack:E(e)}}function S(t,e,r){if("undefined"!=typeof console){var n;if(D.isObject(t)){var i=t.stack;n=e+V(i,t)}else n=e+String(t);"function"==typeof N?N(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function T(t,e,r,n){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){B.throwLater(t)}"unhandledRejection"===t?et(t,r,n)||i||S(r,"Unhandled rejection "):et(t,n)}function C(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():D.toString(t);var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.length=s||(nt=function(t){if(W.test(t))return!0;var e=R(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}}function k(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);ot(this,k),e>32&&this.uncycle()}var I,M,N,F=r._getDomain,B=r._async,L=t("./errors").Warning,D=t("./util"),U=D.canAttachTrace,W=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,z=/\((?:timers\.js):\d+:\d+\)/,q=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,H=null,V=null,$=!1,G=!(0==D.env("BLUEBIRD_DEBUG")),Y=!(0==D.env("BLUEBIRD_WARNINGS")||!G&&!D.env("BLUEBIRD_WARNINGS")),X=!(0==D.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!D.env("BLUEBIRD_LONG_STACK_TRACES")),Q=0!=D.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(Y||!!D.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=t._bitField&-1048577|524288},r.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),B.invokeLater(this._notifyUnhandledRejection,this,void 0))},r.prototype._notifyUnhandledRejectionIsHandled=function(){T("rejectionHandled",I,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),T("unhandledRejection",M,t,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(t,e,r){return b(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=F();M="function"==typeof t?null===e?t:D.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=F();I="function"==typeof t?null===e?t:D.domainBind(e,t):void 0};var J=function(){};r.longStackTraces=function(){if(B.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!at.longStackTraces&&P()){var t=r.prototype._captureStackTrace,e=r.prototype._attachExtraTrace;at.longStackTraces=!0,J=function(){if(B.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=t,r.prototype._attachExtraTrace=e,n.deactivateLongStackTraces(),B.enableTrampoline(),at.longStackTraces=!1},r.prototype._captureStackTrace=d,r.prototype._attachExtraTrace=y,n.activateLongStackTraces(),B.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return at.longStackTraces&&P()};var Z=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return D.global.dispatchEvent(t),function(t,e){var r=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!D.global.dispatchEvent(r)}}if("function"==typeof Event){var t=new Event("CustomEvent");return D.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,!D.global.dispatchEvent(r)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),D.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!D.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),K=function(){return D.isNode?function(){return e.emit.apply(e,arguments)}:D.global?function(t){var e="on"+t.toLowerCase(),r=D.global[e];return!!r&&(r.apply(D.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),tt={promiseCreated:i,promiseFulfilled:i,promiseRejected:i,promiseResolved:i,promiseCancelled:i,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:i},et=function(t){var e=!1;try{e=K.apply(null,arguments)}catch(t){B.throwLater(t),e=!0}var r=!1;try{r=Z(t,tt[t].apply(null,arguments))}catch(t){B.throwLater(t),r=!0}return r||e};r.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&J()),"warnings"in t){var e=t.warnings;at.warnings=!!e,Q=at.warnings,D.isObject(e)&&"wForgottenReturn"in e&&(Q=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!at.cancellation){if(B.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=l,r.prototype._propagateFrom=f,r.prototype._onCancel=u,r.prototype._setOnCancel=c,r.prototype._attachCancellationCallback=s,r.prototype._execute=a,rt=f,at.cancellation=!0}"monitoring"in t&&(t.monitoring&&!at.monitoring?(at.monitoring=!0,r.prototype._fireEvent=et):!t.monitoring&&at.monitoring&&(at.monitoring=!1,r.prototype._fireEvent=o))},r.prototype._fireEvent=o,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var rt=p,nt=function(){return!1},it=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;D.inherits(k,Error),n.CapturedTrace=k,k.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;n0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;s=0;--l)e[l]._length=c,c++;return}}}},k.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),r=e.message,n=[e.stack],i=this;void 0!==i;)n.push(E(i.stack.split("\n"))),i=i._parent;w(n),_(n),D.notEnumerableProp(t,"stack",m(r,n)),D.notEnumerableProp(t,"__stackCleaned__",!0)}};var ot=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():C(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,H=t,V=e;var r=Error.captureStackTrace;return nt=function(t){return W.test(t)},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return H=/@/,V=e,$=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(t){i="stack"in t}return"stack"in n||!i||"number"!=typeof Error.stackTraceLimit?(V=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?C(e):e.toString()},null):(H=t,V=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(N=function(t){console.warn(t)},D.isNode&&e.stderr.isTTY?N=function(t,e){var r=e?"[33m":"[31m";console.warn(r+t+"[0m\n")}:D.isNode||"string"!=typeof(new Error).stack||(N=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var at={warnings:Y,longStackTraces:!1,cancellation:!1,monitoring:!1};return X&&r.longStackTraces(),{longStackTraces:function(){return at.longStackTraces},warnings:function(){return at.warnings},cancellation:function(){return at.cancellation},monitoring:function(){return at.monitoring},propagateFromFunction:function(){return rt},boundValueFunction:function(){return h},checkForgottenReturns:v,setBounds:A,warn:b,deprecated:g,CapturedTrace:k,fireDomEvent:Z,fireGlobalEvent:K}}},{"./errors":12,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1],n=function(){throw e};return this.caught(t,n)},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();var i=function(){return n};return this.caught(r,i)}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){function r(){return o(this)}function n(t,r){return i(t,r,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(r,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,n){return i(t,n,e,0)._then(r,void 0,void 0,t,void 0)},t.mapSeries=n}},{}],12:[function(t,e,r){"use strict";function n(t,e){function r(n){return this instanceof r?(f(this,"message","string"==typeof n?n:e),f(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return l(r,Error),r}function i(t){return this instanceof i?(f(this,"name","OperationalError"),f(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(f(this,"message",t.message),f(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,a,s=t("./es5"),u=s.freeze,c=t("./util"),l=c.inherits,f=c.notEnumerableProp,p=n("Warning","warning"),h=n("CancellationError","cancellation error"),d=n("TimeoutError","timeout error"),y=n("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(t){o=n("TypeError","type error"),a=n("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function a(){return u.call(this,this.promise._target()._settledValue())}function s(t){if(!o(this,t))return f.e=t,f}function u(t){var n=this.promise,u=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?u.call(n._boundValue()):u.call(n._boundValue(),t);if(void 0!==c){n._setReturnedNonUndefined();var p=r(c,n);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var h=new l("late cancellation observer");return n._attachExtraTrace(h),f.e=h,f}p.isPending()&&p._attachCancellationCallback(new i(this))}return p._then(a,s,void 0,this,void 0)}}}return n.isRejected()?(o(this),f.e=t,f):(o(this),t)}var c=t("./util"),l=e.CancellationError,f=c.errorObj;return n.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,i){return"function"!=typeof t?this.then():this._then(r,i,void 0,new n(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,u,u)},e.prototype.tap=function(t){return this._passThrough(t,1,u)},n}},{"./util":36}],16:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){function s(t,r,n){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var n}var i=[].slice.call(arguments);t&&i.pop();var n=new r(i).promise();return void 0!==t?n.spread(t):n}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=c();this._callback=null===i?e:l.domainBind(i,e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function u(t,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+l.classString(r));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+l.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(i.concurrency)));a=i.concurrency}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new s(t,r,a,o).promise()}var c=e._getDomain,l=t("./util"),f=l.tryCatch,p=l.errorObj,h=e._async;l.inherits(s,r),s.prototype._asyncInit=function(){this._init$(void 0,-2)},s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,u=this._limit;if(r<0){if(r=r*-1-1,n[r]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var c=this._promise,l=this._callback,h=c._boundValue();c._pushContext();var d=f(l).call(h,t,r,o),y=c._popContext();if(a.checkForgottenReturns(d,y,null!==s?"Promise.filter":"Promise.map",c),d===p)return this._reject(d.e),!0;var v=i(d,this._promise);if(v instanceof e){v=v._target();var g=v._bitField;if(0===(50397184&g))return u>=1&&this._inFlight++,n[r]=v,v._proxy(this,(r+1)*-1),!1;if(0===(33554432&g))return 0!==(16777216&g)?(this._reject(v._reason()),!0):(this._cancel(),!0);d=v._value()}n[r]=d}var b=++this._totalResolved;return b>=o&&(null!==s?this._filter(n,s):this._resolve(n),!0)},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];u=a.isArray(c)?s(t).apply(l,c):s(t).call(l,c)}else u=s(t)();var f=n._popContext();return o.checkForgottenReturns(u,f,"Promise.try",n),n._resolveFromSyncValue(u),n},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";function n(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(n(t)){e=new c(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=l.keys(t),i=0;i1){var r,n=new Array(e-1),i=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+d.classString(t);arguments.length>1&&(r+=", "+d.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},o.prototype.done=function(t,e){var r=this._then(t,e,void 0,void 0,void 0);r._setIsFinal()},o.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+d.classString(t)):this.all()._then(t,void 0,void 0,E,void 0)},o.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new S(this).promise()},o.prototype.error=function(t){return this.caught(d.originatesFromRejection,t)},o.getNewLibraryCopy=r.exports,o.is=function(t){return t instanceof o},o.fromNode=o.fromCallback=function(t){var e=new o(w);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=I(t)(A(e,r));return n===k&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},o.all=function(t){return new S(t).promise()},o.cast=function(t){var e=j(t);return e instanceof o||(e=new o(w),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(t){var e=new o(w);return e._captureStackTrace(),e._rejectCallback(t,!0),e},o.setScheduler=function(t){if("function"!=typeof t)throw new m("expecting a function but got "+d.classString(t));return g.setScheduler(t)},o.prototype._then=function(t,e,r,n,i){var a=void 0!==i,s=a?i:new o(w),u=this._target(),l=u._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===n&&0!==(2097152&this._bitField)&&(n=0!==(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var f=c();if(0!==(50397184&l)){var p,h,y=u._settlePromiseCtx;0!==(33554432&l)?(h=u._rejectionHandler0,p=t):0!==(16777216&l)?(h=u._fulfillmentHandler0,p=e,u._unsetRejectionIsUnhandled()):(y=u._settlePromiseLateCancellationObserver,h=new _("late cancellation observer"),u._attachExtraTrace(h),p=e),g.invoke(y,u,{handler:null===f?p:"function"==typeof p&&d.domainBind(f,p),promise:s,receiver:n,value:h})}else u._addCallbacks(t,e,s,n,f);return s},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},o.prototype._setLength=function(t){this._bitField=this._bitField&-65536|65535&t},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){g.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},o.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==h)return void 0===e&&this._isBound()?this._boundValue():e},o.prototype._promiseAt=function(t){return this[4*t-4+2]},o.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},o.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),r=t._rejectionHandler0,n=t._promise0,i=t._receiverAt(0);void 0===i&&(i=h),this._addCallbacks(e,r,n,i,null)},o.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=h),this._addCallbacks(r,n,i,o,null)},o.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:d.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:d.domainBind(i,e));else{var a=4*o-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===i?t:d.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:d.domainBind(i,e))}return this._setLength(o+1),o},o.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},o.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var r=j(t,this);if(!(r instanceof o))return this._fulfill(t);e&&this._propagateFrom(r,2);var n=r._target();if(n===this)return void this._reject(l());var i=n._bitField;if(0===(50397184&i)){var a=this._length();a>0&&n._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=l();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():g.settlePromises(this))}},o.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?g.fatalError(t,d.isNode):void((65535&e)>0?g.settlePromises(this):this._ensurePossibleRejectionHandled())},o.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!==(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},o.defer=o.pending=function(){x.deprecated("Promise.defer","new Promise");var t=new o(w);return{promise:t,resolve:a,reject:s}},d.notEnumerableProp(o,"_makeSelfResolutionError",l),t("./method")(o,w,j,p,x),t("./bind")(o,w,j,x),t("./cancel")(o,S,p,x),t("./direct_resolve")(o),t("./synchronous_inspection")(o),t("./join")(o,S,j,w,g,c),o.Promise=o,o.version="3.4.6",t("./map.js")(o,S,p,j,w,x),t("./call_get.js")(o),t("./using.js")(o,p,j,C,w,x),t("./timers.js")(o,w,x),t("./generators.js")(o,p,w,j,n,x),t("./nodeify.js")(o),t("./promisify.js")(o,w),t("./props.js")(o,S,j,p),t("./race.js")(o,w,j,p),t("./reduce.js")(o,S,p,j,w,x),t("./settle.js")(o,S,x),t("./some.js")(o,S,p),t("./filter.js")(o,w),t("./each.js")(o,w),t("./any.js")(o),d.toFastProperties(o),d.toFastProperties(o.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new o(w)),x.setBounds(v.firstLineError,d.lastLineError),o}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){function a(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var u=t("./util");u.isArray;return u.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,o){var s=n(this._values,this._promise);if(s instanceof e){s=s._target();var c=s._bitField;if(this._values=s,0===(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(0===(33554432&c))return 0!==(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(s=u.asArray(s),null===s){var l=i("expecting an array or an iterable object but got "+u.classString(s)).reason();return void this._promise._rejectCallback(l,!1)}return 0===s.length?void(o===-5?this._resolveEmptyArray():this._resolve(a(o))):void this._iterate(s)},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var n;if(this._isMap)n=p(this._values);else{n={};for(var i=this.length(),o=0,a=this.length();o>1},e.prototype.props=function(){return a(this)},e.props=function(t){return a(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var o=0;o=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(t,e){var r=new o;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},i.prototype._promiseRejected=function(t,e){var r=new o;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var a=t("./util"),s=t("./errors").RangeError,u=t("./errors").AggregateError,c=a.isArray,l={};a.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new u,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new s(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t,n){if(l(t)){if(t instanceof e)return t;var i=o(t);if(i===c){n&&n._pushContext();var u=e.reject(i.e);return n&&n._popContext(),u}if("function"==typeof i){if(a(t)){var u=new e(r);return t._then(u._fulfill,u._reject,void 0,u,null),u}return s(t,i,n)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(t){return c.e=t,c}}function a(t){try{return f.call(t,"_promise0")}catch(t){return!1}}function s(t,n,i){function o(t){s&&(s._resolveCallback(t),s=null)}function a(t){s&&(s._rejectCallback(t,f,!0),s=null)}var s=new e(r),l=s;i&&i._pushContext(),s._captureStackTrace(),i&&i._popContext();var f=!0,p=u.tryCatch(n).call(t,o,a);return f=!1,s&&p===c&&(s._rejectCallback(p.e,!0,!0),s=null),l}var u=t("./util"),c=u.errorObj,l=u.isObject,f={}.hasOwnProperty;return n}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function a(t){throw clearTimeout(this.handle),t}var s=t("./util"),u=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,o){var a,s;return void 0!==o?(a=e.resolve(o)._then(c,null,null,t,void 0),n.cancellation()&&o instanceof e&&a._setOnCancel(o)):(a=new e(r),s=setTimeout(function(){a._fulfill()},+t),n.cancellation()&&a._setOnCancel(new i(s)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};e.prototype.delay=function(t){return l(t,this)};var f=function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new u("operation timed out"):new u(e),s.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()};e.prototype.timeout=function(t,e){t=+t;var r,s,u=new i(setTimeout(function(){r.isPending()&&f(r,e,s)},t));return n.cancellation()?(s=this.then(),r=s._then(o,a,void 0,u,void 0),r._setOnCancel(u)):r=this._then(o,a,void 0,u,void 0),r}}},{"./util":36}],35:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){function s(t){setTimeout(function(){throw t},0)}function u(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function c(t,r){function i(){if(a>=c)return l._fulfill();var o=u(t[a++]);if(o instanceof e&&o._isDisposable()){try{o=n(o._getDisposer().tryDispose(r),t.promise);
-}catch(t){return s(t)}if(o instanceof e)return o._then(i,s,null,null,null)}i()}var a=0,c=t.length,l=new e(o);return i(),l}function l(t,e,r){this._data=t,this._promise=e,this._context=r}function f(t,e,r){this.constructor$(t,e,r)}function p(t){return l.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function h(t){this.length=t,this.promise=null,this[t-1]=null}var d=t("./util"),y=t("./errors").TypeError,v=t("./util").inherits,g=d.errorObj,b=d.tryCatch,m={};l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():m},l.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==m?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(f,l),f.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},h.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new f(t,this,i());throw new y}}},{"./errors":12,"./util":36}],36:[function(t,n,i){"use strict";function o(){try{var t=A;return A=null,t.apply(this,arguments)}catch(t){return R.e=t,R}}function a(t){return A=t,o}function s(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function u(t){return"function"==typeof t||"object"==typeof t&&null!==t}function c(t){return s(t)?new Error(b(t)):t}function l(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=N.test(t+"")&&x.names(t).length>0;if(r||n||i)return!0}return!1}catch(t){return!1}}function y(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function v(t){return F.test(t)}function g(t,e,r){for(var n=new Array(t),i=0;i10||t[0]>0}(),W.isNode&&W.toFastProperties(e);try{throw new Error}catch(t){W.lastLineError=t}n.exports=W},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(e,r(2),function(){return this}(),r(34).setImmediate)},function(t,e,r){(function(t,n){function i(t,e){this._id=t,this._clearFn=e}var o=r(2).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,u={},c=0;e.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},e.setImmediate="function"==typeof t?t:function(t){var r=c++,n=!(arguments.length<2)&&s.call(arguments,1);return u[r]=!0,o(function(){u[r]&&(n?t.apply(null,n):t.call(null),e.clearImmediate(r))}),r},e.clearImmediate="function"==typeof n?n:function(t){delete u[t]}}).call(e,r(34).setImmediate,r(34).clearImmediate)},function(t,e){t.exports=child_process},function(t,e){t.exports=fs},function(t,e,r){(function(t){function r(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-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&&(e=a+"/"+e,i="/"===a.charAt(0))}return e=r(n(e.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+e||"."},e.normalize=function(t){var i=e.isAbsolute(t),o="/"===a(t,-1);return t=r(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,r){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=e.resolve(t).substr(1),r=e.resolve(r).substr(1);for(var i=n(t.split("/")),o=n(r.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u=t;){var o=r.slice(0,t);r=r.slice(t),n.emit("data",o)}}},byteDelimiter:function(t){"[object Array]"!==Object.prototype.toString.call(t)&&(t=[t]);var e=[],r=0;return function(n,i){for(var o=0;o0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var s=new Error("stream.unshift() after end event");t.emit("error",s)}else!e.decoder||i||n||(r=e.decoder.write(r)),i||(e.reading=!1),e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&f(t)),h(t,e);else i||(e.reading=!1);return a(e)}function a(t){return!t.ended&&(t.needReadable||t.length=R)t=R;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}function u(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:isNaN(t)||C.isNull(t)?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:t<=0?0:(t>e.highWaterMark&&(e.highWaterMark=s(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function c(t,e){var r=null;return C.isBuffer(e)||C.isString(e)||C.isNullOrUndefined(e)||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function l(t,e){if(e.decoder&&!e.ended){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,f(t)}function f(t){var r=t._readableState;r.needReadable=!1,r.emittedReadable||(P("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?e.nextTick(function(){p(t)}):p(t))}function p(t){P("emit readable"),t.emit("readable"),b(t)}function h(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(function(){d(t,r)}))}function d(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=i)r=o?n.join(""):j.concat(n,i),n.length=0;else if(t0)throw new Error("endReadable called on non-empty stream");r.endEmitted||(r.ended=!0,e.nextTick(function(){r.endEmitted||0!==r.length||(r.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function w(t,e){for(var r=0,n=t.length;r0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return P("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?_(this):f(this),null;if(t=u(t,e),0===t&&e.ended)return 0===e.length&&_(this),null;var n=e.needReadable;P("need readable",n),(0===e.length||e.length-t0?m(t,e):null,C.isNull(i)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&_(this),C.isNull(i)||this.emit("data",i),i},i.prototype._read=function(t){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(t,r){function n(t){P("onunpipe"),t===f&&o()}function i(){P("onend"),t.end()}function o(){P("cleanup"),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("drain",v),t.removeListener("error",s),t.removeListener("unpipe",n),f.removeListener("end",i),f.removeListener("end",o),f.removeListener("data",a),!p.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){P("ondata");var r=t.write(e);!1===r&&(P("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,f.pause())}function s(e){P("onerror",e),l(),t.removeListener("error",s),0===S.listenerCount(t,"error")&&t.emit("error",e)}function u(){t.removeListener("finish",c),l()}function c(){P("onfinish"),t.removeListener("close",u),l()}function l(){P("unpipe"),f.unpipe(t)}var f=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=t;break;case 1:p.pipes=[p.pipes,t];break;default:p.pipes.push(t)}p.pipesCount+=1,P("pipe count=%d opts=%j",p.pipesCount,r);var h=(!r||r.end!==!1)&&t!==e.stdout&&t!==e.stderr,d=h?i:o;p.endEmitted?e.nextTick(d):f.once("end",d),t.on("unpipe",n);var v=y(f);return t.on("drain",v),f.on("data",a),t._events&&t._events.error?O(t._events.error)?t._events.error.unshift(s):t._events.error=[s,t._events.error]:t.on("error",s),t.once("close",u),t.once("finish",c),t.emit("pipe",f),p.flowing||(P("pipe resume"),f.resume()),t},i.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i1){for(var r=[],n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,n=e.charCodeAt(i);if(n>=55296&&n<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},c.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},c.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},function(t,e,r){function n(t,e){this.afterTransform=function(t,r){return i(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(t,e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,u.isNullOrUndefined(r)||t.push(r),i&&i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length=0&&"[object Function]"===h(t.callee)),r},T=Function.call.bind(Function.apply),C={Call:function(t,e){var r=arguments.length>2?arguments[2]:[];if(!C.IsCallable(t))throw new TypeError(t+" is not a function");return T(t,e,r)},RequireObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t)},TypeIsObject:function(t){return null!=t&&Object(t)===t},ToObject:function(t,e){return C.RequireObjectCoercible(t,e),Object(t)},IsCallable:function(t){return"function"==typeof t&&"[object Function]"===h(t)},ToInt32:function(t){return C.ToNumber(t)>>0},ToUint32:function(t){return C.ToNumber(t)>>>0},ToNumber:function(t){if("[object Symbol]"===h(t))throw new TypeError("Cannot convert a Symbol value to a number");return+t},ToInteger:function(t){var e=C.ToNumber(t);return Number.isNaN(e)?0:0!==e&&Number.isFinite(e)?(e>0?1:-1)*Math.floor(Math.abs(e)):e},ToLength:function(t){var e=C.ToInteger(t);return e<=0?0:e>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e},SameValue:function(t,e){return t===e?0!==t||1/t===1/e:Number.isNaN(t)&&Number.isNaN(e)},SameValueZero:function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)},IsIterable:function(t){return C.TypeIsObject(t)&&("undefined"!=typeof t[O]||S(t))},GetIterator:function(t){if(S(t))return new e(t,"value");var r=t[O];if(!C.IsCallable(r))throw new TypeError("value is not an iterable");var n=r.call(t);if(!C.TypeIsObject(n))throw new TypeError("bad iterator");return n},IteratorNext:function(t){var e=arguments.length>1?t.next(arguments[1]):t.next();if(!C.TypeIsObject(e))throw new TypeError("bad iterator");return e},Construct:function(t,e){var r;r=C.IsCallable(t[g])?t[g]():E(t.prototype||null),w(r,{_es6construct:!0});var n=C.Call(t,r,e);return C.TypeIsObject(n)?n:r},CreateHTML:function(t,e,r,n){var i=String(t),o="<"+e;if(""!==r){var a=String(n),s=a.replace(/"/g,""");o+=" "+r+'="'+s+'"'}var u=o+">",c=u+i;return c+""+e+">"}},x=function(t){if(!C.TypeIsObject(t))throw new TypeError("bad object");return t._es6construct||(t.constructor&&C.IsCallable(t.constructor[g])&&(t=t.constructor[g](t)),w(t,{_es6construct:!0})),t},P=function(){function t(t){var e=Math.floor(t),r=t-e;return r<.5?e:r>.5?e+1:e%2?e+1:e}function e(e,r,n){var i,o,a,s,u,c,l,f=(1<=Math.pow(2,1-f)?(o=Math.min(Math.floor(Math.log(e)/Math.LN2),1023),a=t(e/Math.pow(2,o)*Math.pow(2,n)),a/Math.pow(2,n)>=2&&(o+=1,a=1),o>f?(o=(1<>=1;return f.reverse(),a=f.join(""),s=(1<0?u*Math.pow(2,c-s)*(1+l/Math.pow(2,r)):0!==l?u*Math.pow(2,-(s-1))*(l/Math.pow(2,r)):u<0?-0:0}function n(t){return r(t,8,23)}function i(t){return e(t,8,23)}var o={toFloat32:function(t){return n(i(t))}};if("undefined"!=typeof Float32Array){var a=new Float32Array(1);o.toFloat32=function(t){return a[0]=t,a[0]}}return o}();if(w(String,{fromCodePoint:function(t){for(var e,r=[],n=0,i=arguments.length;n1114111)throw new RangeError("Invalid code point "+e);e<65536?r.push(String.fromCharCode(e)):(e-=65536,r.push(String.fromCharCode((e>>10)+55296)),r.push(String.fromCharCode(e%1024+56320)))}return r.join("")},raw:function(t){var e=C.ToObject(t,"bad callSite"),r=e.raw,n=C.ToObject(r,"bad raw value"),i=n.length,o=C.ToLength(i);if(o<=0)return"";for(var a,s,u,c,l=[],f=0;f=o));)s=f+1=k)throw new RangeError("repeat count must be less than infinity and not overflow maximum string size");return A(e,t)},startsWith:function(t){C.RequireObjectCoercible(this);var e=String(this);if(b.regex(t))throw new TypeError('Cannot call method "startsWith" with a regex');t=String(t);var r=arguments.length>1?arguments[1]:void 0,n=Math.max(C.ToInteger(r),0);return e.slice(n,n+t.length)===t},endsWith:function(t){C.RequireObjectCoercible(this);var e=String(this);if(b.regex(t))throw new TypeError('Cannot call method "endsWith" with a regex');t=String(t);var r=e.length,n=arguments.length>1?arguments[1]:void 0,i="undefined"==typeof n?r:C.ToInteger(n),o=Math.min(Math.max(i,0),r);return e.slice(o-t.length,o)===t},includes:function(t){var e=arguments.length>1?arguments[1]:void 0;return p(this,t,e)!==-1},codePointAt:function(t){C.RequireObjectCoercible(this);var e=String(this),r=C.ToInteger(t),n=e.length;if(r>=0&&r56319||o)return i;var a=e.charCodeAt(r+1);return a<56320||a>57343?i:1024*(i-55296)+(a-56320)+65536}}};w(String.prototype,I);var M=1!=="
".trim().length;if(M){delete String.prototype.trim;var N=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),F=new RegExp("(^["+N+"]+)|(["+N+"]+$)","g");w(String.prototype,{trim:function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(F,"")}})}var B=function(t){C.RequireObjectCoercible(t),this._s=String(t),this._i=0};B.prototype.next=function(){var t=this._s,e=this._i;if("undefined"==typeof t||e>=t.length)return this._s=void 0,{value:void 0,done:!0};var r,n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===t.length?n=1:(r=t.charCodeAt(e+1),n=r<56320||r>57343?1:2),this._i=e+n,{value:t.substr(e,n),done:!1}},j(B.prototype),j(String.prototype,function(){return new B(this)}),f||(m(String.prototype,"startsWith",I.startsWith,!0),m(String.prototype,"endsWith",I.endsWith,!0));var L={from:function(t){var e=arguments.length>1?arguments[1]:void 0,r=C.ToObject(t,"bad iterable");if("undefined"!=typeof e&&!C.IsCallable(e))throw new TypeError("Array.from: when provided, the second argument must be a function");var n,i,o,a,s=arguments.length>2,u=s?arguments[2]:void 0,c=C.IsIterable(r);if(c){o=0,i=C.IsCallable(this)?Object(new this):[];var l,f=c?C.GetIterator(r):null;do l=C.IteratorNext(f),l.done||(a=l.value,e?i[o]=s?e.call(u,a,o):e(a,o):i[o]=a,o+=1);while(!l.done);n=o}else for(n=C.ToLength(r.length),i=C.IsCallable(this)?Object(new this(n)):new Array(n),o=0;o0;)if(e=r.shift(),e in this.object)return U("key"===this.kind?e:"value"===this.kind?this.object[e]:[e,this.object[e]]);return U()}}),j(W.prototype);var z={copyWithin:function(t,e){var r=arguments[2],n=C.ToObject(this),i=C.ToLength(n.length);t=C.ToInteger(t),e=C.ToInteger(e);var o=t<0?Math.max(i+t,0):Math.min(t,i),a=e<0?Math.max(i+e,0):Math.min(e,i);r="undefined"==typeof r?i:C.ToInteger(r);var s=r<0?Math.max(i+r,0):Math.min(r,i),u=Math.min(s-a,i-o),c=1;for(a0;)d(n,a)?n[o]=n[a]:delete n[a],a+=c,o+=c,u-=1;return n},fill:function(t){var e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=C.ToObject(this),i=C.ToLength(n.length);e=C.ToInteger("undefined"==typeof e?0:e),r=C.ToInteger("undefined"==typeof r?i:r);for(var o=e<0?Math.max(i+e,0):Math.min(e,i),a=r<0?i+r:r,s=o;s1?arguments[1]:null,o=0;o1?arguments[1]:null,i=0;i1?NaN:t===-1?-(1/0):1===t?1/0:0===t?t:.5*Math.log((1+t)/(1-t))},cbrt:function(t){if(t=Number(t),0===t)return t;var e,r=t<0;return r&&(t=-t),e=Math.pow(t,1/3),r?-e:e},clz32:function(t){t=Number(t);var e=C.ToUint32(t);return 0===e?32:32-e.toString(2).length},cosh:function(t){return t=Number(t),0===t?1:Number.isNaN(t)?NaN:c(t)?(t<0&&(t=-t),t>21?Math.exp(t)/2:(Math.exp(t)+Math.exp(-t))/2):1/0},expm1:function(t){var e=Number(t);if(e===-(1/0))return-1;if(!c(e)||0===t)return e;if(Math.abs(e)>.5)return Math.exp(e)-1;for(var r=e,n=0,i=1;n+r!==n;)n+=r,i+=1,r*=e/i;return n},hypot:function(t,e){var r=!1,n=!0,i=!1,o=[];if(Array.prototype.every.call(arguments,function(t){var e=Number(t);return Number.isNaN(e)?r=!0:e===1/0||e===-(1/0)?i=!0:0!==e&&(n=!1),!i&&(r||o.push(Math.abs(e)),!0)}),i)return 1/0;if(r)return NaN;if(n)return 0;o.sort(function(t,e){return e-t});var a=o[0],s=o.map(function(t){return t/a}),u=s.reduce(function(t,e){return t+e*e},0);return a*Math.sqrt(u)},log2:function(t){return Math.log(t)*Math.LOG2E},log10:function(t){return Math.log(t)*Math.LOG10E},log1p:function(t){var e=Number(t);return e<-1||Number.isNaN(e)?NaN:0===e||e===1/0?e:e===-1?-(1/0):1+e-1===0?e:e*(Math.log(1+e)/(1+e-1))},sign:function(t){var e=+t;return 0===e?e:Number.isNaN(e)?e:e<0?-1:1},sinh:function(t){var e=Number(t);return c(t)&&0!==t?Math.abs(e)<1?(Math.expm1(e)-Math.expm1(-e))/2:(Math.exp(e-1)-Math.exp(-e-1))*Math.E/2:t},tanh:function(t){var e=Number(t);if(Number.isNaN(t)||0===e)return e;if(e===1/0)return 1;if(e===-(1/0))return-1;var r=Math.expm1(e),n=Math.expm1(-e);return r===1/0?1:n===1/0?-1:(r-n)/(Math.exp(e)+Math.exp(-e))},trunc:function(t){var e=Number(t);return e<0?-Math.floor(-e):Math.floor(e)},imul:function(t,e){t=C.ToUint32(t),e=C.ToUint32(e);var r=t>>>16&65535,n=65535&t,i=e>>>16&65535,o=65535&e;return n*o+(r*o+n*i<<16>>>0)|0},fround:function(t){if(0===t||t===1/0||t===-(1/0)||Number.isNaN(t))return t;var e=Number(t);return P.toFloat32(e)}};w(Math,Z),m(Math,"tanh",Z.tanh,Math.tanh(-2e-17)!==-2e-17),m(Math,"acosh",Z.acosh,Math.acosh(Number.MAX_VALUE)===1/0),m(Math,"sinh",Z.sinh,Math.sinh(-2e-17)!==-2e-17);var K=Math.expm1(10);m(Math,"expm1",Z.expm1,K>22025.465794806718||K<22025.465794806718);var tt=0===Math.round(.5-Number.EPSILON/4)&&1===Math.round(-.5+Number.EPSILON/3.99),et=Math.round;m(Math,"round",function(t){return-.5<=t&&t<.5&&0!==t?Math.sign(0*t):et(t)},!tt),Math.imul(4294967295,5)!==-5&&(Math.imul=Z.imul);var rt=function(){var t,e;C.IsPromise=function(t){return!!C.TypeIsObject(t)&&(!!t._promiseConstructor&&"undefined"!=typeof t._status)};var r,n=function(t){if(!C.IsCallable(t))throw new TypeError("bad promise constructor");var e=this,r=function(t,r){e.resolve=t,e.reject=r};if(e.promise=C.Construct(t,[r]),!e.promise._es6construct)throw new TypeError("bad promise constructor");if(!C.IsCallable(e.resolve)||!C.IsCallable(e.reject))throw new TypeError("bad promise constructor")},i=u.setTimeout;"undefined"!=typeof window&&C.IsCallable(window.postMessage)&&(r=function(){var t=[],e="zero-timeout-message",r=function(r){t.push(r),window.postMessage(e,"*")},n=function(r){if(r.source===window&&r.data===e){if(r.stopPropagation(),0===t.length)return;var n=t.shift();n()}};return window.addEventListener("message",n,!0),r});var a=function(){var t=u.Promise;return t&&t.resolve&&function(e){return t.resolve().then(e)}},s=C.IsCallable(u.setImmediate)?u.setImmediate.bind(u):"object"==typeof o&&o.nextTick?o.nextTick:a()||(C.IsCallable(r)?r():function(t){i(t,0)}),c=function(t,e){if(!C.TypeIsObject(t))return!1;var r=e.resolve,n=e.reject;try{var i=t.then;if(!C.IsCallable(i))return!1;i.call(t,r,n)}catch(t){n(t)}return!0},l=function(t,e){t.forEach(function(t){s(function(){var r=t.handler,n=t.capability,i=n.resolve,o=n.reject;try{var a=r(e);if(a===n.promise)throw new TypeError("self resolution");var s=c(a,n);s||i(a)}catch(t){o(t)}})})},f=function(t,e,r){return function(i){if(i===t)return r(new TypeError("self resolution"));var o=t._promiseConstructor,a=new n(o),s=c(i,a);return s?a.promise.then(e,r):e(i)}};t=function(t){var e=this;if(e=x(e),!e._promiseConstructor)throw new TypeError("bad promise");if("undefined"!=typeof e._status)throw new TypeError("promise already initialized");if(!C.IsCallable(t))throw new TypeError("not a valid resolver");e._status="unresolved",e._resolveReactions=[],e._rejectReactions=[];var r=function(t){if("unresolved"===e._status){var r=e._resolveReactions;e._result=t,e._resolveReactions=void 0,e._rejectReactions=void 0,e._status="has-resolution",l(r,t)}},n=function(t){if("unresolved"===e._status){var r=e._rejectReactions;e._result=t,e._resolveReactions=void 0,e._rejectReactions=void 0,e._status="has-rejection",l(r,t)}};try{t(r,n)}catch(t){n(t)}return e},e=t.prototype;var p=function(t,e,r,n){var i=!1;return function(o){if(!i&&(i=!0,e[t]=o,0===--n.count)){var a=r.resolve;a(e)}}};return m(t,g,function(t){var r=this,n=r.prototype||e;return t=t||E(n),w(t,{_status:void 0,_result:void 0,_resolveReactions:void 0,_rejectReactions:void 0,_promiseConstructor:void 0}),t._promiseConstructor=r,t}),w(t,{all:function(t){var e=this,r=new n(e),i=r.resolve,o=r.reject;try{if(!C.IsIterable(t))throw new TypeError("bad iterable");for(var a=C.GetIterator(t),s=[],u={count:1},c=0;;c++){var l=C.IteratorNext(a);if(l.done)break;var f=e.resolve(l.value),h=p(c,s,r,u);u.count++,f.then(h,r.reject)}0===--u.count&&i(s)}catch(t){o(t)}return r.promise},race:function(t){var e=this,r=new n(e),i=r.resolve,o=r.reject;try{if(!C.IsIterable(t))throw new TypeError("bad iterable");for(var a=C.GetIterator(t);;){var s=C.IteratorNext(a);if(s.done)break;var u=e.resolve(s.value);u.then(i,o)}}catch(t){o(t)}return r.promise},reject:function(t){var e=this,r=new n(e),i=r.reject;return i(t),r.promise},resolve:function(t){var e=this;if(C.IsPromise(t)){var r=t._promiseConstructor;if(r===e)return t}var i=new n(e),o=i.resolve;return o(t),i.promise}}),w(e,{catch:function(t){return this.then(void 0,t)},then:function(t,e){var r=this;if(!C.IsPromise(r))throw new TypeError("not a promise");var i=this.constructor,o=new n(i);C.IsCallable(e)||(e=function(t){throw t}),C.IsCallable(t)||(t=function(t){return t});var a=f(r,t,e),s={capability:o,handler:a},u={capability:o,handler:e};switch(r._status){case"unresolved":r._resolveReactions.push(s),r._rejectReactions.push(u);break;case"has-resolution":l([s],r._result);break;case"has-rejection":l([u],r._result);break;default:throw new TypeError("unexpected")}return o.promise}}),t}();u.Promise&&(delete u.Promise.accept,delete u.Promise.defer,delete u.Promise.prototype.chain),w(u,{Promise:rt});var nt=n(u.Promise,function(t){return t.resolve(42)instanceof t}),it=function(){try{return u.Promise.reject(42).then(null,5).then(null,y),!0}catch(t){return!1}}(),ot=function(){try{Promise.call(3,y)}catch(t){return!0}return!1}();nt&&it&&ot||(Promise=rt,m(u,"Promise",rt,!0));var at=function(t){var e=Object.keys(t.reduce(function(t,e){return t[e]=!0,t},{}));return t.join(":")===e.join(":")},st=at(["z","a","bb"]),ut=at(["z",1,"a","3",2]);if(l){var ct=function(t){if(!st)return null;var e=typeof t;return"string"===e?"$"+t:"number"===e?ut?t:"n"+t:null},lt=function(){return Object.create?Object.create(null):{}},ft={Map:function(){function t(t,e){this.key=t,this.value=e,this.next=null,this.prev=null}function e(t,e){this.head=t._head,this.i=this.head,this.kind=e}function r(e){var r=this;if(!C.TypeIsObject(r))throw new TypeError("Map does not accept arguments when called as a function");if(r=x(r),!r._es6map)throw new TypeError("bad map");var n=new t(null,null);if(n.next=n.prev=n,w(r,{_head:n,_storage:lt(),_size:0}),"undefined"!=typeof e&&null!==e){var i=C.GetIterator(e),o=r.set;if(!C.IsCallable(o))throw new TypeError("bad map");for(;;){var a=C.IteratorNext(i);if(a.done)break;var s=a.value;if(!C.TypeIsObject(s))throw new TypeError("expected iterable of pairs");o.call(r,s[0],s[1])}}return r}var n={};t.prototype.isRemoved=function(){return this.key===n},e.prototype={next:function(){var t,e=this.i,r=this.kind,n=this.head;if("undefined"==typeof this.i)return{value:void 0,done:!0};for(;e.isRemoved()&&e!==n;)e=e.prev;for(;e.next!==n;)if(e=e.next,!e.isRemoved())return t="key"===r?e.key:"value"===r?e.value:[e.key,e.value],this.i=e,{value:t,done:!1};return this.i=void 0,{value:void 0,done:!0}}},j(e.prototype);var i=r.prototype;return m(r,g,function(t){var e=this,r=e.prototype||i;return t=t||E(r),w(t,{_es6map:!0}),t}),_.getter(r.prototype,"size",function(){if("undefined"==typeof this._size)throw new TypeError("size method called on incompatible Map");return this._size}),w(r.prototype,{get:function(t){var e=ct(t);if(null!==e){var r=this._storage[e];return r?r.value:void 0}for(var n=this._head,i=n;(i=i.next)!==n;)if(C.SameValueZero(i.key,t))return i.value},has:function(t){var e=ct(t);if(null!==e)return"undefined"!=typeof this._storage[e];for(var r=this._head,n=r;(n=n.next)!==r;)if(C.SameValueZero(n.key,t))return!0;return!1},set:function(e,r){var n,i=this._head,o=i,a=ct(e);if(null!==a){if("undefined"!=typeof this._storage[a])return this._storage[a].value=r,this;n=this._storage[a]=new t(e,r),o=i.prev}for(;(o=o.next)!==i;)if(C.SameValueZero(o.key,e))return o.value=r,this;return n=n||new t(e,r),C.SameValue(-0,e)&&(n.key=0),n.next=this._head,n.prev=this._head.prev,n.prev.next=n,n.next.prev=n,this._size+=1,this},delete:function(t){var e=this._head,r=e,i=ct(t);if(null!==i){if("undefined"==typeof this._storage[i])return!1;r=this._storage[i].prev,delete this._storage[i]}for(;(r=r.next)!==e;)if(C.SameValueZero(r.key,t))return r.key=r.value=n,r.prev.next=r.next,r.next.prev=r.prev,this._size-=1,!0;return!1},clear:function(){this._size=0,this._storage=lt();for(var t=this._head,e=t,r=e.next;(e=r)!==t;)e.key=e.value=n,r=e.next,e.next=e.prev=t;t.next=t.prev=t},keys:function(){return new e(this,"key")},values:function(){return new e(this,"value")},entries:function(){return new e(this,"key+value")},forEach:function(t){for(var e=arguments.length>1?arguments[1]:null,r=this.entries(),n=r.next();!n.done;n=r.next())e?t.call(e,n.value[1],n.value[0],this):t(n.value[1],n.value[0],this)}}),j(r.prototype,function(){return this.entries()}),r}(),Set:function(){var t=function(t){var e=this;if(!C.TypeIsObject(e))throw new TypeError("Set does not accept arguments when called as a function");if(e=x(e),!e._es6set)throw new TypeError("bad set");if(w(e,{"[[SetData]]":null,_storage:lt()}),"undefined"!=typeof t&&null!==t){var r=C.GetIterator(t),n=e.add;if(!C.IsCallable(n))throw new TypeError("bad set");for(;;){var i=C.IteratorNext(r);if(i.done)break;var o=i.value;n.call(e,o)}}return e},e=t.prototype;m(t,g,function(t){var r=this,n=r.prototype||e;return t=t||E(n),w(t,{_es6set:!0}),t});var r=function(t){if(!t["[[SetData]]"]){var e=t["[[SetData]]"]=new ft.Map;Object.keys(t._storage).forEach(function(t){t=36===t.charCodeAt(0)?t.slice(1):"n"===t.charAt(0)?+t.slice(1):+t,e.set(t,t)}),t._storage=null}};return _.getter(t.prototype,"size",function(){if("undefined"==typeof this._storage)throw new TypeError("size method called on incompatible Set");return r(this),this["[[SetData]]"].size}),w(t.prototype,{has:function(t){var e;return this._storage&&null!==(e=ct(t))?!!this._storage[e]:(r(this),this["[[SetData]]"].has(t))},add:function(t){var e;return this._storage&&null!==(e=ct(t))?(this._storage[e]=!0,this):(r(this),this["[[SetData]]"].set(t,t),this)},delete:function(t){var e;if(this._storage&&null!==(e=ct(t))){var n=d(this._storage,e);return delete this._storage[e]&&n}return r(this),this["[[SetData]]"].delete(t)},clear:function(){this._storage?this._storage=lt():this["[[SetData]]"].clear()},values:function(){return r(this),this["[[SetData]]"].values()},entries:function(){return r(this),this["[[SetData]]"].entries()},forEach:function(t){var e=arguments.length>1?arguments[1]:null,n=this;r(n),this["[[SetData]]"].forEach(function(r,i){e?t.call(e,i,i,n):t(i,i,n)})}}),m(t,"keys",t.values,!0),j(t.prototype,function(){return this.values()}),t}()};w(u,ft),(u.Map||u.Set)&&("function"!=typeof u.Map.prototype.clear||0!==(new u.Set).size||0!==(new u.Map).size||"function"!=typeof u.Map.prototype.keys||"function"!=typeof u.Set.prototype.keys||"function"!=typeof u.Map.prototype.forEach||"function"!=typeof u.Set.prototype.forEach||r(u.Map)||r(u.Set)||!n(u.Map,function(t){var e=new t([]);return e.set(42,42),e instanceof t}))&&(u.Map=ft.Map,u.Set=ft.Set),u.Set.prototype.keys!==u.Set.prototype.values&&m(u.Set.prototype,"keys",u.Set.prototype.values,!0),j(Object.getPrototypeOf((new u.Map).keys())),j(Object.getPrototypeOf((new u.Set).keys()))}u.Reflect||m(u,"Reflect",{});var pt=u.Reflect,ht=function(t){if(!C.TypeIsObject(t))throw new TypeError("target must be an object")};if(w(u.Reflect,{apply:function(){return C.Call.apply(null,arguments)},construct:function(t,e){if(!C.IsCallable(t))throw new TypeError("First argument must be callable.");return C.Construct(t,e)},deleteProperty:function(t,e){if(ht(t),l){var r=Object.getOwnPropertyDescriptor(t,e);if(r&&!r.configurable)return!1}return delete t[e]},enumerate:function(t){return ht(t),new W(t,"key")},has:function(t,e){return ht(t),e in t}}),Object.getOwnPropertyNames&&w(u.Reflect,{ownKeys:function(t){ht(t);var e=Object.getOwnPropertyNames(t);return C.IsCallable(Object.getOwnPropertySymbols)&&e.push.apply(e,Object.getOwnPropertySymbols(t)),e}}),Object.preventExtensions&&w(u.Reflect,{isExtensible:function(t){return ht(t),Object.isExtensible(t)},preventExtensions:function(t){return ht(t),vt(function(){Object.preventExtensions(t)})}}),l){var dt=function(t,e,r){var n=Object.getOwnPropertyDescriptor(t,e);if(!n){var i=Object.getPrototypeOf(t);if(null===i)return;return dt(i,e,r)}return"value"in n?n.value:n.get?n.get.call(r):void 0},yt=function(t,e,r,n){var i=Object.getOwnPropertyDescriptor(t,e);if(!i){var o=Object.getPrototypeOf(t);if(null!==o)return yt(o,e,r,n);i={value:void 0,writable:!0,enumerable:!0,configurable:!0}}if("value"in i){if(!i.writable)return!1;if(!C.TypeIsObject(n))return!1;var a=Object.getOwnPropertyDescriptor(n,e);return a?pt.defineProperty(n,e,{value:r}):pt.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}return!!i.set&&(i.set.call(n,r),!0)},vt=function(t){try{t()}catch(t){return!1}return!0};w(u.Reflect,{defineProperty:function(t,e,r){return ht(t),vt(function(){Object.defineProperty(t,e,r)})},getOwnPropertyDescriptor:function(t,e){return ht(t),Object.getOwnPropertyDescriptor(t,e)},get:function(t,e){ht(t);var r=arguments.length>2?arguments[2]:t;return dt(t,e,r)},set:function(t,e,r){ht(t);var n=arguments.length>3?arguments[3]:t;return yt(t,e,r,n)}})}if(Object.getPrototypeOf){var gt=Object.getPrototypeOf;w(u.Reflect,{getPrototypeOf:function(t){return ht(t),gt(t)}})}if(Object.setPrototypeOf){var bt=function(t,e){for(;e;){if(t===e)return!0;e=pt.getPrototypeOf(e)}return!1};w(u.Reflect,{setPrototypeOf:function(t,e){if(ht(t),null!==e&&!C.TypeIsObject(e))throw new TypeError("proto must be an object or null");return e===pt.getPrototypeOf(t)||!(pt.isExtensible&&!pt.isExtensible(t))&&(!bt(t,e)&&(Object.setPrototypeOf(t,e),!0))}})}if("Invalid Date"!==String(new Date(NaN))){var mt=Date.prototype.toString,_t=function(){var t=+this;return t!==t?"Invalid Date":mt.call(this)};m(_t,"toString",mt.toString,!0),m(Date.prototype,"toString",_t,!0)}var wt={anchor:function(t){return C.CreateHTML(this,"a","name",t)},big:function(){return C.CreateHTML(this,"big","","")},blink:function(){return C.CreateHTML(this,"blink","","")},bold:function(){
-return C.CreateHTML(this,"b","","")},fixed:function(){return C.CreateHTML(this,"tt","","")},fontcolor:function(t){return C.CreateHTML(this,"font","color",t)},fontsize:function(t){return C.CreateHTML(this,"font","size",t)},italics:function(){return C.CreateHTML(this,"i","","")},link:function(t){return C.CreateHTML(this,"a","href",t)},small:function(){return C.CreateHTML(this,"small","","")},strike:function(){return C.CreateHTML(this,"strike","","")},sub:function(){return C.CreateHTML(this,"sub","","")},sup:function(){return C.CreateHTML(this,"sup","","")}};return w(String.prototype,wt),Object.keys(wt).forEach(function(t){var e=String.prototype[t],r=!1;if(C.IsCallable(e)){var n=e.call("",' " '),i=[].concat(n.match(/"/g)).length;r=n!==n.toLowerCase()||i>2}else r=!0;r&&m(String.prototype,t,wt[t],!0)}),u})}).call(e,r(2))},function(t,e,r){var n={};!function(e){t.exports=n}(e),function(){var t=!1,e=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(r){function n(){!t&&this.init&&this.init.apply(this,arguments)}var i=this.prototype;t=!0;var o=new this;t=!1;for(var a in r)o[a]="function"==typeof r[a]&&"function"==typeof i[a]&&e.test(r[a])?function(t,e){return function(){var r=this._super;this._super=i[t];var n=e.apply(this,arguments);return this._super=r,n}}(a,r[a]):r[a];return n.prototype=o,n.prototype.constructor=n,n.extend=arguments.callee,n}}(),n.Decoder=Class.extend({init:function(t){function e(t){for(var e=Math.max.apply(null,t),r=0;r8)throw"byteBuffer too small";for(var r=0;r>>=1,t&&(T.byteBuffer|=128),8==T.bitCounter&&(T.wordBuffer.push(T.byteBuffer),T.byteBuffer=0)}function a(t){var e="";t.length&&(t.forEach(function(t){e+=String.fromCharCode(t)}),t.length=0),j(e)}var s,u,c,l,f,p,h,d,y,v,g,b,m,_,w=this,E=t.debug,O="",j=t.onReceive,S=t.sampleRate,T={current:0,PREAMBLE:1,START:2,DATA:3,STOP:4,bitCounter:0,byteBuffer:0,wordBuffer:[],lastTransition:0,lastBitState:0,t:0,c:0};w.setProfile=function(t){u=t.baud,c=t.freqLow,l=t.freqHigh,f=Math.ceil(S/u),p=Math.ceil(40*S/1e3/f),h=new Float32Array(f/2),d=new Float32Array(f/2),y=new Float32Array(f/2),v=new Float32Array(f/2),g=new Float32Array(f/2),b=new Float32Array(f/2),m=new Float32Array(f/2),_=new Float32Array(f/2),function(){for(var t=2*Math.PI*(c/S),e=2*Math.PI*(l/S),r=0;r=12&&a<=p+20&&(r=T.START,T.lastBitState=0,T.byteBuffer=0,T.wordBuffer=[]);break;case T.START:E&&console.log("START"),T.bitCounter=0,1==a?r=T.DATA:a>1&&a<=9?(r=9==a?T.STOP:T.DATA,o(0,a-1)):r=T.PREAMBLE;break;case T.DATA:E&&console.log("DATA");var s=a+T.bitCounter,u=1^T.lastBitState;s>11?r=T.PREAMBLE:11==s?(o(1,a-3),r=T.START,E&&console.log(">emit< "+T.wordBuffer[0].toString(2)),C(T.wordBuffer),T.wordBuffer=[]):10==s?(o(1,a-2),r=T.PREAMBLE,E&&console.log("|emit| "+T.wordBuffer[0].toString(2)),C(T.wordBuffer)):9==s?(o(1,a-1),r=T.START):8==s?(o(u,a),r=T.STOP,T.lastBitState=u):(o(u,a),r=T.DATA,T.lastBitState=u),0==a&&(r=T.PREAMBLE,E&&console.log("#demod error#"));break;case T.STOP:E&&console.log(" STOP"),1==a?r=T.START:3==a?(r=T.START,E&&console.log(">>emit<< "+T.wordBuffer[0].toString(2)),C(T.wordBuffer),T.wordBuffer=[]):a>=2?(r=T.PREAMBLE,E&&console.log("||emit|| "+T.wordBuffer[0].toString(2)),C(T.wordBuffer)):r=T.PREAMBLE;break;default:r=T.PREAMBLE,T.bitCounter=0,T.byteBuffer=0}T.current=r}}}}),n.Encoder=Class.extend({init:function(t){function e(t){for(var e=[],r=0;r>>6),e.push(128|63&n);else if(n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{for(var i=4;n>>>6*i;)i++;for(e.push(65280>>>i&255|n>>>6*--i);i--;)e[idx++]=128|n>>>6*i&63}}return e}var r,i,o,a,s,u,c,l,f,p,h=this,d=44100,y=t.sampleRate;h.setProfile=function(t){r=t.baud,i=t.freqLow,o=t.freqHigh,a=Math.ceil(d/r),s=Math.ceil(40*d/1e3/a),u=t.softmodem?1:2,c=new Float32Array(a),l=new Float32Array(a),f="undefined"!=typeof t.raw&&t.raw,p=t.softmodem,function(){for(var t=2*Math.PI*i/d,e=2*Math.PI*o/d,r=0;r>=1)i(1&m,1);i(1,1),p||i(0,1),t.debug&&console.log("gen. audio length: "+v.length);var w=new n.Resampler({inRate:d,outRate:y,inputBuffer:v});w.resample(v.length);var E=w.outputBuffer();return t.debug&&console.log("resampled audio length: "+E.length),E}}}),n.Profiles={SoftModem:{baud:1225,freqLow:4900,freqHigh:7350,echoCancellation:!1,softmodem:!0},SoftModemLowFrequencies:{baud:1225,freqLow:2450,freqHigh:4900,echoCancellation:!0,softmodem:!0},Browser:{baud:1225,freqLow:19600,freqHigh:20825,echoCancellation:!1,softmodem:!1}},n.Resampler=Class.extend({init:function(t){function e(t){var e=0;if(t>0){var r=s,n=0,i=0,c=0,e=0;for(r-=1,t-=1,c=Math.floor(r);c0){var e=0,r=0,n=0,i=0,l=!c;c=!1;var f=0;do{for(l?(e=a,r=0):(e=s,r=u[0],l=!0);e>0&&n=i)){r+=d[n]*e,f+=e,e=0;break}r+=d[n++]*i,f=n,e-=i}if(!(e<=0)){s=e,u[0]=r,c=!0;break}o[t++]=r/a}while(n0&&h>0))throw new Error("Invalid settings specified for the resampler.");p==h?(l=n,a=1,o=d):(i(),a=p/h,p"),this.scrollTop(this[0].scrollHeight)},u.sysexResponse(c,function(t){}),u.sysexResponse(l,function(t){}),u.sysexResponse(f,function(t){});var n=t("#digital")[0],i=t("#analog")[0];n.disabled=!0,i.disabled=!0,u.on("ready",function(){e(),r.appends("READY! Press 'Query Capabilities' to enable analogRead."),n.disabled=!1,u.queryAnalogMapping(function(t){i.disabled=!1})}),t("#capab").click(function(){u.queryCapabilities(function(){r.appends("Received capabilities."),u.queryAnalogMapping(function(t){r.appends("Received analog mapping. Ready to read."),i.disabled=!1})})}),t("#firmware").click(function(){u.queryFirmware(function(){e()})}),n.onclick=function(){if(u.isReady){var e=t("#pin").val(),r="0"==t("#state").val()?u.LOW:u.HIGH;console.log("digitalWrite("+e+","+r+")"),u.pinMode(e,u.MODES.OUTPUT),u.digitalWrite(e,r)}},i.onclick=function(){if(u.isReady){var e=t("#apin").val();console.log("analogRead("+e+")"),u.setSamplingInterval(200),u.analogRead(e,function(t){console.log("Received analog value: "+t),r.appends("Analog Pin "+e+": "+t)})}},t("#reset").click(function(){u.reset()})}),t.exports={board:u,setOptions:n}},function(t,e,r){(function(e,n,i){function o(t,e,r){function n(){i.isReady=!0,i.emit("ready"),"function"==typeof r&&r()}if("function"!=typeof e&&"undefined"!=typeof e||(r=e,e={}),!(this instanceof o))return new o(t,e,r);u.call(this);var i=this,a={reportVersionTimeout:5e3,samplingInterval:19,serialport:{baudRate:57600,bufferSize:1}},s=Object.assign({},a,e);this.isReady=!1,this.MODES={INPUT:0,OUTPUT:1,ANALOG:2,PWM:3,SERVO:4,SHIFT:5,I2C:6,ONEWIRE:7,STEPPER:8,SERIAL:10,IGNORE:127,PING_READ:117,UNKOWN:16},this.I2C_MODES={WRITE:0,READ:1,CONTINUOUS_READ:2,STOP_READING:3},this.STEPPER={TYPE:{DRIVER:1,TWO_WIRE:2,FOUR_WIRE:4},RUNSTATE:{STOP:0,ACCEL:1,DECEL:2,RUN:3},DIRECTION:{CCW:0,CW:1}},this.SERIAL_MODES={CONTINUOUS_READ:0,STOP_READING:1},this.SERIAL_PORT_IDs={HW_SERIAL0:0,HW_SERIAL1:1,HW_SERIAL2:2,HW_SERIAL3:3,SW_SERIAL0:8,SW_SERIAL1:9,SW_SERIAL2:16,SW_SERIAL3:17,DEFAULT:8},this.SERIAL_PIN_TYPES={RES_RX0:0,RES_TX0:1,RES_RX1:2,RES_TX1:3,RES_RX2:4,RES_TX2:5,RES_RX3:6,RES_TX3:7},this.HIGH=1,this.LOW=0,this.pins=[],this.analogPins=[],this.version={},this.firmware={},this.currentBuffer=[],this.versionReceived=!1,this.name="Firmata",this.settings=s,"object"==typeof t?this.transport=t:this.transport=new f.SerialPort(t,s.serialport),this.sp=this.transport,this.transport.on("close",function(){this.emit("close")}.bind(this)),this.transport.on("disconnect",function(){this.emit("disconnect")}.bind(this)),this.transport.on("open",function(){this.emit("open"),this.emit("connect")}.bind(this)),this.transport.on("error",function(t){this.isReady||"function"!=typeof r?this.emit("error",t):r(t)}.bind(this)),this.transport.on("data",function(t){for(var e,r,n,i,o,a,s=0;s0?(r=this.currentBuffer[s],r>127&&(this.currentBuffer.length=0,this.currentBuffer.push(r))):i!==et&&(n=i=.13?15:n.IS_TEST_MODE?!function(){var t=new Error('Cannot find module "../test/MockSerialPort"');throw t.code="MODULE_NOT_FOUND",t}():16)}catch(t){}if(null==f)throw console.log("It looks like serialport didn't compile properly. This is a common problem and its fix is well documented here https://github.com/voodootikigod/node-serialport#to-install"),"Missing serialport dependency";var h=105,d=106,y=224,v=107,g=108,b=144,m=247,_=111,w=120,E=119,O=118,j=24,S=65,T=115,C=16,x=67,P=8,R=1,A=69,k=68,I=66,M=64,N=60,F=32,B=244,L=109,D=110,U=117,W=121,z=192,q=208,H=249,V=122,$=112,G=96,Y=16,X=32,Q=48,J=64,Z=80,K=96,tt=112,et=240,rt=114,nt=113,it=255,ot=128,at={};at[H]=function(t){t.version.major=t.currentBuffer[1],t.version.minor=t.currentBuffer[2],t.emit("reportversion")},at[y]=function(t){var e=t.currentBuffer[1]|t.currentBuffer[2]<<7,r=15&t.currentBuffer[0];t.pins[t.analogPins[r]]&&(t.pins[t.analogPins[r]].value=e),t.emit("analog-read-"+r,e),t.emit("analog-read",{pin:r,value:e})},at[b]=function(t){for(var e=15&t.currentBuffer[0],r=t.currentBuffer[1]|t.currentBuffer[2]<<7,n=0;n<8;n++){var i=8*e+n,o=t.pins[i];o&&o.mode===t.MODES.INPUT&&(o.value=r>>(7&n)&1,t.emit("digital-read-"+i,o.value),t.emit("digital-read",{pin:i,value:o.value}))}};var st={};st[W]=function(t){for(var e=t.currentBuffer.length-2,r=new i(Math.round((e-4)/2)),n=0,o=0,a=4;a6&&(t.pins[e].state|=t.currentBuffer[5]<<7),t.currentBuffer.length>7&&(t.pins[e].state|=t.currentBuffer[6]<<14),t.emit("pin-state-"+e)},st[d]=function(t){for(var e,r=0,n=2;n15?(r[0]=et,r[1]=_,r[2]=t,r[3]=127&e,r[4]=e>>7&127,e>16384&&(r[r.length]=e>>14&127),e>2097152&&(r[r.length]=e>>21&127),e>268435456&&(r[r.length]=e>>28&127),r[r.length]=m):r.push(y|t,127&e,e>>7&127),this.transport.write(new i(r))},o.prototype.pwmWrite=o.prototype.analogWrite,o.prototype.servoConfig=function(t,e,r){var n;if("object"==typeof t&&null!==t&&(n=t,t=n.pin,e=n.min,r=n.max),"undefined"==typeof t)throw new Error("servoConfig: pin must be specified");if("undefined"==typeof e)throw new Error("servoConfig: min must be specified");if("undefined"==typeof r)throw new Error("servoConfig: max must be specified");var o=[et,$,t,127&e,e>>7&127,127&r,r>>7&127,m];this.pins[t].mode=this.MODES.SERVO,this.transport.write(new i(o))},o.prototype.servoWrite=function(t,e){this.analogWrite.apply(this,arguments)},o.prototype.pinMode=function(t,e){this.pins[t].mode=e,this.transport.write(new i([B,t,e]))},o.prototype.digitalWrite=function(t,e){var r,n=Math.floor(t/8),o=0;this.pins[t].value=e;for(var a=0;a<8;a++)r=this.pins[8*n+a],r&&r.value&&(o|=1<>7&127]))},o.prototype.digitalRead=function(t,e){this.reportDigitalPin(t,1),this.addListener("digital-read-"+t,e)},o.prototype.queryCapabilities=function(t){this.once("capability-query",t),this.transport.write(new i([et,v,m]))},o.prototype.queryAnalogMapping=function(t){this.once("analog-mapping-query",t),this.transport.write(new i([et,h,m]))},o.prototype.queryPinState=function(t,e){this.once("pin-state-"+t,e),this.transport.write(new i([et,L,t,m]))},o.prototype.sendString=function(t){var e=new i(t+"\0","utf8"),r=[];r.push(et),r.push(nt);for(var n=0,o=e.length;n>7&127);r.push(m),this.transport.write(r)},o.prototype.sendI2CConfig=function(t){return this.i2cConfig(t)},o.prototype.i2cConfig=function(t){var e,r=p.get(this);return r||(r={},p.set(this,r)),"number"==typeof t?e=t:"object"==typeof t&&null!==t&&(e=Number(t.delay),"undefined"!=typeof t.address&&(r[t.address]||(r[t.address]={stopTX:!0}),t.settings,Object.assign(r[t.address],t.settings))),r.delay=e=e||0,a(this,[et,w,255&e,e>>8&255,m]),this},o.prototype.sendI2CWriteRequest=function(t,e){var r=[];e=e||[],r.push(et,O,t,this.I2C_MODES.WRITE<<3);for(var n=0,i=e.length;n>7&127);r.push(m),a(this,r)},o.prototype.i2cWrite=function(t,e,r){var n,o=[et,O,t,this.I2C_MODES.WRITE<<3];if(3===arguments.length&&!Array.isArray(e)&&!Array.isArray(r))return this.i2cWriteReg(t,e,r);2===arguments.length&&(Array.isArray(e)?(r=e.slice(),e=r.shift()):r=[]),n=new i([e].concat(r));for(var s=0,u=n.length;s>7&127);return o.push(m),a(this,o),this},o.prototype.i2cWriteReg=function(t,e,r){return a(this,[et,O,t,this.I2C_MODES.WRITE<<3,127&e,e>>7&127,127&r,r>>7&127,m]),this},o.prototype.sendI2CReadRequest=function(t,e,r){a(this,[et,O,t,this.I2C_MODES.READ<<3,127&e,e>>7&127,m]),this.once("I2C-reply-"+t+"-0",r)},o.prototype.i2cRead=function(t,e,r,n){3===arguments.length&&"number"==typeof e&&"function"==typeof r&&(n=r,r=e,e=null);var i="I2C-reply-"+t+"-",o=[et,O,t,this.I2C_MODES.CONTINUOUS_READ<<3];return null!==e?o.push(127&e,e>>7&127):e=0,i+=e,o.push(127&r,r>>7&127,m),this.on(i,n),a(this,o),this},o.prototype.i2cReadOnce=function(t,e,r,n){3===arguments.length&&"number"==typeof e&&"function"==typeof r&&(n=r,r=e,e=null);var i="I2C-reply-"+t+"-",o=[et,O,t,this.I2C_MODES.READ<<3];return null!==e?o.push(127&e,e>>7&127):e=0,i+=e,o.push(127&r,r>>7&127,m),this.once(i,n),a(this,o),this},o.prototype.sendOneWireConfig=function(t,e){this.transport.write(new i([et,T,S,t,e?1:0,m]))},o.prototype.sendOneWireSearch=function(t,e){this._sendOneWireSearch(M,"1-wire-search-reply-"+t,t,e)},o.prototype.sendOneWireAlarmsSearch=function(t,e){this._sendOneWireSearch(k,"1-wire-search-alarms-reply-"+t,t,e)},o.prototype._sendOneWireSearch=function(t,e,r,n){this.transport.write(new i([et,T,t,r,m]));var o=setTimeout(function(){n(new Error("1-Wire device search timeout - are you running ConfigurableFirmata?"))},5e3);this.once(e,function(t){clearTimeout(o),n(null,t)})},o.prototype.sendOneWireRead=function(t,e,r,n){var i=Math.floor(255*Math.random()),o=setTimeout(function(){n(new Error("1-Wire device read timeout - are you running ConfigurableFirmata?"))},5e3);this._sendOneWireRequest(t,P,e,r,i,null,null,"1-wire-read-reply-"+i,function(t){clearTimeout(o),n(null,t)})},o.prototype.sendOneWireReset=function(t){this._sendOneWireRequest(t,R)},o.prototype.sendOneWireWrite=function(t,e,r){this._sendOneWireRequest(t,F,e,null,null,null,Array.isArray(r)?r:[r])},o.prototype.sendOneWireDelay=function(t,e){this._sendOneWireRequest(t,C,null,null,null,e)},o.prototype.sendOneWireWriteAndRead=function(t,e,r,n,i){var o=Math.floor(255*Math.random()),a=setTimeout(function(){i(new Error("1-Wire device read timeout - are you running ConfigurableFirmata?"))},5e3);this._sendOneWireRequest(t,F|P,e,n,o,null,Array.isArray(r)?r:[r],"1-wire-read-reply-"+o,function(t){clearTimeout(a),i(null,t)})},o.prototype._sendOneWireRequest=function(t,e,r,n,o,a,s,u,l){var f=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];(r||n||o||a||s)&&(e|=N),r&&f.splice.apply(f,[0,8].concat(r)),n&&(f[8]=255&n,f[9]=n>>8&255),o&&(f[10]=255&o,f[11]=o>>8&255),a&&(f[12]=255&a,f[13]=a>>8&255,f[14]=a>>16&255,f[15]=a>>24&255),s&&s.forEach(function(t){f.push(t)});var p=[et,T,e,t];p=p.concat(c.to7BitArray(f)),p.push(m),this.transport.write(new i(p)),u&&l&&this.once(u,l)},o.prototype.setSamplingInterval=function(t){var e=t<10?10:t>65535?65535:t;this.settings.samplingInterval=e,this.transport.write(new i([et,V,127&e,e>>7&127,m]))},o.prototype.getSamplingInterval=function(t){return this.settings.samplingInterval},o.prototype.reportAnalogPin=function(t,e){0!==e&&1!==e||(this.pins[this.analogPins[t]].report=e,this.transport.write(new i([z|t,e])))},o.prototype.reportDigitalPin=function(t,e){var r=Math.floor(t/8);0!==e&&1!==e||(this.pins[t].report=e,this.transport.write(new i([q|r,e])))},o.prototype.pingRead=function(t,e){if(this.pins[t.pin].supportedModes.indexOf(U)===-1)throw new Error("Please upload PingFirmata to the board");var r=t.pin,n=t.value,o=t.pulseOut||0,a=t.timeout||1e6,s=[o>>24&255,o>>16&255,o>>8&255,255&o],u=[a>>24&255,a>>16&255,a>>8&255,255&a],c=[et,U,r,n,127&s[0],s[0]>>7&127,127&s[1],s[1]>>7&127,127&s[2],s[2]>>7&127,127&s[3],s[3]>>7&127,127&u[0],u[0]>>7&127,127&u[1],u[1]>>7&127,127&u[2],u[2]>>7&127,127&u[3],u[3]>>7&127,m];this.transport.write(new i(c)),this.once("ping-read-"+r,e)},o.prototype.stepperConfig=function(t,e,r,n,o,a,s){var u=[et,rt,0,t,e,127&r,r>>7&127,n,o];e===this.STEPPER.TYPE.FOUR_WIRE&&u.push(a,s),u.push(m),this.transport.write(new i(u))},o.prototype.stepperStep=function(t,e,r,n,o,a,s){"function"==typeof o&&(s=o,o=0,a=0);var u=[et,rt,1,t,e,127&r,r>>7&127,r>>14&127,127&n,n>>7&127];(o>0||a>0)&&u.push(127&o,o>>7&127,127&a,a>>7&127),u.push(m),this.transport.write(new i(u)),this.once("stepper-done-"+t,s)},o.prototype.serialConfig=function(t){var e,r,n,o;if("object"==typeof t&&null!==t&&(e=t.portId,r=t.baud,n=t.rxPin,o=t.txPin),"undefined"==typeof e)throw new Error("portId must be specified, see SERIAL_PORT_IDs for options.");r=r||57600;var a=[et,G,Y|e,127&r,r>>7&127,r>>14&127];if(e>7&&"undefined"!=typeof n&&"undefined"!=typeof o)a.push(n),a.push(o);else if(e>7)throw new Error("Both RX and TX pins must be defined when using Software Serial.");a.push(m),this.transport.write(new i(a))},o.prototype.serialWrite=function(t,e){for(var r=[et,G,X|t],n=0,o=e.length;n>7&127);r.push(m),r.length>0&&this.transport.write(new i(r))},o.prototype.serialRead=function(t,e,r){var n=[et,G,Q|t,this.SERIAL_MODES.CONTINUOUS_READ];2===arguments.length&&"function"==typeof e?r=e:(n.push(127&e),n.push(e>>7&127)),n.push(m),this.transport.write(new i(n)),this.on("serial-data-"+t,r)},o.prototype.serialStop=function(t){var e=[et,G,Q|t,this.SERIAL_MODES.STOP_READING,m];this.transport.write(new i(e)),this.removeAllListeners("serial-data-"+t)},o.prototype.serialClose=function(t){var e=[et,G,Z|t,m];this.transport.write(new i(e))},o.prototype.serialFlush=function(t){var e=[et,G,K|t,m];this.transport.write(new i(e))},o.prototype.serialListen=function(t){if(!(t<8)){var e=[et,G,tt|t,m];this.transport.write(new i(e))}},o.prototype.sysexResponse=function(t,e){if(o.SYSEX_RESPONSE[t])throw new Error(t+" is not an available SYSEX_RESPONSE byte");return o.SYSEX_RESPONSE[t]=function(t){e(t.currentBuffer.slice(2,-1))},this},o.prototype.sysexCommand=function(t){if(!t.length)throw new Error("Sysex Command cannot be empty");var e=t.slice();return e.unshift(et),e.push(m),this.transport.write(new i(e)),this},o.prototype.reset=function(){this.transport.write(new i([it]))},o.isAcceptablePort=function(t){var e=/usb|acm|^com/i;return!!e.test(t.comName)},o.requestPort=function(t){f.list(function(e,r){var n=r.find(function(t){if(o.isAcceptablePort(t))return t});n?t(null,n):t(new Error("No Acceptable Port Found"),null)})},o.Board=o,o.SYSEX_RESPONSE=st,o.MIDI_RESPONSE=at,o.encode=function(t){for(var e=[],r=t.length,n=0;n>7&127);return e},o.decode=function(t){var e=[];if(t.length%2!==0)throw new Error("Board.decode(data) called with odd number of data bytes");for(;t.length;){var r=t.shift(),n=t.shift();e.push(r|n<<7)}return e},n.IS_TEST_MODE&&(o.test={i2cPeripheralSettings:function(t){return p.get(t)},get i2cActive(){return p}}),t.exports=o}).call(e,r(3),function(){return this}(),r(4).Buffer)},function(t,e){function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(t){if(l===setTimeout)return setTimeout(t,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(t,0);try{return l(t,0)}catch(e){try{return l.call(null,t,0)}catch(e){return l.call(this,t,0)}}}function o(t){if(f===clearTimeout)return clearTimeout(t);if((f===n||!f)&&clearTimeout)return f=clearTimeout,clearTimeout(t);try{return f(t)}catch(e){try{return f.call(null,t)}catch(e){return f.call(this,t)}}}function a(){y&&h&&(y=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!y){var t=i(a);y=!0;for(var e=d.length;e;){for(h=d,d=[];++v1)for(var r=1;r=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function v(e){return+e!=e&&(e=0),t.alloc(+e)}function g(e,r){if(t.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(i)return V(e).length;r=(""+r).toLowerCase(),i=!0}}function b(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return P(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:w(e,r,n,i,o);if("number"==typeof r)return r&=255,t.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):w(e,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){function o(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}var a=1,s=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a=2,s/=2,u/=2,r/=2}var c;if(i){var l=-1;for(c=r;cs&&(r=s-u),c=r;c>=0;c--){for(var f=!0,p=0;pi&&(n=i)):n=i;var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=r){var u,c,l,f;switch(s){case 1:o<128&&(a=o);break;case 2:u=t[i+1],128===(192&u)&&(f=(31&o)<<6|63&u,f>127&&(a=f));break;case 3:u=t[i+1],c=t[i+2],128===(192&u)&&128===(192&c)&&(f=(15&o)<<12|(63&u)<<6|63&c,f>2047&&(f<55296||f>57343)&&(a=f));break;case 4:u=t[i+1],c=t[i+2],l=t[i+3],128===(192&u)&&128===(192&c)&&128===(192&l)&&(f=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&l,f>65535&&f<1114112&&(a=f))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return R(n)}function R(t){var e=t.length;if(e<=tt)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function F(e,r,n,i,o,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||re.length)throw new RangeError("Index out of range")}function B(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function L(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function U(t,e,r,n,i){return i||D(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),Z.write(t,e,r,n,23,4),r+4}function W(t,e,r,n,i){return i||D(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),Z.write(t,e,r,n,52,8),r+8}function z(t){if(t=q(t).replace(et,""),t.length<2)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function H(t){return t<16?"0"+t.toString(16):t.toString(16)}function V(t,e){e=e||1/0;for(var r,n=t.length,i=null,o=[],a=0;a55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function $(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n);return o}function Y(t){return J.toByteArray(z(t))}function X(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Q(t){return t!==t}var J=r(5),Z=r(6),K=r(7);e.Buffer=t,e.SlowBuffer=v,e.INSPECT_MAX_BYTES=50,t.TYPED_ARRAY_SUPPORT=void 0!==n.TYPED_ARRAY_SUPPORT?n.TYPED_ARRAY_SUPPORT:i(),e.kMaxLength=o(),t.poolSize=8192,t._augment=function(e){return e.__proto__=t.prototype,e},t.from=function(t,e,r){return s(null,t,e,r)},t.TYPED_ARRAY_SUPPORT&&(t.prototype.__proto__=Uint8Array.prototype,t.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&t[Symbol.species]===t&&Object.defineProperty(t,Symbol.species,{value:null,configurable:!0})),t.alloc=function(t,e,r){return c(null,t,e,r)},t.allocUnsafe=function(t){return l(null,t)},t.allocUnsafeSlow=function(t){return l(null,t)},t.isBuffer=function(t){return!(null==t||!t._isBuffer)},t.compare=function(e,r){if(!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},t.prototype.compare=function(e,r,n,i,o){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var a=o-i,s=n-r,u=Math.min(a,s),c=this.slice(i,o),l=e.slice(r,n),f=0;fi)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return O(this,t,e,r);case"ascii":return j(this,t,e,r);case"latin1":case"binary":return S(this,t,e,r);case"base64":return T(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;t.prototype.slice=function(e,r){var n=this.length;e=~~e,r=void 0===r?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r0&&(i*=256);)n+=this[t+--e]*i;return n},t.prototype.readUInt8=function(t,e){return e||N(t,1,this.length),this[t]},t.prototype.readUInt16LE=function(t,e){return e||N(t,2,this.length),this[t]|this[t+1]<<8},t.prototype.readUInt16BE=function(t,e){return e||N(t,2,this.length),this[t]<<8|this[t+1]},t.prototype.readUInt32LE=function(t,e){return e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},t.prototype.readUInt32BE=function(t,e){return e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},t.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=this[t],i=1,o=0;++o=i&&(n-=Math.pow(2,8*e)),n},t.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||N(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},t.prototype.readInt8=function(t,e){return e||N(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},t.prototype.readInt16LE=function(t,e){e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(t,e){e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(t,e){return e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},t.prototype.readInt32BE=function(t,e){return e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},t.prototype.readFloatLE=function(t,e){return e||N(t,4,this.length),Z.read(this,t,!0,23,4)},t.prototype.readFloatBE=function(t,e){return e||N(t,4,this.length),Z.read(this,t,!1,23,4)},t.prototype.readDoubleLE=function(t,e){return e||N(t,8,this.length),Z.read(this,t,!0,52,8)},t.prototype.readDoubleBE=function(t,e){return e||N(t,8,this.length),Z.read(this,t,!1,52,8)},t.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e|=0,r|=0,!n){var i=Math.pow(2,8*r)-1;F(this,t,e,r,i,0)}var o=1,a=0;for(this[e]=255&t;++a=0&&(a*=256);)this[e+o]=t/a&255;return e+r},t.prototype.writeUInt8=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,1,255,0),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},t.prototype.writeUInt16LE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):B(this,e,r,!0),r+2},t.prototype.writeUInt16BE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,65535,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):B(this,e,r,!1),r+2},t.prototype.writeUInt32LE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):L(this,e,r,!0),r+4},t.prototype.writeUInt32BE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,4294967295,0),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):L(this,e,r,!1),r+4},t.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);F(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},t.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);F(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},t.prototype.writeInt8=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,1,127,-128),t.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},t.prototype.writeInt16LE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):B(this,e,r,!0),r+2},t.prototype.writeInt16BE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,2,32767,-32768),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):B(this,e,r,!1),r+2},t.prototype.writeInt32LE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,2147483647,-2147483648),t.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):L(this,e,r,!0),r+4},t.prototype.writeInt32BE=function(e,r,n){return e=+e,r|=0,n||F(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),t.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):L(this,e,r,!1),r+4},t.prototype.writeFloatLE=function(t,e,r){return U(this,t,e,!0,r)},t.prototype.writeFloatBE=function(t,e,r){return U(this,t,e,!1,r)},t.prototype.writeDoubleLE=function(t,e,r){return W(this,t,e,!0,r)},t.prototype.writeDoubleBE=function(t,e,r){return W(this,t,e,!1,r)},t.prototype.copy=function(e,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r=0;--o)e[o+r]=this[o+n];else if(a<1e3||!t.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=r;a0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===t[e-2]?2:"="===t[e-1]?1:0}function n(t){return 3*t.length/4-r(t)}function i(t){var e,n,i,o,a,s,u=t.length;a=r(t),s=new l(3*u/4-a),i=a>0?u-4:u;var f=0;for(e=0,n=0;e>16&255,s[f++]=o>>8&255,s[f++]=255&o;return 2===a?(o=c[t.charCodeAt(e)]<<2|c[t.charCodeAt(e+1)]>>4,s[f++]=255&o):1===a&&(o=c[t.charCodeAt(e)]<<10|c[t.charCodeAt(e+1)]<<4|c[t.charCodeAt(e+2)]>>2,s[f++]=o>>8&255,s[f++]=255&o),s}function o(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function a(t,e,r){for(var n,i=[],a=e;al?l:c+s));return 1===n?(e=t[r-1],i+=u[e>>2],i+=u[e<<4&63],i+="=="):2===n&&(e=(t[r-2]<<8)+t[r-1],i+=u[e>>10],i+=u[e>>4&63],i+=u[e<<2&63],i+="="),o.push(i),o.join("")}e.byteLength=n,e.toByteArray=i,e.fromByteArray=s;for(var u=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,h=f.length;p>1,l=-7,f=r?i-1:0,p=r?-1:1,h=t[e+f];for(f+=p,o=h&(1<<-l)-1,h>>=-l,l+=s;l>0;o=256*o+t[e+f],f+=p,l-=8);for(a=o&(1<<-l)-1,o>>=-l,l+=n;l>0;a=256*a+t[e+f],f+=p,l-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:(h?-1:1)*(1/0);a+=Math.pow(2,n),o-=c}return(h?-1:1)*a*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var a,s,u,c=8*o-i-1,l=(1<>1,p=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?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?p/u:p*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[r+h]=255&s,h+=d,s/=256,i-=8);for(a=a<0;t[r+h]=255&a,h+=d,a/=256,c-=8);t[r+h-d]|=128*y}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){var n,i;(function(o,a){!function(o,a){n=a,i="function"==typeof n?n.call(e,r,e,t):n,!(void 0!==i&&(t.exports=i))}(this,function(){"use strict";var t,e=Function.call.bind(Function.apply),r=Function.call.bind(Function.call),n=Array.isArray,i=function(t){return function(){return!e(t,this,arguments)}},s=function(t){try{return t(),!1}catch(t){return!0}},u=function(t){try{return t()}catch(t){return!1}},c=i(s),l=function(){return!s(function(){Object.defineProperty({},"x",{get:function(){}})})},f=!!Object.defineProperty&&l(),p="foo"===function(){}.name,h=Function.call.bind(Array.prototype.forEach),d=Function.call.bind(Array.prototype.reduce),y=Function.call.bind(Array.prototype.filter),v=Function.call.bind(Array.prototype.some),g=function(t,e,r,n){!n&&e in t||(f?Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:!0,value:r}):t[e]=r)},b=function(t,e){h(Object.keys(e),function(r){var n=e[r];g(t,r,n,!1)})},m=Object.create||function(t,e){var r=function(){};r.prototype=t;var n=new r;return"undefined"!=typeof e&&Object.keys(e).forEach(function(t){Q.defineByDescriptor(n,t,e[t])}),n},_=function(t,e){return!!Object.setPrototypeOf&&u(function(){var r=function e(r){var n=new t(r);return Object.setPrototypeOf(n,e.prototype),n};return Object.setPrototypeOf(r,t),r.prototype=m(t.prototype,{constructor:{value:r}}),e(r)})},w=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof o)return o;throw new Error("unable to locate global object")},E=w(),O=E.isFinite,j=Function.call.bind(String.prototype.indexOf),S=Function.call.bind(Object.prototype.toString),T=Function.call.bind(Array.prototype.concat),C=Function.call.bind(String.prototype.slice),x=Function.call.bind(Array.prototype.push),P=Function.apply.bind(Array.prototype.push),R=Function.call.bind(Array.prototype.shift),A=Math.max,k=Math.min,I=Math.floor,M=Math.abs,N=Math.log,F=Math.sqrt,B=Function.call.bind(Object.prototype.hasOwnProperty),L=function(){},D=E.Symbol||{},U=D.species||"@@species",W=Number.isNaN||function(t){return t!==t},z=Number.isFinite||function(t){return"number"==typeof t&&O(t)},q=function(t){return"[object Arguments]"===S(t)},H=function(t){return null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==S(t)&&"[object Function]"===S(t.callee)},V=q(arguments)?q:H,$={primitive:function(t){return null===t||"function"!=typeof t&&"object"!=typeof t},object:function(t){return null!==t&&"object"==typeof t},string:function(t){return"[object String]"===S(t)},regex:function(t){return"[object RegExp]"===S(t)},symbol:function(t){return"function"==typeof E.Symbol&&"symbol"==typeof t}},G=$.symbol(D.iterator)?D.iterator:"_es6-shim iterator_";E.Set&&"function"==typeof(new E.Set)["@@iterator"]&&(G="@@iterator"),E.Reflect||g(E,"Reflect",{});var Y=E.Reflect,X={Call:function(t,r){var n=arguments.length>2?arguments[2]:[];if(!X.IsCallable(t))throw new TypeError(t+" is not a function");return e(t,r,n)},RequireObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t)},TypeIsObject:function(t){return null!=t&&Object(t)===t},ToObject:function(t,e){return X.RequireObjectCoercible(t,e),Object(t)},IsCallable:function(t){return"function"==typeof t&&"[object Function]"===S(t)},IsConstructor:function(t){return X.IsCallable(t)},ToInt32:function(t){return X.ToNumber(t)>>0},ToUint32:function(t){return X.ToNumber(t)>>>0},ToNumber:function(t){if("[object Symbol]"===S(t))throw new TypeError("Cannot convert a Symbol value to a number");return+t},ToInteger:function(t){var e=X.ToNumber(t);return W(e)?0:0!==e&&z(e)?(e>0?1:-1)*I(M(e)):e},ToLength:function(t){var e=X.ToInteger(t);return e<=0?0:e>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e},SameValue:function(t,e){return t===e?0!==t||1/t===1/e:W(t)&&W(e)},SameValueZero:function(t,e){return t===e||W(t)&&W(e)},IsIterable:function(t){return X.TypeIsObject(t)&&("undefined"!=typeof t[G]||V(t))},GetIterator:function(e){if(V(e))return new t(e,"value");var n=X.GetMethod(e,G);if(!X.IsCallable(n))throw new TypeError("value is not an iterable");var i=r(n,e);if(!X.TypeIsObject(i))throw new TypeError("bad iterator");return i},GetMethod:function(t,e){var r=X.ToObject(t)[e];if(void 0!==r&&null!==r){if(!X.IsCallable(r))throw new TypeError("Method not callable: "+e);return r}},IteratorComplete:function(t){return!!t.done},IteratorClose:function(t,e){var n=X.GetMethod(t,"return");if(void 0!==n){var i,o;try{i=r(n,t)}catch(t){o=t}if(!e){if(o)throw o;if(!X.TypeIsObject(i))throw new TypeError("Iterator's return method returned a non-object.")}}},IteratorNext:function(t){var e=arguments.length>1?t.next(arguments[1]):t.next();if(!X.TypeIsObject(e))throw new TypeError("bad iterator");return e},IteratorStep:function(t){var e=X.IteratorNext(t),r=X.IteratorComplete(e);return!r&&e},Construct:function(t,e,r,n){var i="undefined"==typeof r?t:r;if(!n)return Y.construct(t,e,i);var o=i.prototype;X.TypeIsObject(o)||(o=Object.prototype);var a=m(o),s=X.Call(t,a,e);return X.TypeIsObject(s)?s:a},SpeciesConstructor:function(t,e){var r=t.constructor;if(void 0===r)return e;if(!X.TypeIsObject(r))throw new TypeError("Bad constructor");var n=r[U];if(void 0===n||null===n)return e;if(!X.IsConstructor(n))throw new TypeError("Bad @@species");return n},CreateHTML:function(t,e,r,n){var i=String(t),o="<"+e;if(""!==r){var a=String(n),s=a.replace(/"/g,""");o+=" "+r+'="'+s+'"'}var u=o+">",c=u+i;return c+""+e+">"}},Q={getter:function(t,e,r){if(!f)throw new TypeError("getters require true ES5 support");Object.defineProperty(t,e,{configurable:!0,enumerable:!1,get:r})},proxy:function(t,e,r){if(!f)throw new TypeError("getters require true ES5 support");var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,{configurable:n.configurable,enumerable:n.enumerable,get:function(){return t[e]},set:function(r){t[e]=r}})},redefine:function(t,e,r){if(f){var n=Object.getOwnPropertyDescriptor(t,e);n.value=r,Object.defineProperty(t,e,n)}else t[e]=r},defineByDescriptor:function(t,e,r){f?Object.defineProperty(t,e,r):"value"in r&&(t[e]=r.value)},preserveToString:function(t,e){e&&X.IsCallable(e.toString)&&g(t,"toString",e.toString.bind(e),!0)}},J=function(t,e,r){Q.preserveToString(e,t),Object.setPrototypeOf&&Object.setPrototypeOf(t,e),f?h(Object.getOwnPropertyNames(t),function(n){n in L||r[n]||Q.proxy(t,n,e)}):h(Object.keys(t),function(n){n in L||r[n]||(e[n]=t[n])}),e.prototype=t.prototype,Q.redefine(t.prototype,"constructor",e)},Z=function(){return this},K=function(t){f&&!B(t,U)&&Q.getter(t,U,Z)},tt=function(t,e,r){var n=t[e];g(t,e,r,!0),Q.preserveToString(t[e],n)},et=function(t,e){var r=e||function(){return this};g(t,G,r),!t[G]&&$.symbol(G)&&(t[G]=r)},rt=function(t,e,r){f?Object.defineProperty(t,e,{configurable:!0,enumerable:!0,writable:!0,value:r}):t[e]=r},nt=function(t,e,r){if(rt(t,e,r),!X.SameValue(t[e],r))throw new TypeError("property is nonconfigurable")},it=function(t,e,r,n){if(!X.TypeIsObject(t))throw new TypeError("Constructor requires `new`: "+e.name);var i=e.prototype;X.TypeIsObject(i)||(i=r);var o=m(i);for(var a in n)if(B(n,a)){var s=n[a];g(o,a,s,!0)}return o};if(String.fromCodePoint&&1!==String.fromCodePoint.length){var ot=String.fromCodePoint;tt(String,"fromCodePoint",function(t){return e(ot,this,arguments)})}var at={fromCodePoint:function(t){for(var e,r=[],n=0,i=arguments.length;n1114111)throw new RangeError("Invalid code point "+e);e<65536?x(r,String.fromCharCode(e)):(e-=65536,x(r,String.fromCharCode((e>>10)+55296)),x(r,String.fromCharCode(e%1024+56320)))}return r.join("")},raw:function(t){var e=X.ToObject(t,"bad callSite"),r=X.ToObject(e.raw,"bad raw value"),n=r.length,i=X.ToLength(n);if(i<=0)return"";for(var o,a,s,u,c=[],l=0;l=i));)a=l+1=ut)throw new RangeError("repeat count must be less than infinity and not overflow maximum string size");return st(e,r)},startsWith:function(t){X.RequireObjectCoercible(this);var e=String(this);if($.regex(t))throw new TypeError('Cannot call method "startsWith" with a regex');var r=String(t),n=arguments.length>1?arguments[1]:void 0,i=A(X.ToInteger(n),0);return C(e,i,i+r.length)===r},endsWith:function(t){X.RequireObjectCoercible(this);var e=String(this);if($.regex(t))throw new TypeError('Cannot call method "endsWith" with a regex');var r=String(t),n=e.length,i=arguments.length>1?arguments[1]:void 0,o="undefined"==typeof i?n:X.ToInteger(i),a=k(A(o,0),n);return C(e,a-r.length,a)===r},includes:function(t){if($.regex(t))throw new TypeError('"includes" does not accept a RegExp');var e;return arguments.length>1&&(e=arguments[1]),j(this,t,e)!==-1},codePointAt:function(t){X.RequireObjectCoercible(this);var e=String(this),r=X.ToInteger(t),n=e.length;if(r>=0&&r56319||o)return i;var a=e.charCodeAt(r+1);return a<56320||a>57343?i:1024*(i-55296)+(a-56320)+65536}}};if(String.prototype.includes&&"a".includes("a",1/0)!==!1&&tt(String.prototype,"includes",ct.includes),String.prototype.startsWith&&String.prototype.endsWith){var lt=s(function(){"/a/".startsWith(/a/)}),ft="abc".startsWith("a",1/0)===!1;lt&&ft||(tt(String.prototype,"startsWith",ct.startsWith),tt(String.prototype,"endsWith",ct.endsWith))}b(String.prototype,ct);var pt=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),ht=new RegExp("(^["+pt+"]+)|(["+pt+"]+$)","g"),dt=function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(ht,"")},yt=["
","",""].join(""),vt=new RegExp("["+yt+"]","g"),gt=/^[\-+]0x[0-9a-f]+$/i,bt=yt.trim().length!==yt.length;g(String.prototype,"trim",dt,bt);var mt=function(t){X.RequireObjectCoercible(t),this._s=String(t),this._i=0};mt.prototype.next=function(){var t=this._s,e=this._i;if("undefined"==typeof t||e>=t.length)return this._s=void 0,{value:void 0,done:!0};var r,n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===t.length?n=1:(r=t.charCodeAt(e+1),n=r<56320||r>57343?1:2),this._i=e+n,{value:t.substr(e,n),done:!1}},et(mt.prototype),et(String.prototype,function(){return new mt(this)});var _t={from:function(t){var e,n,i=this,o=arguments.length>1?arguments[1]:void 0;if(void 0===o)e=!1;else{if(!X.IsCallable(o))throw new TypeError("Array.from: when provided, the second argument must be a function");n=arguments.length>2?arguments[2]:void 0,e=!0}var a,s,u,c="undefined"!=typeof(V(t)||X.GetMethod(t,G));if(c){s=X.IsConstructor(i)?Object(new i):[];var l,f,p=X.GetIterator(t);for(u=0;;){if(l=X.IteratorStep(p),l===!1)break;f=l.value;try{e&&(f=void 0===n?o(f,u):r(o,n,f,u)),s[u]=f}catch(t){throw X.IteratorClose(p,!0),t}u+=1}a=u}else{var h=X.ToObject(t);a=X.ToLength(h.length),s=X.IsConstructor(i)?Object(new i(a)):new Array(a);var d;for(u=0;u0;)if(t=R(e),t in this.object)return wt("key"===this.kind?t:"value"===this.kind?this.object[t]:[t,this.object[t]]);return wt()}}),et(Ot.prototype);var jt=Array.of===_t.of||function(){var t=function(t){this.length=t};t.prototype=[];var e=Array.of.apply(t,[1,2]);return e instanceof t&&2===e.length}();jt||tt(Array,"of",_t.of);var St={copyWithin:function(t,e){var r=arguments[2],n=X.ToObject(this),i=X.ToLength(n.length),o=X.ToInteger(t),a=X.ToInteger(e),s=o<0?A(i+o,0):k(o,i),u=a<0?A(i+a,0):k(a,i);r="undefined"==typeof r?i:X.ToInteger(r);var c=r<0?A(i+r,0):k(r,i),l=k(c-u,i-s),f=1;for(u0;)B(n,u)?n[s]=n[u]:delete n[u],u+=f,s+=f,l-=1;return n},fill:function(t){var e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=X.ToObject(this),i=X.ToLength(n.length);e=X.ToInteger("undefined"==typeof e?0:e),r=X.ToInteger("undefined"==typeof r?i:r);for(var o=e<0?A(i+e,0):k(e,i),a=r<0?i+r:r,s=o;s1?arguments[1]:null,a=0;a1?arguments[1]:null,o=0;o0&&"undefined"!=typeof arguments[1]?e(Rt,this,arguments):r(Rt,this,t)})}var At=function(t,e){var n={length:-1};return n[e?4294967294:0]=!0,u(function(){r(t,n,function(){throw new RangeError("should not reach here")},[])})};if(!At(Array.prototype.forEach)){var kt=Array.prototype.forEach;tt(Array.prototype,"forEach",function(t){return e(kt,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.map)){var It=Array.prototype.map;tt(Array.prototype,"map",function(t){return e(It,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.filter)){var Mt=Array.prototype.filter;tt(Array.prototype,"filter",function(t){return e(Mt,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.some)){var Nt=Array.prototype.some;tt(Array.prototype,"some",function(t){return e(Nt,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.every)){var Ft=Array.prototype.every;tt(Array.prototype,"every",function(t){return e(Ft,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.reduce)){var Bt=Array.prototype.reduce;tt(Array.prototype,"reduce",function(t){return e(Bt,this.length>=0?this:[],arguments)},!0)}if(!At(Array.prototype.reduceRight,!0)){var Lt=Array.prototype.reduceRight;tt(Array.prototype,"reduceRight",function(t){return e(Lt,this.length>=0?this:[],arguments)},!0)}var Dt=8!==Number("0o10"),Ut=2!==Number("0b10"),Wt=v(yt,function(t){return 0===Number(t+0+t)});if(Dt||Ut||Wt){var zt=Number,qt=/^0b[01]+$/i,Ht=/^0o[0-7]+$/i,Vt=qt.test.bind(qt),$t=Ht.test.bind(Ht),Gt=function(t){var e;if("function"==typeof t.valueOf&&(e=t.valueOf(),$.primitive(e)))return e;if("function"==typeof t.toString&&(e=t.toString(),$.primitive(e)))return e;throw new TypeError("No default value")},Yt=vt.test.bind(vt),Xt=gt.test.bind(gt),Qt=function(){var t=function(e){var n;n=arguments.length>0?$.primitive(e)?e:Gt(e,"number"):0,"string"==typeof n&&(n=r(dt,n),Vt(n)?n=parseInt(C(n,2),2):$t(n)?n=parseInt(C(n,2),8):(Yt(n)||Xt(n))&&(n=NaN));var i=this,o=u(function(){return zt.prototype.valueOf.call(i),!0});return i instanceof t&&!o?new zt(n):zt(n)};return t}();J(zt,Qt,{}),Number=Qt,Q.redefine(E,"Number",Qt)}var Jt=Math.pow(2,53)-1;b(Number,{MAX_SAFE_INTEGER:Jt,MIN_SAFE_INTEGER:-Jt,EPSILON:2.220446049250313e-16,parseInt:E.parseInt,parseFloat:E.parseFloat,isFinite:z,isInteger:function(t){return z(t)&&X.ToInteger(t)===t},isSafeInteger:function(t){return Number.isInteger(t)&&M(t)<=Number.MAX_SAFE_INTEGER},isNaN:W}),g(Number,"parseInt",E.parseInt,Number.parseInt!==E.parseInt),[,1].find(function(t,e){return 0===e})||tt(Array.prototype,"find",St.find),0!==[,1].findIndex(function(t,e){return 0===e})&&tt(Array.prototype,"findIndex",St.findIndex);var Zt=Function.bind.call(Function.bind,Object.prototype.propertyIsEnumerable),Kt=function(){for(var t=Number(this),e=arguments.length,r=e-t,n=new Array(r<0?0:r),i=t;i1?NaN:e===-1?-(1/0):1===e?1/0:0===e?e:.5*N((1+e)/(1-e))},cbrt:function(t){var e=Number(t);if(0===e)return e;var r,n=e<0;return n&&(e=-e),e===1/0?r=1/0:(r=Math.exp(N(e)/3),r=(e/(r*r)+2*r)/3),n?-r:r},clz32:function(t){var e=Number(t),n=X.ToUint32(e);return 0===n?32:Be?r(Be,n):31-I(N(n+.5)*Math.LOG2E)},cosh:function(t){var e=Number(t);return 0===e?1:Number.isNaN(e)?NaN:O(e)?(e<0&&(e=-e),e>21?Math.exp(e)/2:(Math.exp(e)+Math.exp(-e))/2):1/0},expm1:function(t){var e=Number(t);if(e===-(1/0))return-1;if(!O(e)||0===e)return e;if(M(e)>.5)return Math.exp(e)-1;for(var r=e,n=0,i=1;n+r!==n;)n+=r,i+=1,r*=e/i;return n},hypot:function(t,e){for(var r=0,n=0,i=0;i0?o/n*(o/n):o}return n===1/0?1/0:n*F(r)},log2:function(t){return N(t)*Math.LOG2E},log10:function(t){return N(t)*Math.LOG10E},log1p:function(t){var e=Number(t);return e<-1||Number.isNaN(e)?NaN:0===e||e===1/0?e:e===-1?-(1/0):1+e-1===0?e:e*(N(1+e)/(1+e-1))},sign:function(t){var e=Number(t);return 0===e?e:Number.isNaN(e)?e:e<0?-1:1},sinh:function(t){var e=Number(t);return O(e)&&0!==e?M(e)<1?(Math.expm1(e)-Math.expm1(-e))/2:(Math.exp(e-1)-Math.exp(-e-1))*Math.E/2:e},tanh:function(t){var e=Number(t);if(Number.isNaN(e)||0===e)return e;if(e===1/0)return 1;if(e===-(1/0))return-1;var r=Math.expm1(e),n=Math.expm1(-e);return r===1/0?1:n===1/0?-1:(r-n)/(Math.exp(e)+Math.exp(-e))},trunc:function(t){var e=Number(t);return e<0?-I(-e):I(e)},imul:function(t,e){var r=X.ToUint32(t),n=X.ToUint32(e),i=r>>>16&65535,o=65535&r,a=n>>>16&65535,s=65535&n;return o*s+(i*s+o*a<<16>>>0)|0},fround:function(t){var e=Number(t);if(0===e||e===1/0||e===-(1/0)||W(e))return e;var r=Math.sign(e),n=M(e);if(nNe||W(o)?r*(1/0):r*o}};b(Math,Le),g(Math,"log1p",Le.log1p,Math.log1p(-1e-17)!==-1e-17),g(Math,"asinh",Le.asinh,Math.asinh(-1e7)!==-Math.asinh(1e7)),g(Math,"tanh",Le.tanh,Math.tanh(-2e-17)!==-2e-17),g(Math,"acosh",Le.acosh,Math.acosh(Number.MAX_VALUE)===1/0),g(Math,"cbrt",Le.cbrt,Math.abs(1-Math.cbrt(1e-300)/1e-100)/Number.EPSILON>8),g(Math,"sinh",Le.sinh,Math.sinh(-2e-17)!==-2e-17);var De=Math.expm1(10);g(Math,"expm1",Le.expm1,De>22025.465794806718||De<22025.465794806718);var Ue=Math.round,We=0===Math.round(.5-Number.EPSILON/4)&&1===Math.round(-.5+Number.EPSILON/3.99),ze=ke+1,qe=2*ke-1,He=[ze,qe].every(function(t){return Math.round(t)===t});g(Math,"round",function(t){var e=I(t),r=e===-1?-0:e+1;return t-e<.5?e:r},!We||!He),Q.preserveToString(Math.round,Ue);var Ve=Math.imul;Math.imul(4294967295,5)!==-5&&(Math.imul=Le.imul,Q.preserveToString(Math.imul,Ve)),2!==Math.imul.length&&tt(Math,"imul",function(t,r){return e(Ve,Math,arguments)});var $e=function(){var t=E.setTimeout;if("function"==typeof t||"object"==typeof t){X.IsPromise=function(t){return!!X.TypeIsObject(t)&&"undefined"!=typeof t._promise};var e,n=function(t){if(!X.IsConstructor(t))throw new TypeError("Bad promise constructor");var e=this,r=function(t,r){if(void 0!==e.resolve||void 0!==e.reject)throw new TypeError("Bad Promise implementation!");e.resolve=t,e.reject=r};if(e.promise=new t(r),!X.IsCallable(e.resolve)||!X.IsCallable(e.reject))throw new TypeError("Bad promise constructor")};"undefined"!=typeof window&&X.IsCallable(window.postMessage)&&(e=function(){var t=[],e="zero-timeout-message",r=function(r){x(t,r),window.postMessage(e,"*")},n=function(r){if(r.source===window&&r.data===e){if(r.stopPropagation(),0===t.length)return;var n=R(t);n()}};return window.addEventListener("message",n,!0),r});var i,o=function(){var t=E.Promise;return t&&t.resolve&&function(e){return t.resolve().then(e)}},s=X.IsCallable(E.setImmediate)?E.setImmediate.bind(E):"object"==typeof a&&a.nextTick?a.nextTick:o()||(X.IsCallable(e)?e():function(e){t(e,0)}),u=1,c=2,l=3,f=4,p=5,d=function(t,e){var r,n,i=t.capabilities,o=t.handler,a=!1;if(o===u)r=e;else if(o===c)r=e,a=!0;else try{r=o(e)}catch(t){r=t,a=!0}(n=a?i.reject:i.resolve)(r)},y=function(t,e){h(t,function(t){s(function(){d(t,e)})})},v=function(t,e){var r=t._promise,n=r.fulfillReactions;r.result=e,r.fulfillReactions=void 0,r.rejectReactions=void 0,r.state=f,y(n,e)},g=function(t,e){var r=t._promise,n=r.rejectReactions;r.result=e,r.fulfillReactions=void 0,r.rejectReactions=void 0,r.state=p,y(n,e)},m=function(t){var e=!1,r=function(r){var n;if(!e){if(e=!0,r===t)return g(t,new TypeError("Self resolution"));if(!X.TypeIsObject(r))return v(t,r);try{n=r.then}catch(e){return g(t,e)}return X.IsCallable(n)?void s(function(){_(t,r,n)}):v(t,r)}},n=function(r){if(!e)return e=!0,g(t,r)};return{resolve:r,reject:n}},_=function(t,e,n){var i=m(t),o=i.resolve,a=i.reject;try{r(n,e,o,a)}catch(t){a(t)}},w=function(t){if(!X.TypeIsObject(t))throw new TypeError("Promise is not object");var e=t[U];return void 0!==e&&null!==e?e:t},O=function(){var t=function(e){if(!(this instanceof t))throw new TypeError('Constructor Promise requires "new"');if(this&&this._promise)throw new TypeError("Bad construction");if(!X.IsCallable(e))throw new TypeError("not a valid resolver");var r=it(this,t,i,{_promise:{result:void 0,state:l,fulfillReactions:[],rejectReactions:[]}}),n=m(r),o=n.reject;try{e(n.resolve,o)}catch(t){o(t)}return r};return t}();i=O.prototype;var j=function(t,e,r,n){var i=!1;return function(o){if(!i&&(i=!0,e[t]=o,0===--n.count)){var a=r.resolve;a(e)}}},S=function(t,e,r){for(var n,i,o=t.iterator,a=[],s={count:1},u=0;;){try{if(n=X.IteratorStep(o),n===!1){t.done=!0;break}i=n.value}catch(e){throw t.done=!0,e}a[u]=void 0;var c=e.resolve(i),l=j(u,a,r,s);s.count+=1,c.then(l,r.reject),u+=1}if(0===--s.count){var f=r.resolve;f(a)}return r.promise},T=function(t,e,r){for(var n,i,o,a=t.iterator;;){try{if(n=X.IteratorStep(a),n===!1){t.done=!0;break}i=n.value}catch(e){throw t.done=!0,e}o=e.resolve(i),o.then(r.resolve,r.reject)}return r.promise};return b(O,{all:function(t){var e,r,i=w(this),o=new n(i);try{return e=X.GetIterator(t),r={iterator:e,done:!1},S(r,i,o)}catch(t){var a=t;if(r&&!r.done)try{X.IteratorClose(e,!0)}catch(t){a=t}var s=o.reject;return s(a),o.promise}},race:function(t){var e,r,i=w(this),o=new n(i);try{return e=X.GetIterator(t),r={iterator:e,done:!1},T(r,i,o)}catch(t){var a=t;if(r&&!r.done)try{X.IteratorClose(e,!0)}catch(t){a=t}var s=o.reject;return s(a),o.promise}},reject:function(t){var e=this,r=new n(e),i=r.reject;return i(t),r.promise},resolve:function(t){var e=this;if(X.IsPromise(t)){var r=t.constructor;if(r===e)return t}var i=new n(e),o=i.resolve;return o(t),i.promise}}),b(i,{catch:function(t){return this.then(void 0,t)},then:function(t,e){var r=this;if(!X.IsPromise(r))throw new TypeError("not a promise");var i,o=X.SpeciesConstructor(r,O),a=new n(o),h={capabilities:a,handler:X.IsCallable(t)?t:u},y={capabilities:a,handler:X.IsCallable(e)?e:c},v=r._promise;if(v.state===l)x(v.fulfillReactions,h),x(v.rejectReactions,y);else if(v.state===f)i=v.result,s(function(){d(h,i)});else{if(v.state!==p)throw new TypeError("unexpected Promise state");i=v.result,s(function(){d(y,i)})}return a.promise}}),O}}();if(E.Promise&&(delete E.Promise.accept,delete E.Promise.defer,delete E.Promise.prototype.chain),"function"==typeof $e){b(E,{Promise:$e});var Ge=_(E.Promise,function(t){return t.resolve(42).then(function(){})instanceof t}),Ye=!s(function(){E.Promise.reject(42).then(null,5).then(null,L)}),Xe=s(function(){E.Promise.call(3,L)}),Qe=function(t){var e=t.resolve(5);e.constructor={};var r=t.resolve(e);return e===r}(E.Promise);Ge&&Ye&&Xe&&!Qe||(Promise=$e,tt(E,"Promise",$e)),K(Promise)}var Je=function(t){var e=Object.keys(d(t,function(t,e){return t[e]=!0,t},{}));return t.join(":")===e.join(":")},Ze=Je(["z","a","bb"]),Ke=Je(["z",1,"a","3",2]);if(f){var tr=function(t){if(!Ze)return null;var e=typeof t;return"undefined"===e||null===t?"^"+String(t):"string"===e?"$"+t:"number"===e?Ke?t:"n"+t:"boolean"===e?"b"+t:null},er=function(){return Object.create?Object.create(null):{}},rr=function(t,e,i){if(n(i)||$.string(i))h(i,function(t){e.set(t[0],t[1])});else if(i instanceof t)r(t.prototype.forEach,i,function(t,r){e.set(r,t)});else{var o,a;if(null!==i&&"undefined"!=typeof i){if(a=e.set,!X.IsCallable(a))throw new TypeError("bad map");o=X.GetIterator(i)}if("undefined"!=typeof o)for(;;){var s=X.IteratorStep(o);if(s===!1)break;var u=s.value;try{if(!X.TypeIsObject(u))throw new TypeError("expected iterable of pairs");r(a,e,u[0],u[1])}catch(t){throw X.IteratorClose(o,!0),t}}}},nr=function(t,e,i){if(n(i)||$.string(i))h(i,function(t){e.add(t)});else if(i instanceof t)r(t.prototype.forEach,i,function(t){e.add(t)});else{var o,a;if(null!==i&&"undefined"!=typeof i){if(a=e.add,!X.IsCallable(a))throw new TypeError("bad set");o=X.GetIterator(i)}if("undefined"!=typeof o)for(;;){var s=X.IteratorStep(o);if(s===!1)break;var u=s.value;try{r(a,e,u)}catch(t){throw X.IteratorClose(o,!0),t}}}},ir={Map:function(){var t={},e=function(t,e){this.key=t,this.value=e,this.next=null,this.prev=null};e.prototype.isRemoved=function(){return this.key===t};var n=function(t){return!!t._es6map},i=function(t,e){if(!X.TypeIsObject(t)||!n(t))throw new TypeError("Method Map.prototype."+e+" called on incompatible receiver "+String(t))},o=function(t,e){i(t,"[[MapIterator]]"),this.head=t._head,this.i=this.head,this.kind=e};o.prototype={next:function(){var t,e=this.i,r=this.kind,n=this.head;if("undefined"==typeof this.i)return{value:void 0,done:!0};for(;e.isRemoved()&&e!==n;)e=e.prev;for(;e.next!==n;)if(e=e.next,!e.isRemoved())return t="key"===r?e.key:"value"===r?e.value:[e.key,e.value],this.i=e,{value:t,done:!1};return this.i=void 0,{value:void 0,done:!0}}},et(o.prototype);var a,s=function t(){if(!(this instanceof t))throw new TypeError('Constructor Map requires "new"');if(this&&this._es6map)throw new TypeError("Bad construction");var r=it(this,t,a,{_es6map:!0,_head:null,_storage:er(),_size:0}),n=new e(null,null);return n.next=n.prev=n,r._head=n,arguments.length>0&&rr(t,r,arguments[0]),r};return a=s.prototype,Q.getter(a,"size",function(){if("undefined"==typeof this._size)throw new TypeError("size method called on incompatible Map");return this._size}),b(a,{get:function(t){i(this,"get");var e=tr(t);if(null!==e){var r=this._storage[e];return r?r.value:void 0}for(var n=this._head,o=n;(o=o.next)!==n;)if(X.SameValueZero(o.key,t))return o.value},has:function(t){i(this,"has");var e=tr(t);if(null!==e)return"undefined"!=typeof this._storage[e];for(var r=this._head,n=r;(n=n.next)!==r;)if(X.SameValueZero(n.key,t))return!0;return!1},set:function(t,r){i(this,"set");var n,o=this._head,a=o,s=tr(t);if(null!==s){if("undefined"!=typeof this._storage[s])return this._storage[s].value=r,this;n=this._storage[s]=new e(t,r),a=o.prev}for(;(a=a.next)!==o;)if(X.SameValueZero(a.key,t))return a.value=r,this;return n=n||new e(t,r),X.SameValue(-0,t)&&(n.key=0),n.next=this._head,n.prev=this._head.prev,n.prev.next=n,n.next.prev=n,this._size+=1,this},delete:function(e){i(this,"delete");var r=this._head,n=r,o=tr(e);if(null!==o){if("undefined"==typeof this._storage[o])return!1;n=this._storage[o].prev,delete this._storage[o]}for(;(n=n.next)!==r;)if(X.SameValueZero(n.key,e))return n.key=n.value=t,n.prev.next=n.next,n.next.prev=n.prev,this._size-=1,!0;return!1},clear:function(){i(this,"clear"),this._size=0,this._storage=er();for(var e=this._head,r=e,n=r.next;(r=n)!==e;)r.key=r.value=t,n=r.next,r.next=r.prev=e;e.next=e.prev=e},keys:function(){return i(this,"keys"),new o(this,"key")},values:function(){return i(this,"values"),new o(this,"value")},entries:function(){return i(this,"entries"),new o(this,"key+value")},forEach:function(t){i(this,"forEach");for(var e=arguments.length>1?arguments[1]:null,n=this.entries(),o=n.next();!o.done;o=n.next())e?r(t,e,o.value[1],o.value[0],this):t(o.value[1],o.value[0],this)}}),et(a,a.entries),s}(),Set:function(){var t,e=function(t){return t._es6set&&"undefined"!=typeof t._storage},n=function(t,r){if(!X.TypeIsObject(t)||!e(t))throw new TypeError("Set.prototype."+r+" called on incompatible receiver "+String(t))},i=function e(){if(!(this instanceof e))throw new TypeError('Constructor Set requires "new"');if(this&&this._es6set)throw new TypeError("Bad construction");var r=it(this,e,t,{_es6set:!0,"[[SetData]]":null,_storage:er()});if(!r._es6set)throw new TypeError("bad set");return arguments.length>0&&nr(e,r,arguments[0]),r};t=i.prototype;var o=function(t){if(!t["[[SetData]]"]){var e=t["[[SetData]]"]=new ir.Map;h(Object.keys(t._storage),function(t){var r=t;if("^null"===r)r=null;else if("^undefined"===r)r=void 0;else{var n=r.charAt(0);r="$"===n?C(r,1):"n"===n?+C(r,1):"b"===n?"btrue"===r:+r}e.set(r,r)}),t._storage=null}};return Q.getter(i.prototype,"size",function(){return n(this,"size"),o(this),this["[[SetData]]"].size}),b(i.prototype,{has:function(t){n(this,"has");var e;return this._storage&&null!==(e=tr(t))?!!this._storage[e]:(o(this),this["[[SetData]]"].has(t))},add:function(t){n(this,"add");var e;return this._storage&&null!==(e=tr(t))?(this._storage[e]=!0,this):(o(this),this["[[SetData]]"].set(t,t),this)},delete:function(t){n(this,"delete");var e;if(this._storage&&null!==(e=tr(t))){var r=B(this._storage,e);return delete this._storage[e]&&r}return o(this),this["[[SetData]]"].delete(t)},clear:function(){n(this,"clear"),this._storage?this._storage=er():this["[[SetData]]"].clear()},values:function(){return n(this,"values"),o(this),this["[[SetData]]"].values()},entries:function(){return n(this,"entries"),o(this),this["[[SetData]]"].entries()},forEach:function(t){n(this,"forEach");var e=arguments.length>1?arguments[1]:null,i=this;o(i),this["[[SetData]]"].forEach(function(n,o){e?r(t,e,o,o,i):t(o,o,i)})}}),g(i.prototype,"keys",i.prototype.values,!0),et(i.prototype,i.prototype.values),i}()};if(E.Map||E.Set){var or=u(function(){return 2===new Map([[1,2]]).get(1)});if(!or){var ar=E.Map;E.Map=function t(){if(!(this instanceof t))throw new TypeError('Constructor Map requires "new"');var e=new ar;return arguments.length>0&&rr(t,e,arguments[0]),Object.setPrototypeOf(e,E.Map.prototype),g(e,"constructor",t,!0),e},E.Map.prototype=m(ar.prototype),Q.preserveToString(E.Map,ar)}var sr=new Map,ur=function(t){return t.delete(0),t.delete(-0),t.set(0,3),t.get(-0,4),3===t.get(0)&&4===t.get(-0)}(sr),cr=sr.set(1,2)===sr;if(!ur||!cr){var lr=Map.prototype.set;tt(Map.prototype,"set",function(t,e){return r(lr,this,0===t?0:t,e),this})}if(!ur){var fr=Map.prototype.get,pr=Map.prototype.has;b(Map.prototype,{get:function(t){return r(fr,this,0===t?0:t)},has:function(t){return r(pr,this,0===t?0:t)}},!0),Q.preserveToString(Map.prototype.get,fr),Q.preserveToString(Map.prototype.has,pr)}var hr=new Set,dr=function(t){return t.delete(0),t.add(-0),!t.has(0)}(hr),yr=hr.add(1)===hr;if(!dr||!yr){var vr=Set.prototype.add;Set.prototype.add=function(t){return r(vr,this,0===t?0:t),this},Q.preserveToString(Set.prototype.add,vr)}if(!dr){var gr=Set.prototype.has;Set.prototype.has=function(t){return r(gr,this,0===t?0:t)},Q.preserveToString(Set.prototype.has,gr);var br=Set.prototype.delete;Set.prototype.delete=function(t){return r(br,this,0===t?0:t)},Q.preserveToString(Set.prototype.delete,br)}var mr=_(E.Map,function(t){var e=new t([]);return e.set(42,42),e instanceof t}),_r=Object.setPrototypeOf&&!mr,wr=function(){try{return!(E.Map()instanceof E.Map)}catch(t){return t instanceof TypeError}}();if(0!==E.Map.length||_r||!wr){var Er=E.Map;E.Map=function t(){if(!(this instanceof t))throw new TypeError('Constructor Map requires "new"');var e=new Er;return arguments.length>0&&rr(t,e,arguments[0]),Object.setPrototypeOf(e,t.prototype),g(e,"constructor",t,!0),e},E.Map.prototype=Er.prototype,Q.preserveToString(E.Map,Er)}var Or=_(E.Set,function(t){var e=new t([]);return e.add(42,42),e instanceof t}),jr=Object.setPrototypeOf&&!Or,Sr=function(){try{return!(E.Set()instanceof E.Set)}catch(t){return t instanceof TypeError}}();if(0!==E.Set.length||jr||!Sr){var Tr=E.Set;E.Set=function t(){if(!(this instanceof t))throw new TypeError('Constructor Set requires "new"');var e=new Tr;return arguments.length>0&&nr(t,e,arguments[0]),Object.setPrototypeOf(e,t.prototype),g(e,"constructor",t,!0),e},E.Set.prototype=Tr.prototype,Q.preserveToString(E.Set,Tr)}var Cr=!u(function(){return(new Map).keys().next().done});if(("function"!=typeof E.Map.prototype.clear||0!==(new E.Set).size||0!==(new E.Map).size||"function"!=typeof E.Map.prototype.keys||"function"!=typeof E.Set.prototype.keys||"function"!=typeof E.Map.prototype.forEach||"function"!=typeof E.Set.prototype.forEach||c(E.Map)||c(E.Set)||"function"!=typeof(new E.Map).keys().next||Cr||!mr)&&(delete E.Map,delete E.Set,b(E,{Map:ir.Map,Set:ir.Set},!0)),E.Set.prototype.keys!==E.Set.prototype.values&&g(E.Set.prototype,"keys",E.Set.prototype.values,!0),et(Object.getPrototypeOf((new E.Map).keys())),et(Object.getPrototypeOf((new E.Set).keys())),p&&"has"!==E.Set.prototype.has.name){var xr=E.Set.prototype.has;tt(E.Set.prototype,"has",function(t){return r(xr,this,t)})}}b(E,ir),K(E.Map),K(E.Set)}var Pr=function(t){if(!X.TypeIsObject(t))throw new TypeError("target must be an object")},Rr={apply:function(){return e(X.Call,null,arguments)},construct:function(t,e){if(!X.IsConstructor(t))throw new TypeError("First argument must be a constructor.");var r=arguments.length<3?t:arguments[2];if(!X.IsConstructor(r))throw new TypeError("new.target must be a constructor.");return X.Construct(t,e,r,"internal")},deleteProperty:function(t,e){if(Pr(t),f){var r=Object.getOwnPropertyDescriptor(t,e);if(r&&!r.configurable)return!1}return delete t[e]},enumerate:function(t){return Pr(t),new Ot(t,"key")},has:function(t,e){return Pr(t),e in t}};Object.getOwnPropertyNames&&Object.assign(Rr,{ownKeys:function(t){Pr(t);var e=Object.getOwnPropertyNames(t);return X.IsCallable(Object.getOwnPropertySymbols)&&P(e,Object.getOwnPropertySymbols(t)),e}});var Ar=function(t){return!s(t)};if(Object.preventExtensions&&Object.assign(Rr,{isExtensible:function(t){return Pr(t),Object.isExtensible(t)},preventExtensions:function(t){return Pr(t),Ar(function(){Object.preventExtensions(t)})}}),f){var kr=function(t,e,n){var i=Object.getOwnPropertyDescriptor(t,e);if(!i){var o=Object.getPrototypeOf(t);if(null===o)return;return kr(o,e,n)}return"value"in i?i.value:i.get?r(i.get,n):void 0},Ir=function(t,e,n,i){var o=Object.getOwnPropertyDescriptor(t,e);if(!o){var a=Object.getPrototypeOf(t);if(null!==a)return Ir(a,e,n,i);o={value:void 0,writable:!0,enumerable:!0,configurable:!0}}if("value"in o){if(!o.writable)return!1;if(!X.TypeIsObject(i))return!1;var s=Object.getOwnPropertyDescriptor(i,e);return s?Y.defineProperty(i,e,{value:n}):Y.defineProperty(i,e,{value:n,writable:!0,enumerable:!0,configurable:!0})}return!!o.set&&(r(o.set,i,n),!0)};Object.assign(Rr,{defineProperty:function(t,e,r){return Pr(t),Ar(function(){Object.defineProperty(t,e,r)})},getOwnPropertyDescriptor:function(t,e){return Pr(t),Object.getOwnPropertyDescriptor(t,e)},get:function(t,e){Pr(t);var r=arguments.length>2?arguments[2]:t;return kr(t,e,r)},set:function(t,e,r){Pr(t);var n=arguments.length>3?arguments[3]:t;return Ir(t,e,r,n)}})}if(Object.getPrototypeOf){var Mr=Object.getPrototypeOf;Rr.getPrototypeOf=function(t){return Pr(t),Mr(t)}}if(Object.setPrototypeOf&&Rr.getPrototypeOf){var Nr=function(t,e){for(var r=e;r;){if(t===r)return!0;r=Rr.getPrototypeOf(r)}return!1};Object.assign(Rr,{setPrototypeOf:function(t,e){if(Pr(t),null!==e&&!X.TypeIsObject(e))throw new TypeError("proto must be an object or null");return e===Y.getPrototypeOf(t)||!(Y.isExtensible&&!Y.isExtensible(t))&&(!Nr(t,e)&&(Object.setPrototypeOf(t,e),!0))}})}var Fr=function(t,e){if(X.IsCallable(E.Reflect[t])){var r=u(function(){return E.Reflect[t](1),E.Reflect[t](NaN),E.Reflect[t](!0),!0});r&&tt(E.Reflect,t,e)}else g(E.Reflect,t,e)};if(Object.keys(Rr).forEach(function(t){Fr(t,Rr[t])}),p&&"getPrototypeOf"!==E.Reflect.getPrototypeOf.name){var Br=E.Reflect.getPrototypeOf;tt(E.Reflect,"getPrototypeOf",function(t){return r(Br,E.Reflect,t)})}if(E.Reflect.setPrototypeOf&&u(function(){return E.Reflect.setPrototypeOf(1,{}),!0})&&tt(E.Reflect,"setPrototypeOf",Rr.setPrototypeOf),E.Reflect.defineProperty&&(u(function(){var t=!E.Reflect.defineProperty(1,"test",{value:1}),e="function"!=typeof Object.preventExtensions||!E.Reflect.defineProperty(Object.preventExtensions({}),"test",{});return t&&e})||tt(E.Reflect,"defineProperty",Rr.defineProperty)),E.Reflect.construct&&(u(function(){var t=function(){};return E.Reflect.construct(function(){},[],t)instanceof t})||tt(E.Reflect,"construct",Rr.construct)),"Invalid Date"!==String(new Date(NaN))){var Lr=Date.prototype.toString,Dr=function(){var t=+this;return t!==t?"Invalid Date":r(Lr,this)};tt(Date.prototype,"toString",Dr)}var Ur={anchor:function(t){return X.CreateHTML(this,"a","name",t)},big:function(){return X.CreateHTML(this,"big","","")},blink:function(){return X.CreateHTML(this,"blink","","")},bold:function(){return X.CreateHTML(this,"b","","")},fixed:function(){return X.CreateHTML(this,"tt","","")},fontcolor:function(t){return X.CreateHTML(this,"font","color",t)},fontsize:function(t){return X.CreateHTML(this,"font","size",t)},italics:function(){return X.CreateHTML(this,"i","","")},link:function(t){return X.CreateHTML(this,"a","href",t)},small:function(){return X.CreateHTML(this,"small","","")},strike:function(){return X.CreateHTML(this,"strike","","")},sub:function(){return X.CreateHTML(this,"sub","","")},sup:function(){return X.CreateHTML(this,"sup","","")}};h(Object.keys(Ur),function(t){var e=String.prototype[t],n=!1;if(X.IsCallable(e)){var i=r(e,"",' " '),o=T([],i.match(/"/g)).length;n=i!==i.toLowerCase()||o>2}else n=!0;n&&tt(String.prototype,t,Ur[t])});var Wr=function(){if(!$.symbol(D.iterator))return!1;var t="object"==typeof JSON&&"function"==typeof JSON.stringify?JSON.stringify:null;if(!t)return!1;if("undefined"!=typeof t(D()))return!0;if("[null]"!==t([D()]))return!0;var e={a:D()};return e[D()]=!0,"{}"!==t(e)}(),zr=u(function(){return!$.symbol(D.iterator)||"{}"===JSON.stringify(Object(D()))&&"[{}]"===JSON.stringify([Object(D())])});if(Wr||!zr){var qr=JSON.stringify;tt(JSON,"stringify",function(t){if("symbol"!=typeof t){var e;arguments.length>1&&(e=arguments[1]);var i=[t];if(n(e))i.push(e);else{var o=(X.IsCallable(e)?e:null,function(t,n){var i=e?r(e,this,t,n):n;if("symbol"!=typeof i)return $.symbol(i)?te({})(i):i});i.push(o)}return arguments.length>2&&i.push(arguments[2]),qr.apply(this,i)}})}return E})}).call(e,function(){return this}(),r(3))},function(t,e,r){(function(t,n){function i(t,r){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),y(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=o),u(n,t,n.depth)}function o(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function a(t,e){return t}function s(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,r,n){if(t.customInspect&&r&&T(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return m(i)||(i=u(t,i,n)),i}var o=c(t,r);if(o)return o;var a=Object.keys(r),y=s(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(T(r)){var v=r.name?": "+r.name:"";return t.stylize("[Function"+v+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(j(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return l(r)}var g="",b=!1,_=["{","}"];if(d(r)&&(b=!0,_=["[","]"]),T(r)){var w=r.name?": "+r.name:"";g=" [Function"+w+"]"}if(E(r)&&(g=" "+RegExp.prototype.toString.call(r)),j(r)&&(g=" "+Date.prototype.toUTCString.call(r)),S(r)&&(g=" "+l(r)),0===a.length&&(!b||0==r.length))return _[0]+g+_[1];if(n<0)return E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special");t.seen.push(r);var O;return O=b?f(t,r,n,y,a):a.map(function(e){return p(t,r,n,y,e,b)}),t.seen.pop(),h(O,g,_)}function c(t,e){if(w(e))return t.stylize("undefined","undefined");if(m(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return b(e)?t.stylize(""+e,"number"):y(e)?t.stylize(""+e,"boolean"):v(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var o=[],a=0,s=e.length;a-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")),w(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 h(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function y(t){return"boolean"==typeof t}function v(t){return null===t}function g(t){return null==t}function b(t){return"number"==typeof t}function m(t){return"string"==typeof t}function _(t){return"symbol"==typeof t}function w(t){return void 0===t}function E(t){return O(t)&&"[object RegExp]"===x(t)}function O(t){return"object"==typeof t&&null!==t}function j(t){return O(t)&&"[object Date]"===x(t)}function S(t){return O(t)&&("[object Error]"===x(t)||t instanceof Error)}function T(t){return"function"==typeof t}function C(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function x(t){return Object.prototype.toString.call(t)}function P(t){return t<10?"0"+t.toString(10):t.toString(10)}function R(){var t=new Date,e=[P(t.getHours()),P(t.getMinutes()),P(t.getSeconds())].join(":");return[t.getDate(),N[t.getMonth()],e].join(" ")}function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var k=/%[sdj%]/g;e.format=function(t){if(!m(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),s=n[r];r0&&this._events[t].length>i&&(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())),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){function r(){this.removeListener(t,r),i||(i=!0,e.apply(this,arguments))}if(!n(e))throw TypeError("listener must be a function");var i=!1;return r.listener=e,this.on(t,r),this},r.prototype.removeListener=function(t,e){var r,i,a,s;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],a=r.length,i=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(o(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){i=s;break}if(i<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(i,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;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(r=this._events[t],n(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e){t.exports={to7BitArray:function(t){var e=0,r=0,n=[];return t.forEach(function(t){0===e?(n.push(127&t),e++,r=t>>7):(n.push(t<>1),e=0):(e++,r=t>>8-e))}),e>0&&n.push(r),n},from7BitArray:function(t){for(var e=7*t.length>>3,r=[],n=0;n>a|t[o+1]<<7-a&255}return r}}},function(t,e,r){var n=r(13),i={crc8:function(t){for(var e=0,r=0;r>=1,o&&(e^=140),n>>=1}return e},readDevices:function(t){for(var e=n.from7BitArray(t),r=[],o=0;o=0&&a.close();break;case"timeout":}}),this.path=t,n&&e.nextTick(function(){a.open(o)})}function a(t){"undefined"!=typeof chrome&&chrome.serial?chrome.serial.getDevices(function(e){for(var r=new Array(e.length),n=0;n=0;f--){var h=l[f].toLowerCase();if(!(b.indexOf(h)>-1))return o(new Error("Invalid flowControl option: "+h));c[h]=!0}c.dataCallback=r.dataCallback||function(t){c.parser(this,t)}.bind(this),c.disconnectedCallback=r.disconnectedCallback||function(t){this.closing||(t||(t=new Error("Disconnected")),this.emit("disconnect",t))}.bind(this),this.fd=null,this.paused=!0,this.opening=!1,this.closing=!1,"win32"!==e.platform&&(this.bufferSize=c.bufferSize,this.readable=!0,this.reading=!1),this.options=c,n&&e.nextTick(function(){this.open(o)}.bind(this))}var a=r(17)("serialport"),s=r(20).getPolyfill(),u=r(31),c=r(39),l=r(12).EventEmitter,f=r(37),p=r(40),h=r(9),d=new l;d.parsers=c,d.list=u.list;var y=[5,6,7,8],v=[1,1.5,2],g=["none","even","mark","odd","space"],b=["xon","xoff","xany","rtscts"],m=["brk","cts","dtr","dts","rts"],_=40960,w=128,E={baudRate:9600,parity:"none",xon:!1,xoff:!1,xany:!1,rtscts:!1,hupcl:!0,dataBits:8,stopBits:1,bufferSize:65536,parser:c.raw,platformOptions:u.platformOptions},O={brk:!1,cts:!1,dtr:!0,dts:!1,rts:!0},j=["baudRate","dataBits","stopBits","bufferSize","platformOptions","flowControl"];d.SerialPort=o,h.inherits(o,p.Stream),o.prototype._error=function(t,e){e?e(t):this.emit("error",t)},o.prototype.open=function(t){if(this.isOpen())return this._error(new Error("Port is already open"),t);if(this.opening)return this._error(new Error("Port is opening"),t);this.paused=!0,this.readable=!0,this.reading=!1,this.opening=!0;var r=this;u.open(this.path,this.options,function(n,i){return n?(a("SerialPortBinding.open had an error",n),r._error(n,t)):(r.fd=i,r.paused=!1,r.opening=!1,"win32"!==e.platform&&(r.serialPoller=new u.SerialportPoller(r.fd,function(t){t?r.disconnected(t):r._read()}),r.serialPoller.start()),r.emit("open"),void(t&&t()))})},o.prototype.update=function(t,e){if(!this.isOpen())return a("update attempted, but port is not open"),this._error(new Error("Port is not open"),e);var r=i(t),n=s({},E,r);this.options.baudRate=n.baudRate,u.update(this.fd,this.options,function(t){return t?this._error(t,e):(this.emit("open"),void(e&&e()))}.bind(this))},o.prototype.isOpen=function(){return null!==this.fd&&!this.closing},o.prototype.write=function(t,e){if(!this.isOpen())return a("write attempted, but port is not open"),this._error(new Error("Port is not open"),e);n.isBuffer(t)||(t=new n(t)),a("write data: "+JSON.stringify(t));var r=this;u.write(this.fd,t,function(t,n){e?e(t,n):t&&r.emit("error",t)})},"win32"!==e.platform&&(o.prototype._read=function(){function t(t,r,o,a){if(e.reading=!1,t)t.code&&"EAGAIN"===t.code?!e.closing&&e.isOpen()&&e.serialPoller.start():!t.code||"EBADF"!==t.code&&"ENXIO"!==t.code&&t.errno!==-1&&"UNKNOWN"!==t.code?(e.fd=null,e.readable=!1,e.emit("error",t)):e.disconnected(t);else if(e.pool.used-=a-r,0===r)e.isOpen()&&e.serialPoller.start();else{var s=e.pool.slice(i,i+r);if(e.paused)return void(e.buffer=n.concat([e.buffer,s]));if(e._emitData(s),!e.readable)return;e._read()}}var e=this;if(e.readable&&!e.paused&&!e.reading&&!this.closing){e.reading=!0,(!e.pool||e.pool.length-e.pool.used=0;n--){var i=m[n];void 0!==t[i]?r[i]=t[i]:r[i]=O[i]}u.set(this.fd,r,function(t,r){return t?(a("SerialPortBinding.set had an error",t),this._error(t,e)):void(e&&e(null,r))}.bind(this))},o.prototype.drain=function(t){var e=this,r=this.fd;return this.isOpen()?void u.drain(r,function(r,n){t?t(r,n):r&&e.emit("error",r)}):(a("drain attempted, but port is not open"),this._error(new Error("Port is not open"),t))},t.exports=d}).call(e,r(3),r(4).Buffer)},function(t,e,r){function n(){return"WebkitAppearance"in document.documentElement.style||window.console&&(console.firebug||console.exception&&console.table)||navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31}function i(){var t=arguments,r=this.useColors;if(t[0]=(r?"%c":"")+this.namespace+(r?" %c":" ")+t[0]+(r?"%c ":" ")+"+"+e.humanize(this.diff),!r)return t;var n="color: "+this.color;t=[t[0],n,"color: inherit"].concat(Array.prototype.slice.call(t,1));var i=0,o=0;return t[0].replace(/%[a-z%]/g,function(t){"%%"!==t&&(i++,"%c"===t&&(o=i))}),t.splice(o,0,n),t}function o(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{null==t?e.storage.removeItem("debug"):e.storage.debug=t}catch(t){}}function s(){var t;try{t=e.storage.debug}catch(t){}return t}function u(){try{return window.localStorage}catch(t){}}e=t.exports=r(18),e.log=o,e.formatArgs=i,e.save=a,e.load=s,e.useColors=n,e.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:u(),e.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],e.formatters.j=function(t){return JSON.stringify(t)},e.enable(s())},function(t,e,r){function n(){return e.colors[l++%e.colors.length]}function i(t){function r(){}function i(){var t=i,r=+new Date,o=r-(c||r);t.diff=o,t.prev=c,t.curr=r,c=r,null==t.useColors&&(t.useColors=e.useColors()),null==t.color&&t.useColors&&(t.color=n());var a=Array.prototype.slice.call(arguments);a[0]=e.coerce(a[0]),"string"!=typeof a[0]&&(a=["%o"].concat(a));var s=0;a[0]=a[0].replace(/%([a-z%])/g,function(r,n){if("%%"===r)return r;s++;var i=e.formatters[n];if("function"==typeof i){var o=a[s];r=i.call(t,o),a.splice(s,1),s--}return r}),"function"==typeof e.formatArgs&&(a=e.formatArgs.apply(t,a));var u=i.log||e.log||console.log.bind(console);u.apply(t,a)}r.enabled=!1,i.enabled=!0;var o=e.enabled(t)?i:r;return o.namespace=t,o}function o(t){e.save(t);for(var r=(t||"").split(/[\s,]+/),n=r.length,i=0;i1e4)){var e=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),n=(e[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*l;case"days":case"day":case"d":return r*c;case"hours":case"hour":case"hrs":case"hr":case"h":return r*u;case"minutes":case"minute":case"mins":case"min":case"m":return r*s;case"seconds":case"second":case"secs":case"sec":case"s":return r*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}}}function n(t){return t>=c?Math.round(t/c)+"d":t>=u?Math.round(t/u)+"h":t>=s?Math.round(t/s)+"m":t>=a?Math.round(t/a)+"s":t+"ms"}function i(t){return o(t,c,"day")||o(t,u,"hour")||o(t,s,"minute")||o(t,a,"second")||t+" ms"}function o(t,e,r){if(!(t2?arguments[2]:{},a=n(e);o&&(a=a.concat(Object.getOwnPropertySymbols(e))),i(a,function(n){l(t,n,e[n],r[n])})};f.supportsDescriptors=!!c,t.exports=f},function(t,e,r){"use strict";var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Array.prototype.slice,a=r(23),s=Object.prototype.propertyIsEnumerable,u=!s.call({toString:null},"toString"),c=s.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(t){var e=t.constructor;return e&&e.prototype===t},p={$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},h=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!p["$"+t]&&n.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{f(window[t])}catch(t){return!0}}catch(t){return!0}return!1}(),d=function(t){if("undefined"==typeof window||!h)return f(t);try{return f(t)}catch(t){return!1}},y=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===i.call(t),o=a(t),s=e&&"[object String]"===i.call(t),f=[];if(!e&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(s&&t.length>0&&!n.call(t,0))for(var h=0;h0)for(var y=0;y=0&&"[object Function]"===r.call(t.callee)),n}},function(t,e){var r=Object.prototype.hasOwnProperty,n=Object.prototype.toString;t.exports=function(t,e,i){if("[object Function]"!==n.call(e))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var a=0;a0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},i.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,this._drainQueue(this._lateQueue)},i.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},i.prototype._reset=function(){this._isTickUsed=!1},r.exports=i,r.exports.firstLineError=u},{"./queue":26,"./schedule":29,"./util":36}],3:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var i=!1,o=function(t,e){this._reject(e)},a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=function(t,e){0===(50397184&this._bitField)&&this._resolveCallback(e.target)},u=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=n.propagateFromFunction(),t.prototype._boundValue=n.boundValueFunction());var c=r(o),l=new t(e);l._propagateFrom(this,1);var f=this._target();if(l._setBoundTo(c),c instanceof t){var p={promiseRejectionQueued:!1,promise:l,target:f,bindingPromise:c};f._then(e,a,void 0,l,p),c._then(s,u,void 0,l,p),l._setOnCancel(c)}else l._resolveCallback(f);return l},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=this._bitField&-2097153},t.prototype._isBound=function(){return 2097152===(2097152&this._bitField)},t.bind=function(e,r){return t.resolve(r).bind(e)}}},{}],4:[function(t,e,r){"use strict";function n(){try{Promise===o&&(Promise=i)}catch(t){}return o}var i;"undefined"!=typeof Promise&&(i=Promise);var o=t("./promise")();o.noConflict=n,e.exports=o},{"./promise":22}],5:[function(t,e,r){"use strict";var n=Object.create;if(n){var i=n(null),o=n(null);i[" size"]=o[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+s.classString(t)+" has no method '"+s.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return e<0&&(e=Math.max(0,e+t.length)),t[e]}var a,s=t("./util"),u=s.canEvaluate;s.isIdentifier;e.prototype.call=function(t){var e=[].slice.call(arguments,1);return e.push(t),this._then(n,void 0,void 0,e,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=a(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util":36}],6:[function(t,e,r){"use strict";e.exports=function(e,r,n,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,u=e._async;e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled");for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched();break}var r=t._cancellationParent;if(null==r||!r._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched();break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=r}},e.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--;
+},e.prototype._enoughBranchesHaveCancelled=function(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0},e.prototype._cancelBy=function(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))},e.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),u.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},e.prototype._unsetOnCancel=function(){this._onCancelField=void 0},e.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},e.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var r=0;r=0)return o[t]}var i=!1,o=[];return t.prototype._promiseCreated=function(){},t.prototype._pushContext=function(){},t.prototype._popContext=function(){return null},t._peekContext=t.prototype._peekContext=function(){},e.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,o.push(this._trace))},e.prototype._popContext=function(){if(void 0!==this._trace){var t=o.pop(),e=t._promiseCreated;return t._promiseCreated=null,e}return null},e.CapturedTrace=null,e.create=r,e.deactivateLongStackTraces=function(){},e.activateLongStackTraces=function(){var r=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,u=t.prototype._promiseCreated;e.deactivateLongStackTraces=function(){t.prototype._pushContext=r,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=u,i=!1},i=!0,t.prototype._pushContext=e.prototype._pushContext,t.prototype._popContext=e.prototype._popContext,t._peekContext=t.prototype._peekContext=n,t.prototype._promiseCreated=function(){var t=this._peekContext();t&&null==t._promiseCreated&&(t._promiseCreated=this)}},e}},{}],9:[function(t,r,n){"use strict";r.exports=function(r,n){function i(t,e){return{promise:e}}function o(){return!1}function a(t,e,r){var n=this;try{t(e,r,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+D.toString(t));n._attachCancellationCallback(t)})}catch(t){return t}}function s(t){if(!this._isCancellable())return this;var e=this._onCancel();void 0!==e?D.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}function u(){return this._onCancelField}function c(t){this._onCancelField=t}function l(){this._cancellationParent=void 0,this._onCancelField=void 0}function f(t,e){if(0!==(1&e)){this._cancellationParent=t;var r=t._branchesRemainingToCancel;void 0===r&&(r=0),t._branchesRemainingToCancel=r+1}0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function p(t,e){0!==(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function h(){var t=this._boundTo;return void 0!==t&&t instanceof r?t.isFulfilled()?t.value():void 0:t}function d(){this._trace=new k(this._peekContext())}function y(t,e){if(U(t)){var r=this._trace;if(void 0!==r&&e&&(r=r._parent),void 0!==r)r.attachExtraTrace(t);else if(!t.__stackCleaned__){var n=j(t);D.notEnumerableProp(t,"stack",n.message+"\n"+n.stack.join("\n")),D.notEnumerableProp(t,"__stackCleaned__",!0)}}}function v(t,e,r,n,i){if(void 0===t&&null!==e&&Q){if(void 0!==i&&i._returnedNonUndefined())return;if(0===(65535&n._bitField))return;r&&(r+=" ");var o="",a="";if(e._trace){for(var s=e._trace.stack.split("\n"),u=E(s),c=u.length-1;c>=0;--c){var l=u[c];if(!z.test(l)){var f=l.match(q);f&&(o="at "+f[1]+":"+f[2]+":"+f[3]+" ");break}}if(u.length>0)for(var p=u[0],c=0;c0&&(a="\n"+s[c-1]);break}}var h="a promise was created in a "+r+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a;n._warn(h,!0,e)}}function g(t,e){var r=t+" is deprecated and will be removed in a future version.";return e&&(r+=" Use "+e+" instead."),b(r)}function b(t,e,n){if(at.warnings){var i,o=new L(t);if(e)n._attachExtraTrace(o);else if(at.longStackTraces&&(i=r._peekContext()))i.attachExtraTrace(o);else{var a=j(o);o.stack=a.message+"\n"+a.stack.join("\n")}et("warning",o)||S(o,"",!0)}}function m(t,e){for(var r=0;r=0;--s)if(n[s]===o){a=s;break}for(var s=a;s>=0;--s){var u=n[s];if(e[i]!==u)break;e.pop(),i--}e=n}}function E(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function j(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?O(t):[" (No stack trace)"],{message:r,stack:E(e)}}function S(t,e,r){if("undefined"!=typeof console){var n;if(D.isObject(t)){var i=t.stack;n=e+V(i,t)}else n=e+String(t);"function"==typeof N?N(n,r):"function"!=typeof console.log&&"object"!=typeof console.log||console.log(n)}}function T(t,e,r,n){var i=!1;try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(n):e(r,n))}catch(t){B.throwLater(t)}"unhandledRejection"===t?et(t,r,n)||i||S(r,"Unhandled rejection "):et(t,n)}function C(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t&&"function"==typeof t.toString?t.toString():D.toString(t);var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+x(e)+">, no stack trace)"}function x(t){var e=41;return t.length=s||(nt=function(t){if(W.test(t))return!0;var e=R(t);return!!(e&&e.fileName===r&&a<=e.line&&e.line<=s)})}}function k(t){this._parent=t,this._promisesCreated=0;var e=this._length=1+(void 0===t?0:t._length);ot(this,k),e>32&&this.uncycle()}var I,M,N,F=r._getDomain,B=r._async,L=t("./errors").Warning,D=t("./util"),U=D.canAttachTrace,W=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,z=/\((?:timers\.js):\d+:\d+\)/,q=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,H=null,V=null,$=!1,G=!(0==D.env("BLUEBIRD_DEBUG")),Y=!(0==D.env("BLUEBIRD_WARNINGS")||!G&&!D.env("BLUEBIRD_WARNINGS")),X=!(0==D.env("BLUEBIRD_LONG_STACK_TRACES")||!G&&!D.env("BLUEBIRD_LONG_STACK_TRACES")),Q=0!=D.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(Y||!!D.env("BLUEBIRD_W_FORGOTTEN_RETURN"));r.prototype.suppressUnhandledRejections=function(){var t=this._target();t._bitField=t._bitField&-1048577|524288},r.prototype._ensurePossibleRejectionHandled=function(){0===(524288&this._bitField)&&(this._setRejectionIsUnhandled(),B.invokeLater(this._notifyUnhandledRejection,this,void 0))},r.prototype._notifyUnhandledRejectionIsHandled=function(){T("rejectionHandled",I,void 0,this)},r.prototype._setReturnedNonUndefined=function(){this._bitField=268435456|this._bitField},r.prototype._returnedNonUndefined=function(){return 0!==(268435456&this._bitField)},r.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue();this._setUnhandledRejectionIsNotified(),T("unhandledRejection",M,t,this)}},r.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=262144|this._bitField},r.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=this._bitField&-262145},r.prototype._isUnhandledRejectionNotified=function(){return(262144&this._bitField)>0},r.prototype._setRejectionIsUnhandled=function(){this._bitField=1048576|this._bitField},r.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},r.prototype._isRejectionUnhandled=function(){return(1048576&this._bitField)>0},r.prototype._warn=function(t,e,r){return b(t,e,r||this)},r.onPossiblyUnhandledRejection=function(t){var e=F();M="function"==typeof t?null===e?t:D.domainBind(e,t):void 0},r.onUnhandledRejectionHandled=function(t){var e=F();I="function"==typeof t?null===e?t:D.domainBind(e,t):void 0};var J=function(){};r.longStackTraces=function(){if(B.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");if(!at.longStackTraces&&P()){var t=r.prototype._captureStackTrace,e=r.prototype._attachExtraTrace;at.longStackTraces=!0,J=function(){if(B.haveItemsQueued()&&!at.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n");r.prototype._captureStackTrace=t,r.prototype._attachExtraTrace=e,n.deactivateLongStackTraces(),B.enableTrampoline(),at.longStackTraces=!1},r.prototype._captureStackTrace=d,r.prototype._attachExtraTrace=y,n.activateLongStackTraces(),B.disableTrampolineIfNecessary()}},r.hasLongStackTraces=function(){return at.longStackTraces&&P()};var Z=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent");return D.global.dispatchEvent(t),function(t,e){var r=new CustomEvent(t.toLowerCase(),{detail:e,cancelable:!0});return!D.global.dispatchEvent(r)}}if("function"==typeof Event){var t=new Event("CustomEvent");return D.global.dispatchEvent(t),function(t,e){var r=new Event(t.toLowerCase(),{cancelable:!0});return r.detail=e,!D.global.dispatchEvent(r)}}var t=document.createEvent("CustomEvent");return t.initCustomEvent("testingtheevent",!1,!0,{}),D.global.dispatchEvent(t),function(t,e){var r=document.createEvent("CustomEvent");return r.initCustomEvent(t.toLowerCase(),!1,!0,e),!D.global.dispatchEvent(r)}}catch(t){}return function(){return!1}}(),K=function(){return D.isNode?function(){return e.emit.apply(e,arguments)}:D.global?function(t){var e="on"+t.toLowerCase(),r=D.global[e];return!!r&&(r.apply(D.global,[].slice.call(arguments,1)),!0)}:function(){return!1}}(),tt={promiseCreated:i,promiseFulfilled:i,promiseRejected:i,promiseResolved:i,promiseCancelled:i,promiseChained:function(t,e,r){return{promise:e,child:r}},warning:function(t,e){return{warning:e}},unhandledRejection:function(t,e,r){return{reason:e,promise:r}},rejectionHandled:i},et=function(t){var e=!1;try{e=K.apply(null,arguments)}catch(t){B.throwLater(t),e=!0}var r=!1;try{r=Z(t,tt[t].apply(null,arguments))}catch(t){B.throwLater(t),r=!0}return r||e};r.config=function(t){if(t=Object(t),"longStackTraces"in t&&(t.longStackTraces?r.longStackTraces():!t.longStackTraces&&r.hasLongStackTraces()&&J()),"warnings"in t){var e=t.warnings;at.warnings=!!e,Q=at.warnings,D.isObject(e)&&"wForgottenReturn"in e&&(Q=!!e.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!at.cancellation){if(B.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");r.prototype._clearCancellationData=l,r.prototype._propagateFrom=f,r.prototype._onCancel=u,r.prototype._setOnCancel=c,r.prototype._attachCancellationCallback=s,r.prototype._execute=a,rt=f,at.cancellation=!0}"monitoring"in t&&(t.monitoring&&!at.monitoring?(at.monitoring=!0,r.prototype._fireEvent=et):!t.monitoring&&at.monitoring&&(at.monitoring=!1,r.prototype._fireEvent=o))},r.prototype._fireEvent=o,r.prototype._execute=function(t,e,r){try{t(e,r)}catch(t){return t}},r.prototype._onCancel=function(){},r.prototype._setOnCancel=function(t){},r.prototype._attachCancellationCallback=function(t){},r.prototype._captureStackTrace=function(){},r.prototype._attachExtraTrace=function(){},r.prototype._clearCancellationData=function(){},r.prototype._propagateFrom=function(t,e){};var rt=p,nt=function(){return!1},it=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;D.inherits(k,Error),n.CapturedTrace=k,k.prototype.uncycle=function(){var t=this._length;if(!(t<2)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;n0&&(e[s-1]._parent=void 0,e[s-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;s=0;--l)e[l]._length=c,c++;return}}}},k.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var e=j(t),r=e.message,n=[e.stack],i=this;void 0!==i;)n.push(E(i.stack.split("\n"))),i=i._parent;w(n),_(n),D.notEnumerableProp(t,"stack",m(r,n)),D.notEnumerableProp(t,"__stackCleaned__",!0)}};var ot=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():C(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,H=t,V=e;var r=Error.captureStackTrace;return nt=function(t){return W.test(t)},function(t,e){Error.stackTraceLimit+=6,r(t,e),Error.stackTraceLimit-=6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return H=/@/,V=e,$=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(t){i="stack"in t}return"stack"in n||!i||"number"!=typeof Error.stackTraceLimit?(V=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?C(e):e.toString()},null):(H=t,V=e,function(t){Error.stackTraceLimit+=6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6})}([]);"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(N=function(t){console.warn(t)},D.isNode&&e.stderr.isTTY?N=function(t,e){var r=e?"[33m":"[31m";console.warn(r+t+"[0m\n")}:D.isNode||"string"!=typeof(new Error).stack||(N=function(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}));var at={warnings:Y,longStackTraces:!1,cancellation:!1,monitoring:!1};return X&&r.longStackTraces(),{longStackTraces:function(){return at.longStackTraces},warnings:function(){return at.warnings},cancellation:function(){return at.cancellation},monitoring:function(){return at.monitoring},propagateFromFunction:function(){return rt},boundValueFunction:function(){return h},checkForgottenReturns:v,setBounds:A,warn:b,deprecated:g,CapturedTrace:k,fireDomEvent:Z,fireGlobalEvent:K}}},{"./errors":12,"./util":36}],10:[function(t,e,r){"use strict";e.exports=function(t){function e(){return this.value}function r(){throw this.reason}t.prototype.return=t.prototype.thenReturn=function(r){return r instanceof t&&r.suppressUnhandledRejections(),this._then(e,void 0,void 0,{value:r},void 0)},t.prototype.throw=t.prototype.thenThrow=function(t){return this._then(r,void 0,void 0,{reason:t},void 0)},t.prototype.catchThrow=function(t){if(arguments.length<=1)return this._then(void 0,r,void 0,{reason:t},void 0);var e=arguments[1],n=function(){throw e};return this.caught(t,n)},t.prototype.catchReturn=function(r){if(arguments.length<=1)return r instanceof t&&r.suppressUnhandledRejections(),this._then(void 0,e,void 0,{value:r},void 0);var n=arguments[1];n instanceof t&&n.suppressUnhandledRejections();var i=function(){return n};return this.caught(r,i)}}},{}],11:[function(t,e,r){"use strict";e.exports=function(t,e){function r(){return o(this)}function n(t,r){return i(t,r,e,e)}var i=t.reduce,o=t.all;t.prototype.each=function(t){return i(this,t,e,0)._then(r,void 0,void 0,this,void 0)},t.prototype.mapSeries=function(t){return i(this,t,e,e)},t.each=function(t,n){return i(t,n,e,0)._then(r,void 0,void 0,t,void 0)},t.mapSeries=n}},{}],12:[function(t,e,r){"use strict";function n(t,e){function r(n){return this instanceof r?(f(this,"message","string"==typeof n?n:e),f(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return l(r,Error),r}function i(t){return this instanceof i?(f(this,"name","OperationalError"),f(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(f(this,"message",t.message),f(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new i(t)}var o,a,s=t("./es5"),u=s.freeze,c=t("./util"),l=c.inherits,f=c.notEnumerableProp,p=n("Warning","warning"),h=n("CancellationError","cancellation error"),d=n("TimeoutError","timeout error"),y=n("AggregateError","aggregate error");try{o=TypeError,a=RangeError}catch(t){o=n("TypeError","type error"),a=n("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),g=0;g1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function a(){return u.call(this,this.promise._target()._settledValue())}function s(t){if(!o(this,t))return f.e=t,f}function u(t){var n=this.promise,u=this.handler;if(!this.called){this.called=!0;var c=this.isFinallyHandler()?u.call(n._boundValue()):u.call(n._boundValue(),t);if(void 0!==c){n._setReturnedNonUndefined();var p=r(c,n);if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var h=new l("late cancellation observer");return n._attachExtraTrace(h),f.e=h,f}p.isPending()&&p._attachCancellationCallback(new i(this))}return p._then(a,s,void 0,this,void 0)}}}return n.isRejected()?(o(this),f.e=t,f):(o(this),t)}var c=t("./util"),l=e.CancellationError,f=c.errorObj;return n.prototype.isFinallyHandler=function(){return 0===this.type},i.prototype._resultCancelled=function(){o(this.finallyHandler)},e.prototype._passThrough=function(t,e,r,i){return"function"!=typeof t?this.then():this._then(r,i,void 0,new n(this,e,t),void 0)},e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,u,u)},e.prototype.tap=function(t){return this._passThrough(t,1,u)},n}},{"./util":36}],16:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){function s(t,r,n){for(var o=0;o0&&"function"==typeof arguments[e]){t=arguments[e];var n}var i=[].slice.call(arguments);t&&i.pop();var n=new r(i).promise();return void 0!==t?n.spread(t):n}}},{"./util":36}],18:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=c();this._callback=null===i?e:l.domainBind(i,e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=[],h.invoke(this._asyncInit,this,void 0)}function u(t,r,i,o){if("function"!=typeof r)return n("expecting a function but got "+l.classString(r));var a=0;if(void 0!==i){if("object"!=typeof i||null===i)return e.reject(new TypeError("options argument must be an object but it is "+l.classString(i)));if("number"!=typeof i.concurrency)return e.reject(new TypeError("'concurrency' must be a number but it is "+l.classString(i.concurrency)));a=i.concurrency}return a="number"==typeof a&&isFinite(a)&&a>=1?a:0,new s(t,r,a,o).promise()}var c=e._getDomain,l=t("./util"),f=l.tryCatch,p=l.errorObj,h=e._async;l.inherits(s,r),s.prototype._asyncInit=function(){this._init$(void 0,-2)},s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,u=this._limit;if(r<0){if(r=r*-1-1,n[r]=t,u>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(u>=1&&this._inFlight>=u)return n[r]=t,this._queue.push(r),!1;null!==s&&(s[r]=t);var c=this._promise,l=this._callback,h=c._boundValue();c._pushContext();var d=f(l).call(h,t,r,o),y=c._popContext();if(a.checkForgottenReturns(d,y,null!==s?"Promise.filter":"Promise.map",c),d===p)return this._reject(d.e),!0;var v=i(d,this._promise);if(v instanceof e){v=v._target();var g=v._bitField;if(0===(50397184&g))return u>=1&&this._inFlight++,n[r]=v,v._proxy(this,(r+1)*-1),!1;if(0===(33554432&g))return 0!==(16777216&g)?(this._reject(v._reason()),!0):(this._cancel(),!0);d=v._value()}n[r]=d}var b=++this._totalResolved;return b>=o&&(null!==s?this._filter(n,s):this._resolve(n),!0)},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlight1){o.deprecated("calling Promise.try with more than 1 argument");var c=arguments[1],l=arguments[2];u=a.isArray(c)?s(t).apply(l,c):s(t).call(l,c)}else u=s(t)();var f=n._popContext();return o.checkForgottenReturns(u,f,"Promise.try",n),n._resolveFromSyncValue(u),n},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}},{"./util":36}],20:[function(t,e,r){"use strict";function n(t){return t instanceof Error&&l.getPrototypeOf(t)===Error.prototype}function i(t){var e;if(n(t)){e=new c(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var r=l.keys(t),i=0;i1){var r,n=new Array(e-1),i=0;for(r=0;r0&&"function"!=typeof t&&"function"!=typeof e){var r=".then() only accepts functions but was passed: "+d.classString(t);arguments.length>1&&(r+=", "+d.classString(e)),this._warn(r)}return this._then(t,e,void 0,void 0,void 0)},o.prototype.done=function(t,e){var r=this._then(t,e,void 0,void 0,void 0);r._setIsFinal()},o.prototype.spread=function(t){return"function"!=typeof t?p("expecting a function but got "+d.classString(t)):this.all()._then(t,void 0,void 0,E,void 0)},o.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},o.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new S(this).promise()},o.prototype.error=function(t){return this.caught(d.originatesFromRejection,t)},o.getNewLibraryCopy=r.exports,o.is=function(t){return t instanceof o},o.fromNode=o.fromCallback=function(t){var e=new o(w);e._captureStackTrace();var r=arguments.length>1&&!!Object(arguments[1]).multiArgs,n=I(t)(A(e,r));return n===k&&e._rejectCallback(n.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},o.all=function(t){return new S(t).promise()},o.cast=function(t){var e=j(t);return e instanceof o||(e=new o(w),e._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},o.resolve=o.fulfilled=o.cast,o.reject=o.rejected=function(t){var e=new o(w);return e._captureStackTrace(),e._rejectCallback(t,!0),e},o.setScheduler=function(t){if("function"!=typeof t)throw new m("expecting a function but got "+d.classString(t));return g.setScheduler(t)},o.prototype._then=function(t,e,r,n,i){var a=void 0!==i,s=a?i:new o(w),u=this._target(),l=u._bitField;a||(s._propagateFrom(this,3),s._captureStackTrace(),void 0===n&&0!==(2097152&this._bitField)&&(n=0!==(50397184&l)?this._boundValue():u===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,s));var f=c();if(0!==(50397184&l)){var p,h,y=u._settlePromiseCtx;0!==(33554432&l)?(h=u._rejectionHandler0,p=t):0!==(16777216&l)?(h=u._fulfillmentHandler0,p=e,u._unsetRejectionIsUnhandled()):(y=u._settlePromiseLateCancellationObserver,h=new _("late cancellation observer"),u._attachExtraTrace(h),p=e),g.invoke(y,u,{handler:null===f?p:"function"==typeof p&&d.domainBind(f,p),promise:s,receiver:n,value:h})}else u._addCallbacks(t,e,s,n,f);return s},o.prototype._length=function(){return 65535&this._bitField},o.prototype._isFateSealed=function(){return 0!==(117506048&this._bitField)},o.prototype._isFollowing=function(){return 67108864===(67108864&this._bitField)},o.prototype._setLength=function(t){this._bitField=this._bitField&-65536|65535&t},o.prototype._setFulfilled=function(){this._bitField=33554432|this._bitField,this._fireEvent("promiseFulfilled",this)},o.prototype._setRejected=function(){this._bitField=16777216|this._bitField,this._fireEvent("promiseRejected",this)},o.prototype._setFollowing=function(){this._bitField=67108864|this._bitField,this._fireEvent("promiseResolved",this)},o.prototype._setIsFinal=function(){this._bitField=4194304|this._bitField},o.prototype._isFinal=function(){return(4194304&this._bitField)>0},o.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},o.prototype._setCancelled=function(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)},o.prototype._setWillBeCancelled=function(){this._bitField=8388608|this._bitField},o.prototype._setAsyncGuaranteed=function(){g.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},o.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3];if(e!==h)return void 0===e&&this._isBound()?this._boundValue():e},o.prototype._promiseAt=function(t){return this[4*t-4+2]},o.prototype._fulfillmentHandlerAt=function(t){return this[4*t-4+0]},o.prototype._rejectionHandlerAt=function(t){return this[4*t-4+1]},o.prototype._boundValue=function(){},o.prototype._migrateCallback0=function(t){var e=(t._bitField,t._fulfillmentHandler0),r=t._rejectionHandler0,n=t._promise0,i=t._receiverAt(0);void 0===i&&(i=h),this._addCallbacks(e,r,n,i,null)},o.prototype._migrateCallbackAt=function(t,e){var r=t._fulfillmentHandlerAt(e),n=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e);void 0===o&&(o=h),this._addCallbacks(r,n,i,o,null)},o.prototype._addCallbacks=function(t,e,r,n,i){var o=this._length();if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=r,this._receiver0=n,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:d.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:d.domainBind(i,e));else{var a=4*o-4;this[a+2]=r,this[a+3]=n,"function"==typeof t&&(this[a+0]=null===i?t:d.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:d.domainBind(i,e))}return this._setLength(o+1),o},o.prototype._proxy=function(t,e){this._addCallbacks(void 0,void 0,e,t,null)},o.prototype._resolveCallback=function(t,e){if(0===(117506048&this._bitField)){if(t===this)return this._rejectCallback(l(),!1);var r=j(t,this);if(!(r instanceof o))return this._fulfill(t);e&&this._propagateFrom(r,2);var n=r._target();if(n===this)return void this._reject(l());var i=n._bitField;if(0===(50397184&i)){var a=this._length();a>0&&n._migrateCallback0(this);for(var s=1;s>>16)){if(t===this){var r=l();return this._attachExtraTrace(r),this._reject(r)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!==(134217728&e)?this._settlePromises():g.settlePromises(this))}},o.prototype._reject=function(t){var e=this._bitField;if(!((117506048&e)>>>16))return this._setRejected(),this._fulfillmentHandler0=t,this._isFinal()?g.fatalError(t,d.isNode):void((65535&e)>0?g.settlePromises(this):this._ensurePossibleRejectionHandled())},o.prototype._fulfillPromises=function(t,e){for(var r=1;r0){if(0!==(16842752&t)){var r=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,r,t),this._rejectPromises(e,r)}else{var n=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,n,t),this._fulfillPromises(e,n)}this._setLength(0)}this._clearCancellationData()},o.prototype._settledValue=function(){var t=this._bitField;return 0!==(33554432&t)?this._rejectionHandler0:0!==(16777216&t)?this._fulfillmentHandler0:void 0},o.defer=o.pending=function(){x.deprecated("Promise.defer","new Promise");var t=new o(w);return{promise:t,resolve:a,reject:s}},d.notEnumerableProp(o,"_makeSelfResolutionError",l),t("./method")(o,w,j,p,x),t("./bind")(o,w,j,x),t("./cancel")(o,S,p,x),t("./direct_resolve")(o),t("./synchronous_inspection")(o),t("./join")(o,S,j,w,g,c),o.Promise=o,o.version="3.4.6",t("./map.js")(o,S,p,j,w,x),t("./call_get.js")(o),t("./using.js")(o,p,j,C,w,x),t("./timers.js")(o,w,x),t("./generators.js")(o,p,w,j,n,x),t("./nodeify.js")(o),t("./promisify.js")(o,w),t("./props.js")(o,S,j,p),t("./race.js")(o,w,j,p),t("./reduce.js")(o,S,p,j,w,x),t("./settle.js")(o,S,x),t("./some.js")(o,S,p),t("./filter.js")(o,w),t("./each.js")(o,w),t("./any.js")(o),d.toFastProperties(o),d.toFastProperties(o.prototype),u({a:1}),u({b:2}),u({c:3}),u(1),u(function(){}),u(void 0),u(!1),u(new o(w)),x.setBounds(v.firstLineError,d.lastLineError),o}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36}],23:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o){function a(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n=this._promise=new e(r);t instanceof e&&n._propagateFrom(t,3),n._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var u=t("./util");u.isArray;return u.inherits(s,o),s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function t(r,o){var s=n(this._values,this._promise);if(s instanceof e){s=s._target();var c=s._bitField;if(this._values=s,0===(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o);if(0===(33554432&c))return 0!==(16777216&c)?this._reject(s._reason()):this._cancel();s=s._value()}if(s=u.asArray(s),null===s){var l=i("expecting an array or an iterable object but got "+u.classString(s)).reason();return void this._promise._rejectCallback(l,!1)}return 0===s.length?void(o===-5?this._resolveEmptyArray():this._resolve(a(o))):void this._iterate(s)},s.prototype._iterate=function(t){var r=this.getActualLength(t.length);this._length=r,this._values=this.shouldCopyValues()?new Array(r):this._values;for(var i=this._promise,o=!1,a=null,s=0;s=this._length&&(this._resolve(this._values),!0)},s.prototype._promiseCancelled=function(){return this._cancel(),!0},s.prototype._promiseRejected=function(t){return this._totalResolved++,this._reject(t),!0},s.prototype._resultCancelled=function(){if(!this._isResolved()){var t=this._values;if(this._cancel(),t instanceof e)t.cancel();else for(var r=0;r=this._length){var n;if(this._isMap)n=p(this._values);else{n={};for(var i=this.length(),o=0,a=this.length();o>1},e.prototype.props=function(){return a(this)},e.props=function(t){return a(t)}}},{"./es5":13,"./util":36}],26:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var o=0;o=this._length&&(this._resolve(this._values),!0)},i.prototype._promiseFulfilled=function(t,e){var r=new o;return r._bitField=33554432,r._settledValueField=t,this._promiseResolved(e,r)},i.prototype._promiseRejected=function(t,e){var r=new o;return r._bitField=16777216,r._settledValueField=t,this._promiseResolved(e,r)},e.settle=function(t){return n.deprecated(".settle()",".reflect()"),new i(t).promise()},e.prototype.settle=function(){return e.settle(this)}}},{"./util":36}],31:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||e<0)return n("expecting a positive integer\n\n See http://goo.gl/MqrFmX\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var a=t("./util"),s=t("./errors").RangeError,u=t("./errors").AggregateError,c=a.isArray,l={};a.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){return this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),1===this.howMany()&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0)},i.prototype._promiseRejected=function(t){return this._addRejected(t),this._checkOutcome()},i.prototype._promiseCancelled=function(){return this._values instanceof e||null==this._values?this._cancel():(this._addRejected(l),this._checkOutcome())},i.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var t=new u,e=this.length();e0?this._reject(t):this._cancel(),!0}return!1},i.prototype._fulfilled=function(){return this._totalResolved},i.prototype._rejected=function(){return this._values.length-this.length()},i.prototype._addRejected=function(t){this._values.push(t)},i.prototype._addFulfilled=function(t){this._values[this._totalResolved++]=t},i.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},i.prototype._getRangeError=function(t){var e="Input array must contain at least "+this._howMany+" items but contains only "+t+" items";return new s(e)},i.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))},e.some=function(t,e){return o(t,e)},e.prototype.some=function(t){return o(this,t)},e._SomePromiseArray=i}},{"./errors":12,"./util":36}],32:[function(t,e,r){"use strict";e.exports=function(t){function e(t){void 0!==t?(t=t._target(),this._bitField=t._bitField,this._settledValueField=t._isFateSealed()?t._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}e.prototype._settledValue=function(){return this._settledValueField};var r=e.prototype.value=function(){if(!this.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},n=e.prototype.error=e.prototype.reason=function(){if(!this.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/MqrFmX\n");return this._settledValue()},i=e.prototype.isFulfilled=function(){return 0!==(33554432&this._bitField)},o=e.prototype.isRejected=function(){return 0!==(16777216&this._bitField)},a=e.prototype.isPending=function(){return 0===(50397184&this._bitField)},s=e.prototype.isResolved=function(){return 0!==(50331648&this._bitField)};e.prototype.isCancelled=function(){return 0!==(8454144&this._bitField)},t.prototype.__isCancelled=function(){return 65536===(65536&this._bitField)},t.prototype._isCancelled=function(){return this._target().__isCancelled()},t.prototype.isCancelled=function(){return 0!==(8454144&this._target()._bitField)},t.prototype.isPending=function(){return a.call(this._target())},t.prototype.isRejected=function(){return o.call(this._target())},t.prototype.isFulfilled=function(){return i.call(this._target())},t.prototype.isResolved=function(){return s.call(this._target())},t.prototype.value=function(){return r.call(this._target())},t.prototype.reason=function(){var t=this._target();return t._unsetRejectionIsUnhandled(),n.call(t)},t.prototype._value=function(){return this._settledValue()},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},t.PromiseInspection=e}},{}],33:[function(t,e,r){"use strict";e.exports=function(e,r){function n(t,n){if(l(t)){if(t instanceof e)return t;var i=o(t);if(i===c){n&&n._pushContext();var u=e.reject(i.e);return n&&n._popContext(),u}if("function"==typeof i){if(a(t)){var u=new e(r);return t._then(u._fulfill,u._reject,void 0,u,null),u}return s(t,i,n)}}return t}function i(t){return t.then}function o(t){try{return i(t)}catch(t){return c.e=t,c}}function a(t){try{return f.call(t,"_promise0")}catch(t){return!1}}function s(t,n,i){function o(t){s&&(s._resolveCallback(t),s=null)}function a(t){s&&(s._rejectCallback(t,f,!0),s=null)}var s=new e(r),l=s;i&&i._pushContext(),s._captureStackTrace(),i&&i._popContext();var f=!0,p=u.tryCatch(n).call(t,o,a);return f=!1,s&&p===c&&(s._rejectCallback(p.e,!0,!0),s=null),l}var u=t("./util"),c=u.errorObj,l=u.isObject,f={}.hasOwnProperty;return n}},{"./util":36}],34:[function(t,e,r){"use strict";e.exports=function(e,r,n){function i(t){this.handle=t}function o(t){return clearTimeout(this.handle),t}function a(t){throw clearTimeout(this.handle),t}var s=t("./util"),u=e.TimeoutError;i.prototype._resultCancelled=function(){clearTimeout(this.handle)};var c=function(t){return l(+this).thenReturn(t)},l=e.delay=function(t,o){var a,s;return void 0!==o?(a=e.resolve(o)._then(c,null,null,t,void 0),n.cancellation()&&o instanceof e&&a._setOnCancel(o)):(a=new e(r),s=setTimeout(function(){a._fulfill()},+t),n.cancellation()&&a._setOnCancel(new i(s)),a._captureStackTrace()),a._setAsyncGuaranteed(),a};e.prototype.delay=function(t){return l(t,this)};var f=function(t,e,r){var n;n="string"!=typeof e?e instanceof Error?e:new u("operation timed out"):new u(e),s.markAsOriginatingFromRejection(n),t._attachExtraTrace(n),t._reject(n),null!=r&&r.cancel()};e.prototype.timeout=function(t,e){t=+t;var r,s,u=new i(setTimeout(function(){r.isPending()&&f(r,e,s)},t));return n.cancellation()?(s=this.then(),r=s._then(o,a,void 0,u,void 0),r._setOnCancel(u)):r=this._then(o,a,void 0,u,void 0),r}}},{"./util":36}],35:[function(t,e,r){"use strict";e.exports=function(e,r,n,i,o,a){function s(t){setTimeout(function(){throw t},0)}function u(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),
+e}function c(t,r){function i(){if(a>=c)return l._fulfill();var o=u(t[a++]);if(o instanceof e&&o._isDisposable()){try{o=n(o._getDisposer().tryDispose(r),t.promise)}catch(t){return s(t)}if(o instanceof e)return o._then(i,s,null,null,null)}i()}var a=0,c=t.length,l=new e(o);return i(),l}function l(t,e,r){this._data=t,this._promise=e,this._context=r}function f(t,e,r){this.constructor$(t,e,r)}function p(t){return l.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}function h(t){this.length=t,this.promise=null,this[t-1]=null}var d=t("./util"),y=t("./errors").TypeError,v=t("./util").inherits,g=d.errorObj,b=d.tryCatch,m={};l.prototype.data=function(){return this._data},l.prototype.promise=function(){return this._promise},l.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():m},l.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=e!==m?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},l.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},v(f,l),f.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},h.prototype._resultCancelled=function(){for(var t=this.length,r=0;r0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new f(t,this,i());throw new y}}},{"./errors":12,"./util":36}],36:[function(t,n,i){"use strict";function o(){try{var t=A;return A=null,t.apply(this,arguments)}catch(t){return R.e=t,R}}function a(t){return A=t,o}function s(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function u(t){return"function"==typeof t||"object"==typeof t&&null!==t}function c(t){return s(t)?new Error(b(t)):t}function l(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;r1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=N.test(t+"")&&x.names(t).length>0;if(r||n||i)return!0}return!1}catch(t){return!1}}function y(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function v(t){return F.test(t)}function g(t,e,r){for(var n=new Array(t),i=0;i10||t[0]>0}(),W.isNode&&W.toFastProperties(e);try{throw new Error}catch(t){W.lastLineError=t}n.exports=W},{"./es5":13}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise)}).call(e,r(3),function(){return this}(),r(35).setImmediate)},function(t,e,r){(function(t,n){function i(t,e){this._id=t,this._clearFn=e}var o=r(3).nextTick,a=Function.prototype.apply,s=Array.prototype.slice,u={},c=0;e.setTimeout=function(){return new i(a.call(setTimeout,window,arguments),clearTimeout)},e.setInterval=function(){return new i(a.call(setInterval,window,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},e.setImmediate="function"==typeof t?t:function(t){var r=c++,n=!(arguments.length<2)&&s.call(arguments,1);return u[r]=!0,o(function(){u[r]&&(n?t.apply(null,n):t.call(null),e.clearImmediate(r))}),r},e.clearImmediate="function"==typeof n?n:function(t){delete u[t]}}).call(e,r(35).setImmediate,r(35).clearImmediate)},function(t,e){t.exports=child_process},function(t,e){t.exports=fs},function(t,e,r){(function(t){function r(t,e){for(var r=0,n=t.length-1;n>=0;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r--;r)t.unshift("..");return t}function n(t,e){if(t.filter)return t.filter(e);for(var r=[],n=0;n=-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&&(e=a+"/"+e,i="/"===a.charAt(0))}return e=r(n(e.split("/"),function(t){return!!t}),!i).join("/"),(i?"/":"")+e||"."},e.normalize=function(t){var i=e.isAbsolute(t),o="/"===a(t,-1);return t=r(n(t.split("/"),function(t){return!!t}),!i).join("/"),t||i||(t="."),t&&o&&(t+="/"),(i?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(n(t,function(t,e){if("string"!=typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,r){function n(t){for(var e=0;e=0&&""===t[r];r--);return e>r?[]:t.slice(e,r-e+1)}t=e.resolve(t).substr(1),r=e.resolve(r).substr(1);for(var i=n(t.split("/")),o=n(r.split("/")),a=Math.min(i.length,o.length),s=a,u=0;u=t;){var o=r.slice(0,t);r=r.slice(t),n.emit("data",o)}}},byteDelimiter:function(t){"[object Array]"!==Object.prototype.toString.call(t)&&(t=[t]);var e=[],r=0;return function(n,i){for(var o=0;o0)if(e.ended&&!i){var s=new Error("stream.push() after EOF");t.emit("error",s)}else if(e.endEmitted&&i){var s=new Error("stream.unshift() after end event");t.emit("error",s)}else!e.decoder||i||n||(r=e.decoder.write(r)),i||(e.reading=!1),e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&f(t)),h(t,e);else i||(e.reading=!1);return a(e)}function a(t){return!t.ended&&(t.needReadable||t.length=R)t=R;else{t--;for(var e=1;e<32;e<<=1)t|=t>>e;t++}return t}function u(t,e){return 0===e.length&&e.ended?0:e.objectMode?0===t?0:1:isNaN(t)||C.isNull(t)?e.flowing&&e.buffer.length?e.buffer[0].length:e.length:t<=0?0:(t>e.highWaterMark&&(e.highWaterMark=s(t)),t>e.length?e.ended?e.length:(e.needReadable=!0,0):t)}function c(t,e){var r=null;return C.isBuffer(e)||C.isString(e)||C.isNullOrUndefined(e)||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function l(t,e){if(e.decoder&&!e.ended){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,f(t)}function f(t){var r=t._readableState;r.needReadable=!1,r.emittedReadable||(P("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?e.nextTick(function(){p(t)}):p(t))}function p(t){P("emit readable"),t.emit("readable"),b(t)}function h(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(function(){d(t,r)}))}function d(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=i)r=o?n.join(""):j.concat(n,i),n.length=0;else if(t0)throw new Error("endReadable called on non-empty stream");r.endEmitted||(r.ended=!0,e.nextTick(function(){r.endEmitted||0!==r.length||(r.endEmitted=!0,t.readable=!1,t.emit("end"))}))}function w(t,e){for(var r=0,n=t.length;r0)&&(e.emittedReadable=!1),0===t&&e.needReadable&&(e.length>=e.highWaterMark||e.ended))return P("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?_(this):f(this),null;if(t=u(t,e),0===t&&e.ended)return 0===e.length&&_(this),null;var n=e.needReadable;P("need readable",n),(0===e.length||e.length-t0?m(t,e):null,C.isNull(i)&&(e.needReadable=!0,t=0),e.length-=t,0!==e.length||e.ended||(e.needReadable=!0),r!==t&&e.ended&&0===e.length&&_(this),C.isNull(i)||this.emit("data",i),i},i.prototype._read=function(t){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(t,r){function n(t){P("onunpipe"),t===f&&o()}function i(){P("onend"),t.end()}function o(){P("cleanup"),t.removeListener("close",u),t.removeListener("finish",c),t.removeListener("drain",v),t.removeListener("error",s),t.removeListener("unpipe",n),f.removeListener("end",i),f.removeListener("end",o),f.removeListener("data",a),!p.awaitDrain||t._writableState&&!t._writableState.needDrain||v()}function a(e){P("ondata");var r=t.write(e);!1===r&&(P("false write response, pause",f._readableState.awaitDrain),f._readableState.awaitDrain++,f.pause())}function s(e){P("onerror",e),l(),t.removeListener("error",s),0===S.listenerCount(t,"error")&&t.emit("error",e)}function u(){t.removeListener("finish",c),l()}function c(){P("onfinish"),t.removeListener("close",u),l()}function l(){P("unpipe"),f.unpipe(t)}var f=this,p=this._readableState;switch(p.pipesCount){case 0:p.pipes=t;break;case 1:p.pipes=[p.pipes,t];break;default:p.pipes.push(t)}p.pipesCount+=1,P("pipe count=%d opts=%j",p.pipesCount,r);var h=(!r||r.end!==!1)&&t!==e.stdout&&t!==e.stderr,d=h?i:o;p.endEmitted?e.nextTick(d):f.once("end",d),t.on("unpipe",n);var v=y(f);return t.on("drain",v),f.on("data",a),t._events&&t._events.error?O(t._events.error)?t._events.error.unshift(s):t._events.error=[s,t._events.error]:t.on("error",s),t.once("close",u),t.once("finish",c),t.emit("pipe",f),p.flowing||(P("pipe resume"),f.resume()),t},i.prototype.unpipe=function(t){var e=this._readableState;if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this),this);if(!t){var r=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i1){for(var r=[],n=0;n=this.charLength-this.charReceived?this.charLength-this.charReceived:t.length;if(t.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&n<=56319)){if(this.charReceived=this.charLength=0,0===t.length)return e;break}this.charLength+=this.surrogateSize,e=""}this.detectIncompleteChar(t);var i=t.length;this.charLength&&(t.copy(this.charBuffer,0,t.length-this.charReceived,i),i-=this.charReceived),e+=t.toString(this.encoding,0,i);var i=e.length-1,n=e.charCodeAt(i);if(n>=55296&&n<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),t.copy(this.charBuffer,0,0,o),e.substring(0,i)}return e},c.prototype.detectIncompleteChar=function(t){for(var e=t.length>=3?3:t.length;e>0;e--){var r=t[t.length-e];if(1==e&&r>>5==6){this.charLength=2;break}if(e<=2&&r>>4==14){this.charLength=3;break}if(e<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=e},c.prototype.end=function(t){var e="";if(t&&t.length&&(e=this.write(t)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;e+=n.slice(0,r).toString(i)}return e}},function(t,e,r){function n(t,e){this.afterTransform=function(t,r){return i(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(t,e,r){var n=t._transformState;n.transforming=!1;var i=n.writecb;if(!i)return t.emit("error",new Error("no writecb in Transform class"));n.writechunk=null,n.writecb=null,u.isNullOrUndefined(r)||t.push(r),i&&i(e);var o=t._readableState;o.reading=!1,(o.needReadable||o.length=0&&"[object Function]"===h(t.callee)),r},T=Function.call.bind(Function.apply),C={Call:function(t,e){var r=arguments.length>2?arguments[2]:[];if(!C.IsCallable(t))throw new TypeError(t+" is not a function");return T(t,e,r)},RequireObjectCoercible:function(t,e){if(null==t)throw new TypeError(e||"Cannot call method on "+t)},TypeIsObject:function(t){return null!=t&&Object(t)===t},ToObject:function(t,e){return C.RequireObjectCoercible(t,e),Object(t)},IsCallable:function(t){return"function"==typeof t&&"[object Function]"===h(t)},ToInt32:function(t){return C.ToNumber(t)>>0},ToUint32:function(t){return C.ToNumber(t)>>>0},ToNumber:function(t){if("[object Symbol]"===h(t))throw new TypeError("Cannot convert a Symbol value to a number");return+t},ToInteger:function(t){var e=C.ToNumber(t);return Number.isNaN(e)?0:0!==e&&Number.isFinite(e)?(e>0?1:-1)*Math.floor(Math.abs(e)):e},ToLength:function(t){var e=C.ToInteger(t);return e<=0?0:e>Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e},SameValue:function(t,e){return t===e?0!==t||1/t===1/e:Number.isNaN(t)&&Number.isNaN(e)},SameValueZero:function(t,e){return t===e||Number.isNaN(t)&&Number.isNaN(e)},IsIterable:function(t){return C.TypeIsObject(t)&&("undefined"!=typeof t[O]||S(t))},GetIterator:function(t){if(S(t))return new e(t,"value");var r=t[O];if(!C.IsCallable(r))throw new TypeError("value is not an iterable");var n=r.call(t);if(!C.TypeIsObject(n))throw new TypeError("bad iterator");return n},IteratorNext:function(t){var e=arguments.length>1?t.next(arguments[1]):t.next();if(!C.TypeIsObject(e))throw new TypeError("bad iterator");return e},Construct:function(t,e){var r;r=C.IsCallable(t[g])?t[g]():E(t.prototype||null),w(r,{_es6construct:!0});var n=C.Call(t,r,e);return C.TypeIsObject(n)?n:r},CreateHTML:function(t,e,r,n){var i=String(t),o="<"+e;if(""!==r){var a=String(n),s=a.replace(/"/g,""");o+=" "+r+'="'+s+'"'}var u=o+">",c=u+i;return c+""+e+">"}},x=function(t){if(!C.TypeIsObject(t))throw new TypeError("bad object");return t._es6construct||(t.constructor&&C.IsCallable(t.constructor[g])&&(t=t.constructor[g](t)),w(t,{_es6construct:!0})),t},P=function(){function t(t){var e=Math.floor(t),r=t-e;return r<.5?e:r>.5?e+1:e%2?e+1:e}function e(e,r,n){var i,o,a,s,u,c,l,f=(1<=Math.pow(2,1-f)?(o=Math.min(Math.floor(Math.log(e)/Math.LN2),1023),a=t(e/Math.pow(2,o)*Math.pow(2,n)),a/Math.pow(2,n)>=2&&(o+=1,a=1),o>f?(o=(1<>=1;return f.reverse(),a=f.join(""),s=(1<0?u*Math.pow(2,c-s)*(1+l/Math.pow(2,r)):0!==l?u*Math.pow(2,-(s-1))*(l/Math.pow(2,r)):u<0?-0:0}function n(t){return r(t,8,23)}function i(t){return e(t,8,23)}var o={toFloat32:function(t){return n(i(t))}};if("undefined"!=typeof Float32Array){var a=new Float32Array(1);o.toFloat32=function(t){return a[0]=t,a[0]}}return o}();if(w(String,{fromCodePoint:function(t){for(var e,r=[],n=0,i=arguments.length;n1114111)throw new RangeError("Invalid code point "+e);e<65536?r.push(String.fromCharCode(e)):(e-=65536,r.push(String.fromCharCode((e>>10)+55296)),r.push(String.fromCharCode(e%1024+56320)))}return r.join("")},raw:function(t){var e=C.ToObject(t,"bad callSite"),r=e.raw,n=C.ToObject(r,"bad raw value"),i=n.length,o=C.ToLength(i);if(o<=0)return"";for(var a,s,u,c,l=[],f=0;f=o));)s=f+1=k)throw new RangeError("repeat count must be less than infinity and not overflow maximum string size");return A(e,t)},startsWith:function(t){C.RequireObjectCoercible(this);var e=String(this);if(b.regex(t))throw new TypeError('Cannot call method "startsWith" with a regex');t=String(t);var r=arguments.length>1?arguments[1]:void 0,n=Math.max(C.ToInteger(r),0);return e.slice(n,n+t.length)===t},endsWith:function(t){C.RequireObjectCoercible(this);var e=String(this);if(b.regex(t))throw new TypeError('Cannot call method "endsWith" with a regex');t=String(t);var r=e.length,n=arguments.length>1?arguments[1]:void 0,i="undefined"==typeof n?r:C.ToInteger(n),o=Math.min(Math.max(i,0),r);return e.slice(o-t.length,o)===t},includes:function(t){var e=arguments.length>1?arguments[1]:void 0;return p(this,t,e)!==-1},codePointAt:function(t){C.RequireObjectCoercible(this);var e=String(this),r=C.ToInteger(t),n=e.length;if(r>=0&&r56319||o)return i;var a=e.charCodeAt(r+1);return a<56320||a>57343?i:1024*(i-55296)+(a-56320)+65536}}};w(String.prototype,I);var M=1!=="
".trim().length;if(M){delete String.prototype.trim;var N=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),F=new RegExp("(^["+N+"]+)|(["+N+"]+$)","g");w(String.prototype,{trim:function(){if("undefined"==typeof this||null===this)throw new TypeError("can't convert "+this+" to object");return String(this).replace(F,"")}})}var B=function(t){C.RequireObjectCoercible(t),this._s=String(t),this._i=0};B.prototype.next=function(){var t=this._s,e=this._i;if("undefined"==typeof t||e>=t.length)return this._s=void 0,{value:void 0,done:!0};var r,n,i=t.charCodeAt(e);return i<55296||i>56319||e+1===t.length?n=1:(r=t.charCodeAt(e+1),n=r<56320||r>57343?1:2),this._i=e+n,{value:t.substr(e,n),done:!1}},j(B.prototype),j(String.prototype,function(){return new B(this)}),f||(m(String.prototype,"startsWith",I.startsWith,!0),m(String.prototype,"endsWith",I.endsWith,!0));var L={from:function(t){var e=arguments.length>1?arguments[1]:void 0,r=C.ToObject(t,"bad iterable");if("undefined"!=typeof e&&!C.IsCallable(e))throw new TypeError("Array.from: when provided, the second argument must be a function");var n,i,o,a,s=arguments.length>2,u=s?arguments[2]:void 0,c=C.IsIterable(r);if(c){o=0,i=C.IsCallable(this)?Object(new this):[];var l,f=c?C.GetIterator(r):null;do l=C.IteratorNext(f),l.done||(a=l.value,e?i[o]=s?e.call(u,a,o):e(a,o):i[o]=a,o+=1);while(!l.done);n=o}else for(n=C.ToLength(r.length),i=C.IsCallable(this)?Object(new this(n)):new Array(n),o=0;o0;)if(e=r.shift(),e in this.object)return U("key"===this.kind?e:"value"===this.kind?this.object[e]:[e,this.object[e]]);return U()}}),j(W.prototype);var z={copyWithin:function(t,e){var r=arguments[2],n=C.ToObject(this),i=C.ToLength(n.length);t=C.ToInteger(t),e=C.ToInteger(e);var o=t<0?Math.max(i+t,0):Math.min(t,i),a=e<0?Math.max(i+e,0):Math.min(e,i);r="undefined"==typeof r?i:C.ToInteger(r);var s=r<0?Math.max(i+r,0):Math.min(r,i),u=Math.min(s-a,i-o),c=1;for(a0;)d(n,a)?n[o]=n[a]:delete n[a],a+=c,o+=c,u-=1;return n},fill:function(t){var e=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=C.ToObject(this),i=C.ToLength(n.length);e=C.ToInteger("undefined"==typeof e?0:e),r=C.ToInteger("undefined"==typeof r?i:r);for(var o=e<0?Math.max(i+e,0):Math.min(e,i),a=r<0?i+r:r,s=o;s1?arguments[1]:null,o=0;o1?arguments[1]:null,i=0;i1?NaN:t===-1?-(1/0):1===t?1/0:0===t?t:.5*Math.log((1+t)/(1-t))},cbrt:function(t){if(t=Number(t),0===t)return t;var e,r=t<0;return r&&(t=-t),e=Math.pow(t,1/3),r?-e:e},clz32:function(t){t=Number(t);var e=C.ToUint32(t);return 0===e?32:32-e.toString(2).length},cosh:function(t){return t=Number(t),0===t?1:Number.isNaN(t)?NaN:c(t)?(t<0&&(t=-t),t>21?Math.exp(t)/2:(Math.exp(t)+Math.exp(-t))/2):1/0},expm1:function(t){var e=Number(t);if(e===-(1/0))return-1;if(!c(e)||0===t)return e;if(Math.abs(e)>.5)return Math.exp(e)-1;for(var r=e,n=0,i=1;n+r!==n;)n+=r,i+=1,r*=e/i;return n},hypot:function(t,e){var r=!1,n=!0,i=!1,o=[];if(Array.prototype.every.call(arguments,function(t){var e=Number(t);return Number.isNaN(e)?r=!0:e===1/0||e===-(1/0)?i=!0:0!==e&&(n=!1),!i&&(r||o.push(Math.abs(e)),!0)}),i)return 1/0;if(r)return NaN;if(n)return 0;o.sort(function(t,e){return e-t});var a=o[0],s=o.map(function(t){return t/a}),u=s.reduce(function(t,e){return t+e*e},0);return a*Math.sqrt(u)},log2:function(t){return Math.log(t)*Math.LOG2E},log10:function(t){return Math.log(t)*Math.LOG10E},log1p:function(t){var e=Number(t);return e<-1||Number.isNaN(e)?NaN:0===e||e===1/0?e:e===-1?-(1/0):1+e-1===0?e:e*(Math.log(1+e)/(1+e-1))},sign:function(t){var e=+t;return 0===e?e:Number.isNaN(e)?e:e<0?-1:1},sinh:function(t){var e=Number(t);return c(t)&&0!==t?Math.abs(e)<1?(Math.expm1(e)-Math.expm1(-e))/2:(Math.exp(e-1)-Math.exp(-e-1))*Math.E/2:t},tanh:function(t){var e=Number(t);if(Number.isNaN(t)||0===e)return e;if(e===1/0)return 1;if(e===-(1/0))return-1;var r=Math.expm1(e),n=Math.expm1(-e);return r===1/0?1:n===1/0?-1:(r-n)/(Math.exp(e)+Math.exp(-e))},trunc:function(t){var e=Number(t);return e<0?-Math.floor(-e):Math.floor(e)},imul:function(t,e){t=C.ToUint32(t),e=C.ToUint32(e);var r=t>>>16&65535,n=65535&t,i=e>>>16&65535,o=65535&e;return n*o+(r*o+n*i<<16>>>0)|0},fround:function(t){if(0===t||t===1/0||t===-(1/0)||Number.isNaN(t))return t;var e=Number(t);return P.toFloat32(e)}};w(Math,Z),m(Math,"tanh",Z.tanh,Math.tanh(-2e-17)!==-2e-17),m(Math,"acosh",Z.acosh,Math.acosh(Number.MAX_VALUE)===1/0),m(Math,"sinh",Z.sinh,Math.sinh(-2e-17)!==-2e-17);var K=Math.expm1(10);m(Math,"expm1",Z.expm1,K>22025.465794806718||K<22025.465794806718);var tt=0===Math.round(.5-Number.EPSILON/4)&&1===Math.round(-.5+Number.EPSILON/3.99),et=Math.round;m(Math,"round",function(t){return-.5<=t&&t<.5&&0!==t?Math.sign(0*t):et(t)},!tt),Math.imul(4294967295,5)!==-5&&(Math.imul=Z.imul);var rt=function(){var t,e;C.IsPromise=function(t){return!!C.TypeIsObject(t)&&(!!t._promiseConstructor&&"undefined"!=typeof t._status)};var r,n=function(t){if(!C.IsCallable(t))throw new TypeError("bad promise constructor");var e=this,r=function(t,r){e.resolve=t,e.reject=r};if(e.promise=C.Construct(t,[r]),!e.promise._es6construct)throw new TypeError("bad promise constructor");if(!C.IsCallable(e.resolve)||!C.IsCallable(e.reject))throw new TypeError("bad promise constructor")},i=u.setTimeout;"undefined"!=typeof window&&C.IsCallable(window.postMessage)&&(r=function(){var t=[],e="zero-timeout-message",r=function(r){t.push(r),window.postMessage(e,"*")},n=function(r){if(r.source===window&&r.data===e){if(r.stopPropagation(),0===t.length)return;var n=t.shift();n()}};return window.addEventListener("message",n,!0),r});var a=function(){var t=u.Promise;return t&&t.resolve&&function(e){return t.resolve().then(e)}},s=C.IsCallable(u.setImmediate)?u.setImmediate.bind(u):"object"==typeof o&&o.nextTick?o.nextTick:a()||(C.IsCallable(r)?r():function(t){i(t,0)}),c=function(t,e){if(!C.TypeIsObject(t))return!1;var r=e.resolve,n=e.reject;try{var i=t.then;if(!C.IsCallable(i))return!1;i.call(t,r,n)}catch(t){n(t)}return!0},l=function(t,e){t.forEach(function(t){s(function(){var r=t.handler,n=t.capability,i=n.resolve,o=n.reject;try{var a=r(e);if(a===n.promise)throw new TypeError("self resolution");var s=c(a,n);s||i(a)}catch(t){o(t)}})})},f=function(t,e,r){return function(i){if(i===t)return r(new TypeError("self resolution"));var o=t._promiseConstructor,a=new n(o),s=c(i,a);return s?a.promise.then(e,r):e(i)}};t=function(t){var e=this;if(e=x(e),!e._promiseConstructor)throw new TypeError("bad promise");if("undefined"!=typeof e._status)throw new TypeError("promise already initialized");if(!C.IsCallable(t))throw new TypeError("not a valid resolver");e._status="unresolved",e._resolveReactions=[],e._rejectReactions=[];var r=function(t){if("unresolved"===e._status){var r=e._resolveReactions;e._result=t,e._resolveReactions=void 0,e._rejectReactions=void 0,e._status="has-resolution",l(r,t)}},n=function(t){if("unresolved"===e._status){var r=e._rejectReactions;e._result=t,e._resolveReactions=void 0,e._rejectReactions=void 0,e._status="has-rejection",l(r,t)}};try{t(r,n)}catch(t){n(t)}return e},e=t.prototype;var p=function(t,e,r,n){var i=!1;return function(o){if(!i&&(i=!0,e[t]=o,0===--n.count)){var a=r.resolve;a(e)}}};return m(t,g,function(t){var r=this,n=r.prototype||e;return t=t||E(n),w(t,{_status:void 0,_result:void 0,_resolveReactions:void 0,_rejectReactions:void 0,_promiseConstructor:void 0}),t._promiseConstructor=r,t}),w(t,{all:function(t){var e=this,r=new n(e),i=r.resolve,o=r.reject;try{if(!C.IsIterable(t))throw new TypeError("bad iterable");for(var a=C.GetIterator(t),s=[],u={count:1},c=0;;c++){var l=C.IteratorNext(a);if(l.done)break;var f=e.resolve(l.value),h=p(c,s,r,u);u.count++,f.then(h,r.reject)}0===--u.count&&i(s)}catch(t){o(t)}return r.promise},race:function(t){var e=this,r=new n(e),i=r.resolve,o=r.reject;try{if(!C.IsIterable(t))throw new TypeError("bad iterable");for(var a=C.GetIterator(t);;){var s=C.IteratorNext(a);if(s.done)break;var u=e.resolve(s.value);u.then(i,o)}}catch(t){o(t)}return r.promise},reject:function(t){var e=this,r=new n(e),i=r.reject;return i(t),r.promise},resolve:function(t){var e=this;if(C.IsPromise(t)){var r=t._promiseConstructor;if(r===e)return t}var i=new n(e),o=i.resolve;return o(t),i.promise}}),w(e,{catch:function(t){return this.then(void 0,t)},then:function(t,e){var r=this;if(!C.IsPromise(r))throw new TypeError("not a promise");var i=this.constructor,o=new n(i);C.IsCallable(e)||(e=function(t){throw t}),C.IsCallable(t)||(t=function(t){return t});var a=f(r,t,e),s={capability:o,handler:a},u={capability:o,handler:e};switch(r._status){case"unresolved":r._resolveReactions.push(s),r._rejectReactions.push(u);break;case"has-resolution":l([s],r._result);break;case"has-rejection":l([u],r._result);break;default:throw new TypeError("unexpected")}return o.promise}}),t}();u.Promise&&(delete u.Promise.accept,delete u.Promise.defer,delete u.Promise.prototype.chain),w(u,{Promise:rt});var nt=n(u.Promise,function(t){return t.resolve(42)instanceof t}),it=function(){try{return u.Promise.reject(42).then(null,5).then(null,y),!0}catch(t){return!1}}(),ot=function(){try{Promise.call(3,y)}catch(t){return!0}return!1}();nt&&it&&ot||(Promise=rt,m(u,"Promise",rt,!0));var at=function(t){var e=Object.keys(t.reduce(function(t,e){return t[e]=!0,t},{}));return t.join(":")===e.join(":")},st=at(["z","a","bb"]),ut=at(["z",1,"a","3",2]);if(l){var ct=function(t){if(!st)return null;var e=typeof t;return"string"===e?"$"+t:"number"===e?ut?t:"n"+t:null},lt=function(){return Object.create?Object.create(null):{}},ft={Map:function(){function t(t,e){this.key=t,this.value=e,this.next=null,this.prev=null}function e(t,e){this.head=t._head,this.i=this.head,this.kind=e}function r(e){var r=this;if(!C.TypeIsObject(r))throw new TypeError("Map does not accept arguments when called as a function");if(r=x(r),!r._es6map)throw new TypeError("bad map");var n=new t(null,null);if(n.next=n.prev=n,w(r,{_head:n,_storage:lt(),_size:0}),"undefined"!=typeof e&&null!==e){var i=C.GetIterator(e),o=r.set;if(!C.IsCallable(o))throw new TypeError("bad map");for(;;){var a=C.IteratorNext(i);if(a.done)break;var s=a.value;if(!C.TypeIsObject(s))throw new TypeError("expected iterable of pairs");o.call(r,s[0],s[1])}}return r}var n={};t.prototype.isRemoved=function(){return this.key===n},e.prototype={next:function(){var t,e=this.i,r=this.kind,n=this.head;if("undefined"==typeof this.i)return{value:void 0,done:!0};for(;e.isRemoved()&&e!==n;)e=e.prev;for(;e.next!==n;)if(e=e.next,!e.isRemoved())return t="key"===r?e.key:"value"===r?e.value:[e.key,e.value],this.i=e,{value:t,done:!1};return this.i=void 0,{value:void 0,done:!0}}},j(e.prototype);var i=r.prototype;return m(r,g,function(t){var e=this,r=e.prototype||i;return t=t||E(r),w(t,{_es6map:!0}),t}),_.getter(r.prototype,"size",function(){if("undefined"==typeof this._size)throw new TypeError("size method called on incompatible Map");return this._size}),w(r.prototype,{get:function(t){var e=ct(t);if(null!==e){var r=this._storage[e];return r?r.value:void 0}for(var n=this._head,i=n;(i=i.next)!==n;)if(C.SameValueZero(i.key,t))return i.value},has:function(t){var e=ct(t);if(null!==e)return"undefined"!=typeof this._storage[e];for(var r=this._head,n=r;(n=n.next)!==r;)if(C.SameValueZero(n.key,t))return!0;return!1},set:function(e,r){var n,i=this._head,o=i,a=ct(e);if(null!==a){if("undefined"!=typeof this._storage[a])return this._storage[a].value=r,this;n=this._storage[a]=new t(e,r),o=i.prev}for(;(o=o.next)!==i;)if(C.SameValueZero(o.key,e))return o.value=r,this;return n=n||new t(e,r),C.SameValue(-0,e)&&(n.key=0),n.next=this._head,n.prev=this._head.prev,n.prev.next=n,n.next.prev=n,this._size+=1,this},delete:function(t){var e=this._head,r=e,i=ct(t);if(null!==i){if("undefined"==typeof this._storage[i])return!1;r=this._storage[i].prev,delete this._storage[i]}for(;(r=r.next)!==e;)if(C.SameValueZero(r.key,t))return r.key=r.value=n,r.prev.next=r.next,r.next.prev=r.prev,this._size-=1,!0;return!1},clear:function(){this._size=0,this._storage=lt();for(var t=this._head,e=t,r=e.next;(e=r)!==t;)e.key=e.value=n,r=e.next,e.next=e.prev=t;t.next=t.prev=t},keys:function(){return new e(this,"key")},values:function(){return new e(this,"value")},entries:function(){return new e(this,"key+value")},forEach:function(t){for(var e=arguments.length>1?arguments[1]:null,r=this.entries(),n=r.next();!n.done;n=r.next())e?t.call(e,n.value[1],n.value[0],this):t(n.value[1],n.value[0],this)}}),j(r.prototype,function(){return this.entries()}),r}(),Set:function(){var t=function(t){var e=this;if(!C.TypeIsObject(e))throw new TypeError("Set does not accept arguments when called as a function");if(e=x(e),!e._es6set)throw new TypeError("bad set");if(w(e,{"[[SetData]]":null,_storage:lt()}),"undefined"!=typeof t&&null!==t){var r=C.GetIterator(t),n=e.add;if(!C.IsCallable(n))throw new TypeError("bad set");for(;;){var i=C.IteratorNext(r);if(i.done)break;var o=i.value;n.call(e,o)}}return e},e=t.prototype;m(t,g,function(t){var r=this,n=r.prototype||e;return t=t||E(n),w(t,{_es6set:!0}),t});var r=function(t){if(!t["[[SetData]]"]){var e=t["[[SetData]]"]=new ft.Map;Object.keys(t._storage).forEach(function(t){t=36===t.charCodeAt(0)?t.slice(1):"n"===t.charAt(0)?+t.slice(1):+t,e.set(t,t)}),t._storage=null}};return _.getter(t.prototype,"size",function(){if("undefined"==typeof this._storage)throw new TypeError("size method called on incompatible Set");return r(this),this["[[SetData]]"].size}),w(t.prototype,{has:function(t){var e;return this._storage&&null!==(e=ct(t))?!!this._storage[e]:(r(this),this["[[SetData]]"].has(t))},add:function(t){var e;return this._storage&&null!==(e=ct(t))?(this._storage[e]=!0,this):(r(this),this["[[SetData]]"].set(t,t),this)},delete:function(t){var e;if(this._storage&&null!==(e=ct(t))){var n=d(this._storage,e);return delete this._storage[e]&&n}return r(this),this["[[SetData]]"].delete(t)},clear:function(){this._storage?this._storage=lt():this["[[SetData]]"].clear()},values:function(){return r(this),this["[[SetData]]"].values()},entries:function(){return r(this),this["[[SetData]]"].entries()},forEach:function(t){var e=arguments.length>1?arguments[1]:null,n=this;r(n),this["[[SetData]]"].forEach(function(r,i){e?t.call(e,i,i,n):t(i,i,n)})}}),m(t,"keys",t.values,!0),j(t.prototype,function(){return this.values()}),t}()};w(u,ft),(u.Map||u.Set)&&("function"!=typeof u.Map.prototype.clear||0!==(new u.Set).size||0!==(new u.Map).size||"function"!=typeof u.Map.prototype.keys||"function"!=typeof u.Set.prototype.keys||"function"!=typeof u.Map.prototype.forEach||"function"!=typeof u.Set.prototype.forEach||r(u.Map)||r(u.Set)||!n(u.Map,function(t){var e=new t([]);return e.set(42,42),e instanceof t}))&&(u.Map=ft.Map,u.Set=ft.Set),u.Set.prototype.keys!==u.Set.prototype.values&&m(u.Set.prototype,"keys",u.Set.prototype.values,!0),j(Object.getPrototypeOf((new u.Map).keys())),j(Object.getPrototypeOf((new u.Set).keys()))}u.Reflect||m(u,"Reflect",{});var pt=u.Reflect,ht=function(t){if(!C.TypeIsObject(t))throw new TypeError("target must be an object")};if(w(u.Reflect,{apply:function(){return C.Call.apply(null,arguments)},construct:function(t,e){if(!C.IsCallable(t))throw new TypeError("First argument must be callable.");return C.Construct(t,e)},deleteProperty:function(t,e){if(ht(t),l){var r=Object.getOwnPropertyDescriptor(t,e);if(r&&!r.configurable)return!1}return delete t[e]},enumerate:function(t){return ht(t),new W(t,"key")},has:function(t,e){return ht(t),e in t}}),Object.getOwnPropertyNames&&w(u.Reflect,{ownKeys:function(t){ht(t);var e=Object.getOwnPropertyNames(t);return C.IsCallable(Object.getOwnPropertySymbols)&&e.push.apply(e,Object.getOwnPropertySymbols(t)),e}}),Object.preventExtensions&&w(u.Reflect,{isExtensible:function(t){return ht(t),Object.isExtensible(t)},preventExtensions:function(t){return ht(t),vt(function(){Object.preventExtensions(t)})}}),l){var dt=function(t,e,r){var n=Object.getOwnPropertyDescriptor(t,e);if(!n){var i=Object.getPrototypeOf(t);if(null===i)return;return dt(i,e,r)}return"value"in n?n.value:n.get?n.get.call(r):void 0},yt=function(t,e,r,n){var i=Object.getOwnPropertyDescriptor(t,e);if(!i){var o=Object.getPrototypeOf(t);if(null!==o)return yt(o,e,r,n);i={value:void 0,writable:!0,enumerable:!0,configurable:!0}}if("value"in i){if(!i.writable)return!1;if(!C.TypeIsObject(n))return!1;var a=Object.getOwnPropertyDescriptor(n,e);return a?pt.defineProperty(n,e,{value:r}):pt.defineProperty(n,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}return!!i.set&&(i.set.call(n,r),!0)},vt=function(t){try{t()}catch(t){return!1}return!0};w(u.Reflect,{defineProperty:function(t,e,r){return ht(t),vt(function(){Object.defineProperty(t,e,r)})},getOwnPropertyDescriptor:function(t,e){return ht(t),Object.getOwnPropertyDescriptor(t,e)},get:function(t,e){ht(t);var r=arguments.length>2?arguments[2]:t;return dt(t,e,r)},set:function(t,e,r){ht(t);var n=arguments.length>3?arguments[3]:t;return yt(t,e,r,n)}})}if(Object.getPrototypeOf){var gt=Object.getPrototypeOf;w(u.Reflect,{getPrototypeOf:function(t){return ht(t),gt(t)}})}if(Object.setPrototypeOf){var bt=function(t,e){for(;e;){if(t===e)return!0;e=pt.getPrototypeOf(e)}return!1};w(u.Reflect,{setPrototypeOf:function(t,e){if(ht(t),null!==e&&!C.TypeIsObject(e))throw new TypeError("proto must be an object or null");return e===pt.getPrototypeOf(t)||!(pt.isExtensible&&!pt.isExtensible(t))&&(!bt(t,e)&&(Object.setPrototypeOf(t,e),!0))}})}if("Invalid Date"!==String(new Date(NaN))){var mt=Date.prototype.toString,_t=function(){var t=+this;return t!==t?"Invalid Date":mt.call(this)};m(_t,"toString",mt.toString,!0),m(Date.prototype,"toString",_t,!0)}var wt={anchor:function(t){return C.CreateHTML(this,"a","name",t);
+},big:function(){return C.CreateHTML(this,"big","","")},blink:function(){return C.CreateHTML(this,"blink","","")},bold:function(){return C.CreateHTML(this,"b","","")},fixed:function(){return C.CreateHTML(this,"tt","","")},fontcolor:function(t){return C.CreateHTML(this,"font","color",t)},fontsize:function(t){return C.CreateHTML(this,"font","size",t)},italics:function(){return C.CreateHTML(this,"i","","")},link:function(t){return C.CreateHTML(this,"a","href",t)},small:function(){return C.CreateHTML(this,"small","","")},strike:function(){return C.CreateHTML(this,"strike","","")},sub:function(){return C.CreateHTML(this,"sub","","")},sup:function(){return C.CreateHTML(this,"sup","","")}};return w(String.prototype,wt),Object.keys(wt).forEach(function(t){var e=String.prototype[t],r=!1;if(C.IsCallable(e)){var n=e.call("",' " '),i=[].concat(n.match(/"/g)).length;r=n!==n.toLowerCase()||i>2}else r=!0;r&&m(String.prototype,t,wt[t],!0)}),u})}).call(e,r(3))},function(t,e,r){var n={};!function(e){t.exports=n}(e),function(){var t=!1,e=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/;this.Class=function(){},Class.extend=function(r){function n(){!t&&this.init&&this.init.apply(this,arguments)}var i=this.prototype;t=!0;var o=new this;t=!1;for(var a in r)o[a]="function"==typeof r[a]&&"function"==typeof i[a]&&e.test(r[a])?function(t,e){return function(){var r=this._super;this._super=i[t];var n=e.apply(this,arguments);return this._super=r,n}}(a,r[a]):r[a];return n.prototype=o,n.prototype.constructor=n,n.extend=arguments.callee,n}}(),n.Decoder=Class.extend({init:function(t){function e(t){for(var e=Math.max.apply(null,t),r=0;r8)throw"byteBuffer too small";for(var r=0;r>>=1,t&&(T.byteBuffer|=128),8==T.bitCounter&&(T.wordBuffer.push(T.byteBuffer),T.byteBuffer=0)}function a(t){var e="";t.length&&(t.forEach(function(t){e+=String.fromCharCode(t)}),t.length=0),j(e)}var s,u,c,l,f,p,h,d,y,v,g,b,m,_,w=this,E=t.debug,O="",j=t.onReceive,S=t.sampleRate,T={current:0,PREAMBLE:1,START:2,DATA:3,STOP:4,bitCounter:0,byteBuffer:0,wordBuffer:[],lastTransition:0,lastBitState:0,t:0,c:0};w.setProfile=function(t){u=t.baud,c=t.freqLow,l=t.freqHigh,f=Math.ceil(S/u),p=Math.ceil(40*S/1e3/f),h=new Float32Array(f/2),d=new Float32Array(f/2),y=new Float32Array(f/2),v=new Float32Array(f/2),g=new Float32Array(f/2),b=new Float32Array(f/2),m=new Float32Array(f/2),_=new Float32Array(f/2),function(){for(var t=2*Math.PI*(c/S),e=2*Math.PI*(l/S),r=0;r=12&&a<=p+20&&(r=T.START,T.lastBitState=0,T.byteBuffer=0,T.wordBuffer=[]);break;case T.START:E&&console.log("START"),T.bitCounter=0,1==a?r=T.DATA:a>1&&a<=9?(r=9==a?T.STOP:T.DATA,o(0,a-1)):r=T.PREAMBLE;break;case T.DATA:E&&console.log("DATA");var s=a+T.bitCounter,u=1^T.lastBitState;s>11?r=T.PREAMBLE:11==s?(o(1,a-3),r=T.START,E&&console.log(">emit< "+T.wordBuffer[0].toString(2)),C(T.wordBuffer),T.wordBuffer=[]):10==s?(o(1,a-2),r=T.PREAMBLE,E&&console.log("|emit| "+T.wordBuffer[0].toString(2)),C(T.wordBuffer)):9==s?(o(1,a-1),r=T.START):8==s?(o(u,a),r=T.STOP,T.lastBitState=u):(o(u,a),r=T.DATA,T.lastBitState=u),0==a&&(r=T.PREAMBLE,E&&console.log("#demod error#"));break;case T.STOP:E&&console.log(" STOP"),1==a?r=T.START:3==a?(r=T.START,E&&console.log(">>emit<< "+T.wordBuffer[0].toString(2)),C(T.wordBuffer),T.wordBuffer=[]):a>=2?(r=T.PREAMBLE,E&&console.log("||emit|| "+T.wordBuffer[0].toString(2)),C(T.wordBuffer)):r=T.PREAMBLE;break;default:r=T.PREAMBLE,T.bitCounter=0,T.byteBuffer=0}T.current=r}}}}),n.Encoder=Class.extend({init:function(t){function e(t){for(var e=[],r=0;r>>6),e.push(128|63&n);else if(n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{for(var i=4;n>>>6*i;)i++;for(e.push(65280>>>i&255|n>>>6*--i);i--;)e[idx++]=128|n>>>6*i&63}}return e}var r,i,o,a,s,u,c,l,f,p,h=this,d=44100,y=t.sampleRate;h.setProfile=function(t){r=t.baud,i=t.freqLow,o=t.freqHigh,a=Math.ceil(d/r),s=Math.ceil(40*d/1e3/a),u=t.softmodem?1:2,c=new Float32Array(a),l=new Float32Array(a),f="undefined"!=typeof t.raw&&t.raw,p=t.softmodem,function(){for(var t=2*Math.PI*i/d,e=2*Math.PI*o/d,r=0;r>=1)i(1&m,1);i(1,1),p||i(0,1),t.debug&&console.log("gen. audio length: "+v.length);var w=new n.Resampler({inRate:d,outRate:y,inputBuffer:v});w.resample(v.length);var E=w.outputBuffer();return t.debug&&console.log("resampled audio length: "+E.length),E}}}),n.Profiles={SoftModem:{baud:1225,freqLow:4900,freqHigh:7350,echoCancellation:!1,softmodem:!0},SoftModemLowFrequencies:{baud:1225,freqLow:2450,freqHigh:4900,echoCancellation:!0,softmodem:!0},Browser:{baud:1225,freqLow:19600,freqHigh:20825,echoCancellation:!1,softmodem:!1}},n.Resampler=Class.extend({init:function(t){function e(t){var e=0;if(t>0){var r=s,n=0,i=0,c=0,e=0;for(r-=1,t-=1,c=Math.floor(r);c0){var e=0,r=0,n=0,i=0,l=!c;c=!1;var f=0;do{for(l?(e=a,r=0):(e=s,r=u[0],l=!0);e>0&&n=i)){r+=d[n]*e,f+=e,e=0;break}r+=d[n++]*i,f=n,e-=i}if(!(e<=0)){s=e,u[0]=r,c=!0;break}o[t++]=r/a}while(n0&&h>0))throw new Error("Invalid settings specified for the resampler.");p==h?(l=n,a=1,o=d):(i(),a=p/h,p=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"label"in b&&b.disabled===a||"form"in b&&b.disabled===a||"form"in b&&b.disabled===!1&&(b.isDisabled===a||b.isDisabled!==!a&&("label"in b||!ea(b))!==a)}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}},d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(_,aa),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=V.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(_,aa),$.test(j[0].type)&&qa(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&sa(j),!a)return G.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,!b||$.test(a)&&qa(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext,B=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,C=/^.[^:#\[\.,]*$/;function D(a,b,c){if(r.isFunction(b))return r.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return r.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(C.test(b))return r.filter(b,a,c);b=r.filter(b,a)}return r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType})}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(D(this,a||[],!1))},not:function(a){return this.pushStack(D(this,a||[],!0))},is:function(a){return!!D(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var E,F=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,G=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||E,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:F.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),B.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};G.prototype=r.fn,E=r(d);var H=/^(?:parents|prev(?:Until|All))/,I={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function J(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return J(a,"nextSibling")},prev:function(a){return J(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return a.contentDocument||r.merge([],a.childNodes)}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(I[a]||r.uniqueSort(e),H.test(a)&&e.reverse()),this.pushStack(e)}});var K=/\S+/g;function L(a){var b={};return r.each(a.match(K)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?L(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function M(a){return a}function N(a){throw a}function O(a,b,c){var d;try{a&&r.isFunction(d=a.promise)?d.call(a).done(b).fail(c):a&&r.isFunction(d=a.then)?d.call(a,b,c):b.call(void 0,a)}catch(a){c.call(void 0,a)}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==N&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:M,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:M)),c[2][3].add(g(0,a,r.isFunction(d)?d:N))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(O(a,g.done(h(c)).resolve,g.reject),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)O(e[c],h(c),g.reject);return g.promise()}});var P=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&P.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var Q=r.Deferred();r.fn.ready=function(a){return Q.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,holdReady:function(a){a?r.readyWait++:r.ready(!0)},ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||Q.resolveWith(d,[r]))}}),r.ready.then=Q.then;function R(){d.removeEventListener("DOMContentLoaded",R),a.removeEventListener("load",R),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",R),a.addEventListener("load",R));var S=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)S(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,
-r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){W.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=V.get(a,b),c&&(!d||r.isArray(c)?d=V.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return V.get(a,c)||V.access(a,c,{empty:r.Callbacks("once memory").add(function(){V.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length