From f9b74687bbe18d48c973bbbac7f4f822e319bd67 Mon Sep 17 00:00:00 2001 From: Caleb Sander Date: Sat, 23 Dec 2017 22:56:34 -0500 Subject: [PATCH] Fixed #58 --- compiled/download.js | 2 +- compiled/upload-download.js | 2 +- compiled/upload.js | 2 +- dist/lib/appendable.d.ts | 2 +- dist/recursive-registry.d.ts | 12 + dist/recursive-registry.js | 12 + dist/types/recursive.d.ts | 25 + dist/types/recursive.js | 27 + .../_lib_appendable_.appendablebuffer.html | 71 +- ...b_appendable_stream_.appendablestream.html | 90 +- .../_lib_growable_buffer_.growablebuffer.html | 92 +- .../_types_absolute_.absolutetype.html | 36 +- .../_types_abstract_.abstracttype.html | 55 +- docs/classes/_types_array_.arraytype.html | 28 +- docs/classes/_types_big_int_.biginttype.html | 32 +- ..._big_unsigned_int_.bigunsignedinttype.html | 32 +- docs/classes/_types_boolean_.booleantype.html | 32 +- ...types_boolean_array_.booleanarraytype.html | 32 +- ...types_boolean_tuple_.booleantupletype.html | 28 +- docs/classes/_types_byte_.bytetype.html | 32 +- docs/classes/_types_char_.chartype.html | 32 +- docs/classes/_types_choice_.choicetype.html | 28 +- docs/classes/_types_chrono_.chronotype.html | 36 +- docs/classes/_types_date_.datetype.html | 32 +- docs/classes/_types_day_.daytype.html | 32 +- docs/classes/_types_double_.doubletype.html | 32 +- docs/classes/_types_enum_.enumtype.html | 28 +- .../classes/_types_flex_int_.flexinttype.html | 32 +- ...lex_unsigned_int_.flexunsignedinttype.html | 32 +- docs/classes/_types_float_.floattype.html | 32 +- .../_types_floating_.floatingpointtype.html | 36 +- docs/classes/_types_int_.inttype.html | 32 +- docs/classes/_types_integer_.integertype.html | 36 +- docs/classes/_types_long_.longtype.html | 32 +- docs/classes/_types_map_.maptype.html | 28 +- .../_types_named_choice_.namedchoicetype.html | 28 +- docs/classes/_types_octets_.octetstype.html | 32 +- .../_types_optional_.optionaltype.html | 28 +- docs/classes/_types_pointer_.pointertype.html | 28 +- .../_types_recursive_.recursivetype.html | 84 +- docs/classes/_types_set_.settype.html | 28 +- docs/classes/_types_short_.shorttype.html | 32 +- docs/classes/_types_string_.stringtype.html | 32 +- docs/classes/_types_struct_.structtype.html | 28 +- docs/classes/_types_time_.timetype.html | 32 +- docs/classes/_types_tuple_.tupletype.html | 28 +- .../_types_unsigned_.unsignedtype.html | 36 +- ...types_unsigned_byte_.unsignedbytetype.html | 32 +- .../_types_unsigned_int_.unsignedinttype.html | 32 +- ...types_unsigned_long_.unsignedlongtype.html | 32 +- ...pes_unsigned_short_.unsignedshorttype.html | 32 +- ...b_write_iterable_.iterablewriteparams.html | 2 +- docs/interfaces/_types_type_.type.html | 12 +- docs/modules/_lib_appendable_.html | 8 +- docs/modules/_lib_recursive_nesting_.html | 14 +- docs/modules/_recursive_registry_.html | 16 +- docs/modules/_types_abstract_.html | 22 - docs/modules/_types_pointer_.html | 2 +- docs/modules/_types_recursive_.html | 4 +- lib/appendable.ts | 2 +- package-lock.json | 1766 ++++++++++------- package.json | 12 +- recursive-registry.ts | 12 + test/type-bytes/recursive.ts | 24 +- test/value-bytes/recursive.ts | 9 +- types/recursive.ts | 27 + 66 files changed, 2086 insertions(+), 1514 deletions(-) rename docs/{interfaces => classes}/_lib_appendable_.appendablebuffer.html (86%) diff --git a/compiled/download.js b/compiled/download.js index 92a10a0..f2a6d91 100644 --- a/compiled/download.js +++ b/compiled/download.js @@ -1 +1 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var u=n[r]={i:r,l:!1,exports:{}};return e[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=65)}([function(e,t,n){"use strict";function r(e,t){t instanceof Array||(t=[t]);for(const n of t)if(e instanceof n||void 0!==e&&null!==e&&e.constructor===n)return;throw new TypeError(f.inspect(e)+" is not an instance of "+t.map(({name:e})=>e).join(" or "))}function u(e){if(r(e,Number),!Number.isSafeInteger(e))throw new RangeError(f.inspect(e)+" is not an integer")}function a(e,t,n,r){if(t=n){const u=String(t)+" is not in ["+String(e)+","+String(n)+")";throw r?new RangeError(r+" ("+u+")"):new RangeError(u)}}function s(e){throw new Error(e)}function l(e,t){e||s(t||"Assertion failed")}function o(e,t){const n=()=>new RangeError("Expected "+f.inspect(t)+" but got "+f.inspect(e));if(t){let r=!0;switch(t.constructor){case Object:if(!e||e.constructor!==Object)throw n();for(const r in t)if({}.hasOwnProperty.call(t,r))try{o(e[r],t[r])}catch(e){throw n()}break;case Array:if(!e||e.constructor!==Array)throw n();try{o(e.length,t.length)}catch(e){throw n()}for(let r=0;rn,t.NOT_LONG_ENOUGH);let a;const s=new Uint8Array(e)[n];switch(s){case 0:case 255:a=Boolean(s);break;default:throw new Error("0x"+r(s.toString(16),2)+" is an invalid Boolean value")}return{value:a,length:1}},t.readBooleans=function({buffer:e,offset:n,count:r}){const s=new Array(r),l=a.modEight(r),o=a.dividedByEight(r),i=l?o+1:o;u.default(e.byteLength>=n+i,t.NOT_LONG_ENOUGH);const f=new Uint8Array(e,n);for(let e=0;en,t.NOT_LONG_ENOUGH);const r=new Uint8Array(e,n),a=s.getByteCount(r[0]);return u.default(e.byteLength>=n+a,t.NOT_LONG_ENOUGH),{value:s.readValueBuffer(r.slice(0,a).buffer),length:a}},t.readLong=function(e,n){u.default(e.byteLength>=n+8,t.NOT_LONG_ENOUGH);const r=new DataView(e,n),a=r.getInt32(0),s=r.getUint32(4);return{value:l.add(l.mul(String(a),l.LONG_UPPER_SHIFT),String(s)),length:8}},t.readNumber=function({func:e,type:n}){const r=n.BYTES_PER_ELEMENT;return(n,a)=>(u.default(n.byteLength>=a+r,t.NOT_LONG_ENOUGH),{value:new DataView(n)[e](a),length:r})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4);class u extends r.default{}t.default=u},function(e,t,n){"use strict";function r(e){const t=7*e;return Math.pow(2,t)}Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),a=(new Map).set(0,0),s=new Map,l=new Map;{let e=1,t=0,n=-256;for(;t<=Number.MAX_SAFE_INTEGER;)t+=r(e),a.set(e,t),s.set(e,255&n),l.set(e-1,e),n>>=1,e++}t.makeValueBuffer=function(e){u.default.integer(e),u.default(e>=0,String(e)+" is negative");const t=(()=>{for(const[t,n]of a)if(n>e)return t;throw new Error("Cannot represent "+String(e))})();let n=e-a.get(t-1);const r=new Uint8Array(t);for(let e=t-1;e>=0;e--)r[e]=255&n,n=Math.floor(n/256);return r[0]|=s.get(t),r.buffer},t.getByteCount=function(e){const t=Math.clz32(~e<<24),n=l.get(t);return u.default(void 0!==n,"Invalid number of bytes"),n},t.readValueBuffer=function(e){u.default.instanceOf(e,ArrayBuffer);const t=e.byteLength;u.default(t>0,"Empty flex int buffer");const n=new Uint8Array(e);let r=n[0]^s.get(t);for(let e=1;e{if(e&&e.constructor===String){const t=Number(e);if(!isNaN(t)||"NaN"===e)return t}})},function(e,t,n){"use strict";function r(e,t){if(void 0===e)return"undefined";if(null===e||u.has(e.constructor))return JSON.stringify(e);if(e instanceof ArrayBuffer){const t=new Uint8Array(e);let n="[";for(const e of t)"["!==n&&(n+=", "),n+="0x"+(e<16?"0":"")+e.toString(16);return n+"]"}if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=""}if(e instanceof Function)return"Function "+e.name;if(t.get(e))return"[Circular]";if(t.set(e,1),e instanceof Set){let n="Set {";const u=e.values();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Map){let n="Map {";const u=e.entries();let a=u.next();for(;!a.done;)n+=r(a.value[0],t),n+=" => ",n+=r(a.value[1],t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Array){let n="[";const u=e[Symbol.iterator]();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"]"}if(e.constructor===Object){let n="{";for(const u in e)({}).hasOwnProperty.call(e,u)&&("{"!==n&&(n+=", "),n+=u+": "+r(e[u],t));return t.set(e,t.get(e)-1),n+"}"}const{name:n}=e.constructor,a=(n?n+" ":"")+r(function(e){const t={};for(const n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(e),t);return t.set(e,t.get(e)-1),a}Object.defineProperty(t,"__esModule",{value:!0});const u=new Set([String,Number,Boolean,Date]);t.inspect=function(e){return r(e,new Map)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(23),a=4096;t.toString=function(e){r.default.instanceOf(e,Uint8Array);const t=[];for(let n=0;n239?4:r>223?3:r>191?2:1;if(n+a<=e.length){let t,s,l,o;switch(a){case 1:r<128&&(u=r);break;case 2:128==(192&(t=e[n+1]))&&(o=(31&r)<<6|63&t)>127&&(u=o);break;case 3:t=e[n+1],s=e[n+2],128==(192&t)&&128==(192&s)&&(o=(15&r)<<12|(63&t)<<6|63&s)>2047&&(o<55296||o>57343)&&(u=o);break;case 4:t=e[n+1],s=e[n+2],l=e[n+3],128==(192&t)&&128==(192&s)&&128==(192&l)&&(o=(15&r)<<18|(63&t)<<12|(63&s)<<6|63&l)>65535&&o<1114112&&(u=o)}}void 0===u?(u=65533,a=1):u>65535&&(u-=65536,t.push(u>>>10&1023|55296),u=56320|1023&u),t.push(u),n+=a}let n="";for(let e=0;e>6).add(128|63&e):e<55296||e>=57344?t.add(224|e>>12).add(128|e>>6&63).add(128|63&e):(e=65536+((1023&e)<<10|1023&e),t.add(240|e>>18).add(128|e>>12&63).add(128|e>>6&63).add(128|63&e))}return t.toBuffer()},t.toBinaryString=function(e){r.default.instanceOf(e,ArrayBuffer);let t="";const n=new Uint8Array(e);for(let e=0;e=10;)l-=10,u++;0===l?a++:(r=String(l)+T(r,a),a=0)}return u>0&&(r=String(u)+T(r,a)),r}function a(e,t){if(V(e),V(t),v(e)&&v(t))return u(e,t);if(p(e)&&p(t))return b(u(w(e),w(t)));if(h(w(e),w(t))){var n=e;e=t,t=n}var a=r(w(e),w(t));return v(e)?a:b(a)}function s(e,t){return V(e),V(t),a(e,b(t))}function l(e,t){S(e),M(t);for(var n="",r=N(e),u=0,a=0,s=0;s=10;)l-=10,u++;0===l?a++:(n=String(l)+T(n,a),a=0)}return u>0&&(n=String(u)+T(n,a)),0===n.length?"0":n}function o(e,t){S(e),S(t);for(var n="0",r=N(t),a=0;a0;)e+="0",t--;return e}function A(e,t){return V(e),M(t),t>=N(e)?"0":e.charAt(e.length-t-1)}function N(e){return p(e)?e.length-1:e.length}function V(e){U(e,"string")}function S(e){V(e),function(e,t,n){if(!t.call(null,e))throw new Error("Condition "+n+" failed for value "+e)}(e,v,"isPositive")}function M(e){U(e,"number")}function E(e){if(U(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function U(e,t){if(typeof e!==t)throw new Error("Not a "+t+": "+e)}Object.defineProperty(t,"__esModule",{value:!0}),t.subPositive=r,t.add=a,t.sub=s,t.timesDigit=l,t.mulPositive=o,t.mul=i,t.quotientRemainderPositive=f,t.div=function(e,t,n=!1){V(e),V(t);var r=f(w(e),w(t))[0];return _(e,t)||(r=b(r)),!n||c(i(r,t),e)||_(e,t)||(r=s(r,"1")),r},t.eq=c,t.lt=h,t.ge=g,t.gt=y,t.isNegative=p,t.isPositive=v,t.abs=w,t.negate=b;var P=/^(-?)0*([1-9][0-9]*)$/,L=/^0+$/;t.normalize=O,t.LONG_UPPER_SHIFT="4294967296",t.BYTE_SHIFT="256"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),o=n(4);class i extends l.default{constructor(e){super(),r.default.instanceOf(e,Object);const t=Object.keys(e).length;try{r.default.byteUnsignedInteger(t)}catch(e){r.default.fail(String(t)+" fields is too many")}this.fields=new Array(t);let n=0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const a=u.fromString(t);try{r.default.byteUnsignedInteger(a.byteLength)}catch(e){r.default.fail("Field name "+t+" is too long")}const l=e[t];try{r.default.instanceOf(l,o.default)}catch(e){r.default.fail(s.inspect(l)+" is not a valid field type")}this.fields[n]={name:t,type:l,nameBuffer:a},n++}this.fields.sort((e,t)=>e.namet.name?1:0)}static get _value(){return 81}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.fields.length);for(const t of this.fields){const{nameBuffer:n}=t;e.add(n.byteLength).addAll(n),t.type.addToBuffer(e)}return!0}return!1}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Object);for(const n of this.fields){const u=t[n.name];try{n.type.writeValue(e,u)}catch(e){throw r.default(void 0!==u,'Value for field "'+n.name+'" missing'),e}}}consumeValue(e,t,n){let r=0;const u=n||a.makeBaseValue(this);for(const n of this.fields){const a=n.type.consumeValue(e,t+r);u[n.name]=a.value,r+=a.length}return{value:u,length:r}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function u(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,a=[],s=t;s0?i-4:i;var f=0;for(t=0;t>16&255,s[f++]=u>>8&255,s[f++]=255&u;return 2===a?(u=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[f++]=255&u):1===a&&(u=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[f++]=u>>8&255,s[f++]=255&u),s},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,u="",l=[],o=0,i=n-r;oi?i:o+16383));return 1===r?(t=e[n-1],u+=s[t>>2],u+=s[t<<4&63],u+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],u+=s[t>>10],u+=s[t>>4&63],u+=s[t<<2&63],u+="="),l.push(u),l.join("")};for(var s=[],l=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,c=i.length;f>>3},t.modEight=function(e){return 7&e},t.timesEight=function(e){return e<<3}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.default=(({type:e,buffer:t,value:n,length:u})=>{t.addAll(r.makeValueBuffer(u));for(const r of n)e.writeValue(t,r)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{}t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(22),u=n(0);class a extends r.default{constructor(e=10){super();try{u.default.integer(e),u.default(e>=0)}catch(t){throw new RangeError(String(e)+" is not a valid buffer length")}this.buffer=new ArrayBuffer(e),this.size=0,this.pausePoints=[]}get length(){return this.size}grow(e){if(u.default.integer(e),e>this.buffer.byteLength){const t=new ArrayBuffer(e<<1);new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=t}return this}add(e){return u.default.integer(e),u.default.between(0,e,256,"Not a byte: "+String(e)),this.addAll(new Uint8Array([e]).buffer)}addAll(e){u.default.instanceOf(e,ArrayBuffer);const t=this.size,n=this.size+e.byteLength;return this.grow(n),this.size=n,new Uint8Array(this.buffer).set(new Uint8Array(e),t),this}get rawBuffer(){return this.buffer}toBuffer(){let e;return this.pausePoints.length?[e]=this.pausePoints:e=this.size,e===this.buffer.byteLength?this.buffer:this.buffer.slice(0,e)}pause(){return this.pausePoints.push(this.size),this}resume(){if(!this.pausePoints.length)throw new Error("Was not paused");return this.pausePoints.pop(),this}reset(){if(!this.pausePoints.length)throw new Error("Was not paused");const e=this.pausePoints[this.pausePoints.length-1];return this.size=e,this}}t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new WeakMap;t.increment=function(e){const t=r.get(e)||0;r.set(e,t+1)},t.decrement=function(e){const t=r.get(e);r.set(e,t-1)},t.get=function(e){return r.get(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(10);t.default=((e,t)=>{r.default.instanceOf(t,String),r.default(!(u.gt(t,"9223372036854775807")||u.lt(t,"-9223372036854775808")),"Value out of range");const n=u.div(t,u.LONG_UPPER_SHIFT,!0),a=u.sub(t,u.mul(n,u.LONG_UPPER_SHIFT)),s=new ArrayBuffer(8),l=new DataView(s);l.setInt32(0,Number(n)),l.setUint32(4,Number(a)),e.addAll(s)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MILLIS_PER_DAY=864e5;const r=6e4;t.toUTC=function(e){return e.getTime()-e.getTimezoneOffset()*r},t.fromUTC=function(e){const t=new Date(e);return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);class u extends r.default{}t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(20);t.default=((e,t)=>{r.default.instanceOf(t,Array);e:for(let n=0;;n++){let a=0;for(let s=0;s<8;s++){const l=u.timesEight(n)|s;if(l===t.length){s&&e.add(a);break e}const o=t[l];r.default.instanceOf(o,Boolean),o&&(a|=1<<7-s)}e.add(a)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32);t.ByteType=r.default;var u=n(35);t.ShortType=u.default;var a=n(36);t.IntType=a.default;var s=n(37);t.LongType=s.default;var l=n(38);t.BigIntType=l.default;var o=n(39);t.FlexIntType=o.default;var i=n(40);t.UnsignedByteType=i.default;var f=n(41);t.UnsignedShortType=f.default;var c=n(42);t.UnsignedIntType=c.default;var d=n(43);t.UnsignedLongType=d.default;var h=n(44);t.BigUnsignedIntType=h.default;var g=n(45);t.FlexUnsignedIntType=g.default;var y=n(46);t.DateType=y.default;var p=n(47);t.DayType=p.default;var v=n(48);t.TimeType=v.default;var w=n(49);t.FloatType=w.default;var _=n(50);t.DoubleType=_.default;var b=n(51);t.BooleanType=b.default;var O=n(52);t.BooleanTupleType=O.default;var m=n(53);t.BooleanArrayType=m.default;var T=n(54);t.CharType=T.default;var B=n(55);t.StringType=B.default;var A=n(56);t.OctetsType=A.default;var N=n(15);t.TupleType=N.default;var V=n(11);t.StructType=V.default;var S=n(12);t.ArrayType=S.default;var M=n(14);t.SetType=M.default;var E=n(13);t.MapType=E.default;var U=n(57);t.EnumType=U.default;var P=n(58);t.ChoiceType=P.default;var L=n(59);t.NamedChoiceType=L.default;var x=n(60);t.RecursiveType=x.default;var I=n(61);t.OptionalType=I.default;var j=n(62);t.PointerType=j.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REPEATED_TYPE=255},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new Map;t.get=function(e){let t=r.get(e);return t||(t={[e]:class{}}[e],r.set(e,t)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int8Array,func:"getInt8"});class o extends s.default{static get _value(){return 1}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-128,t,128,"Value out of range"),e.addAll(new Int8Array([t]).buffer)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=(e,t)=>e>>>t|e<<32-t;t.default=(e=>{const t=e.byteLength,n=8*t;r.default(n===new Uint32Array([n])[0],"Bit length does not fit in a 32-bit integer");const s=t+(64-(t+72&63))+8,l=new ArrayBuffer(s),o=new Uint8Array(l);o.set(new Uint8Array(e)),o[t]=128,new DataView(l).setUint32(s-4,n);const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);for(let e=0;e>>3,u=t[e-2],s=a(u,17)^a(u,19)^u>>>10;t[e]=t[e-16]+r+t[e-7]+s}const r=i.slice();for(let e=0;e<64;e++){const n=r[0],s=r[1],l=r[2],o=r[4],i=r[5],f=r[6],c=a(o,6)^a(o,11)^a(o,25),d=o&i^~o&f,h=r[7]+c+d+u[e]+t[e],g=(a(n,2)^a(n,13)^a(n,22))+(n&s^n&l^s&l);r[7]=f,r[6]=i,r[5]=o,r[4]=r[3]+h,r[3]=l,r[2]=s,r[1]=n,r[0]=h+g}for(let e=0;e<8;e++)i[e]+=r[e]}const f=new ArrayBuffer(32),c=new DataView(f);for(let e=0;e<8;e++)c.setUint32(e<<2,i[e]);return f})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(17),u=new ArrayBuffer(2);new DataView(u).setUint16(0,12),t.VERSION_STRING=r.fromByteArray(new Uint8Array(u))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int16Array,func:"getInt16"});class o extends s.default{static get _value(){return 2}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-32768,t,32768,"Value out of range");const u=new ArrayBuffer(2);new DataView(u).setInt16(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int32Array,func:"getInt32"});class o extends s.default{static get _value(){return 3}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-2147483648,t,2147483648,"Value out of range");const u=new ArrayBuffer(4);new DataView(u).setInt32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),u=n(25),a=n(8);class s extends a.default{static get _value(){return 4}writeValue(e,t){this.isBuffer(e),u.default(e,t)}consumeValue(e,t){return r.readLong(e,t)}}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(8);class o extends l.default{static get _value(){return 5}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),t=s.normalize(t);const n=[];if(!s.eq(t,"0")){for(;s.gt(t,"127")||s.lt(t,"-128");){const e=s.div(t,s.BYTE_SHIFT,!0),r=s.sub(t,s.mul(e,s.BYTE_SHIFT));n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const o=new Uint8Array(e,t+l);let i;if(u){i=String(o[0]<<24>>24);for(let e=1;e=t+8,u.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getUint32(0),l=n.getUint32(4);return{value:a.add(a.mul(String(s),a.LONG_UPPER_SHIFT),String(l)),length:8}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(9);class o extends l.default{static get _value(){return 21}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(!s.isNegative(t),"Value out of range");const n=[];if(!s.eq(t,"0")){for(;s.ge(t,s.BYTE_SHIFT);){const[e,r]=s.quotientRemainderPositive(t,s.BYTE_SHIFT);n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const o=new Uint8Array(e,t+l);let i="0";for(let e=0;e>8),l.setUint8(2,a),e.addAll(s)}consumeValue(e,t){r.default(e.byteLength>=t+3,a.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getInt16(0)<<8|n.getUint8(2);return{value:u.fromUTC(s*u.MILLIS_PER_DAY),length:3}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(26),a=n(1),s=n(16);class l extends s.default{static get _value(){return 28}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Date);const n=new ArrayBuffer(4);new DataView(n).setUint32(0,t.getTime()%u.MILLIS_PER_DAY),e.addAll(n)}consumeValue(e,t){return r.default(e.byteLength>=t+4,a.NOT_LONG_ENOUGH),{value:new Date(new DataView(e).getUint32(t)),length:4}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float32Array,func:"getFloat32"});class o extends s.default{static get _value(){return 32}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(4);new DataView(u).setFloat32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float64Array,func:"getFloat64"});class o extends s.default{static get _value(){return 33}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(8);new DataView(u).setFloat64(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(2);class s extends a.default{static get _value(){return 48}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Boolean),e.add(t?255:0)}consumeValue(e,t){return u.readBooleanByte(e,t)}}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(28),s=n(2);class l extends s.default{static get _value(){return 49}constructor(e){super(),r.default.byteUnsignedInteger(e),this.length=e}addToBuffer(e){return!!super.addToBuffer(e)&&(e.add(this.length),!0)}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),r.default(t.length===this.length,"Length does not match: expected "+String(this.length)+" but got "+String(t.length)),a.default(e,t)}consumeValue(e,t){return u.readBooleans({buffer:e,offset:t,count:this.length})}equals(e){return super.equals(e)&&e.length===this.length}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(28),l=n(2);class o extends l.default{static get _value(){return 50}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),e.addAll(u.makeValueBuffer(t.length)),s.default(e,t)}consumeValue(e,t){const n=a.readFlexInt(e,t);let{length:r}=n;const u=a.readBooleans({buffer:e,offset:t+r,count:n.value}),{value:s}=u;return r+=u.length,{value:s,length:r}}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);class l extends s.default{static get _value(){return 64}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(1===t.length,"String must contain only 1 character"),e.addAll(u.fromString(t))}consumeValue(e,t){r.default(e.byteLength>t,a.NOT_LONG_ENOUGH);const[n]=u.toString(new Uint8Array(e,t).subarray(0,4));return{value:n,length:u.fromString(n).byteLength}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);class l extends s.default{static get _value(){return 65}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),e.addAll(u.fromString(t)).add(0)}consumeValue(e,t){const n=new Uint8Array(e,t);let s=0;for(;r.default(n.length>s,a.NOT_LONG_ENOUGH),n[s];s++);const l=u.toString(n.subarray(0,s));return s++,{value:l,length:s}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(2);class l extends s.default{static get _value(){return 66}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,ArrayBuffer),e.addAll(u.makeValueBuffer(t.byteLength)).addAll(t)}consumeValue(e,t){const n=a.readFlexInt(e,t),{length:u}=n,s=u+n.value;return r.default(e.byteLength>=t+s,a.NOT_LONG_ENOUGH),{value:e.slice(t+u,t+s),length:s}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),o=n(4);class i extends o.default{constructor({type:e,values:t}){super(),r.default.instanceOf(e,l.default),r.default.instanceOf(t,Array);try{r.default.byteUnsignedInteger(t.length)}catch(e){r.default.fail(String(t.length)+" values is too many")}const n=new Map;for(let a=0;at,a.NOT_LONG_ENOUGH);const n=new Uint8Array(e)[t],{values:u}=this;return r.default(n in u,"Index "+String(n)+" is invalid"),{value:u[n],length:1}}equals(e){if(!super.equals(e))return!1;const t=e;if(!this.type.equals(t.type))return!1;if(this.values.length!==t.values.length)return!1;const n=t.valueIndices.keys();for(const e of this.valueIndices.keys()){if(n.next().value!==e)return!1}return!0}}t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(6),s=n(2),l=n(4);class o extends s.default{constructor(e){super(),r.default.instanceOf(e,Array);try{r.default.byteUnsignedInteger(e.length)}catch(t){r.default.fail(String(e.length)+" types is too many")}for(const t of e)r.default.instanceOf(t,l.default);this.types=e}static get _value(){return 86}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.types.length);for(const t of this.types)t.addToBuffer(e);return!0}return!1}writeValue(e,t){this.isBuffer(e),e.pause();let n=!1;for(let r=0;rt,u.NOT_LONG_ENOUGH);const a=new Uint8Array(e)[t],{value:s,length:l}=this.types[a].consumeValue(e,t+n);return n+=l,{value:s,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.types.length!==t.types.length)return!1;for(let e=0;et,s.NOT_LONG_ENOUGH);const u=new Uint8Array(e)[t],l=this.indexConstructors.get(u);if(void 0===l)throw new Error("Constructor index "+String(u)+" is invalid");const o=a.get(l.name),{value:i,length:f}=this.constructorTypes[u].type.consumeValue(e,t+n,new o);return n+=f,{value:i,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.constructorTypes.length!==t.constructorTypes.length)return!1;for(let e=0;e=0,"Offset is negative: "+String(t));const n=new Uint8Array(e);u.default(e.byteLength>t,o.NOT_LONG_ENOUGH);const d=n[t];let p,v=1;const w=h.get(d);if(w)return{value:new w,length:v};switch(d){case c.BooleanTupleType._value:{u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const r=n[t+v];v++,p=new c.BooleanTupleType(r);break}case c.TupleType._value:{const a=r(e,t+v);v+=a.length,u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++,p=new c.TupleType({type:a.value,length:s});break}case c.StructType._value:{u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++;const l={};for(let i=0;it+v,o.NOT_LONG_ENOUGH);const s=n[t+v],i=t+ ++v,f=i+s;u.default(e.byteLength>=f,o.NOT_LONG_ENOUGH);const c=a.toString(n.subarray(i,f));v+=s;const d=r(e,f);l[c]=d.value,v+=d.length}p=new c.StructType(l);break}case c.ArrayType._value:{const n=r(e,t+v);v+=n.length,p=new c.ArrayType(n.value);break}case c.SetType._value:{const n=r(e,t+v);v+=n.length,p=new c.SetType(n.value);break}case c.MapType._value:{const n=r(e,t+v),u=r(e,t+(v+=n.length));v+=u.length,p=new c.MapType(n.value,u.value);break}case c.EnumType._value:{const a=r(e,t+v),s=a.value;v+=a.length,u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const l=n[t+v];v++;const i=new Array(l);for(let n=0;nt+v,o.NOT_LONG_ENOUGH);const a=n[t+v];v++;const s=new Array(a);for(let n=0;nt+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++;const f=new Map;for(let d=0;dt+v,o.NOT_LONG_ENOUGH);const s=n[t+v],d=t+ ++v,h=d+s;u.default(e.byteLength>=h,o.NOT_LONG_ENOUGH);const g=a.toString(n.subarray(d,h));v+=s;const y=r(e,h);if(!(y.value instanceof c.StructType))throw new Error("Not a StructType: "+i.inspect(y.value));f.set(l.get(g),y.value),v+=y.length}p=new c.NamedChoiceType(f);break}case c.RecursiveType._value:{const n=o.readFlexInt(e,t+v),u=n.value;v+=n.length;let a,s=y.get(e);if(s?a=s.get(u):(s=new Map,y.set(e,s)),void 0===a){do{a="read-type";for(let e=0;e{if(!t.ok)throw new Error("Received status of "+String(t.status));const n=t.headers.get("sig");return r&&r.sig===n?t.arrayBuffer().then(e=>{const t=r.type.readValue(e);return Promise.resolve(t)}):t.arrayBuffer().then(t=>{const r=s._consumeType(t,0),a=r.value,o=a.readValue(t,r.length);return l[e]={sig:n,type:a},function(){const e={};for(const t in l)e[t]={sig:l[t].sig,type:u.fromByteArray(new Uint8Array(l[t].type.toBuffer()))};localStorage.typeCache=JSON.stringify(e)}(),Promise.resolve(o)})})}Object.defineProperty(t,"__esModule",{value:!0});const u=n(17),a=n(19),s=n(63),l={};if(localStorage.typeCache){const e=JSON.parse(localStorage.typeCache);for(const t in e)l[t]={sig:e[t].sig,type:s.type(u.toByteArray(e[t].type).buffer)}}t.download=r,function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(19)),window.sb=t}]); \ No newline at end of file +!function(e){function t(r){if(n[r])return n[r].exports;var u=n[r]={i:r,l:!1,exports:{}};return e[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=65)}([function(e,t,n){"use strict";function r(e,t){t instanceof Array||(t=[t]);for(const n of t)if(e instanceof n||void 0!==e&&null!==e&&e.constructor===n)return;throw new TypeError(f.inspect(e)+" is not an instance of "+t.map(({name:e})=>e).join(" or "))}function u(e){if(r(e,Number),!Number.isSafeInteger(e))throw new RangeError(f.inspect(e)+" is not an integer")}function a(e,t,n,r){if(t=n){const u=String(t)+" is not in ["+String(e)+","+String(n)+")";throw r?new RangeError(r+" ("+u+")"):new RangeError(u)}}function s(e){throw new Error(e)}function l(e,t){e||s(t||"Assertion failed")}function o(e,t){const n=()=>new RangeError("Expected "+f.inspect(t)+" but got "+f.inspect(e));if(t){let r=!0;switch(t.constructor){case Object:if(!e||e.constructor!==Object)throw n();for(const r in t)if({}.hasOwnProperty.call(t,r))try{o(e[r],t[r])}catch(e){throw n()}break;case Array:if(!e||e.constructor!==Array)throw n();try{o(e.length,t.length)}catch(e){throw n()}for(let r=0;rn,t.NOT_LONG_ENOUGH);let a;const s=new Uint8Array(e)[n];switch(s){case 0:case 255:a=Boolean(s);break;default:throw new Error("0x"+r(s.toString(16),2)+" is an invalid Boolean value")}return{value:a,length:1}},t.readBooleans=function({buffer:e,offset:n,count:r}){const s=new Array(r),l=a.modEight(r),o=a.dividedByEight(r),i=l?o+1:o;u.default(e.byteLength>=n+i,t.NOT_LONG_ENOUGH);const f=new Uint8Array(e,n);for(let e=0;en,t.NOT_LONG_ENOUGH);const r=new Uint8Array(e,n),a=s.getByteCount(r[0]);return u.default(e.byteLength>=n+a,t.NOT_LONG_ENOUGH),{value:s.readValueBuffer(r.slice(0,a).buffer),length:a}},t.readLong=function(e,n){u.default(e.byteLength>=n+8,t.NOT_LONG_ENOUGH);const r=new DataView(e,n),a=r.getInt32(0),s=r.getUint32(4);return{value:l.add(l.mul(String(a),l.LONG_UPPER_SHIFT),String(s)),length:8}},t.readNumber=function({func:e,type:n}){const r=n.BYTES_PER_ELEMENT;return(n,a)=>(u.default(n.byteLength>=a+r,t.NOT_LONG_ENOUGH),{value:new DataView(n)[e](a),length:r})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4);t.default=class extends r.default{}},function(e,t,n){"use strict";function r(e){const t=7*e;return Math.pow(2,t)}Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),a=(new Map).set(0,0),s=new Map,l=new Map;{let e=1,t=0,n=-256;for(;t<=Number.MAX_SAFE_INTEGER;)t+=r(e),a.set(e,t),s.set(e,255&n),l.set(e-1,e),n>>=1,e++}t.makeValueBuffer=function(e){u.default.integer(e),u.default(e>=0,String(e)+" is negative");const t=(()=>{for(const[t,n]of a)if(n>e)return t;throw new Error("Cannot represent "+String(e))})();let n=e-a.get(t-1);const r=new Uint8Array(t);for(let e=t-1;e>=0;e--)r[e]=255&n,n=Math.floor(n/256);return r[0]|=s.get(t),r.buffer},t.getByteCount=function(e){const t=Math.clz32(~e<<24),n=l.get(t);return u.default(void 0!==n,"Invalid number of bytes"),n},t.readValueBuffer=function(e){u.default.instanceOf(e,ArrayBuffer);const t=e.byteLength;u.default(t>0,"Empty flex int buffer");const n=new Uint8Array(e);let r=n[0]^s.get(t);for(let e=1;e{if(e&&e.constructor===String){const t=Number(e);if(!isNaN(t)||"NaN"===e)return t}})},function(e,t,n){"use strict";function r(e,t){if(void 0===e)return"undefined";if(null===e||u.has(e.constructor))return JSON.stringify(e);if(e instanceof ArrayBuffer){const t=new Uint8Array(e);let n="[";for(const e of t)"["!==n&&(n+=", "),n+="0x"+(e<16?"0":"")+e.toString(16);return n+"]"}if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=""}if(e instanceof Function)return"Function "+e.name;if(t.get(e))return"[Circular]";if(t.set(e,1),e instanceof Set){let n="Set {";const u=e.values();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Map){let n="Map {";const u=e.entries();let a=u.next();for(;!a.done;)n+=r(a.value[0],t),n+=" => ",n+=r(a.value[1],t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Array){let n="[";const u=e[Symbol.iterator]();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"]"}if(e.constructor===Object){let n="{";for(const u in e)({}).hasOwnProperty.call(e,u)&&("{"!==n&&(n+=", "),n+=u+": "+r(e[u],t));return t.set(e,t.get(e)-1),n+"}"}const{name:n}=e.constructor,a=(n?n+" ":"")+r(function(e){const t={};for(const n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(e),t);return t.set(e,t.get(e)-1),a}Object.defineProperty(t,"__esModule",{value:!0});const u=new Set([String,Number,Boolean,Date]);t.inspect=function(e){return r(e,new Map)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(23),a=4096;t.toString=function(e){r.default.instanceOf(e,Uint8Array);const t=[];for(let n=0;n239?4:r>223?3:r>191?2:1;if(n+a<=e.length){let t,s,l,o;switch(a){case 1:r<128&&(u=r);break;case 2:128==(192&(t=e[n+1]))&&(o=(31&r)<<6|63&t)>127&&(u=o);break;case 3:t=e[n+1],s=e[n+2],128==(192&t)&&128==(192&s)&&(o=(15&r)<<12|(63&t)<<6|63&s)>2047&&(o<55296||o>57343)&&(u=o);break;case 4:t=e[n+1],s=e[n+2],l=e[n+3],128==(192&t)&&128==(192&s)&&128==(192&l)&&(o=(15&r)<<18|(63&t)<<12|(63&s)<<6|63&l)>65535&&o<1114112&&(u=o)}}void 0===u?(u=65533,a=1):u>65535&&(u-=65536,t.push(u>>>10&1023|55296),u=56320|1023&u),t.push(u),n+=a}let n="";for(let e=0;e>6).add(128|63&e):e<55296||e>=57344?t.add(224|e>>12).add(128|e>>6&63).add(128|63&e):(e=65536+((1023&e)<<10|1023&e),t.add(240|e>>18).add(128|e>>12&63).add(128|e>>6&63).add(128|63&e))}return t.toBuffer()},t.toBinaryString=function(e){r.default.instanceOf(e,ArrayBuffer);let t="";const n=new Uint8Array(e);for(let e=0;e=10;)l-=10,u++;0===l?a++:(r=String(l)+T(r,a),a=0)}return u>0&&(r=String(u)+T(r,a)),r}function a(e,t){if(V(e),V(t),v(e)&&v(t))return u(e,t);if(p(e)&&p(t))return b(u(w(e),w(t)));if(h(w(e),w(t))){var n=e;e=t,t=n}var a=r(w(e),w(t));return v(e)?a:b(a)}function s(e,t){return V(e),V(t),a(e,b(t))}function l(e,t){S(e),M(t);for(var n="",r=N(e),u=0,a=0,s=0;s=10;)l-=10,u++;0===l?a++:(n=String(l)+T(n,a),a=0)}return u>0&&(n=String(u)+T(n,a)),0===n.length?"0":n}function o(e,t){S(e),S(t);for(var n="0",r=N(t),a=0;a0;)e+="0",t--;return e}function A(e,t){return V(e),M(t),t>=N(e)?"0":e.charAt(e.length-t-1)}function N(e){return p(e)?e.length-1:e.length}function V(e){U(e,"string")}function S(e){V(e),function(e,t,n){if(!t.call(null,e))throw new Error("Condition "+n+" failed for value "+e)}(e,v,"isPositive")}function M(e){U(e,"number")}function E(e){if(U(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function U(e,t){if(typeof e!==t)throw new Error("Not a "+t+": "+e)}Object.defineProperty(t,"__esModule",{value:!0}),t.subPositive=r,t.add=a,t.sub=s,t.timesDigit=l,t.mulPositive=o,t.mul=i,t.quotientRemainderPositive=f,t.div=function(e,t,n=!1){V(e),V(t);var r=f(w(e),w(t))[0];return _(e,t)||(r=b(r)),!n||c(i(r,t),e)||_(e,t)||(r=s(r,"1")),r},t.eq=c,t.lt=h,t.ge=g,t.gt=y,t.isNegative=p,t.isPositive=v,t.abs=w,t.negate=b;var P=/^(-?)0*([1-9][0-9]*)$/,L=/^0+$/;t.normalize=O,t.LONG_UPPER_SHIFT="4294967296",t.BYTE_SHIFT="256"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),o=n(4);t.default=class extends l.default{constructor(e){super(),r.default.instanceOf(e,Object);const t=Object.keys(e).length;try{r.default.byteUnsignedInteger(t)}catch(e){r.default.fail(String(t)+" fields is too many")}this.fields=new Array(t);let n=0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const a=u.fromString(t);try{r.default.byteUnsignedInteger(a.byteLength)}catch(e){r.default.fail("Field name "+t+" is too long")}const l=e[t];try{r.default.instanceOf(l,o.default)}catch(e){r.default.fail(s.inspect(l)+" is not a valid field type")}this.fields[n]={name:t,type:l,nameBuffer:a},n++}this.fields.sort((e,t)=>e.namet.name?1:0)}static get _value(){return 81}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.fields.length);for(const t of this.fields){const{nameBuffer:n}=t;e.add(n.byteLength).addAll(n),t.type.addToBuffer(e)}return!0}return!1}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Object);for(const n of this.fields){const u=t[n.name];try{n.type.writeValue(e,u)}catch(e){throw r.default(void 0!==u,'Value for field "'+n.name+'" missing'),e}}}consumeValue(e,t,n){let r=0;const u=n||a.makeBaseValue(this);for(const n of this.fields){const a=n.type.consumeValue(e,t+r);u[n.name]=a.value,r+=a.length}return{value:u,length:r}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function u(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,a=[],s=t;s0?i-4:i;var f=0;for(t=0;t>16&255,s[f++]=u>>8&255,s[f++]=255&u;return 2===a?(u=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[f++]=255&u):1===a&&(u=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[f++]=u>>8&255,s[f++]=255&u),s},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,u="",l=[],o=0,i=n-r;oi?i:o+16383));return 1===r?(t=e[n-1],u+=s[t>>2],u+=s[t<<4&63],u+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],u+=s[t>>10],u+=s[t>>4&63],u+=s[t<<2&63],u+="="),l.push(u),l.join("")};for(var s=[],l=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,c=i.length;f>>3},t.modEight=function(e){return 7&e},t.timesEight=function(e){return e<<3}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.default=(({type:e,buffer:t,value:n,length:u})=>{t.addAll(r.makeValueBuffer(u));for(const r of n)e.writeValue(t,r)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(22),u=n(0),a=10;t.default=class extends r.default{constructor(e=a){super();try{u.default.integer(e),u.default(e>=0)}catch(t){throw new RangeError(String(e)+" is not a valid buffer length")}this.buffer=new ArrayBuffer(e),this.size=0,this.pausePoints=[]}get length(){return this.size}grow(e){if(u.default.integer(e),e>this.buffer.byteLength){const t=new ArrayBuffer(e<<1);new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=t}return this}add(e){return u.default.integer(e),u.default.between(0,e,256,"Not a byte: "+String(e)),this.addAll(new Uint8Array([e]).buffer)}addAll(e){u.default.instanceOf(e,ArrayBuffer);const t=this.size,n=this.size+e.byteLength;return this.grow(n),this.size=n,new Uint8Array(this.buffer).set(new Uint8Array(e),t),this}get rawBuffer(){return this.buffer}toBuffer(){let e;return this.pausePoints.length?[e]=this.pausePoints:e=this.size,e===this.buffer.byteLength?this.buffer:this.buffer.slice(0,e)}pause(){return this.pausePoints.push(this.size),this}resume(){if(!this.pausePoints.length)throw new Error("Was not paused");return this.pausePoints.pop(),this}reset(){if(!this.pausePoints.length)throw new Error("Was not paused");const e=this.pausePoints[this.pausePoints.length-1];return this.size=e,this}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new WeakMap;t.increment=function(e){const t=r.get(e)||0;r.set(e,t+1)},t.decrement=function(e){const t=r.get(e);r.set(e,t-1)},t.get=function(e){return r.get(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(10);t.default=((e,t)=>{r.default.instanceOf(t,String),r.default(!(u.gt(t,"9223372036854775807")||u.lt(t,"-9223372036854775808")),"Value out of range");const n=u.div(t,u.LONG_UPPER_SHIFT,!0),a=u.sub(t,u.mul(n,u.LONG_UPPER_SHIFT)),s=new ArrayBuffer(8),l=new DataView(s);l.setInt32(0,Number(n)),l.setUint32(4,Number(a)),e.addAll(s)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MILLIS_PER_DAY=864e5;const r=6e4;t.toUTC=function(e){return e.getTime()-e.getTimezoneOffset()*r},t.fromUTC=function(e){const t=new Date(e);return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);t.default=class extends r.default{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(20);t.default=((e,t)=>{r.default.instanceOf(t,Array);e:for(let n=0;;n++){let a=0;for(let s=0;s<8;s++){const l=u.timesEight(n)|s;if(l===t.length){s&&e.add(a);break e}const o=t[l];r.default.instanceOf(o,Boolean),o&&(a|=1<<7-s)}e.add(a)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32);t.ByteType=r.default;var u=n(35);t.ShortType=u.default;var a=n(36);t.IntType=a.default;var s=n(37);t.LongType=s.default;var l=n(38);t.BigIntType=l.default;var o=n(39);t.FlexIntType=o.default;var i=n(40);t.UnsignedByteType=i.default;var f=n(41);t.UnsignedShortType=f.default;var c=n(42);t.UnsignedIntType=c.default;var d=n(43);t.UnsignedLongType=d.default;var h=n(44);t.BigUnsignedIntType=h.default;var g=n(45);t.FlexUnsignedIntType=g.default;var y=n(46);t.DateType=y.default;var p=n(47);t.DayType=p.default;var v=n(48);t.TimeType=v.default;var w=n(49);t.FloatType=w.default;var _=n(50);t.DoubleType=_.default;var b=n(51);t.BooleanType=b.default;var O=n(52);t.BooleanTupleType=O.default;var m=n(53);t.BooleanArrayType=m.default;var T=n(54);t.CharType=T.default;var B=n(55);t.StringType=B.default;var A=n(56);t.OctetsType=A.default;var N=n(15);t.TupleType=N.default;var V=n(11);t.StructType=V.default;var S=n(12);t.ArrayType=S.default;var M=n(14);t.SetType=M.default;var E=n(13);t.MapType=E.default;var U=n(57);t.EnumType=U.default;var P=n(58);t.ChoiceType=P.default;var L=n(59);t.NamedChoiceType=L.default;var x=n(60);t.RecursiveType=x.default;var I=n(61);t.OptionalType=I.default;var j=n(62);t.PointerType=j.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REPEATED_TYPE=255},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new Map;t.get=function(e){let t=r.get(e);return t||(t={[e]:class{}}[e],r.set(e,t)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int8Array,func:"getInt8"});t.default=class extends s.default{static get _value(){return 1}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-128,t,128,"Value out of range"),e.addAll(new Int8Array([t]).buffer)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=(e,t)=>e>>>t|e<<32-t;t.default=(e=>{const t=e.byteLength,n=8*t;r.default(n===new Uint32Array([n])[0],"Bit length does not fit in a 32-bit integer");const s=t+(64-(t+72&63))+8,l=new ArrayBuffer(s),o=new Uint8Array(l);o.set(new Uint8Array(e)),o[t]=128,new DataView(l).setUint32(s-4,n);const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);for(let e=0;e>>3,u=t[e-2],s=a(u,17)^a(u,19)^u>>>10;t[e]=t[e-16]+r+t[e-7]+s}const r=i.slice();for(let e=0;e<64;e++){const n=r[0],s=r[1],l=r[2],o=r[4],i=r[5],f=r[6],c=a(o,6)^a(o,11)^a(o,25),d=o&i^~o&f,h=r[7]+c+d+u[e]+t[e],g=(a(n,2)^a(n,13)^a(n,22))+(n&s^n&l^s&l);r[7]=f,r[6]=i,r[5]=o,r[4]=r[3]+h,r[3]=l,r[2]=s,r[1]=n,r[0]=h+g}for(let e=0;e<8;e++)i[e]+=r[e]}const f=new ArrayBuffer(32),c=new DataView(f);for(let e=0;e<8;e++)c.setUint32(e<<2,i[e]);return f})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(17),u=new ArrayBuffer(2);new DataView(u).setUint16(0,12),t.VERSION_STRING=r.fromByteArray(new Uint8Array(u))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int16Array,func:"getInt16"});t.default=class extends s.default{static get _value(){return 2}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-32768,t,32768,"Value out of range");const u=new ArrayBuffer(2);new DataView(u).setInt16(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int32Array,func:"getInt32"});t.default=class extends s.default{static get _value(){return 3}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-2147483648,t,2147483648,"Value out of range");const u=new ArrayBuffer(4);new DataView(u).setInt32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),u=n(25),a=n(8);t.default=class extends a.default{static get _value(){return 4}writeValue(e,t){this.isBuffer(e),u.default(e,t)}consumeValue(e,t){return r.readLong(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(8);t.default=class extends l.default{static get _value(){return 5}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),t=s.normalize(t);const n=[];if(!s.eq(t,"0")){for(;s.gt(t,"127")||s.lt(t,"-128");){const e=s.div(t,s.BYTE_SHIFT,!0),r=s.sub(t,s.mul(e,s.BYTE_SHIFT));n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const o=new Uint8Array(e,t+l);let i;if(u){i=String(o[0]<<24>>24);for(let e=1;e=t+8,u.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getUint32(0),l=n.getUint32(4);return{value:a.add(a.mul(String(s),a.LONG_UPPER_SHIFT),String(l)),length:8}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(9);t.default=class extends l.default{static get _value(){return 21}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(!s.isNegative(t),"Value out of range");const n=[];if(!s.eq(t,"0")){for(;s.ge(t,s.BYTE_SHIFT);){const[e,r]=s.quotientRemainderPositive(t,s.BYTE_SHIFT);n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const o=new Uint8Array(e,t+l);let i="0";for(let e=0;e>8),l.setUint8(2,a),e.addAll(s)}consumeValue(e,t){r.default(e.byteLength>=t+3,a.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getInt16(0)<<8|n.getUint8(2);return{value:u.fromUTC(s*u.MILLIS_PER_DAY),length:3}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(26),a=n(1),s=n(16);t.default=class extends s.default{static get _value(){return 28}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Date);const n=new ArrayBuffer(4);new DataView(n).setUint32(0,t.getTime()%u.MILLIS_PER_DAY),e.addAll(n)}consumeValue(e,t){return r.default(e.byteLength>=t+4,a.NOT_LONG_ENOUGH),{value:new Date(new DataView(e).getUint32(t)),length:4}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float32Array,func:"getFloat32"});t.default=class extends s.default{static get _value(){return 32}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(4);new DataView(u).setFloat32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float64Array,func:"getFloat64"});t.default=class extends s.default{static get _value(){return 33}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(8);new DataView(u).setFloat64(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(2);t.default=class extends a.default{static get _value(){return 48}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Boolean),e.add(t?255:0)}consumeValue(e,t){return u.readBooleanByte(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(28),s=n(2);t.default=class extends s.default{static get _value(){return 49}constructor(e){super(),r.default.byteUnsignedInteger(e),this.length=e}addToBuffer(e){return!!super.addToBuffer(e)&&(e.add(this.length),!0)}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),r.default(t.length===this.length,"Length does not match: expected "+String(this.length)+" but got "+String(t.length)),a.default(e,t)}consumeValue(e,t){return u.readBooleans({buffer:e,offset:t,count:this.length})}equals(e){return super.equals(e)&&e.length===this.length}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(28),l=n(2);t.default=class extends l.default{static get _value(){return 50}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),e.addAll(u.makeValueBuffer(t.length)),s.default(e,t)}consumeValue(e,t){const n=a.readFlexInt(e,t);let{length:r}=n;const u=a.readBooleans({buffer:e,offset:t+r,count:n.value}),{value:s}=u;return r+=u.length,{value:s,length:r}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 64}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(1===t.length,"String must contain only 1 character"),e.addAll(u.fromString(t))}consumeValue(e,t){r.default(e.byteLength>t,a.NOT_LONG_ENOUGH);const[n]=u.toString(new Uint8Array(e,t).subarray(0,4));return{value:n,length:u.fromString(n).byteLength}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 65}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),e.addAll(u.fromString(t)).add(0)}consumeValue(e,t){const n=new Uint8Array(e,t);let s=0;for(;r.default(n.length>s,a.NOT_LONG_ENOUGH),n[s];s++);const l=u.toString(n.subarray(0,s));return s++,{value:l,length:s}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 66}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,ArrayBuffer),e.addAll(u.makeValueBuffer(t.byteLength)).addAll(t)}consumeValue(e,t){const n=a.readFlexInt(e,t),{length:u}=n,s=u+n.value;return r.default(e.byteLength>=t+s,a.NOT_LONG_ENOUGH),{value:e.slice(t+u,t+s),length:s}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),o=n(4);t.default=class extends o.default{constructor({type:e,values:t}){super(),r.default.instanceOf(e,l.default),r.default.instanceOf(t,Array);try{r.default.byteUnsignedInteger(t.length)}catch(e){r.default.fail(String(t.length)+" values is too many")}const n=new Map;for(let a=0;at,a.NOT_LONG_ENOUGH);const n=new Uint8Array(e)[t],{values:u}=this;return r.default(n in u,"Index "+String(n)+" is invalid"),{value:u[n],length:1}}equals(e){if(!super.equals(e))return!1;const t=e;if(!this.type.equals(t.type))return!1;if(this.values.length!==t.values.length)return!1;const n=t.valueIndices.keys();for(const e of this.valueIndices.keys())if(n.next().value!==e)return!1;return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(6),s=n(2),l=n(4);t.default=class extends s.default{constructor(e){super(),r.default.instanceOf(e,Array);try{r.default.byteUnsignedInteger(e.length)}catch(t){r.default.fail(String(e.length)+" types is too many")}for(const t of e)r.default.instanceOf(t,l.default);this.types=e}static get _value(){return 86}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.types.length);for(const t of this.types)t.addToBuffer(e);return!0}return!1}writeValue(e,t){this.isBuffer(e),e.pause();let n=!1;for(let r=0;rt,u.NOT_LONG_ENOUGH);const a=new Uint8Array(e)[t],{value:s,length:l}=this.types[a].consumeValue(e,t+n);return n+=l,{value:s,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.types.length!==t.types.length)return!1;for(let e=0;et,s.NOT_LONG_ENOUGH);const u=new Uint8Array(e)[t],l=this.indexConstructors.get(u);if(void 0===l)throw new Error("Constructor index "+String(u)+" is invalid");const o=a.get(l.name),{value:i,length:f}=this.constructorTypes[u].type.consumeValue(e,t+n,new o);return n+=f,{value:i,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.constructorTypes.length!==t.constructorTypes.length)return!1;for(let e=0;e=0,"Offset is negative: "+String(t));const n=new Uint8Array(e);u.default(e.byteLength>t,o.NOT_LONG_ENOUGH);const d=n[t];let p,v=1;const w=h.get(d);if(w)return{value:new w,length:v};switch(d){case c.BooleanTupleType._value:{u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const r=n[t+v];v++,p=new c.BooleanTupleType(r);break}case c.TupleType._value:{const a=r(e,t+v);v+=a.length,u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++,p=new c.TupleType({type:a.value,length:s});break}case c.StructType._value:{u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++;const l={};for(let i=0;it+v,o.NOT_LONG_ENOUGH);const s=n[t+v],i=t+ ++v,f=i+s;u.default(e.byteLength>=f,o.NOT_LONG_ENOUGH);const c=a.toString(n.subarray(i,f));v+=s;const d=r(e,f);l[c]=d.value,v+=d.length}p=new c.StructType(l);break}case c.ArrayType._value:{const n=r(e,t+v);v+=n.length,p=new c.ArrayType(n.value);break}case c.SetType._value:{const n=r(e,t+v);v+=n.length,p=new c.SetType(n.value);break}case c.MapType._value:{const n=r(e,t+v),u=r(e,t+(v+=n.length));v+=u.length,p=new c.MapType(n.value,u.value);break}case c.EnumType._value:{const a=r(e,t+v),s=a.value;v+=a.length,u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const l=n[t+v];v++;const i=new Array(l);for(let n=0;nt+v,o.NOT_LONG_ENOUGH);const a=n[t+v];v++;const s=new Array(a);for(let n=0;nt+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++;const f=new Map;for(let d=0;dt+v,o.NOT_LONG_ENOUGH);const s=n[t+v],d=t+ ++v,h=d+s;u.default(e.byteLength>=h,o.NOT_LONG_ENOUGH);const g=a.toString(n.subarray(d,h));v+=s;const y=r(e,h);if(!(y.value instanceof c.StructType))throw new Error("Not a StructType: "+i.inspect(y.value));f.set(l.get(g),y.value),v+=y.length}p=new c.NamedChoiceType(f);break}case c.RecursiveType._value:{const n=o.readFlexInt(e,t+v),u=n.value;v+=n.length;let a,s=y.get(e);if(s?a=s.get(u):(s=new Map,y.set(e,s)),void 0===a){do{a="read-type";for(let e=0;e{if(!t.ok)throw new Error("Received status of "+String(t.status));const n=t.headers.get("sig");return l&&l.sig===n?t.arrayBuffer().then(e=>{const t=l.type.readValue(e);return Promise.resolve(t)}):t.arrayBuffer().then(t=>{const u=a._consumeType(t,0),l=u.value,o=l.readValue(t,u.length);return s[e]={sig:n,type:l},function(){const e={};for(const t in s)e[t]={sig:s[t].sig,type:r.fromByteArray(new Uint8Array(s[t].type.toBuffer()))};localStorage.typeCache=JSON.stringify(e)}(),Promise.resolve(o)})})},function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(19)),window.sb=t}]); \ No newline at end of file diff --git a/compiled/upload-download.js b/compiled/upload-download.js index 61977cc..a1c92da 100644 --- a/compiled/upload-download.js +++ b/compiled/upload-download.js @@ -1 +1 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var u=n[r]={i:r,l:!1,exports:{}};return e[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=66)}([function(e,t,n){"use strict";function r(e,t){t instanceof Array||(t=[t]);for(const n of t)if(e instanceof n||void 0!==e&&null!==e&&e.constructor===n)return;throw new TypeError(f.inspect(e)+" is not an instance of "+t.map(({name:e})=>e).join(" or "))}function u(e){if(r(e,Number),!Number.isSafeInteger(e))throw new RangeError(f.inspect(e)+" is not an integer")}function a(e,t,n,r){if(t=n){const u=String(t)+" is not in ["+String(e)+","+String(n)+")";throw r?new RangeError(r+" ("+u+")"):new RangeError(u)}}function s(e){throw new Error(e)}function l(e,t){e||s(t||"Assertion failed")}function o(e,t){const n=()=>new RangeError("Expected "+f.inspect(t)+" but got "+f.inspect(e));if(t){let r=!0;switch(t.constructor){case Object:if(!e||e.constructor!==Object)throw n();for(const r in t)if({}.hasOwnProperty.call(t,r))try{o(e[r],t[r])}catch(e){throw n()}break;case Array:if(!e||e.constructor!==Array)throw n();try{o(e.length,t.length)}catch(e){throw n()}for(let r=0;rn,t.NOT_LONG_ENOUGH);let a;const s=new Uint8Array(e)[n];switch(s){case 0:case 255:a=Boolean(s);break;default:throw new Error("0x"+r(s.toString(16),2)+" is an invalid Boolean value")}return{value:a,length:1}},t.readBooleans=function({buffer:e,offset:n,count:r}){const s=new Array(r),l=a.modEight(r),o=a.dividedByEight(r),i=l?o+1:o;u.default(e.byteLength>=n+i,t.NOT_LONG_ENOUGH);const f=new Uint8Array(e,n);for(let e=0;en,t.NOT_LONG_ENOUGH);const r=new Uint8Array(e,n),a=s.getByteCount(r[0]);return u.default(e.byteLength>=n+a,t.NOT_LONG_ENOUGH),{value:s.readValueBuffer(r.slice(0,a).buffer),length:a}},t.readLong=function(e,n){u.default(e.byteLength>=n+8,t.NOT_LONG_ENOUGH);const r=new DataView(e,n),a=r.getInt32(0),s=r.getUint32(4);return{value:l.add(l.mul(String(a),l.LONG_UPPER_SHIFT),String(s)),length:8}},t.readNumber=function({func:e,type:n}){const r=n.BYTES_PER_ELEMENT;return(n,a)=>(u.default(n.byteLength>=a+r,t.NOT_LONG_ENOUGH),{value:new DataView(n)[e](a),length:r})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4);class u extends r.default{}t.default=u},function(e,t,n){"use strict";function r(e){const t=7*e;return Math.pow(2,t)}Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),a=(new Map).set(0,0),s=new Map,l=new Map;{let e=1,t=0,n=-256;for(;t<=Number.MAX_SAFE_INTEGER;)t+=r(e),a.set(e,t),s.set(e,255&n),l.set(e-1,e),n>>=1,e++}t.makeValueBuffer=function(e){u.default.integer(e),u.default(e>=0,String(e)+" is negative");const t=(()=>{for(const[t,n]of a)if(n>e)return t;throw new Error("Cannot represent "+String(e))})();let n=e-a.get(t-1);const r=new Uint8Array(t);for(let e=t-1;e>=0;e--)r[e]=255&n,n=Math.floor(n/256);return r[0]|=s.get(t),r.buffer},t.getByteCount=function(e){const t=Math.clz32(~e<<24),n=l.get(t);return u.default(void 0!==n,"Invalid number of bytes"),n},t.readValueBuffer=function(e){u.default.instanceOf(e,ArrayBuffer);const t=e.byteLength;u.default(t>0,"Empty flex int buffer");const n=new Uint8Array(e);let r=n[0]^s.get(t);for(let e=1;e{if(e&&e.constructor===String){const t=Number(e);if(!isNaN(t)||"NaN"===e)return t}})},function(e,t,n){"use strict";function r(e,t){if(void 0===e)return"undefined";if(null===e||u.has(e.constructor))return JSON.stringify(e);if(e instanceof ArrayBuffer){const t=new Uint8Array(e);let n="[";for(const e of t)"["!==n&&(n+=", "),n+="0x"+(e<16?"0":"")+e.toString(16);return n+"]"}if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=""}if(e instanceof Function)return"Function "+e.name;if(t.get(e))return"[Circular]";if(t.set(e,1),e instanceof Set){let n="Set {";const u=e.values();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Map){let n="Map {";const u=e.entries();let a=u.next();for(;!a.done;)n+=r(a.value[0],t),n+=" => ",n+=r(a.value[1],t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Array){let n="[";const u=e[Symbol.iterator]();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"]"}if(e.constructor===Object){let n="{";for(const u in e)({}).hasOwnProperty.call(e,u)&&("{"!==n&&(n+=", "),n+=u+": "+r(e[u],t));return t.set(e,t.get(e)-1),n+"}"}const{name:n}=e.constructor,a=(n?n+" ":"")+r(function(e){const t={};for(const n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(e),t);return t.set(e,t.get(e)-1),a}Object.defineProperty(t,"__esModule",{value:!0});const u=new Set([String,Number,Boolean,Date]);t.inspect=function(e){return r(e,new Map)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(23),a=4096;t.toString=function(e){r.default.instanceOf(e,Uint8Array);const t=[];for(let n=0;n239?4:r>223?3:r>191?2:1;if(n+a<=e.length){let t,s,l,o;switch(a){case 1:r<128&&(u=r);break;case 2:128==(192&(t=e[n+1]))&&(o=(31&r)<<6|63&t)>127&&(u=o);break;case 3:t=e[n+1],s=e[n+2],128==(192&t)&&128==(192&s)&&(o=(15&r)<<12|(63&t)<<6|63&s)>2047&&(o<55296||o>57343)&&(u=o);break;case 4:t=e[n+1],s=e[n+2],l=e[n+3],128==(192&t)&&128==(192&s)&&128==(192&l)&&(o=(15&r)<<18|(63&t)<<12|(63&s)<<6|63&l)>65535&&o<1114112&&(u=o)}}void 0===u?(u=65533,a=1):u>65535&&(u-=65536,t.push(u>>>10&1023|55296),u=56320|1023&u),t.push(u),n+=a}let n="";for(let e=0;e>6).add(128|63&e):e<55296||e>=57344?t.add(224|e>>12).add(128|e>>6&63).add(128|63&e):(e=65536+((1023&e)<<10|1023&e),t.add(240|e>>18).add(128|e>>12&63).add(128|e>>6&63).add(128|63&e))}return t.toBuffer()},t.toBinaryString=function(e){r.default.instanceOf(e,ArrayBuffer);let t="";const n=new Uint8Array(e);for(let e=0;e=10;)l-=10,u++;0===l?a++:(r=String(l)+T(r,a),a=0)}return u>0&&(r=String(u)+T(r,a)),r}function a(e,t){if(V(e),V(t),v(e)&&v(t))return u(e,t);if(p(e)&&p(t))return b(u(w(e),w(t)));if(h(w(e),w(t))){var n=e;e=t,t=n}var a=r(w(e),w(t));return v(e)?a:b(a)}function s(e,t){return V(e),V(t),a(e,b(t))}function l(e,t){S(e),M(t);for(var n="",r=N(e),u=0,a=0,s=0;s=10;)l-=10,u++;0===l?a++:(n=String(l)+T(n,a),a=0)}return u>0&&(n=String(u)+T(n,a)),0===n.length?"0":n}function o(e,t){S(e),S(t);for(var n="0",r=N(t),a=0;a0;)e+="0",t--;return e}function A(e,t){return V(e),M(t),t>=N(e)?"0":e.charAt(e.length-t-1)}function N(e){return p(e)?e.length-1:e.length}function V(e){P(e,"string")}function S(e){V(e),function(e,t,n){if(!t.call(null,e))throw new Error("Condition "+n+" failed for value "+e)}(e,v,"isPositive")}function M(e){P(e,"number")}function E(e){if(P(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function P(e,t){if(typeof e!==t)throw new Error("Not a "+t+": "+e)}Object.defineProperty(t,"__esModule",{value:!0}),t.subPositive=r,t.add=a,t.sub=s,t.timesDigit=l,t.mulPositive=o,t.mul=i,t.quotientRemainderPositive=f,t.div=function(e,t,n=!1){V(e),V(t);var r=f(w(e),w(t))[0];return _(e,t)||(r=b(r)),!n||c(i(r,t),e)||_(e,t)||(r=s(r,"1")),r},t.eq=c,t.lt=h,t.ge=g,t.gt=y,t.isNegative=p,t.isPositive=v,t.abs=w,t.negate=b;var U=/^(-?)0*([1-9][0-9]*)$/,L=/^0+$/;t.normalize=O,t.LONG_UPPER_SHIFT="4294967296",t.BYTE_SHIFT="256"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),o=n(4);class i extends l.default{constructor(e){super(),r.default.instanceOf(e,Object);const t=Object.keys(e).length;try{r.default.byteUnsignedInteger(t)}catch(e){r.default.fail(String(t)+" fields is too many")}this.fields=new Array(t);let n=0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const a=u.fromString(t);try{r.default.byteUnsignedInteger(a.byteLength)}catch(e){r.default.fail("Field name "+t+" is too long")}const l=e[t];try{r.default.instanceOf(l,o.default)}catch(e){r.default.fail(s.inspect(l)+" is not a valid field type")}this.fields[n]={name:t,type:l,nameBuffer:a},n++}this.fields.sort((e,t)=>e.namet.name?1:0)}static get _value(){return 81}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.fields.length);for(const t of this.fields){const{nameBuffer:n}=t;e.add(n.byteLength).addAll(n),t.type.addToBuffer(e)}return!0}return!1}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Object);for(const n of this.fields){const u=t[n.name];try{n.type.writeValue(e,u)}catch(e){throw r.default(void 0!==u,'Value for field "'+n.name+'" missing'),e}}}consumeValue(e,t,n){let r=0;const u=n||a.makeBaseValue(this);for(const n of this.fields){const a=n.type.consumeValue(e,t+r);u[n.name]=a.value,r+=a.length}return{value:u,length:r}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function u(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,a=[],s=t;s0?i-4:i;var f=0;for(t=0;t>16&255,s[f++]=u>>8&255,s[f++]=255&u;return 2===a?(u=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[f++]=255&u):1===a&&(u=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[f++]=u>>8&255,s[f++]=255&u),s},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,u="",l=[],o=0,i=n-r;oi?i:o+16383));return 1===r?(t=e[n-1],u+=s[t>>2],u+=s[t<<4&63],u+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],u+=s[t>>10],u+=s[t>>4&63],u+=s[t<<2&63],u+="="),l.push(u),l.join("")};for(var s=[],l=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,c=i.length;f>>3},t.modEight=function(e){return 7&e},t.timesEight=function(e){return e<<3}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.default=(({type:e,buffer:t,value:n,length:u})=>{t.addAll(r.makeValueBuffer(u));for(const r of n)e.writeValue(t,r)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{}t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(22),u=n(0);class a extends r.default{constructor(e=10){super();try{u.default.integer(e),u.default(e>=0)}catch(t){throw new RangeError(String(e)+" is not a valid buffer length")}this.buffer=new ArrayBuffer(e),this.size=0,this.pausePoints=[]}get length(){return this.size}grow(e){if(u.default.integer(e),e>this.buffer.byteLength){const t=new ArrayBuffer(e<<1);new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=t}return this}add(e){return u.default.integer(e),u.default.between(0,e,256,"Not a byte: "+String(e)),this.addAll(new Uint8Array([e]).buffer)}addAll(e){u.default.instanceOf(e,ArrayBuffer);const t=this.size,n=this.size+e.byteLength;return this.grow(n),this.size=n,new Uint8Array(this.buffer).set(new Uint8Array(e),t),this}get rawBuffer(){return this.buffer}toBuffer(){let e;return this.pausePoints.length?[e]=this.pausePoints:e=this.size,e===this.buffer.byteLength?this.buffer:this.buffer.slice(0,e)}pause(){return this.pausePoints.push(this.size),this}resume(){if(!this.pausePoints.length)throw new Error("Was not paused");return this.pausePoints.pop(),this}reset(){if(!this.pausePoints.length)throw new Error("Was not paused");const e=this.pausePoints[this.pausePoints.length-1];return this.size=e,this}}t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new WeakMap;t.increment=function(e){const t=r.get(e)||0;r.set(e,t+1)},t.decrement=function(e){const t=r.get(e);r.set(e,t-1)},t.get=function(e){return r.get(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(10);t.default=((e,t)=>{r.default.instanceOf(t,String),r.default(!(u.gt(t,"9223372036854775807")||u.lt(t,"-9223372036854775808")),"Value out of range");const n=u.div(t,u.LONG_UPPER_SHIFT,!0),a=u.sub(t,u.mul(n,u.LONG_UPPER_SHIFT)),s=new ArrayBuffer(8),l=new DataView(s);l.setInt32(0,Number(n)),l.setUint32(4,Number(a)),e.addAll(s)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MILLIS_PER_DAY=864e5;const r=6e4;t.toUTC=function(e){return e.getTime()-e.getTimezoneOffset()*r},t.fromUTC=function(e){const t=new Date(e);return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);class u extends r.default{}t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(20);t.default=((e,t)=>{r.default.instanceOf(t,Array);e:for(let n=0;;n++){let a=0;for(let s=0;s<8;s++){const l=u.timesEight(n)|s;if(l===t.length){s&&e.add(a);break e}const o=t[l];r.default.instanceOf(o,Boolean),o&&(a|=1<<7-s)}e.add(a)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32);t.ByteType=r.default;var u=n(35);t.ShortType=u.default;var a=n(36);t.IntType=a.default;var s=n(37);t.LongType=s.default;var l=n(38);t.BigIntType=l.default;var o=n(39);t.FlexIntType=o.default;var i=n(40);t.UnsignedByteType=i.default;var f=n(41);t.UnsignedShortType=f.default;var c=n(42);t.UnsignedIntType=c.default;var d=n(43);t.UnsignedLongType=d.default;var h=n(44);t.BigUnsignedIntType=h.default;var g=n(45);t.FlexUnsignedIntType=g.default;var y=n(46);t.DateType=y.default;var p=n(47);t.DayType=p.default;var v=n(48);t.TimeType=v.default;var w=n(49);t.FloatType=w.default;var _=n(50);t.DoubleType=_.default;var b=n(51);t.BooleanType=b.default;var O=n(52);t.BooleanTupleType=O.default;var m=n(53);t.BooleanArrayType=m.default;var T=n(54);t.CharType=T.default;var B=n(55);t.StringType=B.default;var A=n(56);t.OctetsType=A.default;var N=n(15);t.TupleType=N.default;var V=n(11);t.StructType=V.default;var S=n(12);t.ArrayType=S.default;var M=n(14);t.SetType=M.default;var E=n(13);t.MapType=E.default;var P=n(57);t.EnumType=P.default;var U=n(58);t.ChoiceType=U.default;var L=n(59);t.NamedChoiceType=L.default;var x=n(60);t.RecursiveType=x.default;var I=n(61);t.OptionalType=I.default;var j=n(62);t.PointerType=j.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REPEATED_TYPE=255},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new Map;t.get=function(e){let t=r.get(e);return t||(t={[e]:class{}}[e],r.set(e,t)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int8Array,func:"getInt8"});class o extends s.default{static get _value(){return 1}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-128,t,128,"Value out of range"),e.addAll(new Int8Array([t]).buffer)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=(e,t)=>e>>>t|e<<32-t;t.default=(e=>{const t=e.byteLength,n=8*t;r.default(n===new Uint32Array([n])[0],"Bit length does not fit in a 32-bit integer");const s=t+(64-(t+72&63))+8,l=new ArrayBuffer(s),o=new Uint8Array(l);o.set(new Uint8Array(e)),o[t]=128,new DataView(l).setUint32(s-4,n);const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);for(let e=0;e>>3,u=t[e-2],s=a(u,17)^a(u,19)^u>>>10;t[e]=t[e-16]+r+t[e-7]+s}const r=i.slice();for(let e=0;e<64;e++){const n=r[0],s=r[1],l=r[2],o=r[4],i=r[5],f=r[6],c=a(o,6)^a(o,11)^a(o,25),d=o&i^~o&f,h=r[7]+c+d+u[e]+t[e],g=(a(n,2)^a(n,13)^a(n,22))+(n&s^n&l^s&l);r[7]=f,r[6]=i,r[5]=o,r[4]=r[3]+h,r[3]=l,r[2]=s,r[1]=n,r[0]=h+g}for(let e=0;e<8;e++)i[e]+=r[e]}const f=new ArrayBuffer(32),c=new DataView(f);for(let e=0;e<8;e++)c.setUint32(e<<2,i[e]);return f})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(17),u=new ArrayBuffer(2);new DataView(u).setUint16(0,12),t.VERSION_STRING=r.fromByteArray(new Uint8Array(u))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int16Array,func:"getInt16"});class o extends s.default{static get _value(){return 2}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-32768,t,32768,"Value out of range");const u=new ArrayBuffer(2);new DataView(u).setInt16(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int32Array,func:"getInt32"});class o extends s.default{static get _value(){return 3}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-2147483648,t,2147483648,"Value out of range");const u=new ArrayBuffer(4);new DataView(u).setInt32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),u=n(25),a=n(8);class s extends a.default{static get _value(){return 4}writeValue(e,t){this.isBuffer(e),u.default(e,t)}consumeValue(e,t){return r.readLong(e,t)}}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(8);class o extends l.default{static get _value(){return 5}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),t=s.normalize(t);const n=[];if(!s.eq(t,"0")){for(;s.gt(t,"127")||s.lt(t,"-128");){const e=s.div(t,s.BYTE_SHIFT,!0),r=s.sub(t,s.mul(e,s.BYTE_SHIFT));n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const o=new Uint8Array(e,t+l);let i;if(u){i=String(o[0]<<24>>24);for(let e=1;e=t+8,u.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getUint32(0),l=n.getUint32(4);return{value:a.add(a.mul(String(s),a.LONG_UPPER_SHIFT),String(l)),length:8}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(9);class o extends l.default{static get _value(){return 21}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(!s.isNegative(t),"Value out of range");const n=[];if(!s.eq(t,"0")){for(;s.ge(t,s.BYTE_SHIFT);){const[e,r]=s.quotientRemainderPositive(t,s.BYTE_SHIFT);n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const o=new Uint8Array(e,t+l);let i="0";for(let e=0;e>8),l.setUint8(2,a),e.addAll(s)}consumeValue(e,t){r.default(e.byteLength>=t+3,a.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getInt16(0)<<8|n.getUint8(2);return{value:u.fromUTC(s*u.MILLIS_PER_DAY),length:3}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(26),a=n(1),s=n(16);class l extends s.default{static get _value(){return 28}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Date);const n=new ArrayBuffer(4);new DataView(n).setUint32(0,t.getTime()%u.MILLIS_PER_DAY),e.addAll(n)}consumeValue(e,t){return r.default(e.byteLength>=t+4,a.NOT_LONG_ENOUGH),{value:new Date(new DataView(e).getUint32(t)),length:4}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float32Array,func:"getFloat32"});class o extends s.default{static get _value(){return 32}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(4);new DataView(u).setFloat32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float64Array,func:"getFloat64"});class o extends s.default{static get _value(){return 33}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(8);new DataView(u).setFloat64(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(2);class s extends a.default{static get _value(){return 48}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Boolean),e.add(t?255:0)}consumeValue(e,t){return u.readBooleanByte(e,t)}}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(28),s=n(2);class l extends s.default{static get _value(){return 49}constructor(e){super(),r.default.byteUnsignedInteger(e),this.length=e}addToBuffer(e){return!!super.addToBuffer(e)&&(e.add(this.length),!0)}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),r.default(t.length===this.length,"Length does not match: expected "+String(this.length)+" but got "+String(t.length)),a.default(e,t)}consumeValue(e,t){return u.readBooleans({buffer:e,offset:t,count:this.length})}equals(e){return super.equals(e)&&e.length===this.length}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(28),l=n(2);class o extends l.default{static get _value(){return 50}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),e.addAll(u.makeValueBuffer(t.length)),s.default(e,t)}consumeValue(e,t){const n=a.readFlexInt(e,t);let{length:r}=n;const u=a.readBooleans({buffer:e,offset:t+r,count:n.value}),{value:s}=u;return r+=u.length,{value:s,length:r}}}t.default=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);class l extends s.default{static get _value(){return 64}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(1===t.length,"String must contain only 1 character"),e.addAll(u.fromString(t))}consumeValue(e,t){r.default(e.byteLength>t,a.NOT_LONG_ENOUGH);const[n]=u.toString(new Uint8Array(e,t).subarray(0,4));return{value:n,length:u.fromString(n).byteLength}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);class l extends s.default{static get _value(){return 65}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),e.addAll(u.fromString(t)).add(0)}consumeValue(e,t){const n=new Uint8Array(e,t);let s=0;for(;r.default(n.length>s,a.NOT_LONG_ENOUGH),n[s];s++);const l=u.toString(n.subarray(0,s));return s++,{value:l,length:s}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(2);class l extends s.default{static get _value(){return 66}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,ArrayBuffer),e.addAll(u.makeValueBuffer(t.byteLength)).addAll(t)}consumeValue(e,t){const n=a.readFlexInt(e,t),{length:u}=n,s=u+n.value;return r.default(e.byteLength>=t+s,a.NOT_LONG_ENOUGH),{value:e.slice(t+u,t+s),length:s}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),o=n(4);class i extends o.default{constructor({type:e,values:t}){super(),r.default.instanceOf(e,l.default),r.default.instanceOf(t,Array);try{r.default.byteUnsignedInteger(t.length)}catch(e){r.default.fail(String(t.length)+" values is too many")}const n=new Map;for(let a=0;at,a.NOT_LONG_ENOUGH);const n=new Uint8Array(e)[t],{values:u}=this;return r.default(n in u,"Index "+String(n)+" is invalid"),{value:u[n],length:1}}equals(e){if(!super.equals(e))return!1;const t=e;if(!this.type.equals(t.type))return!1;if(this.values.length!==t.values.length)return!1;const n=t.valueIndices.keys();for(const e of this.valueIndices.keys()){if(n.next().value!==e)return!1}return!0}}t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(6),s=n(2),l=n(4);class o extends s.default{constructor(e){super(),r.default.instanceOf(e,Array);try{r.default.byteUnsignedInteger(e.length)}catch(t){r.default.fail(String(e.length)+" types is too many")}for(const t of e)r.default.instanceOf(t,l.default);this.types=e}static get _value(){return 86}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.types.length);for(const t of this.types)t.addToBuffer(e);return!0}return!1}writeValue(e,t){this.isBuffer(e),e.pause();let n=!1;for(let r=0;rt,u.NOT_LONG_ENOUGH);const a=new Uint8Array(e)[t],{value:s,length:l}=this.types[a].consumeValue(e,t+n);return n+=l,{value:s,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.types.length!==t.types.length)return!1;for(let e=0;et,s.NOT_LONG_ENOUGH);const u=new Uint8Array(e)[t],l=this.indexConstructors.get(u);if(void 0===l)throw new Error("Constructor index "+String(u)+" is invalid");const o=a.get(l.name),{value:i,length:f}=this.constructorTypes[u].type.consumeValue(e,t+n,new o);return n+=f,{value:i,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.constructorTypes.length!==t.constructorTypes.length)return!1;for(let e=0;e=0,"Offset is negative: "+String(t));const n=new Uint8Array(e);u.default(e.byteLength>t,o.NOT_LONG_ENOUGH);const d=n[t];let p,v=1;const w=h.get(d);if(w)return{value:new w,length:v};switch(d){case c.BooleanTupleType._value:{u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const r=n[t+v];v++,p=new c.BooleanTupleType(r);break}case c.TupleType._value:{const a=r(e,t+v);v+=a.length,u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++,p=new c.TupleType({type:a.value,length:s});break}case c.StructType._value:{u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++;const l={};for(let i=0;it+v,o.NOT_LONG_ENOUGH);const s=n[t+v],i=t+ ++v,f=i+s;u.default(e.byteLength>=f,o.NOT_LONG_ENOUGH);const c=a.toString(n.subarray(i,f));v+=s;const d=r(e,f);l[c]=d.value,v+=d.length}p=new c.StructType(l);break}case c.ArrayType._value:{const n=r(e,t+v);v+=n.length,p=new c.ArrayType(n.value);break}case c.SetType._value:{const n=r(e,t+v);v+=n.length,p=new c.SetType(n.value);break}case c.MapType._value:{const n=r(e,t+v),u=r(e,t+(v+=n.length));v+=u.length,p=new c.MapType(n.value,u.value);break}case c.EnumType._value:{const a=r(e,t+v),s=a.value;v+=a.length,u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const l=n[t+v];v++;const i=new Array(l);for(let n=0;nt+v,o.NOT_LONG_ENOUGH);const a=n[t+v];v++;const s=new Array(a);for(let n=0;nt+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++;const f=new Map;for(let d=0;dt+v,o.NOT_LONG_ENOUGH);const s=n[t+v],d=t+ ++v,h=d+s;u.default(e.byteLength>=h,o.NOT_LONG_ENOUGH);const g=a.toString(n.subarray(d,h));v+=s;const y=r(e,h);if(!(y.value instanceof c.StructType))throw new Error("Not a StructType: "+i.inspect(y.value));f.set(l.get(g),y.value),v+=y.length}p=new c.NamedChoiceType(f);break}case c.RecursiveType._value:{const n=o.readFlexInt(e,t+v),u=n.value;v+=n.length;let a,s=y.get(e);if(s?a=s.get(u):(s=new Map,y.set(e,s)),void 0===a){do{a="read-type";for(let e=0;e{if(!t.ok)throw new Error("Received status of "+String(t.status));const n=t.headers.get("sig");return r&&r.sig===n?t.arrayBuffer().then(e=>{const t=r.type.readValue(e);return Promise.resolve(t)}):t.arrayBuffer().then(t=>{const r=l._consumeType(t,0),u=r.value,a=u.readValue(t,r.length);return o[e]={sig:n,type:u},function(){const e={};for(const t in o)e[t]={sig:o[t].sig,type:s.fromByteArray(new Uint8Array(o[t].type.toBuffer()))};localStorage.typeCache=JSON.stringify(e)}(),Promise.resolve(a)})})}Object.defineProperty(t,"__esModule",{value:!0});const u=n(19),a=n(4);t.upload=function({type:e,value:t,url:n,options:r}){return u.assert.instanceOf(e,a.default),u.assert.instanceOf(n,String),u.assert.instanceOf(r,Object),"POST"!==r.method&&u.assert.fail("Must use POST when uploading"),r.body=e.valueBuffer(t),fetch(n,r)},function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(19));const s=n(17),l=n(63),o={};if(localStorage.typeCache){const e=JSON.parse(localStorage.typeCache);for(const t in e)o[t]={sig:e[t].sig,type:l.type(s.toByteArray(e[t].type).buffer)}}t.download=r,window.sb=t}]); \ No newline at end of file +!function(e){function t(r){if(n[r])return n[r].exports;var u=n[r]={i:r,l:!1,exports:{}};return e[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=66)}([function(e,t,n){"use strict";function r(e,t){t instanceof Array||(t=[t]);for(const n of t)if(e instanceof n||void 0!==e&&null!==e&&e.constructor===n)return;throw new TypeError(f.inspect(e)+" is not an instance of "+t.map(({name:e})=>e).join(" or "))}function u(e){if(r(e,Number),!Number.isSafeInteger(e))throw new RangeError(f.inspect(e)+" is not an integer")}function a(e,t,n,r){if(t=n){const u=String(t)+" is not in ["+String(e)+","+String(n)+")";throw r?new RangeError(r+" ("+u+")"):new RangeError(u)}}function s(e){throw new Error(e)}function l(e,t){e||s(t||"Assertion failed")}function o(e,t){const n=()=>new RangeError("Expected "+f.inspect(t)+" but got "+f.inspect(e));if(t){let r=!0;switch(t.constructor){case Object:if(!e||e.constructor!==Object)throw n();for(const r in t)if({}.hasOwnProperty.call(t,r))try{o(e[r],t[r])}catch(e){throw n()}break;case Array:if(!e||e.constructor!==Array)throw n();try{o(e.length,t.length)}catch(e){throw n()}for(let r=0;rn,t.NOT_LONG_ENOUGH);let a;const s=new Uint8Array(e)[n];switch(s){case 0:case 255:a=Boolean(s);break;default:throw new Error("0x"+r(s.toString(16),2)+" is an invalid Boolean value")}return{value:a,length:1}},t.readBooleans=function({buffer:e,offset:n,count:r}){const s=new Array(r),l=a.modEight(r),o=a.dividedByEight(r),i=l?o+1:o;u.default(e.byteLength>=n+i,t.NOT_LONG_ENOUGH);const f=new Uint8Array(e,n);for(let e=0;en,t.NOT_LONG_ENOUGH);const r=new Uint8Array(e,n),a=s.getByteCount(r[0]);return u.default(e.byteLength>=n+a,t.NOT_LONG_ENOUGH),{value:s.readValueBuffer(r.slice(0,a).buffer),length:a}},t.readLong=function(e,n){u.default(e.byteLength>=n+8,t.NOT_LONG_ENOUGH);const r=new DataView(e,n),a=r.getInt32(0),s=r.getUint32(4);return{value:l.add(l.mul(String(a),l.LONG_UPPER_SHIFT),String(s)),length:8}},t.readNumber=function({func:e,type:n}){const r=n.BYTES_PER_ELEMENT;return(n,a)=>(u.default(n.byteLength>=a+r,t.NOT_LONG_ENOUGH),{value:new DataView(n)[e](a),length:r})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4);t.default=class extends r.default{}},function(e,t,n){"use strict";function r(e){const t=7*e;return Math.pow(2,t)}Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),a=(new Map).set(0,0),s=new Map,l=new Map;{let e=1,t=0,n=-256;for(;t<=Number.MAX_SAFE_INTEGER;)t+=r(e),a.set(e,t),s.set(e,255&n),l.set(e-1,e),n>>=1,e++}t.makeValueBuffer=function(e){u.default.integer(e),u.default(e>=0,String(e)+" is negative");const t=(()=>{for(const[t,n]of a)if(n>e)return t;throw new Error("Cannot represent "+String(e))})();let n=e-a.get(t-1);const r=new Uint8Array(t);for(let e=t-1;e>=0;e--)r[e]=255&n,n=Math.floor(n/256);return r[0]|=s.get(t),r.buffer},t.getByteCount=function(e){const t=Math.clz32(~e<<24),n=l.get(t);return u.default(void 0!==n,"Invalid number of bytes"),n},t.readValueBuffer=function(e){u.default.instanceOf(e,ArrayBuffer);const t=e.byteLength;u.default(t>0,"Empty flex int buffer");const n=new Uint8Array(e);let r=n[0]^s.get(t);for(let e=1;e{if(e&&e.constructor===String){const t=Number(e);if(!isNaN(t)||"NaN"===e)return t}})},function(e,t,n){"use strict";function r(e,t){if(void 0===e)return"undefined";if(null===e||u.has(e.constructor))return JSON.stringify(e);if(e instanceof ArrayBuffer){const t=new Uint8Array(e);let n="[";for(const e of t)"["!==n&&(n+=", "),n+="0x"+(e<16?"0":"")+e.toString(16);return n+"]"}if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=""}if(e instanceof Function)return"Function "+e.name;if(t.get(e))return"[Circular]";if(t.set(e,1),e instanceof Set){let n="Set {";const u=e.values();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Map){let n="Map {";const u=e.entries();let a=u.next();for(;!a.done;)n+=r(a.value[0],t),n+=" => ",n+=r(a.value[1],t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Array){let n="[";const u=e[Symbol.iterator]();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"]"}if(e.constructor===Object){let n="{";for(const u in e)({}).hasOwnProperty.call(e,u)&&("{"!==n&&(n+=", "),n+=u+": "+r(e[u],t));return t.set(e,t.get(e)-1),n+"}"}const{name:n}=e.constructor,a=(n?n+" ":"")+r(function(e){const t={};for(const n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(e),t);return t.set(e,t.get(e)-1),a}Object.defineProperty(t,"__esModule",{value:!0});const u=new Set([String,Number,Boolean,Date]);t.inspect=function(e){return r(e,new Map)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(23),a=4096;t.toString=function(e){r.default.instanceOf(e,Uint8Array);const t=[];for(let n=0;n239?4:r>223?3:r>191?2:1;if(n+a<=e.length){let t,s,l,o;switch(a){case 1:r<128&&(u=r);break;case 2:128==(192&(t=e[n+1]))&&(o=(31&r)<<6|63&t)>127&&(u=o);break;case 3:t=e[n+1],s=e[n+2],128==(192&t)&&128==(192&s)&&(o=(15&r)<<12|(63&t)<<6|63&s)>2047&&(o<55296||o>57343)&&(u=o);break;case 4:t=e[n+1],s=e[n+2],l=e[n+3],128==(192&t)&&128==(192&s)&&128==(192&l)&&(o=(15&r)<<18|(63&t)<<12|(63&s)<<6|63&l)>65535&&o<1114112&&(u=o)}}void 0===u?(u=65533,a=1):u>65535&&(u-=65536,t.push(u>>>10&1023|55296),u=56320|1023&u),t.push(u),n+=a}let n="";for(let e=0;e>6).add(128|63&e):e<55296||e>=57344?t.add(224|e>>12).add(128|e>>6&63).add(128|63&e):(e=65536+((1023&e)<<10|1023&e),t.add(240|e>>18).add(128|e>>12&63).add(128|e>>6&63).add(128|63&e))}return t.toBuffer()},t.toBinaryString=function(e){r.default.instanceOf(e,ArrayBuffer);let t="";const n=new Uint8Array(e);for(let e=0;e=10;)l-=10,u++;0===l?a++:(r=String(l)+T(r,a),a=0)}return u>0&&(r=String(u)+T(r,a)),r}function a(e,t){if(V(e),V(t),v(e)&&v(t))return u(e,t);if(p(e)&&p(t))return b(u(w(e),w(t)));if(h(w(e),w(t))){var n=e;e=t,t=n}var a=r(w(e),w(t));return v(e)?a:b(a)}function s(e,t){return V(e),V(t),a(e,b(t))}function l(e,t){S(e),M(t);for(var n="",r=N(e),u=0,a=0,s=0;s=10;)l-=10,u++;0===l?a++:(n=String(l)+T(n,a),a=0)}return u>0&&(n=String(u)+T(n,a)),0===n.length?"0":n}function o(e,t){S(e),S(t);for(var n="0",r=N(t),a=0;a0;)e+="0",t--;return e}function A(e,t){return V(e),M(t),t>=N(e)?"0":e.charAt(e.length-t-1)}function N(e){return p(e)?e.length-1:e.length}function V(e){P(e,"string")}function S(e){V(e),function(e,t,n){if(!t.call(null,e))throw new Error("Condition "+n+" failed for value "+e)}(e,v,"isPositive")}function M(e){P(e,"number")}function E(e){if(P(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function P(e,t){if(typeof e!==t)throw new Error("Not a "+t+": "+e)}Object.defineProperty(t,"__esModule",{value:!0}),t.subPositive=r,t.add=a,t.sub=s,t.timesDigit=l,t.mulPositive=o,t.mul=i,t.quotientRemainderPositive=f,t.div=function(e,t,n=!1){V(e),V(t);var r=f(w(e),w(t))[0];return _(e,t)||(r=b(r)),!n||c(i(r,t),e)||_(e,t)||(r=s(r,"1")),r},t.eq=c,t.lt=h,t.ge=g,t.gt=y,t.isNegative=p,t.isPositive=v,t.abs=w,t.negate=b;var U=/^(-?)0*([1-9][0-9]*)$/,L=/^0+$/;t.normalize=O,t.LONG_UPPER_SHIFT="4294967296",t.BYTE_SHIFT="256"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),o=n(4);t.default=class extends l.default{constructor(e){super(),r.default.instanceOf(e,Object);const t=Object.keys(e).length;try{r.default.byteUnsignedInteger(t)}catch(e){r.default.fail(String(t)+" fields is too many")}this.fields=new Array(t);let n=0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const a=u.fromString(t);try{r.default.byteUnsignedInteger(a.byteLength)}catch(e){r.default.fail("Field name "+t+" is too long")}const l=e[t];try{r.default.instanceOf(l,o.default)}catch(e){r.default.fail(s.inspect(l)+" is not a valid field type")}this.fields[n]={name:t,type:l,nameBuffer:a},n++}this.fields.sort((e,t)=>e.namet.name?1:0)}static get _value(){return 81}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.fields.length);for(const t of this.fields){const{nameBuffer:n}=t;e.add(n.byteLength).addAll(n),t.type.addToBuffer(e)}return!0}return!1}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Object);for(const n of this.fields){const u=t[n.name];try{n.type.writeValue(e,u)}catch(e){throw r.default(void 0!==u,'Value for field "'+n.name+'" missing'),e}}}consumeValue(e,t,n){let r=0;const u=n||a.makeBaseValue(this);for(const n of this.fields){const a=n.type.consumeValue(e,t+r);u[n.name]=a.value,r+=a.length}return{value:u,length:r}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function u(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,a=[],s=t;s0?i-4:i;var f=0;for(t=0;t>16&255,s[f++]=u>>8&255,s[f++]=255&u;return 2===a?(u=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[f++]=255&u):1===a&&(u=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[f++]=u>>8&255,s[f++]=255&u),s},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,u="",l=[],o=0,i=n-r;oi?i:o+16383));return 1===r?(t=e[n-1],u+=s[t>>2],u+=s[t<<4&63],u+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],u+=s[t>>10],u+=s[t>>4&63],u+=s[t<<2&63],u+="="),l.push(u),l.join("")};for(var s=[],l=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,c=i.length;f>>3},t.modEight=function(e){return 7&e},t.timesEight=function(e){return e<<3}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.default=(({type:e,buffer:t,value:n,length:u})=>{t.addAll(r.makeValueBuffer(u));for(const r of n)e.writeValue(t,r)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(22),u=n(0),a=10;t.default=class extends r.default{constructor(e=a){super();try{u.default.integer(e),u.default(e>=0)}catch(t){throw new RangeError(String(e)+" is not a valid buffer length")}this.buffer=new ArrayBuffer(e),this.size=0,this.pausePoints=[]}get length(){return this.size}grow(e){if(u.default.integer(e),e>this.buffer.byteLength){const t=new ArrayBuffer(e<<1);new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=t}return this}add(e){return u.default.integer(e),u.default.between(0,e,256,"Not a byte: "+String(e)),this.addAll(new Uint8Array([e]).buffer)}addAll(e){u.default.instanceOf(e,ArrayBuffer);const t=this.size,n=this.size+e.byteLength;return this.grow(n),this.size=n,new Uint8Array(this.buffer).set(new Uint8Array(e),t),this}get rawBuffer(){return this.buffer}toBuffer(){let e;return this.pausePoints.length?[e]=this.pausePoints:e=this.size,e===this.buffer.byteLength?this.buffer:this.buffer.slice(0,e)}pause(){return this.pausePoints.push(this.size),this}resume(){if(!this.pausePoints.length)throw new Error("Was not paused");return this.pausePoints.pop(),this}reset(){if(!this.pausePoints.length)throw new Error("Was not paused");const e=this.pausePoints[this.pausePoints.length-1];return this.size=e,this}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new WeakMap;t.increment=function(e){const t=r.get(e)||0;r.set(e,t+1)},t.decrement=function(e){const t=r.get(e);r.set(e,t-1)},t.get=function(e){return r.get(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(10);t.default=((e,t)=>{r.default.instanceOf(t,String),r.default(!(u.gt(t,"9223372036854775807")||u.lt(t,"-9223372036854775808")),"Value out of range");const n=u.div(t,u.LONG_UPPER_SHIFT,!0),a=u.sub(t,u.mul(n,u.LONG_UPPER_SHIFT)),s=new ArrayBuffer(8),l=new DataView(s);l.setInt32(0,Number(n)),l.setUint32(4,Number(a)),e.addAll(s)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MILLIS_PER_DAY=864e5;const r=6e4;t.toUTC=function(e){return e.getTime()-e.getTimezoneOffset()*r},t.fromUTC=function(e){const t=new Date(e);return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);t.default=class extends r.default{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(20);t.default=((e,t)=>{r.default.instanceOf(t,Array);e:for(let n=0;;n++){let a=0;for(let s=0;s<8;s++){const l=u.timesEight(n)|s;if(l===t.length){s&&e.add(a);break e}const o=t[l];r.default.instanceOf(o,Boolean),o&&(a|=1<<7-s)}e.add(a)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32);t.ByteType=r.default;var u=n(35);t.ShortType=u.default;var a=n(36);t.IntType=a.default;var s=n(37);t.LongType=s.default;var l=n(38);t.BigIntType=l.default;var o=n(39);t.FlexIntType=o.default;var i=n(40);t.UnsignedByteType=i.default;var f=n(41);t.UnsignedShortType=f.default;var c=n(42);t.UnsignedIntType=c.default;var d=n(43);t.UnsignedLongType=d.default;var h=n(44);t.BigUnsignedIntType=h.default;var g=n(45);t.FlexUnsignedIntType=g.default;var y=n(46);t.DateType=y.default;var p=n(47);t.DayType=p.default;var v=n(48);t.TimeType=v.default;var w=n(49);t.FloatType=w.default;var _=n(50);t.DoubleType=_.default;var b=n(51);t.BooleanType=b.default;var O=n(52);t.BooleanTupleType=O.default;var m=n(53);t.BooleanArrayType=m.default;var T=n(54);t.CharType=T.default;var B=n(55);t.StringType=B.default;var A=n(56);t.OctetsType=A.default;var N=n(15);t.TupleType=N.default;var V=n(11);t.StructType=V.default;var S=n(12);t.ArrayType=S.default;var M=n(14);t.SetType=M.default;var E=n(13);t.MapType=E.default;var P=n(57);t.EnumType=P.default;var U=n(58);t.ChoiceType=U.default;var L=n(59);t.NamedChoiceType=L.default;var x=n(60);t.RecursiveType=x.default;var I=n(61);t.OptionalType=I.default;var j=n(62);t.PointerType=j.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REPEATED_TYPE=255},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new Map;t.get=function(e){let t=r.get(e);return t||(t={[e]:class{}}[e],r.set(e,t)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int8Array,func:"getInt8"});t.default=class extends s.default{static get _value(){return 1}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-128,t,128,"Value out of range"),e.addAll(new Int8Array([t]).buffer)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=(e,t)=>e>>>t|e<<32-t;t.default=(e=>{const t=e.byteLength,n=8*t;r.default(n===new Uint32Array([n])[0],"Bit length does not fit in a 32-bit integer");const s=t+(64-(t+72&63))+8,l=new ArrayBuffer(s),o=new Uint8Array(l);o.set(new Uint8Array(e)),o[t]=128,new DataView(l).setUint32(s-4,n);const i=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);for(let e=0;e>>3,u=t[e-2],s=a(u,17)^a(u,19)^u>>>10;t[e]=t[e-16]+r+t[e-7]+s}const r=i.slice();for(let e=0;e<64;e++){const n=r[0],s=r[1],l=r[2],o=r[4],i=r[5],f=r[6],c=a(o,6)^a(o,11)^a(o,25),d=o&i^~o&f,h=r[7]+c+d+u[e]+t[e],g=(a(n,2)^a(n,13)^a(n,22))+(n&s^n&l^s&l);r[7]=f,r[6]=i,r[5]=o,r[4]=r[3]+h,r[3]=l,r[2]=s,r[1]=n,r[0]=h+g}for(let e=0;e<8;e++)i[e]+=r[e]}const f=new ArrayBuffer(32),c=new DataView(f);for(let e=0;e<8;e++)c.setUint32(e<<2,i[e]);return f})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(17),u=new ArrayBuffer(2);new DataView(u).setUint16(0,12),t.VERSION_STRING=r.fromByteArray(new Uint8Array(u))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int16Array,func:"getInt16"});t.default=class extends s.default{static get _value(){return 2}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-32768,t,32768,"Value out of range");const u=new ArrayBuffer(2);new DataView(u).setInt16(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int32Array,func:"getInt32"});t.default=class extends s.default{static get _value(){return 3}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-2147483648,t,2147483648,"Value out of range");const u=new ArrayBuffer(4);new DataView(u).setInt32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),u=n(25),a=n(8);t.default=class extends a.default{static get _value(){return 4}writeValue(e,t){this.isBuffer(e),u.default(e,t)}consumeValue(e,t){return r.readLong(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(8);t.default=class extends l.default{static get _value(){return 5}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),t=s.normalize(t);const n=[];if(!s.eq(t,"0")){for(;s.gt(t,"127")||s.lt(t,"-128");){const e=s.div(t,s.BYTE_SHIFT,!0),r=s.sub(t,s.mul(e,s.BYTE_SHIFT));n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const o=new Uint8Array(e,t+l);let i;if(u){i=String(o[0]<<24>>24);for(let e=1;e=t+8,u.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getUint32(0),l=n.getUint32(4);return{value:a.add(a.mul(String(s),a.LONG_UPPER_SHIFT),String(l)),length:8}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(9);t.default=class extends l.default{static get _value(){return 21}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(!s.isNegative(t),"Value out of range");const n=[];if(!s.eq(t,"0")){for(;s.ge(t,s.BYTE_SHIFT);){const[e,r]=s.quotientRemainderPositive(t,s.BYTE_SHIFT);n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const o=new Uint8Array(e,t+l);let i="0";for(let e=0;e>8),l.setUint8(2,a),e.addAll(s)}consumeValue(e,t){r.default(e.byteLength>=t+3,a.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getInt16(0)<<8|n.getUint8(2);return{value:u.fromUTC(s*u.MILLIS_PER_DAY),length:3}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(26),a=n(1),s=n(16);t.default=class extends s.default{static get _value(){return 28}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Date);const n=new ArrayBuffer(4);new DataView(n).setUint32(0,t.getTime()%u.MILLIS_PER_DAY),e.addAll(n)}consumeValue(e,t){return r.default(e.byteLength>=t+4,a.NOT_LONG_ENOUGH),{value:new Date(new DataView(e).getUint32(t)),length:4}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float32Array,func:"getFloat32"});t.default=class extends s.default{static get _value(){return 32}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(4);new DataView(u).setFloat32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float64Array,func:"getFloat64"});t.default=class extends s.default{static get _value(){return 33}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(8);new DataView(u).setFloat64(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(2);t.default=class extends a.default{static get _value(){return 48}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Boolean),e.add(t?255:0)}consumeValue(e,t){return u.readBooleanByte(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(28),s=n(2);t.default=class extends s.default{static get _value(){return 49}constructor(e){super(),r.default.byteUnsignedInteger(e),this.length=e}addToBuffer(e){return!!super.addToBuffer(e)&&(e.add(this.length),!0)}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),r.default(t.length===this.length,"Length does not match: expected "+String(this.length)+" but got "+String(t.length)),a.default(e,t)}consumeValue(e,t){return u.readBooleans({buffer:e,offset:t,count:this.length})}equals(e){return super.equals(e)&&e.length===this.length}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(28),l=n(2);t.default=class extends l.default{static get _value(){return 50}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),e.addAll(u.makeValueBuffer(t.length)),s.default(e,t)}consumeValue(e,t){const n=a.readFlexInt(e,t);let{length:r}=n;const u=a.readBooleans({buffer:e,offset:t+r,count:n.value}),{value:s}=u;return r+=u.length,{value:s,length:r}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 64}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(1===t.length,"String must contain only 1 character"),e.addAll(u.fromString(t))}consumeValue(e,t){r.default(e.byteLength>t,a.NOT_LONG_ENOUGH);const[n]=u.toString(new Uint8Array(e,t).subarray(0,4));return{value:n,length:u.fromString(n).byteLength}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 65}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),e.addAll(u.fromString(t)).add(0)}consumeValue(e,t){const n=new Uint8Array(e,t);let s=0;for(;r.default(n.length>s,a.NOT_LONG_ENOUGH),n[s];s++);const l=u.toString(n.subarray(0,s));return s++,{value:l,length:s}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 66}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,ArrayBuffer),e.addAll(u.makeValueBuffer(t.byteLength)).addAll(t)}consumeValue(e,t){const n=a.readFlexInt(e,t),{length:u}=n,s=u+n.value;return r.default(e.byteLength>=t+s,a.NOT_LONG_ENOUGH),{value:e.slice(t+u,t+s),length:s}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),o=n(4);t.default=class extends o.default{constructor({type:e,values:t}){super(),r.default.instanceOf(e,l.default),r.default.instanceOf(t,Array);try{r.default.byteUnsignedInteger(t.length)}catch(e){r.default.fail(String(t.length)+" values is too many")}const n=new Map;for(let a=0;at,a.NOT_LONG_ENOUGH);const n=new Uint8Array(e)[t],{values:u}=this;return r.default(n in u,"Index "+String(n)+" is invalid"),{value:u[n],length:1}}equals(e){if(!super.equals(e))return!1;const t=e;if(!this.type.equals(t.type))return!1;if(this.values.length!==t.values.length)return!1;const n=t.valueIndices.keys();for(const e of this.valueIndices.keys())if(n.next().value!==e)return!1;return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(6),s=n(2),l=n(4);t.default=class extends s.default{constructor(e){super(),r.default.instanceOf(e,Array);try{r.default.byteUnsignedInteger(e.length)}catch(t){r.default.fail(String(e.length)+" types is too many")}for(const t of e)r.default.instanceOf(t,l.default);this.types=e}static get _value(){return 86}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.types.length);for(const t of this.types)t.addToBuffer(e);return!0}return!1}writeValue(e,t){this.isBuffer(e),e.pause();let n=!1;for(let r=0;rt,u.NOT_LONG_ENOUGH);const a=new Uint8Array(e)[t],{value:s,length:l}=this.types[a].consumeValue(e,t+n);return n+=l,{value:s,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.types.length!==t.types.length)return!1;for(let e=0;et,s.NOT_LONG_ENOUGH);const u=new Uint8Array(e)[t],l=this.indexConstructors.get(u);if(void 0===l)throw new Error("Constructor index "+String(u)+" is invalid");const o=a.get(l.name),{value:i,length:f}=this.constructorTypes[u].type.consumeValue(e,t+n,new o);return n+=f,{value:i,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.constructorTypes.length!==t.constructorTypes.length)return!1;for(let e=0;e=0,"Offset is negative: "+String(t));const n=new Uint8Array(e);u.default(e.byteLength>t,o.NOT_LONG_ENOUGH);const d=n[t];let p,v=1;const w=h.get(d);if(w)return{value:new w,length:v};switch(d){case c.BooleanTupleType._value:{u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const r=n[t+v];v++,p=new c.BooleanTupleType(r);break}case c.TupleType._value:{const a=r(e,t+v);v+=a.length,u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++,p=new c.TupleType({type:a.value,length:s});break}case c.StructType._value:{u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++;const l={};for(let i=0;it+v,o.NOT_LONG_ENOUGH);const s=n[t+v],i=t+ ++v,f=i+s;u.default(e.byteLength>=f,o.NOT_LONG_ENOUGH);const c=a.toString(n.subarray(i,f));v+=s;const d=r(e,f);l[c]=d.value,v+=d.length}p=new c.StructType(l);break}case c.ArrayType._value:{const n=r(e,t+v);v+=n.length,p=new c.ArrayType(n.value);break}case c.SetType._value:{const n=r(e,t+v);v+=n.length,p=new c.SetType(n.value);break}case c.MapType._value:{const n=r(e,t+v),u=r(e,t+(v+=n.length));v+=u.length,p=new c.MapType(n.value,u.value);break}case c.EnumType._value:{const a=r(e,t+v),s=a.value;v+=a.length,u.default(e.byteLength>t+v,o.NOT_LONG_ENOUGH);const l=n[t+v];v++;const i=new Array(l);for(let n=0;nt+v,o.NOT_LONG_ENOUGH);const a=n[t+v];v++;const s=new Array(a);for(let n=0;nt+v,o.NOT_LONG_ENOUGH);const s=n[t+v];v++;const f=new Map;for(let d=0;dt+v,o.NOT_LONG_ENOUGH);const s=n[t+v],d=t+ ++v,h=d+s;u.default(e.byteLength>=h,o.NOT_LONG_ENOUGH);const g=a.toString(n.subarray(d,h));v+=s;const y=r(e,h);if(!(y.value instanceof c.StructType))throw new Error("Not a StructType: "+i.inspect(y.value));f.set(l.get(g),y.value),v+=y.length}p=new c.NamedChoiceType(f);break}case c.RecursiveType._value:{const n=o.readFlexInt(e,t+v),u=n.value;v+=n.length;let a,s=y.get(e);if(s?a=s.get(u):(s=new Map,y.set(e,s)),void 0===a){do{a="read-type";for(let e=0;e{if(!t.ok)throw new Error("Received status of "+String(t.status));const n=t.headers.get("sig");return u&&u.sig===n?t.arrayBuffer().then(e=>{const t=u.type.readValue(e);return Promise.resolve(t)}):t.arrayBuffer().then(t=>{const r=s._consumeType(t,0),u=r.value,o=u.readValue(t,r.length);return l[e]={sig:n,type:u},function(){const e={};for(const t in l)e[t]={sig:l[t].sig,type:a.fromByteArray(new Uint8Array(l[t].type.toBuffer()))};localStorage.typeCache=JSON.stringify(e)}(),Promise.resolve(o)})})},window.sb=t}]); \ No newline at end of file diff --git a/compiled/upload.js b/compiled/upload.js index 8185b54..e9274f3 100644 --- a/compiled/upload.js +++ b/compiled/upload.js @@ -1 +1 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var u=n[r]={i:r,l:!1,exports:{}};return e[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var n={};t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=64)}([function(e,t,n){"use strict";function r(e,t){t instanceof Array||(t=[t]);for(const n of t)if(e instanceof n||void 0!==e&&null!==e&&e.constructor===n)return;throw new TypeError(o.inspect(e)+" is not an instance of "+t.map(({name:e})=>e).join(" or "))}function u(e){if(r(e,Number),!Number.isSafeInteger(e))throw new RangeError(o.inspect(e)+" is not an integer")}function a(e,t,n,r){if(t=n){const u=String(t)+" is not in ["+String(e)+","+String(n)+")";throw r?new RangeError(r+" ("+u+")"):new RangeError(u)}}function s(e){throw new Error(e)}function l(e,t){e||s(t||"Assertion failed")}function i(e,t){const n=()=>new RangeError("Expected "+o.inspect(t)+" but got "+o.inspect(e));if(t){let r=!0;switch(t.constructor){case Object:if(!e||e.constructor!==Object)throw n();for(const r in t)if({}.hasOwnProperty.call(t,r))try{i(e[r],t[r])}catch(e){throw n()}break;case Array:if(!e||e.constructor!==Array)throw n();try{i(e.length,t.length)}catch(e){throw n()}for(let r=0;rn,t.NOT_LONG_ENOUGH);let a;const s=new Uint8Array(e)[n];switch(s){case 0:case 255:a=Boolean(s);break;default:throw new Error("0x"+r(s.toString(16),2)+" is an invalid Boolean value")}return{value:a,length:1}},t.readBooleans=function({buffer:e,offset:n,count:r}){const s=new Array(r),l=a.modEight(r),i=a.dividedByEight(r),f=l?i+1:i;u.default(e.byteLength>=n+f,t.NOT_LONG_ENOUGH);const o=new Uint8Array(e,n);for(let e=0;en,t.NOT_LONG_ENOUGH);const r=new Uint8Array(e,n),a=s.getByteCount(r[0]);return u.default(e.byteLength>=n+a,t.NOT_LONG_ENOUGH),{value:s.readValueBuffer(r.slice(0,a).buffer),length:a}},t.readLong=function(e,n){u.default(e.byteLength>=n+8,t.NOT_LONG_ENOUGH);const r=new DataView(e,n),a=r.getInt32(0),s=r.getUint32(4);return{value:l.add(l.mul(String(a),l.LONG_UPPER_SHIFT),String(s)),length:8}},t.readNumber=function({func:e,type:n}){const r=n.BYTES_PER_ELEMENT;return(n,a)=>(u.default(n.byteLength>=a+r,t.NOT_LONG_ENOUGH),{value:new DataView(n)[e](a),length:r})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4);class u extends r.default{}t.default=u},function(e,t,n){"use strict";function r(e){const t=7*e;return Math.pow(2,t)}Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),a=(new Map).set(0,0),s=new Map,l=new Map;{let e=1,t=0,n=-256;for(;t<=Number.MAX_SAFE_INTEGER;)t+=r(e),a.set(e,t),s.set(e,255&n),l.set(e-1,e),n>>=1,e++}t.makeValueBuffer=function(e){u.default.integer(e),u.default(e>=0,String(e)+" is negative");const t=(()=>{for(const[t,n]of a)if(n>e)return t;throw new Error("Cannot represent "+String(e))})();let n=e-a.get(t-1);const r=new Uint8Array(t);for(let e=t-1;e>=0;e--)r[e]=255&n,n=Math.floor(n/256);return r[0]|=s.get(t),r.buffer},t.getByteCount=function(e){const t=Math.clz32(~e<<24),n=l.get(t);return u.default(void 0!==n,"Invalid number of bytes"),n},t.readValueBuffer=function(e){u.default.instanceOf(e,ArrayBuffer);const t=e.byteLength;u.default(t>0,"Empty flex int buffer");const n=new Uint8Array(e);let r=n[0]^s.get(t);for(let e=1;e{if(e&&e.constructor===String){const t=Number(e);if(!isNaN(t)||"NaN"===e)return t}})},function(e,t,n){"use strict";function r(e,t){if(void 0===e)return"undefined";if(null===e||u.has(e.constructor))return JSON.stringify(e);if(e instanceof ArrayBuffer){const t=new Uint8Array(e);let n="[";for(const e of t)"["!==n&&(n+=", "),n+="0x"+(e<16?"0":"")+e.toString(16);return n+"]"}if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=""}if(e instanceof Function)return"Function "+e.name;if(t.get(e))return"[Circular]";if(t.set(e,1),e instanceof Set){let n="Set {";const u=e.values();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Map){let n="Map {";const u=e.entries();let a=u.next();for(;!a.done;)n+=r(a.value[0],t),n+=" => ",n+=r(a.value[1],t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Array){let n="[";const u=e[Symbol.iterator]();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"]"}if(e.constructor===Object){let n="{";for(const u in e)({}).hasOwnProperty.call(e,u)&&("{"!==n&&(n+=", "),n+=u+": "+r(e[u],t));return t.set(e,t.get(e)-1),n+"}"}const{name:n}=e.constructor,a=(n?n+" ":"")+r(function(e){const t={};for(const n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(e),t);return t.set(e,t.get(e)-1),a}Object.defineProperty(t,"__esModule",{value:!0});const u=new Set([String,Number,Boolean,Date]);t.inspect=function(e){return r(e,new Map)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(23),a=4096;t.toString=function(e){r.default.instanceOf(e,Uint8Array);const t=[];for(let n=0;n239?4:r>223?3:r>191?2:1;if(n+a<=e.length){let t,s,l,i;switch(a){case 1:r<128&&(u=r);break;case 2:128==(192&(t=e[n+1]))&&(i=(31&r)<<6|63&t)>127&&(u=i);break;case 3:t=e[n+1],s=e[n+2],128==(192&t)&&128==(192&s)&&(i=(15&r)<<12|(63&t)<<6|63&s)>2047&&(i<55296||i>57343)&&(u=i);break;case 4:t=e[n+1],s=e[n+2],l=e[n+3],128==(192&t)&&128==(192&s)&&128==(192&l)&&(i=(15&r)<<18|(63&t)<<12|(63&s)<<6|63&l)>65535&&i<1114112&&(u=i)}}void 0===u?(u=65533,a=1):u>65535&&(u-=65536,t.push(u>>>10&1023|55296),u=56320|1023&u),t.push(u),n+=a}let n="";for(let e=0;e>6).add(128|63&e):e<55296||e>=57344?t.add(224|e>>12).add(128|e>>6&63).add(128|63&e):(e=65536+((1023&e)<<10|1023&e),t.add(240|e>>18).add(128|e>>12&63).add(128|e>>6&63).add(128|63&e))}return t.toBuffer()},t.toBinaryString=function(e){r.default.instanceOf(e,ArrayBuffer);let t="";const n=new Uint8Array(e);for(let e=0;e=10;)l-=10,u++;0===l?a++:(r=String(l)+B(r,a),a=0)}return u>0&&(r=String(u)+B(r,a)),r}function a(e,t){if(S(e),S(t),v(e)&&v(t))return u(e,t);if(p(e)&&p(t))return b(u(w(e),w(t)));if(h(w(e),w(t))){var n=e;e=t,t=n}var a=r(w(e),w(t));return v(e)?a:b(a)}function s(e,t){return S(e),S(t),a(e,b(t))}function l(e,t){N(e),M(t);for(var n="",r=V(e),u=0,a=0,s=0;s=10;)l-=10,u++;0===l?a++:(n=String(l)+B(n,a),a=0)}return u>0&&(n=String(u)+B(n,a)),0===n.length?"0":n}function i(e,t){N(e),N(t);for(var n="0",r=V(t),a=0;a0;)e+="0",t--;return e}function A(e,t){return S(e),M(t),t>=V(e)?"0":e.charAt(e.length-t-1)}function V(e){return p(e)?e.length-1:e.length}function S(e){U(e,"string")}function N(e){S(e),function(e,t,n){if(!t.call(null,e))throw new Error("Condition "+n+" failed for value "+e)}(e,v,"isPositive")}function M(e){U(e,"number")}function P(e){if(U(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function U(e,t){if(typeof e!==t)throw new Error("Not a "+t+": "+e)}Object.defineProperty(t,"__esModule",{value:!0}),t.subPositive=r,t.add=a,t.sub=s,t.timesDigit=l,t.mulPositive=i,t.mul=f,t.quotientRemainderPositive=o,t.div=function(e,t,n=!1){S(e),S(t);var r=o(w(e),w(t))[0];return _(e,t)||(r=b(r)),!n||c(f(r,t),e)||_(e,t)||(r=s(r,"1")),r},t.eq=c,t.lt=h,t.ge=g,t.gt=y,t.isNegative=p,t.isPositive=v,t.abs=w,t.negate=b;var E=/^(-?)0*([1-9][0-9]*)$/,x=/^0+$/;t.normalize=m,t.LONG_UPPER_SHIFT="4294967296",t.BYTE_SHIFT="256"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),i=n(4);class f extends l.default{constructor(e){super(),r.default.instanceOf(e,Object);const t=Object.keys(e).length;try{r.default.byteUnsignedInteger(t)}catch(e){r.default.fail(String(t)+" fields is too many")}this.fields=new Array(t);let n=0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const a=u.fromString(t);try{r.default.byteUnsignedInteger(a.byteLength)}catch(e){r.default.fail("Field name "+t+" is too long")}const l=e[t];try{r.default.instanceOf(l,i.default)}catch(e){r.default.fail(s.inspect(l)+" is not a valid field type")}this.fields[n]={name:t,type:l,nameBuffer:a},n++}this.fields.sort((e,t)=>e.namet.name?1:0)}static get _value(){return 81}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.fields.length);for(const t of this.fields){const{nameBuffer:n}=t;e.add(n.byteLength).addAll(n),t.type.addToBuffer(e)}return!0}return!1}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Object);for(const n of this.fields){const u=t[n.name];try{n.type.writeValue(e,u)}catch(e){throw r.default(void 0!==u,'Value for field "'+n.name+'" missing'),e}}}consumeValue(e,t,n){let r=0;const u=n||a.makeBaseValue(this);for(const n of this.fields){const a=n.type.consumeValue(e,t+r);u[n.name]=a.value,r+=a.length}return{value:u,length:r}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function u(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,a=[],s=t;s0?f-4:f;var o=0;for(t=0;t>16&255,s[o++]=u>>8&255,s[o++]=255&u;return 2===a?(u=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[o++]=255&u):1===a&&(u=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[o++]=u>>8&255,s[o++]=255&u),s},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,u="",l=[],i=0,f=n-r;if?f:i+16383));return 1===r?(t=e[n-1],u+=s[t>>2],u+=s[t<<4&63],u+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],u+=s[t>>10],u+=s[t>>4&63],u+=s[t<<2&63],u+="="),l.push(u),l.join("")};for(var s=[],l=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=f.length;o>>3},t.modEight=function(e){return 7&e},t.timesEight=function(e){return e<<3}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.default=(({type:e,buffer:t,value:n,length:u})=>{t.addAll(r.makeValueBuffer(u));for(const r of n)e.writeValue(t,r)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r{}t.default=r},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(22),u=n(0);class a extends r.default{constructor(e=10){super();try{u.default.integer(e),u.default(e>=0)}catch(t){throw new RangeError(String(e)+" is not a valid buffer length")}this.buffer=new ArrayBuffer(e),this.size=0,this.pausePoints=[]}get length(){return this.size}grow(e){if(u.default.integer(e),e>this.buffer.byteLength){const t=new ArrayBuffer(e<<1);new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=t}return this}add(e){return u.default.integer(e),u.default.between(0,e,256,"Not a byte: "+String(e)),this.addAll(new Uint8Array([e]).buffer)}addAll(e){u.default.instanceOf(e,ArrayBuffer);const t=this.size,n=this.size+e.byteLength;return this.grow(n),this.size=n,new Uint8Array(this.buffer).set(new Uint8Array(e),t),this}get rawBuffer(){return this.buffer}toBuffer(){let e;return this.pausePoints.length?[e]=this.pausePoints:e=this.size,e===this.buffer.byteLength?this.buffer:this.buffer.slice(0,e)}pause(){return this.pausePoints.push(this.size),this}resume(){if(!this.pausePoints.length)throw new Error("Was not paused");return this.pausePoints.pop(),this}reset(){if(!this.pausePoints.length)throw new Error("Was not paused");const e=this.pausePoints[this.pausePoints.length-1];return this.size=e,this}}t.default=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new WeakMap;t.increment=function(e){const t=r.get(e)||0;r.set(e,t+1)},t.decrement=function(e){const t=r.get(e);r.set(e,t-1)},t.get=function(e){return r.get(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(10);t.default=((e,t)=>{r.default.instanceOf(t,String),r.default(!(u.gt(t,"9223372036854775807")||u.lt(t,"-9223372036854775808")),"Value out of range");const n=u.div(t,u.LONG_UPPER_SHIFT,!0),a=u.sub(t,u.mul(n,u.LONG_UPPER_SHIFT)),s=new ArrayBuffer(8),l=new DataView(s);l.setInt32(0,Number(n)),l.setUint32(4,Number(a)),e.addAll(s)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MILLIS_PER_DAY=864e5;const r=6e4;t.toUTC=function(e){return e.getTime()-e.getTimezoneOffset()*r},t.fromUTC=function(e){const t=new Date(e);return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);class u extends r.default{}t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(20);t.default=((e,t)=>{r.default.instanceOf(t,Array);e:for(let n=0;;n++){let a=0;for(let s=0;s<8;s++){const l=u.timesEight(n)|s;if(l===t.length){s&&e.add(a);break e}const i=t[l];r.default.instanceOf(i,Boolean),i&&(a|=1<<7-s)}e.add(a)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32);t.ByteType=r.default;var u=n(35);t.ShortType=u.default;var a=n(36);t.IntType=a.default;var s=n(37);t.LongType=s.default;var l=n(38);t.BigIntType=l.default;var i=n(39);t.FlexIntType=i.default;var f=n(40);t.UnsignedByteType=f.default;var o=n(41);t.UnsignedShortType=o.default;var c=n(42);t.UnsignedIntType=c.default;var d=n(43);t.UnsignedLongType=d.default;var h=n(44);t.BigUnsignedIntType=h.default;var g=n(45);t.FlexUnsignedIntType=g.default;var y=n(46);t.DateType=y.default;var p=n(47);t.DayType=p.default;var v=n(48);t.TimeType=v.default;var w=n(49);t.FloatType=w.default;var _=n(50);t.DoubleType=_.default;var b=n(51);t.BooleanType=b.default;var m=n(52);t.BooleanTupleType=m.default;var O=n(53);t.BooleanArrayType=O.default;var B=n(54);t.CharType=B.default;var T=n(55);t.StringType=T.default;var A=n(56);t.OctetsType=A.default;var V=n(15);t.TupleType=V.default;var S=n(11);t.StructType=S.default;var N=n(12);t.ArrayType=N.default;var M=n(14);t.SetType=M.default;var P=n(13);t.MapType=P.default;var U=n(57);t.EnumType=U.default;var E=n(58);t.ChoiceType=E.default;var x=n(59);t.NamedChoiceType=x.default;var I=n(60);t.RecursiveType=I.default;var j=n(61);t.OptionalType=j.default;var L=n(62);t.PointerType=L.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REPEATED_TYPE=255},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new Map;t.get=function(e){let t=r.get(e);return t||(t={[e]:class{}}[e],r.set(e,t)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int8Array,func:"getInt8"});class i extends s.default{static get _value(){return 1}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-128,t,128,"Value out of range"),e.addAll(new Int8Array([t]).buffer)}consumeValue(e,t){return l(e,t)}}t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=(e,t)=>e>>>t|e<<32-t;t.default=(e=>{const t=e.byteLength,n=8*t;r.default(n===new Uint32Array([n])[0],"Bit length does not fit in a 32-bit integer");const s=t+(64-(t+72&63))+8,l=new ArrayBuffer(s),i=new Uint8Array(l);i.set(new Uint8Array(e)),i[t]=128,new DataView(l).setUint32(s-4,n);const f=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);for(let e=0;e>>3,u=t[e-2],s=a(u,17)^a(u,19)^u>>>10;t[e]=t[e-16]+r+t[e-7]+s}const r=f.slice();for(let e=0;e<64;e++){const n=r[0],s=r[1],l=r[2],i=r[4],f=r[5],o=r[6],c=a(i,6)^a(i,11)^a(i,25),d=i&f^~i&o,h=r[7]+c+d+u[e]+t[e],g=(a(n,2)^a(n,13)^a(n,22))+(n&s^n&l^s&l);r[7]=o,r[6]=f,r[5]=i,r[4]=r[3]+h,r[3]=l,r[2]=s,r[1]=n,r[0]=h+g}for(let e=0;e<8;e++)f[e]+=r[e]}const o=new ArrayBuffer(32),c=new DataView(o);for(let e=0;e<8;e++)c.setUint32(e<<2,f[e]);return o})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(17),u=new ArrayBuffer(2);new DataView(u).setUint16(0,12),t.VERSION_STRING=r.fromByteArray(new Uint8Array(u))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int16Array,func:"getInt16"});class i extends s.default{static get _value(){return 2}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-32768,t,32768,"Value out of range");const u=new ArrayBuffer(2);new DataView(u).setInt16(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int32Array,func:"getInt32"});class i extends s.default{static get _value(){return 3}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-2147483648,t,2147483648,"Value out of range");const u=new ArrayBuffer(4);new DataView(u).setInt32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),u=n(25),a=n(8);class s extends a.default{static get _value(){return 4}writeValue(e,t){this.isBuffer(e),u.default(e,t)}consumeValue(e,t){return r.readLong(e,t)}}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(8);class i extends l.default{static get _value(){return 5}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),t=s.normalize(t);const n=[];if(!s.eq(t,"0")){for(;s.gt(t,"127")||s.lt(t,"-128");){const e=s.div(t,s.BYTE_SHIFT,!0),r=s.sub(t,s.mul(e,s.BYTE_SHIFT));n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const i=new Uint8Array(e,t+l);let f;if(u){f=String(i[0]<<24>>24);for(let e=1;e=t+8,u.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getUint32(0),l=n.getUint32(4);return{value:a.add(a.mul(String(s),a.LONG_UPPER_SHIFT),String(l)),length:8}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(9);class i extends l.default{static get _value(){return 21}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(!s.isNegative(t),"Value out of range");const n=[];if(!s.eq(t,"0")){for(;s.ge(t,s.BYTE_SHIFT);){const[e,r]=s.quotientRemainderPositive(t,s.BYTE_SHIFT);n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const i=new Uint8Array(e,t+l);let f="0";for(let e=0;e>8),l.setUint8(2,a),e.addAll(s)}consumeValue(e,t){r.default(e.byteLength>=t+3,a.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getInt16(0)<<8|n.getUint8(2);return{value:u.fromUTC(s*u.MILLIS_PER_DAY),length:3}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(26),a=n(1),s=n(16);class l extends s.default{static get _value(){return 28}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Date);const n=new ArrayBuffer(4);new DataView(n).setUint32(0,t.getTime()%u.MILLIS_PER_DAY),e.addAll(n)}consumeValue(e,t){return r.default(e.byteLength>=t+4,a.NOT_LONG_ENOUGH),{value:new Date(new DataView(e).getUint32(t)),length:4}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float32Array,func:"getFloat32"});class i extends s.default{static get _value(){return 32}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(4);new DataView(u).setFloat32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float64Array,func:"getFloat64"});class i extends s.default{static get _value(){return 33}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(8);new DataView(u).setFloat64(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(2);class s extends a.default{static get _value(){return 48}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Boolean),e.add(t?255:0)}consumeValue(e,t){return u.readBooleanByte(e,t)}}t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(28),s=n(2);class l extends s.default{static get _value(){return 49}constructor(e){super(),r.default.byteUnsignedInteger(e),this.length=e}addToBuffer(e){return!!super.addToBuffer(e)&&(e.add(this.length),!0)}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),r.default(t.length===this.length,"Length does not match: expected "+String(this.length)+" but got "+String(t.length)),a.default(e,t)}consumeValue(e,t){return u.readBooleans({buffer:e,offset:t,count:this.length})}equals(e){return super.equals(e)&&e.length===this.length}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(28),l=n(2);class i extends l.default{static get _value(){return 50}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),e.addAll(u.makeValueBuffer(t.length)),s.default(e,t)}consumeValue(e,t){const n=a.readFlexInt(e,t);let{length:r}=n;const u=a.readBooleans({buffer:e,offset:t+r,count:n.value}),{value:s}=u;return r+=u.length,{value:s,length:r}}}t.default=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);class l extends s.default{static get _value(){return 64}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(1===t.length,"String must contain only 1 character"),e.addAll(u.fromString(t))}consumeValue(e,t){r.default(e.byteLength>t,a.NOT_LONG_ENOUGH);const[n]=u.toString(new Uint8Array(e,t).subarray(0,4));return{value:n,length:u.fromString(n).byteLength}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);class l extends s.default{static get _value(){return 65}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),e.addAll(u.fromString(t)).add(0)}consumeValue(e,t){const n=new Uint8Array(e,t);let s=0;for(;r.default(n.length>s,a.NOT_LONG_ENOUGH),n[s];s++);const l=u.toString(n.subarray(0,s));return s++,{value:l,length:s}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(2);class l extends s.default{static get _value(){return 66}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,ArrayBuffer),e.addAll(u.makeValueBuffer(t.byteLength)).addAll(t)}consumeValue(e,t){const n=a.readFlexInt(e,t),{length:u}=n,s=u+n.value;return r.default(e.byteLength>=t+s,a.NOT_LONG_ENOUGH),{value:e.slice(t+u,t+s),length:s}}}t.default=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),i=n(4);class f extends i.default{constructor({type:e,values:t}){super(),r.default.instanceOf(e,l.default),r.default.instanceOf(t,Array);try{r.default.byteUnsignedInteger(t.length)}catch(e){r.default.fail(String(t.length)+" values is too many")}const n=new Map;for(let a=0;at,a.NOT_LONG_ENOUGH);const n=new Uint8Array(e)[t],{values:u}=this;return r.default(n in u,"Index "+String(n)+" is invalid"),{value:u[n],length:1}}equals(e){if(!super.equals(e))return!1;const t=e;if(!this.type.equals(t.type))return!1;if(this.values.length!==t.values.length)return!1;const n=t.valueIndices.keys();for(const e of this.valueIndices.keys()){if(n.next().value!==e)return!1}return!0}}t.default=f},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(6),s=n(2),l=n(4);class i extends s.default{constructor(e){super(),r.default.instanceOf(e,Array);try{r.default.byteUnsignedInteger(e.length)}catch(t){r.default.fail(String(e.length)+" types is too many")}for(const t of e)r.default.instanceOf(t,l.default);this.types=e}static get _value(){return 86}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.types.length);for(const t of this.types)t.addToBuffer(e);return!0}return!1}writeValue(e,t){this.isBuffer(e),e.pause();let n=!1;for(let r=0;rt,u.NOT_LONG_ENOUGH);const a=new Uint8Array(e)[t],{value:s,length:l}=this.types[a].consumeValue(e,t+n);return n+=l,{value:s,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.types.length!==t.types.length)return!1;for(let e=0;et,s.NOT_LONG_ENOUGH);const u=new Uint8Array(e)[t],l=this.indexConstructors.get(u);if(void 0===l)throw new Error("Constructor index "+String(u)+" is invalid");const i=a.get(l.name),{value:f,length:o}=this.constructorTypes[u].type.consumeValue(e,t+n,new i);return n+=o,{value:f,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.constructorTypes.length!==t.constructorTypes.length)return!1;for(let e=0;ee).join(" or "))}function u(e){if(r(e,Number),!Number.isSafeInteger(e))throw new RangeError(o.inspect(e)+" is not an integer")}function a(e,t,n,r){if(t=n){const u=String(t)+" is not in ["+String(e)+","+String(n)+")";throw r?new RangeError(r+" ("+u+")"):new RangeError(u)}}function s(e){throw new Error(e)}function l(e,t){e||s(t||"Assertion failed")}function i(e,t){const n=()=>new RangeError("Expected "+o.inspect(t)+" but got "+o.inspect(e));if(t){let r=!0;switch(t.constructor){case Object:if(!e||e.constructor!==Object)throw n();for(const r in t)if({}.hasOwnProperty.call(t,r))try{i(e[r],t[r])}catch(e){throw n()}break;case Array:if(!e||e.constructor!==Array)throw n();try{i(e.length,t.length)}catch(e){throw n()}for(let r=0;rn,t.NOT_LONG_ENOUGH);let a;const s=new Uint8Array(e)[n];switch(s){case 0:case 255:a=Boolean(s);break;default:throw new Error("0x"+r(s.toString(16),2)+" is an invalid Boolean value")}return{value:a,length:1}},t.readBooleans=function({buffer:e,offset:n,count:r}){const s=new Array(r),l=a.modEight(r),i=a.dividedByEight(r),f=l?i+1:i;u.default(e.byteLength>=n+f,t.NOT_LONG_ENOUGH);const o=new Uint8Array(e,n);for(let e=0;en,t.NOT_LONG_ENOUGH);const r=new Uint8Array(e,n),a=s.getByteCount(r[0]);return u.default(e.byteLength>=n+a,t.NOT_LONG_ENOUGH),{value:s.readValueBuffer(r.slice(0,a).buffer),length:a}},t.readLong=function(e,n){u.default(e.byteLength>=n+8,t.NOT_LONG_ENOUGH);const r=new DataView(e,n),a=r.getInt32(0),s=r.getUint32(4);return{value:l.add(l.mul(String(a),l.LONG_UPPER_SHIFT),String(s)),length:8}},t.readNumber=function({func:e,type:n}){const r=n.BYTES_PER_ELEMENT;return(n,a)=>(u.default(n.byteLength>=a+r,t.NOT_LONG_ENOUGH),{value:new DataView(n)[e](a),length:r})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(4);t.default=class extends r.default{}},function(e,t,n){"use strict";function r(e){const t=7*e;return Math.pow(2,t)}Object.defineProperty(t,"__esModule",{value:!0});const u=n(0),a=(new Map).set(0,0),s=new Map,l=new Map;{let e=1,t=0,n=-256;for(;t<=Number.MAX_SAFE_INTEGER;)t+=r(e),a.set(e,t),s.set(e,255&n),l.set(e-1,e),n>>=1,e++}t.makeValueBuffer=function(e){u.default.integer(e),u.default(e>=0,String(e)+" is negative");const t=(()=>{for(const[t,n]of a)if(n>e)return t;throw new Error("Cannot represent "+String(e))})();let n=e-a.get(t-1);const r=new Uint8Array(t);for(let e=t-1;e>=0;e--)r[e]=255&n,n=Math.floor(n/256);return r[0]|=s.get(t),r.buffer},t.getByteCount=function(e){const t=Math.clz32(~e<<24),n=l.get(t);return u.default(void 0!==n,"Invalid number of bytes"),n},t.readValueBuffer=function(e){u.default.instanceOf(e,ArrayBuffer);const t=e.byteLength;u.default(t>0,"Empty flex int buffer");const n=new Uint8Array(e);let r=n[0]^s.get(t);for(let e=1;e{if(e&&e.constructor===String){const t=Number(e);if(!isNaN(t)||"NaN"===e)return t}})},function(e,t,n){"use strict";function r(e,t){if(void 0===e)return"undefined";if(null===e||u.has(e.constructor))return JSON.stringify(e);if(e instanceof ArrayBuffer){const t=new Uint8Array(e);let n="[";for(const e of t)"["!==n&&(n+=", "),n+="0x"+(e<16?"0":"")+e.toString(16);return n+"]"}if("undefined"!=typeof Buffer&&e instanceof Buffer){let t=""}if(e instanceof Function)return"Function "+e.name;if(t.get(e))return"[Circular]";if(t.set(e,1),e instanceof Set){let n="Set {";const u=e.values();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Map){let n="Map {";const u=e.entries();let a=u.next();for(;!a.done;)n+=r(a.value[0],t),n+=" => ",n+=r(a.value[1],t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"}"}if(e instanceof Array){let n="[";const u=e[Symbol.iterator]();let a=u.next();for(;!a.done;)n+=r(a.value,t),(a=u.next()).done||(n+=", ");return t.set(e,t.get(e)-1),n+"]"}if(e.constructor===Object){let n="{";for(const u in e)({}).hasOwnProperty.call(e,u)&&("{"!==n&&(n+=", "),n+=u+": "+r(e[u],t));return t.set(e,t.get(e)-1),n+"}"}const{name:n}=e.constructor,a=(n?n+" ":"")+r(function(e){const t={};for(const n in e)({}).hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}(e),t);return t.set(e,t.get(e)-1),a}Object.defineProperty(t,"__esModule",{value:!0});const u=new Set([String,Number,Boolean,Date]);t.inspect=function(e){return r(e,new Map)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(23),a=4096;t.toString=function(e){r.default.instanceOf(e,Uint8Array);const t=[];for(let n=0;n239?4:r>223?3:r>191?2:1;if(n+a<=e.length){let t,s,l,i;switch(a){case 1:r<128&&(u=r);break;case 2:128==(192&(t=e[n+1]))&&(i=(31&r)<<6|63&t)>127&&(u=i);break;case 3:t=e[n+1],s=e[n+2],128==(192&t)&&128==(192&s)&&(i=(15&r)<<12|(63&t)<<6|63&s)>2047&&(i<55296||i>57343)&&(u=i);break;case 4:t=e[n+1],s=e[n+2],l=e[n+3],128==(192&t)&&128==(192&s)&&128==(192&l)&&(i=(15&r)<<18|(63&t)<<12|(63&s)<<6|63&l)>65535&&i<1114112&&(u=i)}}void 0===u?(u=65533,a=1):u>65535&&(u-=65536,t.push(u>>>10&1023|55296),u=56320|1023&u),t.push(u),n+=a}let n="";for(let e=0;e>6).add(128|63&e):e<55296||e>=57344?t.add(224|e>>12).add(128|e>>6&63).add(128|63&e):(e=65536+((1023&e)<<10|1023&e),t.add(240|e>>18).add(128|e>>12&63).add(128|e>>6&63).add(128|63&e))}return t.toBuffer()},t.toBinaryString=function(e){r.default.instanceOf(e,ArrayBuffer);let t="";const n=new Uint8Array(e);for(let e=0;e=10;)l-=10,u++;0===l?a++:(r=String(l)+B(r,a),a=0)}return u>0&&(r=String(u)+B(r,a)),r}function a(e,t){if(S(e),S(t),v(e)&&v(t))return u(e,t);if(p(e)&&p(t))return b(u(w(e),w(t)));if(h(w(e),w(t))){var n=e;e=t,t=n}var a=r(w(e),w(t));return v(e)?a:b(a)}function s(e,t){return S(e),S(t),a(e,b(t))}function l(e,t){N(e),M(t);for(var n="",r=V(e),u=0,a=0,s=0;s=10;)l-=10,u++;0===l?a++:(n=String(l)+B(n,a),a=0)}return u>0&&(n=String(u)+B(n,a)),0===n.length?"0":n}function i(e,t){N(e),N(t);for(var n="0",r=V(t),a=0;a0;)e+="0",t--;return e}function A(e,t){return S(e),M(t),t>=V(e)?"0":e.charAt(e.length-t-1)}function V(e){return p(e)?e.length-1:e.length}function S(e){U(e,"string")}function N(e){S(e),function(e,t,n){if(!t.call(null,e))throw new Error("Condition "+n+" failed for value "+e)}(e,v,"isPositive")}function M(e){U(e,"number")}function P(e){if(U(e,"number"),e<0)throw new Error("Expected a positive number: "+e)}function U(e,t){if(typeof e!==t)throw new Error("Not a "+t+": "+e)}Object.defineProperty(t,"__esModule",{value:!0}),t.subPositive=r,t.add=a,t.sub=s,t.timesDigit=l,t.mulPositive=i,t.mul=f,t.quotientRemainderPositive=o,t.div=function(e,t,n=!1){S(e),S(t);var r=o(w(e),w(t))[0];return _(e,t)||(r=b(r)),!n||c(f(r,t),e)||_(e,t)||(r=s(r,"1")),r},t.eq=c,t.lt=h,t.ge=g,t.gt=y,t.isNegative=p,t.isPositive=v,t.abs=w,t.negate=b;var E=/^(-?)0*([1-9][0-9]*)$/,x=/^0+$/;t.normalize=m,t.LONG_UPPER_SHIFT="4294967296",t.BYTE_SHIFT="256"},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),i=n(4);t.default=class extends l.default{constructor(e){super(),r.default.instanceOf(e,Object);const t=Object.keys(e).length;try{r.default.byteUnsignedInteger(t)}catch(e){r.default.fail(String(t)+" fields is too many")}this.fields=new Array(t);let n=0;for(const t in e){if(!{}.hasOwnProperty.call(e,t))continue;const a=u.fromString(t);try{r.default.byteUnsignedInteger(a.byteLength)}catch(e){r.default.fail("Field name "+t+" is too long")}const l=e[t];try{r.default.instanceOf(l,i.default)}catch(e){r.default.fail(s.inspect(l)+" is not a valid field type")}this.fields[n]={name:t,type:l,nameBuffer:a},n++}this.fields.sort((e,t)=>e.namet.name?1:0)}static get _value(){return 81}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.fields.length);for(const t of this.fields){const{nameBuffer:n}=t;e.add(n.byteLength).addAll(n),t.type.addToBuffer(e)}return!0}return!1}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Object);for(const n of this.fields){const u=t[n.name];try{n.type.writeValue(e,u)}catch(e){throw r.default(void 0!==u,'Value for field "'+n.name+'" missing'),e}}}consumeValue(e,t,n){let r=0;const u=n||a.makeBaseValue(this);for(const n of this.fields){const a=n.type.consumeValue(e,t+r);u[n.name]=a.value,r+=a.length}return{value:u,length:r}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.fields.length!==t.fields.length)return!1;for(let e=0;e0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function u(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}function a(e,t,n){for(var r,a=[],s=t;s0?f-4:f;var o=0;for(t=0;t>16&255,s[o++]=u>>8&255,s[o++]=255&u;return 2===a?(u=l[e.charCodeAt(t)]<<2|l[e.charCodeAt(t+1)]>>4,s[o++]=255&u):1===a&&(u=l[e.charCodeAt(t)]<<10|l[e.charCodeAt(t+1)]<<4|l[e.charCodeAt(t+2)]>>2,s[o++]=u>>8&255,s[o++]=255&u),s},t.fromByteArray=function(e){for(var t,n=e.length,r=n%3,u="",l=[],i=0,f=n-r;if?f:i+16383));return 1===r?(t=e[n-1],u+=s[t>>2],u+=s[t<<4&63],u+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],u+=s[t>>10],u+=s[t>>4&63],u+=s[t<<2&63],u+="="),l.push(u),l.join("")};for(var s=[],l=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,c=f.length;o>>3},t.modEight=function(e){return 7&e},t.timesEight=function(e){return e<<3}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(3);t.default=(({type:e,buffer:t,value:n,length:u})=>{t.addAll(r.makeValueBuffer(u));for(const r of n)e.writeValue(t,r)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.default=class{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(22),u=n(0),a=10;t.default=class extends r.default{constructor(e=a){super();try{u.default.integer(e),u.default(e>=0)}catch(t){throw new RangeError(String(e)+" is not a valid buffer length")}this.buffer=new ArrayBuffer(e),this.size=0,this.pausePoints=[]}get length(){return this.size}grow(e){if(u.default.integer(e),e>this.buffer.byteLength){const t=new ArrayBuffer(e<<1);new Uint8Array(t).set(new Uint8Array(this.buffer).subarray(0,this.size)),this.buffer=t}return this}add(e){return u.default.integer(e),u.default.between(0,e,256,"Not a byte: "+String(e)),this.addAll(new Uint8Array([e]).buffer)}addAll(e){u.default.instanceOf(e,ArrayBuffer);const t=this.size,n=this.size+e.byteLength;return this.grow(n),this.size=n,new Uint8Array(this.buffer).set(new Uint8Array(e),t),this}get rawBuffer(){return this.buffer}toBuffer(){let e;return this.pausePoints.length?[e]=this.pausePoints:e=this.size,e===this.buffer.byteLength?this.buffer:this.buffer.slice(0,e)}pause(){return this.pausePoints.push(this.size),this}resume(){if(!this.pausePoints.length)throw new Error("Was not paused");return this.pausePoints.pop(),this}reset(){if(!this.pausePoints.length)throw new Error("Was not paused");const e=this.pausePoints[this.pausePoints.length-1];return this.size=e,this}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new WeakMap;t.increment=function(e){const t=r.get(e)||0;r.set(e,t+1)},t.decrement=function(e){const t=r.get(e);r.set(e,t-1)},t.get=function(e){return r.get(e)}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(10);t.default=((e,t)=>{r.default.instanceOf(t,String),r.default(!(u.gt(t,"9223372036854775807")||u.lt(t,"-9223372036854775808")),"Value out of range");const n=u.div(t,u.LONG_UPPER_SHIFT,!0),a=u.sub(t,u.mul(n,u.LONG_UPPER_SHIFT)),s=new ArrayBuffer(8),l=new DataView(s);l.setInt32(0,Number(n)),l.setUint32(4,Number(a)),e.addAll(s)})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MILLIS_PER_DAY=864e5;const r=6e4;t.toUTC=function(e){return e.getTime()-e.getTimezoneOffset()*r},t.fromUTC=function(e){const t=new Date(e);return new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(2);t.default=class extends r.default{}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(20);t.default=((e,t)=>{r.default.instanceOf(t,Array);e:for(let n=0;;n++){let a=0;for(let s=0;s<8;s++){const l=u.timesEight(n)|s;if(l===t.length){s&&e.add(a);break e}const i=t[l];r.default.instanceOf(i,Boolean),i&&(a|=1<<7-s)}e.add(a)}})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(32);t.ByteType=r.default;var u=n(35);t.ShortType=u.default;var a=n(36);t.IntType=a.default;var s=n(37);t.LongType=s.default;var l=n(38);t.BigIntType=l.default;var i=n(39);t.FlexIntType=i.default;var f=n(40);t.UnsignedByteType=f.default;var o=n(41);t.UnsignedShortType=o.default;var c=n(42);t.UnsignedIntType=c.default;var d=n(43);t.UnsignedLongType=d.default;var h=n(44);t.BigUnsignedIntType=h.default;var g=n(45);t.FlexUnsignedIntType=g.default;var y=n(46);t.DateType=y.default;var p=n(47);t.DayType=p.default;var v=n(48);t.TimeType=v.default;var w=n(49);t.FloatType=w.default;var _=n(50);t.DoubleType=_.default;var b=n(51);t.BooleanType=b.default;var m=n(52);t.BooleanTupleType=m.default;var O=n(53);t.BooleanArrayType=O.default;var B=n(54);t.CharType=B.default;var T=n(55);t.StringType=T.default;var A=n(56);t.OctetsType=A.default;var V=n(15);t.TupleType=V.default;var S=n(11);t.StructType=S.default;var N=n(12);t.ArrayType=N.default;var M=n(14);t.SetType=M.default;var P=n(13);t.MapType=P.default;var U=n(57);t.EnumType=U.default;var E=n(58);t.ChoiceType=E.default;var x=n(59);t.NamedChoiceType=x.default;var I=n(60);t.RecursiveType=I.default;var j=n(61);t.OptionalType=j.default;var L=n(62);t.PointerType=L.default},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.REPEATED_TYPE=255},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=new Map;t.get=function(e){let t=r.get(e);return t||(t={[e]:class{}}[e],r.set(e,t)),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int8Array,func:"getInt8"});t.default=class extends s.default{static get _value(){return 1}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-128,t,128,"Value out of range"),e.addAll(new Int8Array([t]).buffer)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=(e,t)=>e>>>t|e<<32-t;t.default=(e=>{const t=e.byteLength,n=8*t;r.default(n===new Uint32Array([n])[0],"Bit length does not fit in a 32-bit integer");const s=t+(64-(t+72&63))+8,l=new ArrayBuffer(s),i=new Uint8Array(l);i.set(new Uint8Array(e)),i[t]=128,new DataView(l).setUint32(s-4,n);const f=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]);for(let e=0;e>>3,u=t[e-2],s=a(u,17)^a(u,19)^u>>>10;t[e]=t[e-16]+r+t[e-7]+s}const r=f.slice();for(let e=0;e<64;e++){const n=r[0],s=r[1],l=r[2],i=r[4],f=r[5],o=r[6],c=a(i,6)^a(i,11)^a(i,25),d=i&f^~i&o,h=r[7]+c+d+u[e]+t[e],g=(a(n,2)^a(n,13)^a(n,22))+(n&s^n&l^s&l);r[7]=o,r[6]=f,r[5]=i,r[4]=r[3]+h,r[3]=l,r[2]=s,r[1]=n,r[0]=h+g}for(let e=0;e<8;e++)f[e]+=r[e]}const o=new ArrayBuffer(32),c=new DataView(o);for(let e=0;e<8;e++)c.setUint32(e<<2,f[e]);return o})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(17),u=new ArrayBuffer(2);new DataView(u).setUint16(0,12),t.VERSION_STRING=r.fromByteArray(new Uint8Array(u))},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int16Array,func:"getInt16"});t.default=class extends s.default{static get _value(){return 2}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-32768,t,32768,"Value out of range");const u=new ArrayBuffer(2);new DataView(u).setInt16(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(8),l=u.readNumber({type:Int32Array,func:"getInt32"});t.default=class extends s.default{static get _value(){return 3}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.integer(t),r.default.between(-2147483648,t,2147483648,"Value out of range");const u=new ArrayBuffer(4);new DataView(u).setInt32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(1),u=n(25),a=n(8);t.default=class extends a.default{static get _value(){return 4}writeValue(e,t){this.isBuffer(e),u.default(e,t)}consumeValue(e,t){return r.readLong(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(8);t.default=class extends l.default{static get _value(){return 5}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),t=s.normalize(t);const n=[];if(!s.eq(t,"0")){for(;s.gt(t,"127")||s.lt(t,"-128");){const e=s.div(t,s.BYTE_SHIFT,!0),r=s.sub(t,s.mul(e,s.BYTE_SHIFT));n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const i=new Uint8Array(e,t+l);let f;if(u){f=String(i[0]<<24>>24);for(let e=1;e=t+8,u.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getUint32(0),l=n.getUint32(4);return{value:a.add(a.mul(String(s),a.LONG_UPPER_SHIFT),String(l)),length:8}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(10),l=n(9);t.default=class extends l.default{static get _value(){return 21}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(!s.isNegative(t),"Value out of range");const n=[];if(!s.eq(t,"0")){for(;s.ge(t,s.BYTE_SHIFT);){const[e,r]=s.quotientRemainderPositive(t,s.BYTE_SHIFT);n.push(Number(r)),t=e}n.push(Number(t))}const a=new Uint8Array(n.length);for(let e=n.length-1,t=0;e>=0;e--,t++)a[t]=n[e];e.addAll(u.makeValueBuffer(n.length)).addAll(a.buffer)}consumeValue(e,t){const n=a.readFlexInt(e,t),u=n.value;let{length:l}=n;r.default(e.byteLength>=t+l+u,a.NOT_LONG_ENOUGH);const i=new Uint8Array(e,t+l);let f="0";for(let e=0;e>8),l.setUint8(2,a),e.addAll(s)}consumeValue(e,t){r.default(e.byteLength>=t+3,a.NOT_LONG_ENOUGH);const n=new DataView(e,t),s=n.getInt16(0)<<8|n.getUint8(2);return{value:u.fromUTC(s*u.MILLIS_PER_DAY),length:3}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(26),a=n(1),s=n(16);t.default=class extends s.default{static get _value(){return 28}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Date);const n=new ArrayBuffer(4);new DataView(n).setUint32(0,t.getTime()%u.MILLIS_PER_DAY),e.addAll(n)}consumeValue(e,t){return r.default(e.byteLength>=t+4,a.NOT_LONG_ENOUGH),{value:new Date(new DataView(e).getUint32(t)),length:4}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float32Array,func:"getFloat32"});t.default=class extends s.default{static get _value(){return 32}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(4);new DataView(u).setFloat32(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(5),s=n(27),l=u.readNumber({type:Float64Array,func:"getFloat64"});t.default=class extends s.default{static get _value(){return 33}writeValue(e,t){this.isBuffer(e);const n=a.default(t);void 0!==n&&(t=n),r.default.instanceOf(t,Number);const u=new ArrayBuffer(8);new DataView(u).setFloat64(0,t),e.addAll(u)}consumeValue(e,t){return l(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(2);t.default=class extends a.default{static get _value(){return 48}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Boolean),e.add(t?255:0)}consumeValue(e,t){return u.readBooleanByte(e,t)}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(28),s=n(2);t.default=class extends s.default{static get _value(){return 49}constructor(e){super(),r.default.byteUnsignedInteger(e),this.length=e}addToBuffer(e){return!!super.addToBuffer(e)&&(e.add(this.length),!0)}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),r.default(t.length===this.length,"Length does not match: expected "+String(this.length)+" but got "+String(t.length)),a.default(e,t)}consumeValue(e,t){return u.readBooleans({buffer:e,offset:t,count:this.length})}equals(e){return super.equals(e)&&e.length===this.length}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(28),l=n(2);t.default=class extends l.default{static get _value(){return 50}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,Array),e.addAll(u.makeValueBuffer(t.length)),s.default(e,t)}consumeValue(e,t){const n=a.readFlexInt(e,t);let{length:r}=n;const u=a.readBooleans({buffer:e,offset:t+r,count:n.value}),{value:s}=u;return r+=u.length,{value:s,length:r}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 64}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),r.default(1===t.length,"String must contain only 1 character"),e.addAll(u.fromString(t))}consumeValue(e,t){r.default(e.byteLength>t,a.NOT_LONG_ENOUGH);const[n]=u.toString(new Uint8Array(e,t).subarray(0,4));return{value:n,length:u.fromString(n).byteLength}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 65}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,String),e.addAll(u.fromString(t)).add(0)}consumeValue(e,t){const n=new Uint8Array(e,t);let s=0;for(;r.default(n.length>s,a.NOT_LONG_ENOUGH),n[s];s++);const l=u.toString(n.subarray(0,s));return s++,{value:l,length:s}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(3),a=n(1),s=n(2);t.default=class extends s.default{static get _value(){return 66}writeValue(e,t){this.isBuffer(e),r.default.instanceOf(t,ArrayBuffer),e.addAll(u.makeValueBuffer(t.byteLength)).addAll(t)}consumeValue(e,t){const n=a.readFlexInt(e,t),{length:u}=n,s=u+n.value;return r.default(e.byteLength>=t+s,a.NOT_LONG_ENOUGH),{value:e.slice(t+u,t+s),length:s}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(7),a=n(1),s=n(6),l=n(2),i=n(4);t.default=class extends i.default{constructor({type:e,values:t}){super(),r.default.instanceOf(e,l.default),r.default.instanceOf(t,Array);try{r.default.byteUnsignedInteger(t.length)}catch(e){r.default.fail(String(t.length)+" values is too many")}const n=new Map;for(let a=0;at,a.NOT_LONG_ENOUGH);const n=new Uint8Array(e)[t],{values:u}=this;return r.default(n in u,"Index "+String(n)+" is invalid"),{value:u[n],length:1}}equals(e){if(!super.equals(e))return!1;const t=e;if(!this.type.equals(t.type))return!1;if(this.values.length!==t.values.length)return!1;const n=t.valueIndices.keys();for(const e of this.valueIndices.keys())if(n.next().value!==e)return!1;return!0}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r=n(0),u=n(1),a=n(6),s=n(2),l=n(4);t.default=class extends s.default{constructor(e){super(),r.default.instanceOf(e,Array);try{r.default.byteUnsignedInteger(e.length)}catch(t){r.default.fail(String(e.length)+" types is too many")}for(const t of e)r.default.instanceOf(t,l.default);this.types=e}static get _value(){return 86}addToBuffer(e){if(super.addToBuffer(e)){e.add(this.types.length);for(const t of this.types)t.addToBuffer(e);return!0}return!1}writeValue(e,t){this.isBuffer(e),e.pause();let n=!1;for(let r=0;rt,u.NOT_LONG_ENOUGH);const a=new Uint8Array(e)[t],{value:s,length:l}=this.types[a].consumeValue(e,t+n);return n+=l,{value:s,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.types.length!==t.types.length)return!1;for(let e=0;et,s.NOT_LONG_ENOUGH);const u=new Uint8Array(e)[t],l=this.indexConstructors.get(u);if(void 0===l)throw new Error("Constructor index "+String(u)+" is invalid");const i=a.get(l.name),{value:f,length:o}=this.constructorTypes[u].type.consumeValue(e,t+n,new i);return n+=o,{value:f,length:n}}equals(e){if(!super.equals(e))return!1;const t=e;if(this.constructorTypes.length!==t.constructorTypes.length)return!1;for(let e=0;e extends AbsoluteType writeValue(buffer: AppendableBuffer, value: E): void; consumeValue(buffer: ArrayBuffer, offset: number): ReadResult; equals(otherType: any): boolean; + /** + * An alternative to [[registerType]], + * to avoid writing the type's name twice. + * Please use this instead of [[registerType]]. + * + * So this + * ````javascript + * let type = new sb.RecursiveType('abc') + * sb.registerType({ + * type: new sb.StructType({ + * //... + * }), + * name: 'abc' + * }) + * ```` + * becomes + * ````javascript + * let type = new sb.RecursiveType('abc') + * type.setType(new sb.StructType({ + * //... + * })) + * ```` + * @param type The type to register + */ + setType(type: RegisterableType): void; } diff --git a/dist/types/recursive.js b/dist/types/recursive.js index 719e922..36fbe1c 100644 --- a/dist/types/recursive.js +++ b/dist/types/recursive.js @@ -213,5 +213,32 @@ class RecursiveType extends absolute_1.default { return super.equals(otherType) && this.name === otherType.name; } + /** + * An alternative to [[registerType]], + * to avoid writing the type's name twice. + * Please use this instead of [[registerType]]. + * + * So this + * ````javascript + * let type = new sb.RecursiveType('abc') + * sb.registerType({ + * type: new sb.StructType({ + * //... + * }), + * name: 'abc' + * }) + * ```` + * becomes + * ````javascript + * let type = new sb.RecursiveType('abc') + * type.setType(new sb.StructType({ + * //... + * })) + * ```` + * @param type The type to register + */ + setType(type) { + recursiveRegistry.registerType({ type, name: this.name }); + } } exports.default = RecursiveType; diff --git a/docs/interfaces/_lib_appendable_.appendablebuffer.html b/docs/classes/_lib_appendable_.appendablebuffer.html similarity index 86% rename from docs/interfaces/_lib_appendable_.appendablebuffer.html rename to docs/classes/_lib_appendable_.appendablebuffer.html index 5c04af7..d8f60d2 100644 --- a/docs/interfaces/_lib_appendable_.appendablebuffer.html +++ b/docs/classes/_lib_appendable_.appendablebuffer.html @@ -62,7 +62,7 @@ AppendableBuffer -

