0;){if(s=(i=t.readVarint32())>>3,(o=7&i)===e.WIRE_TYPES.ENDGROUP){if(s!==n)throw Error("Illegal group end indicator for "+this.toString(!0)+": "+s+" ("+(n?n+" expected":"not a group")+")");break}if(a=this._fieldsById[s])a.repeated&&!a.options.packed?c[a.name].push(a.decode(o,t)):(c[a.name]=a.decode(o,t),a.oneof&&(null!==this[a.oneof.name]&&(this[this[a.oneof.name]]=null),c[a.oneof.name]=a.name));else switch(o){case e.WIRE_TYPES.VARINT:t.readVarint32();break;case e.WIRE_TYPES.BITS32:t.offset+=4;break;case e.WIRE_TYPES.BITS64:t.offset+=8;break;case e.WIRE_TYPES.LDELIM:var h=t.readVarint32();t.offset+=h;break;case e.WIRE_TYPES.STARTGROUP:for(;u(s,t););break;default:throw Error("Illegal wire type for unknown field "+s+" in "+this.toString(!0)+"#decode: "+o)}}for(var l=0,p=this._fields.length;l4294967295?0|t:t;case e.TYPES.uint32:case e.TYPES.fixed32:return("number"!=typeof t||t==t&&t%1!=0)&&i(typeof t,"not an integer"),t<0?t>>>0:t;case e.TYPES.int64:case e.TYPES.sint64:case e.TYPES.sfixed64:if(e.Long)try{return l(t,!1)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.uint64:case e.TYPES.fixed64:if(e.Long)try{return l(t,!0)}catch(e){i(typeof t,e.message)}else i(typeof t,"requires Long.js");case e.TYPES.bool:return"boolean"!=typeof t&&i(typeof t,"not a boolean"),t;case e.TYPES.float:case e.TYPES.double:return"number"!=typeof t&&i(typeof t,"not a number"),t;case e.TYPES.string:return"string"==typeof t||t&&t instanceof String||i(typeof t,"not a string"),""+t;case e.TYPES.bytes:return n.isByteBuffer(t)?t:n.wrap(t,"base64");case e.TYPES.enum:var s=this.resolvedType.getChildren(d.Value);for(f=0;f=0){r.writeVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),r.ensureCapacity(r.offset+=1);var o=r.offset;for(i=0;i1){var f=r.slice(o,r.offset);o+=a-1,r.offset=o,r.append(f)}r.writeVarint32(s,o-a)}else for(i=0;i=0){for(r+=n.calculateVarint32(this.id<<3|e.WIRE_TYPES.LDELIM),o=0,i=0;i=0&&!n){o=r.readVarint32(),o=r.offset+o;for(var s=[];r.offset>>0;case e.TYPES.sint32:return 0|r.readVarint32ZigZag();case e.TYPES.fixed32:return r.readUint32()>>>0;case e.TYPES.sfixed32:return 0|r.readInt32();case e.TYPES.int64:return r.readVarint64();case e.TYPES.uint64:return r.readVarint64().toUnsigned();case e.TYPES.sint64:return r.readVarint64ZigZag();case e.TYPES.fixed64:return r.readUint64();case e.TYPES.sfixed64:return r.readInt64();case e.TYPES.bool:return!!r.readVarint32();case e.TYPES.enum:return r.readVarint32();case e.TYPES.float:return r.readFloat();case e.TYPES.double:return r.readDouble();case e.TYPES.string:return r.readVString();case e.TYPES.bytes:if(o=r.readVarint32(),r.remaining()=0)return!1;s.push(o)}s=null}if(void 0!==r.enums){if(!e.Util.isArray(r.enums))return!1;for(n=0;n0;){if(t=r.pop(),!e.Util.isArray(t))throw Error("Not a valid namespace: "+JSON.stringify(t));for(;t.length>0;){var o=t.shift();if(i.isValidMessage(o)){var s=new n.Message(this,this.ptr,o.name,o.options,o.isGroup),a={};if(o.oneofs)for(var f=Object.keys(o.oneofs),u=0,c=f.length;u0)for(u=0,c=o.fields.length;u0)for(u=0;u0)for(u=0;ue.ID_MAX&&(s.extensions[1]=e.ID_MAX)),this.ptr.addChild(s),y.length>0){r.push(t),t=y,y=null,this.ptr=s,s=null;continue}y=null,s=null}else if(i.isValidEnum(o)){for(s=new n.Enum(this,this.ptr,o.name,o.options),u=0;us.extensions[1])throw Error("Illegal extended field id in message "+s.name+": "+o.fields[u].id+" ("+s.extensions.join(" to ")+" expected)");var b=o.fields[u].name;this.options.convertFieldsToCamelCase&&(b=n.Message.Field._toCamelCase(o.fields[u].name)),h=new n.Message.ExtensionField(this,s,o.fields[u].rule,o.fields[u].type,this.ptr.fqn()+"."+b,o.fields[u].id,o.fields[u].options);var v=new n.Extension(this,this.ptr,o.fields[u].name,h);h.extension=v,this.ptr.addChild(v),s.addChild(h)}else if(!/\.?google\.protobuf\./.test(o.ref))throw Error("Extended message "+o.ref+" is not defined")}o=null}t=null,this.ptr=this.ptr.parent}return this.resolved=!1,this.result=null,this},o.import=function(t,n){if("string"==typeof n){if(e.Util.IS_NODE&&(n=r(188).resolve(n)),!0===this.files[n])return this.reset(),this;this.files[n]=!0}if(t.imports&&t.imports.length>0){var i,o="/",s=!1;"object"==typeof n?(this.importRoot=n.root,s=!0,i=this.importRoot,n=n.file,(i.indexOf("\\")>=0||n.indexOf("\\")>=0)&&(o="\\")):"string"==typeof n?this.importRoot?i=this.importRoot:n.indexOf("/")>=0?""===(i=n.replace(/\/[^\/]*$/,""))&&(i="/"):n.indexOf("\\")>=0?(i=n.replace(/\\[^\\]*$/,""),o="\\"):i=".":i=null;for(var a=0;a=0)return!1;s.push(o)}s=null}return!0},o.resolveAll=function(){var r;if(null!=this.ptr&&"object"!=typeof this.ptr.type){if(this.ptr instanceof n.Namespace)for(var i=this.ptr.children,o=0,s=i.length;o=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var n=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,i=function(e){return n.exec(e).slice(1)};function o(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,n="/"===s.charAt(0))}return(n?"/":"")+(t=r(o(t.split("/"),function(e){return!!e}),!n).join("/"))||"."},t.normalize=function(e){var n=t.isAbsolute(e),i="/"===s(e,-1);return(e=r(o(e.split("/"),function(e){return!!e}),!n).join("/"))||n||(e="."),e&&i&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var i=n(e.split("/")),o=n(r.split("/")),s=Math.min(i.length,o.length),a=s,f=0;f
+ * This version of ByteBuffer.js uses an ArrayBuffer as its backing buffer which is accessed through a DataView and is
+ * compatible with modern browsers.
+ * Released under the Apache License, Version 2.0
+ * see: https://github.com/dcodeIO/ByteBuffer.js for details
+ */
+!function(t){"use strict";e.exports=function(){var e;try{e=r(190)}catch(e){}return function(e){var t=function(e,r,i){if(void 0===e&&(e=t.DEFAULT_CAPACITY),void 0===r&&(r=t.DEFAULT_ENDIAN),void 0===i&&(i=t.DEFAULT_NOASSERT),!i){if((e|=0)<0)throw RangeError("Illegal capacity");r=!!r,i=!!i}this.buffer=0===e?n:new ArrayBuffer(e),this.view=0===e?null:new DataView(this.buffer),this.offset=0,this.markedOffset=-1,this.limit=e,this.littleEndian=void 0!==r&&!!r,this.noAssert=!!i};t.VERSION="3.5.5",t.LITTLE_ENDIAN=!0,t.BIG_ENDIAN=!1,t.DEFAULT_CAPACITY=16,t.DEFAULT_ENDIAN=t.BIG_ENDIAN,t.DEFAULT_NOASSERT=!1,t.Long=e||null;var r=t.prototype,n=new ArrayBuffer(0),o=String.fromCharCode;function s(e){var t=0;return function(){return t1024&&(t.push(o.apply(String,e)),e.length=0),Array.prototype.push.apply(e,arguments)}}t.allocate=function(e,r,n){return new t(e,r,n)},t.concat=function(e,r,n,i){"boolean"!=typeof r&&"string"==typeof r||(i=n,n=r,r=void 0);for(var o,s=0,a=0,f=e.length;a0&&(s+=o);if(0===s)return new t(0,n,i);var u,c=new t(s,n,i),h=new Uint8Array(c.buffer);for(a=0;a0&&(a.buffer=e.buffer,a.offset=e.byteOffset,a.limit=e.byteOffset+e.length,a.view=e.length>0?new DataView(e.buffer):null);else if(e instanceof ArrayBuffer)a=new t(0,o,s),e.byteLength>0&&(a.buffer=e,a.offset=0,a.limit=e.byteLength,a.view=e.byteLength>0?new DataView(e):null);else{if("[object Array]"!==Object.prototype.toString.call(e))throw TypeError("Illegal buffer");for((a=new t(e.length,o,s)).limit=e.length,i=0;i>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view.setInt8(t,e),r&&(this.offset+=1),this},r.writeByte=r.writeInt8,r.readInt8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view.getInt8(e);return t&&(this.offset+=1),r},r.readByte=r.readInt8,r.writeUint8=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=1;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=1,this.view.setUint8(t,e),r&&(this.offset+=1),this},r.readUint8=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r=this.view.getUint8(e);return t&&(this.offset+=1),r},r.writeInt16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.view.setInt16(t,e,this.littleEndian),r&&(this.offset+=2),this},r.writeShort=r.writeInt16,r.readInt16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=this.view.getInt16(e,this.littleEndian);return t&&(this.offset+=2),r},r.readShort=r.readInt16,r.writeUint16=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=2;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=2,this.view.setUint16(t,e,this.littleEndian),r&&(this.offset+=2),this},r.readUint16=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+2>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+2) <= "+this.buffer.byteLength)}var r=this.view.getUint16(e,this.littleEndian);return t&&(this.offset+=2),r},r.writeInt32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.view.setInt32(t,e,this.littleEndian),r&&(this.offset+=4),this},r.writeInt=r.writeInt32,r.readInt32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=this.view.getInt32(e,this.littleEndian);return t&&(this.offset+=4),r},r.readInt=r.readInt32,r.writeUint32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.view.setUint32(t,e,this.littleEndian),r&&(this.offset+=4),this},r.readUint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=this.view.getUint32(e,this.littleEndian);return t&&(this.offset+=4),r},e&&(r.writeInt64=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;return r>i&&this.resize((i*=2)>r?i:r),r-=8,this.littleEndian?(this.view.setInt32(r,t.low,!0),this.view.setInt32(r+4,t.high,!0)):(this.view.setInt32(r,t.high,!1),this.view.setInt32(r+4,t.low,!1)),n&&(this.offset+=8),this},r.writeLong=r.writeInt64,r.readInt64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=this.littleEndian?new e(this.view.getInt32(t,!0),this.view.getInt32(t+4,!0),!1):new e(this.view.getInt32(t+4,!1),this.view.getInt32(t,!1),!1);return r&&(this.offset+=8),n},r.readLong=r.readInt64,r.writeUint64=function(t,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"==typeof t)t=e.fromNumber(t);else if("string"==typeof t)t=e.fromString(t);else if(!(t&&t instanceof e))throw TypeError("Illegal value: "+t+" (not an integer or Long)");if("number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t)),r+=8;var i=this.buffer.byteLength;return r>i&&this.resize((i*=2)>r?i:r),r-=8,this.littleEndian?(this.view.setInt32(r,t.low,!0),this.view.setInt32(r+4,t.high,!0)):(this.view.setInt32(r,t.high,!1),this.view.setInt32(r+4,t.low,!1)),n&&(this.offset+=8),this},r.readUint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+8) <= "+this.buffer.byteLength)}var n=this.littleEndian?new e(this.view.getInt32(t,!0),this.view.getInt32(t+4,!0),!0):new e(this.view.getInt32(t+4,!1),this.view.getInt32(t,!1),!0);return r&&(this.offset+=8),n}),r.writeFloat32=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=4;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=4,this.view.setFloat32(t,e,this.littleEndian),r&&(this.offset+=4),this},r.writeFloat=r.writeFloat32,r.readFloat32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r=this.view.getFloat32(e,this.littleEndian);return t&&(this.offset+=4),r},r.readFloat=r.readFloat32,r.writeFloat64=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof e)throw TypeError("Illegal value: "+e+" (not a number)");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}t+=8;var n=this.buffer.byteLength;return t>n&&this.resize((n*=2)>t?n:t),t-=8,this.view.setFloat64(t,e,this.littleEndian),r&&(this.offset+=8),this},r.writeDouble=r.writeFloat64,r.readFloat64=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+8>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+8) <= "+this.buffer.byteLength)}var r=this.view.getFloat64(e,this.littleEndian);return t&&(this.offset+=8),r},r.readDouble=r.readFloat64,t.MAX_VARINT32_BYTES=5,t.calculateVarint32=function(e){return(e>>>=0)<128?1:e<16384?2:e<1<<21?3:e<1<<28?4:5},t.zigZagEncode32=function(e){return((e|=0)<<1^e>>31)>>>0},t.zigZagDecode32=function(e){return e>>>1^-(1&e)|0},r.writeVarint32=function(e,r){var n=void 0===r;if(n&&(r=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal offset: "+r+" (not an integer)");if((r>>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,o=t.calculateVarint32(e);r+=o;var s=this.buffer.byteLength;return r>s&&this.resize((s*=2)>r?s:r),r-=o,this.view.setUint8(r,i=128|e),(e>>>=0)>=128?(i=e>>7|128,this.view.setUint8(r+1,i),e>=16384?(i=e>>14|128,this.view.setUint8(r+2,i),e>=1<<21?(i=e>>21|128,this.view.setUint8(r+3,i),e>=1<<28?(this.view.setUint8(r+4,e>>28&15),o=5):(this.view.setUint8(r+3,127&i),o=4)):(this.view.setUint8(r+2,127&i),o=3)):(this.view.setUint8(r+1,127&i),o=2)):(this.view.setUint8(r,127&i),o=1),n?(this.offset+=o,this):o},r.writeVarint32ZigZag=function(e,r){return this.writeVarint32(t.zigZagEncode32(e),r)},r.readVarint32=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n,i=0,o=0;do{if(n=e+i,!this.noAssert&&n>this.limit){var s=Error("Truncated");throw s.truncated=!0,s}r=this.view.getUint8(n),i<5&&(o|=(127&r)<<7*i>>>0),++i}while(128==(128&r));return o|=0,t?(this.offset+=i,o):{value:o,length:i}},r.readVarint32ZigZag=function(e){var r=this.readVarint32(e);return"object"==typeof r?r.value=t.zigZagDecode32(r.value):r=t.zigZagDecode32(r),r},e&&(t.MAX_VARINT64_BYTES=10,t.calculateVarint64=function(t){"number"==typeof t?t=e.fromNumber(t):"string"==typeof t&&(t=e.fromString(t));var r=t.toInt()>>>0,n=t.shiftRightUnsigned(28).toInt()>>>0,i=t.shiftRightUnsigned(56).toInt()>>>0;return 0==i?0==n?r<16384?r<128?1:2:r<1<<21?3:4:n<16384?n<128?5:6:n<1<<21?7:8:i<128?9:10},t.zigZagEncode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftLeft(1).xor(t.shiftRight(63)).toUnsigned()},t.zigZagDecode64=function(t){return"number"==typeof t?t=e.fromNumber(t,!1):"string"==typeof t?t=e.fromString(t,!1):!1!==t.unsigned&&(t=t.toSigned()),t.shiftRightUnsigned(1).xor(t.and(e.ONE).toSigned().negate()).toSigned()},r.writeVarint64=function(r,n){var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"==typeof r)r=e.fromNumber(r);else if("string"==typeof r)r=e.fromString(r);else if(!(r&&r instanceof e))throw TypeError("Illegal value: "+r+" (not an integer or Long)");if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}"number"==typeof r?r=e.fromNumber(r,!1):"string"==typeof r?r=e.fromString(r,!1):!1!==r.unsigned&&(r=r.toSigned());var o=t.calculateVarint64(r),s=r.toInt()>>>0,a=r.shiftRightUnsigned(28).toInt()>>>0,f=r.shiftRightUnsigned(56).toInt()>>>0;n+=o;var u=this.buffer.byteLength;switch(n>u&&this.resize((u*=2)>n?u:n),n-=o,o){case 10:this.view.setUint8(n+9,f>>>7&1);case 9:this.view.setUint8(n+8,9!==o?128|f:127&f);case 8:this.view.setUint8(n+7,8!==o?a>>>21|128:a>>>21&127);case 7:this.view.setUint8(n+6,7!==o?a>>>14|128:a>>>14&127);case 6:this.view.setUint8(n+5,6!==o?a>>>7|128:a>>>7&127);case 5:this.view.setUint8(n+4,5!==o?128|a:127&a);case 4:this.view.setUint8(n+3,4!==o?s>>>21|128:s>>>21&127);case 3:this.view.setUint8(n+2,3!==o?s>>>14|128:s>>>14&127);case 2:this.view.setUint8(n+1,2!==o?s>>>7|128:s>>>7&127);case 1:this.view.setUint8(n,1!==o?128|s:127&s)}return i?(this.offset+=o,this):o},r.writeVarint64ZigZag=function(e,r){return this.writeVarint64(t.zigZagEncode64(e),r)},r.readVarint64=function(t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+1) <= "+this.buffer.byteLength)}var n=t,i=0,o=0,s=0,a=0;if(i=127&(a=this.view.getUint8(t++)),128&a&&(i|=(127&(a=this.view.getUint8(t++)))<<7,128&a&&(i|=(127&(a=this.view.getUint8(t++)))<<14,128&a&&(i|=(127&(a=this.view.getUint8(t++)))<<21,128&a&&(o=127&(a=this.view.getUint8(t++)),128&a&&(o|=(127&(a=this.view.getUint8(t++)))<<7,128&a&&(o|=(127&(a=this.view.getUint8(t++)))<<14,128&a&&(o|=(127&(a=this.view.getUint8(t++)))<<21,128&a&&(s=127&(a=this.view.getUint8(t++)),128&a&&(s|=(127&(a=this.view.getUint8(t++)))<<7,128&a))))))))))throw Error("Buffer overrun");var f=e.fromBits(i|o<<28,o>>>4|s<<24,!1);return r?(this.offset=t,f):{value:f,length:t-n}},r.readVarint64ZigZag=function(r){var n=this.readVarint64(r);return n&&n.value instanceof e?n.value=t.zigZagDecode64(n.value):n=t.zigZagDecode64(n),n}),r.writeCString=function(e,t){var r=void 0===t;r&&(t=this.offset);var n,i=e.length;if(!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");for(n=0;n>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}i=u.calculateUTF16asUTF8(s(e))[1],t+=i+1;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=i+1,u.encodeUTF16toUTF8(s(e),function(e){this.view.setUint8(t++,e)}.bind(this)),this.view.setUint8(t++,0),r?(this.offset=t,this):i},r.readCString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n=e,i=-1;return u.decodeUTF8toUTF16(function(){if(0===i)return null;if(e>=this.limit)throw RangeError("Illegal range: Truncated data, "+e+" < "+this.limit);return 0===(i=this.view.getUint8(e++))?null:i}.bind(this),r=a(),!0),t?(this.offset=e,r()):{string:r(),length:e-n}},r.writeIString=function(e,t){var r=void 0===t;if(r&&(t=this.offset),!this.noAssert){if("string"!=typeof e)throw TypeError("Illegal str: Not a string");if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: "+t+" (not an integer)");if((t>>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var n,i=t;n=u.calculateUTF16asUTF8(s(e),this.noAssert)[1],t+=4+n;var o=this.buffer.byteLength;if(t>o&&this.resize((o*=2)>t?o:t),t-=4+n,this.view.setUint32(t,n,this.littleEndian),t+=4,u.encodeUTF16toUTF8(s(e),function(e){this.view.setUint8(t++,e)}.bind(this)),t!==i+4+n)throw RangeError("Illegal range: Truncated data, "+t+" == "+(t+4+n));return r?(this.offset=t,this):t-i},r.readIString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+4>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+4) <= "+this.buffer.byteLength)}var r,n,i=e;r=this.view.getUint32(e,this.littleEndian);var o,s=(e+=4)+r;return u.decodeUTF8toUTF16(function(){return e>>=0)<0||t+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+t+" (+0) <= "+this.buffer.byteLength)}var i=t;r=u.calculateUTF16asUTF8(s(e))[1],t+=r;var o=this.buffer.byteLength;return t>o&&this.resize((o*=2)>t?o:t),t-=r,u.encodeUTF16toUTF8(s(e),function(e){this.view.setUint8(t++,e)}.bind(this)),n?(this.offset=t,this):t-i},r.writeString=r.writeUTF8String,t.calculateUTF8Chars=function(e){return u.calculateUTF16asUTF8(s(e))[0]},t.calculateUTF8Bytes=function(e){return u.calculateUTF16asUTF8(s(e))[1]},r.readUTF8String=function(e,r,n){"number"==typeof r&&(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),void 0===r&&(r=t.METRICS_CHARS),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");if(e|=0,"number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}var o,s=0,f=n;if(r===t.METRICS_CHARS){if(o=a(),u.decodeUTF8(function(){return s>>=0)<0||n+e>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+"+e+") <= "+this.buffer.byteLength)}var c=n+e;if(u.decodeUTF8toUTF16(function(){return n>>=0)<0||r+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+r+" (+0) <= "+this.buffer.byteLength)}var i,o,a=r;i=u.calculateUTF16asUTF8(s(e),this.noAssert)[1],o=t.calculateVarint32(i),r+=o+i;var f=this.buffer.byteLength;if(r>f&&this.resize((f*=2)>r?f:r),r-=o+i,r+=this.writeVarint32(i,r),u.encodeUTF16toUTF8(s(e),function(e){this.view.setUint8(r++,e)}.bind(this)),r!==a+i+o)throw RangeError("Illegal range: Truncated data, "+r+" == "+(r+i+o));return n?(this.offset=r,this):r-a},r.readVString=function(e){var t=void 0===e;if(t&&(e=this.offset),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal offset: "+e+" (not an integer)");if((e>>>=0)<0||e+1>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+1) <= "+this.buffer.byteLength)}var r,n=this.readVarint32(e),i=e;e+=n.length,n=n.value;var o=e+n,s=a();return u.decodeUTF8toUTF16(function(){return e>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var o=e.limit-e.offset;if(o<=0)return this;n+=o;var s=this.buffer.byteLength;return n>s&&this.resize((s*=2)>n?s:n),n-=o,new Uint8Array(this.buffer,n).set(new Uint8Array(e.buffer).subarray(e.offset,e.limit)),e.offset+=o,i&&(this.offset+=o),this},r.appendTo=function(e,t){return e.append(this,t),this},r.assert=function(e){return this.noAssert=!e,this},r.capacity=function(){return this.buffer.byteLength},r.clear=function(){return this.offset=0,this.limit=this.buffer.byteLength,this.markedOffset=-1,this},r.clone=function(e){var r=new t(0,this.littleEndian,this.noAssert);if(e){var n=new ArrayBuffer(this.buffer.byteLength);new Uint8Array(n).set(this.buffer),r.buffer=n,r.view=new DataView(n)}else r.buffer=this.buffer,r.view=this.view;return r.offset=this.offset,r.markedOffset=this.markedOffset,r.limit=this.limit,r},r.compact=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(0===e&&t===this.buffer.byteLength)return this;var r=t-e;if(0===r)return this.buffer=n,this.view=null,this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=0,this;var i=new ArrayBuffer(r);return new Uint8Array(i).set(new Uint8Array(this.buffer).subarray(e,t)),this.buffer=i,this.view=new DataView(i),this.markedOffset>=0&&(this.markedOffset-=e),this.offset=0,this.limit=r,this},r.copy=function(e,r){if(void 0===e&&(e=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,e<0||e>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+r+" <= "+this.buffer.byteLength)}if(e===r)return new t(0,this.littleEndian,this.noAssert);var n=r-e,i=new t(n,this.littleEndian,this.noAssert);return i.offset=0,i.limit=n,i.markedOffset>=0&&(i.markedOffset-=e),this.copyTo(i,0,e,r),i},r.copyTo=function(e,r,n,i){var o,s;if(!this.noAssert&&!t.isByteBuffer(e))throw TypeError("Illegal target: Not a ByteBuffer");if(r=(s=void 0===r)?e.offset:0|r,n=(o=void 0===n)?this.offset:0|n,i=void 0===i?this.limit:0|i,r<0||r>e.buffer.byteLength)throw RangeError("Illegal target range: 0 <= "+r+" <= "+e.buffer.byteLength);if(n<0||i>this.buffer.byteLength)throw RangeError("Illegal source range: 0 <= "+n+" <= "+this.buffer.byteLength);var a=i-n;return 0===a?e:(e.ensureCapacity(r+a),new Uint8Array(e.buffer).set(new Uint8Array(this.buffer).subarray(n,i),r),o&&(this.offset+=a),s&&(e.offset+=a),this)},r.ensureCapacity=function(e){var t=this.buffer.byteLength;return te?t:e):this},r.fill=function(e,t,r){var n=void 0===t;if(n&&(t=this.offset),"string"==typeof e&&e.length>0&&(e=e.charCodeAt(0)),void 0===t&&(t=this.offset),void 0===r&&(r=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal value: "+e+" (not an integer)");if(e|=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal begin: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal end: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(t>=r)return this;for(;t>>=0)<0||e+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+e+" (+0) <= "+this.buffer.byteLength)}return this.markedOffset=e,this},r.order=function(e){if(!this.noAssert&&"boolean"!=typeof e)throw TypeError("Illegal littleEndian: Not a boolean");return this.littleEndian=!!e,this},r.LE=function(e){return this.littleEndian=void 0===e||!!e,this},r.BE=function(e){return this.littleEndian=void 0!==e&&!e,this},r.prepend=function(e,r,n){"number"!=typeof r&&"string"==typeof r||(n=r,r=void 0);var i=void 0===n;if(i&&(n=this.offset),!this.noAssert){if("number"!=typeof n||n%1!=0)throw TypeError("Illegal offset: "+n+" (not an integer)");if((n>>>=0)<0||n+0>this.buffer.byteLength)throw RangeError("Illegal offset: 0 <= "+n+" (+0) <= "+this.buffer.byteLength)}e instanceof t||(e=t.wrap(e,r));var o=e.limit-e.offset;if(o<=0)return this;var s,a=o-n;if(a>0){var f=new ArrayBuffer(this.buffer.byteLength+a);(s=new Uint8Array(f)).set(new Uint8Array(this.buffer).subarray(n,this.buffer.byteLength),o),this.buffer=f,this.view=new DataView(f),this.offset+=a,this.markedOffset>=0&&(this.markedOffset+=a),this.limit+=a,n+=a}else s=new Uint8Array(this.buffer);return s.set(new Uint8Array(e.buffer).subarray(e.offset,e.limit),n-o),e.offset=e.limit,i&&(this.offset-=o),this},r.prependTo=function(e,t){return e.prepend(this,t),this},r.printDebug=function(e){"function"!=typeof e&&(e=console.log.bind(console)),e(this.toString()+"\n-------------------------------------------------------------------\n"+this.toDebug(!0))},r.remaining=function(){return this.limit-this.offset},r.reset=function(){return this.markedOffset>=0?(this.offset=this.markedOffset,this.markedOffset=-1):this.offset=0,this},r.resize=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal capacity: "+e+" (not an integer)");if((e|=0)<0)throw RangeError("Illegal capacity: 0 <= "+e)}if(this.buffer.byteLength>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}return e===t?this:(Array.prototype.reverse.call(new Uint8Array(this.buffer).subarray(e,t)),this.view=new DataView(this.buffer),this)},r.skip=function(e){if(!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal length: "+e+" (not an integer)");e|=0}var t=this.offset+e;if(!this.noAssert&&(t<0||t>this.buffer.byteLength))throw RangeError("Illegal length: 0 <= "+this.offset+" + "+e+" <= "+this.buffer.byteLength);return this.offset=t,this},r.slice=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r=this.clone();return r.offset=e,r.limit=t,r},r.toBuffer=function(e){var t=this.offset,r=this.limit;if(t>r){var i=t;t=r,r=i}if(!this.noAssert){if("number"!=typeof t||t%1!=0)throw TypeError("Illegal offset: Not an integer");if(t>>>=0,"number"!=typeof r||r%1!=0)throw TypeError("Illegal limit: Not an integer");if(r>>>=0,t<0||t>r||r>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+t+" <= "+r+" <= "+this.buffer.byteLength)}if(!e&&0===t&&r===this.buffer.byteLength)return this.buffer;if(t===r)return n;var o=new ArrayBuffer(r-t);return new Uint8Array(o).set(new Uint8Array(this.buffer).subarray(t,r),0),o},r.toArrayBuffer=r.toBuffer,r.toString=function(e,t,r){if(void 0===e)return"ByteBufferAB(offset="+this.offset+",markedOffset="+this.markedOffset+",limit="+this.limit+",capacity="+this.capacity()+")";switch("number"==typeof e&&(r=t=e="utf8"),e){case"utf8":return this.toUTF8(t,r);case"base64":return this.toBase64(t,r);case"hex":return this.toHex(t,r);case"binary":return this.toBinary(t,r);case"debug":return this.toDebug();case"columns":return this.toColumns();default:throw Error("Unsupported encoding: "+e)}};var f=function(){for(var e={},t=[65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,43,47],r=[],n=0,i=t.length;n>2&63]),i=(3&n)<<4,null!==(n=e())?(r(t[63&((i|=n>>4&15)|n>>4&15)]),i=(15&n)<<2,null!==(n=e())?(r(t[63&(i|n>>6&3)]),r(t[63&n])):(r(t[63&i]),r(61))):(r(t[63&i]),r(61),r(61))},e.decode=function(e,t){var n,i,o;function s(e){throw Error("Illegal character code: "+e)}for(;null!==(n=e());)if(void 0===(i=r[n])&&s(n),null!==(n=e())&&(void 0===(o=r[n])&&s(n),t(i<<2>>>0|(48&o)>>4),null!==(n=e()))){if(void 0===(i=r[n])){if(61===n)break;s(n)}if(t((15&o)<<4>>>0|(60&i)>>2),null!==(n=e())){if(void 0===(o=r[n])){if(61===n)break;s(n)}t((3&i)<<6>>>0|o)}}},e.test=function(e){return/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/.test(e)},e}();r.toBase64=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;return f.encode(function(){return e>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}if(e===t)return"";for(var r=[],n=[];e=1024&&(n.push(String.fromCharCode.apply(String,r)),r=[]);return n.join("")+String.fromCharCode.apply(String,r)},t.fromBinary=function(e,r,n){if(!n&&"string"!=typeof e)throw TypeError("Illegal str: Not a string");for(var i,o=0,s=e.length,a=new t(s,r,n);o255)throw RangeError("Illegal charCode at "+o+": 0 <= "+i+" <= 255");a.view.setUint8(o++,i)}return a.limit=s,a},r.toDebug=function(e){for(var t,r=-1,n=this.buffer.byteLength,i="",o="",s="";r32&&t<127?String.fromCharCode(t):".")),++r,e&&r>0&&r%16==0&&r!==n){for(;i.length<51;)i+=" ";s+=i+o+"\n",i=o=""}r===this.offset&&r===this.limit?i+=r===this.markedOffset?"!":"|":r===this.offset?i+=r===this.markedOffset?"[":"<":r===this.limit?i+=r===this.markedOffset?"]":">":i+=r===this.markedOffset?"'":e||0!==r&&r!==n?" ":""}if(e&&" "!==i){for(;i.length<51;)i+=" ";s+=i+o+"\n"}return e?s:i},t.fromDebug=function(e,r,n){for(var i,o,s=e.length,a=new t((s+1)/3|0,r,n),f=0,u=0,c=!1,h=!1,l=!1,p=!1,d=!1;f":if(!n){if(p){d=!0;break}p=!0}a.limit=u,c=!1;break;case"'":if(!n){if(l){d=!0;break}l=!0}a.markedOffset=u,c=!1;break;case" ":c=!1;break;default:if(!n&&c){d=!0;break}if(o=parseInt(i+e.charAt(f++),16),!n&&(isNaN(o)||o<0||o>255))throw TypeError("Illegal str: Not a debug encoded string");a.view.setUint8(u++,o),c=!0}if(d)throw TypeError("Illegal str: Invalid symbol at "+f)}if(!n){if(!h||!p)throw TypeError("Illegal str: Missing offset or limit");if(u>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}for(var r,n=new Array(t-e);e255))throw TypeError("Illegal str: Contains non-hex characters");s.view.setUint8(f++,i)}return s.limit=f,s};var u=function(){var e={MAX_CODEPOINT:1114111,encodeUTF8:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<128?t(127&r):r<2048?(t(r>>6&31|192),t(63&r|128)):r<65536?(t(r>>12&15|224),t(r>>6&63|128),t(63&r|128)):(t(r>>18&7|240),t(r>>12&63|128),t(r>>6&63|128),t(63&r|128)),r=null},decodeUTF8:function(e,t){for(var r,n,i,o,s=function(e){e=e.slice(0,e.indexOf(null));var t=Error(e.toString());throw t.name="TruncatedError",t.bytes=e,t};null!==(r=e());)if(0==(128&r))t(r);else if(192==(224&r))null===(n=e())&&s([r,n]),t((31&r)<<6|63&n);else if(224==(240&r))(null===(n=e())||null===(i=e()))&&s([r,n,i]),t((15&r)<<12|(63&n)<<6|63&i);else{if(240!=(248&r))throw RangeError("Illegal starting byte: "+r);(null===(n=e())||null===(i=e())||null===(o=e()))&&s([r,n,i,o]),t((7&r)<<18|(63&n)<<12|(63&i)<<6|63&o)}},UTF16toUTF8:function(e,t){for(var r,n=null;null!==(r=null!==n?n:e());)r>=55296&&r<=57343&&null!==(n=e())&&n>=56320&&n<=57343?(t(1024*(r-55296)+n-56320+65536),n=null):t(r);null!==n&&t(n)},UTF8toUTF16:function(e,t){var r=null;for("number"==typeof e&&(r=e,e=function(){return null});null!==r||null!==(r=e());)r<=65535?t(r):(t(55296+((r-=65536)>>10)),t(r%1024+56320)),r=null},encodeUTF16toUTF8:function(t,r){e.UTF16toUTF8(t,function(t){e.encodeUTF8(t,r)})},decodeUTF8toUTF16:function(t,r){e.decodeUTF8(t,function(t){e.UTF8toUTF16(t,r)})},calculateCodePoint:function(e){return e<128?1:e<2048?2:e<65536?3:4},calculateUTF8:function(t){for(var r,n=0;null!==(r=t());)n+=e.calculateCodePoint(r);return n},calculateUTF16asUTF8:function(t){var r=0,n=0;return e.UTF16toUTF8(t,function(t){++r,n+=e.calculateCodePoint(t)}),[r,n]}};return e}();return r.toUTF8=function(e,t){if(void 0===e&&(e=this.offset),void 0===t&&(t=this.limit),!this.noAssert){if("number"!=typeof e||e%1!=0)throw TypeError("Illegal begin: Not an integer");if(e>>>=0,"number"!=typeof t||t%1!=0)throw TypeError("Illegal end: Not an integer");if(t>>>=0,e<0||e>t||t>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+e+" <= "+t+" <= "+this.buffer.byteLength)}var r;try{u.decodeUTF8toUTF16(function(){return e
+ * Released under the Apache License, Version 2.0
+ * see: https://github.com/dcodeIO/Long.js for details
+ */i=[],void 0===(o="function"==typeof(n=function(){"use strict";function e(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}e.__isLong__,Object.defineProperty(e.prototype,"__isLong__",{value:!0,enumerable:!1,configurable:!1}),e.isLong=function(e){return!0===(e&&e.__isLong__)};var t={},r={};e.fromInt=function(n,i){var o,s;return i?0<=(n>>>=0)&&n<256&&(s=r[n])?s:(o=new e(n,(0|n)<0?-1:0,!0),0<=n&&n<256&&(r[n]=o),o):-128<=(n|=0)&&n<128&&(s=t[n])?s:(o=new e(n,n<0?-1:0,!1),-128<=n&&n<128&&(t[n]=o),o)},e.fromNumber=function(t,r){return r=!!r,isNaN(t)||!isFinite(t)?e.ZERO:!r&&t<=-o?e.MIN_VALUE:!r&&t+1>=o?e.MAX_VALUE:r&&t>=i?e.MAX_UNSIGNED_VALUE:t<0?e.fromNumber(-t,r).negate():new e(t%n|0,t/n|0,r)},e.fromBits=function(t,r,n){return new e(t,r,n)},e.fromString=function(t,r,n){if(0===t.length)throw Error("number format error: empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e.ZERO;if("number"==typeof r&&(n=r,r=!1),(n=n||10)<2||360)throw Error('number format error: interior "-" character: '+t);if(0===i)return e.fromString(t.substring(1),r,n).negate();for(var o=e.fromNumber(Math.pow(n,8)),s=e.ZERO,a=0;a>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*n+(this.low>>>0):this.high*n+(this.low>>>0)},e.prototype.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((r=a).isZero())return f+s;for(;f.length<6;)f="0"+f;s=""+f+s}},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.equals(e.MIN_VALUE)?64:this.negate().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,r=31;r>0&&0==(t&1<=0},e.prototype.isOdd=function(){return 1==(1&this.low)},e.prototype.isEven=function(){return 0==(1&this.low)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},e.eq=e.prototype.equals,e.prototype.notEquals=function(e){return!this.equals(e)},e.neq=e.prototype.notEquals,e.prototype.lessThan=function(e){return this.compare(e)<0},e.prototype.lt=e.prototype.lessThan,e.prototype.lessThanOrEqual=function(e){return this.compare(e)<=0},e.prototype.lte=e.prototype.lessThanOrEqual,e.prototype.greaterThan=function(e){return this.compare(e)>0},e.prototype.gt=e.prototype.greaterThan,e.prototype.greaterThanOrEqual=function(e){return this.compare(e)>=0},e.prototype.gte=e.prototype.greaterThanOrEqual,e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.equals(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.subtract(t).isNegative()?-1:1},e.prototype.negate=function(){return!this.unsigned&&this.equals(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=e.prototype.negate,e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,f=t.low>>>16,u=0,c=0,h=0,l=0;return h+=(l+=o+(65535&t.low))>>>16,l&=65535,c+=(h+=i+f)>>>16,h&=65535,u+=(c+=n+a)>>>16,c&=65535,u+=r+s,u&=65535,e.fromBits(h<<16|l,u<<16|c,this.unsigned)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.negate())},e.prototype.sub=e.prototype.subtract,e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())return e.ZERO;if(this.equals(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.equals(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return t.isNegative()?this.negate().multiply(t.negate()):this.negate().multiply(t).negate();if(t.isNegative())return this.multiply(t.negate()).negate();if(this.lessThan(s)&&t.lessThan(s))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,a=t.high>>>16,f=65535&t.high,u=t.low>>>16,c=65535&t.low,h=0,l=0,p=0,d=0;return p+=(d+=o*c)>>>16,d&=65535,l+=(p+=i*c)>>>16,p&=65535,l+=(p+=o*u)>>>16,p&=65535,h+=(l+=n*c)>>>16,l&=65535,h+=(l+=i*u)>>>16,l&=65535,h+=(l+=o*f)>>>16,l&=65535,h+=r*c+n*u+i*f+o*a,h&=65535,e.fromBits(p<<16|d,h<<16|l,this.unsigned)},e.prototype.mul=e.prototype.multiply,e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw new Error("division by zero");if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var r,n,i;if(this.equals(e.MIN_VALUE))return t.equals(e.ONE)||t.equals(e.NEG_ONE)?e.MIN_VALUE:t.equals(e.MIN_VALUE)?e.ONE:(r=this.shiftRight(1).divide(t).shiftLeft(1)).equals(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(n=this.subtract(t.multiply(r)),i=r.add(n.divide(t)));if(t.equals(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return t.isNegative()?this.negate().divide(t.negate()):this.negate().divide(t).negate();if(t.isNegative())return this.divide(t.negate()).negate();for(i=e.ZERO,n=this;n.greaterThanOrEqual(t);){r=Math.max(1,Math.floor(n.toNumber()/t.toNumber()));for(var o=Math.ceil(Math.log(r)/Math.LN2),s=o<=48?1:Math.pow(2,o-48),a=e.fromNumber(r),f=a.multiply(t);f.isNegative()||f.greaterThan(n);)r-=s,f=(a=e.fromNumber(r,this.unsigned)).multiply(t);a.isZero()&&(a=e.ONE),i=i.add(a),n=n.subtract(f)}return i},e.prototype.div=e.prototype.divide,e.prototype.modulo=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.subtract(this.divide(t).multiply(t))},e.prototype.mod=e.prototype.modulo,e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?e.fromBits(this.low<>>32-t,this.unsigned):e.fromBits(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=e.prototype.shiftRight,e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),0==(t&=63))return this;var r=this.high;if(t<32){var n=this.low;return e.fromBits(n>>>t|r<<32-t,r>>>t,this.unsigned)}return 32===t?e.fromBits(r,0,this.unsigned):e.fromBits(r>>>t-32,0,this.unsigned)},e.prototype.shru=e.prototype.shiftRightUnsigned,e.prototype.toSigned=function(){return this.unsigned?new e(this.low,this.high,!1):this},e.prototype.toUnsigned=function(){return this.unsigned?this:new e(this.low,this.high,!0)},e})?n.apply(t,i):n)||(e.exports=o)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.protocolToJSON=function(e){var t=i(e.file[2]);return t.imports=[i(e.file[1])],t};var n=r(192);function i(e){var t={};t.package=e.package,t.options=e.options,t.services=[];var r=Object.values(e.message_type).map(a),n=function(e){var t={};return Object.values(e).forEach(function(e){var r=e.extendee.slice(1);null==t[r]&&(t[r]={},t[r].ref=r,t[r].fields=[]),t[r].fields.push(u(e))}),Object.values(t)}(e.extension);return t.messages=n.concat(r),t.enums=Object.values(e.enum_type).map(o),t}function o(e){var t={};return t.name=e.name,t.values=Object.values(e.value).map(s),t.options={},t}function s(e){var t={};return t.name=e.name,t.id=e.number,t}function a(e){var t={enums:[]};return t.name=e.name,t.options=e.options||{},t.messages=[],t.fields=Object.values(e.field).map(u),t.oneofs={},t}Object.values||(0,n.shim)();var f={1:"double",2:"float",3:"int64",4:"uint64",5:"int32",6:"fixed64",7:"fixed32",8:"bool",9:"string",10:"group",11:"message",12:"bytes",13:"uint32",14:"enum",15:"sfixed32",16:"sfixed64",17:"sint32",18:"sint64"};function u(e){var t={};return 1===e.label&&(t.rule="optional"),2===e.label&&(t.rule="required"),3===e.label&&(t.rule="repeated"),t.type=f[e.type],e.type_name&&(t.type=e.type_name.slice(1)),t.name=e.name,t.options=e.options||{},t.id=e.number,t}},function(e,t,r){"use strict";var n=r(94),i=r(95),o=r(103),s=r(209),a=o();n(a,{getPolyfill:o,implementation:i,shim:s}),e.exports=a},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i=Object.prototype.toString,o=Array.prototype.slice,s=r(194),a=Object.prototype.propertyIsEnumerable,f=!a.call({toString:null},"toString"),u=a.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(e){var t=e.constructor;return t&&t.prototype===e},l={$applicationCache:!0,$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},p=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!l["$"+e]&&n.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{h(window[e])}catch(e){return!0}}catch(e){return!0}return!1}(),d=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===i.call(e),o=s(e),a=t&&"[object String]"===i.call(e),l=[];if(!t&&!r&&!o)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&e.length>0&&!n.call(e,0))for(var g=0;g0)for(var y=0;y=0&&"[object Function]"===n.call(e.callee)),r}},function(e,t,r){"use strict";e.exports=r(196)},function(e,t,r){"use strict";var n=r(197),i=r(100),o=i(i({},n),{SameValueNonNumber:function(e,t){if("number"==typeof e||typeof e!=typeof t)throw new TypeError("SameValueNonNumber requires two non-number values of the same type.");return this.SameValue(e,t)}});e.exports=o},function(e,t,r){"use strict";var n=r(31),i=r(199),o=r(97),s=o("%TypeError%"),a=o("%SyntaxError%"),f=o("%Array%"),u=o("%String%"),c=o("%Object%"),h=o("%Number%"),l=o("%Symbol%",!0),p=o("%RegExp%"),d=!!l,g=r(98),y=r(99),b=h.MAX_SAFE_INTEGER||Math.pow(2,53)-1,v=r(100),m=r(101),w=r(102),_=r(205),E=parseInt,A=r(32),I=A.call(Function.call,f.prototype.slice),S=A.call(Function.call,u.prototype.slice),T=A.call(Function.call,p.prototype.test,/^0b[01]+$/i),C=A.call(Function.call,p.prototype.test,/^0o[0-7]+$/i),O=A.call(Function.call,p.prototype.exec),P=new p("["+["
","",""].join("")+"]","g"),k=A.call(Function.call,p.prototype.test,P),x=A.call(Function.call,p.prototype.test,/^[-+]0x[0-9a-f]+$/i),B=A.call(Function.call,u.prototype.charCodeAt),D=A.call(Function.call,Object.prototype.toString),N=Math.floor,U=Math.abs,L=Object.create,R=c.getOwnPropertyDescriptor,M=c.isExtensible,j=["\t\n\v\f\r "," \u2028","\u2029\ufeff"].join(""),F=new RegExp("(^["+j+"]+)|(["+j+"]+$)","g"),H=A.call(Function.call,u.prototype.replace),Q=r(206),q=r(208),z=v(v({},Q),{Call:function(e,t){var r=arguments.length>2?arguments[2]:[];if(!this.IsCallable(e))throw new s(e+" is not a function");return e.apply(t,r)},ToPrimitive:i,ToNumber:function(e){var t=_(e)?e:i(e,h);if("symbol"==typeof t)throw new s("Cannot convert a Symbol value to a number");if("string"==typeof t){if(T(t))return this.ToNumber(E(S(t,2),2));if(C(t))return this.ToNumber(E(S(t,2),8));if(k(t)||x(t))return NaN;var r=function(e){return H(e,F,"")}(t);if(r!==t)return this.ToNumber(r)}return h(t)},ToInt16:function(e){var t=this.ToUint16(e);return t>=32768?t-65536:t},ToInt8:function(e){var t=this.ToUint8(e);return t>=128?t-256:t},ToUint8:function(e){var t=this.ToNumber(e);if(g(t)||0===t||!y(t))return 0;var r=m(t)*N(U(t));return w(r,256)},ToUint8Clamp:function(e){var t=this.ToNumber(e);if(g(t)||t<=0)return 0;if(t>=255)return 255;var r=N(e);return r+.5b?b:t},CanonicalNumericIndexString:function(e){if("[object String]"!==D(e))throw new s("must be a string");if("-0"===e)return-0;var t=this.ToNumber(e);return this.SameValue(this.ToString(t),e)?t:void 0},RequireObjectCoercible:Q.CheckObjectCoercible,IsArray:f.isArray||function(e){return"[object Array]"===D(e)},IsConstructor:function(e){return"function"==typeof e&&!!e.prototype},IsExtensible:Object.preventExtensions?function(e){return!_(e)&&M(e)}:function(e){return!0},IsInteger:function(e){if("number"!=typeof e||g(e)||!y(e))return!1;var t=U(e);return N(t)===t},IsPropertyKey:function(e){return"string"==typeof e||"symbol"==typeof e},IsRegExp:function(e){if(!e||"object"!=typeof e)return!1;if(d){var t=e[l.match];if(void 0!==t)return Q.ToBoolean(t)}return q(e)},SameValueZero:function(e,t){return e===t||g(e)&&g(t)},GetV:function(e,t){if(!this.IsPropertyKey(t))throw new s("Assertion failed: IsPropertyKey(P) is not true");return this.ToObject(e)[t]},GetMethod:function(e,t){if(!this.IsPropertyKey(t))throw new s("Assertion failed: IsPropertyKey(P) is not true");var r=this.GetV(e,t);if(null!=r){if(!this.IsCallable(r))throw new s(t+"is not a function");return r}},Get:function(e,t){if("Object"!==this.Type(e))throw new s("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(t))throw new s("Assertion failed: IsPropertyKey(P) is not true");return e[t]},Type:function(e){return"symbol"==typeof e?"Symbol":Q.Type(e)},SpeciesConstructor:function(e,t){if("Object"!==this.Type(e))throw new s("Assertion failed: Type(O) is not Object");var r=e.constructor;if(void 0===r)return t;if("Object"!==this.Type(r))throw new s("O.constructor is not an Object");var n=d&&l.species?r[l.species]:void 0;if(null==n)return t;if(this.IsConstructor(n))return n;throw new s("no constructor found")},CompletePropertyDescriptor:function(e){if(!this.IsPropertyDescriptor(e))throw new s("Desc must be a Property Descriptor");return this.IsGenericDescriptor(e)||this.IsDataDescriptor(e)?(n(e,"[[Value]]")||(e["[[Value]]"]=void 0),n(e,"[[Writable]]")||(e["[[Writable]]"]=!1)):(n(e,"[[Get]]")||(e["[[Get]]"]=void 0),n(e,"[[Set]]")||(e["[[Set]]"]=void 0)),n(e,"[[Enumerable]]")||(e["[[Enumerable]]"]=!1),n(e,"[[Configurable]]")||(e["[[Configurable]]"]=!1),e},Set:function(e,t,r,n){if("Object"!==this.Type(e))throw new s("O must be an Object");if(!this.IsPropertyKey(t))throw new s("P must be a Property Key");if("Boolean"!==this.Type(n))throw new s("Throw must be a Boolean");if(n)return e[t]=r,!0;try{e[t]=r}catch(e){return!1}},HasOwnProperty:function(e,t){if("Object"!==this.Type(e))throw new s("O must be an Object");if(!this.IsPropertyKey(t))throw new s("P must be a Property Key");return n(e,t)},HasProperty:function(e,t){if("Object"!==this.Type(e))throw new s("O must be an Object");if(!this.IsPropertyKey(t))throw new s("P must be a Property Key");return t in e},IsConcatSpreadable:function(e){if("Object"!==this.Type(e))return!1;if(d&&"symbol"==typeof l.isConcatSpreadable){var t=this.Get(e,Symbol.isConcatSpreadable);if(void 0!==t)return this.ToBoolean(t)}return this.IsArray(e)},Invoke:function(e,t){if(!this.IsPropertyKey(t))throw new s("P must be a Property Key");var r=I(arguments,2),n=this.GetV(e,t);return this.Call(n,e,r)},GetIterator:function(e,t){if(!d)throw new SyntaxError("ES.GetIterator depends on native iterator support.");var r=t;arguments.length<2&&(r=this.GetMethod(e,l.iterator));var n=this.Call(r,e);if("Object"!==this.Type(n))throw new s("iterator must return an object");return n},IteratorNext:function(e,t){var r=this.Invoke(e,"next",arguments.length<2?[]:[t]);if("Object"!==this.Type(r))throw new s("iterator next must return an object");return r},IteratorComplete:function(e){if("Object"!==this.Type(e))throw new s("Assertion failed: Type(iterResult) is not Object");return this.ToBoolean(this.Get(e,"done"))},IteratorValue:function(e){if("Object"!==this.Type(e))throw new s("Assertion failed: Type(iterResult) is not Object");return this.Get(e,"value")},IteratorStep:function(e){var t=this.IteratorNext(e);return!0!==this.IteratorComplete(t)&&t},IteratorClose:function(e,t){if("Object"!==this.Type(e))throw new s("Assertion failed: Type(iterator) is not Object");if(!this.IsCallable(t))throw new s("Assertion failed: completion is not a thunk for a Completion Record");var r,n=t,i=this.GetMethod(e,"return");if(void 0===i)return n();try{var o=this.Call(i,e,[])}catch(e){throw r=n(),n=null,e}if(r=n(),n=null,"Object"!==this.Type(o))throw new s("iterator .return must return an object");return r},CreateIterResultObject:function(e,t){if("Boolean"!==this.Type(t))throw new s("Assertion failed: Type(done) is not Boolean");return{value:e,done:t}},RegExpExec:function(e,t){if("Object"!==this.Type(e))throw new s("R must be an Object");if("String"!==this.Type(t))throw new s("S must be a String");var r=this.Get(e,"exec");if(this.IsCallable(r)){var n=this.Call(r,e,[t]);if(null===n||"Object"===this.Type(n))return n;throw new s('"exec" method must return `null` or an Object')}return O(e,t)},ArraySpeciesCreate:function(e,t){if(!this.IsInteger(t)||t<0)throw new s("Assertion failed: length must be an integer >= 0");var r,n=0===t?0:t;if(this.IsArray(e)&&(r=this.Get(e,"constructor"),"Object"===this.Type(r)&&d&&l.species&&null===(r=this.Get(r,l.species))&&(r=void 0)),void 0===r)return f(n);if(!this.IsConstructor(r))throw new s("C must be a constructor");return new r(n)},CreateDataProperty:function(e,t,r){if("Object"!==this.Type(e))throw new s("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(t))throw new s("Assertion failed: IsPropertyKey(P) is not true");var n=R(e,t),i=n||"function"!=typeof M||M(e);if(n&&(!n.writable||!n.configurable)||!i)return!1;var o={configurable:!0,enumerable:!0,value:r,writable:!0};return Object.defineProperty(e,t,o),!0},CreateDataPropertyOrThrow:function(e,t,r){if("Object"!==this.Type(e))throw new s("Assertion failed: Type(O) is not Object");if(!this.IsPropertyKey(t))throw new s("Assertion failed: IsPropertyKey(P) is not true");var n=this.CreateDataProperty(e,t,r);if(!n)throw new s("unable to create data property");return n},ObjectCreate:function(e,t){if(null!==e&&"Object"!==this.Type(e))throw new s("Assertion failed: proto must be null or an object");if((arguments.length<2?[]:t).length>0)throw new a("es-abstract does not yet support internal slots");if(null===e&&!L)throw new a("native Object.create support is required to create null objects");return L(e)},AdvanceStringIndex:function(e,t,r){if("String"!==this.Type(e))throw new s("S must be a String");if(!this.IsInteger(t)||t<0||t>b)throw new s("Assertion failed: length must be an integer >= 0 and <= 2**53");if("Boolean"!==this.Type(r))throw new s("Assertion failed: unicode must be a Boolean");if(!r)return t+1;if(t+1>=e.length)return t+1;var n=B(e,t);if(n<55296||n>56319)return t+1;var i=B(e,t+1);return i<56320||i>57343?t+1:t+2}});delete z.CheckObjectCoercible,e.exports=z},function(e,t,r){"use strict";var n=Array.prototype.slice,i=Object.prototype.toString;e.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==i.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var r,o=n.call(arguments,1),s=Math.max(0,t.length-o.length),a=[],f=0;f1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?t=function(e,t){var r=e[t];if(null!=r){if(!o(r))throw new TypeError(r+" returned for property "+t+" of object "+e+" is not a function");return r}}(e,Symbol.toPrimitive):a(e)&&(t=Symbol.prototype.valueOf)),void 0!==t){var f=t.call(e,r);if(i(f))return f;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(e)||a(e))&&(r="string"),function(e,t){if(null==e)throw new TypeError("Cannot call method on "+e);if("string"!=typeof t||"number"!==t&&"string"!==t)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===t?["toString","valueOf"]:["valueOf","toString"];for(s=0;s>0},ToUint32:function(e){return this.ToNumber(e)>>>0},ToUint16:function(e){var t=this.ToNumber(e);if(a(t)||0===t||!f(t))return 0;var r=u(t)*Math.floor(Math.abs(t));return c(r,65536)},ToString:function(e){return s(e)},ToObject:function(e){return this.CheckObjectCoercible(e),i(e)},CheckObjectCoercible:function(e,t){if(null==e)throw new o(t||"Cannot call method on "+e);return e},IsCallable:h,SameValue:function(e,t){return e===t?0!==e||1/e==1/t:a(e)&&a(t)},Type:function(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":void 0},IsPropertyDescriptor:function(e){if("Object"!==this.Type(e))return!1;var t={"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};for(var r in e)if(p(e,r)&&!t[r])return!1;var n=p(e,"[[Value]]"),i=p(e,"[[Get]]")||p(e,"[[Set]]");if(n&&i)throw new o("Property Descriptors may not be both accessor and data descriptors");return!0},IsAccessorDescriptor:function(e){if(void 0===e)return!1;if(!this.IsPropertyDescriptor(e))throw new o("Desc must be a Property Descriptor");return!(!p(e,"[[Get]]")&&!p(e,"[[Set]]"))},IsDataDescriptor:function(e){if(void 0===e)return!1;if(!this.IsPropertyDescriptor(e))throw new o("Desc must be a Property Descriptor");return!(!p(e,"[[Value]]")&&!p(e,"[[Writable]]"))},IsGenericDescriptor:function(e){if(void 0===e)return!1;if(!this.IsPropertyDescriptor(e))throw new o("Desc must be a Property Descriptor");return!this.IsAccessorDescriptor(e)&&!this.IsDataDescriptor(e)},FromPropertyDescriptor:function(e){if(void 0===e)return e;if(!this.IsPropertyDescriptor(e))throw new o("Desc must be a Property Descriptor");if(this.IsDataDescriptor(e))return{value:e["[[Value]]"],writable:!!e["[[Writable]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};if(this.IsAccessorDescriptor(e))return{get:e["[[Get]]"],set:e["[[Set]]"],enumerable:!!e["[[Enumerable]]"],configurable:!!e["[[Configurable]]"]};throw new o("FromPropertyDescriptor must be called with a fully populated Property Descriptor")},ToPropertyDescriptor:function(e){if("Object"!==this.Type(e))throw new o("ToPropertyDescriptor requires an object");var t={};if(p(e,"enumerable")&&(t["[[Enumerable]]"]=this.ToBoolean(e.enumerable)),p(e,"configurable")&&(t["[[Configurable]]"]=this.ToBoolean(e.configurable)),p(e,"value")&&(t["[[Value]]"]=e.value),p(e,"writable")&&(t["[[Writable]]"]=this.ToBoolean(e.writable)),p(e,"get")){var r=e.get;if(void 0!==r&&!this.IsCallable(r))throw new TypeError("getter must be a function");t["[[Get]]"]=r}if(p(e,"set")){var n=e.set;if(void 0!==n&&!this.IsCallable(n))throw new o("setter must be a function");t["[[Set]]"]=n}if((p(t,"[[Get]]")||p(t,"[[Set]]"))&&(p(t,"[[Value]]")||p(t,"[[Writable]]")))throw new o("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return t}};e.exports=d},function(e,t,r){"use strict";var n=Object.prototype.toString,i=r(96),o=r(51),s=function(e){var t;if((t=arguments.length>1?arguments[1]:"[object Date]"===n.call(e)?String:Number)===String||t===Number){var r,s,a=t===String?["toString","valueOf"]:["valueOf","toString"];for(s=0;s1?s(e,arguments[1]):s(e)}},function(e,t,r){"use strict";var n=r(31),i=RegExp.prototype.exec,o=Object.getOwnPropertyDescriptor,s=Object.prototype.toString,a="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!a)return"[object RegExp]"===s.call(e);var t=o(e,"lastIndex");return!(!t||!n(t,"value"))&&function(e){try{var t=e.lastIndex;return e.lastIndex=0,i.call(e),!0}catch(e){return!1}finally{e.lastIndex=t}}(e)}},function(e,t,r){"use strict";var n=r(103),i=r(94);e.exports=function(){var e=n();return i(Object,{values:e},{values:function(){return Object.values!==e}}),e}},function(e,t,r){"use strict";e.exports=r(12).newBuilder({}).import({package:null,messages:[{name:"DeviceDescriptor",fields:[{rule:"optional",options:{},type:"uint32",name:"vendor_id",id:1},{rule:"optional",options:{},type:"uint32",name:"product_id",id:2},{rule:"optional",options:{},type:"string",name:"serial_number",id:3},{rule:"optional",options:{},type:"string",name:"path",id:4}],enums:[],messages:[],options:{},oneofs:{}},{name:"Configuration",fields:[{rule:"repeated",options:{},type:"string",name:"whitelist_urls",id:1},{rule:"repeated",options:{},type:"string",name:"blacklist_urls",id:2},{rule:"required",options:{},type:"google.protobuf.FileDescriptorSet",name:"wire_protocol",id:3},{rule:"repeated",options:{},type:"DeviceDescriptor",name:"known_devices",id:4},{rule:"optional",options:{},type:"uint32",name:"valid_until",id:5}],enums:[],messages:[],options:{},oneofs:{}}],enums:[],imports:[{package:"google.protobuf",messages:[{name:"FileDescriptorSet",fields:[{rule:"repeated",options:{},type:"FileDescriptorProto",name:"file",id:1}],enums:[],messages:[],options:{},oneofs:{}},{name:"FileDescriptorProto",fields:[{rule:"optional",options:{},type:"string",name:"name",id:1},{rule:"optional",options:{},type:"string",name:"package",id:2},{rule:"repeated",options:{},type:"string",name:"dependency",id:3},{rule:"repeated",options:{},type:"int32",name:"public_dependency",id:10},{rule:"repeated",options:{},type:"int32",name:"weak_dependency",id:11},{rule:"repeated",options:{},type:"DescriptorProto",name:"message_type",id:4},{rule:"repeated",options:{},type:"EnumDescriptorProto",name:"enum_type",id:5},{rule:"repeated",options:{},type:"ServiceDescriptorProto",name:"service",id:6},{rule:"repeated",options:{},type:"FieldDescriptorProto",name:"extension",id:7},{rule:"optional",options:{},type:"FileOptions",name:"options",id:8},{rule:"optional",options:{},type:"SourceCodeInfo",name:"source_code_info",id:9}],enums:[],messages:[],options:{},oneofs:{}},{name:"DescriptorProto",fields:[{rule:"optional",options:{},type:"string",name:"name",id:1},{rule:"repeated",options:{},type:"FieldDescriptorProto",name:"field",id:2},{rule:"repeated",options:{},type:"FieldDescriptorProto",name:"extension",id:6},{rule:"repeated",options:{},type:"DescriptorProto",name:"nested_type",id:3},{rule:"repeated",options:{},type:"EnumDescriptorProto",name:"enum_type",id:4},{rule:"repeated",options:{},type:"ExtensionRange",name:"extension_range",id:5},{rule:"optional",options:{},type:"MessageOptions",name:"options",id:7}],enums:[],messages:[{name:"ExtensionRange",fields:[{rule:"optional",options:{},type:"int32",name:"start",id:1},{rule:"optional",options:{},type:"int32",name:"end",id:2}],enums:[],messages:[],options:{},oneofs:{}}],options:{},oneofs:{}},{name:"FieldDescriptorProto",fields:[{rule:"optional",options:{},type:"string",name:"name",id:1},{rule:"optional",options:{},type:"int32",name:"number",id:3},{rule:"optional",options:{},type:"Label",name:"label",id:4},{rule:"optional",options:{},type:"Type",name:"type",id:5},{rule:"optional",options:{},type:"string",name:"type_name",id:6},{rule:"optional",options:{},type:"string",name:"extendee",id:2},{rule:"optional",options:{},type:"string",name:"default_value",id:7},{rule:"optional",options:{},type:"FieldOptions",name:"options",id:8}],enums:[{name:"Type",values:[{name:"TYPE_DOUBLE",id:1},{name:"TYPE_FLOAT",id:2},{name:"TYPE_INT64",id:3},{name:"TYPE_UINT64",id:4},{name:"TYPE_INT32",id:5},{name:"TYPE_FIXED64",id:6},{name:"TYPE_FIXED32",id:7},{name:"TYPE_BOOL",id:8},{name:"TYPE_STRING",id:9},{name:"TYPE_GROUP",id:10},{name:"TYPE_MESSAGE",id:11},{name:"TYPE_BYTES",id:12},{name:"TYPE_UINT32",id:13},{name:"TYPE_ENUM",id:14},{name:"TYPE_SFIXED32",id:15},{name:"TYPE_SFIXED64",id:16},{name:"TYPE_SINT32",id:17},{name:"TYPE_SINT64",id:18}],options:{}},{name:"Label",values:[{name:"LABEL_OPTIONAL",id:1},{name:"LABEL_REQUIRED",id:2},{name:"LABEL_REPEATED",id:3}],options:{}}],messages:[],options:{},oneofs:{}},{name:"EnumDescriptorProto",fields:[{rule:"optional",options:{},type:"string",name:"name",id:1},{rule:"repeated",options:{},type:"EnumValueDescriptorProto",name:"value",id:2},{rule:"optional",options:{},type:"EnumOptions",name:"options",id:3}],enums:[],messages:[],options:{},oneofs:{}},{name:"EnumValueDescriptorProto",fields:[{rule:"optional",options:{},type:"string",name:"name",id:1},{rule:"optional",options:{},type:"int32",name:"number",id:2},{rule:"optional",options:{},type:"EnumValueOptions",name:"options",id:3}],enums:[],messages:[],options:{},oneofs:{}},{name:"ServiceDescriptorProto",fields:[{rule:"optional",options:{},type:"string",name:"name",id:1},{rule:"repeated",options:{},type:"MethodDescriptorProto",name:"method",id:2},{rule:"optional",options:{},type:"ServiceOptions",name:"options",id:3}],enums:[],messages:[],options:{},oneofs:{}},{name:"MethodDescriptorProto",fields:[{rule:"optional",options:{},type:"string",name:"name",id:1},{rule:"optional",options:{},type:"string",name:"input_type",id:2},{rule:"optional",options:{},type:"string",name:"output_type",id:3},{rule:"optional",options:{},type:"MethodOptions",name:"options",id:4}],enums:[],messages:[],options:{},oneofs:{}},{name:"FileOptions",fields:[{rule:"optional",options:{},type:"string",name:"java_package",id:1},{rule:"optional",options:{},type:"string",name:"java_outer_classname",id:8},{rule:"optional",options:{default:!1},type:"bool",name:"java_multiple_files",id:10},{rule:"optional",options:{default:!1},type:"bool",name:"java_generate_equals_and_hash",id:20},{rule:"optional",options:{default:"SPEED"},type:"OptimizeMode",name:"optimize_for",id:9},{rule:"optional",options:{},type:"string",name:"go_package",id:11},{rule:"optional",options:{default:!1},type:"bool",name:"cc_generic_services",id:16},{rule:"optional",options:{default:!1},type:"bool",name:"java_generic_services",id:17},{rule:"optional",options:{default:!1},type:"bool",name:"py_generic_services",id:18},{rule:"repeated",options:{},type:"UninterpretedOption",name:"uninterpreted_option",id:999}],enums:[{name:"OptimizeMode",values:[{name:"SPEED",id:1},{name:"CODE_SIZE",id:2},{name:"LITE_RUNTIME",id:3}],options:{}}],messages:[],options:{},oneofs:{},extensions:[1e3,536870911]},{name:"MessageOptions",fields:[{rule:"optional",options:{default:!1},type:"bool",name:"message_set_wire_format",id:1},{rule:"optional",options:{default:!1},type:"bool",name:"no_standard_descriptor_accessor",id:2},{rule:"repeated",options:{},type:"UninterpretedOption",name:"uninterpreted_option",id:999}],enums:[],messages:[],options:{},oneofs:{},extensions:[1e3,536870911]},{name:"FieldOptions",fields:[{rule:"optional",options:{default:"STRING"},type:"CType",name:"ctype",id:1},{rule:"optional",options:{},type:"bool",name:"packed",id:2},{rule:"optional",options:{default:!1},type:"bool",name:"lazy",id:5},{rule:"optional",options:{default:!1},type:"bool",name:"deprecated",id:3},{rule:"optional",options:{},type:"string",name:"experimental_map_key",id:9},{rule:"optional",options:{default:!1},type:"bool",name:"weak",id:10},{rule:"repeated",options:{},type:"UninterpretedOption",name:"uninterpreted_option",id:999}],enums:[{name:"CType",values:[{name:"STRING",id:0},{name:"CORD",id:1},{name:"STRING_PIECE",id:2}],options:{}}],messages:[],options:{},oneofs:{},extensions:[1e3,536870911]},{name:"EnumOptions",fields:[{rule:"optional",options:{default:!0},type:"bool",name:"allow_alias",id:2},{rule:"repeated",options:{},type:"UninterpretedOption",name:"uninterpreted_option",id:999}],enums:[],messages:[],options:{},oneofs:{},extensions:[1e3,536870911]},{name:"EnumValueOptions",fields:[{rule:"repeated",options:{},type:"UninterpretedOption",name:"uninterpreted_option",id:999}],enums:[],messages:[],options:{},oneofs:{},extensions:[1e3,536870911]},{name:"ServiceOptions",fields:[{rule:"repeated",options:{},type:"UninterpretedOption",name:"uninterpreted_option",id:999}],enums:[],messages:[],options:{},oneofs:{},extensions:[1e3,536870911]},{name:"MethodOptions",fields:[{rule:"repeated",options:{},type:"UninterpretedOption",name:"uninterpreted_option",id:999}],enums:[],messages:[],options:{},oneofs:{},extensions:[1e3,536870911]},{name:"UninterpretedOption",fields:[{rule:"repeated",options:{},type:"NamePart",name:"name",id:2},{rule:"optional",options:{},type:"string",name:"identifier_value",id:3},{rule:"optional",options:{},type:"uint64",name:"positive_int_value",id:4},{rule:"optional",options:{},type:"int64",name:"negative_int_value",id:5},{rule:"optional",options:{},type:"double",name:"double_value",id:6},{rule:"optional",options:{},type:"bytes",name:"string_value",id:7},{rule:"optional",options:{},type:"string",name:"aggregate_value",id:8}],enums:[],messages:[{name:"NamePart",fields:[{rule:"required",options:{},type:"string",name:"name_part",id:1},{rule:"required",options:{},type:"bool",name:"is_extension",id:2}],enums:[],messages:[],options:{},oneofs:{}}],options:{},oneofs:{}},{name:"SourceCodeInfo",fields:[{rule:"repeated",options:{},type:"Location",name:"location",id:1}],enums:[],messages:[{name:"Location",fields:[{rule:"repeated",options:{packed:!0},type:"int32",name:"path",id:1},{rule:"repeated",options:{packed:!0},type:"int32",name:"span",id:2},{rule:"optional",options:{},type:"string",name:"leading_comments",id:3},{rule:"optional",options:{},type:"string",name:"trailing_comments",id:4}],enums:[],messages:[],options:{},oneofs:{}}],options:{},oneofs:{}}],enums:[],imports:[],options:{java_package:"com.google.protobuf",java_outer_classname:"DescriptorProtos",optimize_for:"SPEED"},services:[]}],options:{},services:[]}).build()},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MessageDecoder=void 0;var n=function(){function e(e,t){for(var r=0;rt.path?1:0:parseInt(e.path)-parseInt(t.path)}var w=(y((i=function(){function e(t,r){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="LowlevelTransportWithSharedConnections",this.debug=!1,this.deferedDebugOnRelease={},this.deferedNormalOnRelease={},this.configured=!1,this.stopped=!1,this._lastStringified="",this.requestNeeded=!1,this.latestId=0,this.defereds={},this.isOutdated=!1,this.plugin=t,this.version=t.version,this._sharedWorkerFactory=r,!this.plugin.allowsWriteAndEnumerate)throw new Error("Plugin with shared connections cannot disallow write and enumerate")}return a(e,[{key:"enumerate",value:function(){return this._silentEnumerate()}},{key:"_silentEnumerate",value:function(){var e=g(s.default.mark(function e(){var t,r,n,i,o;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendToWorker({type:"enumerate-intent"});case 2:return t=[],e.prev=3,e.next=6,this.plugin.enumerate();case 6:t=e.sent;case 7:return e.prev=7,e.next=10,this.sendToWorker({type:"enumerate-done"});case 10:return e.finish(7);case 11:return e.next=13,this.sendToWorker({type:"get-sessions-and-disconnect",devices:t});case 13:if("sessions"===(r=e.sent).type){e.next=16;break}throw new Error("Wrong reply");case 16:return n=r.debugSessions,i=r.normalSessions,o=t.map(function(e){var t=i[e.path],r=n[e.path];return{path:e.path,session:t,debug:e.debug,debugSession:r}}),this._releaseDisconnected(o),e.abrupt("return",o.sort(m));case 21:case"end":return e.stop()}},e,this,[[3,,7,11]])}));return function(){return e.apply(this,arguments)}}()},{key:"_releaseDisconnected",value:function(e){var t=this,r={};e.forEach(function(e){null!=e.session&&(r[e.session]=!0)}),Object.keys(this.deferedDebugOnRelease).forEach(function(e){null==r[e]&&t._releaseCleanup(e,!0)}),Object.keys(this.deferedNormalOnRelease).forEach(function(e){null==r[e]&&t._releaseCleanup(e,!1)})}},{key:"listen",value:function(){var e=g(s.default.mark(function e(t){var r,n;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=v(t),n=null==t?this._lastStringified:r,e.abrupt("return",this._runIter(0,n));case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_runIter",value:function(){var e=g(s.default.mark(function e(t,r){var n,i;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._silentEnumerate();case 2:if(n=e.sent,(i=v(n))===r&&60!==t){e.next=7;break}return this._lastStringified=i,e.abrupt("return",n);case 7:return e.next=9,(0,u.resolveTimeoutPromise)(500,null);case 9:return e.abrupt("return",this._runIter(t+1,i));case 10:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"acquire",value:function(){var e=g(s.default.mark(function e(t,r){var n,i,o,a;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendToWorker({type:"acquire-intent",path:t.path,previous:t.previous,debug:r});case 2:if("wrong-previous-session"!==(n=e.sent).type){e.next=5;break}throw new Error("wrong previous session");case 5:if("other-session"===n.type){e.next=7;break}throw new Error("Strange reply");case 7:return i=null==n.otherSession,e.prev=8,e.next=11,this.plugin.connect(t.path,r,i);case 11:e.next=18;break;case 13:return e.prev=13,e.t0=e.catch(8),e.next=17,this.sendToWorker({type:"acquire-failed"});case 17:throw e.t0;case 18:return e.next=20,this.sendToWorker({type:"acquire-done"});case 20:if("session-number"===(o=e.sent).type){e.next=23;break}throw new Error("Strange reply.");case 23:return a=o.number,r?this.deferedDebugOnRelease[a]=(0,u.create)():this.deferedNormalOnRelease[a]=(0,u.create)(),e.abrupt("return",a);case 26:case"end":return e.stop()}},e,this,[[8,13]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"release",value:function(){var e=g(s.default.mark(function e(t,r,n){var i,o,a,f;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!r||n){e.next=3;break}return this.sendToWorker({type:"release-onclose",session:t}),e.abrupt("return");case 3:return e.next=5,this.sendToWorker({type:"release-intent",session:t,debug:n});case 5:if("double-release"!==(i=e.sent).type){e.next=8;break}throw new Error("Trying to double release.");case 8:if("path"===i.type){e.next=10;break}throw new Error("Strange reply.");case 10:return o=i.path,a=i.otherSession,f=null==a,this._releaseCleanup(t,n),e.prev=14,e.next=17,this.plugin.disconnect(o,n,f);case 17:e.next=21;break;case 19:e.prev=19,e.t0=e.catch(14);case 21:return e.next=23,this.sendToWorker({type:"release-done"});case 23:case"end":return e.stop()}},e,this,[[14,19]])}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"_releaseCleanup",value:function(e,t){var r=t?this.deferedDebugOnRelease:this.deferedNormalOnRelease;null!=r[e]&&(r[e].reject(new Error("Device released or disconnected")),delete r[e])}},{key:"configure",value:function(){var e=g(s.default.mark(function e(t){var r;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:r=(0,c.parseConfigure)(t),this._messages=r,this.configured=!0;case 3:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"_sendLowlevel",value:function(e,t){var r=this;return function(n){return r.plugin.send(e,n,t)}}},{key:"_receiveLowlevel",value:function(e,t){var r=this;return function(){return r.plugin.receive(e,t)}}},{key:"messages",value:function(){if(null==this._messages)throw new Error("Transport not configured.");return this._messages}},{key:"doWithSession",value:function(){var e=g(s.default.mark(function e(t,r,n){var i,o,a,f,u,c;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.sendToWorker({type:"get-sessions"});case 2:if("sessions"===(i=e.sent).type){e.next=5;break}throw new Error("Wrong reply");case 5:if(o=r?i.debugSessions:i.normalSessions,a=null,Object.keys(o).forEach(function(e){o[e]===t&&(a=e)}),null!=a){e.next=10;break}throw new Error("Session not available.");case 10:return f=a,e.next=13,n(f);case 13:return u=e.sent,c=r?this.deferedDebugOnRelease[t]:this.deferedNormalOnRelease[t],e.abrupt("return",Promise.race([c.rejectingPromise,u]));case 16:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"call",value:function(){var e=g(s.default.mark(function e(t,r,n,i){var o,a=this;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(){var e=g(s.default.mark(function e(t){var o,f;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.messages(),e.next=3,(0,h.buildAndSend)(o,a._sendLowlevel(t,i),r,n);case 3:return e.next=5,(0,l.receiveAndParse)(o,a._receiveLowlevel(t,i));case 5:return f=e.sent,e.abrupt("return",f);case 7:case"end":return e.stop()}},e,a)}));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",this.doWithSession(t,i,o));case 2:case"end":return e.stop()}},e,this)}));return function(t,r,n,i){return e.apply(this,arguments)}}()},{key:"post",value:function(){var e=g(s.default.mark(function e(t,r,n,i){var o,a=this;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=function(){var e=g(s.default.mark(function e(t){var o;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=a.messages(),e.next=3,(0,h.buildAndSend)(o,a._sendLowlevel(t,i),r,n);case 3:case"end":return e.stop()}},e,a)}));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",this.doWithSession(t,i,o));case 2:case"end":return e.stop()}},e,this)}));return function(t,r,n,i){return e.apply(this,arguments)}}()},{key:"read",value:function(){var e=g(s.default.mark(function e(t,r){var n,i=this;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=function(){var e=g(s.default.mark(function e(t){var n,o;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=i.messages(),e.next=3,(0,l.receiveAndParse)(n,i._receiveLowlevel(t,r));case 3:return o=e.sent,e.abrupt("return",o);case 5:case"end":return e.stop()}},e,i)}));return function(t){return e.apply(this,arguments)}}(),e.abrupt("return",this.doWithSession(t,r,n));case 2:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}()},{key:"init",value:function(){var e=g(s.default.mark(function e(t){var r=this;return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.debug=!!t,this.requestNeeded=this.plugin.requestNeeded,e.next=4,this.plugin.init(t);case 4:null!=this._sharedWorkerFactory&&(this.sharedWorker=this._sharedWorkerFactory(),null!=this.sharedWorker&&(this.sharedWorker.port.onmessage=function(e){r.receiveFromWorker(e.data)}));case 5:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"requestDevice",value:function(){var e=g(s.default.mark(function e(){return s.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.plugin.requestDevice());case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"sendToWorker",value:function(e){var t=this;if(this.stopped)return Promise.reject("Transport stopped.");this.latestId++;var r=this.latestId;return this.defereds[r]=(0,u.create)(),null!=this.sharedWorker?this.sharedWorker.port.postMessage({id:r,message:e}):(0,d.postModuleMessage)({id:r,message:e},function(e){return t.receiveFromWorker(e)}),this.defereds[r].promise}},{key:"receiveFromWorker",value:function(e){this.defereds[e.id].resolve(e.message),delete this.defereds[e.id]}},{key:"setBridgeLatestUrl",value:function(e){}},{key:"stop",value:function(){this.stopped=!0,this.sharedWorker=null}}]),e}()).prototype,"enumerate",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"enumerate"),i.prototype),y(i.prototype,"listen",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"listen"),i.prototype),y(i.prototype,"acquire",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"acquire"),i.prototype),y(i.prototype,"release",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"release"),i.prototype),y(i.prototype,"configure",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"configure"),i.prototype),y(i.prototype,"call",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"call"),i.prototype),y(i.prototype,"post",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"post"),i.prototype),y(i.prototype,"read",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"read"),i.prototype),y(i.prototype,"init",[p.debugInOut],Object.getOwnPropertyDescriptor(i.prototype,"init"),i.prototype),i);t.default=w,e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.patch=function(){o||(n.Reflect.Message.Field.prototype.verifyValueOriginal=n.Reflect.Message.Field.prototype.verifyValue,n.Reflect.Message.Field.prototype.verifyValue=function(e,t){var r=e;return this.type===n.TYPES.bytes&&null!=e&&"string"==typeof e&&(r=i.wrap(e,"hex")),this.verifyValueOriginal(r,t)});o=!0};var n=function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}(r(12));var i=n.ByteBuffer,o=!1},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.postModuleMessage=function(e,t){var r=e.id,n=e.message;l({id:r,message:n},{postMessage:t})};var n=r(105);"undefined"!=typeof onconnect&&(onconnect=function(e){var t=e.ports[0];t.onmessage=function(e){l(e.data,t)}});var i={},o={},s=null,a=Promise.resolve();function f(){var e=(0,n.create)();s=e,setTimeout(function(){return e.reject(new Error("Timed out"))},1e4)}function u(e){null!=s&&s.resolve(e)}function c(){return null==s?Promise.reject(new Error("???")):s.promise}function h(e){var t=a.then(function(){return e()});a=t.catch(function(){})}function l(e,t){var r=e.id,n=e.message;if("acquire-intent"===n.type){var s=n.path,a=n.previous,l=n.debug;h(function(){return function(e,t,r,n,s){var a=!1,u=r?o:i,h=r?i:o,l=u[e];a=null==l?null!=t:t!==l;return a?(y({type:"wrong-previous-session"},n,s),Promise.resolve()):(f(),y({type:"other-session",otherSession:h[e]},n,s),c().then(function(t){if(t.good){var n=(++g).toString();r&&(n="debug"+n),u[e]=n,y({type:"session-number",number:n},t.id,s)}else y({type:"ok"},t.id,s)}))}(s,a,l,r,t)})}if("acquire-done"===n.type&&function(e){u({good:!0,id:e})}(r),"acquire-failed"===n.type&&function(e){u({good:!1,id:e})}(r),"get-sessions"===n.type&&h(function(){return d(r,t)}),"get-sessions-and-disconnect"===n.type){var b=n.devices;h(function(){return d(r,t,b)})}if("release-onclose"===n.type){var v=n.session;h(function(){return function(e){var t=null;if(Object.keys(i).forEach(function(r){i[r]===e&&(t=r)}),null==t)return Promise.resolve();var r=t;return delete i[r],delete o[r],Promise.resolve()}(v)})}if("release-intent"===n.type){var m=n.session,w=n.debug;h(function(){return function(e,t,r,n){var s=null,a=t?o:i,u=t?i:o;if(Object.keys(a).forEach(function(t){a[t]===e&&(s=t)}),null==s)return y({type:"double-release"},r,n),Promise.resolve();var h=s,l=u[h];return f(),y({type:"path",path:h,otherSession:l},r,n),c().then(function(e){delete a[h],y({type:"ok"},e.id,n)})}(m,w,r,t)})}"release-done"===n.type&&p(r),"enumerate-intent"===n.type&&h(function(){return function(e,t){return f(),y({type:"ok"},e,t),c().then(function(e){y({type:"ok"},e.id,t)})}(r,t)}),"enumerate-done"===n.type&&p(r)}function p(e){u({id:e})}function d(e,t,r){if(null!=r){var n={};r.forEach(function(e){n[e.path]=!0}),Object.keys(i).forEach(function(e){i[e]||delete i[e]}),Object.keys(o).forEach(function(e){o[e]||delete o[e]})}return y({type:"sessions",debugSessions:o,normalSessions:i},e,t),Promise.resolve()}var g=0;function y(e,t,r){r.postMessage({id:t,message:e})}},function(e,t,r){var n="undefined"!=typeof JSON?JSON:r(216);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var s,a="boolean"==typeof t.cycles&&t.cycles,f=t.replacer||function(e,t){return t},u=t.cmp&&(s=t.cmp,function(e){return function(t,r){var n={key:t,value:e[t]},i={key:r,value:e[r]};return s(n,i)}}),c=[];return function e(t,s,h,l){var p=r?"\n"+new Array(l+1).join(r):"",d=r?": ":":";if(h&&h.toJSON&&"function"==typeof h.toJSON&&(h=h.toJSON()),void 0!==(h=f.call(t,s,h))){if("object"!=typeof h||null===h)return n.stringify(h);if(i(h)){for(var g=[],y=0;y="0"&&n<="9";)t+=n,f();if("."===n)for(t+=".";f()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,f(),"-"!==n&&"+"!==n||(t+=n,f());n>="0"&&n<="9";)t+=n,f();if(e=+t,isFinite(e))return e;a("Bad number")},c=function(){var e,t,r,i="";if('"'===n)for(;f();){if('"'===n)return f(),i;if("\\"===n)if(f(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(f(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof s[n])break;i+=s[n]}else i+=n}a("Bad string")},h=function(){for(;n&&n<=" ";)f()};o=function(){switch(h(),n){case"{":return function(){var e,t={};if("{"===n){if(f("{"),h(),"}"===n)return f("}"),t;for(;n;){if(e=c(),h(),f(":"),Object.hasOwnProperty.call(t,e)&&a('Duplicate key "'+e+'"'),t[e]=o(),h(),"}"===n)return f("}"),t;f(","),h()}}a("Bad object")}();case"[":return function(){var e=[];if("["===n){if(f("["),h(),"]"===n)return f("]"),e;for(;n;){if(e.push(o()),h(),"]"===n)return f("]"),e;f(","),h()}}a("Bad array")}();case'"':return c();case"-":return u();default:return n>="0"&&n<="9"?u():function(){switch(n){case"t":return f("t"),f("r"),f("u"),f("e"),!0;case"f":return f("f"),f("a"),f("l"),f("s"),f("e"),!1;case"n":return f("n"),f("u"),f("l"),f("l"),null}a("Unexpected '"+n+"'")}()}},e.exports=function(e,t){var s;return i=e,r=0,n=" ",s=o(),h(),n&&a("Syntax error"),"function"==typeof t?function e(r,n){var i,o,s=r[n];if(s&&"object"==typeof s)for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&(void 0!==(o=e(s,i))?s[i]=o:delete s[i]);return t.call(r,n,s)}({"":s},""):s}},function(e,t){var r,n,i,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,s={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function a(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,function(e){var t=s[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}e.exports=function(e,t,o){var s;if(r="",n="","number"==typeof o)for(s=0;s0,a!==this.unreadableHidDevice&&this.unreadableHidDeviceChange.emit("change"),e.abrupt("return",this._lastDevices);case 12:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"enumerate",value:function(){var e=c(i.default.mark(function e(){return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._listDevices();case 2:return e.t0=function(e){return{path:e.path,debug:e.debug}},e.abrupt("return",e.sent.map(e.t0));case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"_findDevice",value:function(){var e=c(i.default.mark(function e(t){var r;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=this._lastDevices.find(function(e){return e.path===t}))){e.next=3;break}throw new Error("Action was interrupted.");case 3:return e.abrupt("return",r.device);case 4:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=c(i.default.mark(function e(t,r,n){var o,s,a;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._findDevice(t);case 2:if(o=e.sent,(s=new Uint8Array(64))[0]=63,s.set(new Uint8Array(r),1),o.opened){e.next=9;break}return e.next=9,this.connect(t,n,!1);case 9:return a=n?this.debugEndpointId:this.normalEndpointId,e.abrupt("return",o.transferOut(a,s).then(function(){}));case 11:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"receive",value:function(){var e=c(i.default.mark(function e(t,r){var n,o,s;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._findDevice(t);case 2:if(n=e.sent,o=r?this.debugEndpointId:this.normalEndpointId,e.prev=4,n.opened){e.next=8;break}return e.next=8,this.connect(t,r,!1);case 8:return e.next=10,n.transferIn(o,64);case 10:if(0!==(s=e.sent).data.byteLength){e.next=13;break}return e.abrupt("return",this.receive(t,r));case 13:return e.abrupt("return",s.data.buffer.slice(1));case 16:if(e.prev=16,e.t0=e.catch(4),"Device unavailable."!==e.t0.message){e.next=22;break}throw new Error("Action was interrupted.");case 22:throw e.t0;case 23:case"end":return e.stop()}},e,this,[[4,16]])}));return function(t,r){return e.apply(this,arguments)}}()},{key:"connect",value:function(){var e=c(i.default.mark(function e(t,r,n){var s,a,f,u=this;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:s=i.default.mark(function e(o){return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(o>0)){e.next=3;break}return e.next=3,new Promise(function(e){return setTimeout(function(){return e()},200*o)});case 3:return e.prev=3,e.next=6,u._connectIn(t,r,n);case 6:return e.t0=e.sent,e.abrupt("return",{v:e.t0});case 10:if(e.prev=10,e.t1=e.catch(3),4!==o){e.next=14;break}throw e.t1;case 14:case"end":return e.stop()}},e,u,[[3,10]])}),a=0;case 2:if(!(a<5)){e.next=10;break}return e.delegateYield(s(a),"t0",4);case 4:if("object"!==(void 0===(f=e.t0)?"undefined":o(f))){e.next=7;break}return e.abrupt("return",f.v);case 7:a++,e.next=2;break;case 10:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"_connectIn",value:function(){var e=c(i.default.mark(function e(t,r,n){var o,s;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._findDevice(t);case 2:return o=e.sent,e.next=5,o.open();case 5:if(!n){e.next=10;break}return e.next=8,o.selectConfiguration(this.configurationId);case 8:return e.next=10,o.reset();case 10:return s=r?this.debugInterfaceId:this.normalInterfaceId,e.next=13,o.claimInterface(s);case 13:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(){var e=c(i.default.mark(function e(t,r,n){var o,s;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._findDevice(t);case 2:return o=e.sent,s=r?this.debugInterfaceId:this.normalInterfaceId,e.next=6,o.releaseInterface(s);case 6:if(!n){e.next=9;break}return e.next=9,o.close();case 9:case"end":return e.stop()}},e,this)}));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"requestDevice",value:function(){var e=c(i.default.mark(function e(){return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.usb.requestDevice({filters:l});case 2:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()}]),e}()).prototype,"init",[f.debugInOut],Object.getOwnPropertyDescriptor(n.prototype,"init"),n.prototype),h(n.prototype,"connect",[f.debugInOut],Object.getOwnPropertyDescriptor(n.prototype,"connect"),n.prototype),h(n.prototype,"disconnect",[f.debugInOut],Object.getOwnPropertyDescriptor(n.prototype,"disconnect"),n.prototype),n);t.default=v,e.exports=t.default},function(e,t,r){(function(t,n){r(26).parse;var i=r(26).resolve,o=r(52),s=r(231),a=r(232),f=r(21),u=r(53),c=r(264),h=r(55),l=r(265),p=r(112);function d(e,r){if(!(this instanceof d))return new d(e,r);if(!d.Promise)throw new Error("native promise missing, set Fetch.Promise to your favorite alternative");u.Promise=d.Promise;var n=this;return new d.Promise(function(u,g){var y,b=new l(e,r);if(!b.protocol||!b.hostname)throw new Error("only absolute urls are supported");if("http:"!==b.protocol&&"https:"!==b.protocol)throw new Error("only http(s) protocols are supported");y="https:"===b.protocol?s.request:o.request;var v=new h(b.headers);b.compress&&v.set("accept-encoding","gzip,deflate"),v.has("user-agent")||v.set("user-agent","node-fetch/1.0 (+https://github.com/bitinn/node-fetch)"),v.has("connection")||b.agent||v.set("connection","close"),v.has("accept")||v.set("accept","*/*"),!v.has("content-type")&&b.body&&"function"==typeof b.body.getBoundary&&v.set("content-type","multipart/form-data; boundary="+b.body.getBoundary()),!v.has("content-length")&&/post|put|patch|delete/i.test(b.method)&&("string"==typeof b.body?v.set("content-length",t.byteLength(b.body)):b.body&&"function"==typeof b.body.getLengthSync?b.body._lengthRetrievers&&0==b.body._lengthRetrievers.length?v.set("content-length",b.body.getLengthSync().toString()):b.body.hasKnownLength&&b.body.hasKnownLength()&&v.set("content-length",b.body.getLengthSync().toString()):void 0!==b.body&&null!==b.body||v.set("content-length","0")),b.headers=v.raw(),b.headers.host&&(b.headers.host=b.headers.host[0]);var m,w=y(b);b.timeout&&w.once("socket",function(e){m=setTimeout(function(){w.abort(),g(new p("network timeout at: "+b.url,"request-timeout"))},b.timeout)}),w.on("error",function(e){clearTimeout(m),g(new p("request to "+b.url+" failed, reason: "+e.message,"system",e))}),w.on("response",function(e){if(clearTimeout(m),n.isRedirect(e.statusCode)&&"manual"!==b.redirect)return"error"===b.redirect?void g(new p("redirect mode is set to error: "+b.url,"no-redirect")):b.counter>=b.follow?void g(new p("maximum redirect reached at: "+b.url,"max-redirect")):e.headers.location?(303!==e.statusCode&&(301!==e.statusCode&&302!==e.statusCode||"POST"!==b.method)||(b.method="GET",delete b.body,delete b.headers["content-length"]),b.counter++,void u(d(i(b.url,e.headers.location),b))):void g(new p("redirect location header missing at: "+b.url,"invalid-redirect"));var t=new h(e.headers);"manual"===b.redirect&&t.has("location")&&t.set("location",i(b.url,t.get("location")));var r,o=e.pipe(new f.PassThrough),s={url:b.url,status:e.statusCode,statusText:e.statusMessage,headers:t,size:b.size,timeout:b.timeout};if(!b.compress||"HEAD"===b.method||!t.has("content-encoding")||204===e.statusCode||304===e.statusCode)return r=new c(o,s),void u(r);var l=t.get("content-encoding");if("gzip"==l||"x-gzip"==l)return o=o.pipe(a.createGunzip()),r=new c(o,s),void u(r);"deflate"!=l&&"x-deflate"!=l?(r=new c(o,s),u(r)):e.pipe(new f.PassThrough).once("data",function(e){o=8==(15&e[0])?o.pipe(a.createInflate()):o.pipe(a.createInflateRaw()),r=new c(o,s),u(r)})}),"string"==typeof b.body?(w.write(b.body),w.end()):b.body instanceof t?(w.write(b.body),w.end()):"object"==typeof b.body&&b.body.pipe?b.body.pipe(w):"object"==typeof b.body?(w.write(b.body.toString()),w.end()):w.end()})}e.exports=d,e.exports.default=e.exports,d.prototype.isRedirect=function(e){return 301===e||302===e||303===e||307===e||308===e},d.Promise=n.Promise,d.Response=c,d.Headers=h,d.Request=l}).call(this,r(1).Buffer,r(5))},function(e,t,r){(function(e,n){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */!function(o){t&&t.nodeType,e&&e.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,f=2147483647,u=36,c=1,h=26,l=38,p=700,d=72,g=128,y="-",b=/^xn--/,v=/[^\x20-\x7E]/,m=/[\x2E\u3002\uFF0E\uFF61]/g,w={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},_=u-c,E=Math.floor,A=String.fromCharCode;function I(e){throw new RangeError(w[e])}function S(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function T(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+S((e=e.replace(m,".")).split("."),t).join(".")}function C(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i65535&&(t+=A((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=A(e)}).join("")}function P(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function k(e,t,r){var n=0;for(e=r?E(e/p):e>>1,e+=E(e/t);e>_*h>>1;n+=u)e=E(e/_);return E(n+(_+1)*e/(e+l))}function x(e){var t,r,n,i,o,s,a,l,p,b,v,m=[],w=e.length,_=0,A=g,S=d;for((r=e.lastIndexOf(y))<0&&(r=0),n=0;n=128&&I("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i=w&&I("invalid-input"),((l=(v=e.charCodeAt(i++))-48<10?v-22:v-65<26?v-65:v-97<26?v-97:u)>=u||l>E((f-_)/s))&&I("overflow"),_+=l*s,!(l<(p=a<=S?c:a>=S+h?h:a-S));a+=u)s>E(f/(b=u-p))&&I("overflow"),s*=b;S=k(_-o,t=m.length+1,0==o),E(_/t)>f-A&&I("overflow"),A+=E(_/t),_%=t,m.splice(_++,0,A)}return O(m)}function B(e){var t,r,n,i,o,s,a,l,p,b,v,m,w,_,S,T=[];for(m=(e=C(e)).length,t=g,r=0,o=d,s=0;s=t&&vE((f-r)/(w=n+1))&&I("overflow"),r+=(a-t)*w,t=a,s=0;sf&&I("overflow"),v==t){for(l=r,p=u;!(l<(b=p<=o?c:p>=o+h?h:p-o));p+=u)S=l-b,_=u-b,T.push(A(P(b+S%_,0))),l=E(S/_);T.push(A(P(l,0))),o=k(r,w,n==i),r=0,++n}++r,++t}return T.join("")}a={version:"1.4.1",ucs2:{decode:C,encode:O},decode:x,encode:B,toASCII:function(e){return T(e,function(e){return v.test(e)?"xn--"+B(e):e})},toUnicode:function(e){return T(e,function(e){return b.test(e)?x(e.slice(4).toLowerCase()):e})}},void 0===(i=function(){return a}.call(t,r,t,e))||(e.exports=i)}()}).call(this,r(84)(e),r(5))},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(225),t.encode=t.stringify=r(226)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){t=t||"&",r=r||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var f=1e3;o&&"number"==typeof o.maxKeys&&(f=o.maxKeys);var u=e.length;f>0&&u>f&&(u=f);for(var c=0;c=0?(h=g.substr(0,y),l=g.substr(y+1)):(h=g,l=""),p=decodeURIComponent(h),d=decodeURIComponent(l),n(s,p)?i(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,a){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(s(e),function(s){var a=encodeURIComponent(n(s))+r;return i(e[s])?o(e[s],function(e){return a+encodeURIComponent(n(e))}).join(t):a+encodeURIComponent(n(e[s]))}).join(t):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n=f?s=new RangeError(u):t=n.concat(i,o),i=[],e.close(),r(s,t)}e.on("error",function(t){e.removeListener("end",a),e.removeListener("readable",s),r(t)}),e.on("end",a),e.end(t),s()}function v(e,t){if("string"==typeof t&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function m(e){if(!(this instanceof m))return new m(e);C.call(this,e,o.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);C.call(this,e,o.INFLATE)}function _(e){if(!(this instanceof _))return new _(e);C.call(this,e,o.GZIP)}function E(e){if(!(this instanceof E))return new E(e);C.call(this,e,o.GUNZIP)}function A(e){if(!(this instanceof A))return new A(e);C.call(this,e,o.DEFLATERAW)}function I(e){if(!(this instanceof I))return new I(e);C.call(this,e,o.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);C.call(this,e,o.UNZIP)}function T(e){return e===o.Z_NO_FLUSH||e===o.Z_PARTIAL_FLUSH||e===o.Z_SYNC_FLUSH||e===o.Z_FULL_FLUSH||e===o.Z_FINISH||e===o.Z_BLOCK}function C(e,r){var s=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,i.call(this,e),e.flush&&!T(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!T(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:o.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!n.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(r);var a=this;this._hadError=!1,this._handle.onerror=function(e,r){O(a),a._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],a.emit("error",n)};var f=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(f=e.level);var u=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(u=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,f,e.memLevel||t.Z_DEFAULT_MEMLEVEL,u,e.dictionary),this._buffer=n.allocUnsafe(this._chunkSize),this._offset=0,this._level=f,this._strategy=u,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!s._handle},configurable:!0,enumerable:!0})}function O(t,r){r&&e.nextTick(r),t._handle&&(t._handle.close(),t._handle=null)}function P(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(p),writable:!1}),t.Deflate=m,t.Inflate=w,t.Gzip=_,t.Gunzip=E,t.DeflateRaw=A,t.InflateRaw=I,t.Unzip=S,t.createDeflate=function(e){return new m(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new A(e)},t.createInflateRaw=function(e){return new I(e)},t.createGzip=function(e){return new _(e)},t.createGunzip=function(e){return new E(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new m(t),e,r)},t.deflateSync=function(e,t){return v(new m(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new _(t),e,r)},t.gzipSync=function(e,t){return v(new _(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new A(t),e,r)},t.deflateRawSync=function(e,t){return v(new A(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new S(t),e,r)},t.unzipSync=function(e,t){return v(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new w(t),e,r)},t.inflateSync=function(e,t){return v(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new E(t),e,r)},t.gunzipSync=function(e,t){return v(new E(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),b(new I(t),e,r)},t.inflateRawSync=function(e,t){return v(new I(t),e)},s.inherits(C,i),C.prototype.params=function(r,n,i){if(rt.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+r);if(n!=t.Z_FILTERED&&n!=t.Z_HUFFMAN_ONLY&&n!=t.Z_RLE&&n!=t.Z_FIXED&&n!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+n);if(this._level!==r||this._strategy!==n){var s=this;this.flush(o.Z_SYNC_FLUSH,function(){a(s._handle,"zlib binding closed"),s._handle.params(r,n),s._hadError||(s._level=r,s._strategy=n,i&&i())})}else e.nextTick(i)},C.prototype.reset=function(){return a(this._handle,"zlib binding closed"),this._handle.reset()},C.prototype._flush=function(e){this._transform(n.alloc(0),"",e)},C.prototype.flush=function(t,r){var i=this,s=this._writableState;("function"==typeof t||void 0===t&&!r)&&(r=t,t=o.Z_FULL_FLUSH),s.ended?r&&e.nextTick(r):s.ending?r&&this.once("end",r):s.needDrain?r&&this.once("drain",function(){return i.flush(t,r)}):(this._flushFlag=t,this.write(n.alloc(0),"",r))},C.prototype.close=function(t){O(this,t),e.nextTick(P,this)},C.prototype._transform=function(e,t,r){var i,s=this._writableState,a=(s.ending||s.ended)&&(!e||s.length===e.length);return null===e||n.isBuffer(e)?this._handle?(a?i=this._finishFlushFlag:(i=this._flushFlag,e.length>=s.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(e,i,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},C.prototype._processChunk=function(e,t,r){var i=e&&e.length,o=this._chunkSize-this._offset,s=0,c=this,h="function"==typeof r;if(!h){var l,p=[],d=0;this.on("error",function(e){l=e}),a(this._handle,"zlib binding closed");do{var g=this._handle.writeSync(t,e,s,i,this._buffer,this._offset,o)}while(!this._hadError&&v(g[0],g[1]));if(this._hadError)throw l;if(d>=f)throw O(this),new RangeError(u);var y=n.concat(p,d);return O(this),y}a(this._handle,"zlib binding closed");var b=this._handle.write(t,e,s,i,this._buffer,this._offset,o);function v(f,u){if(this&&(this.buffer=null,this.callback=null),!c._hadError){var l=o-u;if(a(l>=0,"have should not go down"),l>0){var g=c._buffer.slice(c._offset,c._offset+l);c._offset+=l,h?c.push(g):(p.push(g),d+=g.length)}if((0===u||c._offset>=c._chunkSize)&&(o=c._chunkSize,c._offset=0,c._buffer=n.allocUnsafe(c._chunkSize)),0===u){if(s+=i-f,i=f,!h)return!0;var y=c._handle.write(t,e,s,i,c._buffer,c._offset,c._chunkSize);return y.callback=v,void(y.buffer=e)}if(!h)return!1;r()}}b.buffer=e,b.callback=v},s.inherits(m,C),s.inherits(w,C),s.inherits(_,C),s.inherits(E,C),s.inherits(A,C),s.inherits(I,C),s.inherits(S,C)}).call(this,r(8))},function(e,t,r){"use strict";(function(e,n){var i=r(24),o=r(234),s=r(235),a=r(238),f=r(241);for(var u in f)t[u]=f[u];t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7;function c(e){if("number"!=typeof e||et.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}c.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,i(this.init_done,"close before init"),i(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?s.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||a.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},c.prototype.write=function(e,t,r,n,i,o,s){return this._write(!0,e,t,r,n,i,o,s)},c.prototype.writeSync=function(e,t,r,n,i,o,s){return this._write(!1,e,t,r,n,i,o,s)},c.prototype._write=function(r,o,s,a,f,u,c,h){if(i.equal(arguments.length,8),i(this.init_done,"write before init"),i(this.mode!==t.NONE,"already finalized"),i.equal(!1,this.write_in_progress,"write already in progress"),i.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,i.equal(!1,void 0===o,"must provide flush value"),this.write_in_progress=!0,o!==t.Z_NO_FLUSH&&o!==t.Z_PARTIAL_FLUSH&&o!==t.Z_SYNC_FLUSH&&o!==t.Z_FULL_FLUSH&&o!==t.Z_FINISH&&o!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==s&&(s=e.alloc(0),f=0,a=0),this.strm.avail_in=f,this.strm.input=s,this.strm.next_in=a,this.strm.avail_out=h,this.strm.output=u,this.strm.next_out=c,this.flush=o,!r)return this._process(),this._checkError()?this._afterSync():void 0;var l=this;return n.nextTick(function(){l._process(),l._after()}),this},c.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},c.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=a.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=a.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=a.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=a.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},c.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},c.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},c.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},c.prototype.init=function(e,r,n,o,s){i(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),i(e>=8&&e<=15,"invalid windowBits"),i(r>=-1&&r<=9,"invalid compression level"),i(n>=1&&n<=9,"invalid memlevel"),i(o===t.Z_FILTERED||o===t.Z_HUFFMAN_ONLY||o===t.Z_RLE||o===t.Z_FIXED||o===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,o,s),this._setDictionary()},c.prototype.params=function(){throw new Error("deflateParams Not supported")},c.prototype.reset=function(){this._reset(),this._setDictionary()},c.prototype._init=function(e,r,n,i,f){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new o,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=s.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=a.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=f,this.write_in_progress=!1,this.init_done=!0},c.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=s.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},c.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=s.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=a.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=c}).call(this,r(1).Buffer,r(8))},function(e,t,r){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(e,t,r){"use strict";var n,i=r(34),o=r(236),s=r(108),a=r(109),f=r(237),u=0,c=1,h=3,l=4,p=5,d=0,g=1,y=-2,b=-3,v=-5,m=-1,w=1,_=2,E=3,A=4,I=0,S=2,T=8,C=9,O=15,P=8,k=286,x=30,B=19,D=2*k+1,N=15,U=3,L=258,R=L+U+1,M=32,j=42,F=69,H=73,Q=91,q=103,z=113,V=666,K=1,Y=2,G=3,Z=4,W=3;function $(e,t){return e.msg=f[t],t}function J(e){return(e<<1)-(e>4?9:0)}function X(e){for(var t=e.length;--t>=0;)e[t]=0}function ee(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function te(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ee(e.strm)}function re(e,t){e.pending_buf[e.pending++]=t}function ne(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function ie(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,f=e.strstart>e.w_size-R?e.strstart-(e.w_size-R):0,u=e.window,c=e.w_mask,h=e.prev,l=e.strstart+L,p=u[o+s-1],d=u[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(u[(r=t)+s]===d&&u[r+s-1]===p&&u[r]===u[o]&&u[++r]===u[o+1]){o+=2,r++;do{}while(u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&u[++o]===u[++r]&&os){if(e.match_start=t,s=n,n>=a)break;p=u[o+s-1],d=u[o+s]}}}while((t=h[t&c])>f&&0!=--i);return s<=e.lookahead?s:e.lookahead}function oe(e){var t,r,n,o,f,u,c,h,l,p,d=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-R)){i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=d?n-d:0}while(--r);t=r=d;do{n=e.prev[--t],e.prev[t]=n>=d?n-d:0}while(--r);o+=d}if(0===e.strm.avail_in)break;if(u=e.strm,c=e.window,h=e.strstart+e.lookahead,l=o,p=void 0,(p=u.avail_in)>l&&(p=l),r=0===p?0:(u.avail_in-=p,i.arraySet(c,u.input,u.next_in,p,h),1===u.state.wrap?u.adler=s(u.adler,c,p,h):2===u.state.wrap&&(u.adler=a(u.adler,c,p,h)),u.next_in+=p,u.total_in+=p,p),e.lookahead+=r,e.lookahead+e.insert>=U)for(f=e.strstart-e.insert,e.ins_h=e.window[f],e.ins_h=(e.ins_h<=U&&(e.ins_h=(e.ins_h<=U)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-U),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=U){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=U&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=U-1)),e.prev_length>=U&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-U,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-U),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(a=2,n-=16),o<1||o>C||r!==T||n<8||n>15||t<0||t>9||s<0||s>A)return $(e,y);8===n&&(n=9);var f=new ue;return e.state=f,f.strm=e,f.wrap=a,f.gzhead=null,f.w_bits=n,f.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(oe(e),0===e.lookahead&&t===u)return K;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,te(e,!1),0===e.strm.avail_out))return K;if(e.strstart-e.block_start>=e.w_size-R&&(te(e,!1),0===e.strm.avail_out))return K}return e.insert=0,t===l?(te(e,!0),0===e.strm.avail_out?G:Z):(e.strstart>e.block_start&&(te(e,!1),e.strm.avail_out),K)}),new fe(4,4,8,4,se),new fe(4,5,16,8,se),new fe(4,6,32,32,se),new fe(4,4,16,16,ae),new fe(8,16,32,32,ae),new fe(8,16,128,128,ae),new fe(8,32,128,256,ae),new fe(32,128,258,1024,ae),new fe(32,258,258,4096,ae)],t.deflateInit=function(e,t){return le(e,t,T,O,P,I)},t.deflateInit2=le,t.deflateReset=he,t.deflateResetKeep=ce,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?y:(e.state.gzhead=t,d):y},t.deflate=function(e,t){var r,i,s,f;if(!e||!e.state||t>p||t<0)return e?$(e,y):y;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===V&&t!==l)return $(e,0===e.avail_out?v:y);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===j)if(2===i.wrap)e.adler=0,re(i,31),re(i,139),re(i,8),i.gzhead?(re(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),re(i,255&i.gzhead.time),re(i,i.gzhead.time>>8&255),re(i,i.gzhead.time>>16&255),re(i,i.gzhead.time>>24&255),re(i,9===i.level?2:i.strategy>=_||i.level<2?4:0),re(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(re(i,255&i.gzhead.extra.length),re(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=F):(re(i,0),re(i,0),re(i,0),re(i,0),re(i,0),re(i,9===i.level?2:i.strategy>=_||i.level<2?4:0),re(i,W),i.status=z);else{var b=T+(i.w_bits-8<<4)<<8;b|=(i.strategy>=_||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(b|=M),b+=31-b%31,i.status=z,ne(i,b),0!==i.strstart&&(ne(i,e.adler>>>16),ne(i,65535&e.adler)),e.adler=1}if(i.status===F)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending!==i.pending_buf_size));)re(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=H)}else i.status=H;if(i.status===H)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending===i.pending_buf_size)){f=1;break}f=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===f&&(i.gzindex=0,i.status=Q)}else i.status=Q;if(i.status===Q)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),ee(e),s=i.pending,i.pending===i.pending_buf_size)){f=1;break}f=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===f&&(i.status=q)}else i.status=q;if(i.status===q&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ee(e),i.pending+2<=i.pending_buf_size&&(re(i,255&e.adler),re(i,e.adler>>8&255),e.adler=0,i.status=z)):i.status=z),0!==i.pending){if(ee(e),0===e.avail_out)return i.last_flush=-1,d}else if(0===e.avail_in&&J(t)<=J(r)&&t!==l)return $(e,v);if(i.status===V&&0!==e.avail_in)return $(e,v);if(0!==e.avail_in||0!==i.lookahead||t!==u&&i.status!==V){var m=i.strategy===_?function(e,t){for(var r;;){if(0===e.lookahead&&(oe(e),0===e.lookahead)){if(t===u)return K;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(te(e,!1),0===e.strm.avail_out))return K}return e.insert=0,t===l?(te(e,!0),0===e.strm.avail_out?G:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?K:Y}(i,t):i.strategy===E?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=L){if(oe(e),e.lookahead<=L&&t===u)return K;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=U&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+L;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=U?(r=o._tr_tally(e,1,e.match_length-U),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(te(e,!1),0===e.strm.avail_out))return K}return e.insert=0,t===l?(te(e,!0),0===e.strm.avail_out?G:Z):e.last_lit&&(te(e,!1),0===e.strm.avail_out)?K:Y}(i,t):n[i.level].func(i,t);if(m!==G&&m!==Z||(i.status=V),m===K||m===G)return 0===e.avail_out&&(i.last_flush=-1),d;if(m===Y&&(t===c?o._tr_align(i):t!==p&&(o._tr_stored_block(i,0,0,!1),t===h&&(X(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ee(e),0===e.avail_out))return i.last_flush=-1,d}return t!==l?d:i.wrap<=0?g:(2===i.wrap?(re(i,255&e.adler),re(i,e.adler>>8&255),re(i,e.adler>>16&255),re(i,e.adler>>24&255),re(i,255&e.total_in),re(i,e.total_in>>8&255),re(i,e.total_in>>16&255),re(i,e.total_in>>24&255)):(ne(i,e.adler>>>16),ne(i,65535&e.adler)),ee(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?d:g)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==j&&t!==F&&t!==H&&t!==Q&&t!==q&&t!==z&&t!==V?$(e,y):(e.state=null,t===z?$(e,b):d):y},t.deflateSetDictionary=function(e,t){var r,n,o,a,f,u,c,h,l=t.length;if(!e||!e.state)return y;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==j||r.lookahead)return y;for(1===a&&(e.adler=s(e.adler,t,l,0)),r.wrap=0,l>=r.w_size&&(0===a&&(X(r.head),r.strstart=0,r.block_start=0,r.insert=0),h=new i.Buf8(r.w_size),i.arraySet(h,t,l-r.w_size,r.w_size,0),t=h,l=r.w_size),f=e.avail_in,u=e.next_in,c=e.input,e.avail_in=l,e.next_in=0,e.input=t,oe(r);r.lookahead>=U;){n=r.strstart,o=r.lookahead-(U-1);do{r.ins_h=(r.ins_h<=0;)e[t]=0}var u=0,c=1,h=2,l=29,p=256,d=p+1+l,g=30,y=19,b=2*d+1,v=15,m=16,w=7,_=256,E=16,A=17,I=18,S=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],T=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],C=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],O=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],P=new Array(2*(d+2));f(P);var k=new Array(2*g);f(k);var x=new Array(512);f(x);var B=new Array(256);f(B);var D=new Array(l);f(D);var N,U,L,R=new Array(g);function M(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function j(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function F(e){return e<256?x[e]:x[256+(e>>>7)]}function H(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Q(e,t,r){e.bi_valid>m-r?(e.bi_buf|=t<>m-e.bi_valid,e.bi_valid+=r-m):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function V(e,t,r){var n,i,o=new Array(v+1),s=0;for(n=1;n<=v;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=z(o[a]++,a))}}function K(e){var t;for(t=0;t