diffusion
Version:
Diffusion JavaScript client
1 lines • 144 kB
JavaScript
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=32)}([function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.readOptional=t.writeOptional=t.writeBoolean=t.readBoolean=t.writeMap=t.readMap=t.readObject=t.writeObject=t.writeDictionary=t.readDictionary=t.readCollection=t.writeCollection=t.writeString=t.readString=t.writeBytes=t.readBytes=t.writeByte=t.writeInt32=t.readInt32=t.writeInt64=t.readInt64=t.readByte=void 0;var i=r(2),o=r(4),s=r(19),u=o.fromNumber(128),a=o.fromNumber(127),l=a.not();function c(e){var t=e.read();if(-1===t)throw new i.IOError("End of stream");return t}function f(e){for(var t=0,r=0;t<32;){var n=c(e);if(r|=(127&n)<<t,0==(128&n))return r;t+=7}throw new i.IOError("Malformed int32")}function p(e,t){for(;0!=(-128&t);)e.write(127&t|128),t>>>=7;e.write(t)}function h(e,t){e.write(t)}function d(e){var t=f(e);return e.readMany(t)}function S(e,t){p(e,t.length),e.writeMany(t)}function y(e){var t=d(e);return t?s.uint8toUtf8(t):""}function E(e,t){S(e,s.uint8FromUtf8(t))}function _(e,t,r,i){var o,s;p(e,Object.keys(t).length);try{for(var u=n(Object.getOwnPropertyNames(t)),a=u.next();!a.done;a=u.next()){var l=a.value;r(e,l),i(e,t[l])}}catch(e){o={error:e}}finally{try{a&&!a.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}}function v(e,t,r){for(var n=f(e),i={},o=0;o<n;++o){i[t(e)]=r(e)}return i}t.readByte=c,t.readInt64=function(e){for(var t=o.fromNumber(0),r=0;r<64;){var n=c(e),s=o.fromNumber(n);if(t=t.or(s.and(a).shiftLeft(r)),s.and(u).equals(0))return t;r+=7}throw new i.IOError("Malformed int64")},t.writeInt64=function(e,t){for(var r=t instanceof o?t:o.fromNumber(t,!1);!r.and(l).equals(0);)e.write(r.and(a).or(u).toInt()),r=r.shiftRightUnsigned(7);e.write(r.toInt())},t.readInt32=f,t.writeInt32=p,t.writeByte=h,t.readBytes=d,t.writeBytes=S,t.readString=y,t.writeString=E,t.writeCollection=function(e,t,r){var i,o;p(e,t.length);try{for(var s=n(t),u=s.next();!u.done;u=s.next()){r(e,u.value)}}catch(e){i={error:e}}finally{try{u&&!u.done&&(o=s.return)&&o.call(s)}finally{if(i)throw i.error}}},t.readCollection=function(e,t){for(var r=f(e),n=[],i=0;i<r;++i)n.push(t(e));return n},t.readDictionary=function(e,t){return v(e,y,t)},t.writeDictionary=function(e,t,r){_(e,t,E,r)},t.writeObject=_,t.readObject=v,t.readMap=function(e,t,r){for(var n=f(e),i=new Map,o=0;o<n;++o){var s=t(e);i.set(s,r(e))}return i},t.writeMap=function(e,t,r,n){p(e,t.size),t.forEach((function(t,i){r(e,i),n(e,t)}))},t.readBoolean=function(e){return 0!==e.readInt8()},t.writeBoolean=function(e,t){e.writeInt8(t?1:0)},t.writeOptional=function(e,t,r,n){void 0===n&&(n=function(e){return null!=e}),n(t)?(h(e,1),r(e,t)):h(e,0)},t.readOptional=function(e,t){return c(e)?t(e):void 0}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractSerialiser=void 0;var n=r(2),i=function(){function e(){}return e.prototype.read=function(e){throw new n.InternalError("AbstractSerialiser#read is not implemented")},e.prototype.write=function(e,t){throw new n.InternalError("AbstractSerialiser#write is not implemented")},e}();t.AbstractSerialiser=i},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.InternalError=t.IllegalStateError=t.RetryLimitError=t.SchemaParseError=t.SchemaViolationError=t.InvalidFilterError=t.OutOfBoundsError=t.IllegalArgumentError=t.SessionError=t.IOError=t.InvalidDataError=t.AssertionError=t.RuntimeError=t.NullValueError=void 0;var o=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="null_value_error",t}(Error);t.NullValueError=o;var s=function(e){function t(t,r){var n=e.call(this,t)||this;return n.cause=r,n}return i(t,e),t.prototype.getType=function(){return t.type},t.type="runtime_error",t}(Error);t.RuntimeError=s;var u=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="assertion_error",t}(Error);t.AssertionError=u;var a=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="invalid_data_error",t}(Error);t.InvalidDataError=a;var l=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="io_error",t}(Error);t.IOError=l;var c=function(e){function t(t,r){var n=e.call(this,t)||this;return n.cause=r,n}return i(t,e),t.prototype.getType=function(){return t.type},t.type="session_error",t}(Error);t.SessionError=c;var f=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="illegal_argument_error",t}(Error);t.IllegalArgumentError=f;var p=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="out_of_bounds_error",t}(Error);t.OutOfBoundsError=p;var h=function(e){function t(t,r){var n=e.call(this,t)||this;return n.errors=r,n}return i(t,e),t.prototype.getType=function(){return t.type},t.type="invalid_filter_error",t}(Error);t.InvalidFilterError=h;var d=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="schema_violation_error",t}(Error);t.SchemaViolationError=d;var S=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="schema_parse_error",t}(Error);t.SchemaParseError=S;var y=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="retry_limit_error",t}(Error);t.RetryLimitError=y;var E=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="illegal_state_error",t}(Error);t.IllegalStateError=E;var _=function(e){function t(t){return e.call(this,t)||this}return i(t,e),t.prototype.getType=function(){return t.type},t.type="internal_error",t}(Error);t.InternalError=_},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionIdSerialiser=t.SessionIdSerialiserClass=void 0;var n=r(0),i=r(26),o=function(){function e(){}return e.prototype.read=function(e){var t=n.readInt64(e),r=n.readInt64(e);return new i.SessionId(t,r)},e.prototype.write=function(e,t){n.writeInt64(e,t.server),n.writeInt64(e,t.value)},e}();t.SessionIdSerialiserClass=o,t.SessionIdSerialiser=new o},function(e,t){e.exports=n;var r=null;try{r=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}function n(e,t,r){this.low=0|e,this.high=0|t,this.unsigned=!!r}function i(e){return!0===(e&&e.__isLong__)}n.prototype.__isLong__,Object.defineProperty(n.prototype,"__isLong__",{value:!0}),n.isLong=i;var o={},s={};function u(e,t){var r,n,i;return t?(i=0<=(e>>>=0)&&e<256)&&(n=s[e])?n:(r=l(e,(0|e)<0?-1:0,!0),i&&(s[e]=r),r):(i=-128<=(e|=0)&&e<128)&&(n=o[e])?n:(r=l(e,e<0?-1:0,!1),i&&(o[e]=r),r)}function a(e,t){if(isNaN(e))return t?_:E;if(t){if(e<0)return _;if(e>=d)return R}else{if(e<=-S)return O;if(e+1>=S)return T}return e<0?a(-e,t).neg():l(e%h|0,e/h|0,t)}function l(e,t,r){return new n(e,t,r)}n.fromInt=u,n.fromNumber=a,n.fromBits=l;var c=Math.pow;function f(e,t,r){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return E;if("number"==typeof t?(r=t,t=!1):t=!!t,(r=r||10)<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===n)return f(e.substring(1),t,r).neg();for(var i=a(c(r,8)),o=E,s=0;s<e.length;s+=8){var u=Math.min(8,e.length-s),l=parseInt(e.substring(s,s+u),r);if(u<8){var p=a(c(r,u));o=o.mul(p).add(a(l))}else o=(o=o.mul(i)).add(a(l))}return o.unsigned=t,o}function p(e,t){return"number"==typeof e?a(e,t):"string"==typeof e?f(e,t):l(e.low,e.high,"boolean"==typeof t?t:e.unsigned)}n.fromString=f,n.fromValue=p;var h=4294967296,d=h*h,S=d/2,y=u(1<<24),E=u(0);n.ZERO=E;var _=u(0,!0);n.UZERO=_;var v=u(1);n.ONE=v;var w=u(1,!0);n.UONE=w;var g=u(-1);n.NEG_ONE=g;var T=l(-1,2147483647,!1);n.MAX_VALUE=T;var R=l(-1,-1,!0);n.MAX_UNSIGNED_VALUE=R;var O=l(0,-2147483648,!1);n.MIN_VALUE=O;var I=n.prototype;I.toInt=function(){return this.unsigned?this.low>>>0:this.low},I.toNumber=function(){return this.unsigned?(this.high>>>0)*h+(this.low>>>0):this.high*h+(this.low>>>0)},I.toString=function(e){if((e=e||10)<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(O)){var t=a(e),r=this.div(t),n=r.mul(t).sub(this);return r.toString(e)+n.toInt().toString(e)}return"-"+this.neg().toString(e)}for(var i=a(c(e,6),this.unsigned),o=this,s="";;){var u=o.div(i),l=(o.sub(u.mul(i)).toInt()>>>0).toString(e);if((o=u).isZero())return l+s;for(;l.length<6;)l="0"+l;s=""+l+s}},I.getHighBits=function(){return this.high},I.getHighBitsUnsigned=function(){return this.high>>>0},I.getLowBits=function(){return this.low},I.getLowBitsUnsigned=function(){return this.low>>>0},I.getNumBitsAbs=function(){if(this.isNegative())return this.eq(O)?64:this.neg().getNumBitsAbs();for(var e=0!=this.high?this.high:this.low,t=31;t>0&&0==(e&1<<t);t--);return 0!=this.high?t+33:t+1},I.isZero=function(){return 0===this.high&&0===this.low},I.eqz=I.isZero,I.isNegative=function(){return!this.unsigned&&this.high<0},I.isPositive=function(){return this.unsigned||this.high>=0},I.isOdd=function(){return 1==(1&this.low)},I.isEven=function(){return 0==(1&this.low)},I.equals=function(e){return i(e)||(e=p(e)),(this.unsigned===e.unsigned||this.high>>>31!=1||e.high>>>31!=1)&&(this.high===e.high&&this.low===e.low)},I.eq=I.equals,I.notEquals=function(e){return!this.eq(e)},I.neq=I.notEquals,I.ne=I.notEquals,I.lessThan=function(e){return this.comp(e)<0},I.lt=I.lessThan,I.lessThanOrEqual=function(e){return this.comp(e)<=0},I.lte=I.lessThanOrEqual,I.le=I.lessThanOrEqual,I.greaterThan=function(e){return this.comp(e)>0},I.gt=I.greaterThan,I.greaterThanOrEqual=function(e){return this.comp(e)>=0},I.gte=I.greaterThanOrEqual,I.ge=I.greaterThanOrEqual,I.compare=function(e){if(i(e)||(e=p(e)),this.eq(e))return 0;var t=this.isNegative(),r=e.isNegative();return t&&!r?-1:!t&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},I.comp=I.compare,I.negate=function(){return!this.unsigned&&this.eq(O)?O:this.not().add(v)},I.neg=I.negate,I.add=function(e){i(e)||(e=p(e));var t=this.high>>>16,r=65535&this.high,n=this.low>>>16,o=65535&this.low,s=e.high>>>16,u=65535&e.high,a=e.low>>>16,c=0,f=0,h=0,d=0;return h+=(d+=o+(65535&e.low))>>>16,f+=(h+=n+a)>>>16,c+=(f+=r+u)>>>16,c+=t+s,l((h&=65535)<<16|(d&=65535),(c&=65535)<<16|(f&=65535),this.unsigned)},I.subtract=function(e){return i(e)||(e=p(e)),this.add(e.neg())},I.sub=I.subtract,I.multiply=function(e){if(this.isZero())return E;if(i(e)||(e=p(e)),r)return l(r.mul(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned);if(e.isZero())return E;if(this.eq(O))return e.isOdd()?O:E;if(e.eq(O))return this.isOdd()?O:E;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(y)&&e.lt(y))return a(this.toNumber()*e.toNumber(),this.unsigned);var t=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,u=e.high>>>16,c=65535&e.high,f=e.low>>>16,h=65535&e.low,d=0,S=0,_=0,v=0;return _+=(v+=s*h)>>>16,S+=(_+=o*h)>>>16,_&=65535,S+=(_+=s*f)>>>16,d+=(S+=n*h)>>>16,S&=65535,d+=(S+=o*f)>>>16,S&=65535,d+=(S+=s*c)>>>16,d+=t*h+n*f+o*c+s*u,l((_&=65535)<<16|(v&=65535),(d&=65535)<<16|(S&=65535),this.unsigned)},I.mul=I.multiply,I.divide=function(e){if(i(e)||(e=p(e)),e.isZero())throw Error("division by zero");var t,n,o;if(r)return this.unsigned||-2147483648!==this.high||-1!==e.low||-1!==e.high?l((this.unsigned?r.div_u:r.div_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?_:E;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return _;if(e.gt(this.shru(1)))return w;o=_}else{if(this.eq(O))return e.eq(v)||e.eq(g)?O:e.eq(O)?v:(t=this.shr(1).div(e).shl(1)).eq(E)?e.isNegative()?v:g:(n=this.sub(e.mul(t)),o=t.add(n.div(e)));if(e.eq(O))return this.unsigned?_:E;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=E}for(n=this;n.gte(e);){t=Math.max(1,Math.floor(n.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(t)/Math.LN2),u=s<=48?1:c(2,s-48),f=a(t),h=f.mul(e);h.isNegative()||h.gt(n);)h=(f=a(t-=u,this.unsigned)).mul(e);f.isZero()&&(f=v),o=o.add(f),n=n.sub(h)}return o},I.div=I.divide,I.modulo=function(e){return i(e)||(e=p(e)),r?l((this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,e.low,e.high),r.get_high(),this.unsigned):this.sub(this.div(e).mul(e))},I.mod=I.modulo,I.rem=I.modulo,I.not=function(){return l(~this.low,~this.high,this.unsigned)},I.and=function(e){return i(e)||(e=p(e)),l(this.low&e.low,this.high&e.high,this.unsigned)},I.or=function(e){return i(e)||(e=p(e)),l(this.low|e.low,this.high|e.high,this.unsigned)},I.xor=function(e){return i(e)||(e=p(e)),l(this.low^e.low,this.high^e.high,this.unsigned)},I.shiftLeft=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):l(0,this.low<<e-32,this.unsigned)},I.shl=I.shiftLeft,I.shiftRight=function(e){return i(e)&&(e=e.toInt()),0==(e&=63)?this:e<32?l(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):l(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},I.shr=I.shiftRight,I.shiftRightUnsigned=function(e){if(i(e)&&(e=e.toInt()),0===(e&=63))return this;var t=this.high;return e<32?l(this.low>>>e|t<<32-e,t>>>e,this.unsigned):l(32===e?t:t>>>e-32,0,this.unsigned)},I.shru=I.shiftRightUnsigned,I.shr_u=I.shiftRightUnsigned,I.toSigned=function(){return this.unsigned?l(this.low,this.high,!1):this},I.toUnsigned=function(){return this.unsigned?this:l(this.low,this.high,!0)},I.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},I.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},I.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},n.fromBytes=function(e,t,r){return r?n.fromBytesLE(e,t):n.fromBytesBE(e,t)},n.fromBytesLE=function(e,t){return new n(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,t)},n.fromBytesBE=function(e,t){return new n(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CIDSerialiser=t.CIDSerialiserClass=void 0;var n=r(44),i=r(0),o=function(){function e(){}return e.prototype.read=function(e){return new n.ConversationId(i.readInt64(e))},e.prototype.write=function(e,t){i.writeInt64(e,t.val)},e}();t.CIDSerialiserClass=o,t.CIDSerialiser=new o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DescendantQualifier=t.DQ=t.canonicalise=t.split=t.PATH_SEPARATOR=void 0,t.PATH_SEPARATOR="/",t.split=function(e){return e.split(t.PATH_SEPARATOR)},t.canonicalise=function(e){if(!e)return"";var r=e.length,n=r>0&&e.charAt(0)===t.PATH_SEPARATOR?1:0,i=r>1&&e.charAt(r-1)===t.PATH_SEPARATOR?1:0;return e.substring(n,r-i)};var n=function(e){this.includesDescendants=e};t.DQ=n,t.DescendantQualifier=Object.freeze({MATCH:new n(!1),DESCENDANTS_OF_MATCH:new n(!0),MATCH_AND_DESCENDANTS:new n(!0)})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractTopicSelector=void 0;var n=r(6),i=function(){function e(e,t,r){this.type=e,this.prefix=t,this.expression=r}return e.prototype.selects=function(e){var t=n.canonicalise(e);return 0===t.indexOf(this.prefix)&&this.doSelects(t)},e.prototype.toString=function(){return this.expression},e}();t.AbstractTopicSelector=i},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.enumerize=void 0,t.enumerize=function(e){Object.keys(e).forEach((function(t){var r=e[t].id;void 0!==r&&(e[r]=t)}))}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.requireNonNull=void 0;var n=r(2);t.requireNonNull=function(e,t){if(null==e)throw new n.NullValueError(t+" is null");return e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.write=t.read=void 0;var n=r(2),i=r(0);t.read=function(e,t){var r=i.readByte(e);if(void 0===t[r])throw new n.IllegalArgumentError("Unable to decode enum value "+r);return t[t[r]]},t.write=function(e,t){"number"==typeof t?i.writeByte(e,t):i.writeByte(e,t.id)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TopicTypeEnum=t.TopicType=void 0;var n=r(8),i=function(e,t,r){this.id=e,this.stateful=t,this.functional=r};t.TopicType=i,t.TopicTypeEnum={BINARY:new i(14,!0,!1),JSON:new i(15,!0,!1),STRING:new i(17,!0,!1),INT64:new i(18,!0,!1),DOUBLE:new i(19,!0,!1),TIME_SERIES:new i(16,!0,!1),RECORD_V2:new i(20,!0,!1),UNKNOWN_TOPIC_TYPE:new i(21,!1,!1)},n.enumerize(t.TopicTypeEnum)},function(e,t,r){"use strict";var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.setLevel=t.create=t.LoggingLevel=void 0;var i,o=r(54);function s(e,t){var r="|"+e.toUpperCase()+"|"+t+"|",n=function(){return new Date};return function(t,i){i?o[e](n()+r+t,i):o[e](n()+r+t)}}!function(e){e.trace="trace",e.debug="debug",e.info="info",e.warn="warn",e.error="error"}(i=t.LoggingLevel||(t.LoggingLevel={})),t.create=function(e){var t,r,o={};try{for(var u=n(Object.keys(i)),a=u.next();!a.done;a=u.next()){var l=a.value;o[l]=s(l,e)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return o},t.setLevel=o.setLevel},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Type=t.Prefix=void 0,function(e){e.PATH=">",e.SPLIT_PATH_PATTERN="?",e.FULL_PATH_PATTERN="*",e.SELECTOR_SET="#"}(t.Prefix||(t.Prefix={})),function(e){e.PATH=">",e.SPLIT_PATH_PATTERN="?",e.FULL_PATH_PATTERN="*",e.SELECTOR_SET="#"}(t.Type||(t.Type={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MIN_SAFE_INTEGER=t.MAX_SAFE_INTEGER=t.MAX_INT32=t.findNextPowerOfTwo=t.approximateSquareRoot=void 0;var n=r(2);t.approximateSquareRoot=function(e){if(e<0)throw new n.IllegalArgumentError("Value must be great or equal to 0");if(0===e)return 0;var t=32-function(e){if(0===e)return 32;var t=1;return e>>>16==0&&(t+=16,e<<=16),e>>>24==0&&(t+=8,e<<=8),e>>>28==0&&(t+=4,e<<=4),e>>>30==0&&(t+=2,e<<=2),t-=e>>>31}(e);return 1<<Math.round(t/2)},t.findNextPowerOfTwo=function(e){if(e<0||e>1<<30)throw new n.IllegalArgumentError("Illegal argument: "+e);return e--,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e},t.MAX_INT32=2147483647,t.MAX_SAFE_INTEGER=9007199254740991,t.MIN_SAFE_INTEGER=-9007199254740991},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorReportSerialiser=t.ErrorReportSerialiserClass=void 0;var o=r(0),s=r(1),u=r(70),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.read=function(e){var t=o.readString(e),r=o.readInt32(e),n=o.readInt32(e);return new u.ErrorReportImpl(t,r,n)},t.prototype.write=function(e,t){o.writeString(e,t.message),o.writeInt32(e,t.line),o.writeInt32(e,t.column)},t}(s.AbstractSerialiser);t.ErrorReportSerialiserClass=a,t.ErrorReportSerialiser=new a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorReason=void 0;var n=function(){function e(e,t){this.id=e,this.reason=t}return e.prototype.toString=function(){return this.id+": "+this.reason},e}();t.ErrorReason=n},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.MessageReceiverControlRegistrationParamsSerialiser=t.MessageReceiverControlRegistrationParamsSerialiserClass=void 0;var o=r(18),s=r(0),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.write=function(e,t){s.writeInt32(e,t.definition.id),o.ControlGroupSerialiser.write(e,t.group),s.writeString(e,t.path),s.writeCollection(e,t.keys,s.writeString)},t}(r(1).AbstractSerialiser);t.MessageReceiverControlRegistrationParamsSerialiserClass=u,t.MessageReceiverControlRegistrationParamsSerialiser=new u},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ControlGroupSerialiser=t.ControlGroupSerialiserClass=void 0;var o=r(37),s=r(0),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.read=function(e){var t=s.readString(e);return new o.ControlGroup(t)},t.prototype.write=function(e,t){s.writeString(e,t.name)},t}(r(1).AbstractSerialiser);t.ControlGroupSerialiserClass=u,t.ControlGroupSerialiser=new u},function(e,t,r){"use strict";(function(e){var r=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},i=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};function o(e){for(var t=[],r=0;r<e.length;r+=128)t.push(e.subarray(r,Math.min(r+128,e.length)));return t.map((function(e){return String.fromCharCode.apply(String,i([],n(e)))})).join("")}Object.defineProperty(t,"__esModule",{value:!0}),t.isUint8Array=t.isEqualUint8Arrays=t.uint8toUtf8=t.uint8ToBase64=t.uint8ToAscii=t.uint8FromDoubleBE=t.uint8FromBase64=t.uint8FromUtf8=t.uint8FromBinary=t.writeInt32BE=t.writeInt8=t.readDoubleBE=t.readFloatBE=t.readInt32BE=t.readUInt32BE=t.readUInt16BE=t.readInt8=t.concatUint8Arrays=void 0,t.concatUint8Arrays=function(e){var t,n,i=e.reduce((function(e,t){return e+t.length}),0),o=new Uint8Array(i),s=0;try{for(var u=r(e),a=u.next();!a.done;a=u.next()){var l=a.value;o.set(l,s),s+=l.length}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=u.return)&&n.call(u)}finally{if(t)throw t.error}}return o},t.readInt8=function(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getInt8(t)},t.readUInt16BE=function(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getUint16(t,!1)},t.readUInt32BE=function(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(t,!1)},t.readInt32BE=function(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getInt32(t,!1)},t.readFloatBE=function(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!1)},t.readDoubleBE=function(e,t){return new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!1)},t.writeInt8=function(e,t,r){e[t]=r},t.writeInt32BE=function(e,t,r){new DataView(e.buffer,e.byteOffset,e.byteLength).setInt32(t,r,!1)},t.uint8FromBinary=function(e){for(var t=new Uint8Array(e.length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t},t.uint8FromUtf8=function(e){return(new TextEncoder).encode(e)},t.uint8FromBase64="undefined"==typeof window||void 0===window.atob?function(t){return new Uint8Array(e.from(t,"base64"))}:function(e){return new Uint8Array(window.atob(e).split("").map((function(e){return e.charCodeAt(0)})))},t.uint8FromDoubleBE=function(e){var t=new ArrayBuffer(8);return new DataView(t).setFloat64(0,e,!1),new Uint8Array(t)},t.uint8ToAscii=o,t.uint8ToBase64="undefined"==typeof window||void 0===window.btoa?function(t){return e.from(t).toString("base64")}:function(e){return window.btoa(o(e))},t.uint8toUtf8=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=e.length),(new TextDecoder).decode(e.subarray(t,r))},t.isEqualUint8Arrays=function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;++r)if(e[r]!==t[r])return!1;return!0},t.isUint8Array=function(e){return"function"==typeof Uint8Array&&e instanceof Uint8Array||"[object Uint8Array]"===Object.prototype.toString.call(e)}}).call(this,r(38).Buffer)},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TopicControlRegistrationParamsSerialiser=t.TopicControlRegistrationParamsSerialiserClass=void 0;var o=r(18),s=r(0),u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.write=function(e,t){s.writeInt32(e,t.definition.id),o.ControlGroupSerialiser.write(e,t.group),s.writeString(e,t.path)},t}(r(1).AbstractSerialiser);t.TopicControlRegistrationParamsSerialiserClass=u,t.TopicControlRegistrationParamsSerialiser=new u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NullSerialiser=void 0,t.NullSerialiser={read:function(){return null},write:function(){}}},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},i=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(t,"__esModule",{value:!0}),t.TopicSpecification=void 0;var o=r(2),s=["PUBLISH_VALUES_ONLY","SCHEMA","VALIDATE_VALUES","TIDY_ON_UNSUBSCRIBE","TIME_SERIES_EVENT_VALUE_TYPE","TIME_SERIES_RETAINED_RANGE","TIME_SERIES_SUBSCRIPTION_RANGE","DONT_RETAIN_VALUE","PERSISTENT","REMOVAL","OWNER","COMPRESSION","CONFLATION","PRIORITY"],u=function(){function e(e,t){void 0===t&&(t={}),this.type=e,this.properties=t}return e.prototype.withProperty=function(t,r){var i;if("string"!=typeof t||s.indexOf(t.toUpperCase())<0)throw new o.IllegalArgumentError("Invalid key: "+t);if("string"!=typeof r)throw new o.IllegalArgumentError("Invalid value, must be string: "+r);var u=n(n({},this.properties),((i={})[t]=r,i));return new e(this.type,u)},e.prototype.withProperties=function(t){var r,u;try{for(var a=i(Object.getOwnPropertyNames(t)),l=a.next();!l.done;l=a.next()){var c=l.value;if("string"!=typeof c||s.indexOf(c.toUpperCase())<0)throw new o.IllegalArgumentError("Invalid key: "+c);var f=t[c];if("string"!=typeof f)throw new o.IllegalArgumentError("Invalid value, must be string: "+f)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(u=a.return)&&u.call(a)}finally{if(r)throw r.error}}var p=n(n({},this.properties),t);return new e(this.type,p)},e.PUBLISH_VALUES_ONLY="PUBLISH_VALUES_ONLY",e.VALIDATE_VALUES="VALIDATE_VALUES",e.TIDY_ON_UNSUBSCRIBE="TIDY_ON_UNSUBSCRIBE",e.TIME_SERIES_EVENT_VALUE_TYPE="TIME_SERIES_EVENT_VALUE_TYPE",e.TIME_SERIES_RETAINED_RANGE="TIME_SERIES_RETAINED_RANGE",e.TIME_SERIES_SUBSCRIPTION_RANGE="TIME_SERIES_SUBSCRIPTION_RANGE",e.SCHEMA="SCHEMA",e.DONT_RETAIN_VALUE="DONT_RETAIN_VALUE",e.PERSISTENT="PERSISTENT",e.REMOVAL="REMOVAL",e.CONFLATION="CONFLATION",e.OWNER="OWNER",e.COMPRESSION="COMPRESSION",e.PRIORITY="PRIORITY",e}();t.TopicSpecification=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SESSION_EVENT_DEREGISTRATION=t.SESSION_EVENT_REGISTRATION=t.SESSION_FETCH=t.SET_CLIENT_CONFLATION_FILTER=t.CLOSE_CLIENT_FILTER=t.CHANGE_AUTHORISATION_ROLES_FILTER=t.CHANGE_AUTHORISATION_ROLES=t.SET_SESSION_PROPERTIES_FILTER=t.SET_SESSION_PROPERTIES=t.SESSION_PROPERTIES_EVENT_2=t.SESSION_PROPERTIES_REGISTRATION_2=t.GET_SESSION_PROPERTIES=t.FILTER_UNSUBSCRIBE=t.FILTER_SUBSCRIBE=t.SET_CLIENT_CONFLATION=t.CLOSE_CLIENT=t.UNSUBSCRIBE_CLIENT=t.SUBSCRIBE_CLIENT=void 0;var n=r(57),i=r(58),o=r(69),s=r(72),u=r(74),a=r(75),l=r(76),c=r(78),f=r(79),p=r(81),h=r(85),d=r(86),S=r(87),y=r(88),E=r(89),_=r(90),v=r(92),w=r(21),g=r(94),T=r(97),R=r(5),O=r(98),I=r(29);t.SUBSCRIBE_CLIENT={id:10,request:s.ClientSubscribeRequestSerialiser,response:w.NullSerialiser},t.UNSUBSCRIBE_CLIENT={id:11,request:s.ClientSubscribeRequestSerialiser,response:w.NullSerialiser},t.CLOSE_CLIENT={id:14,request:l.CloseClientRequestSerialiser,response:w.NullSerialiser},t.SET_CLIENT_CONFLATION={id:15,request:d.SetClientConflationRequestSerialiser,response:w.NullSerialiser},t.FILTER_SUBSCRIBE={id:65,request:i.ClientFilterSubscribeRequestSerialiser,response:o.ClientFilterSubscribeResponseSerialiser},t.FILTER_UNSUBSCRIBE={id:66,request:i.ClientFilterSubscribeRequestSerialiser,response:o.ClientFilterSubscribeResponseSerialiser},t.GET_SESSION_PROPERTIES={id:67,request:c.GetSessionPropertiesRequestSerialiser,response:f.GetSessionPropertiesResponseSerialiser},t.SESSION_PROPERTIES_REGISTRATION_2={id:81,request:y.SetSessionPropertiesListenerSerialiser,response:w.NullSerialiser},t.SESSION_PROPERTIES_EVENT_2={id:82,request:p.SessionPropertiesEventBatchSerialiser,response:w.NullSerialiser},t.SET_SESSION_PROPERTIES={id:105,request:E.SetSessionPropertiesRequestSerialiser,response:_.SetSessionPropertiesResultSerialiser},t.SET_SESSION_PROPERTIES_FILTER={id:106,request:S.SetSessionPropertiesFilterRequestSerialiser,response:v.CountOrParserErrorsSerialiser},t.CHANGE_AUTHORISATION_ROLES={id:123,request:a.ChangeAuthorisationRolesRequestSerialiser,response:w.NullSerialiser},t.CHANGE_AUTHORISATION_ROLES_FILTER={id:124,request:u.ChangeAuthorisationRolesFilterRequestSerialiser,response:v.CountOrParserErrorsSerialiser},t.CLOSE_CLIENT_FILTER={id:162,request:n.StringSerialiser,response:v.CountOrParserErrorsSerialiser},t.SET_CLIENT_CONFLATION_FILTER={id:163,request:h.SetClientConflationFilterRequestSerialiser,response:v.CountOrParserErrorsSerialiser},t.SESSION_FETCH={id:168,request:T.SessionFetchQuerySerialiser,response:g.SessionFetchQueryResultSerialiser},t.SESSION_EVENT_REGISTRATION={id:189,request:O.SessionEventListenerRegistrationRequestSerialiser,response:I.ErrorReportListSerialiser},t.SESSION_EVENT_DEREGISTRATION={id:190,request:R.CIDSerialiser,response:w.NullSerialiser}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.TopicSelectorSerialiser=t.TopicSelectorSerialiserClass=void 0;var o=r(0),s=r(1),u=r(59),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.read=function(e){return u.parseSelector(o.readString(e))},t.prototype.write=function(e,t){o.writeString(e,t.expression)},t}(s.AbstractSerialiser);t.TopicSelectorSerialiserClass=a,t.TopicSelectorSerialiser=new a},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regex=void 0;var n=r(2);t.regex=function(e,t){if(void 0===t&&(t=""),""===e)throw new n.IllegalArgumentError("Empty regular expression ["+t+"]");try{var r=new RegExp(e);return function(e){var t=r.exec(e);return t&&t[0]===e}}catch(e){throw new n.IllegalArgumentError("Bad regular expression ["+e.message+", "+t+"]")}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionId=void 0;var n=r(2),i=r(4),o=function(){function e(e,t){this.server=e,this.value=t}return e.fromString=function(t){var r,o=t.split("-");if(2!==o.length)throw new n.IllegalArgumentError("SessionId must consist of two hexadecimal parts, joined with a '-'");try{r=new e(i.fromString(o[0],!1,16),i.fromString(o[1],!1,16))}catch(e){throw new n.IllegalArgumentError("SessionId must consist of two hexadecimal parts, joined with a '-'")}return r},e.validate=function(t){if(t instanceof e)return t;if(0===t.length||t.indexOf("-")<0||t.indexOf(" ")>=0)return!1;try{return e.fromString(t)}catch(e){return!1}},e.prototype.toString=function(){var e="0000000000000000"+this.server.toUnsigned().toString(16),t="0000000000000000"+this.value.toUnsigned().toString(16);return(e.substr(e.length-16)+"-"+t.substr(t.length-16)).toLowerCase()},e}();t.SessionId=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ClientCloseReason=t.CloseReasonEnum=void 0;var n=r(83),i=r(8);t.CloseReasonEnum={CLOSED_BY_CLIENT:new n.CloseReasonImpl(0,"The session was closed by the client",!1),CLOSED_BY_SERVER:new n.CloseReasonImpl(1,"The session was closed by the server",!1),RECONNECT_ABORTED:new n.CloseReasonImpl(2,"Client aborted a reconnect attempt",!1),CONNECTION_TIMEOUT:new n.CloseReasonImpl(3,"The connection attempt timed out",!1),HANDSHAKE_REJECTED:new n.CloseReasonImpl(4,"The connection handshake was rejected by the server",!1),HANDSHAKE_ERROR:new n.CloseReasonImpl(5,"There was an error parsing the handshake response",!1),TRANSPORT_ERROR:new n.CloseReasonImpl(6,"There was an unexpected error with the connection",!0),CONNECTION_ERROR:new n.CloseReasonImpl(7,"The client could not establish a connection to the server",!0),IDLE_CONNECTION:new n.CloseReasonImpl(8,"The activity monitor detected the connection was idle",!0),LOST_MESSAGES:new n.CloseReasonImpl(16,"Loss of messages has been detected",!1),PROTOCOL_VERSION_MISMATCH:new n.CloseReasonImpl(17,"Client version rejected : Client should be downgraded to use server compatible version or server upgraded to client version in use",!1),LICENSE_EXCEEDED:new n.CloseReasonImpl(18,"The license limit was exceeded",!1),ACCESS_DENIED:new n.CloseReasonImpl(99,"The connection attempt was rejected by the server because authentication failed",!1)},i.enumerize(t.CloseReasonEnum),function(e){e[e.CONNECTION_LOST=0]="CONNECTION_LOST",e[e.IO_EXCEPTION=1]="IO_EXCEPTION",e[e.CLIENT_UNRESPONSIVE=2]="CLIENT_UNRESPONSIVE",e[e.MESSAGE_QUEUE_LIMIT_REACHED=3]="MESSAGE_QUEUE_LIMIT_REACHED",e[e.CLOSED_BY_CLIENT=4]="CLOSED_BY_CLIENT",e[e.MESSAGE_TOO_LARGE=5]="MESSAGE_TOO_LARGE",e[e.INTERNAL_ERROR=6]="INTERNAL_ERROR",e[e.INVALID_INBOUND_MESSAGE=7]="INVALID_INBOUND_MESSAGE",e[e.ABORTED=8]="ABORTED",e[e.LOST_MESSAGES=9]="LOST_MESSAGES",e[e.CLOSED_BY_CONTROLLER=10]="CLOSED_BY_CONTROLLER",e[e.FAILED_OVER=11]="FAILED_OVER",e[e.SESSION_TAKEN_OVER=12]="SESSION_TAKEN_OVER"}(t.ClientCloseReason||(t.ClientCloseReason={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionPropertiesEventType=void 0,function(e){e[e.OPEN=0]="OPEN",e[e.UPDATE=1]="UPDATE",e[e.CLOSE=2]="CLOSE"}(t.SessionPropertiesEventType||(t.SessionPropertiesEventType={}))},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorReportListSerialiser=t.ErrorReportListSerialiserClass=void 0;var o=r(0),s=r(1),u=r(95),a=r(15),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.read=function(e){var t=o.readCollection(e,a.ErrorReportSerialiser.read);return new u.ErrorReportList(t)},t.prototype.write=function(e,t){o.writeCollection(e,t.errors,a.ErrorReportSerialiser.write)},t}(s.AbstractSerialiser);t.ErrorReportListSerialiserClass=l,t.ErrorReportListSerialiser=new l},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.responseSuccess=void 0,t.responseSuccess=function(e,t){return!e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SessionState=t.SessionEventStreamEventType=t.SessionEventType=void 0,function(e){e[e.UPDATED=0]="UPDATED",e[e.RECONNECTED=1]="RECONNECTED",e[e.FAILED_OVER=2]="FAILED_OVER",e[e.DISCONNECTED=3]="DISCONNECTED"}(t.SessionEventType||(t.SessionEventType={})),function(e){e[e.STATE=0]="STATE",e[e.PROPERTIES=1]="PROPERTIES"}(t.SessionEventStreamEventType||(t.SessionEventStreamEventType={})),function(e){e[e.ACTIVE=0]="ACTIVE",e[e.DISCONNECTED=1]="DISCONNECTED",e[e.RECONNECTED=2]="RECONNECTED",e[e.FAILED_OVER=3]="FAILED_OVER",e[e.CLOSED=4]="CLOSED"}(t.SessionState||(t.SessionState={}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),void 0===window._diffusion_features&&(window._diffusion_features={client_control:{},gateway_control:{},log_retrieval:{},messages:{},metrics:{},ping:{},remote_servers:{},replace_license:{},security:{},session_lock:{},session_trees:{},topic_control:{},topic_notifications:{},topic_update:{},topic_views:{},time_series:{}});var n=r(33);window._diffusion_features.client_control.ClientControlImpl=n.ClientControlImpl},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{a(n.next(e))}catch(e){o(e)}}function u(e){try{a(n.throw(e))}catch(e){o(e)}}function a(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},o=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},u=this&&this.__spreadArray||function(e,t){for(var r=0,n=t.length,i=e.length;r<n;r++,i++)e[i]=t[r];return e};Object.defineProperty(t,"__esModule",{value:!0}),t.ClientControlImpl=void 0;var a=r(34),l=r(2),c=r(16),f=r(35),p=r(55),h=r(23),d=r(101),S=r(102),y=r(28),E=r(103),_=r(104),v=r(105),w=r(26),g=r(12),T=r(9),R=r(30),O=r(4),I=r(31),b=r(106),C=g.create("Session.Clients");function A(e){switch(e.type){case y.SessionPropertiesEventType.CLOSE:return I.SessionState.CLOSED;case y.SessionPropertiesEventType.OPEN:return I.SessionState.ACTIVE;case y.SessionPropertiesEventType.UPDATE:default:switch(e.updateType){case I.SessionEventType.DISCONNECTED:return I.SessionState.DISCONNECTED;case I.SessionEventType.FAILED_OVER:return I.SessionState.FAILED_OVER;case I.SessionEventType.RECONNECTED:return I.SessionState.RECONNECTED;case I.SessionEventType.UPDATED:default:return I.SessionState.ACTIVE}}}var P=function(){function e(e){this.SessionEventType=I.SessionEventType,this.internal=e,this.serviceLocator=e.getServiceLocator(),this.SET_CLIENT_CONFLATION=this.serviceLocator.obtain(h.SET_CLIENT_CONFLATION),this.SET_CLIENT_CONFLATION_FILTER=this.serviceLocator.obtain(h.SET_CLIENT_CONFLATION_FILTER),this.GET_SESSION_PROPERTIES=this.serviceLocator.obtain(h.GET_SESSION_PROPERTIES),this.SESSION_PROPERTIES_REGISTRATION=this.serviceLocator.obtain(h.SESSION_PROPERTIES_REGISTRATION_2),this.CHANGE_AUTHORISATION_ROLES=this.serviceLocator.obtain(h.CHANGE_AUTHORISATION_ROLES),this.CHANGE_AUTHORISATION_ROLES_FILTER=this.serviceLocator.obtain(h.CHANGE_AUTHORISATION_ROLES_FILTER),this.SET_SESSION_PROPERTIES_FILTER=this.serviceLocator.obtain(h.SET_SESSION_PROPERTIES_FILTER),this.SESSION_EVENT_REGISTRATION=this.serviceLocator.obtain(h.SESSION_EVENT_REGISTRATION),this.SESSION_EVENT_DEREGISTRATION=this.serviceLocator.obtain(h.SESSION_EVENT_DEREGISTRATION),this.internal.getServiceRegistry().add(h.SESSION_PROPERTIES_EVENT_2,{onRequest:function(e,t,r){e.getConversationSet().respondIfPresent(t.cid,t),r.respond()}})}return e.prototype.close=function(e){var t=this;return new Promise((function(r,n){try{T.requireNonNull(e,"sessions")}catch(e){return void n(e)}if(t.internal.checkConnected(n)){var i=w.SessionId.validate(e);i?t.serviceLocator.obtain(h.CLOSE_CLIENT).send({sessionID:i},(function(e,t){e?n(e):r(1)})):"string"==typeof e?t.serviceLocator.obtain(h.CLOSE_CLIENT_FILTER).send(e,(function(e,t){R.responseSuccess(e,t)?t.errors.length>0?n(t.errors):r(t.count):n(e)})):n(new Error("Invalid SessionID: "+e))}}))},e.prototype.subscribe=function(e,t){var r=this;return new Promise((function(n,i){try{e=T.requireNonNull(e,"SessionID or Session Filter"),t=T.requireNonNull(t,"Topic Selector")}catch(e){return void i(e)}if(r.internal.checkConnected(i)){var o=void 0;try{o=r.internal.getContext().parseSelector(t)}catch(e){return void i(e)}var s=w.SessionId.validate(e);s?r.serviceLocator.obtain(h.SUBSCRIBE_CLIENT).send({sessionID:s,selector:o},(function(e){e?i(e):n()})):r.serviceLocator.obtain(h.FILTER_SUBSCRIBE).send({filter:e,selector:o},(function(e,t){R.responseSuccess(e,t)?t.isSuccess()?n(t.selected):i(t.errors):i(e)}))}}))},e.prototype.unsubscribe=function(e,t){var r=this;return new Promise((function(n,i){try{T.requireNonNull(e,"SessionID or Session Filter"),T.requireNonNull(t,"Topic Selector")}catch(e){return void i(e)}if(r.internal.checkConnected(i)){var o=void 0;try{o=r.internal.getContext().parseSelector(t)}catch(e){return void i(e)}var s=w.SessionId.validate(e);s?r.serviceLocator.obtain(h.UNSUBSCRIBE_CLIENT).send({sessionID:s,selector:o},(function(e){e?i(e):n()})):r.serviceLocator.obtain(h.FILTER_UNSUBSCRIBE).send({filter:e,selector:o},(function(e,t){R.responseSuccess(e,t)?t.isSuccess()?n(t.selected):i(t.errors):i(e)}))}}))},e.prototype.getSessionProperties=function(e,t){var r=this;return void 0===t&&(t=[]),new Promise((function(n,i){"string"==typeof e&&(e=w.SessionId.fromString(e)),r.internal.checkConnected(i)&&r.GET_SESSION_PROPERTIES.send({sessionID:e,propertyKeys:t},(function(e,t){R.responseSuccess(e,t)?null===t?i(new Error("Invalid session ID")):n(t.properties):i(e)}))}))},e.prototype.setSessionProperties=function(e,t){var r=this;return new Promise((function(n,i){try{T.requireNonNull(e,"sessionId"),T.requireNonNull(t,"properties")}catch(e){return void i(e)}if("string"==typeof e&&(e=w.SessionId.fromString(e)),r.internal.checkConnected(i)){var o={},s=[];r.extractOverwriteAndRemoveProperties(o,s,t),r.serviceLocator.obtain(h.SET_SESSION_PROPERTIES).send({sessionID:e,overwriteProperties:o,removeProperties:s},(function(e,t){R.responseSuccess(e,t)?n(t.properties):i(e)}))}}))},e.prototype.setOverwriteOrRemoveProperty=function(e,t,r,n){null===n?t.push(r):e[r]=n},e.prototype.extractOverwriteAndRemoveProperties=function(e,t,r){var n,i,s=this;if(r.forEach instanceof Function)r.forEach((function(r,n){s.setOverwriteOrRemoveProperty(e,t,r,n)}));else try{for(var u=o(Object.getOwnPropertyNames(r)),a=u.next();!a.done;a=u.next()){var l=a.value;this.setOverwriteOrRemoveProperty(e,t,l,r[l])}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}},e.prototype.setSessionPropertiesByFilter=function(e,t){var r=this;return new Promise((function(n,i){try{T.requireNonNull(e,"filter"),T.requireNonNull(t,"properties")}catch(e){return void i(e)}if(r.internal.checkConnected(i)){var o={},s=[],u=new v.SetSessionPropertiesFilterRequest(e,o,s);r.extractOverwriteAndRemoveProperties(o,s,t),r.SET_SESSION_PROPERTIES_FILTER.send(u,(function(e,t){R.responseSuccess(e,t)?t.errors.length>0?i(t.errors):n(t.count):i(e)}))}}))},e.prototype.setSessionPropertiesListener=function(e,t){var r=this;return new Promise((function(s,u){return n(r,void 0,void 0,(function(){var r,n,a,l=this;return i(this,(function(i){switch(i.label){case 0:return t||u(new Error("Session Properties listener is null or undefined")),this.internal.checkConnected(u)?(C.debug("Adding Session Properties Listener"),r={active:function(e){C.debug("Session Properties Listener active"),t.onActive(e)},respond:function(e){var r,n;try{for(var i=o(e.events)