Interface AppendableBuffer

+

Class AppendableBuffer

@@ -74,8 +74,8 @@

Interface AppendableBuffer

A "writable" interface, sufficient to be able to write type and value bytes. - Implemented by GrowableBuffer, as well as - AppendableStream (a wrapper around a writable stream). + Implemented by GrowableBuffer, as well as + AppendableStream (a wrapper around a writable stream). All methods can be chained, e.g.

let gb = new GrowableBuffer
 gb
@@ -95,16 +95,17 @@ 

Hierarchy

-
-

Implemented by

- -

Index

@@ -112,17 +113,17 @@

Index

Properties

Methods

@@ -130,7 +131,7 @@

Methods

Properties

-
+

length

length: number
@@ -148,10 +149,10 @@

length

Methods

-
+

add

-
    +
    • add(value: number): this
      @@ -180,10 +181,10 @@

      Returns this

-
+

addAll

-
    +
    • addAll(buffer: ArrayBuffer): this
      @@ -214,10 +215,10 @@

      Returns this

-
+

pause

-
    +
    • pause(): this
      @@ -246,7 +247,7 @@

      pause

      .pause() .add(4).add(5).add(6) .reset() //cancels [4, 5, 6] - .resume() + .resume() //resumes [] .resume() //resumes [1, 2, 3] console.log(new Uint8Array(gb.toBuffer())) //Uint8Array [ 1, 2, 3 ] @@ -255,10 +256,10 @@

      Returns this

