UNPKG

@zeainc/zea-collab

Version:

The Zea Collab library provides Client and Server side tools for connecting and synchronizing users.

1 lines 77.8 kB
import*as e from"@zeainc/zea-engine";import{Color as t,MathFunctions as r,Plane as n,Disc as o,Cuboid as i,Vec3 as s,Lines as a,TreeItem as u,Camera as l,LDRImage as c,Label as h,FlatSurfaceMaterial as f,GeomItem as d,Xfo as m,VideoStreamImage2D as p,SimpleSurfaceMaterial as g,LinesMaterial as v,VLAAsset as w,Cylinder as y,Quat as b,BaseItem as C,Vec2 as I,Vec4 as E,RGBA as P,Mat3 as _,Mat4 as R,Registry as A}from"@zeainc/zea-engine";import O from"socket.io-client";import{UndoRedoManager as D,SelectionManager as S}from"@zeainc/zea-ux";var T={name:"@zeainc/zea-collab",version:"6.3.4",description:"The Zea Collab library provides Client and Server side tools for connecting and synchronizing users.",main:"dist/index.cjs.js",module:"dist/index.esm.js",browser:"dist/index.umd.js",files:["dist/"],keywords:["Zea"],scripts:{build:"rollup -c","build:watch":"rollup -w -c",dev:"npm-run-all --parallel build:watch start:watch",dist:"yarn publish --access=public",docs:"cp CHANGELOG.md docs/ && adg --config adg.config.json","docs-w":"cp CHANGELOG.md docs/ && adg -w --config=adg.config.json","docs:serve":"docsify serve docs/",prepare:"yarn run build",release:"standard-version",start:"es-dev-server --cors","start:watch":"es-dev-server --cors --app-index testing-e2e/index.html --open --watch","to-cleanup":"rm -Rf dist/ node_modules/ yarn.lock"},repository:{type:"git",url:"git+ssh://git@github.com/ZeaInc/zea-collab.git"},bugs:{url:"https://github.com/ZeaInc/zea-collab/issues"},homepage:"https://github.com/ZeaInc/zea-collab#readme",author:"Zea Inc.",license:"MIT",dependencies:{debug:"^4.1.1","socket.io-client":"^2.3.0","socketio-wildcard":"^2.0.0"},devDependencies:{"@rollup/plugin-commonjs":"^15.0.0","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^9.0.0","@zeainc/jsdocs2md":"^0.0.8","@zeainc/zea-engine":"^4.13.0","@zeainc/zea-ux":"4.6.0",bufferutil:"^4.0.1","builtin-modules":"^3.1.0",crypto:"^1.0.1","docsify-cli":"^4.4.1","es-dev-server":"^1.57.4",eslint:"^7.9.0","eslint-config-airbnb-base":"^14.1.0","eslint-plugin-import":"^2.20.2","npm-run-all":"^4.1.5",path:"^0.12.7",prettier:"2.1.2",rollup:"^2.27.0","rollup-plugin-node-polyfills":"^0.2.1","rollup-plugin-terser":"^7.0.2","standard-version":"^9.0.0",stream:"^0.0.2",tls:"^0.0.1","utf-8-validate":"^5.0.2"}};function M(){}function U(){U.init.call(this)}function N(e){return void 0===e._maxListeners?U.defaultMaxListeners:e._maxListeners}function x(e,t,r){if(t)e.call(r);else for(var n=e.length,o=j(e,n),i=0;i<n;++i)o[i].call(r)}function F(e,t,r,n){if(t)e.call(r,n);else for(var o=e.length,i=j(e,o),s=0;s<o;++s)i[s].call(r,n)}function L(e,t,r,n,o){if(t)e.call(r,n,o);else for(var i=e.length,s=j(e,i),a=0;a<i;++a)s[a].call(r,n,o)}function k(e,t,r,n,o,i){if(t)e.call(r,n,o,i);else for(var s=e.length,a=j(e,s),u=0;u<s;++u)a[u].call(r,n,o,i)}function B(e,t,r,n){if(t)e.apply(r,n);else for(var o=e.length,i=j(e,o),s=0;s<o;++s)i[s].apply(r,n)}function V(e,t,r,n){var o,i,s,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');if((i=e._events)?(i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]):(i=e._events=new M,e._eventsCount=0),s){if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),!s.warned&&(o=N(e))&&o>0&&s.length>o){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,a=u,"function"==typeof console.warn?console.warn(a):console.log(a)}}else s=i[t]=r,++e._eventsCount;return e}function G(e,t,r){var n=!1;function o(){e.removeListener(t,o),n||(n=!0,r.apply(e,arguments))}return o.listener=r,o}function X(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function j(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}function z(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}function Y(e){if(e.__esModule)return e;var t=Object.defineProperty({},"__esModule",{value:!0});return Object.keys(e).forEach((function(r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})})),t}M.prototype=Object.create(null),U.EventEmitter=U,U.usingDomains=!1,U.prototype.domain=void 0,U.prototype._events=void 0,U.prototype._maxListeners=void 0,U.defaultMaxListeners=10,U.init=function(){this.domain=null,U.usingDomains&&undefined.active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new M,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},U.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},U.prototype.getMaxListeners=function(){return N(this)},U.prototype.emit=function(e){var t,r,n,o,i,s,a,u="error"===e;if(s=this._events)u=u&&null==s.error;else if(!u)return!1;if(a=this.domain,u){if(t=arguments[1],!a){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=a,t.domainThrown=!1,a.emit("error",t),!1}if(!(r=s[e]))return!1;var c="function"==typeof r;switch(n=arguments.length){case 1:x(r,c,this);break;case 2:F(r,c,this,arguments[1]);break;case 3:L(r,c,this,arguments[1],arguments[2]);break;case 4:k(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(n-1),i=1;i<n;i++)o[i-1]=arguments[i];B(r,c,this,o)}return!0},U.prototype.addListener=function(e,t){return V(this,e,t,!1)},U.prototype.on=U.prototype.addListener,U.prototype.prependListener=function(e,t){return V(this,e,t,!0)},U.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,G(this,e,t)),this},U.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,G(this,e,t)),this},U.prototype.removeListener=function(e,t){var r,n,o,i,s;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(n=this._events))return this;if(!(r=n[e]))return this;if(r===t||r.listener&&r.listener===t)0==--this._eventsCount?this._events=new M:(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length;i-- >0;)if(r[i]===t||r[i].listener&&r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new M,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,o=e.length;n<o;r+=1,n+=1)e[r]=e[n];e.pop()}(r,o);n.removeListener&&this.emit("removeListener",e,s||t)}return this},U.prototype.removeAllListeners=function(e){var t,r;if(!(r=this._events))return this;if(!r.removeListener)return 0===arguments.length?(this._events=new M,this._eventsCount=0):r[e]&&(0==--this._eventsCount?this._events=new M:delete r[e]),this;if(0===arguments.length){for(var n,o=Object.keys(r),i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=new M,this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(t)do{this.removeListener(e,t[t.length-1])}while(t[0]);return this},U.prototype.listeners=function(e){var t,r=this._events;return r&&(t=r[e])?"function"==typeof t?[t.listener||t]:function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(t):[]},U.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):X.call(e,t)},U.prototype.listenerCount=X,U.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var J=Y(Object.freeze({__proto__:null,default:U,EventEmitter:U})).EventEmitter,$="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};function H(){throw new Error("setTimeout has not been defined")}function Z(){throw new Error("clearTimeout has not been defined")}var W=H,q=Z;function K(e){if(W===setTimeout)return setTimeout(e,0);if((W===H||!W)&&setTimeout)return W=setTimeout,setTimeout(e,0);try{return W(e,0)}catch(t){try{return W.call(null,e,0)}catch(t){return W.call(this,e,0)}}}"function"==typeof $.setTimeout&&(W=setTimeout),"function"==typeof $.clearTimeout&&(q=clearTimeout);var Q,ee=[],te=!1,re=-1;function ne(){te&&Q&&(te=!1,Q.length?ee=Q.concat(ee):re=-1,ee.length&&oe())}function oe(){if(!te){var e=K(ne);te=!0;for(var t=ee.length;t;){for(Q=ee,ee=[];++re<t;)Q&&Q[re].run();re=-1,t=ee.length}Q=null,te=!1,function(e){if(q===clearTimeout)return clearTimeout(e);if((q===Z||!q)&&clearTimeout)return q=clearTimeout,clearTimeout(e);try{q(e)}catch(t){try{return q.call(null,e)}catch(t){return q.call(this,e)}}}(e)}}function ie(e,t){this.fun=e,this.array=t}ie.prototype.run=function(){this.fun.apply(null,this.array)};function se(){}var ae=se,ue=se,le=se,ce=se,he=se,fe=se,de=se;var me=$.performance||{},pe=me.now||me.mozNow||me.msNow||me.oNow||me.webkitNow||function(){return(new Date).getTime()};var ge=new Date;var ve={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];ee.push(new ie(e,t)),1!==ee.length||te||K(oe)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:ae,addListener:ue,once:le,off:ce,removeListener:he,removeAllListeners:fe,emit:de,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*pe.call(me),r=Math.floor(t),n=Math.floor(t%1*1e9);return e&&(r-=e[0],(n-=e[1])<0&&(r--,n+=1e9)),[r,n]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-ge)/1e3}},we=1e3,ye=60*we,be=60*ye,Ce=24*be,Ie=7*Ce,Ee=365.25*Ce,Pe=function(e,t){t=t||{};var r=typeof e;if("string"===r&&e.length>0)return function(e){if((e=String(e)).length>100)return;var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return r*Ee;case"weeks":case"week":case"w":return r*Ie;case"days":case"day":case"d":return r*Ce;case"hours":case"hour":case"hrs":case"hr":case"h":return r*be;case"minutes":case"minute":case"mins":case"min":case"m":return r*ye;case"seconds":case"second":case"secs":case"sec":case"s":return r*we;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}(e);if("number"===r&&isFinite(e))return t.long?function(e){var t=Math.abs(e);if(t>=Ce)return _e(e,t,Ce,"day");if(t>=be)return _e(e,t,be,"hour");if(t>=ye)return _e(e,t,ye,"minute");if(t>=we)return _e(e,t,we,"second");return e+" ms"}(e):function(e){var t=Math.abs(e);if(t>=Ce)return Math.round(e/Ce)+"d";if(t>=be)return Math.round(e/be)+"h";if(t>=ye)return Math.round(e/ye)+"m";if(t>=we)return Math.round(e/we)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function _e(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}var Re=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;const r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((n,o)=>{if("%%"===n)return"%";s++;const i=t.formatters[o];if("function"==typeof i){const t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function n(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(n),...t.skips.map(n).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const n=("string"==typeof e?e:"").split(/[\s,]+/),o=n.length;for(r=0;r<o;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.substr(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=Pe,t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t},Ae=z((function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,o=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))})),t.splice(o,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&void 0!==ve&&"env"in ve&&(e=ve.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Re(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}));function Oe(){return!1}function De(){throw new Error("tty.ReadStream is not implemented")}function Se(){throw new Error("tty.ReadStream is not implemented")}var Te={isatty:Oe,ReadStream:De,WriteStream:Se},Me=Object.freeze({__proto__:null,isatty:Oe,ReadStream:De,WriteStream:Se,default:Te}),Ue=[],Ne=[],xe="undefined"!=typeof Uint8Array?Uint8Array:Array,Fe=!1;function Le(){Fe=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,r=e.length;t<r;++t)Ue[t]=e[t],Ne[e.charCodeAt(t)]=t;Ne["-".charCodeAt(0)]=62,Ne["_".charCodeAt(0)]=63}function ke(e,t,r){for(var n,o,i=[],s=t;s<r;s+=3)n=(e[s]<<16)+(e[s+1]<<8)+e[s+2],i.push(Ue[(o=n)>>18&63]+Ue[o>>12&63]+Ue[o>>6&63]+Ue[63&o]);return i.join("")}function Be(e){var t;Fe||Le();for(var r=e.length,n=r%3,o="",i=[],s=16383,a=0,u=r-n;a<u;a+=s)i.push(ke(e,a,a+s>u?u:a+s));return 1===n?(t=e[r-1],o+=Ue[t>>2],o+=Ue[t<<4&63],o+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],o+=Ue[t>>10],o+=Ue[t>>4&63],o+=Ue[t<<2&63],o+="="),i.push(o),i.join("")}function Ve(e,t,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,l=u>>1,c=-7,h=r?o-1:0,f=r?-1:1,d=e[t+h];for(h+=f,i=d&(1<<-c)-1,d>>=-c,c+=a;c>0;i=256*i+e[t+h],h+=f,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===i)i=1-l;else{if(i===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),i-=l}return(d?-1:1)*s*Math.pow(2,i-n)}function Ge(e,t,r,n,o,i){var s,a,u,l=8*i-o-1,c=(1<<l)-1,h=c>>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,m=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+h>=1?f/u:f*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*u-1)*Math.pow(2,o),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;e[r+d]=255&a,d+=m,a/=256,o-=8);for(s=s<<o|a,l+=o;l>0;e[r+d]=255&s,d+=m,s/=256,l-=8);e[r+d-m]|=128*p}var Xe={}.toString,je=Array.isArray||function(e){return"[object Array]"==Xe.call(e)};function ze(){return Je.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ye(e,t){if(ze()<t)throw new RangeError("Invalid typed array length");return Je.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Je.prototype:(null===e&&(e=new Je(t)),e.length=t),e}function Je(e,t,r){if(!(Je.TYPED_ARRAY_SUPPORT||this instanceof Je))return new Je(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Ze(this,e)}return $e(this,e,t,r)}function $e(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);Je.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Je.prototype:e=We(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!Je.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Qe(t,r),o=(e=Ye(e,n)).write(t,r);o!==n&&(e=e.slice(0,o));return e}(e,t,r):function(e,t){if(Ke(t)){var r=0|qe(t.length);return 0===(e=Ye(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?Ye(e,0):We(e,t);if("Buffer"===t.type&&je(t.data))return We(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function He(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Ze(e,t){if(He(t),e=Ye(e,t<0?0:0|qe(t)),!Je.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function We(e,t){var r=t.length<0?0:0|qe(t.length);e=Ye(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function qe(e){if(e>=ze())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ze().toString(16)+" bytes");return 0|e}function Ke(e){return!(null==e||!e._isBuffer)}function Qe(e,t){if(Ke(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return _t(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Rt(e).length;default:if(n)return _t(e).length;t=(""+t).toLowerCase(),n=!0}}function et(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return mt(this,t,r);case"utf8":case"utf-8":return ht(this,t,r);case"ascii":return ft(this,t,r);case"latin1":case"binary":return dt(this,t,r);case"base64":return ct(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function tt(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function rt(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=Je.from(t,n)),Ke(t))return 0===t.length?-1:nt(e,t,r,n,o);if("number"==typeof t)return t&=255,Je.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):nt(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function nt(e,t,r,n,o){var i,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var c=-1;for(i=r;i<a;i++)if(l(e,i)===l(t,-1===c?0:i-c)){if(-1===c&&(c=i),i-c+1===u)return c*s}else-1!==c&&(i-=i-c),c=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var h=!0,f=0;f<u;f++)if(l(e,i+f)!==l(t,f)){h=!1;break}if(h)return i}return-1}function ot(e,t,r,n){r=Number(r)||0;var o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function it(e,t,r,n){return At(_t(t,e.length-r),e,r,n)}function st(e,t,r,n){return At(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function at(e,t,r,n){return st(e,t,r,n)}function ut(e,t,r,n){return At(Rt(t),e,r,n)}function lt(e,t,r,n){return At(function(e,t){for(var r,n,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function ct(e,t,r){return 0===t&&r===e.length?Be(e):Be(e.slice(t,r))}function ht(e,t,r){r=Math.min(e.length,r);for(var n=[],o=t;o<r;){var i,s,a,u,l=e[o],c=null,h=l>239?4:l>223?3:l>191?2:1;if(o+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(i=e[o+1]))&&(u=(31&l)<<6|63&i)>127&&(c=u);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(u=(15&l)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=h}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}Je.TYPED_ARRAY_SUPPORT=void 0===$.TYPED_ARRAY_SUPPORT||$.TYPED_ARRAY_SUPPORT,Je.poolSize=8192,Je._augment=function(e){return e.__proto__=Je.prototype,e},Je.from=function(e,t,r){return $e(null,e,t,r)},Je.TYPED_ARRAY_SUPPORT&&(Je.prototype.__proto__=Uint8Array.prototype,Je.__proto__=Uint8Array),Je.alloc=function(e,t,r){return function(e,t,r,n){return He(t),t<=0?Ye(e,t):void 0!==r?"string"==typeof n?Ye(e,t).fill(r,n):Ye(e,t).fill(r):Ye(e,t)}(null,e,t,r)},Je.allocUnsafe=function(e){return Ze(null,e)},Je.allocUnsafeSlow=function(e){return Ze(null,e)},Je.isBuffer=function(e){return null!=e&&(!!e._isBuffer||Ot(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&Ot(e.slice(0,0))}(e))},Je.compare=function(e,t){if(!Ke(e)||!Ke(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},Je.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Je.concat=function(e,t){if(!je(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Je.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Je.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){var i=e[r];if(!Ke(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},Je.byteLength=Qe,Je.prototype._isBuffer=!0,Je.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)tt(this,t,t+1);return this},Je.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)tt(this,t,t+3),tt(this,t+1,t+2);return this},Je.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)tt(this,t,t+7),tt(this,t+1,t+6),tt(this,t+2,t+5),tt(this,t+3,t+4);return this},Je.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?ht(this,0,e):et.apply(this,arguments)},Je.prototype.equals=function(e){if(!Ke(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Je.compare(this,e)},Je.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},Je.prototype.compare=function(e,t,r,n,o){if(!Ke(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(i,s),u=this.slice(n,o),l=e.slice(t,r),c=0;c<a;++c)if(u[c]!==l[c]){i=u[c],s=l[c];break}return i<s?-1:s<i?1:0},Je.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Je.prototype.indexOf=function(e,t,r){return rt(this,e,t,r,!0)},Je.prototype.lastIndexOf=function(e,t,r){return rt(this,e,t,r,!1)},Je.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return ot(this,e,t,r);case"utf8":case"utf-8":return it(this,e,t,r);case"ascii":return st(this,e,t,r);case"latin1":case"binary":return at(this,e,t,r);case"base64":return ut(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return lt(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},Je.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ft(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function dt(e,t,r){var n="";r=Math.min(e.length,r);for(var o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function mt(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=t;i<r;++i)o+=Pt(e[i]);return o}function pt(e,t,r){for(var n=e.slice(t,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function gt(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function vt(e,t,r,n,o,i){if(!Ke(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function wt(e,t,r,n){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-r,2);o<i;++o)e[r+o]=(t&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function yt(e,t,r,n){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-r,4);o<i;++o)e[r+o]=t>>>8*(n?o:3-o)&255}function bt(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Ct(e,t,r,n,o){return o||bt(e,0,r,4),Ge(e,t,r,n,23,4),r+4}function It(e,t,r,n,o){return o||bt(e,0,r,8),Ge(e,t,r,n,52,8),r+8}Je.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),Je.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=Je.prototype;else{var o=t-e;r=new Je(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+e]}return r},Je.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||gt(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n},Je.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||gt(e,t,this.length);for(var n=this[e+--t],o=1;t>0&&(o*=256);)n+=this[e+--t]*o;return n},Je.prototype.readUInt8=function(e,t){return t||gt(e,1,this.length),this[e]},Je.prototype.readUInt16LE=function(e,t){return t||gt(e,2,this.length),this[e]|this[e+1]<<8},Je.prototype.readUInt16BE=function(e,t){return t||gt(e,2,this.length),this[e]<<8|this[e+1]},Je.prototype.readUInt32LE=function(e,t){return t||gt(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Je.prototype.readUInt32BE=function(e,t){return t||gt(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Je.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||gt(e,t,this.length);for(var n=this[e],o=1,i=0;++i<t&&(o*=256);)n+=this[e+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},Je.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||gt(e,t,this.length);for(var n=t,o=1,i=this[e+--n];n>0&&(o*=256);)i+=this[e+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},Je.prototype.readInt8=function(e,t){return t||gt(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Je.prototype.readInt16LE=function(e,t){t||gt(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Je.prototype.readInt16BE=function(e,t){t||gt(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Je.prototype.readInt32LE=function(e,t){return t||gt(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Je.prototype.readInt32BE=function(e,t){return t||gt(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Je.prototype.readFloatLE=function(e,t){return t||gt(e,4,this.length),Ve(this,e,!0,23,4)},Je.prototype.readFloatBE=function(e,t){return t||gt(e,4,this.length),Ve(this,e,!1,23,4)},Je.prototype.readDoubleLE=function(e,t){return t||gt(e,8,this.length),Ve(this,e,!0,52,8)},Je.prototype.readDoubleBE=function(e,t){return t||gt(e,8,this.length),Ve(this,e,!1,52,8)},Je.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||vt(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},Je.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||vt(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},Je.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,1,255,0),Je.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Je.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,2,65535,0),Je.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):wt(this,e,t,!0),t+2},Je.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,2,65535,0),Je.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):wt(this,e,t,!1),t+2},Je.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,4,4294967295,0),Je.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):yt(this,e,t,!0),t+4},Je.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,4,4294967295,0),Je.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):yt(this,e,t,!1),t+4},Je.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);vt(this,e,t,r,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<r&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+r},Je.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var o=Math.pow(2,8*r-1);vt(this,e,t,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+r},Je.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,1,127,-128),Je.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Je.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,2,32767,-32768),Je.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):wt(this,e,t,!0),t+2},Je.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,2,32767,-32768),Je.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):wt(this,e,t,!1),t+2},Je.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,4,2147483647,-2147483648),Je.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):yt(this,e,t,!0),t+4},Je.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||vt(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Je.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):yt(this,e,t,!1),t+4},Je.prototype.writeFloatLE=function(e,t,r){return Ct(this,e,t,!0,r)},Je.prototype.writeFloatBE=function(e,t,r){return Ct(this,e,t,!1,r)},Je.prototype.writeDoubleLE=function(e,t,r){return It(this,e,t,!0,r)},Je.prototype.writeDoubleBE=function(e,t,r){return It(this,e,t,!1,r)},Je.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var o,i=n-r;if(this===e&&r<t&&t<n)for(o=i-1;o>=0;--o)e[o+t]=this[o+r];else if(i<1e3||!Je.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+i),t);return i},Je.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Je.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{var s=Ke(e)?e:_t(new Je(e,n).toString()),a=s.length;for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};var Et=/[^+\/0-9A-Za-z-_]/g;function Pt(e){return e<16?"0"+e.toString(16):e.toString(16)}function _t(e,t){var r;t=t||1/0;for(var n=e.length,o=null,i=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function Rt(e){return function(e){var t,r,n,o,i,s;Fe||Le();var a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");i="="===e[a-2]?2:"="===e[a-1]?1:0,s=new xe(3*a/4-i),n=i>0?a-4:a;var u=0;for(t=0,r=0;t<n;t+=4,r+=3)o=Ne[e.charCodeAt(t)]<<18|Ne[e.charCodeAt(t+1)]<<12|Ne[e.charCodeAt(t+2)]<<6|Ne[e.charCodeAt(t+3)],s[u++]=o>>16&255,s[u++]=o>>8&255,s[u++]=255&o;return 2===i?(o=Ne[e.charCodeAt(t)]<<2|Ne[e.charCodeAt(t+1)]>>4,s[u++]=255&o):1===i&&(o=Ne[e.charCodeAt(t)]<<10|Ne[e.charCodeAt(t+1)]<<4|Ne[e.charCodeAt(t+2)]>>2,s[u++]=o>>8&255,s[u++]=255&o),s}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Et,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function At(e,t,r,n){for(var o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function Ot(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var Dt="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},St=/%[sdj%]/g;function Tt(e){if(!$t(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(Ft(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,i=String(e).replace(St,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<o;s=n[++r])zt(s)||!qt(s)?i+=" "+s:i+=" "+Ft(s);return i}function Mt(e,t){if(Zt($.process))return function(){return Mt(e,t).apply(this,arguments)};if(!0===ve.noDeprecation)return e;var r=!1;return function(){if(!r){if(ve.throwDeprecation)throw new Error(t);ve.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}}var Ut,Nt={};function xt(e){if(Zt(Ut)&&(Ut=ve.env.NODE_DEBUG||""),e=e.toUpperCase(),!Nt[e])if(new RegExp("\\b"+e+"\\b","i").test(Ut)){Nt[e]=function(){var t=Tt.apply(null,arguments);console.error("%s %d: %s",e,0,t)}}else Nt[e]=function(){};return Nt[e]}function Ft(e,t){var r={seen:[],stylize:kt};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),jt(t)?r.showHidden=t:t&&ur(r,t),Zt(r.showHidden)&&(r.showHidden=!1),Zt(r.depth)&&(r.depth=2),Zt(r.colors)&&(r.colors=!1),Zt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Lt),Bt(r,e,r.depth)}function Lt(e,t){var r=Ft.styles[t];return r?"["+Ft.colors[r][0]+"m"+e+"["+Ft.colors[r][1]+"m":e}function kt(e,t){return e}function Bt(e,t,r){if(e.customInspect&&t&&er(t.inspect)&&t.inspect!==Ft&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return $t(n)||(n=Bt(e,n,r)),n}var o=function(e,t){if(Zt(t))return e.stylize("undefined","undefined");if($t(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(Jt(t))return e.stylize(""+t,"number");if(jt(t))return e.stylize(""+t,"boolean");if(zt(t))return e.stylize("null","null")}(e,t);if(o)return o;var i=Object.keys(t),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),Qt(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return Vt(t);if(0===i.length){if(er(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(Wt(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Kt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Qt(t))return Vt(t)}var u,l="",c=!1,h=["{","}"];(Xt(t)&&(c=!0,h=["[","]"]),er(t))&&(l=" [Function"+(t.name?": "+t.name:"")+"]");return Wt(t)&&(l=" "+RegExp.prototype.toString.call(t)),Kt(t)&&(l=" "+Date.prototype.toUTCString.call(t)),Qt(t)&&(l=" "+Vt(t)),0!==i.length||c&&0!=t.length?r<0?Wt(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),u=c?function(e,t,r,n,o){for(var i=[],s=0,a=t.length;s<a;++s)lr(t,String(s))?i.push(Gt(e,t,r,n,String(s),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(Gt(e,t,r,n,o,!0))})),i}(e,t,r,s,i):i.map((function(n){return Gt(e,t,r,s,n,c)})),e.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(u,l,h)):h[0]+l+h[1]}function Vt(e){return"["+Error.prototype.toString.call(e)+"]"}function Gt(e,t,r,n,o,i){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),lr(n,o)||(s="["+o+"]"),a||(e.seen.indexOf(u.value)<0?(a=zt(r)?Bt(e,u.value,null):Bt(e,u.value,r-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),Zt(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function Xt(e){return Array.isArray(e)}function jt(e){return"boolean"==typeof e}function zt(e){return null===e}function Yt(e){return null==e}function Jt(e){return"number"==typeof e}function $t(e){return"string"==typeof e}function Ht(e){return"symbol"==typeof e}function Zt(e){return void 0===e}function Wt(e){return qt(e)&&"[object RegExp]"===nr(e)}function qt(e){return"object"==typeof e&&null!==e}function Kt(e){return qt(e)&&"[object Date]"===nr(e)}function Qt(e){return qt(e)&&("[object Error]"===nr(e)||e instanceof Error)}function er(e){return"function"==typeof e}function tr(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function rr(e){return Je.isBuffer(e)}function nr(e){return Object.prototype.toString.call(e)}function or(e){return e<10?"0"+e.toString(10):e.toString(10)}Ft.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Ft.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var ir=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function sr(){var e=new Date,t=[or(e.getHours()),or(e.getMinutes()),or(e.getSeconds())].join(":");return[e.getDate(),ir[e.getMonth()],t].join(" ")}function ar(){console.log("%s - %s",sr(),Tt.apply(null,arguments))}function ur(e,t){if(!t||!qt(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}function lr(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var cr,hr={inherits:Dt,_extend:ur,log:ar,isBuffer:rr,isPrimitive:tr,isFunction:er,isError:Qt,isDate:Kt,isObject:qt,isRegExp:Wt,isUndefined:Zt,isSymbol:Ht,isString:$t,isNumber:Jt,isNullOrUndefined:Yt,isNull:zt,isBoolean:jt,isArray:Xt,inspect:Ft,deprecate:Mt,format:Tt,debuglog:xt},fr=Object.freeze({__proto__:null,format:Tt,deprecate:Mt,debuglog:xt,inspect:Ft,isArray:Xt,isBoolean:jt,isNull:zt,isNullOrUndefined:Yt,isNumber:Jt,isString:$t,isSymbol:Ht,isUndefined:Zt,isRegExp:Wt,isObject:qt,isDate:Kt,isError:Qt,isFunction:er,isPrimitive:tr,isBuffer:rr,log:ar,inherits:Dt,_extend:ur,default:hr});function dr(){if(void 0===cr){var e=new ArrayBuffer(2),t=new Uint8Array(e),r=new Uint16Array(e);if(t[0]=1,t[1]=2,258===r[0])cr="BE";else{if(513!==r[0])throw new Error("unable to figure out endianess");cr="LE"}}return cr}function mr(){return void 0!==$.location?$.location.hostname:""}function pr(){return[]}function gr(){return 0}function vr(){return Number.MAX_VALUE}function wr(){return Number.MAX_VALUE}function yr(){return[]}function br(){return"Browser"}function Cr(){return void 0!==$.navigator?$.navigator.appVersion:""}function Ir(){}function Er(){}function Pr(){return"/tmp"}var _r=Pr,Rr={EOL:"\n",tmpdir:_r,tmpDir:Pr,networkInterfaces:Ir,getNetworkInterfaces:Er,release:Cr,type:br,cpus:yr,totalmem:wr,freemem:vr,uptime:gr,loadavg:pr,hostname:mr,endianness:dr},Ar=(e,t=ve.argv)=>{const r=e.startsWith("-")?"":1===e.length?"-":"--",n=t.indexOf(r+e),o=t.indexOf("--");return-1!==n&&(-1===o||n<o)},Or=Y(Object.freeze({__proto__:null,endianness:dr,hostname:mr,loadavg:pr,uptime:gr,freemem:vr,totalmem:wr,cpus:yr,type:br,release:Cr,networkInterfaces:Ir,getNetworkInterfaces:Er,arch:function(){return"javascript"},platform:function(){return"browser"},tmpDir:Pr,tmpdir:_r,EOL:"\n",default:Rr})),Dr=Y(Me);const{env:Sr}=ve;let Tr;function Mr(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function Ur(e,t){if(0===Tr)return 0;if(Ar("color=16m")||Ar("color=full")||Ar("color=truecolor"))return 3;if(Ar("color=256"))return 2;if(e&&!t&&void 0===Tr)return 0;const r=Tr||0;if("dumb"===Sr.TERM)return r;if("win32"===ve.platform){const e=Or.release().split(".");return Number(e[0])>=10&&Number(e[2])>=10586?Number(e[2])>=14931?3:2:1}if("CI"in Sr)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some((e=>e in Sr))||"codeship"===Sr.CI_NAME?1:r;if("TEAMCITY_VERSION"in Sr)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Sr.TEAMCITY_VERSION)?1:0;if("truecolor"===Sr.COLORTERM)return 3;if("TERM_PROGRAM"in Sr){const e=parseInt((Sr.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Sr.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Sr.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Sr.TERM)||"COLORTERM"in Sr?1:r}Ar("no-color")||Ar("no-colors")||Ar("color=false")||Ar("color=never")?Tr=0:(Ar("color")||Ar("colors")||Ar("color=true")||Ar("color=always"))&&(Tr=1),"FORCE_COLOR"in Sr&&(Tr="true"===Sr.FORCE_COLOR?1:"false"===Sr.FORCE_COLOR?0:0===Sr.FORCE_COLOR.length?1:Math.min(parseInt(Sr.FORCE_COLOR,10),3));var Nr={supportsColor:function(e){return Mr(Ur(e,e&&e.isTTY))},stdout:Mr(Ur(!0,Dr.isatty(1))),stderr:Mr(Ur(!0,Dr.isatty(2)))},xr=Y(fr),Fr=z((function(e,t){t.init=function(e){e.inspectOpts={};const r=Object.keys(t.inspectOpts);for(let n=0;n<r.length;n++)e.inspectOpts[r[n]]=t.inspectOpts[r[n]]},t.log=function(...e){return ve.stderr.write(xr.format(...e)+"\n")},t.formatArgs=function(r){const{namespace:n,useColors:o}=this;if(o){const t=this.color,o="[3"+(t<8?t:"8;5;"+t),i=` ${o};1m${n} `;r[0]=i+r[0].split("\n").join("\n"+i),r.push(o+"m+"+e.exports.humanize(this.diff)+"")}else r[0]=function(){if(t.inspectOpts.hideDate)return"";return(new Date).toISOString()+" "}()+n+" "+r[0]},t.save=function(e){e?ve.env.DEBUG=e:delete ve.env.DEBUG},t.load=function(){return ve.env.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):Dr.isatty(ve.stderr.fd)},t.destroy=xr.deprecate((()=>{}),"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=Nr;e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys(ve.env).filter((e=>/^debug_/i.test(e))).reduce(((e,t)=>{const r=t.substring(6).toLowerCase().replace(/_([a-z])/g,((e,t)=>t.toUpperCase()));let n=ve.env[t];return n=!!/^(yes|on|true|enabled)$/i.test(n)||!/^(no|off|false|disabled)$/i.test(n)&&("null"===n?null:Number(n)),e[r]=n,e}),{}),e.exports=Re(t);const{formatters:r}=e.exports;r.o=function(e){return this.inspectOpts.colors=this.useColors,xr.inspect(e,this.inspectOpts).split("\n").map((e=>e.trim())).join(" ")},r.O=function(e){return this.inspectOpts.colors=this.useColors,xr.inspect(e,this.inspectOpts)}})),Lr=z((function(e){void 0===ve||"renderer"===ve.type||!0===ve.browser||ve.__nwjs?e.exports=Ae:e.exports=Fr}));const kr=Lr("zea:collab"),Br=()=>{let e=r.randomInt(0,360);const[n,o,i]=function(e,t,r){let n=t*Math.min(r,1-r),o=(t,o=(t+e/30)%12)=>r-n*Math.max(Math.min(o-3,9-o,1),-1);return[o(0),o(8),o(4)]}(e,.9,.5);return new t(n,o,i)};const Vr={JOIN_ROOM:"join-room",PING_ROOM:"ping-room",LEAVE_ROOM:"leave-room"};class Gr{#e;constructor(e,t,r={}){this.roomId=null,this.userData=e,this.socketUrl=t,t