UNPKG

dd-trace

Version:

Datadog APM tracing client for JavaScript

1 lines 54.6 kB
(()=>{"use strict";var __webpack_modules__={"./@datadog/sketches-js/dist/ddsketch/DDSketch.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LogCollapsingHighestDenseDDSketch=e.LogCollapsingLowestDenseDDSketch=e.DDSketch=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/store/index.js"),r=n("./@datadog/sketches-js/dist/ddsketch/mapping/index.js"),s=.01,u=2048,a=function(){function t(t){var e=t.mapping,n=t.store,i=t.negativeStore,o=t.zeroCount;this.mapping=e,this.store=n,this.negativeStore=i,this.zeroCount=o,this.count=this.negativeStore.count+this.zeroCount+this.store.count,this.min=1/0,this.max=-1/0,this.sum=0}return t.prototype.accept=function(t,e){if(void 0===e&&(e=1),e<=0)throw Error("Weight must be a positive number");if(t>this.mapping.minPossible){var n=this.mapping.key(t);this.store.add(n,e)}else if(t<-this.mapping.minPossible){var n=this.mapping.key(-t);this.negativeStore.add(n,e)}else this.zeroCount+=e;this.count+=e,this.sum+=t*e,t<this.min&&(this.min=t),t>this.max&&(this.max=t)},t.prototype.getValueAtQuantile=function(t){if(t<0||t>1||0===this.count)return NaN;var e=t*(this.count-1),n=0;if(e<this.negativeStore.count){var i=this.negativeStore.count-e-1,o=this.negativeStore.keyAtRank(i,!1);n=-this.mapping.value(o)}else{if(e<this.zeroCount+this.negativeStore.count)return 0;var o=this.store.keyAtRank(e-this.zeroCount-this.negativeStore.count);n=this.mapping.value(o)}return n},t.prototype.merge=function(t){if(!this.mergeable(t))throw Error("Cannot merge two DDSketches with different `relativeAccuracy` parameters");if(0!==t.count){if(0===this.count)return void this._copy(t);this.store.merge(t.store),this.zeroCount+=t.zeroCount,this.count+=t.count,this.sum+=t.sum,t.min<this.min&&(this.min=t.min),t.max>this.max&&(this.max=t.max)}},t.prototype.mergeable=function(t){return this.mapping.gamma===t.mapping.gamma},t.prototype._copy=function(t){this.store.copy(t.store),this.negativeStore.copy(t.negativeStore),this.zeroCount=t.zeroCount,this.min=t.min,this.max=t.max,this.count=t.count,this.sum=t.sum},t.prototype.toProto=function(){var t=n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").DDSketch,e=t.create({mapping:this.mapping.toProto(),positiveValues:this.store.toProto(),negativeValues:this.negativeStore.toProto(),zeroCount:this.zeroCount});return t.encode(e).finish()},t.fromProto=function(e){var i=n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").DDSketch.decode(e);return new t({mapping:r.KeyMapping.fromProto(i.mapping),store:o.DenseStore.fromProto(i.positiveValues),negativeStore:o.DenseStore.fromProto(i.negativeValues),zeroCount:i.zeroCount})},t}(),f={relativeAccuracy:s};e.DDSketch=function(t){function e(e){var n=(void 0===e?f:e).relativeAccuracy,i=void 0===n?s:n,u=new r.LogarithmicMapping(i),a=new o.DenseStore,c=new o.DenseStore;return t.call(this,{mapping:u,store:a,negativeStore:c,zeroCount:0})||this}return i(e,t),e}(a),e.LogCollapsingLowestDenseDDSketch=function(t){function e(e){var n=void 0===e?f:e,i=n.relativeAccuracy,a=void 0===i?s:i,c=n.binLimit,p=void 0===c?u:c,l=new r.LogarithmicMapping(a),h=new o.CollapsingLowestDenseStore(p),d=new o.CollapsingLowestDenseStore(p);return t.call(this,{mapping:l,store:h,negativeStore:d,zeroCount:0})||this}return i(e,t),e}(a),e.LogCollapsingHighestDenseDDSketch=function(t){function e(e){var n=void 0===e?f:e,i=n.relativeAccuracy,a=void 0===i?s:i,c=n.binLimit,p=void 0===c?u:c,l=new r.LogarithmicMapping(a),h=new o.CollapsingHighestDenseStore(p),d=new o.CollapsingHighestDenseStore(p);return t.call(this,{mapping:l,store:h,negativeStore:d,zeroCount:0})||this}return i(e,t),e}(a)},"./@datadog/sketches-js/dist/ddsketch/index.js":function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(e,n);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,o)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n("./@datadog/sketches-js/dist/ddsketch/DDSketch.js"),e)},"./@datadog/sketches-js/dist/ddsketch/mapping/CubicallyInterpolatedMapping.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CubicallyInterpolatedMapping=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"),r=n("./@datadog/sketches-js/dist/ddsketch/math.js");e.CubicallyInterpolatedMapping=function(t){function e(e,n){void 0===n&&(n=0);var i=t.call(this,e,n)||this;return i.A=6/35,i.B=-.6,i.C=10/7,i._multiplier/=i.C,i}return i(e,t),e.prototype._cubicLog2Approx=function(t){var e=(0,r.frexp)(t),n=e[0],i=e[1],o=2*n-1;return((this.A*o+this.B)*o+this.C)*o+(i-1)},e.prototype._cubicExp2Approx=function(t){var e=Math.floor(t),n=this.B*this.B-3*this.A*this.C,i=2*this.B*this.B*this.B-9*this.A*this.B*this.C-27*this.A*this.A*(t-e),o=Math.cbrt((i-Math.sqrt(i*i-4*n*n*n))/2),s=(-(this.B+o+n/o)/(3*this.A)+1)/2;return(0,r.ldexp)(s,e+1)},e.prototype._logGamma=function(t){return this._cubicLog2Approx(t)*this._multiplier},e.prototype._powGamma=function(t){return this._cubicExp2Approx(t/this._multiplier)},e.prototype._protoInterpolation=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.CUBIC},e}(o.KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.KeyMapping=void 0;var i=n("./@datadog/sketches-js/dist/ddsketch/mapping/index.js"),o=11125369292536007e-324,r=Number.MAX_VALUE;e.KeyMapping=function(){function t(t,e){if(void 0===e&&(e=0),t<=0||t>=1)throw Error("Relative accuracy must be between 0 and 1 when initializing a KeyMapping");this.relativeAccuracy=t,this._offset=e;var n=2*t/(1-t);this.gamma=1+n,this._multiplier=1/Math.log1p(n),this.minPossible=o*this.gamma,this.maxPossible=r/this.gamma}return t.fromGammaOffset=function(t,e){return new this((t-1)/(t+1),e)},t.prototype.key=function(t){return Math.ceil(this._logGamma(t))+this._offset},t.prototype.value=function(t){return this._powGamma(t-this._offset)*(2/(1+this.gamma))},t.prototype.toProto=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.create({gamma:this.gamma,indexOffset:this._offset,interpolation:this._protoInterpolation()})},t.fromProto=function(t){if(!t||null==t.gamma||null==t.indexOffset)throw Error("Failed to decode mapping from protobuf");var e=n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation,o=t.interpolation,r=t.gamma,s=t.indexOffset;switch(o){case e.NONE:return i.LogarithmicMapping.fromGammaOffset(r,s);case e.LINEAR:return i.LinearlyInterpolatedMapping.fromGammaOffset(r,s);case e.CUBIC:return i.CubicallyInterpolatedMapping.fromGammaOffset(r,s);default:throw Error("Unrecognized mapping when decoding from protobuf")}},t.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},t.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},t.prototype._protoInterpolation=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.NONE},t}()},"./@datadog/sketches-js/dist/ddsketch/mapping/LinearlyInterpolatedMapping.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LinearlyInterpolatedMapping=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"),r=n("./@datadog/sketches-js/dist/ddsketch/math.js");e.LinearlyInterpolatedMapping=function(t){function e(e,n){return void 0===n&&(n=0),t.call(this,e,n)||this}return i(e,t),e.prototype._log2Approx=function(t){var e=(0,r.frexp)(t);return 2*e[0]-1+(e[1]-1)},e.prototype._exp2Approx=function(t){var e=Math.floor(t)+1,n=(t-e+2)/2;return(0,r.ldexp)(n,e)},e.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},e.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},e.prototype._protoInterpolation=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.LINEAR},e}(o.KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/LogarithmicMapping.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.LogarithmicMapping=void 0,e.LogarithmicMapping=function(t){function e(e,n){void 0===n&&(n=0);var i=t.call(this,e,n)||this;return i._multiplier*=Math.log(2),i}return i(e,t),e.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},e.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},e.prototype._protoInterpolation=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.NONE},e}(n("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js").KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/index.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CubicallyInterpolatedMapping=e.LinearlyInterpolatedMapping=e.LogarithmicMapping=e.KeyMapping=void 0;var i=n("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js");Object.defineProperty(e,"KeyMapping",{enumerable:!0,get:function(){return i.KeyMapping}});var o=n("./@datadog/sketches-js/dist/ddsketch/mapping/LogarithmicMapping.js");Object.defineProperty(e,"LogarithmicMapping",{enumerable:!0,get:function(){return o.LogarithmicMapping}});var r=n("./@datadog/sketches-js/dist/ddsketch/mapping/LinearlyInterpolatedMapping.js");Object.defineProperty(e,"LinearlyInterpolatedMapping",{enumerable:!0,get:function(){return r.LinearlyInterpolatedMapping}});var s=n("./@datadog/sketches-js/dist/ddsketch/mapping/CubicallyInterpolatedMapping.js");Object.defineProperty(e,"CubicallyInterpolatedMapping",{enumerable:!0,get:function(){return s.CubicallyInterpolatedMapping}})},"./@datadog/sketches-js/dist/ddsketch/math.js":function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ldexp=e.frexp=void 0,e.frexp=function(t){if(0===t||!Number.isFinite(t))return[t,0];for(var e=Math.abs(t),n=Math.max(-1023,Math.floor(Math.log2(e))+1),i=e*Math.pow(2,-n);i<.5;)i*=2,n--;for(;i>=1;)i*=.5,n++;return t<0&&(i=-i),[i,n]},e.ldexp=function(t,e){for(var n=Math.min(3,Math.ceil(Math.abs(e)/1023)),i=t,o=0;o<n;o++)i*=Math.pow(2,Math.floor((e+o)/n));return i}},"./@datadog/sketches-js/dist/ddsketch/proto/compiled.js":function(t,e,n){var i=n("./protobufjs/minimal.js"),o=i.Reader,r=i.Writer,s=i.util,u=i.roots.default||(i.roots.default={});u.DDSketch=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.mapping=null,t.prototype.positiveValues=null,t.prototype.negativeValues=null,t.prototype.zeroCount=0,t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=r.create()),null!=t.mapping&&Object.hasOwnProperty.call(t,"mapping")&&u.IndexMapping.encode(t.mapping,e.uint32(10).fork()).ldelim(),null!=t.positiveValues&&Object.hasOwnProperty.call(t,"positiveValues")&&u.Store.encode(t.positiveValues,e.uint32(18).fork()).ldelim(),null!=t.negativeValues&&Object.hasOwnProperty.call(t,"negativeValues")&&u.Store.encode(t.negativeValues,e.uint32(26).fork()).ldelim(),null!=t.zeroCount&&Object.hasOwnProperty.call(t,"zeroCount")&&e.uint32(33).double(t.zeroCount),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof o||(t=o.create(t));for(var n=void 0===e?t.len:t.pos+e,i=new u.DDSketch;t.pos<n;){var r=t.uint32();switch(r>>>3){case 1:i.mapping=u.IndexMapping.decode(t,t.uint32());break;case 2:i.positiveValues=u.Store.decode(t,t.uint32());break;case 3:i.negativeValues=u.Store.decode(t,t.uint32());break;case 4:i.zeroCount=t.double();break;default:t.skipType(7&r)}}return i},t.decodeDelimited=function(t){return t instanceof o||(t=new o(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.mapping&&t.hasOwnProperty("mapping")){var e=u.IndexMapping.verify(t.mapping);if(e)return"mapping."+e}if(null!=t.positiveValues&&t.hasOwnProperty("positiveValues")){var e=u.Store.verify(t.positiveValues);if(e)return"positiveValues."+e}if(null!=t.negativeValues&&t.hasOwnProperty("negativeValues")){var e=u.Store.verify(t.negativeValues);if(e)return"negativeValues."+e}return null!=t.zeroCount&&t.hasOwnProperty("zeroCount")&&"number"!=typeof t.zeroCount?"zeroCount: number expected":null},t.fromObject=function(t){if(t instanceof u.DDSketch)return t;var e=new u.DDSketch;if(null!=t.mapping){if("object"!=typeof t.mapping)throw TypeError(".DDSketch.mapping: object expected");e.mapping=u.IndexMapping.fromObject(t.mapping)}if(null!=t.positiveValues){if("object"!=typeof t.positiveValues)throw TypeError(".DDSketch.positiveValues: object expected");e.positiveValues=u.Store.fromObject(t.positiveValues)}if(null!=t.negativeValues){if("object"!=typeof t.negativeValues)throw TypeError(".DDSketch.negativeValues: object expected");e.negativeValues=u.Store.fromObject(t.negativeValues)}return null!=t.zeroCount&&(e.zeroCount=Number(t.zeroCount)),e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.mapping=null,n.positiveValues=null,n.negativeValues=null,n.zeroCount=0),null!=t.mapping&&t.hasOwnProperty("mapping")&&(n.mapping=u.IndexMapping.toObject(t.mapping,e)),null!=t.positiveValues&&t.hasOwnProperty("positiveValues")&&(n.positiveValues=u.Store.toObject(t.positiveValues,e)),null!=t.negativeValues&&t.hasOwnProperty("negativeValues")&&(n.negativeValues=u.Store.toObject(t.negativeValues,e)),null!=t.zeroCount&&t.hasOwnProperty("zeroCount")&&(n.zeroCount=e.json&&!isFinite(t.zeroCount)?String(t.zeroCount):t.zeroCount),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},t}(),u.IndexMapping=function(){function t(t){if(t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.gamma=0,t.prototype.indexOffset=0,t.prototype.interpolation=0,t.create=function(e){return new t(e)},t.encode=function(t,e){return e||(e=r.create()),null!=t.gamma&&Object.hasOwnProperty.call(t,"gamma")&&e.uint32(9).double(t.gamma),null!=t.indexOffset&&Object.hasOwnProperty.call(t,"indexOffset")&&e.uint32(17).double(t.indexOffset),null!=t.interpolation&&Object.hasOwnProperty.call(t,"interpolation")&&e.uint32(24).int32(t.interpolation),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof o||(t=o.create(t));for(var n=void 0===e?t.len:t.pos+e,i=new u.IndexMapping;t.pos<n;){var r=t.uint32();switch(r>>>3){case 1:i.gamma=t.double();break;case 2:i.indexOffset=t.double();break;case 3:i.interpolation=t.int32();break;default:t.skipType(7&r)}}return i},t.decodeDelimited=function(t){return t instanceof o||(t=new o(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.gamma&&t.hasOwnProperty("gamma")&&"number"!=typeof t.gamma)return"gamma: number expected";if(null!=t.indexOffset&&t.hasOwnProperty("indexOffset")&&"number"!=typeof t.indexOffset)return"indexOffset: number expected";if(null!=t.interpolation&&t.hasOwnProperty("interpolation"))switch(t.interpolation){default:return"interpolation: enum value expected";case 0:case 1:case 2:case 3:}return null},t.fromObject=function(t){if(t instanceof u.IndexMapping)return t;var e=new u.IndexMapping;switch(null!=t.gamma&&(e.gamma=Number(t.gamma)),null!=t.indexOffset&&(e.indexOffset=Number(t.indexOffset)),t.interpolation){case"NONE":case 0:e.interpolation=0;break;case"LINEAR":case 1:e.interpolation=1;break;case"QUADRATIC":case 2:e.interpolation=2;break;case"CUBIC":case 3:e.interpolation=3}return e},t.toObject=function(t,e){e||(e={});var n={};return e.defaults&&(n.gamma=0,n.indexOffset=0,n.interpolation=e.enums===String?"NONE":0),null!=t.gamma&&t.hasOwnProperty("gamma")&&(n.gamma=e.json&&!isFinite(t.gamma)?String(t.gamma):t.gamma),null!=t.indexOffset&&t.hasOwnProperty("indexOffset")&&(n.indexOffset=e.json&&!isFinite(t.indexOffset)?String(t.indexOffset):t.indexOffset),null!=t.interpolation&&t.hasOwnProperty("interpolation")&&(n.interpolation=e.enums===String?u.IndexMapping.Interpolation[t.interpolation]:t.interpolation),n},t.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},t.Interpolation=function(){var t={},e=Object.create(t);return e[t[0]="NONE"]=0,e[t[1]="LINEAR"]=1,e[t[2]="QUADRATIC"]=2,e[t[3]="CUBIC"]=3,e}(),t}(),u.Store=function(){function t(t){if(this.binCounts={},this.contiguousBinCounts=[],t)for(var e=Object.keys(t),n=0;n<e.length;++n)null!=t[e[n]]&&(this[e[n]]=t[e[n]])}return t.prototype.binCounts=s.emptyObject,t.prototype.contiguousBinCounts=s.emptyArray,t.prototype.contiguousBinIndexOffset=0,t.create=function(e){return new t(e)},t.encode=function(t,e){if(e||(e=r.create()),null!=t.binCounts&&Object.hasOwnProperty.call(t,"binCounts"))for(var n=Object.keys(t.binCounts),i=0;i<n.length;++i)e.uint32(10).fork().uint32(8).sint32(n[i]).uint32(17).double(t.binCounts[n[i]]).ldelim();if(null!=t.contiguousBinCounts&&t.contiguousBinCounts.length){e.uint32(18).fork();for(var i=0;i<t.contiguousBinCounts.length;++i)e.double(t.contiguousBinCounts[i]);e.ldelim()}return null!=t.contiguousBinIndexOffset&&Object.hasOwnProperty.call(t,"contiguousBinIndexOffset")&&e.uint32(24).sint32(t.contiguousBinIndexOffset),e},t.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},t.decode=function(t,e){t instanceof o||(t=o.create(t));for(var n,i,r=void 0===e?t.len:t.pos+e,a=new u.Store;t.pos<r;){var f=t.uint32();switch(f>>>3){case 1:a.binCounts===s.emptyObject&&(a.binCounts={});var c=t.uint32()+t.pos;for(n=0,i=0;t.pos<c;){var p=t.uint32();switch(p>>>3){case 1:n=t.sint32();break;case 2:i=t.double();break;default:t.skipType(7&p)}}a.binCounts[n]=i;break;case 2:if(a.contiguousBinCounts&&a.contiguousBinCounts.length||(a.contiguousBinCounts=[]),(7&f)==2)for(var c=t.uint32()+t.pos;t.pos<c;)a.contiguousBinCounts.push(t.double());else a.contiguousBinCounts.push(t.double());break;case 3:a.contiguousBinIndexOffset=t.sint32();break;default:t.skipType(7&f)}}return a},t.decodeDelimited=function(t){return t instanceof o||(t=new o(t)),this.decode(t,t.uint32())},t.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.binCounts&&t.hasOwnProperty("binCounts")){if(!s.isObject(t.binCounts))return"binCounts: object expected";for(var e=Object.keys(t.binCounts),n=0;n<e.length;++n){if(!s.key32Re.test(e[n]))return"binCounts: integer key{k:sint32} expected";if("number"!=typeof t.binCounts[e[n]])return"binCounts: number{k:sint32} expected"}}if(null!=t.contiguousBinCounts&&t.hasOwnProperty("contiguousBinCounts")){if(!Array.isArray(t.contiguousBinCounts))return"contiguousBinCounts: array expected";for(var n=0;n<t.contiguousBinCounts.length;++n)if("number"!=typeof t.contiguousBinCounts[n])return"contiguousBinCounts: number[] expected"}return null!=t.contiguousBinIndexOffset&&t.hasOwnProperty("contiguousBinIndexOffset")&&!s.isInteger(t.contiguousBinIndexOffset)?"contiguousBinIndexOffset: integer expected":null},t.fromObject=function(t){if(t instanceof u.Store)return t;var e=new u.Store;if(t.binCounts){if("object"!=typeof t.binCounts)throw TypeError(".Store.binCounts: object expected");e.binCounts={};for(var n=Object.keys(t.binCounts),i=0;i<n.length;++i)e.binCounts[n[i]]=Number(t.binCounts[n[i]])}if(t.contiguousBinCounts){if(!Array.isArray(t.contiguousBinCounts))throw TypeError(".Store.contiguousBinCounts: array expected");e.contiguousBinCounts=[];for(var i=0;i<t.contiguousBinCounts.length;++i)e.contiguousBinCounts[i]=Number(t.contiguousBinCounts[i])}return null!=t.contiguousBinIndexOffset&&(e.contiguousBinIndexOffset=0|t.contiguousBinIndexOffset),e},t.toObject=function(t,e){e||(e={});var n,i={};if((e.arrays||e.defaults)&&(i.contiguousBinCounts=[]),(e.objects||e.defaults)&&(i.binCounts={}),e.defaults&&(i.contiguousBinIndexOffset=0),t.binCounts&&(n=Object.keys(t.binCounts)).length){i.binCounts={};for(var o=0;o<n.length;++o)i.binCounts[n[o]]=e.json&&!isFinite(t.binCounts[n[o]])?String(t.binCounts[n[o]]):t.binCounts[n[o]]}if(t.contiguousBinCounts&&t.contiguousBinCounts.length){i.contiguousBinCounts=[];for(var o=0;o<t.contiguousBinCounts.length;++o)i.contiguousBinCounts[o]=e.json&&!isFinite(t.contiguousBinCounts[o])?String(t.contiguousBinCounts[o]):t.contiguousBinCounts[o]}return null!=t.contiguousBinIndexOffset&&t.hasOwnProperty("contiguousBinIndexOffset")&&(i.contiguousBinIndexOffset=t.contiguousBinIndexOffset),i},t.prototype.toJSON=function(){return this.constructor.toObject(this,i.util.toJSONOptions)},t}(),t.exports=u},"./@datadog/sketches-js/dist/ddsketch/store/CollapsingHighestDenseStore.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingHighestDenseStore=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"),r=n("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.CollapsingHighestDenseStore=function(t){function e(e,n){var i=t.call(this,n)||this;return i.binLimit=e,i.isCollapsed=!1,i}return i(e,t),e.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.maxKey-t.offset+1,n=Math.max(this.maxKey+1,t.minKey)-t.offset;if(e>n){var i=(0,r.sumOfRange)(t.bins,n,e);this.bins[this.length()-1]+=i}else n=e;for(var o=t.minKey;o<n+t.offset;o++)this.bins[o-this.offset]+=t.bins[o-t.offset];this.count+=t.count}},e.prototype.copy=function(e){t.prototype.copy.call(this,e),this.isCollapsed=e.isCollapsed},e.prototype._getNewLength=function(t,e){var n=e-t+1;return Math.min(this.chunkSize*Math.ceil(n/this.chunkSize),this.binLimit)},e.prototype._adjust=function(t,e){if(e-t+1>this.length())if((e=t+this.length()+1)<=this.minKey)this.offset=t,this.maxKey=e,this.bins.fill(0),this.bins[this.length()-1]=this.count;else{var n=this.offset-t;if(n>0){var i=e-this.offset+1,o=this.maxKey-this.offset+1,s=(0,r.sumOfRange)(this.bins,i,o);this.bins.fill(0,i,o),this.bins[i-1]+=s,this.maxKey=e,this._shiftBins(n)}else this.maxKey=e,this._shiftBins(n);this.minKey=t,this.isCollapsed=!0}else this._centerBins(t,e),this.minKey=t,this.maxKey=e},e.prototype._getIndex=function(t){if(t<this.minKey){if(this.isCollapsed||(this._extendRange(t),this.isCollapsed))return this.length()-1}else t>this.maxKey&&this._extendRange(t);return t-this.offset},e}(o.DenseStore)},"./@datadog/sketches-js/dist/ddsketch/store/CollapsingLowestDenseStore.js":function(t,e,n){var i=this&&this.__extends||function(){var t=function(e,n){return(t=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingLowestDenseStore=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"),r=n("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.CollapsingLowestDenseStore=function(t){function e(e,n){var i=t.call(this,n)||this;return i.binLimit=e,i.isCollapsed=!1,i}return i(e,t),e.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.minKey-t.offset,n=Math.min(this.minKey,t.maxKey+1)-t.offset;if(n>e){var i=(0,r.sumOfRange)(t.bins,e,n);this.bins[0]+=i}else n=e;for(var o=n+t.offset;o<t.maxKey+1;o++)this.bins[o-this.offset]+=t.bins[o-t.offset];this.count+=t.count}},e.prototype.copy=function(e){t.prototype.copy.call(this,e),this.isCollapsed=e.isCollapsed},e.prototype._getNewLength=function(t,e){var n=e-t+1;return Math.min(this.chunkSize*Math.ceil(n/this.chunkSize),this.binLimit)},e.prototype._adjust=function(t,e){if(e-t+1>this.length()){if((t=e-this.length()+1)>=this.maxKey)this.offset=t,this.minKey=t,this.bins.fill(0),this.bins[0]=this.count;else{var n=this.offset-t;if(n<0){var i=this.minKey-this.offset,o=t-this.offset,s=(0,r.sumOfRange)(this.bins,i,o);this.bins.fill(0,i,o),this.bins[o]+=s,this.minKey=t,this._shiftBins(n)}else this.minKey=t,this._shiftBins(n)}this.maxKey=e,this.isCollapsed=!0}else this._centerBins(t,e),this.minKey=t,this.maxKey=e},e.prototype._getIndex=function(t){if(t<this.minKey){if(this.isCollapsed||(this._extendRange(t),this.isCollapsed))return 0}else t>this.maxKey&&this._extendRange(t);return t-this.offset},e}(o.DenseStore)},"./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js":function(t,e,n){var i=this&&this.__spreadArray||function(t,e,n){if(n||2==arguments.length)for(var i,o=0,r=e.length;o<r;o++)!i&&o in e||(i||(i=Array.prototype.slice.call(e,0,o)),i[o]=e[o]);return t.concat(i||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.DenseStore=void 0;var o=n("./@datadog/sketches-js/dist/ddsketch/store/util.js"),r=128;e.DenseStore=function(){function t(t){void 0===t&&(t=r),this.chunkSize=t,this.bins=[],this.count=0,this.minKey=1/0,this.maxKey=-1/0,this.offset=0}return t.prototype.add=function(t,e){void 0===e&&(e=1);var n=this._getIndex(t);this.bins[n]+=e,this.count+=e},t.prototype.keyAtRank=function(t,e){void 0===e&&(e=!0);for(var n=0,i=0;i<this.length();i++)if(n+=this.bins[i],e&&n>t||!e&&n>=t+1)return i+this.offset;return this.maxKey},t.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.minKey-t.offset,n=Math.min(this.minKey,t.maxKey+1)-t.offset;if(n>e){var i=(0,o.sumOfRange)(t.bins,e,n);this.bins[0]+=i}else n=e;for(var r=n+t.offset;r<t.maxKey+1;r++)this.bins[r-this.offset]+=t.bins[r-t.offset];this.count+=t.count}},t.prototype.copy=function(t){this.bins=i([],t.bins,!0),this.count=t.count,this.minKey=t.minKey,this.maxKey=t.maxKey,this.offset=t.offset},t.prototype.length=function(){return this.bins.length},t.prototype._getNewLength=function(t,e){var n=e-t+1;return this.chunkSize*Math.ceil(n/this.chunkSize)},t.prototype._adjust=function(t,e){this._centerBins(t,e),this.minKey=t,this.maxKey=e},t.prototype._shiftBins=function(t){var e,n;t>0?(this.bins=this.bins.slice(0,-t),(e=this.bins).unshift.apply(e,Array(t).fill(0))):(this.bins=this.bins.slice(Math.abs(t)),(n=this.bins).push.apply(n,Array(Math.abs(t)).fill(0))),this.offset-=t},t.prototype._centerBins=function(t,e){var n=t+Math.floor((e-t+1)/2);this._shiftBins(Math.floor(this.offset+this.length()/2)-n)},t.prototype._extendRange=function(t,e){e=e||t;var n,i=Math.min(t,e,this.minKey),o=Math.max(t,e,this.maxKey);if(0===this.length())this.bins=Array(this._getNewLength(i,o)).fill(0),this.offset=i,this._adjust(i,o);else if(i>=this.minKey&&o<this.offset+this.length())this.minKey=i,this.maxKey=o;else{var r=this._getNewLength(i,o);r>this.length()&&(n=this.bins).push.apply(n,Array(r-this.length()).fill(0)),this._adjust(i,o)}},t.prototype._getIndex=function(t){return t<this.minKey?this._extendRange(t):t>this.maxKey&&this._extendRange(t),t-this.offset},t.prototype.toProto=function(){return n("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").Store.create({contiguousBinCounts:this.bins,contiguousBinIndexOffset:this.offset})},t.fromProto=function(t){if(!t||null==t.contiguousBinCounts||null==t.contiguousBinIndexOffset)throw Error("Failed to decode store from protobuf");var e=new this,n=t.contiguousBinIndexOffset;e.offset=n;for(var i=0,o=t.contiguousBinCounts;i<o.length;i++){var r=o[i];e.add(n,r),n+=1}return e},t}()},"./@datadog/sketches-js/dist/ddsketch/store/index.js":function(t,e,n){Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingHighestDenseStore=e.CollapsingLowestDenseStore=e.DenseStore=void 0;var i=n("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js");Object.defineProperty(e,"DenseStore",{enumerable:!0,get:function(){return i.DenseStore}});var o=n("./@datadog/sketches-js/dist/ddsketch/store/CollapsingLowestDenseStore.js");Object.defineProperty(e,"CollapsingLowestDenseStore",{enumerable:!0,get:function(){return o.CollapsingLowestDenseStore}});var r=n("./@datadog/sketches-js/dist/ddsketch/store/CollapsingHighestDenseStore.js");Object.defineProperty(e,"CollapsingHighestDenseStore",{enumerable:!0,get:function(){return r.CollapsingHighestDenseStore}})},"./@datadog/sketches-js/dist/ddsketch/store/util.js":function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfRange=void 0,e.sumOfRange=function(t,e,n){for(var i=0,o=e;o<=n;o++)i+=t[o];return i}},"./@datadog/sketches-js/dist/index.js":function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var o=Object.getOwnPropertyDescriptor(e,n);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,o)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),o=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};Object.defineProperty(e,"__esModule",{value:!0}),o(n("./@datadog/sketches-js/dist/ddsketch/index.js"),e)},"./@protobufjs/aspromise/index.js":function(t){t.exports=e;function e(t,e){for(var n=Array(arguments.length-1),i=0,o=2,r=!0;o<arguments.length;)n[i++]=arguments[o++];return new Promise(function(o,s){n[i]=function(t){if(r)if(r=!1,t)s(t);else{for(var e=Array(arguments.length-1),n=0;n<e.length;)e[n++]=arguments[n];o.apply(null,e)}};try{t.apply(e||null,n)}catch(t){r&&(r=!1,s(t))}})}},"./@protobufjs/base64/index.js":function(t,e){var n=e;n.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&"="===t.charAt(e);)++n;return Math.ceil(3*t.length)/4-n};for(var i=Array(64),o=Array(123),r=0;r<64;)o[i[r]=r<26?r+65:r<52?r+71:r<62?r-4:r-59|43]=r++;n.encode=function(t,e,n){for(var o,r=null,s=[],u=0,a=0;e<n;){var f=t[e++];switch(a){case 0:s[u++]=i[f>>2],o=(3&f)<<4,a=1;break;case 1:s[u++]=i[o|f>>4],o=(15&f)<<2,a=2;break;case 2:s[u++]=i[o|f>>6],s[u++]=i[63&f],a=0}u>8191&&((r||(r=[])).push(String.fromCharCode.apply(String,s)),u=0)}return(a&&(s[u++]=i[o],s[u++]=61,1===a&&(s[u++]=61)),r)?(u&&r.push(String.fromCharCode.apply(String,s.slice(0,u))),r.join("")):String.fromCharCode.apply(String,s.slice(0,u))};var s="invalid encoding";n.decode=function(t,e,n){for(var i,r=n,u=0,a=0;a<t.length;){var f=t.charCodeAt(a++);if(61===f&&u>1)break;if(void 0===(f=o[f]))throw Error(s);switch(u){case 0:i=f,u=1;break;case 1:e[n++]=i<<2|(48&f)>>4,i=f,u=2;break;case 2:e[n++]=(15&i)<<4|(60&f)>>2,i=f,u=3;break;case 3:e[n++]=(3&i)<<6|f,u=0}}if(1===u)throw Error(s);return n-r},n.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}},"./@protobufjs/eventemitter/index.js":function(t){function e(){this._listeners={}}t.exports=e,e.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this},e.prototype.off=function(t,e){if(void 0===t)this._listeners={};else if(void 0===e)this._listeners[t]=[];else for(var n=this._listeners[t],i=0;i<n.length;)n[i].fn===e?n.splice(i,1):++i;return this},e.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<e.length;)e[i].fn.apply(e[i++].ctx,n)}return this}},"./@protobufjs/float/index.js":function(t){function e(t){return"undefined"!=typeof Float32Array?!function(){var e=new Float32Array([-0]),n=new Uint8Array(e.buffer),i=128===n[3];function o(t,i,o){e[0]=t,i[o]=n[0],i[o+1]=n[1],i[o+2]=n[2],i[o+3]=n[3]}function r(t,i,o){e[0]=t,i[o]=n[3],i[o+1]=n[2],i[o+2]=n[1],i[o+3]=n[0]}function s(t,i){return n[0]=t[i],n[1]=t[i+1],n[2]=t[i+2],n[3]=t[i+3],e[0]}function u(t,i){return n[3]=t[i],n[2]=t[i+1],n[1]=t[i+2],n[0]=t[i+3],e[0]}t.writeFloatLE=i?o:r,t.writeFloatBE=i?r:o,t.readFloatLE=i?s:u,t.readFloatBE=i?u:s}():!function(){function e(t,e,n,i){var o=+(e<0);if(o&&(e=-e),0===e)t(1/e>0?0:0x80000000,n,i);else if(isNaN(e))t(0x7fc00000,n,i);else if(e>34028234663852886e22)t((o<<31|0x7f800000)>>>0,n,i);else if(e<11754943508222875e-54)t((o<<31|Math.round(e/1401298464324817e-60))>>>0,n,i);else{var r=Math.floor(Math.log(e)/Math.LN2),s=8388607&Math.round(e*Math.pow(2,-r)*8388608);t((o<<31|r+127<<23|s)>>>0,n,i)}}function s(t,e,n){var i=t(e,n),o=(i>>31)*2+1,r=i>>>23&255,s=8388607&i;return 255===r?s?NaN:1/0*o:0===r?1401298464324817e-60*o*s:o*Math.pow(2,r-150)*(s+8388608)}t.writeFloatLE=e.bind(null,n),t.writeFloatBE=e.bind(null,i),t.readFloatLE=s.bind(null,o),t.readFloatBE=s.bind(null,r)}(),"undefined"!=typeof Float64Array?!function(){var e=new Float64Array([-0]),n=new Uint8Array(e.buffer),i=128===n[7];function o(t,i,o){e[0]=t,i[o]=n[0],i[o+1]=n[1],i[o+2]=n[2],i[o+3]=n[3],i[o+4]=n[4],i[o+5]=n[5],i[o+6]=n[6],i[o+7]=n[7]}function r(t,i,o){e[0]=t,i[o]=n[7],i[o+1]=n[6],i[o+2]=n[5],i[o+3]=n[4],i[o+4]=n[3],i[o+5]=n[2],i[o+6]=n[1],i[o+7]=n[0]}function s(t,i){return n[0]=t[i],n[1]=t[i+1],n[2]=t[i+2],n[3]=t[i+3],n[4]=t[i+4],n[5]=t[i+5],n[6]=t[i+6],n[7]=t[i+7],e[0]}function u(t,i){return n[7]=t[i],n[6]=t[i+1],n[5]=t[i+2],n[4]=t[i+3],n[3]=t[i+4],n[2]=t[i+5],n[1]=t[i+6],n[0]=t[i+7],e[0]}t.writeDoubleLE=i?o:r,t.writeDoubleBE=i?r:o,t.readDoubleLE=i?s:u,t.readDoubleBE=i?u:s}():!function(){function e(t,e,n,i,o,r){var s,u=+(i<0);if(u&&(i=-i),0===i)t(0,o,r+e),t(1/i>0?0:0x80000000,o,r+n);else if(isNaN(i))t(0,o,r+e),t(0x7ff80000,o,r+n);else if(i>17976931348623157e292)t(0,o,r+e),t((u<<31|0x7ff00000)>>>0,o,r+n);else if(i<22250738585072014e-324)t((s=i/5e-324)>>>0,o,r+e),t((u<<31|s/0x100000000)>>>0,o,r+n);else{var a=Math.floor(Math.log(i)/Math.LN2);1024===a&&(a=1023),t(0x10000000000000*(s=i*Math.pow(2,-a))>>>0,o,r+e),t((u<<31|a+1023<<20|1048576*s&1048575)>>>0,o,r+n)}}function s(t,e,n,i,o){var r=t(i,o+e),s=t(i,o+n),u=(s>>31)*2+1,a=s>>>20&2047,f=0x100000000*(1048575&s)+r;return 2047===a?f?NaN:1/0*u:0===a?5e-324*u*f:u*Math.pow(2,a-1075)*(f+0x10000000000000)}t.writeDoubleLE=e.bind(null,n,0,4),t.writeDoubleBE=e.bind(null,i,4,0),t.readDoubleLE=s.bind(null,o,0,4),t.readDoubleBE=s.bind(null,r,4,0)}(),t}function n(t,e,n){e[n]=255&t,e[n+1]=t>>>8&255,e[n+2]=t>>>16&255,e[n+3]=t>>>24}function i(t,e,n){e[n]=t>>>24,e[n+1]=t>>>16&255,e[n+2]=t>>>8&255,e[n+3]=255&t}function o(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function r(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=e(e)},"./@protobufjs/inquire/index.js":function(module){module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},"./@protobufjs/pool/index.js":function(t){t.exports=e;function e(t,e,n){var i=n||8192,o=i>>>1,r=null,s=i;return function(n){if(n<1||n>o)return t(n);s+n>i&&(r=t(i),s=0);var u=e.call(r,s,s+=n);return 7&s&&(s=(7|s)+1),u}}},"./@protobufjs/utf8/index.js":function(t,e){var n=e;n.length=function(t){for(var e=0,n=0,i=0;i<t.length;++i)(n=t.charCodeAt(i))<128?e+=1:n<2048?e+=2:(64512&n)==55296&&(64512&t.charCodeAt(i+1))==56320?(++i,e+=4):e+=3;return e},n.read=function(t,e,n){if(n-e<1)return"";for(var i,o=null,r=[],s=0;e<n;)(i=t[e++])<128?r[s++]=i:i>191&&i<224?r[s++]=(31&i)<<6|63&t[e++]:i>239&&i<365?(i=((7&i)<<18|(63&t[e++])<<12|(63&t[e++])<<6|63&t[e++])-65536,r[s++]=55296+(i>>10),r[s++]=56320+(1023&i)):r[s++]=(15&i)<<12|(63&t[e++])<<6|63&t[e++],s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,r)),s=0);return o?(s&&o.push(String.fromCharCode.apply(String,r.slice(0,s))),o.join("")):String.fromCharCode.apply(String,r.slice(0,s))},n.write=function(t,e,n){for(var i,o,r=n,s=0;s<t.length;++s)(i=t.charCodeAt(s))<128?e[n++]=i:(i<2048?e[n++]=i>>6|192:((64512&i)==55296&&(64512&(o=t.charCodeAt(s+1)))==56320?(i=65536+((1023&i)<<10)+(1023&o),++s,e[n++]=i>>18|240,e[n++]=i>>12&63|128):e[n++]=i>>12|224,e[n++]=i>>6&63|128),e[n++]=63&i|128);return n-r}},"./protobufjs/minimal.js":function(t,e,n){t.exports=n("./protobufjs/src/index-minimal.js")},"./protobufjs/src/index-minimal.js":function(t,e,n){var i=e;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}i.build="minimal",i.Writer=n("./protobufjs/src/writer.js"),i.BufferWriter=n("./protobufjs/src/writer_buffer.js"),i.Reader=n("./protobufjs/src/reader.js"),i.BufferReader=n("./protobufjs/src/reader_buffer.js"),i.util=n("./protobufjs/src/util/minimal.js"),i.rpc=n("./protobufjs/src/rpc.js"),i.roots=n("./protobufjs/src/roots.js"),i.configure=o,o()},"./protobufjs/src/reader.js":function(t,e,n){t.exports=a;var i,o=n("./protobufjs/src/util/minimal.js"),r=o.LongBits,s=o.utf8;function u(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function a(t){this.buf=t,this.pos=0,this.len=t.length}var f="undefined"!=typeof Uint8Array?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new a(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new a(t);throw Error("illegal buffer")},c=function(){return o.Buffer?function(t){return(a.create=function(t){return o.Buffer.isBuffer(t)?new i(t):f(t)})(t)}:f};function p(){var t=new r(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw u(this);if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t}return t.lo=(t.lo|(127&this.buf[this.pos++])<<7*e)>>>0,t}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw u(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function l(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function h(){if(this.pos+8>this.len)throw u(this,8);return new r(l(this.buf,this.pos+=4),l(this.buf,this.pos+=4))}a.create=c(),a.prototype._slice=o.Array.prototype.subarray||o.Array.prototype.slice,a.prototype.uint32=function(){var t=0xffffffff;return function(){if(t=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128||(t=(t|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,u(this,10);return t}}(),a.prototype.int32=function(){return 0|this.uint32()},a.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)},a.prototype.bool=function(){return 0!==this.uint32()},a.prototype.fixed32=function(){if(this.pos+4>this.len)throw u(this,4);return l(this.buf,this.pos+=4)},a.prototype.sfixed32=function(){if(this.pos+4>this.len)throw u(this,4);return 0|l(this.buf,this.pos+=4)},a.prototype.float=function(){if(this.pos+4>this.len)throw u(this,4);var t=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},a.prototype.double=function(){if(this.pos+8>this.len)throw u(this,4);var t=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},a.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw u(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,n);if(e===n){var i=o.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,n)},a.prototype.string=function(){var t=this.bytes();return s.read(t,0,t.length)},a.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw u(this,t);this.pos+=t}else do if(this.pos>=this.len)throw u(this);while(128&this.buf[this.pos++]);return this},a.prototype.skipType=function(t){switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(t=7&this.uint32());)this.skipType(t);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},a._configure=function(t){i=t,a.create=c(),i._configure();var e=o.Long?"toLong":"toNumber";o.merge(a.prototype,{int64:function(){return p.call(this)[e](!1)},uint64:function(){return p.call(this)[e](!0)},sint64:function(){return p.call(this).zzDecode()[e](!1)},fixed64:function(){return h.call(this)[e](!0)},sfixed64:function(){return h.call(this)[e](!1)}})}},"./protobufjs/src/reader_buffer.js":function(t,e,n){t.exports=r;var i=n("./protobufjs/src/reader.js");(r.prototype=Object.create(i.prototype)).constructor=r;var o=n("./protobufjs/src/util/minimal.js");function r(t){i.call(this,t)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))},r._configure()},"./protobufjs/src/roots.js":function(t){t.exports={}},"./protobufjs/src/rpc.js":function(t,e,n){e.Service=n("./protobufjs/src/rpc/service.js")},"./protobufjs/src/rpc/service.js":function(t,e,n){t.exports=o;var i=n("./protobufjs/src/util/minimal.js");function o(t,e,n){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!n}(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o,o.prototype.rpcCall=function t(e,n,o,r,s){if(!r)throw TypeError("request must be specified");var u=this;if(!s)return i.asPromise(t,u,e,n,o,r);if(!u.rpcImpl)return void setTimeout(function(){s(Error("already ended"))},0);try{return u.rpcImpl(e,n[u.requestDelimited?"encodeDelimited":"encode"](r).finish(),function(t,n){if(t)return u.emit("error",t,e),s(t);if(null===n)return void u.end(!0);if(!(n instanceof o))try{n=o[u.responseDelimited?"decodeDelimited":"decode"](n)}catch(t){return u.emit("error",t,e),s(t)}return u.emit("data",n,e),s(null,n)})}catch(t){u.emit("error",t,e),setTimeout(function(){s(t)},0);return}},o.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},"./protobufjs/src/util/longbits.js":function(t,e,n){t.exports=o;var i=n("./protobufjs/src/util/minimal.js");function o(t,e){this.lo=t>>>0,this.hi=e>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(t){if(0===t)return r;var e=t<0;e&&(t=-t);var n=t>>>0,i=(t-n)/0x100000000>>>0;return e&&(i=~i>>>0,n=~n>>>0,++n>0xffffffff&&(n=0,++i>0xffffffff&&(i=0))),new o(n,i)},o.from=function(t){if("number"==typeof t)return o.fromNumber(t);if(i.isString(t))if(!i.Long)return o.fromNumber(parseInt(t,10));else t=i.Long.fromString(t);return t.low||t.high?new o(t.low>>>0,t.high>>>0):r},o.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+0x100000000*n)}return this.lo+0x100000000*this.hi},o.prototype.toLong=function(t){return i.Long?new i.Long(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var u=String.prototype.charCodeAt;o.fromHash=function(t){return t===s?r:new o((u.call(t,0)|u.call(t,1)<<8|u.call(t,2)<<16|u.call(t,3)<<24)>>>0,(u.call(t,4)|u.call(t,5)<<8|u.call(t,6)<<16|u.call(t,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},o.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},o.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return 0===n?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}},"./protobufjs/src/util/minimal.js":function(t,e,n){var i=e;function o(t,e,n){for(var i=Object.keys(e),o=0;o<i.length;++o)void 0!==t[i[o]]&&n||(t[i[o]]=e[i[o]]);return t}function r(t){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:Error().stack||""}),n&&o(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}i.asPromise=n("./@protobufjs/aspromise/index.js"),i.base64=n("./@protobufjs/base64/index.js"),i.EventEmitter=n("./@protobufjs/eventemitter/index.js"),i.float=n("./@protobufjs/float/index.js"),i.inquire=n("./@protobufjs/inquire/index.js"),i.utf8=n("./@protobufjs/utf8/index.js"),i.pool=n("./@protobufjs/pool/index.js"),i.LongBits=n("./protobufjs/src/util/longbits.js"),i.isNode=!!("undefined"!=typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||"undefined"!=typeof window&&window||"undefined"!=typeof self&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},i.isString=function(t){return"string"==typeof t||t instanceof String},i.isObject=function(t){return t&&"object"==typeof t},i.isset=i.isSet=function(t,e){var n=t[e];return!!(null!=n&&t.hasOwnProperty(e))&&("object"!=typeof n||(Array.isArray(n)?n.length:Object.keys(n).length)>0)},i.Buffer=function(){try{var t=i.inquire("buffer").Buffer;return t.prototype.utf8Write?t:null}catch(t){return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(t){return"number"==typeof t?i.Buffer?i._Buffer_allocUnsafe(t):new i.Array(t):i.Buffer?i._Buffer_from(t):"undefined"==typeof Uint8Array?t:new Uint8Array(t)},i.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(t){return t?i.LongBits.from(t).toHash():i.LongBits.zeroHash},i.longFromHash=function(t,e){var n=i.LongBits.fromHash(t);return i.Long?i.Long.fromBits(n.lo,n.hi,e):n.toNumber(!!e)},i.merge=o,i.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var t=Object.keys(this),n=t.length-1;n>-1;--n)if(1===e[t[n]]&&void 0!==this[t[n]]&&null!==this[t[n]])return t[n]}},i.oneOfSetter=function(t){return function(e){for(var n=0;n<t.length;++n)t[n]!==e&&delete this[t[n]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var t=i.Buffer;if(!t){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=t.from!==Uint8Array.from&&t.from||functio