-
+

reset

-
    +
    • reset(): this
      @@ -286,10 +287,10 @@

      Returns this

-
+

resume

-
    +
    • resume(): this
      @@ -332,25 +333,25 @@

      Returns this

      -
    • +
    • AppendableBuffer diff --git a/docs/classes/_lib_appendable_stream_.appendablestream.html b/docs/classes/_lib_appendable_stream_.appendablestream.html index 108a7f9..1d4532e 100644 --- a/docs/classes/_lib_appendable_stream_.appendablestream.html +++ b/docs/classes/_lib_appendable_stream_.appendablestream.html @@ -73,7 +73,7 @@

      Class AppendableStream

      A wrapper around a writable stream - to implement AppendableBuffer. + to implement AppendableBuffer. The stream must be explicitly closed by calling end after all bytes have been written.

      @@ -84,16 +84,15 @@

      Class AppendableStream

      Hierarchy

-
-

Implements

- -

Index

@@ -116,18 +115,18 @@

Properties

Accessors

Methods

@@ -211,17 +210,18 @@

Private writtenBytes

Accessors

-
+

length

-
    +
    • get length(): number
    • @@ -236,18 +236,18 @@

      Returns number

      Methods

      -
      +

      add

      -
        +
        • add(value: number): this
        • @@ -269,18 +269,18 @@

          Returns this

      -
      +

      addAll

      -
        +
        • addAll(buffer: ArrayBuffer): this
        • @@ -312,7 +312,7 @@

          end

        • @@ -324,18 +324,18 @@

          Returns void

      -
      +

      pause

      -
        +
        • pause(): this
      -
      +

      reset

      -
      -
      +

      resume

      -
        +
        • resume(): this
        diff --git a/docs/classes/_lib_growable_buffer_.growablebuffer.html b/docs/classes/_lib_growable_buffer_.growablebuffer.html index aec2c97..6ba3a45 100644 --- a/docs/classes/_lib_growable_buffer_.growablebuffer.html +++ b/docs/classes/_lib_growable_buffer_.growablebuffer.html @@ -84,16 +84,15 @@

        Class GrowableBuffer

        Hierarchy

      -
      -

      Implements

      - -

      Index

      @@ -115,19 +114,19 @@

      Properties

      Accessors

      Methods

      @@ -203,17 +202,18 @@

      Private size

      Accessors

      -
      +

      length

      -
        +
        • get length(): number
        • @@ -236,7 +236,7 @@

          Private rawBuffer

        • @@ -251,18 +251,18 @@

          Returns ArrayBuff

      Methods

      -
      +

      add

      -
        +
        • add(value: number): this
      -
      +

      addAll

      -
        +
        • addAll(buffer: ArrayBuffer): this
        • @@ -330,7 +330,7 @@

          grow

        • @@ -359,18 +359,18 @@

          Returns this

      -
      +

      pause

      -
        +
        • pause(): this
      -
      +

      reset

      -
      -
      +

      resume

      -
        +
        • resume(): this
        • @@ -473,7 +473,7 @@

          toBuffer

        • @@ -518,28 +518,28 @@

          Returns ArrayBuff
        • size
        • -
        • +
        • length
        • rawBuffer
        • -
        • +
        • add
        • -
        • +
        • addAll
        • grow
        • -
        • +
        • pause
        • -
        • +
        • reset
        • -
        • +
        • resume
        • diff --git a/docs/classes/_types_absolute_.absolutetype.html b/docs/classes/_types_absolute_.absolutetype.html index de71b44..f590ac0 100644 --- a/docs/classes/_types_absolute_.absolutetype.html +++ b/docs/classes/_types_absolute_.absolutetype.html @@ -207,7 +207,7 @@

          Static _value

          @@ -227,7 +227,7 @@

          Methods

          addToBuffer

          • @@ -235,13 +235,13 @@

            addToBuffer

            Implementation of Type.addToBuffer

            Inherited from AbstractType.addToBuffer

              -
            • Defined in types/abstract.ts:33
            • +
            • Defined in types/abstract.ts:30

            Parameters

            Returns boolean

            @@ -260,7 +260,7 @@

            consumeValue

            Implementation of Type.consumeValue

            Inherited from AbstractType.consumeValue

              -
            • Defined in types/abstract.ts:69
            • +
            • Defined in types/abstract.ts:66

            Parameters

            @@ -291,7 +291,7 @@

            equals

            Implementation of Type.equals

            Inherited from AbstractType.equals

              -
            • Defined in types/abstract.ts:82
            • +
            • Defined in types/abstract.ts:79

            Parameters

            @@ -316,7 +316,7 @@

            getHash

            Implementation of Type.getHash

            Inherited from AbstractType.getHash

              -
            • Defined in types/abstract.ts:55
            • +
            • Defined in types/abstract.ts:52

            Returns string

            @@ -335,7 +335,7 @@

            getSignature

            Implementation of Type.getSignature

            Inherited from AbstractType.getSignature

              -
            • Defined in types/abstract.ts:59
            • +
            • Defined in types/abstract.ts:56

            Returns string

            @@ -346,14 +346,14 @@

            Returns string

            Private isBuffer

            • @@ -365,9 +365,9 @@

              Private isBuffer

              Parameters

              @@ -386,7 +386,7 @@

              readValue

              Parameters

              @@ -414,7 +414,7 @@

              toBuffer

              Implementation of Type.toBuffer

              Inherited from AbstractType.toBuffer

                -
              • Defined in types/abstract.ts:51
              • +
              • Defined in types/abstract.ts:48

              Returns ArrayBuffer

              @@ -433,7 +433,7 @@

              valueBuffer

              Implementation of Type.valueBuffer

              Inherited from AbstractType.valueBuffer

                -
              • Defined in types/abstract.ts:64
              • +
              • Defined in types/abstract.ts:61

              Parameters

              @@ -450,7 +450,7 @@

              Returns ArrayBuff

              writeValue

              • @@ -458,13 +458,13 @@

                writeValue

                Implementation of Type.writeValue

                Inherited from AbstractType.writeValue

                  -
                • Defined in types/abstract.ts:63
                • +
                • Defined in types/abstract.ts:60

                Parameters

                • -
                  buffer: AppendableBuffer
                  +
                  buffer: AppendableBuffer
                • value: VALUE
                  diff --git a/docs/classes/_types_abstract_.abstracttype.html b/docs/classes/_types_abstract_.abstracttype.html index 3c087fa..f462335 100644 --- a/docs/classes/_types_abstract_.abstracttype.html +++ b/docs/classes/_types_abstract_.abstracttype.html @@ -161,7 +161,7 @@

                  Private cachedBuffer: ArrayBuffer

      @@ -171,7 +171,7 @@

      Private cachedHash: undefined | string

