/*! For license information please see gs_label_c_sdk_2.0.0.js.LICENSE.txt */ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.gs=e():t.gs=e()}(this,(()=>(()=>{var t={611:(t,e,r)=>{function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r=0;--o){var i=this.tryEntries[o],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var a=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(a&&c){if(this.prev=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;E(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:x(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function s(t,e,r,n,o,i,s){try{var a=t[i](s),c=a.value}catch(t){return void r(t)}a.done?e(c):Promise.resolve(c).then(n,o)}function a(t){return function(){var e=this,r=arguments;return new Promise((function(n,o){var i=t.apply(e,r);function a(t){s(i,n,o,a,c,"next",t)}function c(t){s(i,n,o,a,c,"throw",t)}a(void 0)}))}}var c,u,f,p,h,l,y,d,v,m,b,g,w,k,_,O,E,P,x,S,B,A,R,T,j,N,C,L,M,I,U,D,F,q,W,H,Y,V,K,z,G,J,X,$,Q,Z,tt,et,rt,nt,ot=r(337).io;function it(t){return new Promise((function(e){setTimeout((function(){e()}),t)}))}t.exports={GSDevice:function(t,e,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"ethernet",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4e3;c=t,u=e,f=r,p=o,l=n.toLowerCase()},connect:(nt=a(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("ethernet"!=l||null!=c&&""!=c&&null!=u&&""!=u){t.next=3;break}return alert("socket connect - Host or Port data error!"),t.abrupt("return");case 3:return t.next=5,ot.connect("http://"+f+":"+p,{transports:["websocket"]});case 5:return h=t.sent,t.next=8,h.emit("IP:Port",{host:c,port:u,devInterface:l});case 8:return t.next=10,h.removeAllListeners("connMsg");case 10:return h.on("connMsg",(function(t){e(t)})),t.next=13,h.removeAllListeners("connect_error");case 13:h.on("connect_error",(function(t){console.error('socket.on("connect_error")=>',t),e("Connected failed"),h.disconnect()}));case 14:case"end":return t.stop()}}),t)}))),function(t){return nt.apply(this,arguments)}),disconnect:(rt=a(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("closing","web disconnection!");case 2:return t.next=4,h.removeAllListeners("end");case 4:h.on("end",(function(t){h.disconnect(),e(t)}));case 5:case"end":return t.stop()}}),t)}))),function(t){return rt.apply(this,arguments)}),setup:(et=a(i().mark((function t(e,r,n,o,s,a,c){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"setup",width:e,height:r,speed:n,density:o,sensor:s,vertical:a,offset:c});case 2:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i,s){return et.apply(this,arguments)}),setDirectionAndMirror:(tt=a(i().mark((function t(e){var r,n=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:null,t.next=3,h.emit("cmd",{cmdName:"setDirectionAndMirror",direction:e,mirror:r});case 3:case"end":return t.stop()}}),t)}))),function(t){return tt.apply(this,arguments)}),setShift:(Z=a(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"setShift",shiftY:e});case 2:case"end":return t.stop()}}),t)}))),function(t){return Z.apply(this,arguments)}),printReverse:(Q=a(i().mark((function t(e,r,n,o){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"printReverse",x_start:e,y_start:r,x_width:n,y_height:o});case 2:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return Q.apply(this,arguments)}),setOffset:($=a(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"setOffset",offset:e});case 2:case"end":return t.stop()}}),t)}))),function(t){return $.apply(this,arguments)}),setCutMode:(X=a(i().mark((function t(e){var r,n=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=n.length>1&&void 0!==n[1]?n[1]:1,t.next=3,h.emit("cmd",{cmdName:"setCutMode",mode:e,piece:r});case 3:case"end":return t.stop()}}),t)}))),function(t){return X.apply(this,arguments)}),setAfterPrintAction:(J=a(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"setAfterPrintAction",mode:e});case 2:case"end":return t.stop()}}),t)}))),function(t){return J.apply(this,arguments)}),genericDefault:(G=a(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"genericDefault"});case 2:case"end":return t.stop()}}),t)}))),function(){return G.apply(this,arguments)}),sensorDefault:(z=a(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"sensorDefault"});case 2:case"end":return t.stop()}}),t)}))),function(){return z.apply(this,arguments)}),rfidSetupDefault:(K=a(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"rfidSetupDefault"});case 2:case"end":return t.stop()}}),t)}))),function(){return K.apply(this,arguments)}),clearbuffer:(V=a(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"clearbuffer"});case 2:case"end":return t.stop()}}),t)}))),function(){return V.apply(this,arguments)}),formfeed:(Y=a(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"formfeed"});case 2:case"end":return t.stop()}}),t)}))),function(){return Y.apply(this,arguments)}),nobackfeed:(H=a(i().mark((function t(){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"nobackfeed"});case 2:case"end":return t.stop()}}),t)}))),function(){return H.apply(this,arguments)}),barcode:(W=a(i().mark((function t(e,r,n,o,s,a,c,u,f){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"barcode",x:e,y:r,type:n,height:o,readable:s,rotation:a,narrow:c,wide:u,content:f});case 2:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i,s,a,c){return W.apply(this,arguments)}),printQRcode:(q=a(i().mark((function t(e,r,n,o,s,a,c,u){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"printQRcode",x:e,y:r,eccLevel:n,cellWidth:o,mode:s,rotation:a,content:c,optionalData:u});case 2:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i,s,a){return q.apply(this,arguments)}),printfont:(F=a(i().mark((function t(e,r,n,o,s,a,c){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"printfont",x:e,y:r,fontname:n,rotation:o,xscale:s,yscale:a,text:c});case 2:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i,s){return F.apply(this,arguments)}),printblock:(D=a(i().mark((function t(e,r,n,o,s,a,c,u,f,p,l){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"printblock",x:e,y:r,width:n,height:o,fontname:s,rotation:a,xscale:c,yscale:u,space:f,align:p,content:l});case 2:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i,s,a,c,u,f){return D.apply(this,arguments)}),printlabel:(U=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"printlabel",set:e,copy:r});case 2:case"end":return t.stop()}}),t)}))),function(t,e){return U.apply(this,arguments)}),downloadbmp:(I=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"downloadbmp",fileData:e,bmpName:r});case 2:return t.next=4,it(500);case 4:case"end":return t.stop()}}),t)}))),function(t,e){return I.apply(this,arguments)}),download_Not1BitDepthBMP:(M=a(i().mark((function t(e,r){var n,o,s,a=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=a.length>2&&void 0!==a[2]?a[2]:null,o=a.length>3&&void 0!==a[3]?a[3]:null,s=a.length>4&&void 0!==a[4]?a[4]:128,t.next=5,h.emit("cmd",{cmdName:"download_Not1BitDepthBMP",fileData:e,bmpName:r,byteWidth:n,dotHeight:o,threshold:s});case 5:return t.next=7,it(500);case 7:case"end":return t.stop()}}),t)}))),function(t,e){return M.apply(this,arguments)}),downloadbmp_path:(L=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"downloadbmp_path",dirName:e,filename:r});case 2:return t.next=4,it(500);case 4:case"end":return t.stop()}}),t)}))),function(t,e){return L.apply(this,arguments)}),downloadpcx:(C=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"downloadpcx",fileData:e,pcxName:r});case 2:return t.next=4,it(500);case 4:case"end":return t.stop()}}),t)}))),function(t,e){return C.apply(this,arguments)}),sendCommand:(N=a(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"sendCommand",command:e});case 2:return t.next=4,it(300);case 4:case"end":return t.stop()}}),t)}))),function(t){return N.apply(this,arguments)}),printerstatus:(j=a(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"printerstatus"});case 2:return t.next=4,h.removeAllListeners("status");case 4:h.on("status",(function(t){e(t)}));case 5:case"end":return t.stop()}}),t)}))),function(t){return j.apply(this,arguments)}),labelCalibration:(T=a(i().mark((function t(e,r,n){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e&&r&&["A","C"].includes(e.toUpperCase())&&["R","N"].includes(r.toUpperCase())||n("Fail"),t.next=3,h.emit("cmd",{cmdName:"labelCalibration",mode:e,type:r});case 3:n("Sent!");case 4:case"end":return t.stop()}}),t)}))),function(t,e,r){return T.apply(this,arguments)}),writeUHF:(R=a(i().mark((function t(e,r,n,o,s){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return s=s.toUpperCase(),t.next=3,h.emit("cmd",{cmdName:"writeUHF",dataFormat:e,startBlockNo:r,byteSize:n,Gen2MemoryBank:o,datastring:s});case 3:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o){return R.apply(this,arguments)}),EPCPWD_Action:(A=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"EPCPWD_Action",action:e,password:r});case 2:case"end":return t.stop()}}),t)}))),function(t,e){return A.apply(this,arguments)}),TIDPWD_Action:(B=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"TIDPWD_Action",action:e,password:r});case 2:case"end":return t.stop()}}),t)}))),function(t,e){return B.apply(this,arguments)}),USERPWD_Action:(S=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"USERPWD_Action",action:e,password:r});case 2:case"end":return t.stop()}}),t)}))),function(t,e){return S.apply(this,arguments)}),AccessPWD_Action:(x=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"AccessPWD_Action",action:e,password:r});case 2:case"end":return t.stop()}}),t)}))),function(t,e){return x.apply(this,arguments)}),KillPWD_Action:(P=a(i().mark((function t(e,r){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"KillPWD_Action",action:e,password:r});case 2:case"end":return t.stop()}}),t)}))),function(t,e){return P.apply(this,arguments)}),Set_RFIDProcedure:(E=a(i().mark((function t(e,r,n,o,s,a,c){var u,f=arguments;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return u=f.length>7&&void 0!==f[7]?f[7]:null,t.next=3,h.emit("cmd",{cmdName:"Set_RFIDProcedure",tagType:e,rw_position:r,void_printout:n,tryEncodie_times:o,error_handle:s,speed:a,retry_times:c,dpi:u});case 3:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i,s){return E.apply(this,arguments)}),writeHF:(O=a(i().mark((function t(e,r,n,o){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return o=o.toUpperCase(),t.next=3,h.emit("cmd",{cmdName:"writeHF",dataFormat:e,startBlockNo:r,byteSize:n,datastring:o});case 3:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return O.apply(this,arguments)}),readUHF:(_=a(i().mark((function t(e,r,n,o,s){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"readUHF",dataFormat:e,startBlockNo:r,byteSize:n,Gen2MemoryBank:o});case 2:return t.next=4,h.removeAllListeners("epcData");case 4:h.once("epcData",(function(t){s(t)}));case 5:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o){return _.apply(this,arguments)}),queryUHF:(k=a(i().mark((function t(e,r,n,o){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"queryUHF",dataFormat:e,pcReturnSetting:r,crc16ReturnSetting:n});case 2:return t.next=4,h.removeAllListeners("epcNumber");case 4:h.once("epcNumber",(function(t){o(t)}));case 5:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return k.apply(this,arguments)}),writeGJB:(w=a(i().mark((function t(e,r,n,o,s,a){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return"H"==e&&(s=s.toUpperCase()),t.next=3,h.emit("cmd",{cmdName:"writeGJB",dataFormat:e,startBlockNo:r,byteSize:n,GJBMemoryBank:o,datastring:s,writePassword:a});case 3:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i){return w.apply(this,arguments)}),readGJB:(g=a(i().mark((function t(e,r,n,o,s,a){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"readGJB",dataFormat:e,startBlockNo:r,byteSize:n,GJBMemoryBank:o,readPassword:s});case 2:if("E"!=o){t.next=8;break}return t.next=5,h.removeAllListeners("gjbEpcData");case 5:h.once("gjbEpcData",(function(t){a("E",t)})),t.next=12;break;case 8:if("U"!=o){t.next=12;break}return t.next=11,h.removeAllListeners("gjbUserData");case 11:h.once("gjbUserData",(function(t){a("U",t)}));case 12:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i){return g.apply(this,arguments)}),setState_Action:(b=a(i().mark((function t(e,r,n){var s,a;return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(s={E:["A","B"],U:["A","B","C","D"],T:["B","D"],F:["C","D"]},(a=[]).push.apply(a,function(t){if(Array.isArray(t))return o(t)}(i=s[e])||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a.includes(r)){t.next=6;break}return console.warn("setState_Action: Not accept [".concat(r,"] action!")),t.abrupt("return");case 6:return t.next=8,h.emit("cmd",{cmdName:"setState_Action",GJBMemoryBank:e,action:r,statePwd:n});case 8:case"end":return t.stop()}var i}),t)}))),function(t,e,r){return b.apply(this,arguments)}),setPWD_Action:(m=a(i().mark((function t(e,r,n,o){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"setPWD_Action",pwdArea:e,action:r,newPwd:n,writePwd:o});case 2:case"end":return t.stop()}}),t)}))),function(t,e,r,n){return m.apply(this,arguments)}),killTag_Action:(v=a(i().mark((function t(e){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"killTag_Action",killPwd:e});case 2:case"end":return t.stop()}}),t)}))),function(t){return v.apply(this,arguments)}),printBMP:(d=a(i().mark((function t(e,r,n,o,s,a,c,u){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"printBMP",x:e,y:r,byteWidth:n,dotHeight:o,mode:s,filename:a,fileData:c,threshold:u});case 2:return t.next=4,it(500);case 4:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i,s,a){return d.apply(this,arguments)}),printBMP_Compression:(y=a(i().mark((function t(e,r,n,o,s,a,c){return i().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,h.emit("cmd",{cmdName:"printBMP_Compression",x:e,y:r,byteWidth:n,dotHeight:o,filename:s,fileData:a,threshold:c});case 2:return t.next=4,it(500);case 4:case"end":return t.stop()}}),t)}))),function(t,e,r,n,o,i,s){return y.apply(this,arguments)})}},55:(t,e)=>{"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=c(t),s=i[0],a=i[1],u=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),f=0,p=a>0?s-4:s;for(r=0;r>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,c=n-o;ac?c:a+s));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=i.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,n){for(var o,i,s=[],a=e;a>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},352:(t,e,r)=>{"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;rl)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,d.prototype),e}function d(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return b(t)}return v(t,e,r)}function v(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|_(t,e),n=y(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(rt(t,Uint8Array)){var e=new Uint8Array(t);return w(e.buffer,e.byteOffset,e.byteLength)}return g(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(t));if(rt(t,ArrayBuffer)||t&&rt(t.buffer,ArrayBuffer))return w(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(rt(t,SharedArrayBuffer)||t&&rt(t.buffer,SharedArrayBuffer)))return w(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return d.from(n,e,r);var o=function(t){if(d.isBuffer(t)){var e=0|k(t.length),r=y(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||nt(t.length)?y(0):g(t):"Buffer"===t.type&&Array.isArray(t.data)?g(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return d.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+u(t))}function m(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function b(t){return m(t),y(t<0?0:0|k(t))}function g(t){for(var e=t.length<0?0:0|k(t.length),r=y(e),n=0;n=l)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+l.toString(16)+" bytes");return 0|t}function _(t,e){if(d.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||rt(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+u(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return tt(t).length;default:if(o)return n?-1:Z(t).length;e=(""+e).toLowerCase(),o=!0}}function O(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return N(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return M(this,e,r);case"base64":return j(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function E(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function P(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),nt(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=d.from(e,n)),d.isBuffer(e))return 0===e.length?-1:x(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):x(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function x(t,e,r,n,o){var i,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;ia&&(r=a-c),i=r;i>=0;i--){for(var p=!0,h=0;ho&&(n=o):n=o;var i,s=e.length;for(n>s/2&&(n=s/2),i=0;i>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function j(t,e,r){return 0===e&&r===t.length?f.fromByteArray(t):f.fromByteArray(t.slice(e,r))}function N(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o239?4:i>223?3:i>191?2:1;if(o+a<=r){var c=void 0,u=void 0,f=void 0,p=void 0;switch(a){case 1:i<128&&(s=i);break;case 2:128==(192&(c=t[o+1]))&&(p=(31&i)<<6|63&c)>127&&(s=p);break;case 3:c=t[o+1],u=t[o+2],128==(192&c)&&128==(192&u)&&(p=(15&i)<<12|(63&c)<<6|63&u)>2047&&(p<55296||p>57343)&&(s=p);break;case 4:c=t[o+1],u=t[o+2],f=t[o+3],128==(192&c)&&128==(192&u)&&128==(192&f)&&(p=(15&i)<<18|(63&c)<<12|(63&u)<<6|63&f)>65535&&p<1114112&&(s=p)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=a}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);for(var r="",n=0;nn.length?(d.isBuffer(i)||(i=d.from(i)),i.copy(n,o)):Uint8Array.prototype.set.call(n,i,o);else{if(!d.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o)}o+=i.length}return n},d.byteLength=_,d.prototype._isBuffer=!0,d.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;er&&(t+=" ... "),""},h&&(d.prototype[h]=d.prototype.inspect),d.prototype.compare=function(t,e,r,n,o){if(rt(t,Uint8Array)&&(t=d.from(t,t.offset,t.byteLength)),!d.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+u(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),p=0;p>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return S(this,t,e,r);case"utf8":case"utf-8":return B(this,t,e,r);case"ascii":case"latin1":case"binary":return A(this,t,e,r);case"base64":return R(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},d.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function L(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;on)&&(r=n);for(var o="",i=e;ir)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,r,n,o,i){if(!d.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function q(t,e,r,n,o){J(e,n,o,t,r,7);var i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;var s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function W(t,e,r,n,o){J(e,n,o,t,r,7);var i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;var s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function H(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Y(t,e,r,n,o){return e=+e,r>>>=0,o||H(t,0,r,4),p.write(t,e,r,n,23,4),r+4}function V(t,e,r,n,o){return e=+e,r>>>=0,o||H(t,0,r,8),p.write(t,e,r,n,52,8),r+8}d.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t],o=1,i=0;++i>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},d.prototype.readUint8=d.prototype.readUInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),this[t]},d.prototype.readUint16LE=d.prototype.readUInt16LE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]|this[t+1]<<8},d.prototype.readUint16BE=d.prototype.readUInt16BE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]<<8|this[t+1]},d.prototype.readUint32LE=d.prototype.readUInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},d.prototype.readUint32BE=d.prototype.readUInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},d.prototype.readBigUInt64LE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=e+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,24),o=this[++t]+this[++t]*Math.pow(2,8)+this[++t]*Math.pow(2,16)+r*Math.pow(2,24);return BigInt(n)+(BigInt(o)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=e*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t],o=this[++t]*Math.pow(2,24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+r;return(BigInt(n)<>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t],o=1,i=0;++i=(o*=128)&&(n-=Math.pow(2,8*e)),n},d.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},d.prototype.readInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},d.prototype.readInt16LE=function(t,e){t>>>=0,e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt16BE=function(t,e){t>>>=0,e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},d.prototype.readInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},d.prototype.readInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},d.prototype.readBigInt64LE=it((function(t){X(t>>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=this[t+4]+this[t+5]*Math.pow(2,8)+this[t+6]*Math.pow(2,16)+(r<<24);return(BigInt(n)<>>=0,"offset");var e=this[t],r=this[t+7];void 0!==e&&void 0!==r||$(t,this.length-8);var n=(e<<24)+this[++t]*Math.pow(2,16)+this[++t]*Math.pow(2,8)+this[++t];return(BigInt(n)<>>=0,e||D(t,4,this.length),p.read(this,t,!0,23,4)},d.prototype.readFloatBE=function(t,e){return t>>>=0,e||D(t,4,this.length),p.read(this,t,!1,23,4)},d.prototype.readDoubleLE=function(t,e){return t>>>=0,e||D(t,8,this.length),p.read(this,t,!0,52,8)},d.prototype.readDoubleBE=function(t,e){return t>>>=0,e||D(t,8,this.length),p.read(this,t,!1,52,8)},d.prototype.writeUintLE=d.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||F(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n||F(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},d.prototype.writeUint8=d.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,1,255,0),this[e]=255&t,e+1},d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigUInt64LE=it((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return q(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeBigUInt64BE=it((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return W(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),d.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);F(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i>0)-a&255;return e+r},d.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);F(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s>>0)-a&255;return e+r},d.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},d.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},d.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},d.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},d.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},d.prototype.writeBigInt64LE=it((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return q(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeBigInt64BE=it((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return W(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),d.prototype.writeFloatLE=function(t,e,r){return Y(this,t,e,!0,r)},d.prototype.writeFloatBE=function(t,e,r){return Y(this,t,e,!1,r)},d.prototype.writeDoubleLE=function(t,e,r){return V(this,t,e,!0,r)},d.prototype.writeDoubleBE=function(t,e,r){return V(this,t,e,!1,r)},d.prototype.copy=function(t,e,r,n){if(!d.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e="_".concat(t.slice(r-3,r)).concat(e);return"".concat(t.slice(0,r)).concat(e)}function J(t,e,r,n,o,i){if(t>r||t3?0===e||e===BigInt(0)?">= 0".concat(a," and < 2").concat(a," ** ").concat(8*(i+1)).concat(a):">= -(2".concat(a," ** ").concat(8*(i+1)-1).concat(a,") and < 2 ** ")+"".concat(8*(i+1)-1).concat(a):">= ".concat(e).concat(a," and <= ").concat(r).concat(a),new K.ERR_OUT_OF_RANGE("value",s,t)}!function(t,e,r){X(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||$(e,t.length-(r+1))}(n,o,i)}function X(t,e){if("number"!=typeof t)throw new K.ERR_INVALID_ARG_TYPE(e,"number",t)}function $(t,e,r){if(Math.floor(t)!==t)throw X(t,r),new K.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new K.ERR_BUFFER_OUT_OF_BOUNDS;throw new K.ERR_OUT_OF_RANGE(r||"offset",">= ".concat(r?1:0," and <= ").concat(e),t)}z("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?"".concat(t," is outside of buffer bounds"):"Attempt to access memory outside buffer bounds"}),RangeError),z("ERR_INVALID_ARG_TYPE",(function(t,e){return'The "'.concat(t,'" argument must be of type number. Received type ').concat(u(e))}),TypeError),z("ERR_OUT_OF_RANGE",(function(t,e,r){var n='The value of "'.concat(t,'" is out of range.'),o=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?o=G(String(r)):"bigint"==typeof r&&(o=String(r),(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(o=G(o)),o+="n"),n+" It must be ".concat(e,". Received ").concat(o)}),RangeError);var Q=/[^+/0-9A-Za-z-_]/g;function Z(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=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((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function tt(t){return f.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function et(t,e,r,n){var o;for(o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function rt(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function nt(t){return t!=t}var ot=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,o=0;o<16;++o)e[n+o]=t[r]+t[o];return e}();function it(t){return"undefined"==typeof BigInt?st:t}function st(){throw new Error("BigInt not supported")}},105:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,c=(1<>1,f=-7,p=r?o-1:0,h=r?-1:1,l=t[e+p];for(p+=h,i=l&(1<<-f)-1,l>>=-f,f+=a;f>0;i=256*i+t[e+p],p+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+p],p+=h,f-=8);if(0===i)i=1-u;else{if(i===c)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),i-=u}return(l?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,c,u=8*i-o-1,f=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,y=n?1:-1,d=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+p>=1?h/c:h*Math.pow(2,1-p))*c>=2&&(s++,c/=2),s+p>=f?(a=0,s=f):s+p>=1?(a=(e*c-1)*Math.pow(2,o),s+=p):(a=e*Math.pow(2,p-1)*Math.pow(2,o),s=0));o>=8;t[r+l]=255&a,l+=y,a/=256,o-=8);for(s=s<0;t[r+l]=255&s,l+=y,s/=256,u-=8);t[r+l-y]|=128*d}},923:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hasCORS=void 0;var r=!1;try{r="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(t){}e.hasCORS=r},99:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=e.encode=void 0,e.encode=function(t){var e="";for(var r in t)t.hasOwnProperty(r)&&(e.length&&(e+="&"),e+=encodeURIComponent(r)+"="+encodeURIComponent(t[r]));return e},e.decode=function(t){for(var e={},r=t.split("&"),n=0,o=r.length;n{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parse=void 0;var r=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,n=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.parse=function(t){var e,o,i=t,s=t.indexOf("["),a=t.indexOf("]");-1!=s&&-1!=a&&(t=t.substring(0,s)+t.substring(s,a).replace(/:/g,";")+t.substring(a,t.length));for(var c,u,f=r.exec(t||""),p={},h=14;h--;)p[n[h]]=f[h]||"";return-1!=s&&-1!=a&&(p.source=i,p.host=p.host.substring(1,p.host.length-1).replace(/;/g,":"),p.authority=p.authority.replace("[","").replace("]","").replace(/;/g,":"),p.ipv6uri=!0),p.pathNames=(e=p.path,o=e.replace(/\/{2,9}/g,"/").split("/"),"/"!=e.substr(0,1)&&0!==e.length||o.splice(0,1),"/"==e.substr(e.length-1,1)&&o.splice(o.length-1,1),o),p.queryKey=(c=p.query,u={},c.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,(function(t,e,r){e&&(u[e]=r)})),u),p}},994:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.yeast=e.decode=e.encode=void 0;var r,n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),o={},i=0,s=0;function a(t){var e="";do{e=n[t%64]+e,t=Math.floor(t/64)}while(t>0);return e}for(e.encode=a,e.decode=function(t){var e=0;for(s=0;s{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.globalThisShim=void 0,e.globalThisShim="undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this")()},965:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parse=e.installTimerFunctions=e.transports=e.Transport=e.protocol=e.Socket=void 0;var n=r(874);Object.defineProperty(e,"Socket",{enumerable:!0,get:function(){return n.Socket}}),e.protocol=n.Socket.protocol;var o=r(708);Object.defineProperty(e,"Transport",{enumerable:!0,get:function(){return o.Transport}});var i=r(122);Object.defineProperty(e,"transports",{enumerable:!0,get:function(){return i.transports}});var s=r(217);Object.defineProperty(e,"installTimerFunctions",{enumerable:!0,get:function(){return s.installTimerFunctions}});var a=r(183);Object.defineProperty(e,"parse",{enumerable:!0,get:function(){return a.parse}})},874:function(t,e,r){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return i(this,g),e=b.call(this),t&&"object"===o(t)&&(r=t,t=null),t?(t=(0,y.parse)(t),r.hostname=t.host,r.secure="https"===t.protocol||"wss"===t.protocol,r.port=t.port,t.query&&(r.query=t.query)):r.host&&(r.hostname=(0,y.parse)(r.host).host),(0,h.installTimerFunctions)(u(e),r),e.secure=null!=r.secure?r.secure:"undefined"!=typeof location&&"https:"===location.protocol,r.hostname&&!r.port&&(r.port=e.secure?"443":"80"),e.hostname=r.hostname||("undefined"!=typeof location?location.hostname:"localhost"),e.port=r.port||("undefined"!=typeof location&&location.port?location.port:e.secure?"443":"80"),e.transports=r.transports||["polling","websocket"],e.readyState="",e.writeBuffer=[],e.prevBufferLen=0,e.opts=n({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},r),e.opts.path=e.opts.path.replace(/\/$/,"")+"/","string"==typeof e.opts.query&&(e.opts.query=(0,l.decode)(e.opts.query)),e.id=null,e.upgrades=null,e.pingInterval=null,e.pingTimeout=null,e.pingTimeoutTimer=null,"function"==typeof addEventListener&&(e.opts.closeOnBeforeunload&&addEventListener("beforeunload",(function(){e.transport&&(e.transport.removeAllListeners(),e.transport.close())}),!1),"localhost"!==e.hostname&&(e.offlineEventListener=function(){e.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",e.offlineEventListener,!1))),e.open(),e}return e=g,(r=[{key:"createTransport",value:function(t){var e=n({},this.opts.query);e.EIO=v.protocol,e.transport=t,this.id&&(e.sid=this.id);var r=n({},this.opts.transportOptions[t],this.opts,{query:e,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new p.transports[t](r)}},{key:"open",value:function(){var t,e=this;if(this.opts.rememberUpgrade&&g.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))t="websocket";else{if(0===this.transports.length)return void this.setTimeoutFn((function(){e.emitReserved("error","No transports available")}),0);t=this.transports[0]}this.readyState="opening";try{t=this.createTransport(t)}catch(t){return this.transports.shift(),void this.open()}t.open(),this.setTransport(t)}},{key:"setTransport",value:function(t){var e=this;this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",(function(t){return e.onClose("transport close",t)}))}},{key:"probe",value:function(t){var e=this,r=this.createTransport(t),n=!1;g.priorWebsocketSuccess=!1;var o=function(){n||(r.send([{type:"ping",data:"probe"}]),r.once("packet",(function(t){if(!n)if("pong"===t.type&&"probe"===t.data){if(e.upgrading=!0,e.emitReserved("upgrading",r),!r)return;g.priorWebsocketSuccess="websocket"===r.name,e.transport.pause((function(){n||"closed"!==e.readyState&&(f(),e.setTransport(r),r.send([{type:"upgrade"}]),e.emitReserved("upgrade",r),r=null,e.upgrading=!1,e.flush())}))}else{var o=new Error("probe error");o.transport=r.name,e.emitReserved("upgradeError",o)}})))};function i(){n||(n=!0,f(),r.close(),r=null)}var s=function(t){var n=new Error("probe error: "+t);n.transport=r.name,i(),e.emitReserved("upgradeError",n)};function a(){s("transport closed")}function c(){s("socket closed")}function u(t){r&&t.name!==r.name&&i()}var f=function(){r.removeListener("open",o),r.removeListener("error",s),r.removeListener("close",a),e.off("close",c),e.off("upgrading",u)};r.once("open",o),r.once("error",s),r.once("close",a),this.once("close",c),this.once("upgrading",u),r.open()}},{key:"onOpen",value:function(){if(this.readyState="open",g.priorWebsocketSuccess="websocket"===this.transport.name,this.emitReserved("open"),this.flush(),"open"===this.readyState&&this.opts.upgrade&&this.transport.pause)for(var t=0,e=this.upgrades.length;t1))return this.writeBuffer;for(var t=1,e=0;e0&&t>this.maxPayload)return this.writeBuffer.slice(0,e);t+=2}return this.writeBuffer}},{key:"write",value:function(t,e,r){return this.sendPacket("message",t,e,r),this}},{key:"send",value:function(t,e,r){return this.sendPacket("message",t,e,r),this}},{key:"sendPacket",value:function(t,e,r,n){if("function"==typeof e&&(n=e,e=void 0),"function"==typeof r&&(n=r,r=null),"closing"!==this.readyState&&"closed"!==this.readyState){(r=r||{}).compress=!1!==r.compress;var o={type:t,data:e,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),n&&this.once("flush",n),this.flush()}}},{key:"close",value:function(){var t=this,e=function(){t.onClose("forced close"),t.transport.close()},r=function r(){t.off("upgrade",r),t.off("upgradeError",r),e()},n=function(){t.once("upgrade",r),t.once("upgradeError",r)};return"opening"!==this.readyState&&"open"!==this.readyState||(this.readyState="closing",this.writeBuffer.length?this.once("drain",(function(){t.upgrading?n():e()})):this.upgrading?n():e()),this}},{key:"onError",value:function(t){g.priorWebsocketSuccess=!1,this.emitReserved("error",t),this.onClose("transport error",t)}},{key:"onClose",value:function(t,e){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),"function"==typeof removeEventListener&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",t,e),this.writeBuffer=[],this.prevBufferLen=0)}},{key:"filterUpgrades",value:function(t){for(var e=[],r=0,n=t.length;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.transports=void 0;var n=r(945),o=r(941);e.transports={websocket:o.WS,polling:n.Polling}},945:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){return o=Object.assign?Object.assign.bind():function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};return o(t,{xd:this.xd,xs:this.xs},this.opts),new P(this.uri(),t)}},{key:"doWrite",value:function(t,e){var r=this,n=this.request({method:"POST",data:t});n.on("success",e),n.on("error",(function(t,e){r.onError("xhr post error",t,e)}))}},{key:"doPoll",value:function(){var t=this,e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(function(e,r){t.onError("xhr poll error",e,r)})),this.pollXhr=e}}]),r}(y.Transport);e.Polling=E;var P=function(t){c(r,t);var e=f(r);function r(t,n){var o;return i(this,r),o=e.call(this),(0,w.installTimerFunctions)(h(o),n),o.opts=n,o.method=n.method||"GET",o.uri=t,o.async=!1!==n.async,o.data=void 0!==n.data?n.data:null,o.create(),o}return a(r,[{key:"create",value:function(){var t=this,e=(0,w.pick)(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;var n=this.xhr=new b.XHR(e);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders)for(var o in n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0),this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(o)&&n.setRequestHeader(o,this.opts.extraHeaders[o])}catch(t){}if("POST"===this.method)try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(t){}try{n.setRequestHeader("Accept","*/*")}catch(t){}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=function(){4===n.readyState&&(200===n.status||1223===n.status?t.onLoad():t.setTimeoutFn((function(){t.onError("number"==typeof n.status?n.status:0)}),0))},n.send(this.data)}catch(e){return void this.setTimeoutFn((function(){t.onError(e)}),0)}"undefined"!=typeof document&&(this.index=r.requestsCount++,r.requests[this.index]=this)}},{key:"onError",value:function(t){this.emitReserved("error",t,this.xhr),this.cleanup(!0)}},{key:"cleanup",value:function(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.xhr.onreadystatechange=_,t)try{this.xhr.abort()}catch(t){}"undefined"!=typeof document&&delete r.requests[this.index],this.xhr=null}}},{key:"onLoad",value:function(){var t=this.xhr.responseText;null!==t&&(this.emitReserved("data",t),this.emitReserved("success"),this.cleanup())}},{key:"abort",value:function(){this.cleanup()}}]),r}(g.Emitter);if(e.Request=P,P.requestsCount=0,P.requests={},"undefined"!=typeof document)if("function"==typeof attachEvent)attachEvent("onunload",S);else if("function"==typeof addEventListener){var x="onpagehide"in k.globalThisShim?"pagehide":"unload";addEventListener(x,S,!1)}function S(){for(var t in P.requests)P.requests.hasOwnProperty(t)&&P.requests[t].abort()}},108:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultBinaryType=e.usingBrowserWebSocket=e.WebSocket=e.nextTick=void 0;var n=r(467);e.nextTick="function"==typeof Promise&&"function"==typeof Promise.resolve?function(t){return Promise.resolve().then(t)}:function(t,e){return e(t,0)},e.WebSocket=n.globalThisShim.WebSocket||n.globalThisShim.MozWebSocket,e.usingBrowserWebSocket=!0,e.defaultBinaryType="arraybuffer"},941:function(t,e,r){"use strict";var n=r(352).Buffer;function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function i(t,e){for(var r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.XHR=void 0;var n=r(923),o=r(467);e.XHR=function(t){var e=t.xdomain;try{if("undefined"!=typeof XMLHttpRequest&&(!e||n.hasCORS))return new XMLHttpRequest}catch(t){}if(!e)try{return new(o.globalThisShim[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},217:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.byteLength=e.installTimerFunctions=e.pick=void 0;var n=r(467);e.pick=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),n=1;n=57344?r+=3:(n++,r+=4);return r}(t):Math.ceil(1.33*(t.byteLength||t.size))}},22:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ERROR_PACKET=e.PACKET_TYPES_REVERSE=e.PACKET_TYPES=void 0;var r=Object.create(null);e.PACKET_TYPES=r,r.open="0",r.close="1",r.ping="2",r.pong="3",r.message="4",r.upgrade="5",r.noop="6";var n=Object.create(null);e.PACKET_TYPES_REVERSE=n,Object.keys(r).forEach((function(t){n[r[t]]=t})),e.ERROR_PACKET={type:"error",data:"parser error"}},930:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decode=e.encode=void 0;for(var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n="undefined"==typeof Uint8Array?[]:new Uint8Array(256),o=0;o>2],i+=r[(3&n[e])<<4|n[e+1]>>4],i+=r[(15&n[e+1])<<2|n[e+2]>>6],i+=r[63&n[e+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,r,o,i,s,a=.75*t.length,c=t.length,u=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var f=new ArrayBuffer(a),p=new Uint8Array(f);for(e=0;e>4,p[u++]=(15&o)<<4|i>>2,p[u++]=(3&i)<<6|63&s;return f}},887:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(22),o=r(930),i="function"==typeof ArrayBuffer,s=function(t,e){if(i){var r=(0,o.decode)(t);return a(r,e)}return{base64:!0,data:t}},a=function(t,e){return"blob"===e&&t instanceof ArrayBuffer?new Blob([t]):t};e.default=function(t,e){if("string"!=typeof t)return{type:"message",data:a(t,e)};var r=t.charAt(0);return"b"===r?{type:"message",data:s(t.substring(1),e)}:n.PACKET_TYPES_REVERSE[r]?t.length>1?{type:n.PACKET_TYPES_REVERSE[r],data:t.substring(1)}:{type:n.PACKET_TYPES_REVERSE[r]}:n.ERROR_PACKET}},58:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(22),o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===Object.prototype.toString.call(Blob),i="function"==typeof ArrayBuffer,s=function(t,e){var r=new FileReader;return r.onload=function(){var t=r.result.split(",")[1];e("b"+t)},r.readAsDataURL(t)};e.default=function(t,e,r){var a,c=t.type,u=t.data;return o&&u instanceof Blob?e?r(u):s(u,r):i&&(u instanceof ArrayBuffer||(a=u,"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(a):a&&a.buffer instanceof ArrayBuffer))?e?r(u):s(new Blob([u]),r):r(n.PACKET_TYPES[c]+(u||""))}},222:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodePayload=e.decodePacket=e.encodePayload=e.encodePacket=e.protocol=void 0;var n=r(58);e.encodePacket=n.default;var o=r(887);e.decodePacket=o.default;var i=String.fromCharCode(30);e.encodePayload=function(t,e){var r=t.length,o=new Array(r),s=0;t.forEach((function(t,a){(0,n.default)(t,!1,(function(t){o[a]=t,++s===r&&e(o.join(i))}))}))},e.decodePayload=function(t,e){for(var r=t.split(i),n=[],s=0;s{"use strict";function r(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}Object.defineProperty(e,"__esModule",{value:!0}),e.Backoff=void 0,e.Backoff=r,r.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),r=Math.floor(e*this.jitter*t);t=0==(1&Math.floor(10*e))?t-r:t+r}return 0|Math.min(t,this.max)},r.prototype.reset=function(){this.attempts=0},r.prototype.setMin=function(t){this.ms=t},r.prototype.setMax=function(t){this.max=t},r.prototype.setJitter=function(t){this.jitter=t}},337:function(t,e,r){"use strict";function n(){return n=Object.assign?Object.assign.bind():function(t){for(var e=1;e=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{var r=this.backoff.duration();this._reconnecting=!0;var n=this.setTimeoutFn((function(){e.skipReconnect||(t.emitReserved("reconnect_attempt",e.backoff.attempts),e.skipReconnect||e.open((function(r){r?(e._reconnecting=!1,e.reconnect(),t.emitReserved("reconnect_error",r)):e.onreconnect()})))}),r);this.opts.autoUnref&&n.unref(),this.subs.push((function(){clearTimeout(n)}))}}},{key:"onreconnect",value:function(){var t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}],r&&o(e.prototype,r),Object.defineProperty(e,"prototype",{writable:!1}),m}(r(544).Emitter);e.Manager=m},66:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.on=void 0,e.on=function(t,e,r){return t.on(e,r),function(){t.off(e,r)}}},829:function(t,e,r){"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r1?e-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,o=t;r=r||"undefined"!=typeof location&&location,null==t&&(t=r.protocol+"//"+r.host),"string"==typeof t&&("/"===t.charAt(0)&&(t="/"===t.charAt(1)?r.protocol+t:r.host+t),/^(https?|wss?):\/\//.test(t)||(t=void 0!==r?r.protocol+"//"+t:"https://"+t),o=n.parse(t)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";var i=-1!==o.host.indexOf(":"),s=i?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+s+":"+o.port+e,o.href=o.protocol+"://"+s+(r&&r.port===o.port?"":":"+o.port),o}},64:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.reconstructPacket=e.deconstructPacket=void 0;var o=r(942);function i(t,e){if(!t)return t;if(o.isBinary(t)){var r={_placeholder:!0,num:e.length};return e.push(t),r}if(Array.isArray(t)){for(var s=new Array(t.length),a=0;a{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function o(){return o="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=i(t,e);if(n){var o=Object.getOwnPropertyDescriptor(n,e);return o.get?o.get.call(arguments.length<3?t:r):o.value}},o.apply(this,arguments)}function i(t,e){for(;!Object.prototype.hasOwnProperty.call(t,e)&&null!==(t=c(t)););return t}function s(t,e){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},s(t,e)}function a(t,e){if(e&&("object"===n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function c(t){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(t)}function u(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var r=0;r0;case h.ACK:case h.BINARY_ACK:return Array.isArray(e)}}}]),f}(l.Emitter);e.Decoder=m;var b=function(){function t(e){u(this,t),this.packet=e,this.buffers=[],this.reconPack=e}return p(t,[{key:"takeBinaryData",value:function(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){var e=y.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),e}return null}},{key:"finishedReconstruction",value:function(){this.reconPack=null,this.buffers=[]}}]),t}()},942:(t,e)=>{"use strict";function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.hasBinary=e.isBinary=void 0;var n="function"==typeof ArrayBuffer,o=Object.prototype.toString,i="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===o.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===o.call(File);function a(t){return n&&(t instanceof ArrayBuffer||function(t){return"function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer}(t))||i&&t instanceof Blob||s&&t instanceof File}e.isBinary=a,e.hasBinary=function t(e,n){if(!e||"object"!==r(e))return!1;if(Array.isArray(e)){for(var o=0,i=e.length;o{"use strict";function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}r.r(e),r.d(e,{Emitter:()=>n}),n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r(611)})()));