!function(e,t){"object"==typeofexports&&"object"==typeofmodule?module.exports=t():"function"==typeofdefine&&define.amd?define([],t):"object"==typeofexports?exports.Colyseus=t():e.Colyseus=t()}("undefined"!=typeofself?self:this,function(){returnfunction(e){functiont(r){if(n[r])returnn[r].exports;vari=n[r]={i:r,l:!1,exports:{}};returne[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}varn={};returnt.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){varn=e&&e.__esModule?function(){returne.default}:function(){returne};returnt.d(n,"a",n),n},t.o=function(e,t){returnObject.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=13)}([function(e,t,n){"use strict";functionr(e,t,n,r){vari,o=!1;switch(t){case"number":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":case"int64":case"uint64":case"float32":case"float64":i="number",isNaN(e)&&console.log('trying to encode "NaN" in '+n.constructor.name+"#"+r);break;case"string":i="string",o=!0;break;case"boolean":return}if(typeofe!==i&&(!o||o&&null!==e)){vars="'"+JSON.stringify(e)+"'"+(e&&e.constructor&&" ("+e.constructor.name+")");thrownewd("a '"+i+"' was expected, but "+s+" was provided in "+n.constructor.name+"#"+r)}}functioni(e,t,n,r){if(!(einstanceoft))thrownewd("a '"+t.name+"' was expected, but '"+e.constructor.name+"' was provided in "+n.constructor.name+"#"+r)}functiono(e,t,n,i,o){vars=u[e];returnvoid0===n?t.push(c.NIL):r(n,e,i,o),!!s&&(s(t,n),!0)}functions(e,t,n){varr=h[e];returnr?r(t,n):null}vara=this&&this.__extends||function(){vare=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,t){e.__proto__=t}||function(e,t){for(varnint)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};returnfunction(t,n){functionr(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,newr)}}();Object.defineProperty(t,"__esModule",{value:!0});varc=n(10),u=n(31),h=n(32),f=n(1),l=n(2),p=n(11),d=function(e){functiont(){returnnull!==e&&e.apply(this,arguments)||this}returna(t,e),t}(Error),v=function(){functione(){for(vare=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Object.defineProperties(this,{$changes:{value:newp.ChangeTree,enumerable:!1,writable:!0}});varn=this._descriptors;n&&Object.defineProperties(this,n)}returne.onError=function(e){console.error(e)},Object.defineProperty(e.prototype,"_schema",{get:function(){returnthis.constructor._schema},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_descriptors",{get:function(){returnthis.constructor._descriptors},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_indexes",{get:function(){returnthis.constructor._indexes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_filters",{get:function(){returnthis.constructor._filters},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"$changed",{get:function(){returnthis.$changes.changed},enumerable:!0,configurable:!0}),e.prototype.decode=function(t,n){void0===n&&(n={offset:0});varr=[],i=this._schema,o=this._indexes,a={};Object.keys(o).forEach(function(e){vart=o[e];a[t]=e});varu=t.length;t[n.offset]===c.TYPE_ID&&(n.offset+=2);for(varp=this;n.offset<u;){if("break"===function(){varo=t[n.offset++];if(o===c.END_OF_STRUCTURE)return"break";varu=a[o],d=i[u],v=void0,y=void0,g=!1;if(d._schema)h.nilCheck(t,n)?(n.offset++,v=null):(v=p["_"+u]||p.createTypeInstance(t,n,d),v.decode(t,n)),g=!0;elseif(Array.isArray(d)){d=d[0],y=[];var_=p["_"+u]||newf.ArraySchema;v=_.clone();varb=h.number(t,n),w=Math.min(h.number(t,n),b);g=w>0;varm=!1;v.length>b&&Array.prototype.splice.call(v,b).forEach(function(t,n){if(t&&t.onRemove)try{t.onRemove()}catch(t){e.onError(t)}if(_.onRemove)try{_.onRemove(t,b+n)}catch(t){e.onError(t)}});for(varC=0;C<w;C++){varO=h.number(t,n),S=void0;h.indexChangeCheck(t,n)&&(h.uint8(t,n),S=h.number(t,n),m=!0);varA=!m&&void0===v[O]||m&&void0===S;if(d.prototypeinstanceofe){vark=void0;if(k=A?p.createTypeInstance(t,n,d):void0!==S?_[S]:_[O],k||(k=p.createTypeInstance(t,n,d),A=!0),h.nilCheck(t,n)){if(n.offset++,_.onRemove)try{_.onRemove(k,O)}catch(t){e.onError(t)}continue}k.decode(t,n),v[O]=k}elsev[O]=s(d,t,n);if(A){if(_.onAdd)try{_.onAdd(v[O],O)}catch(t){e.onError(t)}}elseif(_.onChange)try{_.onChange(v[O],O)}catch(t){e.onError(t)}y.push(v[O])}}elseif(d.map){d=d.map;varI=p["_"+u]||newl.MapSchema;v=I.clone();varE=h.number(t,n);g=E>0;for(varm=!1,P=Object.keys(I),C=0;C<E&&(void0!==t[n.offset]&&t[n.offset]!==c.END_OF_STRUCTURE);C++){varx=void0;h.indexChangeCheck(t,n)&&(h.uint8(t,n),x=P[h.number(t,n)],m=!0);varM=h.numberCheck(t,n),R="string"!=typeofd,j=M?P[h.number(t,n)]:h.string(t,n),k=void0,A=!m&&void0===I[j]||m&&void0===x&&M;if(k=A&&R?p.createTypeInstance(t,n,d):void0!==x?I[x]:I[j],h.nilCheck(t,n)){if(n.offset++,k&&k.onRemove)try{k.onRemove()}catch(t){e.onError(t)}if(I.onRemove)try{I.onRemove(k,j)}catch(t){e.onError(t)}deletev[j]}elseif(R?(k.decode(t,n),v[j]=k):v[j]=s(d,t,n),A){if(I.onAdd)try{I.onAdd(v[j],j)}catch(t){e.onError(t)}}elseif(I.onChange)try{I.onChange(v[j],j)}catch(t){e.onError(t)}}}elsev=s(d,t,n),g=!0;g&&p.onChange&&r.push({field:u,value:y||v,previousValue:p["_"+u]}),p["_"+u]=v}())break}if(this.onChange&&r.length>0)try{this.onChange(r)}catch(t){e.onError(t)}returnthis},e.prototype.encode=function(e,t,n){varr=this;void0===e&&(e=this),void0===t&&(t=!1);vars=[],a=function(){r!==e&&s.push(c.END_OF_STRUCTURE)};if(!this.$changes.changed&&!t)returna(),s;for(varh=this._schema,p=this._indexes,d=this._filters,v=t||n?this.$changes.allChanges:this.$changes.changes,y=this,g=0,_=v.length;g<_;g++)!function(a,g){var_=v[a],b=h[_],w=d&&d[_],m=y["_"+_],C=p[_];if(void0===m)return"continue";varO=[];if(b._schema){if(n&&w&&!w.call(y,n,m,e))return"continue";u.number(O,C),m?(i(m,b,y,_),y.tryEncodeTypeId(O,b,m.constructor),O=O.concat(m.encode(e,t,n))):u.uint8(O,c.NIL)}elseif(Array.isArray(b)){u.number(O,C),u.number(O,m.length);varS=(t||n?m.$changes.allChanges:m.$changes.changes).filter(function(e){returnvoid0!==r["_"+_][e]}).sort(function(e,t){returne-t}),A=S.length;u.number(O,A);vark="string"!=typeofb[0];i(y["_"+_],f.ArraySchema,y,_);for(varI=0;I<A;I++){varE=S[I],P=y["_"+_][E];if(!n||!w||w.call(y,n,P,e))if(k){if(u.number(O,E),!t){varx=m.$changes.getIndexChange(P);void0!==x&&(u.uint8(O,c.INDEX_CHANGE),u.number(O,x))}i(P,b[0],y,_),y.tryEncodeTypeId(O,b[0],P.constructor),O=O.concat(P.encode(e,t,n))}elseif(u.number(O,E),!o(b[0],O,P,y,_)){console.log("cannot encode",h[_]);continue}}t||m.$changes.discard()}elseif(b.map){u.number(O,C);varM=t||n?m.$changes.allChanges:m.$changes.changes;u.number(O,M.length);varR=Object.keys(y["_"+_]),k="string"!=typeofb.map;i(y["_"+_],l.MapSchema,y,_);for(varj=0;j<M.length;j++){varT="number"==typeofM[j]&&R[M[j]]||M[j],P=y["_"+_][T],N=void0;if(!n||!w||w.call(y,n,P,e)){if(t){if(void0===P)continue}else{varx=m.$changes.getIndexChange(P);P&&void0!==x&&(u.uint8(O,c.INDEX_CHANGE),u.number(O,y["_"+_]._indexes.get(x))),N=y["_"+_]._indexes.get(T)}void0!==N?u.number(O,N):u.string(O,T),P&&k?(i(P,b.map,y,_),y.tryEncodeTypeId(O,b.map,P.constructor),O=O.concat(P.encode(e,t,n))):void0!==P?o(b.map,O,P,y,_):u.uint8(O,c.NIL)}}t||(m.$changes.discard(),n||y["_"+_]._updateIndexes())}else{if(n&&w&&!w.call(y,n,m,e))return"continue";if(u.number(O,C),!o(b,O,m,y,_))returnconsole.log("cannot encode",h[_]),"continue"}s=s.concat(O)}(g);returna(),t||n||this.$changes.discard(),s},e.prototype.encodeFiltered=function(e){returnthis.encode(this,!1,e)},e.prototype.encodeAll=function(){returnthis.encode(this,!0)},e.prototype.encodeAllFiltered=function(e){returnthis.encode(this,!0,e)},e.prototype.clone=function(){vare=newthis.constructor,t=this._schema;for(varnint)e[n]=this[n];returne},e.prototype.triggerAll=function(){if(this.onChange){vart=[],n=this._schema;for(varrinn)void0!==this[r]&&t.push({field:r,value:this[r],previousValue:void0});try{this.onChange(t)}catch(t){e.onError(t)}}},e.prototype.toJSON=function(){vare=this._schema,t={};for(varnine)void0!==this[n]&&(t[n]="function"==typeofthis[n].toJSON?this[n].toJSON():this["_"+n]);returnt},e.prototype.tryEncodeTypeId=function(e,t,n){t._typeid!==n._typeid&&(u.uint8(e,c.TYPE_ID),u.uint8(e,n._typeid))},e.prototype.createTypeInstance=function(e,t,n){if(e[t.offset]===c.TYPE_ID){t.offset++;returnnew(this.constructor._context.get(h.uint8(e,t)))}returnnewn},e}();t.Schema=v},function(e,t,n){"use strict";varr=this&&this.__extends||function(){vare=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,t){e.__proto__=t}||function(e,t){for(varnint)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};returnfunction(t,n){functionr(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,newr)}}();Object.defineProperty(t,"__esModule",{value:!0});vari=function(e){functiont(){for(varn=[],r=0;r<arguments.length;r++)n[r]=arguments[r];vari=e.apply(this,n)||this;returnObject.setPrototypeOf(i,Object.create(t.prototype)),Object.defineProperties(i,{$sorting:{value:void0,enumerable:!1,writable:!0},$changes:{value:void0,enumerable:!1,writable:!0},onAdd:{value:void0,enumerable:!1,writable:!0},onRemove:{value:void0,enumerable:!1,writable:!0},onChange:{value:void0,enumerable:!1,writable:!0},triggerAll:{value:function(){if(i.onAdd)for(vare=0;e<i.length;e++)i.onAdd(i[e],e)}},toJSON:{value:function(){for(vare=[],t=0;t<i.length;t++){varn=i[t];e.push("function"==typeofn.toJSON?n.toJSON():n)}returne}},clone:{value:function(){vare=new(t.bind.apply(t,[void0].concat(i)));returne.onAdd=i.onAdd,e.onRemove=i.onRemove,e.onChange=i.onChange,e}}}),i}returnr(t,e),t.prototype.sort=function(t){this.$sorting=!0,e.prototype.sort.call(this,t);for(varn=this.$changes.changes,r=0,i=n;r<i.length;r++){varo=i[r],s=this.$changes.getIndex(this[o]);void0!==s&&this.$changes.mapIndexChange(this[o],s),this.$changes.mapIndex(this[o],o)}returnthis.$sorting=!1,this},t.prototype.splice=function(e,t){for(varn=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];vari=Array.prototype.splice.apply(this,arguments),o=this.filter(function(n,r){returnr>=e+t-1});returni.map(function(e){e&&e.$changes&&(e.$changes.parent.deleteIndex(e),e.$changes.parent.deleteIndexChange(e),deletee.$changes.parent)}),o.forEach(function(e){e&&e.$changes&&e.$changes.parentField--}),i},t}(Array);t.ArraySchema=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=function(){functione(t){varn=this;void0===t&&(t={});for(varrint)this[r]=t[r];Object.defineProperties(this,{$changes:{value:void0,enumerable:!1,writable:!0},onAdd:{value:void0,enumerable:!1,writable:!0},onRemove:{value:void0,enumerable:!1,writable:!0},onChange:{value:void0,enumerable:!1,writable:!0},clone:{value:function(){vart=Object.assign(newe,n);returnt.onAdd=n.onAdd,t.onRemove=n.onRemove,t.onChange=n.onChange,t}},triggerAll:{value:function(){if(n.onAdd)for(vareinn)n.onAdd(n[e],e)}},toJSON:{value:function(){vare={};for(vartinn)e[t]="function"==typeofn[t].toJSON?n[t].toJSON():n[t];returne}},_indexes:{value:newMap,enumerable:!1,writable:!0},_updateIndexes:{value:function(){vare=0,t=newMap;for(varrinn)t.set(r,e++);n._indexes=t}}})}returne}();t.MapSchema=r},function(e,t,n){"use strict";varr=this&&this.__importDefault||function(e){returne&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});vari=r(n(16)),o=r(n(17));t.decode=i.default,t.encode=o.default},function(e,t,n){"use strict";functionr(e,t){t.headers=e.headers||{},t.statusMessage=e.statusText,t.statusCode=e.status,t.data=e.response}functioni(e,t,n){returnnewPromise(function(i,o){n=n||{};vars,a,c,u,h=newXMLHttpRequest,f=n.headers||{};h.timeout=n.timeout,h.ontimeout=h.onerror=function(e){e.timeout="timeout"==e.type,o(e)},h.open(e,t),h.onload=function(){for(u=h.getAllResponseHeaders().trim().split(/[\r\n]+/),r(h,h);c=u.shift();)c=c.split(": "),h.headers[c.shift().toLowerCase()]=c.join(": ");if((c=h.headers["content-type"])&&~c.indexOf("application/json"))try{h.data=JSON.parse(h.data,n.reviver)}catch(e){returnr(h,e),o(e)}(h.status>=400?o:i)(h)},(a=n.body)&&/Array|Object/.test(a.constructor)&&(f["content-type"]="application/json",a=JSON.stringify(a));for(sinf)h.setRequestHeader(s,f[s]);h.send(a)})}Object.defineProperty(t,"__esModule",{value:!0}),t.send=i,n.d(t,"get",function(){returno}),n.d(t,"post",function(){returns}),n.d(t,"patch",function(){returna}),n.d(t,"del",function(){returnc}),n.d(t,"put",function(){returnu});varo=i.bind(i,"GET"),s=i.bind(i,"POST"),a=i.bind(i,"PATCH"),c=i.bind(i,"DELETE"),u=i.bind(i,"PUT")},function(e,t,n){"use strict";varr=this&&this.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varnine)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);returnt.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});vari=r(n(3)),o=n(18),s=n(19),a=n(6),c=n(7),u=function(){functione(e,t){varn=this;this.onJoin=o.createSignal(),this.onStateChange=o.createSignal(),this.onMessage=o.createSignal(),this.onError=o.createSignal(),this.onLeave=o.createSignal(),this.id=null,this.name=e,t?(this.serializer=new(a.getSerializer("schema")),this.rootSchema=t,this.serializer.state=newt):this.serializer=new(a.getSerializer("fossil-delta")),this.onError(function(e){returnconsole.error(e)}),this.onLeave(function(){returnn.removeAllListeners()})}returne.prototype.connect=function(e){vart=this;this.connection=news.Connection(e,!1),this.connection.reconnectEnabled=!1,this.connection.onmessage=this.onMessageCallback.bind(this),this.connection.onclose=function(e){t.onLeave.invoke(e.code)},this.connection.onerror=function(e){console.warn("Room, onError ("+e.code+"): "+e.reason),t.onError.invoke(e.reason)},this.connection.open()},e.prototype.leave=function(e){void0===e&&(e=!0),this.connection?e?this.connection.send([c.Protocol.LEAVE_ROOM]):this.connection.close():this.onLeave.invoke(4e3)},e.prototype.send=function(e){this.connection.send([c.Protocol.ROOM_DATA,e])},Object.defineProperty(e.prototype,"state",{get:function(){returnthis.serializer.getState()},enumerable:!0,configurable:!0}),e.prototype.listen=function(e,t,n){return"schema"===this.serializerId?voidconsole.error("'"+this.serializerId+"' serializer doesn't support .listen() method."):(this.serializerId||console.warn("room.Listen() should be called after room.onJoin has been called (DEPRECATION WARNING)"),this.serializer.api.listen(e,t,n))},e.prototype.removeListener=function(e){returnthis.serializer.api.removeListener(e)},e.prototype.removeAllListeners=function(){this.serializer&&this.serializer.teardown(),this.onJoin.clear(),this.onStateChange.clear(),this.onMessage.clear(),this.onError.clear(),this.onLeave.clear()},e.prototype.onMessageCallback=function(e){if(this.previousCode)this.previousCode===c.Protocol.ROOM_STATE?this.setState(Array.from(newUint8Array(e.data))):this.previousCode===c.Protocol.ROOM_STATE_PATCH?this.patch(Array.from(newUint8Array(e.data))):this.previousCode===c.Protocol.ROOM_DATA&&this.onMessage.invoke(i.decode(e.data)),this.previousCode=void0;else{vart=newDataView(e.data),n=t.getUint8(0);if(n===c.Protocol.JOIN_ROOM){varr=1;this.serializerId=c.utf8Read(t,r),r+=c.utf8Length(this.serializerId);varo=a.getSerializer(this.serializerId);if(!o)thrownewError("missing serializer: "+this.serializerId);if("fossil-delta"===this.serializerId||this.rootSchema||(this.serializer=newo),t.buffer.byteLength>r&&this.serializer.handshake){vars=Array.from(newUint8Array(t.buffer.slice(r)));this.serializer.handshake(s)}this.onJoin.invoke()}elsen===c.Protocol.JOIN_ERROR?this.onError.invoke(c.utf8Read(t,1)):n===c.Protocol.LEAVE_ROOM?this.leave():this.previousCode=n}},e.prototype.setState=function(e){this.serializer.setState(e),this.onStateChange.invoke(this.serializer.getState())},e.prototype.patch=function(e){this.serializer.patch(e),this.onStateChange.invoke(this.serializer.getState())},e}();t.Room=u},function(e,t,n){"use strict";functionr(e,t){o[e]=t}functioni(e){returno[e]}Object.defineProperty(t,"__esModule",{value:!0});varo={};t.registerSerializer=r,t.getSerializer=i},function(e,t,n){"use strict";functionr(e,t){for(varn=e.getUint8(t++),r="",i=0,o=t,s=t+n;o<s;o++){vara=e.getUint8(o);if(0!=(128&a))if(192!=(224&a))if(224!=(240&a)){if(240!=(248&a))thrownewError("Invalid byte "+a.toString(16));i=(7&a)<<18|(63&e.getUint8(++o))<<12|(63&e.getUint8(++o))<<6|(63&e.getUint8(++o))<<0,i>=65536?(i-=65536,r+=String.fromCharCode(55296+(i>>>10),56320+(1023&i))):r+=String.fromCharCode(i)}elser+=String.fromCharCode((15&a)<<12|(63&e.getUint8(++o))<<6|(63&e.getUint8(++o))<<0);elser+=String.fromCharCode((31&a)<<6|63&e.getUint8(++o));elser+=String.fromCharCode(a)}returnr}functioni(e){void0===e&&(e="");for(vart=0,n=0,r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);returnn+1}Object.defineProperty(t,"__esModule",{value:!0});!function(e){e[e.JOIN_ROOM=10]="JOIN_ROOM",e[e.JOIN_ERROR=11]="JOIN_ERROR",e[e.LEAVE_ROOM=12]="LEAVE_ROOM",e[e.ROOM_DATA=13]="ROOM_DATA",e[e.ROOM_STATE=14]="ROOM_STATE",e[e.ROOM_STATE_PATCH=15]="ROOM_STATE_PATCH"}(t.Protocol||(t.Protocol={})),t.utf8Read=r,t.utf8Length=i},function(e,t,n){"use strict";varr=this&&this.__awaiter||function(e,t,n,r){returnnew(n||(n=Promise))(function(i,o){functions(e){try{c(r.next(e))}catch(e){o(e)}}functiona(e){try{c(r.throw(e))}catch(e){o(e)}}functionc(e){e.done?i(e.value):newn(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){functionn(e){returnfunction(t){returnr([e,t])}}functionr(n){if(i)thrownewTypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)returns;switch(o=0,s&&(n=[2&n[0],s.value]),n[0]){case0:case1:s=n;break;case4:returnc.label++,{value:n[1],done:!1};case5:c.label++,o=n[1],n=[0];continue;case7:n=c.ops.pop(),c.trys.pop();continue;default:if(s=c.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){c.label=n[1];break}if(6===n[0]&&c.label<s[1]){c.label=s[1],s=n;break}if(s&&c.label<s[2]){c.label=s[2],c.ops.push(n);break}s[2]&&c.ops.pop(),c.trys.pop();continue}n=t.call(e,c)}catch(e){n=[6,e],o=0}finally{i=s=0}if(5&n[0])thrown[1];return{value:n[0]?n[1]:void0,done:!0}}vari,o,s,a,c={label:0,sent:function(){if(1&s[0])throws[1];returns[1]},trys:[],ops:[]};returna={next:n(0),throw:n(1),return:n(2)},"function"==typeofSymbol&&(a[Symbol.iterator]=function(){returnthis}),a},o=this&&this.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varnine)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);returnt.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});vars=o(n(4)),a=n(23),c="colyseus-auth-token";!function(e){e.ios="ios",e.android="android"}(t.Platform||(t.Platform={}));varu=function(){functione(e){vart=this;this._id=void0,this.username=void0,this.displayName=void0,this.avatarUrl=void0,this.isAnonymous=void0,this.email=void0,this.lang=void0,this.location=void0,this.timezone=void0,this.metadata=void0,this.devices=void0,this.facebookId=void0,this.twitterId=void0,this.googleId=void0,this.gameCenterId=void0,this.steamId=void0,this.friendIds=void0,this.blockedUserIds=void0,this.createdAt=void0,this.updatedAt=void0,this.token=void0,this.endpoint=e.replace("ws","http"),a.getItem(c,function(e){returnt.token=e})}returnObject.defineProperty(e.prototype,"hasToken",{get:function(){return!!this.token},enumerable:!0,configurable:!0}),e.prototype.login=function(e){returnvoid0===e&&(e={}),r(this,void0,void0,function(){vart,n,r;returni(this,function(i){switch(i.label){case0:returnt=Object.assign({},e),this.hasToken&&(t.token=this.token),[4,this.request("post","/auth",t)];case1:n=i.sent(),this.token=n.token,a.setItem(c,this.token);for(rinn)this.hasOwnProperty(r)&&(this[r]=n[r]);returnthis.registerPingService(),[2,this]}})})},e.prototype.save=function(){returnr(this,void0,void0,function(){returni(this,function(e){switch(e.label){case0:return[4,this.request("put","/auth",{},{username:this.username,displayName:this.displayName,avatarUrl:this.avatarUrl,lang:this.lang,location:this.location,timezone:this.timezone})];case1:returne.sent(),[2,this]}})})},e.prototype.getFriends=function(){returnr(this,void0,void0,function(){returni(this,function(e){switch(e.label){case0:return[4,this.request("get","/friends/all")];case1:return[2,e.sent()]}})})},e.prototype.getOnlineFriends=function(){returnr(this,void0,void0,function(){returni(this,function(e){switch(e.label){case0:return[4,this.request("get","/friends/online")];case1:return[2,e.sent()]}})})},e.prototype.getFriendRequests=function(){returnr(this,void0,void0,function(){returni(this,function(e){switch(e.label){case0:return[4,this.request("get","/friends/requests")];case1:return[2,e.sent()]}})})},e.prototype.sendFriendRequest=function(e){returnr(this,void0,void0,function(){returni(this,function(t){switch(t.label){case0:return[4,this.request("post","/friends/requests",{userId:e})];case1:return[2,t.sent()]}})})},e.prototype.acceptFriendRequest=function(e){returnr(this,void0,void0,function(){returni(this,function(t){switch(t.label){case0:return[4,this.request("put","/friends/requests",{userId:e})];case1:return[2,t.sent()]}})})},e.prototype.declineFriendRequest=function(e){returnr(this,void0,void0,function(){returni(this,function(t){switch(t.label){case0:return[4,this.request("del","/friends/requests",{userId:e})];case1:return[2,t.sent()]}})})},e.prototype.blockUser=function(e){returnr(this,void0,void0,function(){returni(this,function(t){switch(t.label){case0:return[4,this.request("post","/friends/block",{userId:e})];case1:return[2,t.sent()]}})})},e.prototype.unblockUser=function(e){returnr(this,void0,void0,function(){returni(this,function(t){switch(t.label){case0:return[4,this.request("put","/friends/block",{userId:e})];case1:return[2,t.sent()]}})})},e.prototype.request=function(e,t,n,o,a){returnvoid0===n&&(n={}),void0===a&&(a={}),r(this,void0,void0,function(){varr,c,u,h;returni(this,function(i){switch(i.label){case0:a.Accept="application/json",this.hasToken&&(a.Authorization="Bearer "+this.token),r=[];for(cinn)r.push(c+"="+n[c]);returnu=r.length>0?"?"+r.join("&"):"",h={headers:a},o&&(h.body=o),[4,s[e](""+this.endpoint+t+u,h)];case1:return[2,i.sent().data]}})})},e.prototype.logout=function(){this.token=void0,a.removeItem(c),this.unregisterPingService()},e.prototype.registerPingService=function(e){vart=this;void0===e&&(e=15e3),this.unregisterPingService(),this.keepOnlineInterval=setInterval(function(){returnt.request("get","/auth")},e)},e.prototype.unregisterPingService=function(){clearInterval(this.keepOnlineInterval)},e}();t.Auth=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=n(0);t.Schema=r.Schema;vari=n(2);t.MapSchema=i.MapSchema;varo=n(1);t.ArraySchema=o.ArraySchema;vars=n(33);t.Reflection=s.Reflection,t.ReflectionType=s.ReflectionType,t.ReflectionField=s.ReflectionField;vara=n(12);t.type=a.type,t.filter=a.filter,t.defineTypes=a.defineTypes,t.Context=a.Context},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.END_OF_STRUCTURE=193,t.NIL=192,t.INDEX_CHANGE=212,t.TYPE_ID=213},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=n(0),i=n(1),o=n(2),s=function(){functione(e,t,n){void0===e&&(e=null),void0===n&&(n=!1),this.changed=!1,this.changes=[],this.allChanges=[],this.linkedTrees=[],this.parent=t,this.parentField=e,this.trackAllChanges=n}returne.prototype.link=function(e){this.linkedTrees.push(e)},e.prototype.change=function(e,t){void0===t&&(t=!1),this.changed=!0,-1===this.changes.indexOf(e)&&this.changes.push(e);varn=this.allChanges.indexOf(e);t||-1!==n?t&&n>=0&&this.allChanges.splice(n,1):this.allChanges.push(e),this.parent&&this.parent.change(this.parentField)},e.prototype.mapIndex=function(e,t){this.indexMap||(this.indexMap=newMap,this.indexChange=newMap),this.indexMap.set(e,t)},e.prototype.getIndex=function(e){returnthis.indexMap&&this.indexMap.get(e)},e.prototype.deleteIndex=function(e){this.indexMap.delete(e)},e.prototype.mapIndexChange=function(e,t){this.indexChange.set(e,t)},e.prototype.getIndexChange=function(e){returnthis.indexChange&&this.indexChange.get(e)},e.prototype.deleteIndexChange=function(e){this.indexChange.delete(e)},e.prototype.changeAll=function(e){if(einstanceofr.Schema){vart=e._schema;for(varnint)(e[n]instanceofr.Schema||e[n]instanceofi.ArraySchema||e[n]instanceofo.MapSchema)&&!e[n].$changes.parent.parent&&(e[n].$changes.parent=this),this.change(n)}elsefor(vars=Object.keys(e),a=0,c=s;a<c.length;a++){varu=c[a];this.change(u)}},e.prototype.discard=function(){this.changed=!1,this.changes=[],this.indexChange&&this.indexChange.clear()},e}();t.ChangeTree=s},function(e,t,n){"use strict";functionr(e,n){returnvoid0===n&&(n=t.globalContext),function(t,r){vari=t.constructor;i._context=n,n.has(i)||(n.add(i),i._schema=Object.assign({},i._schema||{}),i._indexes=Object.assign({},i._indexes||{}),i._descriptors=Object.assign({},i._descriptors||{})),i._indexes[r]=Object.keys(i._schema).length,i._schema[r]=e;varo=Array.isArray(e),c=!o&&e.map,u="_"+r;i._descriptors[u]={enumerable:!1,configurable:!1,writable:!0},i._descriptors[r]={get:function(){returnthis[u]},set:function(e){if((o||c)&&(e=newProxy(e,{get:function(e,t){returne[t]},set:function(e,t,n){if("length"!==t&&0!==t.indexOf("$")){varr=o?Number(t):String(t);if(!e.$sorting){vari=e.$changes.getIndex(n);void0!==i&&e.$changes.mapIndexChange(n,i),e.$changes.mapIndex(n,r)}ninstanceofa.Schema?n.$changes.parent||(n.$changes=news.ChangeTree(r,e.$changes),n.$changes.changeAll(n)):e[t]=n,e.$changes.change(r)}elsee[t];returne[t]=n,!0},deleteProperty:function(e,t){varn=e[t];c&&void0!==n&&(e.$changes.deleteIndex(n),e.$changes.deleteIndexChange(n),n.$changes&&deleten.$changes.parent,e._indexes.delete(t)),deletee[t];varr=o?Number(t):String(t);returne.$changes.change(r,!0),!0}})),e!==this[u])if(this[u]=e,Array.isArray(i._schema[r])){this.$changes.change(r),e.$changes=news.ChangeTree(r,this.$changes);for(vart=0;t<e.length;t++)e[t]instanceofa.Schema&&(e[t].$changes=news.ChangeTree(t,e.$changes),e[t].$changes.changeAll(e[t])),e.$changes.mapIndex(e[t],t),e.$changes.change(t)}elseif(i._schema[r].map){e.$changes=news.ChangeTree(r,this.$changes),this.$changes.change(r);for(varnine)e[n]instanceofa.Schema&&(e[n].$changes=news.ChangeTree(n,e.$changes),e[n].$changes.changeAll(e[n])),e.$changes.mapIndex(e[n],n),e.$changes.change(n)}else"function"==typeofi._schema[r]?(this.$changes.change(r),e&&(e.$changes=news.ChangeTree(r,this.$changes),e.$changes.changeAll(e))):this.$changes.change(r)},enumerable:!0,configurable:!0}}}functioni(e){returnfunction(t,n){varr=t.constructor;r._filters||(r._filters={}),r._filters[n]=e}}functiono(e,t){for(varnint)r(t[n])(e.prototype,n);returne}Object.defineProperty(t,"__esModule",{value:!0});vars=n(11),a=n(0),c=function(){functione(){this.types={},this.schemas=newMap}returne.prototype.has=function(e){returnthis.schemas.has(e)},e.prototype.get=function(e){returnthis.types[e]},e.prototype.add=function(e){e._typeid=this.schemas.size,this.types[e._typeid]=e,this.schemas.set(e,e._typeid)},e}();t.Context=c,t.globalContext=newc,t.type=r,t.filter=i,t.defineTypes=o},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(14);varr=n(15);t.Client=r.Client;vari=n(7);t.Protocol=i.Protocol;varo=n(5);t.Room=o.Room;vars=n(8);t.Auth=s.Auth,t.Platform=s.Platform;vara=n(25);t.FossilDeltaSerializer=a.FossilDeltaSerializer;varc=n(30);t.SchemaSerializer=c.SchemaSerializer;varu=n(6);t.registerSerializer=u.registerSerializer;varh=n(9);t.Schema=h.Schema,t.type=h.type,u.registerSerializer("fossil-delta",a.FossilDeltaSerializer),u.registerSerializer("schema",c.SchemaSerializer)},function(e,t){ArrayBuffer.isView||(ArrayBuffer.isView=function(e){returnnull!==e&&"object"==typeofe&&e.bufferinstanceofArrayBuffer})},function(e,t,n){"use strict";varr=this&&this.__extends||function(){vare=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,t){e.__proto__=t}||function(e,t){for(varnint)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};returnfunction(t,n){functionr(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,newr)}}(),i=this&&this.__awaiter||function(e,t,n,r){returnnew(n||(n=Promise))(function(i,o){functions(e){try{c(r.next(e))}catch(e){o(e)}}functiona(e){try{c(r.throw(e))}catch(e){o(e)}}functionc(e){e.done?i(e.value):newn(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){functionn(e){returnfunction(t){returnr([e,t])}}functionr(n){if(i)thrownewTypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)returns;switch(o=0,s&&(n=[2&n[0],s.value]),n[0]){case0:case1:s=n;break;case4:returnc.label++,{value:n[1],done:!1};case5:c.label++,o=n[1],n=[0];continue;case7:n=c.ops.pop(),c.trys.pop();continue;default:if(s=c.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){c.label=n[1];break}if(6===n[0]&&c.label<s[1]){c.label=s[1],s=n;break}if(s&&c.label<s[2]){c.label=s[2],c.ops.push(n);break}s[2]&&c.ops.pop(),c.trys.pop();continue}n=t.call(e,c)}catch(e){n=[6,e],o=0}finally{i=s=0}if(5&n[0])thrown[1];return{value:n[0]?n[1]:void0,done:!0}}vari,o,s,a,c={label:0,sent:function(){if(1&s[0])throws[1];returns[1]},trys:[],ops:[]};returna={next:n(0),throw:n(1),return:n(2)},"function"==typeofSymbol&&(a[Symbol.iterator]=function(){returnthis}),a};Object.defineProperty(t,"__esModule",{value:!0});vars=n(4),a=n(5),c=n(8),u=n(24),h=function(e){functiont(n,r){vari=e.call(this,n)||this;returni.code=r,Object.setPrototypeOf(i,t.prototype),i}returnr(t,e),t}(Error);t.MatchMakeError=h;varf=function(){functione(e){void0===e&&(e=location.protocol.replace("http","ws")+"//"+location.hostname+(location.port&&":"+location.port)),this.endpoint=e,this.auth=newc.Auth(this.endpoint),this.push=newu.Push(this.endpoint)}returne.prototype.joinOrCreate=function(e,t,n){returnvoid0===t&&(t={}),i(this,void0,void0,function(){returno(this,function(r){switch(r.label){case0:return[4,this.createMatchMakeRequest("joinOrCreate",e,t,n)];case1:return[2,r.sent()]}})})},e.prototype.create=function(e,t,n){returnvoid0===t&&(t={}),i(this,void0,void0,function(){returno(this,function(r){switch(r.label){case0:return[4,this.createMatchMakeRequest("create",e,t,n)];case1:return[2,r.sent()]}})})},e.prototype.join=function(e,t,n){returnvoid0===t&&(t={}),i(this,void0,void0,function(){returno(this,function(r){switch(r.label){case0:return[4,this.createMatchMakeRequest("join",e,t,n)];case1:return[2,r.sent()]}})})},e.prototype.joinById=function(e,t,n){returnvoid0===t&&(t={}),i(this,void0,void0,function(){returno(this,function(r){switch(r.label){case0:return[4,this.createMatchMakeRequest("joinById",e,t,n)];case1:return[2,r.sent()]}})})},e.prototype.reconnect=function(e,t,n){returni(this,void0,void0,function(){returno(this,function(r){switch(r.label){case0:return[4,this.createMatchMakeRequest("joinById",e,{sessionId:t},n)];case1:return[2,r.sent()]}})})},e.prototype.getAvailableRooms=function(e){returnvoid0===e&&(e=""),i(this,void0,void0,function(){vart;returno(this,function(n){switch(n.label){case0:returnt=this.endpoint.replace("ws","http")+"/matchmake/"+e,[4,s.get(t,{headers:{Accept:"application/json"}})];case1:return[2,n.sent().data]}})})},e.prototype.createMatchMakeRequest=function(e,t,n,r){returnvoid0===n&&(n={}),i(this,void0,void0,function(){vari,a,c;returno(this,function(o){switch(o.label){case0:returni=this.endpoint.replace("ws","http")+"/matchmake/"+e+"/"+t,this.auth.hasToken&&(n.token=this.auth.token),[4,s.post(i,{headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(n)})];case1:if(a=o.sent().data,a.error)thrownewh(a.error,a.code);returnc=this.createRoom(t,r),c.id=a.room.roomId,c.sessionId=a.sessionId,c.connect(this.buildEndpoint(a.room,{sessionId:c.sessionId})),[2,newPromise(function(e,t){varn=function(e){returnt(e)};c.onError.once(n),c.onJoin.once(function(){c.onError.remove(n),e(c)})})]}})})},e.prototype.createRoom=function(e,t){returnnewa.Room(e,t)},e.prototype.buildEndpoint=function(e,t){void0===t&&(t={});varn=[];for(varrint)t.hasOwnProperty(r)&&n.push(r+"="+t[r]);returnthis.endpoint+"/"+e.processId+"/"+e.roomId+"?"+n.join("&")},e}();t.Client=f},function(e,t,n){"use strict";functionr(e){if(this._offset=0,einstanceofArrayBuffer)this._buffer=e,this._view=newDataView(this._buffer);else{if(!ArrayBuffer.isView(e))thrownewError("Invalid argument");this._buffer=e.buffer,this._view=newDataView(this._buffer,e.byteOffset,e.byteLength)}}functioni(e,t,n){for(varr="",i=0,o=t,s=t+n;o<s;o++){vara=e.getUint8(o);if(0!=(128&a))if(192!=(224&a))if(224!=(240&a)){if(240!=(248&a))thrownewError("Invalid byte "+a.toString(16));i=(7&a)<<18|(63&e.getUint8(++o))<<12|(63&e.getUint8(++o))<<6|(63&e.getUint8(++o))<<0,i>=65536?(i-=65536,r+=String.fromCharCode(55296+(i>>>10),56320+(1023&i))):r+=String.fromCharCode(i)}elser+=String.fromCharCode((15&a)<<12|(63&e.getUint8(++o))<<6|(63&e.getUint8(++o))<<0);elser+=String.fromCharCode((31&a)<<6|63&e.getUint8(++o));elser+=String.fromCharCode(a)}returnr}functiono(e){vart=newr(e),n=t._parse();if(t._offset!==e.byteLength)thrownewError(e.byteLength-t._offset+" trailing bytes");returnn}r.prototype._array=function(e){for(vart=newArray(e),n=0;n<e;n++)t[n]=this._parse();returnt},r.prototype._map=function(e){for(vart="",n={},r=0;r<e;r++)t=this._parse(),n[t]=this._parse();returnn},r.prototype._str=function(e){vart=i(this._view,this._offset,e);returnthis._offset+=e,t},r.prototype._bin=function(e){vart=this._buffer.slice(this._offset,this._offset+e);returnthis._offset+=e,t},r.prototype._parse=function(){vare,t=this._view.getUint8(this._offset++),n=0,r=0,i=0,o=0;if(t<192)returnt<128?t:t<144?this._map(15&t):t<160?this._array(15&t):this._str(31&t);if(t>223)return-1*(255-t+1);switch(t){case192:returnnull;case194:return!1;case195:return!0;case196:returnn=this._view.getUint8(this._offset),this._offset+=1,this._bin(n);case197:returnn=this._view.getUint16(this._offset),this._offset+=2,this._bin(n);case198:returnn=this._view.getUint32(this._offset),this._offset+=4,this._bin(n);case199:returnn=this._view.getUint8(this._offset),r=this._view.getInt8(this._offset+1),this._offset+=2,[r,this._bin(n)];case200:returnn=this._view.getUint16(this._offset),r=this._view.getInt8(this._offset+2),this._offset+=3,[r,this._bin(n)];case201:returnn=this._view.getUint32(this._offset),r=this._view.getInt8(this._offset+4),this._offset+=5,[r,this._bin(n)];case202:returne=this._view.getFloat32(this._offset),this._offset+=4,e;case203:returne=this._view.getFloat64(this._offset),this._offset+=8,e;case204:returne=this._view.getUint8(this._offset),this._offset+=1,e;case205:returne=this._view.getUint16(this._offset),this._offset+=2,e;case206:returne=this._view.getUint32(this._offset),this._offset+=4,e;case207:returni=this._view.getUint32(this._offset)*Math.pow(2,32),o=this._view.getUint32(this._offset+4),this._offset+=8,i+o;case208:returne=this._view.getInt8(this._offset),this._offset+=1,e;case209:returne=this._view.getInt16(this._offset),this._offset+=2,e;case210:returne=this._view.getInt32(this._offset),this._offset+=4,e;case211:returni=this._view.getInt32(this._offset)*Math.pow(2,32),o=this._view.getUint32(this._offset+4),this._offset+=8,i+o;case212:returnr=this._view.getInt8(this._offset),this._offset+=1,0===r?void(this._offset+=1):[r,this._bin(1)];case213:returnr=this._view.getInt8(this._offset),this._offset+=1,[r,this._bin(2)];case214:returnr=this._view.getInt8(this._offset),this._offset+=1,[r,this._bin(4)];case215:returnr=this._view.getInt8(this._offset),this._offset+=1,0===r?(i=this._view.getInt32(this._offset)*Math.pow(2,32),o=this._view.getUint32(this._offset+4),this._offset+=8,newDate(i+o)):[r,this._bin(8)];case216:returnr=this._view.getInt8(this._offset),this._offset+=1,[r,this._bin(16)];case217:returnn=this._view.getUint8(this._offset),this._offset+=1,this._str(n);case218:returnn=this._view.getUint16(this._offset),this._offset+=2,this._str(n);case219:returnn=this._view.getUint32(this._offset),this._offset+=4,this._str(n);case220:returnn=this._view.getUint16(this._offset),this._offset+=2,this._array(n);case221:returnn=this._view.getUint32(this._offset),this._offset+=4,this._array(n);case222:returnn=this._view.getUint16(this._offset),this._offset+=2,this._map(n);case223:returnn=this._view.getUint32(this._offset),this._offset+=4,this._map(n)}thrownewError("Could not parse")},e.exports=o},function(e,t,n){"use strict";functionr(e,t,n){for(varr=0,i=0,o=n.length;i<o;i++)r=n.charCodeAt(i),r<128?e.setUint8(t++,r):r<2048?(e.setUint8(t++,192|r>>6),e.setUint8(t++,128|63&r)):r<55296||r>=57344?(e.setUint8(t++,224|r>>12),e.setUint8(t++,128|r>>6&63),e.setUint8(t++,128|63&r)):(i++,r=65536+((1023&r)<<10|1023&n.charCodeAt(i)),e.setUint8(t++,240|r>>18),e.setUint8(t++,128|r>>12&63),e.setUint8(t++,128|r>>6&63),e.setUint8(t++,128|63&r))}functioni(e){for(vart=0,n=0,r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);returnn}functiono(e,t,n){varr=typeofn,s=0,a=0,c=0,u=0,h=0,f=0;if("string"===r){if((h=i(n))<32)e.push(160|h),f=1;elseif(h<256)e.push(217,h),f=2;elseif(h<65536)e.push(218,h>>8,h),f=3;else{if(!(h<4294967296))thrownewError("String too long");e.push(219,h>>24,h>>16,h>>8,h),f=5}returnt.push({_str:n,_length:h,_offset:e.length}),f+h}if("number"===r)returnMath.floor(n)===n&&isFinite(n)?n>=0?n<128?(e.push(n),1):n<256?(e.push(204,n),2):n<65536?(e.push(205,n>>8,n),3):n<4294967296?(e.push(206,n>>24,n>>16,n>>8,n),5):(c=n/Math.pow(2,32)>>0,u=n>>>0,e.push(207,c>>24,c>>16,c>>8,c,u>>24,u>>16,u>>8,u),9):n>=-32?(e.push(n),1):n>=-128?(e.push(208,n),2):n>=-32768?(e.push(209,n>>8,n),3):n>=-2147483648?(e.push(210,n>>24,n>>16,n>>8,n),5):(c=Math.floor(n/Math.pow(2,32)),u=n>>>0,e.push(211,c>>24,c>>16,c>>8,c,u>>24,u>>16,u>>8,u),9):(e.push(203),t.push({_float:n,_length:8,_offset:e.length}),9);if("object"===r){if(null===n)returne.push(192),1;if(Array.isArray(n)){if((h=n.length)<16)e.push(144|h),f=1;elseif(h<65536)e.push(220,h>>8,h),f=3;else{if(!(h<4294967296))thrownewError("Array too large");e.push(221,h>>24,h>>16,h>>8,h),f=5}for(s=0;s<h;s++)f+=o(e,t,n[s]);returnf}if(ninstanceofDate){varl=n.getTime();returnc=Math.floor(l/Math.pow(2,32)),u=l>>>0,e.push(215,0,c>>24,c>>16,c>>8,c,u>>24,u>>16,u>>8,u),10}if(ninstanceofArrayBuffer){if((h=n.byteLength)<256)e.push(196,h),f=2;elseif(h<65536)e.push(197,h>>8,h),f=3;else{if(!(h<4294967296))thrownewError("Buffer too large");e.push(198,h>>24,h>>16,h>>8,h),f=5}returnt.push({_bin:n,_length:h,_offset:e.length}),f+h}if("function"==typeofn.toJSON)returno(e,t,n.toJSON());varp=[],d="",v=Object.keys(n);for(s=0,a=v.length;s<a;s++)d=v[s],"function"!=typeofn[d]&&p.push(d);if((h=p.length)<16)e.push(128|h),f=1;elseif(h<65536)e.push(222,h>>8,h),f=3;else{if(!(h<4294967296))thrownewError("Object too large");e.push(223,h>>24,h>>16,h>>8,h),f=5}for(s=0;s<h;s++)d=p[s],f+=o(e,t,d),f+=o(e,t,n[d]);returnf}if("boolean"===r)returne.push(n?195:194),1;if("undefined"===r)returne.push(212,0,0),3;thrownewError("Could not encode")}functions(e){vart=[],n=[],i=o(t,n,e),s=newArrayBuffer(i),a=newDataView(s),c=0,u=0,h=-1;n.length>0&&(h=n[0]._offset);for(varf,l=0,p=0,d=0,v=t.length;d<v;d++)if(a.setUint8(u+d,t[d]),d+1===h){if(f=n[c],l=f._length,p=u+h,f._bin)for(vary=newUint8Array(f._bin),g=0;g<l;g++)a.setUint8(p+g,y[g]);elsef._str?r(a,p,f._str):void0!==f._float&&a.setFloat64(p,f._float);c++,u+=l,n[c]&&(h=n[c]._offset)}returns}e.exports=s},function(e,t,n){"use strict";functionr(){functione(e){returnt.register(e,null===this)}vart=newi;returne.once=function(e){varn=function(){for(varr=[],i=0;i<arguments.length;i++)r[i]=arguments[i];e.apply(void0,r),t.remove(n)};t.register(n)},e.remove=function(e){returnt.remove(e)},e.invoke=function(){for(vare=[],n=0;n<arguments.length;n++)e[n]=arguments[n];returnt.invoke.apply(t,e)},e.clear=function(){returnt.clear()},e}Object.defineProperty(t,"__esModule",{value:!0});vari=function(){functione(){this.handlers=[]}returne.prototype.register=function(e,t){returnvoid0===t&&(t=!1),this.handlers.push(e),this},e.prototype.invoke=function(){for(vare=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.handlers.forEach(function(t){returnt.apply(void0,e)})},e.prototype.remove=function(e){vart=this.handlers.indexOf(e);this.handlers[t]=this.handlers[this.handlers.length-1],this.handlers.pop()},e.prototype.clear=function(){this.handlers=[]},e}();t.EventEmitter=i,t.createSignal=r},function(e,t,n){"use strict";varr=this&&this.__extends||function(){vare=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,t){e.__proto__=t}||function(e,t){for(varnint)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};returnfunction(t,n){functionr(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,newr)}}(),i=this&&this.__importDefault||function(e){returne&&e.__esModule?e:{default:e}},o=this&&this.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varnine)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);returnt.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});vars=i(n(20)),a=o(n(3)),c=function(e){functiont(t,n){void0===n&&(n=!0);varr=e.call(this,t,void0,{connect:n})||this;returnr._enqueuedCalls=[],r}returnr(t,e),t.prototype.onOpenCallback=function(t){if(e.prototype.onOpenCallback.call(this),this.binaryType="arraybuffer",this._enqueuedCalls.length>0){for(varn=0,r=this._enqueuedCalls;n<r.length;n++){vari=r[n],o=i[0],s=i[1];this[o].apply(this,s)}this._enqueuedCalls=[]}},t.prototype.send=function(t){if(this.ws.readyState===s.default.OPEN)returne.prototype.send.call(this,a.encode(t));this._enqueuedCalls.push(["send",[t]])},t}(s.default);t.Connection=c},function(e,t,n){"use strict";functionr(e,t){if(!(einstanceoft))thrownewTypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});vari=function(){functione(e,t){for(varn=0;n<t.length;n++){varr=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"inr&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}returnfunction(t,n,r){returnn&&e(t.prototype,n),r&&e(t,r),t}}(),o=n(21).createBackoff,s="undefined"!=typeofWebSocket?WebSocket:n(22),a=function(){functione(t,n){vari=arguments.length>2&&void0!==arguments[2]?arguments[2]:{};r(this,e),this.url=t,this.protocols=n,this.reconnectEnabled=!0,this.listeners={},this.backoff=o(i.backoff||"exponential",i),this.backoff.onReady=this.onBackoffReady.bind(this),(void0===i.connect||i.connect)&&this.open()}returni(e,[{key:"open",value:function(){vare=arguments.length>0&&void0!==arguments[0]&&arguments[0];this.isReconnect=e;vart=this.ws&&this.ws.binaryType;this.ws=news(this.url,this.protocols),this.ws.onclose=this.onCloseCallback.bind(this),this.ws.onerror=this.onErrorCallback.bind(this),this.ws.onmessage=this.onMessageCallback.bind(this),this.ws.onopen=this.onOpenCallback.bind(this),t&&(this.ws.binaryType=t)}},{key:"onBackoffReady",value:function(e,t){this.open(!0)}},{key:"onCloseCallback",value:function(e){!this.isReconnect&&this.listeners.onclose&&this.listeners.onclose.apply(null,arguments),this.reconnectEnabled&&e.code<3e3&&this.backoff.backoff()}},{key:"onErrorCallback",value:function(){this.listeners.onerror&&this.listeners.onerror.apply(null,arguments)}},{key:"onMessageCallback",value:function(){this.listeners.onmessage&&this.listeners.onmessage.apply(null,arguments)}},{key:"onOpenCallback",value:function(){this.listeners.onopen&&this.listeners.onopen.apply(null,arguments),this.isReconnect&&this.listeners.onreconnect&&this.listeners.onreconnect.apply(null,arguments),this.isReconnect=!1}},{key:"close",value:function(e,t){void0===e&&(e=1e3),this.reconnectEnabled=!1,this.ws.close(e,t)}},{key:"send",value:function(e){this.ws.send(e)}},{key:"bufferedAmount",get:function(){returnthis.ws.bufferedAmount}},{key:"readyState",get:function(){returnthis.ws.readyState}},{key:"binaryType",get:function(){returnthis.ws.binaryType},set:function(e){this.ws.binaryType=e}},{key:"extensions",get:function(){returnthis.ws.extensions},set:function(e){this.ws.extensions=e}},{key:"protocol",get:function(){returnthis.ws.protocol},set:function(e){this.ws.protocol=e}},{key:"onclose",set:function(e){this.listeners.onclose=e},get:function(){returnthis.listeners.onclose}},{key:"onerror",set:function(e){this.listeners.onerror=e},get:function(){returnthis.listeners.onerror}},{key:"onmessage",set:function(e){this.listeners.onmessage=e},get:function(){returnthis.listeners.onmessage}},{key:"onopen",set:function(e){this.listeners.onopen=e},get:function(){returnthis.listeners.onopen}},{key:"onreconnect",set:function(e){this.listeners.onreconnect=e},get:function(){returnthis.listeners.onreconnect}}]),e}();a.CONNECTING=s.CONNECTING,a.OPEN=s.OPEN,a.CLOSING=s.CLOSING,a.CLOSED=s.CLOSED,t.default=a},function(e,t,n){"use strict";functionr(e,t){returnnewi(o[e],t)}functioni(e,t){this.func=e,this.attempts=0,this.delay=void0!==t.initialDelay?t.initialDelay:100}Object.defineProperty(t,"__esModule",{value:!0}),t.createBackoff=r;varo={exponential:function(e,t){returnMath.floor(Math.random()*Math.pow(2,e)*t)},fibonacci:function(e,t){varn=1;if(e>n)for(varr=1,n=2,i=2;i<e;i++){varo=r+n;r=n,n=o}returnMath.floor(Math.random()*n*t)}};i.prototype.backoff=function(){setTimeout(this.onReady,this.func(++this.attempts,this.delay))}},function(e,t){},function(e,t,n){"use strict";functionr(){returna||(a="undefined"!=typeofcc&&cc.sys&&cc.sys.localStorage?cc.sys.localStorage:"undefined"!=typeofwindow&&window.localStorage?window.localStorage:{cache:{},setItem:function(e,t){this.cache[e]=t},getItem:function(e){this.cache[e]},removeItem:function(e){deletethis.cache[e]}}),a}functioni(e,t){r().setItem(e,t)}functiono(e){r().removeItem(e)}functions(e,t){varn=r().getItem(e);"undefined"!=typeofPromise&&ninstanceofPromise?n.then(function(e){returnt(e)}):t(n)}Object.defineProperty(t,"__esModule",{value:!0});vara;t.setItem=i,t.removeItem=o,t.getItem=s},function(e,t,n){"use strict";varr=this&&this.__awaiter||function(e,t,n,r){returnnew(n||(n=Promise))(function(i,o){functions(e){try{c(r.next(e))}catch(e){o(e)}}functiona(e){try{c(r.throw(e))}catch(e){o(e)}}functionc(e){e.done?i(e.value):newn(function(t){t(e.value)}).then(s,a)}c((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){functionn(e){returnfunction(t){returnr([e,t])}}functionr(n){if(i)thrownewTypeError("Generator is already executing.");for(;c;)try{if(i=1,o&&(s=2&n[0]?o.return:n[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,n[1])).done)returns;switch(o=0,s&&(n=[2&n[0],s.value]),n[0]){case0:case1:s=n;break;case4:returnc.label++,{value:n[1],done:!1};case5:c.label++,o=n[1],n=[0];continue;case7:n=c.ops.pop(),c.trys.pop();continue;default:if(s=c.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){c.label=n[1];break}if(6===n[0]&&c.label<s[1]){c.label=s[1],s=n;break}if(s&&c.label<s[2]){c.label=s[2],c.ops.push(n);break}s[2]&&c.ops.pop(),c.trys.pop();continue}n=t.call(e,c)}catch(e){n=[6,e],o=0}finally{i=s=0}if(5&n[0])thrown[1];return{value:n[0]?n[1]:void0,done:!0}}vari,o,s,a,c={label:0,sent:function(){if(1&s[0])throws[1];returns[1]},trys:[],ops:[]};returna={next:n(0),throw:n(1),return:n(2)},"function"==typeofSymbol&&(a[Symbol.iterator]=function(){returnthis}),a};Object.defineProperty(t,"__esModule",{value:!0});varo=function(){functione(e){this.endpoint=e.replace("ws","http")}returne.prototype.register=function(){returnr(this,void0,void0,function(){returni(this,function(e){switch(e.label){case0:returnthis.check(),[4,this.registerServiceWorker()];case1:returne.sent(),[4,this.requestNotificationPermission()];case2:returne.sent(),[2]}})})},e.prototype.registerServiceWorker=function(){returnr(this,void0,void0,function(){returni(this,function(e){switch(e.label){case0:return[4,navigator.serviceWorker.register(this.endpoint+"/push")];case1:return[2,e.sent()]}})})},e.prototype.requestNotificationPermission=function(){returnr(this,void0,void0,function(){vare;returni(this,function(t){switch(t.label){case0:return[4,window.Notification.requestPermission()];case1:if("granted"!==(e=t.sent()))thrownewError("Permission not granted for Notification");return[2]}})})},e.prototype.check=function(){if(!("serviceWorker"innavigator))thrownewError("No Service Worker support!");if(!("PushManager"inwindow))thrownewError("No Push API Support!")},e}();t.Push=o},function(e,t,n){"use strict";varr=this&&this.__importStar||function(e){if(e&&e.__esModule)returne;vart={};if(null!=e)for(varnine)Object.hasOwnProperty.call(e,n)&&(t[n]=e[n]);returnt.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});vari=n(26),o=r(n(29)),s=r(n(3)),a=function(){functione(){this.api=newi.StateContainer({})}returne.prototype.getState=function(){returnthis.api.state},e.prototype.setState=function(e){this.previousState=newUint8Array(e),this.api.set(s.decode(this.previousState))},e.prototype.patch=function(e){this.previousState=newUint8Array(o.apply(this.previousState,e)),this.api.set(s.decode(this.previousState))},e.prototype.teardown=function(){this.api.removeAllListeners()},e}();t.FossilDeltaSerializer=a},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=n(27);t.StateContainer=r.StateContainer},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=n(28),i=function(){functione(e){this.listeners=[],this.matcherPlaceholders={":id":/^([a-zA-Z0-9\-_]+)$/,":number":/^([0-9]+)$/,":string":/^(\w+)$/,":axis":/^([xyz])$/,":*":/(.*)/},this.state=e,this.reset()}returne.prototype.set=function(e){vart=r.compare(this.state,e);returnthis.state=e,this.checkPatches(t,this.listeners,this.defaultListener),t},e.prototype.registerPlaceholder=function(e,t){this.matcherPlaceholders[e]=t},e.prototype.listen=function(e,t,n){vari,o=this;"function"==typeofe?(i=[],t=e):i=e.split("/"),t.length>1&&console.warn(".listen() accepts only one parameter.");vars={callback:t,rawRules:i,rules:i.map(function(e){return"string"==typeofe?0===e.indexOf(":")?o.matcherPlaceholders[e]||o.matcherPlaceholders[":*"]:newRegExp("^"+e+"$"):e})};return0===i.length?this.defaultListener=s:this.listeners.push(s),n&&this.checkPatches(r.compare({},this.state),[s]),s},e.prototype.removeListener=function(e){for(vart=this.listeners.length-1;t>=0;t--)this.listeners[t]===e&&this.listeners.splice(t,1)},e.prototype.removeAllListeners=function(){this.reset()},e.prototype.checkPatches=function(e,t,n){for(varr=0,i=t.length;r<i;r++)for(varo=t[r],s=e.length-1;s>=0;s--){vara=o&&this.getPathVariables(e[s],o);a&&(o.callback({path:a,rawPath:e[s].path,operation:e[s].operation,value:e[s].value}),e[s].matched=!0)}if(n)for(vars=e.length-1;s>=0;s--)e[s].matched||n.callback(e[s])},e.prototype.getPathVariables=function(e,t){if(e.path.length!==t.rules.length)return!1;for(varn={},r=0,i=t.rules.length;r<i;r++){varo=e.path[r].match(t.rules[r]);if(!o||0===o.length||o.length>2)return!1;":"===t.rawRules[r].substr(0,1)&&(n[t.rawRules[r].substr(1)]=o[1])}returnn},e.prototype.reset=function(){this.listeners=[]},e}();t.StateContainer=i},function(e,t,n){"use strict";functionr(e,t){varn=[];returns(e,t,n,[]),n}functioni(e,t){varn=e.slice();returnn.push(t),n}functiono(e){if(Array.isArray(e)){for(vart=newArray(e.length),n=0;n<t.length;n++)t[n]=""+n;returnt}if(Object.keys)returnObject.keys(e);varr=[];for(variine)e.hasOwnProperty(i)&&r.push(i);returnr}functions(e,t,n,r){for(vara=o(t),c=o(e),u=!1,h=c.length-1;h>=0;h--){varf=c[h],l=e[f];if(!t.hasOwnProperty(f)||void0===t[f]&&void0!==l&&!1===Array.isArray(t))n.push({operation:"remove",path:i(r,f)}),u=!0;else{varp=t[f];"object"==typeofl&&null!=l&&"object"==typeofp&&null!=p?s(l,p,n,i(r,f)):l!==p&&n.push({operation:"replace",path:i(r,f),value:p,previousValue:l})}}if(u||a.length!=c.length)for(varh=a.length-1;h>=0;h--){varf=a[h];if(!e.hasOwnProperty(f)&&void0!==t[f]){varp=t[f],d=i(r,f);"object"==typeofp&&null!=p&&s({},p,n,d),n.push({operation:"add",path:d,value:p})}}}Object.defineProperty(t,"__esModule",{value:!0}),t.compare=r},function(e,t){!function(t,n){void0!==e&&e.exports?e.exports=n():t.fossilDelta=n()}(this,function(){"use strict";functione(){this.a=0,this.b=0,this.i=0,this.z=newArray(s)}functiont(e){this.a=e,this.pos=0}functionn(){this.a=[]}functionr(e){vart,n;for(t=1,n=64;e>=n;t++,n<<=6);returnt}functioni(e){for(vart=0,n=0,r=0,i=0,o=0,s=e.length;s>=16;)t=t+e[o+0]|0,n=n+e[o+1]|0,r=r+e[o+2]|0,i=i+e[o+3]|0,t=t+e[o+4]|0,n=n+e[o+5]|0,r=r+e[o+6]|0,i=i+e[o+7]|0,t=t+e[o+8]|0,n=n+e[o+9]|0,r=r+e[o+10]|0,i=i+e[o+11]|0,t=t+e[o+12]|0,n=n+e[o+13]|0,r=r+e[o+14]|0,i=i+e[o+15]|0,o+=16,s-=16;for(;s>=4;)t=t+e[o+0]|0,n=n+e[o+1]|0,r=r+e[o+2]|0,i=i+e[o+3]|0,o+=4,s-=4;switch(i=((i+(r<<8)|0)+(n<<16)|0)+(t<<24)|0,s){case3:i=i+(e[o+2]<<8)|0;case2:i=i+(e[o+1]<<16)|0;case1:i=i+(e[o+0]<<24)|0}returni>>>0}varo={},s=16;e.prototype.init=function(e,t){varn,r,i=0,o=0;for(n=0;n<s;n++)r=e[t+n],i=i+r&65535,o=o+(s-n)*r&65535,this.z[n]=r;this.a=65535&i,this.b=65535&o,this.i=0},e.prototype.next=function(e){vart=this.z[this.i];this.z[this.i]=e,this.i=this.i+1&s-1,this.a=this.a-t+e&65535,this.b=this.b-s*t+this.a&65535},e.prototype.value=function(){return(65535&this.a|(65535&this.b)<<16)>>>0};vara="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz~".split("").map(function(e){returne.charCodeAt(0)}),c=[-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,-1,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,36,-1,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,-1,-1,-1,63,-1];returnt.prototype.haveBytes=function(){returnthis.pos<this.a.length},t.prototype.getByte=function(){vare=this.a[this.pos];if(++this.pos>this.a.length)thrownewRangeError("out of bounds");returne},t.prototype.getChar=function(){returnString.fromCharCode(this.getByte())},t.prototype.getInt=function(){for(vare,t=0;this.haveBytes()&&(e=c[127&this.getByte()])>=0;)t=(t<<6)+e;returnthis.pos--,t>>>0},n.prototype.toArray=function(){returnthis.a},n.prototype.putByte=function(e){this.a.push(255&e)},n.prototype.putChar=function(e){this.putByte(e.charCodeAt(0))},n.prototype.putInt=function(e){vart,n,r=[];if(0===e)returnvoidthis.putChar("0");for(t=0;e>0;t++,e>>>=6)r.push(a[63&e]);for(n=t-1;n>=0;n--)this.putByte(r[n])},n.prototype.putArray=function(e,t,n){for(varr=t;r<n;r++)this.a.push(e[r])},o.create=function(t,o){vara,c=newn,u=o.length,h=t.length,f=-1;if(c.putInt(u),c.putChar("\n"),h<=s)returnc.putInt(u),c.putChar(":"),c.putArray(o,0,u),c.putInt(i(o)),c.putChar(";"),c.toArray();varl=Math.ceil(h/s),p=newArray(l),d=newArray(l);for(a=0;a<p.length;a++)p[a]=-1;for(a=0;a<d.length;a++)d[a]=-1;varv,y=newe;for(a=0;a<h-s;a+=s)y.init(t,a),v=y.value()%l,p[a/s]=d[v],d[v]=a/s;for(varg,_,b,w,m,C=0;C+s<u;)for(w=0,m=0,y.init(o,C),a=0,b=0;;){varO=250;for(v=y.value()%l,_=d[v];_>=0&&O-->0;){varS,A,k,I,E,P,x,M;for(g=_*s,I=0,P=g,x=C+a;P<h&&x<u&&t[P]===o[x];I++,P++,x++);for(I--,E=1;E<g&&E<=a&&t[g-E]===o[C+a-E];E++);E--,A=g-E,S=I+E+1,k=a-E,M=r(a-E)+r(S)+r(A)+3,S>=M&&S>b&&(b=S,w=g-E,m=k),_=p[_]}if(b>0){m>0&&(c.putInt(m),c.putChar(":"),c.putArray(o,C,C+m),C+=m),C+=b,c.putInt(b),c.putChar("@"),c.putInt(w),c.putChar(","),w+b-1>f&&(f=w+b-1),b=0;break}if(C+a+s>=u){c.putInt(u-C),c.putChar(":"),c.putArray(o,C,C+u-C),C=u;break}y.next(o[C+a+s]),a++}returnC<u&&(c.putInt(u-C),c.putChar(":"),c.putArray(o,C,C+u-C)),c.putInt(i(o)),c.putChar(";"),c.toArray()},o.outputSize=function(e){varn=newt(e),r=n.getInt();if("\n"!==n.getChar())thrownewError("size integer not terminated by '\\n'");returnr},o.apply=function(e,r,o){vars,a=0,c=newt(r),u=e.length,h=r.length;if(s=c.getInt(),"\n"!==c.getChar())thrownewError("size integer not terminated by '\\n'");for(varf=newn;c.haveBytes();){varl,p;switch(l=c.getInt(),c.getChar()){case"@":if(p=c.getInt(),c.haveBytes()&&","!==c.getChar())thrownewError("copy command not terminated by ','");if((a+=l)>s)thrownewError("copy exceeds output file size");if(p+l>u)thrownewError("copy extends past end of input");f.putArray(e,p,p+l);break;case":":if((a+=l)>s)thrownewError("insert command gives an output larger than predicted");if(l>h)thrownewError("insert count exceeds size of delta");f.putArray(c.a,c.pos,c.pos+l),c.pos+=l;break;case";":vard=f.toArray();if((!o||!1!==o.verifyChecksum)&&l!==i(d))thrownewError("bad checksum");if(a!==s)thrownewError("generated size does not match predicted size");returnd;default:thrownewError("unknown delta operator")}}thrownewError("unterminated delta")},o})},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});varr=n(9),i=function(){functione(){}returne.prototype.setState=function(e){this.state.decode(e)},e.prototype.getState=function(){returnthis.state},e.prototype.patch=function(e){this.state.decode(e)},e.prototype.teardown=function(){},e.prototype.handshake=function(e){if(this.state){(newr.Reflection).decode(e)}elsethis.state=r.Reflection.decode(e)},e}();t.SchemaSerializer=i},function(e,t,n){"use strict";functionr(e){for(vart=0,n=0,r=0,i=e.length;r<i;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);returnn}functioni(e,t,n){for(varr=0,i=0,o=n.length;i<o;i++)r=n.charCodeAt(i),r<128?e[t++]=r:r<2048?(e[t++]=192|r>>6,e[t++]=128|63&r):r<55296||r>=57344?(e[t++]=224|r>>12,e[t++]=128|r>>6&63,e[t++]=128|63&r):(i++,r=65536+((1023&r)<<10|1023&n.charCodeAt(i)),e[t++]=240|r>>18,e[t++]=128|r>>12&63,e[t++]=128|r>>6&63,e[t++]=128|63&r)}functiono(e,t){e.push(t)}functions(e,t){e.push(t)}functiona(e,t){e.push(t),e.push(t>>8)}functionc(e,t){e.push(t),e.push(t>>8)}functionu(e,t){e.push(t),e.push(t>>8),e.push(t>>16),e.push(t>>24)}functionh(e,t){varn=t>>24,r=t>>16,i=t>>8,o=t;e.push(o),e.push(i),e.push(r),e.push(n)}functionf(e,t){varn=Math.floor(t/Math.pow(2,32));h(e,t>>>0),h(e,n)}functionl(e,t){varn=t/Math.pow(2,32)>>0;h(e,t>>>0),h(e,n)}functionp(e,t){v(e,t)}functiond(e,t){y(e,t)}functionv(e,t){C[0]=t,u(e,m[0])}functiony(e,t){O[0]=t,u(e,m[w?0:1]),u(e,m[w?1:0])}functiong(e,t){returns(e,t?1:0)}function_(e,t){t||(t="");varn=r(t),o=0;if(n<32)e.push(160|n),o=1;elseif(n<256)e.push(217),s(e,n),o=2;elseif(n<65536)e.push(218),c(e,n),o=3;else{if(!(n<4294967296))thrownewError("String too long");e.push(219),h(e,n),o=5}returni(e,e.length,t),o+n}functionb(e,t){returnisNaN(t)?b(e,0):isFinite(t)?t!==(0|t)?(e.push(203),y(e,t),9):t>=0?t<128?(s(e,t),1):t<256?(e.push(204),s(e,t),2):t<65536?(e.push(205),c(e,t),3):t<4294967296?(e.push(206),h(e,t),5):(e.push(207),l(e,t),9):t>=-32?(e.push(t),1):t>=-128?(e.push(208),o(e,t),2):t>=-32768?(e.push(209),a(e,t),3):t>=-2147483648?(e.push(210),u(e,t),5):(e.push(211),f(e,t),9):b(e,t>0?Number.MAX_SAFE_INTEGER:-Number.MAX_SAFE_INTEGER)}Object.defineProperty(t,"__esModule",{value:!0}),t.utf8Write=i,t.int8=o,t.uint8=s,t.int16=a,t.uint16=c,t.int32=u,t.uint32=h,t.int64=f,t.uint64=l,t.float32=p,t.float64=d;varw=!0,m=newInt32Array(2),C=newFloat32Array(m.buffer),O=newFloat64Array(m.buffer);t.writeFloat32=v,t.writeFloat64=y,t.boolean=g,t.string=_,t.number=b},function(e,t,n){"use strict";functionr(e,t,n){for(varr="",i=0,o=t,s=t+n;o<s;o++){vara=e[o];if(0!=(128&a))if(192!=(224&a))if(224!=(240&a)){if(240!=(248&a))thrownewError("Invalid byte "+a.toString(16));i=(7&a)<<18|(63&e[++o])<<12|(63&e[++o])<<6|(63&e[++o])<<0,i>=65536?(i-=65536,r+=String.fromCharCode(55296+(i>>>10),56320+(1023&i))):r+=String.fromCharCode(i)}elser+=String.fromCharCode((15&a)<<12|(63&e[++o])<<6|(63&e[++o])<<0);elser+=String.fromCharCode((31&a)<<6|63&e[++o]);elser+=String.fromCharCode(a)}returnr}functioni(e,t){returno(e,t)<<24>>24}functiono(e,t){returne[t.offset++]}functions(e,t){returna(e,t)<<16>>16}functiona(e,t){returne[t.offset++]|e[t.offset++]<<8}functionc(e,t){returne[t.offset++]|e[t.offset++]<<8|e[t.offset++]<<16|e[t.offset++]<<24}functionu(e,t){returnc(e,t)>>>0}functionh(e,t){returnd(e,t)}functionf(e,t){returnv(e,t)}functionl(e,t){varn=u(e,t);returnc(e,t)*Math.pow(2,32)+n}functionp(e,t){varn=u(e,t);returnu(e,t)*Math.pow(2,32)+n}functiond(e,t){returnk[0]=c(e,t),I[0]}functionv(e,t){returnk[A?0:1]=c(e,t),k[A?1:0]=c(e,t),E[0]}functiony(e,t){returno(e,t)>0}functiong(e,t){varn,i=e[t.offset++];i<192?n=31&i:217===i?n=o(e,t):218===i?n=a(e,t):219===i&&(n=u(e,t));vars=r(e,t.offset,n);returnt.offset+=n,s}function_(e,t){varn=e[t.offset];returnn<192&&n>160||217===n||218===n||219===n}functionb(e,t){varn=e[t.offset++];returnn<128?n:202===n?d(e,t):203===n?v(e,t):204===n?o(e,t):205===n?a(e,t):206===n?u(e,t):207===n?p(e,t):208===n?i(e,t):209===n?s(e,t):210===n?c(e,t):211===n?l(e,t):n>223?-1*(255-n+1):void0}functionw(e,t){varn=e[t.offset];returnn<128||n>=202&&n<=211}functionm(e,t){returne[t.offset]<160}functionC(e,t){returne[t.offset]===S.NIL}functionO(e,t){returne[t.offset]===S.INDEX_CHANGE}Object.defineProperty(t,"__esModule",{value:!0});varS=n(10);t.int8=i,t.uint8=o,t.int16=s,t.uint16=a,t.int32=c,t.uint32=u,t.float32=h,t.float64=f,t.int64=l,t.uint64=p;varA=!0,k=newInt32Array(2),I=newFloat32Array(k.buffer),E=newFloat64Array(k.buffer);t.readFloat32=d,t.readFloat64=v,t.boolean=y,t.string=g,t.stringCheck=_,t.number=b,t.numberCheck=w,t.arrayCheck=m,t.nilCheck=C,t.indexChangeCheck=O},function(e,t,n){"use strict";varr=this&&this.__extends||function(){vare=function(t,n){return(e=Object.setPrototypeOf||{__proto__:[]}instanceofArray&&function(e,t){e.__proto__=t}||function(e,t){for(varnint)t.hasOwnProperty(n)&&(e[n]=t[n])})(t,n)};returnfunction(t,n){functionr(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,newr)}}(),i=this&&this.__decorate||function(e,t,n,r){vari,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeofReflect&&"function"==typeofReflect.decorate)s=Reflect.decorate(e,t,n,r);elsefor(vara=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);returno>3&&s&&Object.defineProperty(t,n,s),s};Object.defineProperty(t,"__esModule",{value:!0});varo=n(12),s=n(0),a=n(1),c=n(2),u=newo.Context,h=function(e){functiont(){returnnull!==e&&e.apply(this,arguments)||this}returnr(t,e),i([o.type("string",u)],t.prototype,"name",void0),i([o.type("string",u)],t.prototype,"type",void0),i([o.type("uint8",u)],t.prototype,"referencedType",void0),t}(s.Schema);t.ReflectionField=h;varf=function(e){functiont(){vart=null!==e&&e.apply(this,arguments)||this;returnt.fields=newa.ArraySchema,t}returnr(t,e),i([o.type("uint8",u)],t.prototype,"id",void0),i([o.type([h],u)],t.prototype,"fields",void0),t}(s.Schema);t.ReflectionType=f;varl=function(e){functiont(){vart=null!==e&&e.apply(this,arguments)||this;returnt.types=newa.ArraySchema,t}returnr(t,e),t.encode=function(e){varn=e.constructor,r=newt;r.rootType=n._typeid;vari=n._context.types;for(varoini){vars=newf;s.id=Number(o),function(e,t){for(varnint){vari=newh;i.name=n;varo=void0;if("string"==typeoft[n])o=t[n];else{vars="function"==typeoft[n],a=Array.isArray(t[n]),c=!a&&t[n].map,u=void0;s?(o="ref",u=t[n]):a?(o="array","string"==typeoft[n][0]?o+=":"+t[n][0]:u=t[n][0]):c&&(o="map","string"==typeoft[n].map?o+=":"+t[n].map:u=t[n].map),i.referencedType=u?u._typeid:255}i.type=o,e.fields.push(i)}r.types.push(e)}(s,i[o]._schema)}returnr.encodeAll()},t.decode=function(e){varn=newo.Context,i=newt;i.decode(e);varu=i.types.reduce(function(e,t){returne[t.id]=function(e){functiont(){returnnull!==e&&e.apply(this,arguments)||this}returnr(t,e),t}(s.Schema),e},{});i.types.forEach(function(e,t){e.fields.forEach(function(t){varr=u[e.id];if(void0!==t.referencedType){vari=u[t.referencedType];i||(i=t.type.split(":")[1]),0===t.type.indexOf("array")?o.type([i],n)(r.prototype,t.name):0===t.type.indexOf("map")?o.type({map:i},n)(r.prototype,t.name):"ref"===t.type&&o.type(i,n)(r.prototype,t.name)}elseo.type(t.type,n)(r.prototype,t.name)})});varh=u[i.rootType],f=newh;for(varlinh._schema){varp=h._schema[l];if("string"!=typeofp){vard="function"==typeofp,v=Array.isArray(p),y=!v&&p.map;f[l]=v?newa.ArraySchema:y?newc.MapSchema:d?newp:void0}}returnf},i([o.type([f],u)],t.prototype,"types",void0),i([o.type("uint8",u)],t.prototype,"rootType",void0),t}(s.Schema);t.Reflection=l}])});