@@ -181,17 +181,17 @@

Private cachedSignature: undefined | string

Private Optional cachedTypeLocations

-
cachedTypeLocations: Map<AppendableBuffer, number>
+
cachedTypeLocations: Map<AppendableBuffer, number>
@@ -208,7 +208,7 @@

Static _value

  • @@ -234,7 +234,7 @@

    Private _getHash

  • @@ -257,7 +257,7 @@

    Private _getSignature

  • @@ -281,7 +281,7 @@

    Private _toBuffer

  • @@ -298,20 +298,20 @@

    Returns ArrayBuff

    addToBuffer

    • Parameters

      Returns boolean

      @@ -329,7 +329,7 @@

      consumeValue

      Parameters

      @@ -359,7 +359,7 @@

      equals

      Parameters

      @@ -383,7 +383,7 @@

      getHash

      Returns string

      @@ -401,7 +401,7 @@

      getSignature

      Returns string

      @@ -412,13 +412,13 @@

      Returns string

      Private isBuffer

      • @@ -430,9 +430,9 @@

        Private isBuffer

        Parameters

        @@ -450,7 +450,7 @@

        readValue

      • Parameters

        @@ -477,7 +477,7 @@

        toBuffer

        Returns ArrayBuffer

        @@ -495,7 +495,7 @@

        valueBuffer

        Parameters

        @@ -512,20 +512,20 @@

        Returns ArrayBuff

        writeValue

    diff --git a/docs/classes/_types_array_.arraytype.html b/docs/classes/_types_array_.arraytype.html index 7f594d9..e545200 100644 --- a/docs/classes/_types_array_.arraytype.html +++ b/docs/classes/_types_array_.arraytype.html @@ -250,7 +250,7 @@

    Methods

    addToBuffer

    • @@ -264,7 +264,7 @@

      addToBuffer

      Parameters

      Returns boolean

      @@ -338,7 +338,7 @@

      getHash

      Implementation of Type.getHash

      Inherited from AbstractType.getHash

        -
      • Defined in types/abstract.ts:55
      • +
      • Defined in types/abstract.ts:52

      Returns string

      @@ -357,7 +357,7 @@

      getSignature

      Implementation of Type.getSignature

      Inherited from AbstractType.getSignature

        -
      • Defined in types/abstract.ts:59
      • +
      • Defined in types/abstract.ts:56

      Returns string

      @@ -368,14 +368,14 @@

      Returns string

      Private isBuffer

      • @@ -387,9 +387,9 @@

        Private isBuffer

        Parameters

        @@ -408,7 +408,7 @@

        readValue

        Parameters

        @@ -436,7 +436,7 @@

        toBuffer

        Implementation of Type.toBuffer

        Inherited from AbstractType.toBuffer

          -
        • Defined in types/abstract.ts:51
        • +
        • Defined in types/abstract.ts:48

        Returns ArrayBuffer

        @@ -454,7 +454,7 @@

        valueBuffer

        Parameters

        @@ -471,7 +471,7 @@

        Returns ArrayBuff

        writeValue

        • @@ -483,7 +483,7 @@

          writeValue

          -

          Appends value bytes to an AppendableBuffer according to the type

          +

          Appends value bytes to an AppendableBuffer according to the type

          Example:

          let car1 = new Car('VW', 'Bug', 1960)
          @@ -500,7 +500,7 @@ 

          writeValue

          Parameters

          • -
            buffer: AppendableBuffer
            +
            buffer: AppendableBuffer

            The buffer to which to append

            diff --git a/docs/classes/_types_big_int_.biginttype.html b/docs/classes/_types_big_int_.biginttype.html index f4736fa..f251832 100644 --- a/docs/classes/_types_big_int_.biginttype.html +++ b/docs/classes/_types_big_int_.biginttype.html @@ -155,7 +155,7 @@

            Methods

            addToBuffer

            • @@ -163,13 +163,13 @@

              addToBuffer

              Implementation of Type.addToBuffer

              Inherited from AbstractType.addToBuffer

                -
              • Defined in types/abstract.ts:33
              • +
              • Defined in types/abstract.ts:30

              Parameters

              Returns boolean

              @@ -215,7 +215,7 @@

              equals

              Implementation of Type.equals

              Inherited from AbstractType.equals

                -
              • Defined in types/abstract.ts:82
              • +
              • Defined in types/abstract.ts:79

              Parameters

              @@ -240,7 +240,7 @@

              getHash

              Implementation of Type.getHash

              Inherited from AbstractType.getHash

                -
              • Defined in types/abstract.ts:55
              • +
              • Defined in types/abstract.ts:52

              Returns string

              @@ -259,7 +259,7 @@

              getSignature

              Implementation of Type.getSignature

              Inherited from AbstractType.getSignature

                -
              • Defined in types/abstract.ts:59
              • +
              • Defined in types/abstract.ts:56

              Returns string

              @@ -270,14 +270,14 @@

              Returns string

              Private isBuffer

              • @@ -289,9 +289,9 @@

                Private isBuffer

                Parameters

                @@ -310,7 +310,7 @@

                readValue

                Parameters

                @@ -338,7 +338,7 @@

                toBuffer

                Implementation of Type.toBuffer

                Inherited from AbstractType.toBuffer

                  -
                • Defined in types/abstract.ts:51
                • +
                • Defined in types/abstract.ts:48

                Returns ArrayBuffer

                @@ -356,7 +356,7 @@

                valueBuffer

                Parameters

                @@ -373,7 +373,7 @@

                Returns ArrayBuff

                writeValue

                • @@ -385,7 +385,7 @@

                  writeValue

                  -

                  Appends value bytes to an AppendableBuffer according to the type

                  +

                  Appends value bytes to an AppendableBuffer according to the type

                  Examples:

                  type.writeValue(buffer, '-1') //takes up 2 bytes
                  @@ -402,7 +402,7 @@ 

                  writeValue

                  Parameters

                  • -
                    buffer: AppendableBuffer
                    +
                    buffer: AppendableBuffer

                    The buffer to which to append

                    diff --git a/docs/classes/_types_big_unsigned_int_.bigunsignedinttype.html b/docs/classes/_types_big_unsigned_int_.bigunsignedinttype.html index e6a70c8..50ef13b 100644 --- a/docs/classes/_types_big_unsigned_int_.bigunsignedinttype.html +++ b/docs/classes/_types_big_unsigned_int_.bigunsignedinttype.html @@ -155,7 +155,7 @@

                    Methods

                    addToBuffer

                    • @@ -163,13 +163,13 @@

                      addToBuffer

                      Implementation of Type.addToBuffer

                      Inherited from AbstractType.addToBuffer

                        -
                      • Defined in types/abstract.ts:33
                      • +
                      • Defined in types/abstract.ts:30

                      Parameters

                      Returns boolean

                      @@ -215,7 +215,7 @@

                      equals

                      Implementation of Type.equals

                      Inherited from AbstractType.equals

                        -
                      • Defined in types/abstract.ts:82
                      • +
                      • Defined in types/abstract.ts:79

                      Parameters

                      @@ -240,7 +240,7 @@

                      getHash

                      Implementation of Type.getHash

                      Inherited from AbstractType.getHash

                        -
                      • Defined in types/abstract.ts:55
                      • +
                      • Defined in types/abstract.ts:52

                      Returns string

                      @@ -259,7 +259,7 @@

                      getSignature

                      Implementation of Type.getSignature

                      Inherited from AbstractType.getSignature

                        -
                      • Defined in types/abstract.ts:59
                      • +
                      • Defined in types/abstract.ts:56

                      Returns string

                      @@ -270,14 +270,14 @@

                      Returns string

                      Private isBuffer

                      • @@ -289,9 +289,9 @@

                        Private isBuffer

                        Parameters

                        @@ -310,7 +310,7 @@

                        readValue

                        Parameters

                        @@ -338,7 +338,7 @@

                        toBuffer

                        Implementation of Type.toBuffer

                        Inherited from AbstractType.toBuffer

                          -
                        • Defined in types/abstract.ts:51
                        • +
                        • Defined in types/abstract.ts:48

                        Returns ArrayBuffer

                        @@ -356,7 +356,7 @@

                        valueBuffer

                        Parameters

                        @@ -373,7 +373,7 @@

                        Returns ArrayBuff

                        writeValue

                        • @@ -385,7 +385,7 @@

                          writeValue

                          -

                          Appends value bytes to an AppendableBuffer according to the type

                          +

                          Appends value bytes to an AppendableBuffer according to the type

                          Examples:

                          type.writeValue(buffer, '1') //takes up 2 bytes
                          @@ -402,7 +402,7 @@ 

                          writeValue

                          Parameters

                          • -
                            buffer: AppendableBuffer
                            +
                            buffer: AppendableBuffer

                            The buffer to which to append

                            diff --git a/docs/classes/_types_boolean_.booleantype.html b/docs/classes/_types_boolean_.booleantype.html index 31a644e..d195b01 100644 --- a/docs/classes/_types_boolean_.booleantype.html +++ b/docs/classes/_types_boolean_.booleantype.html @@ -161,7 +161,7 @@

                            Methods

                            addToBuffer

                            • @@ -169,13 +169,13 @@

                              addToBuffer

                              Implementation of Type.addToBuffer

                              Inherited from AbstractType.addToBuffer

                                -
                              • Defined in types/abstract.ts:33
                              • +
                              • Defined in types/abstract.ts:30

                              Parameters

                              Returns boolean

                              @@ -221,7 +221,7 @@

                              equals

                              Implementation of Type.equals

                              Inherited from AbstractType.equals

                                -
                              • Defined in types/abstract.ts:82
                              • +
                              • Defined in types/abstract.ts:79

                              Parameters

                              @@ -246,7 +246,7 @@

                              getHash

                              Implementation of Type.getHash

                              Inherited from AbstractType.getHash

                                -
                              • Defined in types/abstract.ts:55
                              • +
                              • Defined in types/abstract.ts:52

                              Returns string

                              @@ -265,7 +265,7 @@

                              getSignature

                              Implementation of Type.getSignature

                              Inherited from AbstractType.getSignature

                                -
                              • Defined in types/abstract.ts:59
                              • +
                              • Defined in types/abstract.ts:56

                              Returns string

                              @@ -276,14 +276,14 @@

                              Returns string

                              Private isBuffer

                              • @@ -295,9 +295,9 @@

                                Private isBuffer

                                Parameters

                                @@ -316,7 +316,7 @@

                                readValue

                                Parameters

                                @@ -344,7 +344,7 @@

                                toBuffer

                                Implementation of Type.toBuffer

                                Inherited from AbstractType.toBuffer

                                  -
                                • Defined in types/abstract.ts:51
                                • +
                                • Defined in types/abstract.ts:48

                                Returns ArrayBuffer

                                @@ -362,7 +362,7 @@

                                valueBuffer

                                Parameters

                                @@ -379,7 +379,7 @@

                                Returns ArrayBuff

                                writeValue

                                • @@ -391,7 +391,7 @@

                                  writeValue

                                  -

                                  Appends value bytes to an AppendableBuffer according to the type

                                  +

                                  Appends value bytes to an AppendableBuffer according to the type

                                  Example:

                                  type.writeValue(buffer, true)
                                  @@ -405,7 +405,7 @@ 

                                  writeValue

                                  Parameters

                                  • -
                                    buffer: AppendableBuffer
                                    +
                                    buffer: AppendableBuffer

                                    The buffer to which to append

                                    diff --git a/docs/classes/_types_boolean_array_.booleanarraytype.html b/docs/classes/_types_boolean_array_.booleanarraytype.html index e79ae7f..2866e7b 100644 --- a/docs/classes/_types_boolean_array_.booleanarraytype.html +++ b/docs/classes/_types_boolean_array_.booleanarraytype.html @@ -164,7 +164,7 @@

                                    Methods

                                    addToBuffer

                                    • @@ -172,13 +172,13 @@

                                      addToBuffer

                                      Implementation of Type.addToBuffer

                                      Inherited from AbstractType.addToBuffer

                                        -
                                      • Defined in types/abstract.ts:33
                                      • +
                                      • Defined in types/abstract.ts:30

                                      Parameters

                                      Returns boolean

                                      @@ -224,7 +224,7 @@

                                      equals

                                      Implementation of Type.equals

                                      Inherited from AbstractType.equals

                                        -
                                      • Defined in types/abstract.ts:82
                                      • +
                                      • Defined in types/abstract.ts:79

                                      Parameters

                                      @@ -249,7 +249,7 @@

                                      getHash

                                      Implementation of Type.getHash

                                      Inherited from AbstractType.getHash

                                        -
                                      • Defined in types/abstract.ts:55
                                      • +
                                      • Defined in types/abstract.ts:52

                                      Returns string

                                      @@ -268,7 +268,7 @@

                                      getSignature

                                      Implementation of Type.getSignature

                                      Inherited from AbstractType.getSignature

                                        -
                                      • Defined in types/abstract.ts:59
                                      • +
                                      • Defined in types/abstract.ts:56

                                      Returns string

                                      @@ -279,14 +279,14 @@

                                      Returns string

                                      Private isBuffer

                                      • @@ -298,9 +298,9 @@

                                        Private isBuffer

                                        Parameters

                                        @@ -319,7 +319,7 @@

                                        readValue

                                        Parameters

                                        @@ -347,7 +347,7 @@

                                        toBuffer

                                        Implementation of Type.toBuffer

                                        Inherited from AbstractType.toBuffer

                                          -
                                        • Defined in types/abstract.ts:51
                                        • +
                                        • Defined in types/abstract.ts:48

                                        Returns ArrayBuffer

                                        @@ -365,7 +365,7 @@

                                        valueBuffer

                                        Parameters

                                        @@ -382,7 +382,7 @@

                                        Returns ArrayBuff

                                        writeValue

                                        • @@ -394,7 +394,7 @@

                                          writeValue

                                          -

                                          Appends value bytes to an AppendableBuffer according to the type

                                          +

                                          Appends value bytes to an AppendableBuffer according to the type

                                          Examples:

                                          type.writeValue(buffer, [false]) //takes up 2 bytes
                                          @@ -411,7 +411,7 @@ 

                                          writeValue

                                          Parameters

                                          • -
                                            buffer: AppendableBuffer
                                            +
                                            buffer: AppendableBuffer

                                            The buffer to which to append

                                            diff --git a/docs/classes/_types_boolean_tuple_.booleantupletype.html b/docs/classes/_types_boolean_tuple_.booleantupletype.html index d2e3bf1..d5cf066 100644 --- a/docs/classes/_types_boolean_tuple_.booleantupletype.html +++ b/docs/classes/_types_boolean_tuple_.booleantupletype.html @@ -228,7 +228,7 @@

                                            Methods

                                            addToBuffer

                                            • @@ -242,7 +242,7 @@

                                              addToBuffer

                                              Parameters

                                              Returns boolean

                                              @@ -313,7 +313,7 @@

                                              getHash

                                              Implementation of Type.getHash

                                              Inherited from AbstractType.getHash

                                                -
                                              • Defined in types/abstract.ts:55
                                              • +
                                              • Defined in types/abstract.ts:52

                                              Returns string

                                              @@ -332,7 +332,7 @@

                                              getSignature

                                              Implementation of Type.getSignature

                                              Inherited from AbstractType.getSignature

                                                -
                                              • Defined in types/abstract.ts:59
                                              • +
                                              • Defined in types/abstract.ts:56

                                              Returns string

                                              @@ -343,14 +343,14 @@

                                              Returns string

                                              Private isBuffer

                                              • @@ -362,9 +362,9 @@

                                                Private isBuffer

                                                Parameters

                                                @@ -383,7 +383,7 @@

                                                readValue

                                                Parameters

                                                @@ -411,7 +411,7 @@

                                                toBuffer

                                                Implementation of Type.toBuffer

                                                Inherited from AbstractType.toBuffer

                                                  -
                                                • Defined in types/abstract.ts:51
                                                • +
                                                • Defined in types/abstract.ts:48

                                                Returns ArrayBuffer

                                                @@ -429,7 +429,7 @@

                                                valueBuffer

                                                Parameters

                                                @@ -446,7 +446,7 @@

                                                Returns ArrayBuff

                                                writeValue

                                                • @@ -458,7 +458,7 @@

                                                  writeValue

                                                  -

                                                  Appends value bytes to an AppendableBuffer according to the type

                                                  +

                                                  Appends value bytes to an AppendableBuffer according to the type

                                                  Example:

                                                  type.writeValue(buffer, new Array(100).fill(true)) //takes up 13 bytes
                                                  @@ -472,7 +472,7 @@ 

                                                  writeValue

                                                  Parameters

                                                  • -
                                                    buffer: AppendableBuffer
                                                    +
                                                    buffer: AppendableBuffer

                                                    The buffer to which to append

                                                    diff --git a/docs/classes/_types_byte_.bytetype.html b/docs/classes/_types_byte_.bytetype.html index ba56d2d..eea655c 100644 --- a/docs/classes/_types_byte_.bytetype.html +++ b/docs/classes/_types_byte_.bytetype.html @@ -154,7 +154,7 @@

                                                    Methods

                                                    addToBuffer

                                                    • @@ -162,13 +162,13 @@

                                                      addToBuffer

                                                      Implementation of Type.addToBuffer

                                                      Inherited from AbstractType.addToBuffer

                                                        -
                                                      • Defined in types/abstract.ts:33
                                                      • +
                                                      • Defined in types/abstract.ts:30

                                                      Parameters

                                                      Returns boolean

                                                      @@ -214,7 +214,7 @@

                                                      equals

                                                      Implementation of Type.equals

                                                      Inherited from AbstractType.equals

                                                        -
                                                      • Defined in types/abstract.ts:82
                                                      • +
                                                      • Defined in types/abstract.ts:79

                                                      Parameters

                                                      @@ -239,7 +239,7 @@

                                                      getHash

                                                      Implementation of Type.getHash

                                                      Inherited from AbstractType.getHash

                                                        -
                                                      • Defined in types/abstract.ts:55
                                                      • +
                                                      • Defined in types/abstract.ts:52

                                                      Returns string

                                                      @@ -258,7 +258,7 @@

                                                      getSignature

                                                      Implementation of Type.getSignature

                                                      Inherited from AbstractType.getSignature

                                                        -
                                                      • Defined in types/abstract.ts:59
                                                      • +
                                                      • Defined in types/abstract.ts:56

                                                      Returns string

                                                      @@ -269,14 +269,14 @@

                                                      Returns string

                                                      Private isBuffer

                                                      • @@ -288,9 +288,9 @@

                                                        Private isBuffer

                                                        Parameters

                                                        @@ -309,7 +309,7 @@

                                                        readValue

                                                        Parameters

                                                        @@ -337,7 +337,7 @@

                                                        toBuffer

                                                        Implementation of Type.toBuffer

                                                        Inherited from AbstractType.toBuffer

                                                          -
                                                        • Defined in types/abstract.ts:51
                                                        • +
                                                        • Defined in types/abstract.ts:48

                                                        Returns ArrayBuffer

                                                        @@ -355,7 +355,7 @@

                                                        valueBuffer

                                                        Parameters

                                                        @@ -372,7 +372,7 @@

                                                        Returns ArrayBuff

                                                        writeValue

                                                        • @@ -384,7 +384,7 @@

                                                          writeValue

                                                          -

                                                          Appends value bytes to an AppendableBuffer according to the type

                                                          +

                                                          Appends value bytes to an AppendableBuffer according to the type

                                                          Example:

                                                          type.writeValue(buffer, -123) //or '-123'
                                                          @@ -398,7 +398,7 @@ 

                                                          writeValue

                                                          Parameters

                                                          • -
                                                            buffer: AppendableBuffer
                                                            +
                                                            buffer: AppendableBuffer

                                                            The buffer to which to append

                                                            diff --git a/docs/classes/_types_char_.chartype.html b/docs/classes/_types_char_.chartype.html index 23ec0d7..df8e2c7 100644 --- a/docs/classes/_types_char_.chartype.html +++ b/docs/classes/_types_char_.chartype.html @@ -161,7 +161,7 @@

                                                            Methods

                                                            addToBuffer

                                                            • @@ -169,13 +169,13 @@

                                                              addToBuffer

                                                              Implementation of Type.addToBuffer

                                                              Inherited from AbstractType.addToBuffer

                                                                -
                                                              • Defined in types/abstract.ts:33
                                                              • +
                                                              • Defined in types/abstract.ts:30

                                                              Parameters

                                                              Returns boolean

                                                              @@ -221,7 +221,7 @@

                                                              equals

                                                              Implementation of Type.equals

                                                              Inherited from AbstractType.equals

                                                                -
                                                              • Defined in types/abstract.ts:82
                                                              • +
                                                              • Defined in types/abstract.ts:79

                                                              Parameters

                                                              @@ -246,7 +246,7 @@

                                                              getHash

                                                              Implementation of Type.getHash

                                                              Inherited from AbstractType.getHash

                                                                -
                                                              • Defined in types/abstract.ts:55
                                                              • +
                                                              • Defined in types/abstract.ts:52

                                                              Returns string

                                                              @@ -265,7 +265,7 @@

                                                              getSignature

                                                              Implementation of Type.getSignature

                                                              Inherited from AbstractType.getSignature

                                                                -
                                                              • Defined in types/abstract.ts:59
                                                              • +
                                                              • Defined in types/abstract.ts:56

                                                              Returns string

                                                              @@ -276,14 +276,14 @@

                                                              Returns string

                                                              Private isBuffer

                                                              • @@ -295,9 +295,9 @@

                                                                Private isBuffer

                                                                Parameters

                                                                @@ -316,7 +316,7 @@

                                                                readValue

                                                                Parameters

                                                                @@ -344,7 +344,7 @@

                                                                toBuffer

                                                                Implementation of Type.toBuffer

                                                                Inherited from AbstractType.toBuffer

                                                                  -
                                                                • Defined in types/abstract.ts:51
                                                                • +
                                                                • Defined in types/abstract.ts:48

                                                                Returns ArrayBuffer

                                                                @@ -362,7 +362,7 @@

                                                                valueBuffer

                                                                Parameters

                                                                @@ -379,7 +379,7 @@

                                                                Returns ArrayBuff

                                                                writeValue

                                                                • @@ -391,7 +391,7 @@

                                                                  writeValue

                                                                  -

                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                  +

                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                  Example:

                                                                  type.writeValue(buffer, 'é') //takes up 2 bytes in UTF-8
                                                                  @@ -405,7 +405,7 @@ 

                                                                  writeValue

                                                                  Parameters

                                                                  • -
                                                                    buffer: AppendableBuffer
                                                                    +
                                                                    buffer: AppendableBuffer

                                                                    The buffer to which to append

                                                                    diff --git a/docs/classes/_types_choice_.choicetype.html b/docs/classes/_types_choice_.choicetype.html index 11e2d4e..be0efab 100644 --- a/docs/classes/_types_choice_.choicetype.html +++ b/docs/classes/_types_choice_.choicetype.html @@ -259,7 +259,7 @@

                                                                    Methods

                                                                    addToBuffer

                                                                    • @@ -273,7 +273,7 @@

                                                                      addToBuffer

                                                                      Parameters

                                                                      Returns boolean

                                                                      @@ -344,7 +344,7 @@

                                                                      getHash

                                                                      Implementation of Type.getHash

                                                                      Inherited from AbstractType.getHash

                                                                        -
                                                                      • Defined in types/abstract.ts:55
                                                                      • +
                                                                      • Defined in types/abstract.ts:52

                                                                      Returns string

                                                                      @@ -363,7 +363,7 @@

                                                                      getSignature

                                                                      Implementation of Type.getSignature

                                                                      Inherited from AbstractType.getSignature

                                                                        -
                                                                      • Defined in types/abstract.ts:59
                                                                      • +
                                                                      • Defined in types/abstract.ts:56

                                                                      Returns string

                                                                      @@ -374,14 +374,14 @@

                                                                      Returns string

                                                                      Private isBuffer

                                                                      • @@ -393,9 +393,9 @@

                                                                        Private isBuffer

                                                                        Parameters

                                                                        @@ -414,7 +414,7 @@

                                                                        readValue

                                                                        Parameters

                                                                        @@ -442,7 +442,7 @@

                                                                        toBuffer

                                                                        Implementation of Type.toBuffer

                                                                        Inherited from AbstractType.toBuffer

                                                                          -
                                                                        • Defined in types/abstract.ts:51
                                                                        • +
                                                                        • Defined in types/abstract.ts:48

                                                                        Returns ArrayBuffer

                                                                        @@ -461,7 +461,7 @@

                                                                        valueBuffer

                                                                        Implementation of Type.valueBuffer

                                                                        Inherited from AbstractType.valueBuffer

                                                                          -
                                                                        • Defined in types/abstract.ts:64
                                                                        • +
                                                                        • Defined in types/abstract.ts:61

                                                                        Parameters

                                                                        @@ -478,7 +478,7 @@

                                                                        Returns ArrayBuff

                                                                        writeValue

                                                                        • @@ -491,7 +491,7 @@

                                                                          writeValue

                                                                          -

                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                          +

                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                          Examples:

                                                                          type.writeValue(buffer, {hex: '#abcdef'}) //writes using hexType
                                                                          @@ -511,7 +511,7 @@ 

                                                                          writeValue

                                                                          Parameters

                                                                          • -
                                                                            buffer: AppendableBuffer
                                                                            +
                                                                            buffer: AppendableBuffer

                                                                            The buffer to which to append

                                                                            diff --git a/docs/classes/_types_chrono_.chronotype.html b/docs/classes/_types_chrono_.chronotype.html index 7f3b9d8..c6f6024 100644 --- a/docs/classes/_types_chrono_.chronotype.html +++ b/docs/classes/_types_chrono_.chronotype.html @@ -155,7 +155,7 @@

                                                                            Static _value

                                                                            @@ -175,7 +175,7 @@

                                                                            Methods

                                                                            addToBuffer

                                                                            • @@ -183,13 +183,13 @@

                                                                              addToBuffer

                                                                              Implementation of Type.addToBuffer

                                                                              Inherited from AbstractType.addToBuffer

                                                                                -
                                                                              • Defined in types/abstract.ts:33
                                                                              • +
                                                                              • Defined in types/abstract.ts:30

                                                                              Parameters

                                                                              Returns boolean

                                                                              @@ -208,7 +208,7 @@

                                                                              consumeValue

                                                                              Implementation of Type.consumeValue

                                                                              Inherited from AbstractType.consumeValue

                                                                                -
                                                                              • Defined in types/abstract.ts:69
                                                                              • +
                                                                              • Defined in types/abstract.ts:66

                                                                              Parameters

                                                                              @@ -239,7 +239,7 @@

                                                                              equals

                                                                              Implementation of Type.equals

                                                                              Inherited from AbstractType.equals

                                                                                -
                                                                              • Defined in types/abstract.ts:82
                                                                              • +
                                                                              • Defined in types/abstract.ts:79

                                                                              Parameters

                                                                              @@ -264,7 +264,7 @@

                                                                              getHash

                                                                              Implementation of Type.getHash

                                                                              Inherited from AbstractType.getHash

                                                                                -
                                                                              • Defined in types/abstract.ts:55
                                                                              • +
                                                                              • Defined in types/abstract.ts:52

                                                                              Returns string

                                                                              @@ -283,7 +283,7 @@

                                                                              getSignature

                                                                              Implementation of Type.getSignature

                                                                              Inherited from AbstractType.getSignature

                                                                                -
                                                                              • Defined in types/abstract.ts:59
                                                                              • +
                                                                              • Defined in types/abstract.ts:56

                                                                              Returns string

                                                                              @@ -294,14 +294,14 @@

                                                                              Returns string

                                                                              Private isBuffer

                                                                              • @@ -313,9 +313,9 @@

                                                                                Private isBuffer

                                                                                Parameters

                                                                                @@ -334,7 +334,7 @@

                                                                                readValue

                                                                                Parameters

                                                                                @@ -362,7 +362,7 @@

                                                                                toBuffer

                                                                                Implementation of Type.toBuffer

                                                                                Inherited from AbstractType.toBuffer

                                                                                  -
                                                                                • Defined in types/abstract.ts:51
                                                                                • +
                                                                                • Defined in types/abstract.ts:48

                                                                                Returns ArrayBuffer

                                                                                @@ -380,7 +380,7 @@

                                                                                valueBuffer

                                                                                Parameters

                                                                                @@ -397,20 +397,20 @@

                                                                                Returns ArrayBuff

                                                                                writeValue

                                                                                • Parameters

                                                                                  • -
                                                                                    buffer: AppendableBuffer
                                                                                    +
                                                                                    buffer: AppendableBuffer
                                                                                  • value: Date
                                                                                    diff --git a/docs/classes/_types_date_.datetype.html b/docs/classes/_types_date_.datetype.html index 39aed4f..9dd2d5c 100644 --- a/docs/classes/_types_date_.datetype.html +++ b/docs/classes/_types_date_.datetype.html @@ -162,7 +162,7 @@

                                                                                    Methods

                                                                                    addToBuffer

                                                                                    • @@ -170,13 +170,13 @@

                                                                                      addToBuffer

                                                                                      Implementation of Type.addToBuffer

                                                                                      Inherited from AbstractType.addToBuffer

                                                                                        -
                                                                                      • Defined in types/abstract.ts:33
                                                                                      • +
                                                                                      • Defined in types/abstract.ts:30

                                                                                      Parameters

                                                                                      Returns boolean

                                                                                      @@ -222,7 +222,7 @@

                                                                                      equals

                                                                                      Implementation of Type.equals

                                                                                      Inherited from AbstractType.equals

                                                                                        -
                                                                                      • Defined in types/abstract.ts:82
                                                                                      • +
                                                                                      • Defined in types/abstract.ts:79

                                                                                      Parameters

                                                                                      @@ -247,7 +247,7 @@

                                                                                      getHash

                                                                                      Implementation of Type.getHash

                                                                                      Inherited from AbstractType.getHash

                                                                                        -
                                                                                      • Defined in types/abstract.ts:55
                                                                                      • +
                                                                                      • Defined in types/abstract.ts:52

                                                                                      Returns string

                                                                                      @@ -266,7 +266,7 @@

                                                                                      getSignature

                                                                                      Implementation of Type.getSignature

                                                                                      Inherited from AbstractType.getSignature

                                                                                        -
                                                                                      • Defined in types/abstract.ts:59
                                                                                      • +
                                                                                      • Defined in types/abstract.ts:56

                                                                                      Returns string

                                                                                      @@ -277,14 +277,14 @@

                                                                                      Returns string

                                                                                      Private isBuffer

                                                                                      • @@ -296,9 +296,9 @@

                                                                                        Private isBuffer

                                                                                        Parameters

                                                                                        @@ -317,7 +317,7 @@

                                                                                        readValue

                                                                                        Parameters

                                                                                        @@ -345,7 +345,7 @@

                                                                                        toBuffer

                                                                                        Implementation of Type.toBuffer

                                                                                        Inherited from AbstractType.toBuffer

                                                                                          -
                                                                                        • Defined in types/abstract.ts:51
                                                                                        • +
                                                                                        • Defined in types/abstract.ts:48

                                                                                        Returns ArrayBuffer

                                                                                        @@ -363,7 +363,7 @@

                                                                                        valueBuffer

                                                                                        Parameters

                                                                                        @@ -380,7 +380,7 @@

                                                                                        Returns ArrayBuff

                                                                                        writeValue

                                                                                        • @@ -392,7 +392,7 @@

                                                                                          writeValue

                                                                                          -

                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                          +

                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                          Example:

                                                                                          type.writeValue(buffer, new Date)
                                                                                          @@ -406,7 +406,7 @@ 

                                                                                          writeValue

                                                                                          Parameters

                                                                                          • -
                                                                                            buffer: AppendableBuffer
                                                                                            +
                                                                                            buffer: AppendableBuffer

                                                                                            The buffer to which to append

                                                                                            diff --git a/docs/classes/_types_day_.daytype.html b/docs/classes/_types_day_.daytype.html index 4e53f4e..0c7c610 100644 --- a/docs/classes/_types_day_.daytype.html +++ b/docs/classes/_types_day_.daytype.html @@ -162,7 +162,7 @@

                                                                                            Methods

                                                                                            addToBuffer

                                                                                            • @@ -170,13 +170,13 @@

                                                                                              addToBuffer

                                                                                              Implementation of Type.addToBuffer

                                                                                              Inherited from AbstractType.addToBuffer

                                                                                                -
                                                                                              • Defined in types/abstract.ts:33
                                                                                              • +
                                                                                              • Defined in types/abstract.ts:30

                                                                                              Parameters

                                                                                              Returns boolean

                                                                                              @@ -222,7 +222,7 @@

                                                                                              equals

                                                                                              Implementation of Type.equals

                                                                                              Inherited from AbstractType.equals

                                                                                                -
                                                                                              • Defined in types/abstract.ts:82
                                                                                              • +
                                                                                              • Defined in types/abstract.ts:79

                                                                                              Parameters

                                                                                              @@ -247,7 +247,7 @@

                                                                                              getHash

                                                                                              Implementation of Type.getHash

                                                                                              Inherited from AbstractType.getHash

                                                                                                -
                                                                                              • Defined in types/abstract.ts:55
                                                                                              • +
                                                                                              • Defined in types/abstract.ts:52

                                                                                              Returns string

                                                                                              @@ -266,7 +266,7 @@

                                                                                              getSignature

                                                                                              Implementation of Type.getSignature

                                                                                              Inherited from AbstractType.getSignature

                                                                                                -
                                                                                              • Defined in types/abstract.ts:59
                                                                                              • +
                                                                                              • Defined in types/abstract.ts:56

                                                                                              Returns string

                                                                                              @@ -277,14 +277,14 @@

                                                                                              Returns string

                                                                                              Private isBuffer

                                                                                              • @@ -296,9 +296,9 @@

                                                                                                Private isBuffer

                                                                                                Parameters

                                                                                                @@ -317,7 +317,7 @@

                                                                                                readValue

                                                                                                Parameters

                                                                                                @@ -345,7 +345,7 @@

                                                                                                toBuffer

                                                                                                Implementation of Type.toBuffer

                                                                                                Inherited from AbstractType.toBuffer

                                                                                                  -
                                                                                                • Defined in types/abstract.ts:51
                                                                                                • +
                                                                                                • Defined in types/abstract.ts:48

                                                                                                Returns ArrayBuffer

                                                                                                @@ -363,7 +363,7 @@

                                                                                                valueBuffer

                                                                                                Parameters

                                                                                                @@ -380,7 +380,7 @@

                                                                                                Returns ArrayBuff

                                                                                                writeValue

                                                                                                • @@ -392,7 +392,7 @@

                                                                                                  writeValue

                                                                                                  -

                                                                                                  Appends value bytes to an AppendableBuffer according to the type. +

                                                                                                  Appends value bytes to an AppendableBuffer according to the type. Writes Date objects but ignores all units smaller than the day.

                                                                                                  Example:

                                                                                                  @@ -407,7 +407,7 @@

                                                                                                  writeValue

                                                                                                  Parameters

                                                                                                  • -
                                                                                                    buffer: AppendableBuffer
                                                                                                    +
                                                                                                    buffer: AppendableBuffer

                                                                                                    The buffer to which to append

                                                                                                    diff --git a/docs/classes/_types_double_.doubletype.html b/docs/classes/_types_double_.doubletype.html index 49cb11d..cd95e9c 100644 --- a/docs/classes/_types_double_.doubletype.html +++ b/docs/classes/_types_double_.doubletype.html @@ -155,7 +155,7 @@

                                                                                                    Methods

                                                                                                    addToBuffer

                                                                                                    • @@ -163,13 +163,13 @@

                                                                                                      addToBuffer

                                                                                                      Implementation of Type.addToBuffer

                                                                                                      Inherited from AbstractType.addToBuffer

                                                                                                        -
                                                                                                      • Defined in types/abstract.ts:33
                                                                                                      • +
                                                                                                      • Defined in types/abstract.ts:30

                                                                                                      Parameters

                                                                                                      Returns boolean

                                                                                                      @@ -215,7 +215,7 @@

                                                                                                      equals

                                                                                                      Implementation of Type.equals

                                                                                                      Inherited from AbstractType.equals

                                                                                                        -
                                                                                                      • Defined in types/abstract.ts:82
                                                                                                      • +
                                                                                                      • Defined in types/abstract.ts:79

                                                                                                      Parameters

                                                                                                      @@ -240,7 +240,7 @@

                                                                                                      getHash

                                                                                                      Implementation of Type.getHash

                                                                                                      Inherited from AbstractType.getHash

                                                                                                        -
                                                                                                      • Defined in types/abstract.ts:55
                                                                                                      • +
                                                                                                      • Defined in types/abstract.ts:52

                                                                                                      Returns string

                                                                                                      @@ -259,7 +259,7 @@

                                                                                                      getSignature

                                                                                                      Implementation of Type.getSignature

                                                                                                      Inherited from AbstractType.getSignature

                                                                                                        -
                                                                                                      • Defined in types/abstract.ts:59
                                                                                                      • +
                                                                                                      • Defined in types/abstract.ts:56

                                                                                                      Returns string

                                                                                                      @@ -270,14 +270,14 @@

                                                                                                      Returns string

                                                                                                      Private isBuffer

                                                                                                      • @@ -289,9 +289,9 @@

                                                                                                        Private isBuffer

                                                                                                        Parameters

                                                                                                        @@ -310,7 +310,7 @@

                                                                                                        readValue

                                                                                                        Parameters

                                                                                                        @@ -338,7 +338,7 @@

                                                                                                        toBuffer

                                                                                                        Implementation of Type.toBuffer

                                                                                                        Inherited from AbstractType.toBuffer

                                                                                                          -
                                                                                                        • Defined in types/abstract.ts:51
                                                                                                        • +
                                                                                                        • Defined in types/abstract.ts:48

                                                                                                        Returns ArrayBuffer

                                                                                                        @@ -356,7 +356,7 @@

                                                                                                        valueBuffer

                                                                                                        Parameters

                                                                                                        @@ -373,7 +373,7 @@

                                                                                                        Returns ArrayBuff

                                                                                                        writeValue

                                                                                                        • @@ -385,7 +385,7 @@

                                                                                                          writeValue

                                                                                                          -

                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                          +

                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                          Examples:

                                                                                                          type.writeValue(buffer, 1.23) //or '1.23'
                                                                                                          @@ -405,7 +405,7 @@ 

                                                                                                          writeValue

                                                                                                          Parameters

                                                                                                          • -
                                                                                                            buffer: AppendableBuffer
                                                                                                            +
                                                                                                            buffer: AppendableBuffer

                                                                                                            The buffer to which to append

                                                                                                            diff --git a/docs/classes/_types_enum_.enumtype.html b/docs/classes/_types_enum_.enumtype.html index 6846427..54a7da0 100644 --- a/docs/classes/_types_enum_.enumtype.html +++ b/docs/classes/_types_enum_.enumtype.html @@ -279,7 +279,7 @@

                                                                                                            Methods

                                                                                                            addToBuffer

                                                                                                            • @@ -293,7 +293,7 @@

                                                                                                              addToBuffer

                                                                                                              Parameters

                                                                                                              Returns boolean

                                                                                                              @@ -364,7 +364,7 @@

                                                                                                              getHash

                                                                                                              Implementation of Type.getHash

                                                                                                              Inherited from AbstractType.getHash

                                                                                                                -
                                                                                                              • Defined in types/abstract.ts:55
                                                                                                              • +
                                                                                                              • Defined in types/abstract.ts:52

                                                                                                              Returns string

                                                                                                              @@ -383,7 +383,7 @@

                                                                                                              getSignature

                                                                                                              Implementation of Type.getSignature

                                                                                                              Inherited from AbstractType.getSignature

                                                                                                                -
                                                                                                              • Defined in types/abstract.ts:59
                                                                                                              • +
                                                                                                              • Defined in types/abstract.ts:56

                                                                                                              Returns string

                                                                                                              @@ -394,14 +394,14 @@

                                                                                                              Returns string

                                                                                                              Private isBuffer

                                                                                                              • @@ -413,9 +413,9 @@

                                                                                                                Private isBuffer

                                                                                                                Parameters

                                                                                                                @@ -434,7 +434,7 @@

                                                                                                                readValue

                                                                                                                Parameters

                                                                                                                @@ -462,7 +462,7 @@

                                                                                                                toBuffer

                                                                                                                Implementation of Type.toBuffer

                                                                                                                Inherited from AbstractType.toBuffer

                                                                                                                  -
                                                                                                                • Defined in types/abstract.ts:51
                                                                                                                • +
                                                                                                                • Defined in types/abstract.ts:48

                                                                                                                Returns ArrayBuffer

                                                                                                                @@ -481,7 +481,7 @@

                                                                                                                valueBuffer

                                                                                                                Implementation of Type.valueBuffer

                                                                                                                Inherited from AbstractType.valueBuffer

                                                                                                                  -
                                                                                                                • Defined in types/abstract.ts:64
                                                                                                                • +
                                                                                                                • Defined in types/abstract.ts:61

                                                                                                                Parameters

                                                                                                                @@ -498,7 +498,7 @@

                                                                                                                Returns ArrayBuff

                                                                                                                writeValue

                                                                                                                • @@ -511,7 +511,7 @@

                                                                                                                  writeValue

                                                                                                                  -

                                                                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                                                                  +

                                                                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                                                                  Example:

                                                                                                                  type.writeValue(buffer, CHEETAH)
                                                                                                                  @@ -525,7 +525,7 @@ 

                                                                                                                  writeValue

                                                                                                                  Parameters

                                                                                                                  • -
                                                                                                                    buffer: AppendableBuffer
                                                                                                                    +
                                                                                                                    buffer: AppendableBuffer

                                                                                                                    The buffer to which to append

                                                                                                                    diff --git a/docs/classes/_types_flex_int_.flexinttype.html b/docs/classes/_types_flex_int_.flexinttype.html index e52ae28..57278ef 100644 --- a/docs/classes/_types_flex_int_.flexinttype.html +++ b/docs/classes/_types_flex_int_.flexinttype.html @@ -160,7 +160,7 @@

                                                                                                                    Methods

                                                                                                                    addToBuffer

                                                                                                                    • @@ -168,13 +168,13 @@

                                                                                                                      addToBuffer

                                                                                                                      Implementation of Type.addToBuffer

                                                                                                                      Inherited from AbstractType.addToBuffer

                                                                                                                        -
                                                                                                                      • Defined in types/abstract.ts:33
                                                                                                                      • +
                                                                                                                      • Defined in types/abstract.ts:30

                                                                                                                      Parameters

                                                                                                                      Returns boolean

                                                                                                                      @@ -220,7 +220,7 @@

                                                                                                                      equals

                                                                                                                      Implementation of Type.equals

                                                                                                                      Inherited from AbstractType.equals

                                                                                                                        -
                                                                                                                      • Defined in types/abstract.ts:82
                                                                                                                      • +
                                                                                                                      • Defined in types/abstract.ts:79

                                                                                                                      Parameters

                                                                                                                      @@ -245,7 +245,7 @@

                                                                                                                      getHash

                                                                                                                      Implementation of Type.getHash

                                                                                                                      Inherited from AbstractType.getHash

                                                                                                                        -
                                                                                                                      • Defined in types/abstract.ts:55
                                                                                                                      • +
                                                                                                                      • Defined in types/abstract.ts:52

                                                                                                                      Returns string

                                                                                                                      @@ -264,7 +264,7 @@

                                                                                                                      getSignature

                                                                                                                      Implementation of Type.getSignature

                                                                                                                      Inherited from AbstractType.getSignature

                                                                                                                        -
                                                                                                                      • Defined in types/abstract.ts:59
                                                                                                                      • +
                                                                                                                      • Defined in types/abstract.ts:56

                                                                                                                      Returns string

                                                                                                                      @@ -275,14 +275,14 @@

                                                                                                                      Returns string

                                                                                                                      Private isBuffer

                                                                                                                      • @@ -294,9 +294,9 @@

                                                                                                                        Private isBuffer

                                                                                                                        Parameters

                                                                                                                        @@ -315,7 +315,7 @@

                                                                                                                        readValue

                                                                                                                        Parameters

                                                                                                                        @@ -343,7 +343,7 @@

                                                                                                                        toBuffer

                                                                                                                        Implementation of Type.toBuffer

                                                                                                                        Inherited from AbstractType.toBuffer

                                                                                                                          -
                                                                                                                        • Defined in types/abstract.ts:51
                                                                                                                        • +
                                                                                                                        • Defined in types/abstract.ts:48

                                                                                                                        Returns ArrayBuffer

                                                                                                                        @@ -361,7 +361,7 @@

                                                                                                                        valueBuffer

                                                                                                                        Parameters

                                                                                                                        @@ -378,7 +378,7 @@

                                                                                                                        Returns ArrayBuff

                                                                                                                        writeValue

                                                                                                                        • @@ -390,7 +390,7 @@

                                                                                                                          writeValue

                                                                                                                          -

                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                          +

                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                          Example:

                                                                                                                          //Takes 4 bytes
                                                                                                                          @@ -405,7 +405,7 @@ 

                                                                                                                          writeValue

                                                                                                                          Parameters

                                                                                                                          • -
                                                                                                                            buffer: AppendableBuffer
                                                                                                                            +
                                                                                                                            buffer: AppendableBuffer

                                                                                                                            The buffer to which to append

                                                                                                                            diff --git a/docs/classes/_types_flex_unsigned_int_.flexunsignedinttype.html b/docs/classes/_types_flex_unsigned_int_.flexunsignedinttype.html index 4b76df5..dbc7189 100644 --- a/docs/classes/_types_flex_unsigned_int_.flexunsignedinttype.html +++ b/docs/classes/_types_flex_unsigned_int_.flexunsignedinttype.html @@ -185,7 +185,7 @@

                                                                                                                            Methods

                                                                                                                            addToBuffer

                                                                                                                            • @@ -193,13 +193,13 @@

                                                                                                                              addToBuffer

                                                                                                                              Implementation of Type.addToBuffer

                                                                                                                              Inherited from AbstractType.addToBuffer

                                                                                                                                -
                                                                                                                              • Defined in types/abstract.ts:33
                                                                                                                              • +
                                                                                                                              • Defined in types/abstract.ts:30

                                                                                                                              Parameters

                                                                                                                              Returns boolean

                                                                                                                              @@ -245,7 +245,7 @@

                                                                                                                              equals

                                                                                                                              Implementation of Type.equals

                                                                                                                              Inherited from AbstractType.equals

                                                                                                                                -
                                                                                                                              • Defined in types/abstract.ts:82
                                                                                                                              • +
                                                                                                                              • Defined in types/abstract.ts:79

                                                                                                                              Parameters

                                                                                                                              @@ -270,7 +270,7 @@

                                                                                                                              getHash

                                                                                                                              Implementation of Type.getHash

                                                                                                                              Inherited from AbstractType.getHash

                                                                                                                                -
                                                                                                                              • Defined in types/abstract.ts:55
                                                                                                                              • +
                                                                                                                              • Defined in types/abstract.ts:52

                                                                                                                              Returns string

                                                                                                                              @@ -289,7 +289,7 @@

                                                                                                                              getSignature

                                                                                                                              Implementation of Type.getSignature

                                                                                                                              Inherited from AbstractType.getSignature

                                                                                                                                -
                                                                                                                              • Defined in types/abstract.ts:59
                                                                                                                              • +
                                                                                                                              • Defined in types/abstract.ts:56

                                                                                                                              Returns string

                                                                                                                              @@ -300,14 +300,14 @@

                                                                                                                              Returns string

                                                                                                                              Private isBuffer

                                                                                                                              • @@ -319,9 +319,9 @@

                                                                                                                                Private isBuffer

                                                                                                                                Parameters

                                                                                                                                @@ -340,7 +340,7 @@

                                                                                                                                readValue

                                                                                                                                Parameters

                                                                                                                                @@ -368,7 +368,7 @@

                                                                                                                                toBuffer

                                                                                                                                Implementation of Type.toBuffer

                                                                                                                                Inherited from AbstractType.toBuffer

                                                                                                                                  -
                                                                                                                                • Defined in types/abstract.ts:51
                                                                                                                                • +
                                                                                                                                • Defined in types/abstract.ts:48

                                                                                                                                Returns ArrayBuffer

                                                                                                                                @@ -386,7 +386,7 @@

                                                                                                                                valueBuffer

                                                                                                                                Parameters

                                                                                                                                @@ -403,7 +403,7 @@

                                                                                                                                Returns ArrayBuff

                                                                                                                                writeValue

                                                                                                                                • @@ -415,7 +415,7 @@

                                                                                                                                  writeValue

                                                                                                                                  -

                                                                                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                  +

                                                                                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                  Example:

                                                                                                                                  //Takes 4 bytes
                                                                                                                                  @@ -430,7 +430,7 @@ 

                                                                                                                                  writeValue

                                                                                                                                  Parameters

                                                                                                                                  • -
                                                                                                                                    buffer: AppendableBuffer
                                                                                                                                    +
                                                                                                                                    buffer: AppendableBuffer

                                                                                                                                    The buffer to which to append

                                                                                                                                    diff --git a/docs/classes/_types_float_.floattype.html b/docs/classes/_types_float_.floattype.html index 407ebd6..69d5813 100644 --- a/docs/classes/_types_float_.floattype.html +++ b/docs/classes/_types_float_.floattype.html @@ -155,7 +155,7 @@

                                                                                                                                    Methods

                                                                                                                                    addToBuffer

                                                                                                                                    • @@ -163,13 +163,13 @@

                                                                                                                                      addToBuffer

                                                                                                                                      Implementation of Type.addToBuffer

                                                                                                                                      Inherited from AbstractType.addToBuffer

                                                                                                                                        -
                                                                                                                                      • Defined in types/abstract.ts:33
                                                                                                                                      • +
                                                                                                                                      • Defined in types/abstract.ts:30

                                                                                                                                      Parameters

                                                                                                                                      Returns boolean

                                                                                                                                      @@ -215,7 +215,7 @@

                                                                                                                                      equals

                                                                                                                                      Implementation of Type.equals

                                                                                                                                      Inherited from AbstractType.equals

                                                                                                                                        -
                                                                                                                                      • Defined in types/abstract.ts:82
                                                                                                                                      • +
                                                                                                                                      • Defined in types/abstract.ts:79

                                                                                                                                      Parameters

                                                                                                                                      @@ -240,7 +240,7 @@

                                                                                                                                      getHash

                                                                                                                                      Implementation of Type.getHash

                                                                                                                                      Inherited from AbstractType.getHash

                                                                                                                                        -
                                                                                                                                      • Defined in types/abstract.ts:55
                                                                                                                                      • +
                                                                                                                                      • Defined in types/abstract.ts:52

                                                                                                                                      Returns string

                                                                                                                                      @@ -259,7 +259,7 @@

                                                                                                                                      getSignature

                                                                                                                                      Implementation of Type.getSignature

                                                                                                                                      Inherited from AbstractType.getSignature

                                                                                                                                        -
                                                                                                                                      • Defined in types/abstract.ts:59
                                                                                                                                      • +
                                                                                                                                      • Defined in types/abstract.ts:56

                                                                                                                                      Returns string

                                                                                                                                      @@ -270,14 +270,14 @@

                                                                                                                                      Returns string

                                                                                                                                      Private isBuffer

                                                                                                                                      • @@ -289,9 +289,9 @@

                                                                                                                                        Private isBuffer

                                                                                                                                        Parameters

                                                                                                                                        @@ -310,7 +310,7 @@

                                                                                                                                        readValue

                                                                                                                                        Parameters

                                                                                                                                        @@ -338,7 +338,7 @@

                                                                                                                                        toBuffer

                                                                                                                                        Implementation of Type.toBuffer

                                                                                                                                        Inherited from AbstractType.toBuffer

                                                                                                                                          -
                                                                                                                                        • Defined in types/abstract.ts:51
                                                                                                                                        • +
                                                                                                                                        • Defined in types/abstract.ts:48

                                                                                                                                        Returns ArrayBuffer

                                                                                                                                        @@ -356,7 +356,7 @@

                                                                                                                                        valueBuffer

                                                                                                                                        Parameters

                                                                                                                                        @@ -373,7 +373,7 @@

                                                                                                                                        Returns ArrayBuff

                                                                                                                                        writeValue

                                                                                                                                        • @@ -385,7 +385,7 @@

                                                                                                                                          writeValue

                                                                                                                                          -

                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                          +

                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                          Examples:

                                                                                                                                          type.writeValue(buffer, 1.23) //or '1.23'
                                                                                                                                          @@ -405,7 +405,7 @@ 

                                                                                                                                          writeValue

                                                                                                                                          Parameters

                                                                                                                                          • -
                                                                                                                                            buffer: AppendableBuffer
                                                                                                                                            +
                                                                                                                                            buffer: AppendableBuffer

                                                                                                                                            The buffer to which to append

                                                                                                                                            diff --git a/docs/classes/_types_floating_.floatingpointtype.html b/docs/classes/_types_floating_.floatingpointtype.html index a9762bf..5e69eb8 100644 --- a/docs/classes/_types_floating_.floatingpointtype.html +++ b/docs/classes/_types_floating_.floatingpointtype.html @@ -144,7 +144,7 @@

                                                                                                                                            Static _value

                                                                                                                                            @@ -164,7 +164,7 @@

                                                                                                                                            Methods

                                                                                                                                            addToBuffer

                                                                                                                                            • @@ -172,13 +172,13 @@

                                                                                                                                              addToBuffer

                                                                                                                                              Implementation of Type.addToBuffer

                                                                                                                                              Inherited from AbstractType.addToBuffer

                                                                                                                                                -
                                                                                                                                              • Defined in types/abstract.ts:33
                                                                                                                                              • +
                                                                                                                                              • Defined in types/abstract.ts:30

                                                                                                                                              Parameters

                                                                                                                                              Returns boolean

                                                                                                                                              @@ -197,7 +197,7 @@

                                                                                                                                              consumeValue

                                                                                                                                              Implementation of Type.consumeValue

                                                                                                                                              Inherited from AbstractType.consumeValue

                                                                                                                                                -
                                                                                                                                              • Defined in types/abstract.ts:69
                                                                                                                                              • +
                                                                                                                                              • Defined in types/abstract.ts:66

                                                                                                                                              Parameters

                                                                                                                                              @@ -228,7 +228,7 @@

                                                                                                                                              equals

                                                                                                                                              Implementation of Type.equals

                                                                                                                                              Inherited from AbstractType.equals

                                                                                                                                                -
                                                                                                                                              • Defined in types/abstract.ts:82
                                                                                                                                              • +
                                                                                                                                              • Defined in types/abstract.ts:79

                                                                                                                                              Parameters

                                                                                                                                              @@ -253,7 +253,7 @@

                                                                                                                                              getHash

                                                                                                                                              Implementation of Type.getHash

                                                                                                                                              Inherited from AbstractType.getHash

                                                                                                                                                -
                                                                                                                                              • Defined in types/abstract.ts:55
                                                                                                                                              • +
                                                                                                                                              • Defined in types/abstract.ts:52

                                                                                                                                              Returns string

                                                                                                                                              @@ -272,7 +272,7 @@

                                                                                                                                              getSignature

                                                                                                                                              Implementation of Type.getSignature

                                                                                                                                              Inherited from AbstractType.getSignature

                                                                                                                                                -
                                                                                                                                              • Defined in types/abstract.ts:59
                                                                                                                                              • +
                                                                                                                                              • Defined in types/abstract.ts:56

                                                                                                                                              Returns string

                                                                                                                                              @@ -283,14 +283,14 @@

                                                                                                                                              Returns string

                                                                                                                                              Private isBuffer

                                                                                                                                              • @@ -302,9 +302,9 @@

                                                                                                                                                Private isBuffer

                                                                                                                                                Parameters

                                                                                                                                                @@ -323,7 +323,7 @@

                                                                                                                                                readValue

                                                                                                                                                Parameters

                                                                                                                                                @@ -351,7 +351,7 @@

                                                                                                                                                toBuffer

                                                                                                                                                Implementation of Type.toBuffer

                                                                                                                                                Inherited from AbstractType.toBuffer

                                                                                                                                                  -
                                                                                                                                                • Defined in types/abstract.ts:51
                                                                                                                                                • +
                                                                                                                                                • Defined in types/abstract.ts:48

                                                                                                                                                Returns ArrayBuffer

                                                                                                                                                @@ -369,7 +369,7 @@

                                                                                                                                                valueBuffer

                                                                                                                                                Parameters

                                                                                                                                                @@ -386,20 +386,20 @@

                                                                                                                                                Returns ArrayBuff

                                                                                                                                                writeValue

                                                                                                                                                • Parameters

                                                                                                                                                  • -
                                                                                                                                                    buffer: AppendableBuffer
                                                                                                                                                    +
                                                                                                                                                    buffer: AppendableBuffer
                                                                                                                                                  • value: number | string
                                                                                                                                                    diff --git a/docs/classes/_types_int_.inttype.html b/docs/classes/_types_int_.inttype.html index e84da93..08082e7 100644 --- a/docs/classes/_types_int_.inttype.html +++ b/docs/classes/_types_int_.inttype.html @@ -154,7 +154,7 @@

                                                                                                                                                    Methods

                                                                                                                                                    addToBuffer

                                                                                                                                                    • @@ -162,13 +162,13 @@

                                                                                                                                                      addToBuffer

                                                                                                                                                      Implementation of Type.addToBuffer

                                                                                                                                                      Inherited from AbstractType.addToBuffer

                                                                                                                                                        -
                                                                                                                                                      • Defined in types/abstract.ts:33
                                                                                                                                                      • +
                                                                                                                                                      • Defined in types/abstract.ts:30

                                                                                                                                                      Parameters

                                                                                                                                                      Returns boolean

                                                                                                                                                      @@ -214,7 +214,7 @@

                                                                                                                                                      equals

                                                                                                                                                      Implementation of Type.equals

                                                                                                                                                      Inherited from AbstractType.equals

                                                                                                                                                        -
                                                                                                                                                      • Defined in types/abstract.ts:82
                                                                                                                                                      • +
                                                                                                                                                      • Defined in types/abstract.ts:79

                                                                                                                                                      Parameters

                                                                                                                                                      @@ -239,7 +239,7 @@

                                                                                                                                                      getHash

                                                                                                                                                      Implementation of Type.getHash

                                                                                                                                                      Inherited from AbstractType.getHash

                                                                                                                                                        -
                                                                                                                                                      • Defined in types/abstract.ts:55
                                                                                                                                                      • +
                                                                                                                                                      • Defined in types/abstract.ts:52

                                                                                                                                                      Returns string

                                                                                                                                                      @@ -258,7 +258,7 @@

                                                                                                                                                      getSignature

                                                                                                                                                      Implementation of Type.getSignature

                                                                                                                                                      Inherited from AbstractType.getSignature

                                                                                                                                                        -
                                                                                                                                                      • Defined in types/abstract.ts:59
                                                                                                                                                      • +
                                                                                                                                                      • Defined in types/abstract.ts:56

                                                                                                                                                      Returns string

                                                                                                                                                      @@ -269,14 +269,14 @@

                                                                                                                                                      Returns string

                                                                                                                                                      Private isBuffer

                                                                                                                                                      • @@ -288,9 +288,9 @@

                                                                                                                                                        Private isBuffer

                                                                                                                                                        Parameters

                                                                                                                                                        @@ -309,7 +309,7 @@

                                                                                                                                                        readValue

                                                                                                                                                        Parameters

                                                                                                                                                        @@ -337,7 +337,7 @@

                                                                                                                                                        toBuffer

                                                                                                                                                        Implementation of Type.toBuffer

                                                                                                                                                        Inherited from AbstractType.toBuffer

                                                                                                                                                          -
                                                                                                                                                        • Defined in types/abstract.ts:51
                                                                                                                                                        • +
                                                                                                                                                        • Defined in types/abstract.ts:48

                                                                                                                                                        Returns ArrayBuffer

                                                                                                                                                        @@ -355,7 +355,7 @@

                                                                                                                                                        valueBuffer

                                                                                                                                                        Parameters

                                                                                                                                                        @@ -372,7 +372,7 @@

                                                                                                                                                        Returns ArrayBuff

                                                                                                                                                        writeValue

                                                                                                                                                        • @@ -384,7 +384,7 @@

                                                                                                                                                          writeValue

                                                                                                                                                          -

                                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                          +

                                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                          Example:

                                                                                                                                                          type.writeValue(buffer, -1234567890) //or '-1234567890'
                                                                                                                                                          @@ -398,7 +398,7 @@ 

                                                                                                                                                          writeValue

                                                                                                                                                          Parameters

                                                                                                                                                          • -
                                                                                                                                                            buffer: AppendableBuffer
                                                                                                                                                            +
                                                                                                                                                            buffer: AppendableBuffer

                                                                                                                                                            The buffer to which to append

                                                                                                                                                            diff --git a/docs/classes/_types_integer_.integertype.html b/docs/classes/_types_integer_.integertype.html index 91b9280..edf849d 100644 --- a/docs/classes/_types_integer_.integertype.html +++ b/docs/classes/_types_integer_.integertype.html @@ -167,7 +167,7 @@

                                                                                                                                                            Static _value

                                                                                                                                                            @@ -187,7 +187,7 @@

                                                                                                                                                            Methods

                                                                                                                                                            addToBuffer

                                                                                                                                                            • @@ -195,13 +195,13 @@

                                                                                                                                                              addToBuffer

                                                                                                                                                              Implementation of Type.addToBuffer

                                                                                                                                                              Inherited from AbstractType.addToBuffer

                                                                                                                                                                -
                                                                                                                                                              • Defined in types/abstract.ts:33
                                                                                                                                                              • +
                                                                                                                                                              • Defined in types/abstract.ts:30

                                                                                                                                                              Parameters

                                                                                                                                                              Returns boolean

                                                                                                                                                              @@ -220,7 +220,7 @@

                                                                                                                                                              consumeValue

                                                                                                                                                              Implementation of Type.consumeValue

                                                                                                                                                              Inherited from AbstractType.consumeValue

                                                                                                                                                                -
                                                                                                                                                              • Defined in types/abstract.ts:69
                                                                                                                                                              • +
                                                                                                                                                              • Defined in types/abstract.ts:66

                                                                                                                                                              Parameters

                                                                                                                                                              @@ -251,7 +251,7 @@

                                                                                                                                                              equals

                                                                                                                                                              Implementation of Type.equals

                                                                                                                                                              Inherited from AbstractType.equals

                                                                                                                                                                -
                                                                                                                                                              • Defined in types/abstract.ts:82
                                                                                                                                                              • +
                                                                                                                                                              • Defined in types/abstract.ts:79

                                                                                                                                                              Parameters

                                                                                                                                                              @@ -276,7 +276,7 @@

                                                                                                                                                              getHash

                                                                                                                                                              Implementation of Type.getHash

                                                                                                                                                              Inherited from AbstractType.getHash

                                                                                                                                                                -
                                                                                                                                                              • Defined in types/abstract.ts:55
                                                                                                                                                              • +
                                                                                                                                                              • Defined in types/abstract.ts:52

                                                                                                                                                              Returns string

                                                                                                                                                              @@ -295,7 +295,7 @@

                                                                                                                                                              getSignature

                                                                                                                                                              Implementation of Type.getSignature

                                                                                                                                                              Inherited from AbstractType.getSignature

                                                                                                                                                                -
                                                                                                                                                              • Defined in types/abstract.ts:59
                                                                                                                                                              • +
                                                                                                                                                              • Defined in types/abstract.ts:56

                                                                                                                                                              Returns string

                                                                                                                                                              @@ -306,14 +306,14 @@

                                                                                                                                                              Returns string

                                                                                                                                                              Private isBuffer

                                                                                                                                                              • @@ -325,9 +325,9 @@

                                                                                                                                                                Private isBuffer

                                                                                                                                                                Parameters

                                                                                                                                                                @@ -346,7 +346,7 @@

                                                                                                                                                                readValue

                                                                                                                                                                Parameters

                                                                                                                                                                @@ -374,7 +374,7 @@

                                                                                                                                                                toBuffer

                                                                                                                                                                Implementation of Type.toBuffer

                                                                                                                                                                Inherited from AbstractType.toBuffer

                                                                                                                                                                  -
                                                                                                                                                                • Defined in types/abstract.ts:51
                                                                                                                                                                • +
                                                                                                                                                                • Defined in types/abstract.ts:48

                                                                                                                                                                Returns ArrayBuffer

                                                                                                                                                                @@ -393,7 +393,7 @@

                                                                                                                                                                valueBuffer

                                                                                                                                                                Implementation of Type.valueBuffer

                                                                                                                                                                Inherited from AbstractType.valueBuffer

                                                                                                                                                                  -
                                                                                                                                                                • Defined in types/abstract.ts:64
                                                                                                                                                                • +
                                                                                                                                                                • Defined in types/abstract.ts:61

                                                                                                                                                                Parameters

                                                                                                                                                                @@ -410,7 +410,7 @@

                                                                                                                                                                Returns ArrayBuff

                                                                                                                                                                writeValue

                                                                                                                                                                • @@ -418,13 +418,13 @@

                                                                                                                                                                  writeValue

                                                                                                                                                                  Implementation of Type.writeValue

                                                                                                                                                                  Inherited from AbstractType.writeValue

                                                                                                                                                                    -
                                                                                                                                                                  • Defined in types/abstract.ts:63
                                                                                                                                                                  • +
                                                                                                                                                                  • Defined in types/abstract.ts:60

                                                                                                                                                                  Parameters

                                                                                                                                                                  • -
                                                                                                                                                                    buffer: AppendableBuffer
                                                                                                                                                                    +
                                                                                                                                                                    buffer: AppendableBuffer
                                                                                                                                                                  • value: VALUE
                                                                                                                                                                    diff --git a/docs/classes/_types_long_.longtype.html b/docs/classes/_types_long_.longtype.html index f2f3e36..194df4a 100644 --- a/docs/classes/_types_long_.longtype.html +++ b/docs/classes/_types_long_.longtype.html @@ -155,7 +155,7 @@

                                                                                                                                                                    Methods

                                                                                                                                                                    addToBuffer

                                                                                                                                                                    • @@ -163,13 +163,13 @@

                                                                                                                                                                      addToBuffer

                                                                                                                                                                      Implementation of Type.addToBuffer

                                                                                                                                                                      Inherited from AbstractType.addToBuffer

                                                                                                                                                                        -
                                                                                                                                                                      • Defined in types/abstract.ts:33
                                                                                                                                                                      • +
                                                                                                                                                                      • Defined in types/abstract.ts:30

                                                                                                                                                                      Parameters

                                                                                                                                                                      Returns boolean

                                                                                                                                                                      @@ -215,7 +215,7 @@

                                                                                                                                                                      equals

                                                                                                                                                                      Implementation of Type.equals

                                                                                                                                                                      Inherited from AbstractType.equals

                                                                                                                                                                        -
                                                                                                                                                                      • Defined in types/abstract.ts:82
                                                                                                                                                                      • +
                                                                                                                                                                      • Defined in types/abstract.ts:79

                                                                                                                                                                      Parameters

                                                                                                                                                                      @@ -240,7 +240,7 @@

                                                                                                                                                                      getHash

                                                                                                                                                                      Implementation of Type.getHash

                                                                                                                                                                      Inherited from AbstractType.getHash

                                                                                                                                                                        -
                                                                                                                                                                      • Defined in types/abstract.ts:55
                                                                                                                                                                      • +
                                                                                                                                                                      • Defined in types/abstract.ts:52

                                                                                                                                                                      Returns string

                                                                                                                                                                      @@ -259,7 +259,7 @@

                                                                                                                                                                      getSignature

                                                                                                                                                                      Implementation of Type.getSignature

                                                                                                                                                                      Inherited from AbstractType.getSignature

                                                                                                                                                                        -
                                                                                                                                                                      • Defined in types/abstract.ts:59
                                                                                                                                                                      • +
                                                                                                                                                                      • Defined in types/abstract.ts:56

                                                                                                                                                                      Returns string

                                                                                                                                                                      @@ -270,14 +270,14 @@

                                                                                                                                                                      Returns string

                                                                                                                                                                      Private isBuffer

                                                                                                                                                                      • @@ -289,9 +289,9 @@

                                                                                                                                                                        Private isBuffer

                                                                                                                                                                        Parameters

                                                                                                                                                                        @@ -310,7 +310,7 @@

                                                                                                                                                                        readValue

                                                                                                                                                                        Parameters

                                                                                                                                                                        @@ -338,7 +338,7 @@

                                                                                                                                                                        toBuffer

                                                                                                                                                                        Implementation of Type.toBuffer

                                                                                                                                                                        Inherited from AbstractType.toBuffer

                                                                                                                                                                          -
                                                                                                                                                                        • Defined in types/abstract.ts:51
                                                                                                                                                                        • +
                                                                                                                                                                        • Defined in types/abstract.ts:48

                                                                                                                                                                        Returns ArrayBuffer

                                                                                                                                                                        @@ -356,7 +356,7 @@

                                                                                                                                                                        valueBuffer

                                                                                                                                                                        Parameters

                                                                                                                                                                        @@ -373,7 +373,7 @@

                                                                                                                                                                        Returns ArrayBuff

                                                                                                                                                                        writeValue

                                                                                                                                                                        • @@ -385,7 +385,7 @@

                                                                                                                                                                          writeValue

                                                                                                                                                                          -

                                                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                          +

                                                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                          Example:

                                                                                                                                                                          type.writeValue(buffer, '-1234567890123456789')
                                                                                                                                                                          @@ -399,7 +399,7 @@ 

                                                                                                                                                                          writeValue

                                                                                                                                                                          Parameters

                                                                                                                                                                          • -
                                                                                                                                                                            buffer: AppendableBuffer
                                                                                                                                                                            +
                                                                                                                                                                            buffer: AppendableBuffer

                                                                                                                                                                            The buffer to which to append

                                                                                                                                                                            diff --git a/docs/classes/_types_map_.maptype.html b/docs/classes/_types_map_.maptype.html index e47fd99..b18c3ac 100644 --- a/docs/classes/_types_map_.maptype.html +++ b/docs/classes/_types_map_.maptype.html @@ -284,7 +284,7 @@

                                                                                                                                                                            Methods

                                                                                                                                                                            addToBuffer

                                                                                                                                                                            • @@ -298,7 +298,7 @@

                                                                                                                                                                              addToBuffer

                                                                                                                                                                              Parameters

                                                                                                                                                                              Returns boolean

                                                                                                                                                                              @@ -372,7 +372,7 @@

                                                                                                                                                                              getHash

                                                                                                                                                                              Implementation of Type.getHash

                                                                                                                                                                              Inherited from AbstractType.getHash

                                                                                                                                                                                -
                                                                                                                                                                              • Defined in types/abstract.ts:55
                                                                                                                                                                              • +
                                                                                                                                                                              • Defined in types/abstract.ts:52

                                                                                                                                                                              Returns string

                                                                                                                                                                              @@ -391,7 +391,7 @@

                                                                                                                                                                              getSignature

                                                                                                                                                                              Implementation of Type.getSignature

                                                                                                                                                                              Inherited from AbstractType.getSignature

                                                                                                                                                                                -
                                                                                                                                                                              • Defined in types/abstract.ts:59
                                                                                                                                                                              • +
                                                                                                                                                                              • Defined in types/abstract.ts:56

                                                                                                                                                                              Returns string

                                                                                                                                                                              @@ -402,14 +402,14 @@

                                                                                                                                                                              Returns string

                                                                                                                                                                              Private isBuffer

                                                                                                                                                                              • @@ -421,9 +421,9 @@

                                                                                                                                                                                Private isBuffer

                                                                                                                                                                                Parameters

                                                                                                                                                                                @@ -442,7 +442,7 @@

                                                                                                                                                                                readValue

                                                                                                                                                                                Parameters

                                                                                                                                                                                @@ -470,7 +470,7 @@

                                                                                                                                                                                toBuffer

                                                                                                                                                                                Implementation of Type.toBuffer

                                                                                                                                                                                Inherited from AbstractType.toBuffer

                                                                                                                                                                                  -
                                                                                                                                                                                • Defined in types/abstract.ts:51
                                                                                                                                                                                • +
                                                                                                                                                                                • Defined in types/abstract.ts:48

                                                                                                                                                                                Returns ArrayBuffer

                                                                                                                                                                                @@ -488,7 +488,7 @@

                                                                                                                                                                                valueBuffer

                                                                                                                                                                                Parameters

                                                                                                                                                                                @@ -505,7 +505,7 @@

                                                                                                                                                                                Returns ArrayBuff

                                                                                                                                                                                writeValue

                                                                                                                                                                                • @@ -517,7 +517,7 @@

                                                                                                                                                                                  writeValue

                                                                                                                                                                                  -

                                                                                                                                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                                  +

                                                                                                                                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                                  Example:

                                                                                                                                                                                  let GOOG = new Map()
                                                                                                                                                                                  @@ -543,7 +543,7 @@ 

                                                                                                                                                                                  writeValue

                                                                                                                                                                                  Parameters

                                                                                                                                                                                  • -
                                                                                                                                                                                    buffer: AppendableBuffer
                                                                                                                                                                                    +
                                                                                                                                                                                    buffer: AppendableBuffer

                                                                                                                                                                                    The buffer to which to append

                                                                                                                                                                                    diff --git a/docs/classes/_types_named_choice_.namedchoicetype.html b/docs/classes/_types_named_choice_.namedchoicetype.html index 6f4303c..5f33e14 100644 --- a/docs/classes/_types_named_choice_.namedchoicetype.html +++ b/docs/classes/_types_named_choice_.namedchoicetype.html @@ -295,7 +295,7 @@

                                                                                                                                                                                    Methods

                                                                                                                                                                                    addToBuffer

                                                                                                                                                                                    • @@ -309,7 +309,7 @@

                                                                                                                                                                                      addToBuffer

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      Returns boolean

                                                                                                                                                                                      @@ -380,7 +380,7 @@

                                                                                                                                                                                      getHash

                                                                                                                                                                                      Implementation of Type.getHash

                                                                                                                                                                                      Inherited from AbstractType.getHash

                                                                                                                                                                                        -
                                                                                                                                                                                      • Defined in types/abstract.ts:55
                                                                                                                                                                                      • +
                                                                                                                                                                                      • Defined in types/abstract.ts:52

                                                                                                                                                                                      Returns string

                                                                                                                                                                                      @@ -399,7 +399,7 @@

                                                                                                                                                                                      getSignature

                                                                                                                                                                                      Implementation of Type.getSignature

                                                                                                                                                                                      Inherited from AbstractType.getSignature

                                                                                                                                                                                        -
                                                                                                                                                                                      • Defined in types/abstract.ts:59
                                                                                                                                                                                      • +
                                                                                                                                                                                      • Defined in types/abstract.ts:56

                                                                                                                                                                                      Returns string

                                                                                                                                                                                      @@ -410,14 +410,14 @@

                                                                                                                                                                                      Returns string

                                                                                                                                                                                      Private isBuffer

                                                                                                                                                                                      • @@ -429,9 +429,9 @@

                                                                                                                                                                                        Private isBuffer

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        @@ -450,7 +450,7 @@

                                                                                                                                                                                        readValue

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        @@ -478,7 +478,7 @@

                                                                                                                                                                                        toBuffer

                                                                                                                                                                                        Implementation of Type.toBuffer

                                                                                                                                                                                        Inherited from AbstractType.toBuffer

                                                                                                                                                                                          -
                                                                                                                                                                                        • Defined in types/abstract.ts:51
                                                                                                                                                                                        • +
                                                                                                                                                                                        • Defined in types/abstract.ts:48

                                                                                                                                                                                        Returns ArrayBuffer

                                                                                                                                                                                        @@ -496,7 +496,7 @@

                                                                                                                                                                                        valueBuffer

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        @@ -513,7 +513,7 @@

                                                                                                                                                                                        Returns ArrayBuff

                                                                                                                                                                                        writeValue

                                                                                                                                                                                        • @@ -525,7 +525,7 @@

                                                                                                                                                                                          writeValue

                                                                                                                                                                                          -

                                                                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                                          +

                                                                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                                          Examples:

                                                                                                                                                                                          let buffer = new GrowableBuffer
                                                                                                                                                                                          @@ -554,7 +554,7 @@ 

                                                                                                                                                                                          writeValue

                                                                                                                                                                                          Parameters

                                                                                                                                                                                          • -
                                                                                                                                                                                            buffer: AppendableBuffer
                                                                                                                                                                                            +
                                                                                                                                                                                            buffer: AppendableBuffer

                                                                                                                                                                                            The buffer to which to append

                                                                                                                                                                                            diff --git a/docs/classes/_types_octets_.octetstype.html b/docs/classes/_types_octets_.octetstype.html index d8ddbb0..2c23a4a 100644 --- a/docs/classes/_types_octets_.octetstype.html +++ b/docs/classes/_types_octets_.octetstype.html @@ -164,7 +164,7 @@

                                                                                                                                                                                            Methods

                                                                                                                                                                                            addToBuffer

                                                                                                                                                                                            • @@ -172,13 +172,13 @@

                                                                                                                                                                                              addToBuffer

                                                                                                                                                                                              Implementation of Type.addToBuffer

                                                                                                                                                                                              Inherited from AbstractType.addToBuffer

                                                                                                                                                                                                -
                                                                                                                                                                                              • Defined in types/abstract.ts:33
                                                                                                                                                                                              • +
                                                                                                                                                                                              • Defined in types/abstract.ts:30

                                                                                                                                                                                              Parameters

                                                                                                                                                                                              Returns boolean

                                                                                                                                                                                              @@ -224,7 +224,7 @@

                                                                                                                                                                                              equals

                                                                                                                                                                                              Implementation of Type.equals

                                                                                                                                                                                              Inherited from AbstractType.equals

                                                                                                                                                                                                -
                                                                                                                                                                                              • Defined in types/abstract.ts:82
                                                                                                                                                                                              • +
                                                                                                                                                                                              • Defined in types/abstract.ts:79

                                                                                                                                                                                              Parameters

                                                                                                                                                                                              @@ -249,7 +249,7 @@

                                                                                                                                                                                              getHash

                                                                                                                                                                                              Implementation of Type.getHash

                                                                                                                                                                                              Inherited from AbstractType.getHash

                                                                                                                                                                                                -
                                                                                                                                                                                              • Defined in types/abstract.ts:55
                                                                                                                                                                                              • +
                                                                                                                                                                                              • Defined in types/abstract.ts:52

                                                                                                                                                                                              Returns string

                                                                                                                                                                                              @@ -268,7 +268,7 @@

                                                                                                                                                                                              getSignature

                                                                                                                                                                                              Implementation of Type.getSignature

                                                                                                                                                                                              Inherited from AbstractType.getSignature

                                                                                                                                                                                                -
                                                                                                                                                                                              • Defined in types/abstract.ts:59
                                                                                                                                                                                              • +
                                                                                                                                                                                              • Defined in types/abstract.ts:56

                                                                                                                                                                                              Returns string

                                                                                                                                                                                              @@ -279,14 +279,14 @@

                                                                                                                                                                                              Returns string

                                                                                                                                                                                              Private isBuffer

                                                                                                                                                                                              • @@ -298,9 +298,9 @@

                                                                                                                                                                                                Private isBuffer

                                                                                                                                                                                                Parameters

                                                                                                                                                                                                @@ -319,7 +319,7 @@

                                                                                                                                                                                                readValue

                                                                                                                                                                                                Parameters

                                                                                                                                                                                                @@ -347,7 +347,7 @@

                                                                                                                                                                                                toBuffer

                                                                                                                                                                                                Implementation of Type.toBuffer

                                                                                                                                                                                                Inherited from AbstractType.toBuffer

                                                                                                                                                                                                  -
                                                                                                                                                                                                • Defined in types/abstract.ts:51
                                                                                                                                                                                                • +
                                                                                                                                                                                                • Defined in types/abstract.ts:48

                                                                                                                                                                                                Returns ArrayBuffer

                                                                                                                                                                                                @@ -365,7 +365,7 @@

                                                                                                                                                                                                valueBuffer

                                                                                                                                                                                                Parameters

                                                                                                                                                                                                @@ -382,7 +382,7 @@

                                                                                                                                                                                                Returns ArrayBuff

                                                                                                                                                                                                writeValue

                                                                                                                                                                                                • @@ -394,7 +394,7 @@

                                                                                                                                                                                                  writeValue

                                                                                                                                                                                                  -

                                                                                                                                                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                                                  +

                                                                                                                                                                                                  Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                                                  Example:

                                                                                                                                                                                                  let octets = new Uint8Array([1, 2, 3, 4, 5])
                                                                                                                                                                                                  @@ -409,7 +409,7 @@ 

                                                                                                                                                                                                  writeValue

                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                  • -
                                                                                                                                                                                                    buffer: AppendableBuffer
                                                                                                                                                                                                    +
                                                                                                                                                                                                    buffer: AppendableBuffer

                                                                                                                                                                                                    The buffer to which to append

                                                                                                                                                                                                    diff --git a/docs/classes/_types_optional_.optionaltype.html b/docs/classes/_types_optional_.optionaltype.html index 74f492c..209d5b0 100644 --- a/docs/classes/_types_optional_.optionaltype.html +++ b/docs/classes/_types_optional_.optionaltype.html @@ -248,7 +248,7 @@

                                                                                                                                                                                                    Methods

                                                                                                                                                                                                    addToBuffer

                                                                                                                                                                                                    • @@ -262,7 +262,7 @@

                                                                                                                                                                                                      addToBuffer

                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                      Returns boolean

                                                                                                                                                                                                      @@ -333,7 +333,7 @@

                                                                                                                                                                                                      getHash

                                                                                                                                                                                                      Implementation of Type.getHash

                                                                                                                                                                                                      Inherited from AbstractType.getHash

                                                                                                                                                                                                        -
                                                                                                                                                                                                      • Defined in types/abstract.ts:55
                                                                                                                                                                                                      • +
                                                                                                                                                                                                      • Defined in types/abstract.ts:52

                                                                                                                                                                                                      Returns string

                                                                                                                                                                                                      @@ -352,7 +352,7 @@

                                                                                                                                                                                                      getSignature

                                                                                                                                                                                                      Implementation of Type.getSignature

                                                                                                                                                                                                      Inherited from AbstractType.getSignature

                                                                                                                                                                                                        -
                                                                                                                                                                                                      • Defined in types/abstract.ts:59
                                                                                                                                                                                                      • +
                                                                                                                                                                                                      • Defined in types/abstract.ts:56

                                                                                                                                                                                                      Returns string

                                                                                                                                                                                                      @@ -363,14 +363,14 @@

                                                                                                                                                                                                      Returns string

                                                                                                                                                                                                      Private isBuffer

                                                                                                                                                                                                      • @@ -382,9 +382,9 @@

                                                                                                                                                                                                        Private isBuffer

                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                        @@ -403,7 +403,7 @@

                                                                                                                                                                                                        readValue

                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                        @@ -431,7 +431,7 @@

                                                                                                                                                                                                        toBuffer

                                                                                                                                                                                                        Implementation of Type.toBuffer

                                                                                                                                                                                                        Inherited from AbstractType.toBuffer

                                                                                                                                                                                                          -
                                                                                                                                                                                                        • Defined in types/abstract.ts:51
                                                                                                                                                                                                        • +
                                                                                                                                                                                                        • Defined in types/abstract.ts:48

                                                                                                                                                                                                        Returns ArrayBuffer

                                                                                                                                                                                                        @@ -449,7 +449,7 @@

                                                                                                                                                                                                        valueBuffer

                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                        @@ -466,7 +466,7 @@

                                                                                                                                                                                                        Returns ArrayBuff

                                                                                                                                                                                                        writeValue

                                                                                                                                                                                                        • @@ -478,7 +478,7 @@

                                                                                                                                                                                                          writeValue

                                                                                                                                                                                                          -

                                                                                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                                                          +

                                                                                                                                                                                                          Appends value bytes to an AppendableBuffer according to the type

                                                                                                                                                                                                          Examples:

                                                                                                                                                                                                          type.writeValue(buffer, {
                                                                                                                                                                                                          @@ -501,7 +501,7 @@ 

                                                                                                                                                                                                          writeValue

                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                          • -
                                                                                                                                                                                                            buffer: AppendableBuffer
                                                                                                                                                                                                            +
                                                                                                                                                                                                            buffer: AppendableBuffer

                                                                                                                                                                                                            The buffer to which to append

                                                                                                                                                                                                            diff --git a/docs/classes/_types_pointer_.pointertype.html b/docs/classes/_types_pointer_.pointertype.html index 1bbfd69..910519c 100644 --- a/docs/classes/_types_pointer_.pointertype.html +++ b/docs/classes/_types_pointer_.pointertype.html @@ -256,7 +256,7 @@

                                                                                                                                                                                                            Methods

                                                                                                                                                                                                            addToBuffer

  • +
    + +

    setType

    + +
      +
    • + +
      +
      +

      An alternative to registerType, + to avoid writing the type's name twice. + Please use this instead of registerType.

      +
      +

      So this

      +
      let type = new sb.RecursiveType('abc')
      +sb.registerType({
      +  type: new sb.StructType({
      +    //...
      +  }),
      +  name: 'abc'
      +})
      +
      +

      becomes

      +
      let type = new sb.RecursiveType('abc')
      +type.setType(new sb.StructType({
      +  //...
      +}))
      +
      +
      +

      Parameters

      + +

      Returns void

      +
    • +
    +

    toBuffer

    @@ -496,7 +545,7 @@

    toBuffer

    Implementation of Type.toBuffer

    Inherited from AbstractType.toBuffer

      -
    • Defined in types/abstract.ts:51
    • +
    • Defined in types/abstract.ts:48

    Returns ArrayBuffer

    @@ -515,7 +564,7 @@

    valueBuffer

    Implementation of Type.valueBuffer

    Inherited from AbstractType.valueBuffer

      -
    • Defined in types/abstract.ts:64
    • +
    • Defined in types/abstract.ts:61

    Parameters

    @@ -532,7 +581,7 @@

    Returns ArrayBuff

    writeValue

    • @@ -545,7 +594,7 @@

      writeValue

      -

      Appends value bytes to an AppendableBuffer according to the type

      +

      Appends value bytes to an AppendableBuffer according to the type

      Example:

      treeType.writeValue(buffer, {
      @@ -584,7 +633,7 @@ 

      writeValue

      Parameters

      • -
        buffer: AppendableBuffer
        +
        buffer: AppendableBuffer

        The buffer to which to append

        @@ -653,6 +702,9 @@

        Returns void readValue

      • +
      • + setType +
      • toBuffer
      • diff --git a/docs/classes/_types_set_.settype.html b/docs/classes/_types_set_.settype.html index 415efaa..2a2e003 100644 --- a/docs/classes/_types_set_.settype.html +++ b/docs/classes/_types_set_.settype.html @@ -244,7 +244,7 @@

        Methods

        addToBuffer

        • @@ -258,7 +258,7 @@

          addToBuffer

          Parameters

          Returns boolean

          @@ -332,7 +332,7 @@

          getHash

          Implementation of Type.getHash

          Inherited from AbstractType.getHash

            -
          • Defined in types/abstract.ts:55
          • +
          • Defined in types/abstract.ts:52

          Returns string

          @@ -351,7 +351,7 @@

          getSignature

          Implementation of Type.getSignature

          Inherited from AbstractType.getSignature

            -
          • Defined in types/abstract.ts:59
          • +
          • Defined in types/abstract.ts:56

          Returns string

          @@ -362,14 +362,14 @@

          Returns string

          Private isBuffer

          • @@ -381,9 +381,9 @@

            Private isBuffer

            Parameters

            @@ -402,7 +402,7 @@

            readValue

            Parameters

            @@ -430,7 +430,7 @@

            toBuffer

            Implementation of Type.toBuffer

            Inherited from AbstractType.toBuffer

              -
            • Defined in types/abstract.ts:51
            • +
            • Defined in types/abstract.ts:48

            Returns ArrayBuffer

            @@ -448,7 +448,7 @@

            valueBuffer

            Parameters

            @@ -465,7 +465,7 @@

            Returns ArrayBuff

            writeValue

            • @@ -477,7 +477,7 @@

              writeValue

              -

              Appends value bytes to an AppendableBuffer according to the type

              +

              Appends value bytes to an AppendableBuffer according to the type

              Example:

              let person1 = {dob: new Date(1980, 3, 10), name: 'Alfred'}
              @@ -494,7 +494,7 @@ 

              writeValue

              Parameters

              • -
                buffer: AppendableBuffer
                +
                buffer: AppendableBuffer

                The buffer to which to append

                diff --git a/docs/classes/_types_short_.shorttype.html b/docs/classes/_types_short_.shorttype.html index 0137838..658a003 100644 --- a/docs/classes/_types_short_.shorttype.html +++ b/docs/classes/_types_short_.shorttype.html @@ -154,7 +154,7 @@

                Methods

                addToBuffer

                • @@ -162,13 +162,13 @@

                  addToBuffer

                  Implementation of Type.addToBuffer

                  Inherited from AbstractType.addToBuffer

                    -
                  • Defined in types/abstract.ts:33
                  • +
                  • Defined in types/abstract.ts:30

                  Parameters

                  Returns boolean

                  @@ -214,7 +214,7 @@

                  equals

                  Implementation of Type.equals

                  Inherited from AbstractType.equals

                    -
                  • Defined in types/abstract.ts:82
                  • +
                  • Defined in types/abstract.ts:79

                  Parameters

                  @@ -239,7 +239,7 @@

                  getHash

                  Implementation of Type.getHash

                  Inherited from AbstractType.getHash

                    -
                  • Defined in types/abstract.ts:55
                  • +
                  • Defined in types/abstract.ts:52

                  Returns string

                  @@ -258,7 +258,7 @@

                  getSignature

                  Implementation of Type.getSignature

                  Inherited from AbstractType.getSignature

                    -
                  • Defined in types/abstract.ts:59
                  • +
                  • Defined in types/abstract.ts:56

                  Returns string

                  @@ -269,14 +269,14 @@

                  Returns string

                  Private isBuffer

                  • @@ -288,9 +288,9 @@

                    Private isBuffer

                    Parameters

                    @@ -309,7 +309,7 @@

                    readValue

                    Parameters

                    @@ -337,7 +337,7 @@

                    toBuffer

                    Implementation of Type.toBuffer

                    Inherited from AbstractType.toBuffer

                      -
                    • Defined in types/abstract.ts:51
                    • +
                    • Defined in types/abstract.ts:48

                    Returns ArrayBuffer

                    @@ -355,7 +355,7 @@

                    valueBuffer

                    Parameters

                    @@ -372,7 +372,7 @@

                    Returns ArrayBuff

                    writeValue

                    • @@ -384,7 +384,7 @@

                      writeValue

                      -

                      Appends value bytes to an AppendableBuffer according to the type

                      +

                      Appends value bytes to an AppendableBuffer according to the type

                      Example:

                      type.writeValue(buffer, -12345) //or '-12345'
                      @@ -398,7 +398,7 @@ 

                      writeValue

                      Parameters

                      • -
                        buffer: AppendableBuffer
                        +
                        buffer: AppendableBuffer

                        The buffer to which to append

                        diff --git a/docs/classes/_types_string_.stringtype.html b/docs/classes/_types_string_.stringtype.html index e155182..8df96ad 100644 --- a/docs/classes/_types_string_.stringtype.html +++ b/docs/classes/_types_string_.stringtype.html @@ -163,7 +163,7 @@

                        Methods

                        addToBuffer

                        • @@ -171,13 +171,13 @@

                          addToBuffer

                          Implementation of Type.addToBuffer

                          Inherited from AbstractType.addToBuffer

                            -
                          • Defined in types/abstract.ts:33
                          • +
                          • Defined in types/abstract.ts:30

                          Parameters

                          Returns boolean

                          @@ -223,7 +223,7 @@

                          equals

                          Implementation of Type.equals

                          Inherited from AbstractType.equals

                            -
                          • Defined in types/abstract.ts:82
                          • +
                          • Defined in types/abstract.ts:79

                          Parameters

                          @@ -248,7 +248,7 @@

                          getHash

                          Implementation of Type.getHash

                          Inherited from AbstractType.getHash

                            -
                          • Defined in types/abstract.ts:55
                          • +
                          • Defined in types/abstract.ts:52

                          Returns string

                          @@ -267,7 +267,7 @@

                          getSignature

                          Implementation of Type.getSignature

                          Inherited from AbstractType.getSignature

                            -
                          • Defined in types/abstract.ts:59
                          • +
                          • Defined in types/abstract.ts:56

                          Returns string

                          @@ -278,14 +278,14 @@

                          Returns string

                          Private isBuffer

                          • @@ -297,9 +297,9 @@

                            Private isBuffer

                            Parameters

                            @@ -318,7 +318,7 @@

                            readValue

                            Parameters

                            @@ -346,7 +346,7 @@

                            toBuffer

                            Implementation of Type.toBuffer

                            Inherited from AbstractType.toBuffer

                              -
                            • Defined in types/abstract.ts:51
                            • +
                            • Defined in types/abstract.ts:48

                            Returns ArrayBuffer

                            @@ -364,7 +364,7 @@

                            valueBuffer

                            Parameters

                            @@ -381,7 +381,7 @@

                            Returns ArrayBuff

                            writeValue

                            • @@ -393,7 +393,7 @@

                              writeValue

                              -

                              Appends value bytes to an AppendableBuffer according to the type

                              +

                              Appends value bytes to an AppendableBuffer according to the type

                              Example:

                              type.writeValue(buffer, 'abcdéf')
                              @@ -407,7 +407,7 @@ 

                              writeValue

                              Parameters

                              • -
                                buffer: AppendableBuffer
                                +
                                buffer: AppendableBuffer

                                The buffer to which to append

                                diff --git a/docs/classes/_types_struct_.structtype.html b/docs/classes/_types_struct_.structtype.html index 29607f3..2c05a75 100644 --- a/docs/classes/_types_struct_.structtype.html +++ b/docs/classes/_types_struct_.structtype.html @@ -262,7 +262,7 @@

                                Methods

                                addToBuffer

                                • @@ -276,7 +276,7 @@

                                  addToBuffer

                                  Parameters

                                  Returns boolean

                                  @@ -350,7 +350,7 @@

                                  getHash

                                  Implementation of Type.getHash

                                  Inherited from AbstractType.getHash

                                    -
                                  • Defined in types/abstract.ts:55
                                  • +
                                  • Defined in types/abstract.ts:52

                                  Returns string

                                  @@ -369,7 +369,7 @@

                                  getSignature

                                  Implementation of Type.getSignature

                                  Inherited from AbstractType.getSignature

                                    -
                                  • Defined in types/abstract.ts:59
                                  • +
                                  • Defined in types/abstract.ts:56

                                  Returns string

                                  @@ -380,14 +380,14 @@

                                  Returns string

                                  Private isBuffer

                                  • @@ -399,9 +399,9 @@

                                    Private isBuffer

                                    Parameters

                                    @@ -420,7 +420,7 @@

                                    readValue

                                    Parameters

                                    @@ -448,7 +448,7 @@

                                    toBuffer

                                    Implementation of Type.toBuffer

                                    Inherited from AbstractType.toBuffer

                                      -
                                    • Defined in types/abstract.ts:51
                                    • +
                                    • Defined in types/abstract.ts:48

                                    Returns ArrayBuffer

                                    @@ -466,7 +466,7 @@

                                    valueBuffer

                                    Parameters

                                    @@ -483,7 +483,7 @@

                                    Returns ArrayBuff

                                    writeValue

                                    • @@ -495,7 +495,7 @@

                                      writeValue

                                      -

                                      Appends value bytes to an AppendableBuffer according to the type

                                      +

                                      Appends value bytes to an AppendableBuffer according to the type

                                      Example:

                                      type.writeValue(buffer, {
                                      @@ -513,7 +513,7 @@ 

                                      writeValue

                                      Parameters

                                      • -
                                        buffer: AppendableBuffer
                                        +
                                        buffer: AppendableBuffer

                                        The buffer to which to append

                                        diff --git a/docs/classes/_types_time_.timetype.html b/docs/classes/_types_time_.timetype.html index 6819ea3..e6803ef 100644 --- a/docs/classes/_types_time_.timetype.html +++ b/docs/classes/_types_time_.timetype.html @@ -167,7 +167,7 @@

                                        Methods

                                        addToBuffer

                                        • @@ -175,13 +175,13 @@

                                          addToBuffer

                                          Implementation of Type.addToBuffer

                                          Inherited from AbstractType.addToBuffer

                                            -
                                          • Defined in types/abstract.ts:33
                                          • +
                                          • Defined in types/abstract.ts:30

                                          Parameters

                                          Returns boolean

                                          @@ -227,7 +227,7 @@

                                          equals

                                          Implementation of Type.equals

                                          Inherited from AbstractType.equals

                                            -
                                          • Defined in types/abstract.ts:82
                                          • +
                                          • Defined in types/abstract.ts:79

                                          Parameters

                                          @@ -252,7 +252,7 @@

                                          getHash

                                          Implementation of Type.getHash

                                          Inherited from AbstractType.getHash

                                            -
                                          • Defined in types/abstract.ts:55
                                          • +
                                          • Defined in types/abstract.ts:52

                                          Returns string

                                          @@ -271,7 +271,7 @@

                                          getSignature

                                          Implementation of Type.getSignature

                                          Inherited from AbstractType.getSignature

                                            -
                                          • Defined in types/abstract.ts:59
                                          • +
                                          • Defined in types/abstract.ts:56

                                          Returns string

                                          @@ -282,14 +282,14 @@

                                          Returns string

                                          Private isBuffer

                                          • @@ -301,9 +301,9 @@

                                            Private isBuffer

                                            Parameters

                                            @@ -322,7 +322,7 @@

                                            readValue

                                            Parameters

                                            @@ -350,7 +350,7 @@

                                            toBuffer

                                            Implementation of Type.toBuffer

                                            Inherited from AbstractType.toBuffer

                                              -
                                            • Defined in types/abstract.ts:51
                                            • +
                                            • Defined in types/abstract.ts:48

                                            Returns ArrayBuffer

                                            @@ -368,7 +368,7 @@

                                            valueBuffer

                                            Parameters

                                            @@ -385,7 +385,7 @@

                                            Returns ArrayBuff

                                            writeValue

                                            • @@ -397,7 +397,7 @@

                                              writeValue

                                              -

                                              Appends value bytes to an AppendableBuffer according to the type

                                              +

                                              Appends value bytes to an AppendableBuffer according to the type

                                              Example:

                                              type.writeValue(buffer, new Date(2017, 0, 1, 16, 37, 24, 189)) //16:37:24.189
                                              @@ -411,7 +411,7 @@ 

                                              writeValue

                                              Parameters

                                              • -
                                                buffer: AppendableBuffer
                                                +
                                                buffer: AppendableBuffer

                                                The buffer to which to append

                                                diff --git a/docs/classes/_types_tuple_.tupletype.html b/docs/classes/_types_tuple_.tupletype.html index aeb44ce..2ecf17b 100644 --- a/docs/classes/_types_tuple_.tupletype.html +++ b/docs/classes/_types_tuple_.tupletype.html @@ -274,7 +274,7 @@

                                                Methods

                                                addToBuffer

                                                • @@ -288,7 +288,7 @@

                                                  addToBuffer

                                                  Parameters

                                                  Returns boolean

                                                  @@ -362,7 +362,7 @@

                                                  getHash

                                                  Implementation of Type.getHash

                                                  Inherited from AbstractType.getHash

                                                    -
                                                  • Defined in types/abstract.ts:55
                                                  • +
                                                  • Defined in types/abstract.ts:52

                                                  Returns string

                                                  @@ -381,7 +381,7 @@

                                                  getSignature

                                                  Implementation of Type.getSignature

                                                  Inherited from AbstractType.getSignature

                                                    -
                                                  • Defined in types/abstract.ts:59
                                                  • +
                                                  • Defined in types/abstract.ts:56

                                                  Returns string

                                                  @@ -392,14 +392,14 @@

                                                  Returns string

                                                  Private isBuffer

                                                  • @@ -411,9 +411,9 @@

                                                    Private isBuffer

                                                    Parameters

                                                    @@ -432,7 +432,7 @@

                                                    readValue

                                                    Parameters

                                                    @@ -460,7 +460,7 @@

                                                    toBuffer

                                                    Implementation of Type.toBuffer

                                                    Inherited from AbstractType.toBuffer

                                                      -
                                                    • Defined in types/abstract.ts:51
                                                    • +
                                                    • Defined in types/abstract.ts:48

                                                    Returns ArrayBuffer

                                                    @@ -478,7 +478,7 @@

                                                    valueBuffer

                                                    Parameters

                                                    @@ -495,7 +495,7 @@

                                                    Returns ArrayBuff

                                                    writeValue

                                                    • @@ -507,7 +507,7 @@

                                                      writeValue

                                                      -

                                                      Appends value bytes to an AppendableBuffer according to the type

                                                      +

                                                      Appends value bytes to an AppendableBuffer according to the type

                                                      Example:

                                                      type.writeValue(buffer, [
                                                      @@ -525,7 +525,7 @@ 

                                                      writeValue

                                                      Parameters

                                                      • -
                                                        buffer: AppendableBuffer
                                                        +
                                                        buffer: AppendableBuffer

                                                        The buffer to which to append

                                                        diff --git a/docs/classes/_types_unsigned_.unsignedtype.html b/docs/classes/_types_unsigned_.unsignedtype.html index b7bd4b4..81e6f1b 100644 --- a/docs/classes/_types_unsigned_.unsignedtype.html +++ b/docs/classes/_types_unsigned_.unsignedtype.html @@ -167,7 +167,7 @@

                                                        Static _value

                                                        @@ -187,7 +187,7 @@

                                                        Methods

                                                        addToBuffer

                                                        • @@ -195,13 +195,13 @@

                                                          addToBuffer

                                                          Implementation of Type.addToBuffer

                                                          Inherited from AbstractType.addToBuffer

                                                            -
                                                          • Defined in types/abstract.ts:33
                                                          • +
                                                          • Defined in types/abstract.ts:30

                                                          Parameters

                                                          Returns boolean

                                                          @@ -220,7 +220,7 @@

                                                          consumeValue

                                                          Implementation of Type.consumeValue

                                                          Inherited from AbstractType.consumeValue

                                                            -
                                                          • Defined in types/abstract.ts:69
                                                          • +
                                                          • Defined in types/abstract.ts:66

                                                          Parameters

                                                          @@ -251,7 +251,7 @@

                                                          equals

                                                          Implementation of Type.equals

                                                          Inherited from AbstractType.equals

                                                            -
                                                          • Defined in types/abstract.ts:82
                                                          • +
                                                          • Defined in types/abstract.ts:79

                                                          Parameters

                                                          @@ -276,7 +276,7 @@

                                                          getHash

                                                          Implementation of Type.getHash

                                                          Inherited from AbstractType.getHash

                                                            -
                                                          • Defined in types/abstract.ts:55
                                                          • +
                                                          • Defined in types/abstract.ts:52

                                                          Returns string

                                                          @@ -295,7 +295,7 @@

                                                          getSignature

                                                          Implementation of Type.getSignature

                                                          Inherited from AbstractType.getSignature

                                                            -
                                                          • Defined in types/abstract.ts:59
                                                          • +
                                                          • Defined in types/abstract.ts:56

                                                          Returns string

                                                          @@ -306,14 +306,14 @@

                                                          Returns string

                                                          Private isBuffer

                                                          • @@ -325,9 +325,9 @@

                                                            Private isBuffer

                                                            Parameters

                                                            @@ -346,7 +346,7 @@

                                                            readValue

                                                            Parameters

                                                            @@ -374,7 +374,7 @@

                                                            toBuffer

                                                            Implementation of Type.toBuffer

                                                            Inherited from AbstractType.toBuffer

                                                              -
                                                            • Defined in types/abstract.ts:51
                                                            • +
                                                            • Defined in types/abstract.ts:48

                                                            Returns ArrayBuffer

                                                            @@ -393,7 +393,7 @@

                                                            valueBuffer

                                                            Implementation of Type.valueBuffer

                                                            Inherited from AbstractType.valueBuffer

                                                              -
                                                            • Defined in types/abstract.ts:64
                                                            • +
                                                            • Defined in types/abstract.ts:61

                                                            Parameters

                                                            @@ -410,7 +410,7 @@

                                                            Returns ArrayBuff

                                                            writeValue

                                                            • @@ -418,13 +418,13 @@

                                                              writeValue

                                                              Implementation of Type.writeValue

                                                              Inherited from AbstractType.writeValue

                                                                -
                                                              • Defined in types/abstract.ts:63
                                                              • +
                                                              • Defined in types/abstract.ts:60

                                                              Parameters

                                                              • -
                                                                buffer: AppendableBuffer
                                                                +
                                                                buffer: AppendableBuffer
                                                              • value: VALUE
                                                                diff --git a/docs/classes/_types_unsigned_byte_.unsignedbytetype.html b/docs/classes/_types_unsigned_byte_.unsignedbytetype.html index d448a12..c04262b 100644 --- a/docs/classes/_types_unsigned_byte_.unsignedbytetype.html +++ b/docs/classes/_types_unsigned_byte_.unsignedbytetype.html @@ -154,7 +154,7 @@

                                                                Methods

                                                                addToBuffer

                                                                • @@ -162,13 +162,13 @@

                                                                  addToBuffer

                                                                  Implementation of Type.addToBuffer

                                                                  Inherited from AbstractType.addToBuffer

                                                                    -
                                                                  • Defined in types/abstract.ts:33
                                                                  • +
                                                                  • Defined in types/abstract.ts:30

                                                                  Parameters

                                                                  Returns boolean

                                                                  @@ -214,7 +214,7 @@

                                                                  equals

                                                                  Implementation of Type.equals

                                                                  Inherited from AbstractType.equals

                                                                    -
                                                                  • Defined in types/abstract.ts:82
                                                                  • +
                                                                  • Defined in types/abstract.ts:79

                                                                  Parameters

                                                                  @@ -239,7 +239,7 @@

                                                                  getHash

                                                                  Implementation of Type.getHash

                                                                  Inherited from AbstractType.getHash

                                                                    -
                                                                  • Defined in types/abstract.ts:55
                                                                  • +
                                                                  • Defined in types/abstract.ts:52

                                                                  Returns string

                                                                  @@ -258,7 +258,7 @@

                                                                  getSignature

                                                                  Implementation of Type.getSignature

                                                                  Inherited from AbstractType.getSignature

                                                                    -
                                                                  • Defined in types/abstract.ts:59
                                                                  • +
                                                                  • Defined in types/abstract.ts:56

                                                                  Returns string

                                                                  @@ -269,14 +269,14 @@

                                                                  Returns string

                                                                  Private isBuffer

                                                                  • @@ -288,9 +288,9 @@

                                                                    Private isBuffer

                                                                    Parameters

                                                                    @@ -309,7 +309,7 @@

                                                                    readValue

                                                                    Parameters

                                                                    @@ -337,7 +337,7 @@

                                                                    toBuffer

                                                                    Implementation of Type.toBuffer

                                                                    Inherited from AbstractType.toBuffer

                                                                      -
                                                                    • Defined in types/abstract.ts:51
                                                                    • +
                                                                    • Defined in types/abstract.ts:48

                                                                    Returns ArrayBuffer

                                                                    @@ -355,7 +355,7 @@

                                                                    valueBuffer

                                                                    Parameters

                                                                    @@ -372,7 +372,7 @@

                                                                    Returns ArrayBuff

                                                                    writeValue

                                                                    • @@ -384,7 +384,7 @@

                                                                      writeValue

                                                                      -

                                                                      Appends value bytes to an AppendableBuffer according to the type

                                                                      +

                                                                      Appends value bytes to an AppendableBuffer according to the type

                                                                      Example:

                                                                      type.writeValue(buffer, 123) //or '123'
                                                                      @@ -398,7 +398,7 @@ 

                                                                      writeValue

                                                                      Parameters

                                                                      • -
                                                                        buffer: AppendableBuffer
                                                                        +
                                                                        buffer: AppendableBuffer

                                                                        The buffer to which to append

                                                                        diff --git a/docs/classes/_types_unsigned_int_.unsignedinttype.html b/docs/classes/_types_unsigned_int_.unsignedinttype.html index e1ac209..1904f41 100644 --- a/docs/classes/_types_unsigned_int_.unsignedinttype.html +++ b/docs/classes/_types_unsigned_int_.unsignedinttype.html @@ -154,7 +154,7 @@

                                                                        Methods

                                                                        addToBuffer

                                                                        • @@ -162,13 +162,13 @@

                                                                          addToBuffer

                                                                          Implementation of Type.addToBuffer

                                                                          Inherited from AbstractType.addToBuffer

                                                                            -
                                                                          • Defined in types/abstract.ts:33
                                                                          • +
                                                                          • Defined in types/abstract.ts:30

                                                                          Parameters

                                                                          Returns boolean

                                                                          @@ -214,7 +214,7 @@

                                                                          equals

                                                                          Implementation of Type.equals

                                                                          Inherited from AbstractType.equals

                                                                            -
                                                                          • Defined in types/abstract.ts:82
                                                                          • +
                                                                          • Defined in types/abstract.ts:79

                                                                          Parameters

                                                                          @@ -239,7 +239,7 @@

                                                                          getHash

                                                                          Implementation of Type.getHash

                                                                          Inherited from AbstractType.getHash

                                                                            -
                                                                          • Defined in types/abstract.ts:55
                                                                          • +
                                                                          • Defined in types/abstract.ts:52

                                                                          Returns string

                                                                          @@ -258,7 +258,7 @@

                                                                          getSignature

                                                                          Implementation of Type.getSignature

                                                                          Inherited from AbstractType.getSignature

                                                                            -
                                                                          • Defined in types/abstract.ts:59
                                                                          • +
                                                                          • Defined in types/abstract.ts:56

                                                                          Returns string

                                                                          @@ -269,14 +269,14 @@

                                                                          Returns string

                                                                          Private isBuffer

                                                                          • @@ -288,9 +288,9 @@

                                                                            Private isBuffer

                                                                            Parameters

                                                                            @@ -309,7 +309,7 @@

                                                                            readValue

                                                                            Parameters

                                                                            @@ -337,7 +337,7 @@

                                                                            toBuffer

                                                                            Implementation of Type.toBuffer

                                                                            Inherited from AbstractType.toBuffer

                                                                              -
                                                                            • Defined in types/abstract.ts:51
                                                                            • +
                                                                            • Defined in types/abstract.ts:48

                                                                            Returns ArrayBuffer

                                                                            @@ -355,7 +355,7 @@

                                                                            valueBuffer

                                                                            Parameters

                                                                            @@ -372,7 +372,7 @@

                                                                            Returns ArrayBuff

                                                                            writeValue

                                                                            • @@ -384,7 +384,7 @@

                                                                              writeValue

                                                                              -

                                                                              Appends value bytes to an AppendableBuffer according to the type

                                                                              +

                                                                              Appends value bytes to an AppendableBuffer according to the type

                                                                              Example:

                                                                              type.writeValue(buffer, 1234567890) //or '1234567890'
                                                                              @@ -398,7 +398,7 @@ 

                                                                              writeValue

                                                                              Parameters

                                                                              • -
                                                                                buffer: AppendableBuffer
                                                                                +
                                                                                buffer: AppendableBuffer

                                                                                The buffer to which to append

                                                                                diff --git a/docs/classes/_types_unsigned_long_.unsignedlongtype.html b/docs/classes/_types_unsigned_long_.unsignedlongtype.html index aa9a65f..e470456 100644 --- a/docs/classes/_types_unsigned_long_.unsignedlongtype.html +++ b/docs/classes/_types_unsigned_long_.unsignedlongtype.html @@ -155,7 +155,7 @@

                                                                                Methods

                                                                                addToBuffer

                                                                                • @@ -163,13 +163,13 @@

                                                                                  addToBuffer

                                                                                  Implementation of Type.addToBuffer

                                                                                  Inherited from AbstractType.addToBuffer

                                                                                    -
                                                                                  • Defined in types/abstract.ts:33
                                                                                  • +
                                                                                  • Defined in types/abstract.ts:30

                                                                                  Parameters

                                                                                  Returns boolean

                                                                                  @@ -215,7 +215,7 @@

                                                                                  equals

                                                                                  Implementation of Type.equals

                                                                                  Inherited from AbstractType.equals

                                                                                    -
                                                                                  • Defined in types/abstract.ts:82
                                                                                  • +
                                                                                  • Defined in types/abstract.ts:79

                                                                                  Parameters

                                                                                  @@ -240,7 +240,7 @@

                                                                                  getHash

                                                                                  Implementation of Type.getHash

                                                                                  Inherited from AbstractType.getHash

                                                                                    -
                                                                                  • Defined in types/abstract.ts:55
                                                                                  • +
                                                                                  • Defined in types/abstract.ts:52

                                                                                  Returns string

                                                                                  @@ -259,7 +259,7 @@

                                                                                  getSignature

                                                                                  Implementation of Type.getSignature

                                                                                  Inherited from AbstractType.getSignature

                                                                                    -
                                                                                  • Defined in types/abstract.ts:59
                                                                                  • +
                                                                                  • Defined in types/abstract.ts:56

                                                                                  Returns string

                                                                                  @@ -270,14 +270,14 @@

                                                                                  Returns string

                                                                                  Private isBuffer

                                                                                  • @@ -289,9 +289,9 @@

                                                                                    Private isBuffer

                                                                                    Parameters

                                                                                    @@ -310,7 +310,7 @@

                                                                                    readValue

                                                                                    Parameters

                                                                                    @@ -338,7 +338,7 @@

                                                                                    toBuffer

                                                                                    Implementation of Type.toBuffer

                                                                                    Inherited from AbstractType.toBuffer

                                                                                      -
                                                                                    • Defined in types/abstract.ts:51
                                                                                    • +
                                                                                    • Defined in types/abstract.ts:48

                                                                                    Returns ArrayBuffer

                                                                                    @@ -356,7 +356,7 @@

                                                                                    valueBuffer

                                                                                    Parameters

                                                                                    @@ -373,7 +373,7 @@

                                                                                    Returns ArrayBuff

                                                                                    writeValue

                                                                                    • @@ -385,7 +385,7 @@

                                                                                      writeValue

                                                                                      -

                                                                                      Appends value bytes to an AppendableBuffer according to the type

                                                                                      +

                                                                                      Appends value bytes to an AppendableBuffer according to the type

                                                                                      Example:

                                                                                      type.writeValue(buffer, '1234567890123456789')
                                                                                      @@ -399,7 +399,7 @@ 

                                                                                      writeValue

                                                                                      Parameters

                                                                                      • -
                                                                                        buffer: AppendableBuffer
                                                                                        +
                                                                                        buffer: AppendableBuffer

                                                                                        The buffer to which to append

                                                                                        diff --git a/docs/classes/_types_unsigned_short_.unsignedshorttype.html b/docs/classes/_types_unsigned_short_.unsignedshorttype.html index 0025bbe..dfb2d3d 100644 --- a/docs/classes/_types_unsigned_short_.unsignedshorttype.html +++ b/docs/classes/_types_unsigned_short_.unsignedshorttype.html @@ -154,7 +154,7 @@

                                                                                        Methods

                                                                                        addToBuffer

                                                                                        • @@ -162,13 +162,13 @@

                                                                                          addToBuffer

                                                                                          Implementation of Type.addToBuffer

                                                                                          Inherited from AbstractType.addToBuffer

                                                                                            -
                                                                                          • Defined in types/abstract.ts:33
                                                                                          • +
                                                                                          • Defined in types/abstract.ts:30

                                                                                          Parameters

                                                                                          Returns boolean

                                                                                          @@ -214,7 +214,7 @@

                                                                                          equals

                                                                                          Implementation of Type.equals

                                                                                          Inherited from AbstractType.equals

                                                                                            -
                                                                                          • Defined in types/abstract.ts:82
                                                                                          • +
                                                                                          • Defined in types/abstract.ts:79

                                                                                          Parameters

                                                                                          @@ -239,7 +239,7 @@

                                                                                          getHash

                                                                                          Implementation of Type.getHash

                                                                                          Inherited from AbstractType.getHash

                                                                                            -
                                                                                          • Defined in types/abstract.ts:55
                                                                                          • +
                                                                                          • Defined in types/abstract.ts:52

                                                                                          Returns string

                                                                                          @@ -258,7 +258,7 @@

                                                                                          getSignature

                                                                                          Implementation of Type.getSignature

                                                                                          Inherited from AbstractType.getSignature

                                                                                            -
                                                                                          • Defined in types/abstract.ts:59
                                                                                          • +
                                                                                          • Defined in types/abstract.ts:56

                                                                                          Returns string

                                                                                          @@ -269,14 +269,14 @@

                                                                                          Returns string

                                                                                          Private isBuffer

                                                                                          • @@ -288,9 +288,9 @@

                                                                                            Private isBuffer

                                                                                            Parameters

                                                                                            @@ -309,7 +309,7 @@

                                                                                            readValue

                                                                                            Parameters

                                                                                            @@ -337,7 +337,7 @@

                                                                                            toBuffer

                                                                                            Implementation of Type.toBuffer

                                                                                            Inherited from AbstractType.toBuffer

                                                                                              -
                                                                                            • Defined in types/abstract.ts:51
                                                                                            • +
                                                                                            • Defined in types/abstract.ts:48

                                                                                            Returns ArrayBuffer

                                                                                            @@ -355,7 +355,7 @@

                                                                                            valueBuffer

                                                                                            Parameters

                                                                                            @@ -372,7 +372,7 @@

                                                                                            Returns ArrayBuff

                                                                                            writeValue

                                                                                            • @@ -384,7 +384,7 @@

                                                                                              writeValue

                                                                                              -

                                                                                              Appends value bytes to an AppendableBuffer according to the type

                                                                                              +

                                                                                              Appends value bytes to an AppendableBuffer according to the type

                                                                                              Example:

                                                                                              type.writeValue(buffer, 12345) //or '12345'
                                                                                              @@ -398,7 +398,7 @@ 

                                                                                              writeValue

                                                                                              Parameters

                                                                                              • -
                                                                                                buffer: AppendableBuffer
                                                                                                +
                                                                                                buffer: AppendableBuffer

                                                                                                The buffer to which to append

                                                                                                diff --git a/docs/interfaces/_lib_write_iterable_.iterablewriteparams.html b/docs/interfaces/_lib_write_iterable_.iterablewriteparams.html index e9fae59..a695780 100644 --- a/docs/interfaces/_lib_write_iterable_.iterablewriteparams.html +++ b/docs/interfaces/_lib_write_iterable_.iterablewriteparams.html @@ -106,7 +106,7 @@

                                                                                                Properties

                                                                                                buffer

                                                                                                - +
                                                                                                -

                                                                                                Appends the type information to an AppendableBuffer

                                                                                                +

                                                                                                Appends the type information to an AppendableBuffer

                                                                                                Parameters

                                                                                                • -
                                                                                                  buffer: AppendableBuffer
                                                                                                  +
                                                                                                  buffer: AppendableBuffer

                                                                                                  The buffer to append to

                                                                                                  @@ -454,7 +454,7 @@

                                                                                                  Returns ArrayBuff

                                                                                                  writeValue

                                                                                                  • @@ -465,7 +465,7 @@

                                                                                                    writeValue

                                                                                                    -

                                                                                                    Appends value bytes to an AppendableBuffer according to the type

                                                                                                    +

                                                                                                    Appends value bytes to an AppendableBuffer according to the type

                                                                                                    throws
                                                                                                    @@ -476,7 +476,7 @@

                                                                                                    writeValue

                                                                                                    Parameters

                                                                                                    • -
                                                                                                      buffer: AppendableBuffer
                                                                                                      +
                                                                                                      buffer: AppendableBuffer

                                                                                                      The buffer to which to append

                                                                                                      diff --git a/docs/modules/_lib_appendable_.html b/docs/modules/_lib_appendable_.html index 0c4c11b..b5e9b79 100644 --- a/docs/modules/_lib_appendable_.html +++ b/docs/modules/_lib_appendable_.html @@ -71,9 +71,9 @@

                                                                                                      Index

                                                                                                      -

                                                                                                      Interfaces

                                                                                                      +

                                                                                                      Classes

                                                                                                      @@ -93,8 +93,8 @@

                                                                                                      Interfaces

                                                                                                      diff --git a/docs/modules/_lib_recursive_nesting_.html b/docs/modules/_lib_recursive_nesting_.html index 6b93bf9..e8c0530 100644 --- a/docs/modules/_lib_recursive_nesting_.html +++ b/docs/modules/_lib_recursive_nesting_.html @@ -92,7 +92,7 @@

                                                                                                      Variables

                                                                                                      recursiveNesting

                                                                                                      -
                                                                                                      recursiveNesting: WeakMap<AppendableBuffer, number> = new WeakMap<AppendableBuffer, number>()
                                                                                                      +
                                                                                                      recursiveNesting: WeakMap<AppendableBuffer, number> = new WeakMap<AppendableBuffer, number>()
                                                                                                      -
                                                                                                      -

                                                                                                      Variables

                                                                                                      - -

    -
    -

    Variables

    -
    - -

    APPENDABLES

    -
    APPENDABLES: (GrowableBuffer | AppendableStream)[] = [GrowableBuffer, AppendableStream]
    - -
    -
    diff --git a/docs/modules/_types_pointer_.html b/docs/modules/_types_pointer_.html index 01a9206..50d58c5 100644 --- a/docs/modules/_types_pointer_.html +++ b/docs/modules/_types_pointer_.html @@ -101,7 +101,7 @@

    pointerReads

    pointers

    -
    pointers: WeakMap<AppendableBuffer, Map<string, number>> = new WeakMap<AppendableBuffer, Map<string, number>>()
    +
    pointers: WeakMap<AppendableBuffer, Map<string, number>> = new WeakMap<AppendableBuffer, Map<string, number>>()