import{n as e,r as t,s as n}from"./jsx-runtime-Bzw2jH9X.js";var r=n(e()),i=Object.defineProperty,a=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable,c=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l=(e,t)=>{for(var n in t||={})o.call(t,n)&&c(e,n,t[n]);if(a)for(var n of a(t))s.call(t,n)&&c(e,n,t[n]);return e},u=(e,t)=>{var n={};for(var r in e)o.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&a)for(var r of a(e))t.indexOf(r)<0&&s.call(e,r)&&(n[r]=e[r]);return n},d;(e=>{let t=class t{constructor(e,n,r,a){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version value out of range`);if(a<-1||a>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let o=[];for(let e=0;e<this.size;e++)o.push(!1);for(let e=0;e<this.size;e++)this.modules.push(o.slice()),this.isFunction.push(o.slice());this.drawFunctionPatterns();let s=this.addEccAndInterleave(r);if(this.drawCodewords(s),a==-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(a=t,e=n),this.applyMask(t)}}i(0<=a&&a<=7),this.mask=a,this.applyMask(a),this.drawFormatBits(a),this.isFunction=[]}static encodeText(n,r){let i=e.QrSegment.makeSegments(n);return t.encodeSegments(i,r)}static encodeBinary(n,r){let i=e.QrSegment.makeBytes(n);return t.encodeSegments([i],r)}static encodeSegments(e,r,a=1,s=40,c=-1,l=!0){if(!(t.MIN_VERSION<=a&&a<=s&&s<=t.MAX_VERSION)||c<-1||c>7)throw RangeError(`Invalid value`);let u,d;for(u=a;;u++){let n=t.getNumDataCodewords(u,r)*8,i=o.getTotalBits(e,u);if(i<=n){d=i;break}if(u>=s)throw RangeError(`Data too long`)}for(let e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])l&&d<=t.getNumDataCodewords(u,e)*8&&(r=e);let f=[];for(let t of e){n(t.mode.modeBits,4,f),n(t.numChars,t.mode.numCharCountBits(u),f);for(let e of t.getData())f.push(e)}i(f.length==d);let p=t.getNumDataCodewords(u,r)*8;i(f.length<=p),n(0,Math.min(4,p-f.length),f),n(0,(8-f.length%8)%8,f),i(f.length%8==0);for(let e=236;f.length<p;e^=253)n(e,8,f);let m=[];for(;m.length*8<f.length;)m.push(0);return f.forEach((e,t)=>m[t>>>3]|=e<<7-(t&7)),new t(u,r,m,c)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n==0&&r==0||n==0&&r==t-1||n==t-1&&r==0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.errorCorrectionLevel.formatBits<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let a=(t<<10|n)^21522;i(!(a>>>15));for(let e=0;e<=5;e++)this.setFunctionModule(8,e,r(a,e));this.setFunctionModule(8,7,r(a,6)),this.setFunctionModule(8,8,r(a,7)),this.setFunctionModule(7,8,r(a,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,r(a,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,r(a,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,r(a,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;i(!(t>>>18));for(let e=0;e<18;e++){let n=r(t,e),i=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(i,a,n),this.setFunctionModule(a,i,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;0<=a&&a<this.size&&0<=o&&o<this.size&&this.setFunctionModule(a,o,i!=2&&i!=4)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!=1)}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){let n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw RangeError(`Invalid argument`);let a=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],o=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),c=a-s%a,l=Math.floor(s/a),u=[],d=t.reedSolomonComputeDivisor(o);for(let n=0,r=0;n<a;n++){let i=e.slice(r,r+l-o+(n<c?0:1));r+=i.length;let a=t.reedSolomonComputeRemainder(i,d);n<c&&i.push(0),u.push(i.concat(a))}let f=[];for(let e=0;e<u[0].length;e++)u.forEach((t,n)=>{(e!=l-o||n>=c)&&f.push(t[e])});return i(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw RangeError(`Invalid argument`);let n=0;for(let t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(let i=0;i<this.size;i++)for(let a=0;a<2;a++){let o=t-a,s=t+1&2?i:this.size-1-i;!this.isFunction[s][o]&&n<e.length*8&&(this.modules[s][o]=r(e[n>>>3],7-(n&7)),n++)}}i(n==e.length*8)}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[n][o]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][o],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,i=0,a=[0,0,0,0,0,0,0];for(let o=0;o<this.size;o++)this.modules[o][n]==r?(i++,i==5?e+=t.PENALTY_N1:i>5&&e++):(this.finderPenaltyAddHistory(i,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[o][n],i=1);e+=this.finderPenaltyTerminateAndCount(r,i,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){let i=this.modules[n][r];i==this.modules[n][r+1]&&i==this.modules[n+1][r]&&i==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(let e of this.modules)n=e.reduce((e,t)=>e+ +!!t,n);let r=this.size*this.size,a=Math.ceil(Math.abs(n*20-r*10)/r)-1;return i(0<=a&&a<=9),e+=a*t.PENALTY_N4,i(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(this.version==1)return[];{let e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw RangeError(`Version number out of range`);let n=(16*e+128)*e+64;if(e>=2){let t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return i(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let i=0;i<e;i++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map(e=>0);for(let i of e){let e=i^r.shift();r.push(0),n.forEach((n,i)=>r[i]^=t.reedSolomonMultiply(n,e))}return r}static reedSolomonMultiply(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return i(!(n>>>8)),n}finderPenaltyCountPatterns(e){let t=e[1];i(t<=this.size*3);let n=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)}};t.MIN_VERSION=1,t.MAX_VERSION=40,t.PENALTY_N1=3,t.PENALTY_N2=3,t.PENALTY_N3=40,t.PENALTY_N4=10,t.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],t.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=t;function n(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function r(e,t){return!!(e>>>t&1)}function i(e){if(!e)throw Error(`Assertion error`)}let a=class e{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}static makeBytes(t){let r=[];for(let e of t)n(e,8,r);return new e(e.Mode.BYTE,t.length,r)}static makeNumeric(t){if(!e.isNumeric(t))throw RangeError(`String contains non-numeric characters`);let r=[];for(let e=0;e<t.length;){let i=Math.min(t.length-e,3);n(parseInt(t.substring(e,e+i),10),i*3+1,r),e+=i}return new e(e.Mode.NUMERIC,t.length,r)}static makeAlphanumeric(t){if(!e.isAlphanumeric(t))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let r=[],i=0;for(;i+2<=t.length;i+=2){let a=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i))*45;a+=e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i+1)),n(a,11,r)}return i<t.length&&n(e.ALPHANUMERIC_CHARSET.indexOf(t.charAt(i)),6,r),new e(e.Mode.ALPHANUMERIC,t.length,r)}static makeSegments(t){return t==``?[]:e.isNumeric(t)?[e.makeNumeric(t)]:e.isAlphanumeric(t)?[e.makeAlphanumeric(t)]:[e.makeBytes(e.toUtf8ByteArray(t))]}static makeEci(t){let r=[];if(t<0)throw RangeError(`ECI assignment value out of range`);if(t<128)n(t,8,r);else if(t<16384)n(2,2,r),n(t,14,r);else if(t<1e6)n(6,3,r),n(t,21,r);else throw RangeError(`ECI assignment value out of range`);return new e(e.Mode.ECI,0,r)}static isNumeric(t){return e.NUMERIC_REGEX.test(t)}static isAlphanumeric(t){return e.ALPHANUMERIC_REGEX.test(t)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(let r of e){let e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)==`%`?(t.push(parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`;let o=a;e.QrSegment=a})(d||={}),(e=>{(e=>{let t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(e.QrCode||={})})(d||={}),(e=>{(e=>{let t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(e.QrSegment||={})})(d||={});var f=d,p={L:f.QrCode.Ecc.LOW,M:f.QrCode.Ecc.MEDIUM,Q:f.QrCode.Ecc.QUARTILE,H:f.QrCode.Ecc.HIGH},m=128,h=`L`,g=`#FFFFFF`,_=`#000000`,v=!1,y=1,b=4,x=0,S=.1;function C(e,t=0){let n=[];return e.forEach(function(e,r){let i=null;e.forEach(function(a,o){if(!a&&i!==null){n.push(`M${i+t} ${r+t}h${o-i}v1H${i+t}z`),i=null;return}if(o===e.length-1){if(!a)return;i===null?n.push(`M${o+t},${r+t} h1v1H${o+t}z`):n.push(`M${i+t},${r+t} h${o+1-i}v1H${i+t}z`);return}a&&i===null&&(i=o)})}),n.join(``)}function w(e,t){return e.slice().map((e,n)=>n<t.y||n>=t.y+t.h?e:e.map((e,n)=>n<t.x||n>=t.x+t.w?e:!1))}function T(e,t,n,r){if(r==null)return null;let i=e.length+n*2,a=Math.floor(t*S),o=i/t,s=(r.width||a)*o,c=(r.height||a)*o,l=r.x==null?e.length/2-s/2:r.x*o,u=r.y==null?e.length/2-c/2:r.y*o,d=r.opacity==null?1:r.opacity,f=null;if(r.excavate){let e=Math.floor(l),t=Math.floor(u);f={x:e,y:t,w:Math.ceil(s+l-e),h:Math.ceil(c+u-t)}}let p=r.crossOrigin;return{x:l,y:u,h:c,w:s,excavation:f,opacity:d,crossOrigin:p}}function E(e,t){return t==null?e?b:x:Math.max(Math.floor(t),0)}function ee({value:e,level:t,minVersion:n,includeMargin:i,marginSize:a,imageSettings:o,size:s,boostLevel:c}){let l=r.useMemo(()=>{let r=(Array.isArray(e)?e:[e]).reduce((e,t)=>(e.push(...f.QrSegment.makeSegments(t)),e),[]);return f.QrCode.encodeSegments(r,p[t],n,void 0,void 0,c)},[e,t,n,c]),{cells:u,margin:d,numCells:m,calculatedImageSettings:h}=r.useMemo(()=>{let e=l.getModules(),t=E(i,a);return{cells:e,margin:t,numCells:e.length+t*2,calculatedImageSettings:T(e,s,t,o)}},[l,s,o,i,a]);return{qrcode:l,margin:d,cells:u,numCells:m,calculatedImageSettings:h}}var D=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}(),O=r.forwardRef(function(e,t){let n=e,{value:i,size:a=m,level:o=h,bgColor:s=g,fgColor:c=_,includeMargin:d=v,minVersion:f=y,boostLevel:p,marginSize:b,imageSettings:x}=n,S=u(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`marginSize`,`imageSettings`]),{style:T}=S,E=u(S,[`style`]),O=x?.src,k=r.useRef(null),A=r.useRef(null),j=r.useCallback(e=>{k.current=e,typeof t==`function`?t(e):t&&(t.current=e)},[t]),[M,N]=r.useState(!1),{margin:P,cells:F,numCells:I,calculatedImageSettings:L}=ee({value:i,level:o,minVersion:f,boostLevel:p,includeMargin:d,marginSize:b,imageSettings:x,size:a});r.useEffect(()=>{if(k.current!=null){let e=k.current,t=e.getContext(`2d`);if(!t)return;let n=F,r=A.current,i=L!=null&&r!==null&&r.complete&&r.naturalHeight!==0&&r.naturalWidth!==0;i&&L.excavation!=null&&(n=w(F,L.excavation));let o=window.devicePixelRatio||1;e.height=e.width=a*o;let l=a/I*o;t.scale(l,l),t.fillStyle=s,t.fillRect(0,0,I,I),t.fillStyle=c,D?t.fill(new Path2D(C(n,P))):F.forEach(function(e,n){e.forEach(function(e,r){e&&t.fillRect(r+P,n+P,1,1)})}),L&&(t.globalAlpha=L.opacity),i&&t.drawImage(r,L.x+P,L.y+P,L.w,L.h)}}),r.useEffect(()=>{N(!1)},[O]);let R=l({height:a,width:a},T),z=null;return O!=null&&(z=r.createElement(`img`,{src:O,key:O,style:{display:`none`},onLoad:()=>{N(!0)},ref:A,crossOrigin:L?.crossOrigin})),r.createElement(r.Fragment,null,r.createElement(`canvas`,l({style:R,height:a,width:a,ref:j,role:`img`},E)),z)});O.displayName=`QRCodeCanvas`;var k=r.forwardRef(function(e,t){let n=e,{value:i,size:a=m,level:o=h,bgColor:s=g,fgColor:c=_,includeMargin:d=v,minVersion:f=y,boostLevel:p,title:b,marginSize:x,imageSettings:S}=n,T=u(n,[`value`,`size`,`level`,`bgColor`,`fgColor`,`includeMargin`,`minVersion`,`boostLevel`,`title`,`marginSize`,`imageSettings`]),{margin:E,cells:D,numCells:O,calculatedImageSettings:k}=ee({value:i,level:o,minVersion:f,boostLevel:p,includeMargin:d,marginSize:x,imageSettings:S,size:a}),A=D,j=null;S!=null&&k!=null&&(k.excavation!=null&&(A=w(D,k.excavation)),j=r.createElement(`image`,{href:S.src,height:k.h,width:k.w,x:k.x+E,y:k.y+E,preserveAspectRatio:`none`,opacity:k.opacity,crossOrigin:k.crossOrigin}));let M=C(A,E);return r.createElement(`svg`,l({height:a,width:a,viewBox:`0 0 ${O} ${O}`,ref:t,role:`img`},T),!!b&&r.createElement(`title`,null,b),r.createElement(`path`,{fill:s,d:`M0,0 h${O}v${O}H0z`,shapeRendering:`crispEdges`}),r.createElement(`path`,{fill:c,d:M,shapeRendering:`crispEdges`}),j)});k.displayName=`QRCodeSVG`;var A=`web#`,j=`scan#`,M=`ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz0123456789`;function N(e=8){let t=``;for(let n=0;n<e;n++)t+=M.charAt(Math.floor(Math.random()*51));return t}function P(){return`${A}${N()}`}function F(){return`${j}${N()}`}var I=t(((e,t)=>{var n=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,r=[`source`,`protocol`,`authority`,`userInfo`,`user`,`password`,`host`,`port`,`relative`,`path`,`directory`,`file`,`query`,`anchor`];t.exports=function(e){var t=e,o=e.indexOf(`[`),s=e.indexOf(`]`);o!=-1&&s!=-1&&(e=e.substring(0,o)+e.substring(o,s).replace(/:/g,`;`)+e.substring(s,e.length));for(var c=n.exec(e||``),l={},u=14;u--;)l[r[u]]=c[u]||``;return o!=-1&&s!=-1&&(l.source=t,l.host=l.host.substring(1,l.host.length-1).replace(/;/g,`:`),l.authority=l.authority.replace(`[`,``).replace(`]`,``).replace(/;/g,`:`),l.ipv6uri=!0),l.pathNames=i(l,l.path),l.queryKey=a(l,l.query),l};function i(e,t){var n=t.replace(/\/{2,9}/g,`/`).split(`/`);return(t.substr(0,1)==`/`||t.length===0)&&n.splice(0,1),t.substr(t.length-1,1)==`/`&&n.splice(n.length-1,1),n}function a(e,t){var n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(e,t,r){t&&(n[t]=r)}),n}})),L=t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return s(e);if(n===`number`&&isNaN(e)===!1)return t.long?l(e):c(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function s(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return s*o;case`days`:case`day`:case`d`:return s*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return s*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return s*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return s*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return s;default:return}}}}function c(e){return e>=a?Math.round(e/a)+`d`:e>=i?Math.round(e/i)+`h`:e>=r?Math.round(e/r)+`m`:e>=n?Math.round(e/n)+`s`:e+`ms`}function l(e){return u(e,a,`day`)||u(e,i,`hour`)||u(e,r,`minute`)||u(e,n,`second`)||e+` ms`}function u(e,t,n){if(!(e<t))return e<t*1.5?Math.floor(e/t)+` `+n:Math.ceil(e/t)+` `+n+`s`}})),R=t(((e,t)=>{e=t.exports=r.debug=r.default=r,e.coerce=c,e.disable=o,e.enable=a,e.enabled=s,e.humanize=L(),e.instances=[],e.names=[],e.skips=[],e.formatters={};function n(t){var n=0,r;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}function r(t){var r;function a(){if(a.enabled){var t=a,n=+new Date;t.diff=n-(r||n),t.prev=r,t.curr=n,r=n;for(var i=Array(arguments.length),o=0;o<i.length;o++)i[o]=arguments[o];i[0]=e.coerce(i[0]),typeof i[0]!=`string`&&i.unshift(`%O`);var s=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(n,r){if(n===`%%`)return n;s++;var a=e.formatters[r];if(typeof a==`function`){var o=i[s];n=a.call(t,o),i.splice(s,1),s--}return n}),e.formatArgs.call(t,i),(a.log||e.log||console.log.bind(console)).apply(t,i)}}return a.namespace=t,a.enabled=e.enabled(t),a.useColors=e.useColors(),a.color=n(t),a.destroy=i,typeof e.init==`function`&&e.init(a),e.instances.push(a),a}function i(){var t=e.instances.indexOf(this);return t!==-1&&(e.instances.splice(t,1),!0)}function a(t){e.save(t),e.names=[],e.skips=[];var n,r=(typeof t==`string`?t:``).split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&(t=r[n].replace(/\*/g,`.*?`),t[0]===`-`?e.skips.push(RegExp(`^`+t.substr(1)+`$`)):e.names.push(RegExp(`^`+t+`$`)));for(n=0;n<e.instances.length;n++){var a=e.instances[n];a.enabled=e.enabled(a.namespace)}}function o(){e.enable(``)}function s(t){if(t[t.length-1]===`*`)return!0;for(var n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}})),z=t(((e,t)=>{e=t.exports=R(),e.log=i,e.formatArgs=r,e.save=a,e.load=o,e.useColors=n,e.storage=typeof chrome<`u`&&chrome.storage!==void 0?chrome.storage.local:s(),e.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`.split(`.`);function n(){return typeof window<`u`&&window.process&&window.process.type===`renderer`?!0:typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}};function r(t){var n=this.useColors;if(t[0]=(n?`%c`:``)+this.namespace+(n?` %c`:` `)+t[0]+(n?`%c `:` `)+`+`+e.humanize(this.diff),n){var r=`color: `+this.color;t.splice(1,0,r,`color: inherit`);var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,function(e){e!==`%%`&&(i++,e===`%c`&&(a=i))}),t.splice(a,0,r)}}function i(){return typeof console==`object`&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{t==null?e.storage.removeItem(`debug`):e.storage.debug=t}catch{}}function o(){var t;try{t=e.storage.debug}catch{}return!t&&typeof process<`u`&&`env`in process&&(t={}.DEBUG),t}e.enable(o());function s(){try{return window.localStorage}catch{}}})),te=t(((e,t)=>{var n=I(),r=z()(`socket.io-client:url`);t.exports=i;function i(e,t){var i=e;t||=typeof location<`u`&&location,e??=t.protocol+`//`+t.host,typeof e==`string`&&(e.charAt(0)===`/`&&(e=e.charAt(1)===`/`?t.protocol+e:t.host+e),/^(https?|wss?):\/\//.test(e)||(r(`protocol-less url %s`,e),e=t===void 0?`https://`+e:t.protocol+`//`+e),r(`parse %s`,e),i=n(e)),i.port||(/^(http|ws)$/.test(i.protocol)?i.port=`80`:/^(http|ws)s$/.test(i.protocol)&&(i.port=`443`)),i.path=i.path||`/`;var a=i.host.indexOf(`:`)===-1?i.host:`[`+i.host+`]`;return i.id=i.protocol+`://`+a+`:`+i.port,i.href=i.protocol+`://`+a+(t&&t.port===i.port?``:`:`+i.port),i}})),ne=t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return s(e);if(n===`number`&&isNaN(e)===!1)return t.long?l(e):c(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function s(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return s*o;case`days`:case`day`:case`d`:return s*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return s*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return s*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return s*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return s;default:return}}}}function c(e){return e>=a?Math.round(e/a)+`d`:e>=i?Math.round(e/i)+`h`:e>=r?Math.round(e/r)+`m`:e>=n?Math.round(e/n)+`s`:e+`ms`}function l(e){return u(e,a,`day`)||u(e,i,`hour`)||u(e,r,`minute`)||u(e,n,`second`)||e+` ms`}function u(e,t,n){if(!(e<t))return e<t*1.5?Math.floor(e/t)+` `+n:Math.ceil(e/t)+` `+n+`s`}})),re=t(((e,t)=>{e=t.exports=r.debug=r.default=r,e.coerce=c,e.disable=o,e.enable=a,e.enabled=s,e.humanize=ne(),e.instances=[],e.names=[],e.skips=[],e.formatters={};function n(t){var n=0,r;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}function r(t){var r;function a(){if(a.enabled){var t=a,n=+new Date;t.diff=n-(r||n),t.prev=r,t.curr=n,r=n;for(var i=Array(arguments.length),o=0;o<i.length;o++)i[o]=arguments[o];i[0]=e.coerce(i[0]),typeof i[0]!=`string`&&i.unshift(`%O`);var s=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(n,r){if(n===`%%`)return n;s++;var a=e.formatters[r];if(typeof a==`function`){var o=i[s];n=a.call(t,o),i.splice(s,1),s--}return n}),e.formatArgs.call(t,i),(a.log||e.log||console.log.bind(console)).apply(t,i)}}return a.namespace=t,a.enabled=e.enabled(t),a.useColors=e.useColors(),a.color=n(t),a.destroy=i,typeof e.init==`function`&&e.init(a),e.instances.push(a),a}function i(){var t=e.instances.indexOf(this);return t!==-1&&(e.instances.splice(t,1),!0)}function a(t){e.save(t),e.names=[],e.skips=[];var n,r=(typeof t==`string`?t:``).split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&(t=r[n].replace(/\*/g,`.*?`),t[0]===`-`?e.skips.push(RegExp(`^`+t.substr(1)+`$`)):e.names.push(RegExp(`^`+t+`$`)));for(n=0;n<e.instances.length;n++){var a=e.instances[n];a.enabled=e.enabled(a.namespace)}}function o(){e.enable(``)}function s(t){if(t[t.length-1]===`*`)return!0;for(var n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}})),ie=t(((e,t)=>{e=t.exports=re(),e.log=i,e.formatArgs=r,e.save=a,e.load=o,e.useColors=n,e.storage=typeof chrome<`u`&&chrome.storage!==void 0?chrome.storage.local:s(),e.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`.split(`.`);function n(){return typeof window<`u`&&window.process&&window.process.type===`renderer`?!0:typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}};function r(t){var n=this.useColors;if(t[0]=(n?`%c`:``)+this.namespace+(n?` %c`:` `)+t[0]+(n?`%c `:` `)+`+`+e.humanize(this.diff),n){var r=`color: `+this.color;t.splice(1,0,r,`color: inherit`);var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,function(e){e!==`%%`&&(i++,e===`%c`&&(a=i))}),t.splice(a,0,r)}}function i(){return typeof console==`object`&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{t==null?e.storage.removeItem(`debug`):e.storage.debug=t}catch{}}function o(){var t;try{t=e.storage.debug}catch{}return!t&&typeof process<`u`&&`env`in process&&(t={}.DEBUG),t}e.enable(o());function s(){try{return window.localStorage}catch{}}})),B=t(((e,t)=>{t!==void 0&&(t.exports=n);function n(e){if(e)return r(e)}function r(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[`$`+e]=this._callbacks[`$`+e]||[]).push(t),this},n.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks[`$`+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks[`$`+e],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===t||r.fn===t){n.splice(i,1);break}return n.length===0&&delete this._callbacks[`$`+e],this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=Array(arguments.length-1),n=this._callbacks[`$`+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[`$`+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}})),V=t(((e,t)=>{var n={}.toString;t.exports=Array.isArray||function(e){return n.call(e)==`[object Array]`}})),H=t(((e,t)=>{t.exports=a;var n=typeof Buffer==`function`&&typeof Buffer.isBuffer==`function`,r=typeof ArrayBuffer==`function`,i=function(e){return typeof ArrayBuffer.isView==`function`?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer};function a(e){return n&&Buffer.isBuffer(e)||r&&(e instanceof ArrayBuffer||i(e))}})),ae=t((e=>{var t=V(),n=H(),r=Object.prototype.toString,i=typeof Blob==`function`||typeof Blob<`u`&&r.call(Blob)===`[object BlobConstructor]`,a=typeof File==`function`||typeof File<`u`&&r.call(File)===`[object FileConstructor]`;e.deconstructPacket=function(e){var t=[],n=e.data,r=e;return r.data=o(n,t),r.attachments=t.length,{packet:r,buffers:t}};function o(e,r){if(!e)return e;if(n(e)){var i={_placeholder:!0,num:r.length};return r.push(e),i}if(t(e)){for(var a=Array(e.length),s=0;s<e.length;s++)a[s]=o(e[s],r);return a}if(typeof e==`object`&&!(e instanceof Date)){var a={};for(var c in e)a[c]=o(e[c],r);return a}return e}e.reconstructPacket=function(e,t){return e.data=s(e.data,t),e.attachments=void 0,e};function s(e,n){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num==`number`&&e.num>=0&&e.num<n.length)return n[e.num];throw Error(`illegal attachments`)}if(t(e))for(var r=0;r<e.length;r++)e[r]=s(e[r],n);else if(typeof e==`object`)for(var i in e)e[i]=s(e[i],n);return e}e.removeBlobs=function(e,r){function o(e,l,u){if(!e)return e;if(i&&e instanceof Blob||a&&e instanceof File){s++;var d=new FileReader;d.onload=function(){u?u[l]=this.result:c=this.result,--s||r(c)},d.readAsArrayBuffer(e)}else if(t(e))for(var f=0;f<e.length;f++)o(e[f],f,e);else if(typeof e==`object`&&!n(e))for(var p in e)o(e[p],p,e)}var s=0,c=e;o(c),s||r(c)}})),U=t((e=>{var t=ie()(`socket.io-parser`),n=B(),r=ae(),i=V(),a=H();e.protocol=4,e.types=[`CONNECT`,`DISCONNECT`,`EVENT`,`ACK`,`ERROR`,`BINARY_EVENT`,`BINARY_ACK`],e.CONNECT=0,e.DISCONNECT=1,e.EVENT=2,e.ACK=3,e.ERROR=4,e.BINARY_EVENT=5,e.BINARY_ACK=6,e.Encoder=o,e.Decoder=d;function o(){}var s=e.ERROR+`"encode error"`;o.prototype.encode=function(n,r){t(`encoding packet %j`,n),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type?u(n,r):r([c(n)])};function c(n){var r=``+n.type;if((e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type)&&(r+=n.attachments+`-`),n.nsp&&n.nsp!==`/`&&(r+=n.nsp+`,`),n.id!=null&&(r+=n.id),n.data!=null){var i=l(n.data);if(i!==!1)r+=i;else return s}return t(`encoded %j as %s`,n,r),r}function l(e){try{return JSON.stringify(e)}catch{return!1}}function u(e,t){function n(e){var n=r.deconstructPacket(e),i=c(n.packet),a=n.buffers;a.unshift(i),t(a)}r.removeBlobs(e,n)}function d(e){this.reconstructor=null,e||={},this.opts={maxAttachments:e.maxAttachments||10}}n(d.prototype),d.prototype.add=function(t){var n;if(typeof t==`string`){if(this.reconstructor)throw Error(`got plaintext data when reconstructing a packet`);n=p(t,this.opts.maxAttachments),e.BINARY_EVENT===n.type||e.BINARY_ACK===n.type?this.reconstructor=new h(n):this.emit(`decoded`,n)}else if(a(t)||t.base64){if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,this.emit(`decoded`,n));else throw Error(`got binary data when not reconstructing a packet`)}else throw Error(`Unknown type: `+t)};function f(e,t){switch(e){case 0:return typeof t==`object`;case 1:return t===void 0;case 4:return typeof t==`string`||typeof t==`object`;case 2:case 5:return i(t)&&(typeof t[0]==`string`||typeof t[0]==`number`);case 3:case 6:return i(t)}}function p(n,r){var i=0,a={type:Number(n.charAt(0))};if(e.types[a.type]==null)return g(`unknown packet type `+a.type);if(e.BINARY_EVENT===a.type||e.BINARY_ACK===a.type){for(var o=i+1;n.charAt(++i)!==`-`&&i!=n.length;);var s=n.substring(o,i);if(s!=Number(s)||n.charAt(i)!==`-`)throw Error(`Illegal attachments`);var c=Number(s);if(!_(c)||c<1)throw Error(`Illegal attachments`);if(c>r)throw Error(`too many attachments`);a.attachments=c}if(n.charAt(i+1)===`/`){for(var o=i+1;++i;){var l=n.charAt(i);if(l===`,`||i===n.length)break}a.nsp=n.substring(o,i)}else a.nsp=`/`;var u=n.charAt(i+1);if(u!==``&&Number(u)==u){for(var o=i+1;++i;){var l=n.charAt(i);if(l==null||Number(l)!=l){--i;break}if(i===n.length)break}a.id=Number(n.substring(o,i+1))}if(n.charAt(++i)){var d=m(n.substr(i));if(f(a.type,d))a.data=d;else throw Error(`invalid payload`)}return t(`decoded %s as %j`,n,a),a}function m(e){try{return JSON.parse(e)}catch{return!1}}d.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()};function h(e){this.reconPack=e,this.buffers=[]}h.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=r.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},h.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};function g(t){return{type:e.ERROR,data:`parser error: `+t}}var _=Number.isInteger||function(e){return typeof e==`number`&&isFinite(e)&&Math.floor(e)===e}})),oe=t(((e,t)=>{try{t.exports=typeof XMLHttpRequest<`u`&&`withCredentials`in new XMLHttpRequest}catch{t.exports=!1}})),W=t(((e,t)=>{t.exports=(function(){return typeof self<`u`?self:typeof window<`u`?window:Function(`return this`)()})()})),G=t(((e,t)=>{var n=oe(),r=W();t.exports=function(e){var t=e.xdomain,i=e.xscheme,a=e.enablesXDR;try{if(typeof XMLHttpRequest<`u`&&(!t||n))return new XMLHttpRequest}catch{}try{if(typeof XDomainRequest<`u`&&!i&&a)return new XDomainRequest}catch{}if(!t)try{return new r[[`Active`,`Object`].join(`X`)](`Microsoft.XMLHTTP`)}catch{}}})),se=t(((e,t)=>{t.exports=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t}})),K=t(((e,t)=>{var n=V(),r=Object.prototype.toString,i=typeof Blob==`function`||typeof Blob<`u`&&r.call(Blob)===`[object BlobConstructor]`,a=typeof File==`function`||typeof File<`u`&&r.call(File)===`[object FileConstructor]`;t.exports=o;function o(e){if(!e||typeof e!=`object`)return!1;if(n(e)){for(var t=0,r=e.length;t<r;t++)if(o(e[t]))return!0;return!1}if(typeof Buffer==`function`&&Buffer.isBuffer&&Buffer.isBuffer(e)||typeof ArrayBuffer==`function`&&e instanceof ArrayBuffer||i&&e instanceof Blob||a&&e instanceof File)return!0;if(e.toJSON&&typeof e.toJSON==`function`&&arguments.length===1)return o(e.toJSON(),!0);for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&o(e[s]))return!0;return!1}})),ce=t(((e,t)=>{t.exports=function(e,t,n){var r=e.byteLength;if(t||=0,n||=r,e.slice)return e.slice(t,n);if(t<0&&(t+=r),n<0&&(n+=r),n>r&&(n=r),t>=r||t>=n||r===0)return new ArrayBuffer(0);for(var i=new Uint8Array(e),a=new Uint8Array(n-t),o=t,s=0;o<n;o++,s++)a[s]=i[o];return a.buffer}})),le=t(((e,t)=>{t.exports=n;function n(e,t,n){var i=!1;return n||=r,a.count=e,e===0?t():a;function a(e,r){if(a.count<=0)throw Error(`after called too many times`);--a.count,e?(i=!0,t(e),t=n):a.count===0&&!i&&t(null,r)}}function r(){}})),ue=t(((e,t)=>{var n=String.fromCharCode;function r(e){for(var t=[],n=0,r=e.length,i,a;n<r;)i=e.charCodeAt(n++),i>=55296&&i<=56319&&n<r?(a=e.charCodeAt(n++),(a&64512)==56320?t.push(((i&1023)<<10)+(a&1023)+65536):(t.push(i),n--)):t.push(i);return t}function i(e){for(var t=e.length,r=-1,i,a=``;++r<t;)i=e[r],i>65535&&(i-=65536,a+=n(i>>>10&1023|55296),i=56320|i&1023),a+=n(i);return a}function a(e,t){if(e>=55296&&e<=57343){if(t)throw Error(`Lone surrogate U+`+e.toString(16).toUpperCase()+` is not a scalar value`);return!1}return!0}function o(e,t){return n(e>>t&63|128)}function s(e,t){if(!(e&4294967168))return n(e);var r=``;return e&4294965248?e&4294901760?e&4292870144||(r=n(e>>18&7|240),r+=o(e,12),r+=o(e,6)):(a(e,t)||(e=65533),r=n(e>>12&15|224),r+=o(e,6)):r=n(e>>6&31|192),r+=n(e&63|128),r}function c(e,t){t||={};for(var n=!1!==t.strict,i=r(e),a=i.length,o=-1,c,l=``;++o<a;)c=i[o],l+=s(c,n);return l}function l(){if(p>=f)throw Error(`Invalid byte index`);var e=d[p]&255;if(p++,(e&192)==128)return e&63;throw Error(`Invalid continuation byte`)}function u(e){var t,n,r,i,o;if(p>f)throw Error(`Invalid byte index`);if(p==f)return!1;if(t=d[p]&255,p++,!(t&128))return t;if((t&224)==192){if(n=l(),o=(t&31)<<6|n,o>=128)return o;throw Error(`Invalid continuation byte`)}if((t&240)==224){if(n=l(),r=l(),o=(t&15)<<12|n<<6|r,o>=2048)return a(o,e)?o:65533;throw Error(`Invalid continuation byte`)}if((t&248)==240&&(n=l(),r=l(),i=l(),o=(t&7)<<18|n<<12|r<<6|i,o>=65536&&o<=1114111))return o;throw Error(`Invalid UTF-8 detected`)}var d,f,p;function m(e,t){t||={};var n=!1!==t.strict;d=r(e),f=d.length,p=0;for(var a=[],o;(o=u(n))!==!1;)a.push(o);return i(a)}t.exports={version:`2.1.2`,encode:c,decode:m}})),de=t((e=>{(function(t){e.encode=function(e){var n=new Uint8Array(e),r,i=n.length,a=``;for(r=0;r<i;r+=3)a+=t[n[r]>>2],a+=t[(n[r]&3)<<4|n[r+1]>>4],a+=t[(n[r+1]&15)<<2|n[r+2]>>6],a+=t[n[r+2]&63];return i%3==2?a=a.substring(0,a.length-1)+`=`:i%3==1&&(a=a.substring(0,a.length-2)+`==`),a},e.decode=function(e){var n=e.length*.75,r=e.length,i,a=0,o,s,c,l;e[e.length-1]===`=`&&(n--,e[e.length-2]===`=`&&n--);var u=new ArrayBuffer(n),d=new Uint8Array(u);for(i=0;i<r;i+=4)o=t.indexOf(e[i]),s=t.indexOf(e[i+1]),c=t.indexOf(e[i+2]),l=t.indexOf(e[i+3]),d[a++]=o<<2|s>>4,d[a++]=(s&15)<<4|c>>2,d[a++]=(c&3)<<6|l&63;return u}})(`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`)})),fe=t(((e,t)=>{var n=n===void 0?typeof WebKitBlobBuilder<`u`?WebKitBlobBuilder:typeof MSBlobBuilder<`u`?MSBlobBuilder:typeof MozBlobBuilder<`u`&&MozBlobBuilder:n,r=(function(){try{return new Blob([`hi`]).size===2}catch{return!1}})(),i=r&&(function(){try{return new Blob([new Uint8Array([1,2])]).size===2}catch{return!1}})(),a=n&&n.prototype.append&&n.prototype.getBlob;function o(e){return e.map(function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var n=new Uint8Array(e.byteLength);n.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer}return t}return e})}function s(e,t){t||={};var r=new n;return o(e).forEach(function(e){r.append(e)}),t.type?r.getBlob(t.type):r.getBlob()}function c(e,t){return new Blob(o(e),t||{})}typeof Blob<`u`&&(s.prototype=Blob.prototype,c.prototype=Blob.prototype),t.exports=(function(){if(r)return i?Blob:c;if(a)return s})()})),q=t((e=>{var t=se(),n=K(),r=ce(),i=le(),a=ue(),o;typeof ArrayBuffer<`u`&&(o=de());var s=typeof navigator<`u`&&/Android/i.test(navigator.userAgent),c=typeof navigator<`u`&&/PhantomJS/i.test(navigator.userAgent),l=s||c;e.protocol=3;var u=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},d=t(u),f={type:`error`,data:`parser error`},p=fe();e.encodePacket=function(e,t,n,r){typeof t==`function`&&(r=t,t=!1),typeof n==`function`&&(r=n,n=null);var i=e.data===void 0?void 0:e.data.buffer||e.data;if(typeof ArrayBuffer<`u`&&i instanceof ArrayBuffer)return h(e,t,r);if(p!==void 0&&i instanceof p)return _(e,t,r);if(i&&i.base64)return m(e,r);var o=u[e.type];return e.data!==void 0&&(o+=n?a.encode(String(e.data),{strict:!1}):String(e.data)),r(``+o)};function m(t,n){return n(`b`+e.packets[t.type]+t.data.data)}function h(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var i=t.data,a=new Uint8Array(i),o=new Uint8Array(1+i.byteLength);o[0]=u[t.type];for(var s=0;s<a.length;s++)o[s+1]=a[s];return r(o.buffer)}function g(t,n,r){if(!n)return e.encodeBase64Packet(t,r);var i=new FileReader;return i.onload=function(){e.encodePacket({type:t.type,data:i.result},n,!0,r)},i.readAsArrayBuffer(t.data)}function _(t,n,r){if(!n)return e.encodeBase64Packet(t,r);if(l)return g(t,n,r);var i=new Uint8Array(1);return i[0]=u[t.type],r(new p([i.buffer,t.data]))}e.encodeBase64Packet=function(t,n){var r=`b`+e.packets[t.type];if(p!==void 0&&t.data instanceof p){var i=new FileReader;return i.onload=function(){var e=i.result.split(`,`)[1];n(r+e)},i.readAsDataURL(t.data)}var a;try{a=String.fromCharCode.apply(null,new Uint8Array(t.data))}catch{for(var o=new Uint8Array(t.data),s=Array(o.length),c=0;c<o.length;c++)s[c]=o[c];a=String.fromCharCode.apply(null,s)}return r+=btoa(a),n(r)},e.decodePacket=function(t,n,i){if(t===void 0)return f;if(typeof t==`string`){if(t.charAt(0)===`b`)return e.decodeBase64Packet(t.substr(1),n);if(i&&(t=v(t),t===!1))return f;var a=t.charAt(0);return Number(a)!=a||!d[a]?f:t.length>1?{type:d[a],data:t.substring(1)}:{type:d[a]}}var a=new Uint8Array(t)[0],o=r(t,1);return p&&n===`blob`&&(o=new p([o])),{type:d[a],data:o}};function v(e){try{e=a.decode(e,{strict:!1})}catch{return!1}return e}e.decodeBase64Packet=function(e,t){var n=d[e.charAt(0)];if(!o)return{type:n,data:{base64:!0,data:e.substr(1)}};var r=o.decode(e.substr(1));return t===`blob`&&p&&(r=new p([r])),{type:n,data:r}},e.encodePayload=function(t,r,i){typeof r==`function`&&(i=r,r=null);var a=n(t);if(r&&a)return p&&!l?e.encodePayloadAsBlob(t,i):e.encodePayloadAsArrayBuffer(t,i);if(!t.length)return i(`0:`);function o(e){return e.length+`:`+e}function s(t,n){e.encodePacket(t,a?r:!1,!1,function(e){n(null,o(e))})}y(t,s,function(e,t){return i(t.join(``))})};function y(e,t,n){for(var r=Array(e.length),a=i(e.length,n),o=function(e,n,i){t(n,function(t,n){r[e]=n,i(t,r)})},s=0;s<e.length;s++)o(s,e[s],a)}e.decodePayload=function(t,n,r){if(typeof t!=`string`)return e.decodePayloadAsBinary(t,n,r);typeof n==`function`&&(r=n,n=null);var i;if(t===``)return r(f,0,1);for(var a=``,o,s,c=0,l=t.length;c<l;c++){var u=t.charAt(c);if(u!==`:`){a+=u;continue}if(a===``||a!=(o=Number(a))||(s=t.substr(c+1,o),a!=s.length))return r(f,0,1);if(s.length){if(i=e.decodePacket(s,n,!1),f.type===i.type&&f.data===i.data)return r(f,0,1);if(!1===r(i,c+o,l))return}c+=o,a=``}if(a!==``)return r(f,0,1)},e.encodePayloadAsArrayBuffer=function(t,n){if(!t.length)return n(new ArrayBuffer(0));function r(t,n){e.encodePacket(t,!0,!0,function(e){return n(null,e)})}y(t,r,function(e,t){var r=t.reduce(function(e,t){var n=typeof t==`string`?t.length:t.byteLength;return e+n.toString().length+n+2},0),i=new Uint8Array(r),a=0;return t.forEach(function(e){var t=typeof e==`string`,n=e;if(t){for(var r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);n=r.buffer}t?i[a++]=0:i[a++]=1;for(var s=n.byteLength.toString(),o=0;o<s.length;o++)i[a++]=parseInt(s[o]);i[a++]=255;for(var r=new Uint8Array(n),o=0;o<r.length;o++)i[a++]=r[o]}),n(i.buffer)})},e.encodePayloadAsBlob=function(t,n){function r(t,n){e.encodePacket(t,!0,!0,function(e){var t=new Uint8Array(1);if(t[0]=1,typeof e==`string`){for(var r=new Uint8Array(e.length),i=0;i<e.length;i++)r[i]=e.charCodeAt(i);e=r.buffer,t[0]=0}for(var a=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),o=new Uint8Array(a.length+1),i=0;i<a.length;i++)o[i]=parseInt(a[i]);o[a.length]=255,p&&n(null,new p([t.buffer,o.buffer,e]))})}y(t,r,function(e,t){return n(new p(t))})},e.decodePayloadAsBinary=function(t,n,i){typeof n==`function`&&(i=n,n=null);for(var a=t,o=[];a.byteLength>0;){for(var s=new Uint8Array(a),c=s[0]===0,l=``,u=1;s[u]!==255;u++){if(l.length>310)return i(f,0,1);l+=s[u]}a=r(a,2+l.length),l=parseInt(l);var d=r(a,0,l);if(c)try{d=String.fromCharCode.apply(null,new Uint8Array(d))}catch{var p=new Uint8Array(d);d=``;for(var u=0;u<p.length;u++)d+=String.fromCharCode(p[u])}o.push(d),a=r(a,l)}var m=o.length;o.forEach(function(t,r){i(e.decodePacket(t,n,!0),r,m)})}})),J=t(((e,t)=>{var n=q(),r=B();t.exports=i;function i(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState=``,this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.isReactNative=e.isReactNative,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}r(i.prototype),i.prototype.onError=function(e,t){var n=Error(e);return n.type=`TransportError`,n.description=t,this.emit(`error`,n),this},i.prototype.open=function(){return(this.readyState===`closed`||this.readyState===``)&&(this.readyState=`opening`,this.doOpen()),this},i.prototype.close=function(){return(this.readyState===`opening`||this.readyState===`open`)&&(this.doClose(),this.onClose()),this},i.prototype.send=function(e){if(this.readyState===`open`)this.write(e);else throw Error(`Transport not open`)},i.prototype.onOpen=function(){this.readyState=`open`,this.writable=!0,this.emit(`open`)},i.prototype.onData=function(e){var t=n.decodePacket(e,this.socket.binaryType);this.onPacket(t)},i.prototype.onPacket=function(e){this.emit(`packet`,e)},i.prototype.onClose=function(){this.readyState=`closed`,this.emit(`close`)}})),Y=t((e=>{e.encode=function(e){var t=``;for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+=`&`),t+=encodeURIComponent(n)+`=`+encodeURIComponent(e[n]));return t},e.decode=function(e){for(var t={},n=e.split(`&`),r=0,i=n.length;r<i;r++){var a=n[r].split(`=`);t[decodeURIComponent(a[0])]=decodeURIComponent(a[1])}return t}})),X=t(((e,t)=>{t.exports=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}})),Z=t(((e,t)=>{var n=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_`.split(``),r=64,i={},a=0,o=0,s;function c(e){var t=``;do t=n[e%r]+t,e=Math.floor(e/r);while(e>0);return t}function l(e){var t=0;for(o=0;o<e.length;o++)t=t*r+i[e.charAt(o)];return t}function u(){var e=c(+new Date);return e===s?e+`.`+c(a++):(a=0,s=e)}for(;o<r;o++)i[n[o]]=o;u.encode=c,u.decode=l,t.exports=u})),pe=t(((e,t)=>{var n=1e3,r=n*60,i=r*60,a=i*24,o=a*365.25;t.exports=function(e,t){t||={};var n=typeof e;if(n===`string`&&e.length>0)return s(e);if(n===`number`&&isNaN(e)===!1)return t.long?l(e):c(e);throw Error(`val is not a non-empty string or a valid number. val=`+JSON.stringify(e))};function s(e){if(e=String(e),!(e.length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var s=parseFloat(t[1]);switch((t[2]||`ms`).toLowerCase()){case`years`:case`year`:case`yrs`:case`yr`:case`y`:return s*o;case`days`:case`day`:case`d`:return s*a;case`hours`:case`hour`:case`hrs`:case`hr`:case`h`:return s*i;case`minutes`:case`minute`:case`mins`:case`min`:case`m`:return s*r;case`seconds`:case`second`:case`secs`:case`sec`:case`s`:return s*n;case`milliseconds`:case`millisecond`:case`msecs`:case`msec`:case`ms`:return s;default:return}}}}function c(e){return e>=a?Math.round(e/a)+`d`:e>=i?Math.round(e/i)+`h`:e>=r?Math.round(e/r)+`m`:e>=n?Math.round(e/n)+`s`:e+`ms`}function l(e){return u(e,a,`day`)||u(e,i,`hour`)||u(e,r,`minute`)||u(e,n,`second`)||e+` ms`}function u(e,t,n){if(!(e<t))return e<t*1.5?Math.floor(e/t)+` `+n:Math.ceil(e/t)+` `+n+`s`}})),me=t(((e,t)=>{e=t.exports=r.debug=r.default=r,e.coerce=c,e.disable=o,e.enable=a,e.enabled=s,e.humanize=pe(),e.instances=[],e.names=[],e.skips=[],e.formatters={};function n(t){var n=0,r;for(r in t)n=(n<<5)-n+t.charCodeAt(r),n|=0;return e.colors[Math.abs(n)%e.colors.length]}function r(t){var r;function a(){if(a.enabled){var t=a,n=+new Date;t.diff=n-(r||n),t.prev=r,t.curr=n,r=n;for(var i=Array(arguments.length),o=0;o<i.length;o++)i[o]=arguments[o];i[0]=e.coerce(i[0]),typeof i[0]!=`string`&&i.unshift(`%O`);var s=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(n,r){if(n===`%%`)return n;s++;var a=e.formatters[r];if(typeof a==`function`){var o=i[s];n=a.call(t,o),i.splice(s,1),s--}return n}),e.formatArgs.call(t,i),(a.log||e.log||console.log.bind(console)).apply(t,i)}}return a.namespace=t,a.enabled=e.enabled(t),a.useColors=e.useColors(),a.color=n(t),a.destroy=i,typeof e.init==`function`&&e.init(a),e.instances.push(a),a}function i(){var t=e.instances.indexOf(this);return t!==-1&&(e.instances.splice(t,1),!0)}function a(t){e.save(t),e.names=[],e.skips=[];var n,r=(typeof t==`string`?t:``).split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&(t=r[n].replace(/\*/g,`.*?`),t[0]===`-`?e.skips.push(RegExp(`^`+t.substr(1)+`$`)):e.names.push(RegExp(`^`+t+`$`)));for(n=0;n<e.instances.length;n++){var a=e.instances[n];a.enabled=e.enabled(a.namespace)}}function o(){e.enable(``)}function s(t){if(t[t.length-1]===`*`)return!0;for(var n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1}function c(e){return e instanceof Error?e.stack||e.message:e}})),Q=t(((e,t)=>{e=t.exports=me(),e.log=i,e.formatArgs=r,e.save=a,e.load=o,e.useColors=n,e.storage=typeof chrome<`u`&&chrome.storage!==void 0?chrome.storage.local:s(),e.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`.split(`.`);function n(){return typeof window<`u`&&window.process&&window.process.type===`renderer`?!0:typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<`u`&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<`u`&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}e.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return`[UnexpectedJSONParseError]: `+e.message}};function r(t){var n=this.useColors;if(t[0]=(n?`%c`:``)+this.namespace+(n?` %c`:` `)+t[0]+(n?`%c `:` `)+`+`+e.humanize(this.diff),n){var r=`color: `+this.color;t.splice(1,0,r,`color: inherit`);var i=0,a=0;t[0].replace(/%[a-zA-Z%]/g,function(e){e!==`%%`&&(i++,e===`%c`&&(a=i))}),t.splice(a,0,r)}}function i(){return typeof console==`object`&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function a(t){try{t==null?e.storage.removeItem(`debug`):e.storage.debug=t}catch{}}function o(){var t;try{t=e.storage.debug}catch{}return!t&&typeof process<`u`&&`env`in process&&(t={}.DEBUG),t}e.enable(o());function s(){try{return window.localStorage}catch{}}})),he=t(((e,t)=>{var n=J(),r=Y(),i=q(),a=X(),o=Z(),s=Q()(`engine.io-client:polling`);t.exports=l;var c=(function(){return new(G())({xdomain:!1}).responseType!=null})();function l(e){var t=e&&e.forceBase64;(!c||t)&&(this.supportsBinary=!1),n.call(this,e)}a(l,n),l.prototype.name=`polling`,l.prototype.doOpen=function(){this.poll()},l.prototype.pause=function(e){var t=this;this.readyState=`pausing`;function n(){s(`paused`),t.readyState=`paused`,e()}if(this.polling||!this.writable){var r=0;this.polling&&(s(`we are currently polling - waiting to pause`),r++,this.once(`pollComplete`,function(){s(`pre-pause polling complete`),--r||n()})),this.writable||(s(`we are currently writing - waiting to pause`),r++,this.once(`drain`,function(){s(`pre-pause writing complete`),--r||n()}))}else n()},l.prototype.poll=function(){s(`polling`),this.polling=!0,this.doPoll(),this.emit(`poll`)},l.prototype.onData=function(e){var t=this;s(`polling got data %s`,e),i.decodePayload(e,this.socket.binaryType,function(e,n,r){if(t.readyState===`opening`&&e.type===`open`&&t.onOpen(),e.type===`close`)return t.onClose(),!1;t.onPacket(e)}),this.readyState!==`closed`&&(this.polling=!1,this.emit(`pollComplete`),this.readyState===`open`?this.poll():s(`ignoring poll - transport state "%s"`,this.readyState))},l.prototype.doClose=function(){var e=this;function t(){s(`writing close packet`),e.write([{type:`close`}])}this.readyState===`open`?(s(`transport open - closing`),t()):(s(`transport not open - deferring close`),this.once(`open`,t))},l.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit(`drain`)};i.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},l.prototype.uri=function(){var e=this.query||{},t=this.secure?`https`:`http`,n=``;!1!==this.timestampRequests&&(e[this.timestampParam]=o()),!this.supportsBinary&&!e.sid&&(e.b64=1),e=r.encode(e),this.port&&(t===`https`&&Number(this.port)!==443||t===`http`&&Number(this.port)!==80)&&(n=`:`+this.port),e.length&&(e=`?`+e);var i=this.hostname.indexOf(`:`)!==-1;return t+`://`+(i?`[`+this.hostname+`]`:this.hostname)+n+this.path+e}})),ge=t(((e,t)=>{var n=G(),r=he(),i=B(),a=X(),o=Q()(`engine.io-client:polling-xhr`),s=W();t.exports=l,t.exports.Request=u;function c(){}function l(e){if(r.call(this,e),this.requestTimeout=e.requestTimeout,this.extraHeaders=e.extraHeaders,typeof location<`u`){var t=location.protocol===`https:`,n=location.port;n||=t?443:80,this.xd=typeof location<`u`&&e.hostname!==location.hostname||n!==e.port,this.xs=e.secure!==t}}a(l,r),l.prototype.supportsBinary=!0,l.prototype.request=function(e){return e||={},e.uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.withCredentials=this.withCredentials,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new u(e)},l.prototype.doWrite=function(e,t){var n=typeof e!=`string`&&e!==void 0,r=this.request({method:`POST`,data:e,isBinary:n}),i=this;r.on(`success`,t),r.on(`error`,function(e){i.onError(`xhr post error`,e)}),this.sendXhr=r},l.prototype.doPoll=function(){o(`xhr poll`);var e=this.request(),t=this;e.on(`data`,function(e){t.onData(e)}),e.on(`error`,function(e){t.onError(`xhr poll error`,e)}),this.pollXhr=e};function u(e){this.method=e.method||`GET`,this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=e.data===void 0?null:e.data,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.withCredentials=e.withCredentials,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}if(i(u.prototype),u.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new n(e),r=this;try{o(`xhr open %s: %s`,this.method,this.uri),t.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var i in t.setDisableHeaderCheck&&t.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(i)&&t.setRequestHeader(i,this.extraHeaders[i])}catch{}if(this.method===`POST`)try{this.isBinary?t.setRequestHeader(`Content-type`,`application/octet-stream`):t.setRequestHeader(`Content-type`,`text/plain;charset=UTF-8`)}catch{}try{t.setRequestHeader(`Accept`,`*/*`)}catch{}`withCredentials`in t&&(t.withCredentials=this.withCredentials),this.requestTimeout&&(t.timeout=this.requestTimeout),this.hasXDR()?(t.onload=function(){r.onLoad()},t.onerror=function(){r.onError(t.responseText)}):t.onreadystatechange=function(){if(t.readyState===2)try{var e=t.getResponseHeader(`Content-Type`);(r.supportsBinary&&e===`application/octet-stream`||e===`application/octet-stream; charset=UTF-8`)&&(t.responseType=`arraybuffer`)}catch{}t.readyState===4&&(t.status===200||t.status===1223?r.onLoad():setTimeout(function(){r.onError(typeof t.status==`number`?t.status:0)},0))},o(`xhr data %s`,this.data),t.send(this.data)}catch(e){setTimeout(function(){r.onError(e)},0);return}typeof document<`u`&&(this.index=u.requestsCount++,u.requests[this.index]=this)},u.prototype.onSuccess=function(){this.emit(`success`),this.cleanup()},u.prototype.onData=function(e){this.emit(`data`,e),this.onSuccess()},u.prototype.onError=function(e){this.emit(`error`,e),this.cleanup(!0)},u.prototype.cleanup=function(e){if(this.xhr!==void 0&&this.xhr!==null){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=c:this.xhr.onreadystatechange=c,e)try{this.xhr.abort()}catch{}typeof document<`u`&&delete u.requests[this.index],this.xhr=null}},u.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader(`Content-Type`)}catch{}e=(t===`application/octet-stream`||t===`application/octet-stream; charset=UTF-8`)&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}e!=null&&this.onData(e)},u.prototype.hasXDR=function(){return typeof XDomainRequest<`u`&&!this.xs&&this.enablesXDR},u.prototype.abort=function(){this.cleanup()},u.requestsCount=0,u.requests={},typeof document<`u`){if(typeof attachEvent==`function`)attachEvent(`onunload`,f);else if(typeof addEventListener==`function`){var d=`onpagehide`in s?`pagehide`:`unload`;addEventListener(d,f,!1)}}function f(){for(var e in u.requests)u.requests.hasOwnProperty(e)&&u.requests[e].abort()}})),_e=t(((e,t)=>{var n=he(),r=X(),i=W();t.exports=l;var a=/\n/g,o=/\\n/g,s;function c(){}function l(e){n.call(this,e),this.query=this.query||{},s||=i.___eio=i.___eio||[],this.index=s.length;var t=this;s.push(function(e){t.onData(e)}),this.query.j=this.index,typeof addEventListener==`function`&&addEventListener(`beforeunload`,function(){t.script&&(t.script.onerror=c)},!1)}r(l,n),l.prototype.supportsBinary=!1,l.prototype.doClose=function(){this.script&&=(this.script.parentNode.removeChild(this.script),null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),n.prototype.doClose.call(this)},l.prototype.doPoll=function(){var e=this,t=document.createElement(`script`);this.script&&=(this.script.parentNode.removeChild(this.script),null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError(`jsonp poll error`,t)};var n=document.getElementsByTagName(`script`)[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,typeof navigator<`u`&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var e=document.createElement(`iframe`);document.body.appendChild(e),document.body.removeChild(e)},100)},l.prototype.doWrite=function(e,t){var n=this;if(!this.form){var r=document.createElement(`form`),i=document.createElement(`textarea`),s=this.iframeId=`eio_iframe_`+this.index,c;r.className=`socketio`,r.style.position=`absolute`,r.style.top=`-1000px`,r.style.left=`-1000px`,r.target=s,r.method=`POST`,r.setAttribute(`accept-charset`,`utf-8`),i.name=`d`,r.appendChild(i),document.body.appendChild(r),this.form=r,this.area=i}this.form.action=this.uri();function l(){u(),t()}function u(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(e){n.onError(`jsonp polling iframe removal error`,e)}try{var e=`<iframe src="javascript:0" name="`+n.iframeId+`">`;c=document.createElement(e)}catch{c=document.createElement(`iframe`),c.name=n.iframeId,c.src=`javascript:0`}c.id=n.iframeId,n.form.appendChild(c),n.iframe=c}u(),e=e.replace(o,`\\
`),this.area.value=e.replace(a,`\\n`);try{this.form.submit()}catch{}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){n.iframe.readyState===`complete`&&l()}:this.iframe.onload=l}})),ve=t(((e,t)=>{t.exports={}})),ye=t(((e,t)=>{var n=J(),r=q(),i=Y(),a=X(),o=Z(),s=Q()(`engine.io-client:websocket`),c,l;if(typeof WebSocket<`u`?c=WebSocket:typeof self<`u`&&(c=self.WebSocket||self.MozWebSocket),typeof window>`u`)try{l=ve()}catch{}var u=c||l;t.exports=d;function d(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=c&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(u=l),n.call(this,e)}a(d,n),d.prototype.name=`websocket`,d.prototype.supportsBinary=!0,d.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={};this.isReactNative||(n.agent=this.agent,n.perMessageDeflate=this.perMessageDeflate,n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized),this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?t?new u(e,t):new u(e):new u(e,t,n)}catch(e){return this.emit(`error`,e)}this.ws.binaryType===void 0&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType=`nodebuffer`):this.ws.binaryType=`arraybuffer`,this.addEventListeners()}},d.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError(`websocket error`,t)}},d.prototype.write=function(e){var t=this;this.writable=!1;for(var n=e.length,i=0,a=n;i<a;i++)(function(e){r.encodePacket(e,t.supportsBinary,function(r){if(!t.usingBrowserWebSocket){var i={};e.options&&(i.compress=e.options.compress),t.perMessageDeflate&&(typeof r==`string`?Buffer.byteLength(r):r.length)<t.perMessageDeflate.threshold&&(i.compress=!1)}try{t.usingBrowserWebSocket?t.ws.send(r):t.ws.send(r,i)}catch{s(`websocket closed before onclose event`)}--n||o()})})(e[i]);function o(){t.emit(`flush`),setTimeout(function(){t.writable=!0,t.emit(`drain`)},0)}},d.prototype.onClose=function(){n.prototype.onClose.call(this)},d.prototype.doClose=function(){this.ws!==void 0&&(this.ws.onerror=function(){},this.ws.close())},d.prototype.uri=function(){var e=this.query||{},t=this.secure?`wss`:`ws`,n=``;this.port&&(t===`wss`&&Number(this.port)!==443||t===`ws`&&Number(this.port)!==80)&&(n=`:`+this.port),this.timestampRequests&&(e[this.timestampParam]=o()),this.supportsBinary||(e.b64=1),e=i.encode(e),e.length&&(e=`?`+e);var r=this.hostname.indexOf(`:`)!==-1;return t+`://`+(r?`[`+this.hostname+`]`:this.hostname)+n+this.path+e},d.prototype.check=function(){return!!u&&!(`__initialize`in u&&this.name===d.prototype.name)}})),be=t((e=>{var t=G(),n=ge(),r=_e(),i=ye();e.polling=a,e.websocket=i;function a(e){var i,a=!1,o=!1,s=!1!==e.jsonp;if(typeof location<`u`){var c=location.protocol===`https:`,l=location.port;l||=c?443:80,a=e.hostname!==location.hostname||l!==e.port,o=e.secure!==c}if(e.xdomain=a,e.xscheme=o,i=new t(e),`open`in i&&!e.forceJSONP)return new n(e);if(!s)throw Error(`JSONP disabled`);return new r(e)}})),xe=t(((e,t)=>{var n=[].indexOf;t.exports=function(e,t){if(n)return e.indexOf(t);for(var r=0;r<e.length;++r)if(e[r]===t)return r;return-1}})),Se=t(((e,t)=>{var n=be(),r=B(),i=Q()(`engine.io-client:socket`),a=xe(),o=q(),s=I(),c=Y();t.exports=l;function l(e,t){if(!(this instanceof l))return new l(e,t);t||={},e&&typeof e==`object`&&(t=e,e=null),e?(e=s(e),t.hostname=e.host,t.secure=e.protocol===`https`||e.protocol===`wss`,t.port=e.port,e.query&&(t.query=e.query)):t.host&&(t.hostname=s(t.host).host),this.secure=t.secure==null?typeof location<`u`&&location.protocol===`https:`:t.secure,t.hostname&&!t.port&&(t.port=this.secure?`443`:`80`),this.agent=t.agent||!1,this.hostname=t.hostname||(typeof location<`u`?location.hostname:`localhost`),this.port=t.port||(typeof location<`u`&&location.port?location.port:this.secure?443:80),this.query=t.query||{},typeof this.query==`string`&&(this.query=c.decode(this.query)),this.upgrade=!1!==t.upgrade,this.path=(t.path||`/engine.io`).replace(/\/$/,``)+`/`,this.forceJSONP=!!t.forceJSONP,this.jsonp=!1!==t.jsonp,this.forceBase64=!!t.forceBase64,this.enablesXDR=!!t.enablesXDR,this.withCredentials=!1!==t.withCredentials,this.timestampParam=t.timestampParam||`t`,this.timestampRequests=t.timestampRequests,this.transports=t.transports||[`polling`,`websocket`],this.transportOptions=t.transportOptions||{},this.readyState=``,this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=t.policyPort||843,this.rememberUpgrade=t.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=t.onlyBinaryUpgrades,this.perMessageDeflate=!1===t.perMessageDeflate?!1:t.perMessageDeflate||{},!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&this.perMessageDeflate.threshold==null&&(this.perMessageDeflate.threshold=1024),this.pfx=t.pfx||void 0,this.key=t.key||void 0,this.passphrase=t.passphrase||void 0,this.cert=t.cert||void 0,this.ca=t.ca||void 0,this.ciphers=t.ciphers||void 0,this.rejectUnauthorized=t.rejectUnauthorized===void 0||t.rejectUnauthorized,this.forceNode=!!t.forceNode,this.isReactNative=typeof navigator<`u`&&typeof navigator.product==`string`&&navigator.product.toLowerCase()===`reactnative`,(typeof self>`u`||this.isReactNative)&&(t.extraHeaders&&Object.keys(t.extraHeaders).length>0&&(this.extraHeaders=t.extraHeaders),t.localAddress&&(this.localAddress=t.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}l.priorWebsocketSuccess=!1,r(l.prototype),l.protocol=o.protocol,l.Socket=l,l.Transport=J(),l.transports=be(),l.parser=q(),l.prototype.createTransport=function(e){i(`creating transport "%s"`,e);var t=u(this.query);t.EIO=o.protocol,t.transport=e;var r=this.transportOptions[e]||{};return this.id&&(t.sid=this.id),new n[e]({query:t,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,withCredentials:r.withCredentials||this.withCredentials,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0,isReactNative:this.isReactNative})};function u(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}l.prototype.open=function(){var e;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&this.transports.indexOf(`websocket`)!==-1)e=`websocket`;else if(this.transports.length===0){var t=this;setTimeout(function(){t.emit(`error`,`No transports available`)},0);return}else e=this.transports[0];this.readyState=`opening`;try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)},l.prototype.setTransport=function(e){i(`setting transport %s`,e.name);var t=this;this.transport&&(i(`clearing existing transport %s`,this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on(`drain`,function(){t.onDrain()}).on(`packet`,function(e){t.onPacket(e)}).on(`error`,function(e){t.onError(e)}).on(`close`,function(){t.onClose(`transport close`)})},l.prototype.probe=function(e){i(`probing transport "%s"`,e);var t=this.createTransport(e,{probe:1}),n=!1,r=this;l.priorWebsocketSuccess=!1;function a(){if(r.onlyBinaryUpgrades){var a=!this.supportsBinary&&r.transport.supportsBinary;n||=a}n||(i(`probe transport "%s" opened`,e),t.send([{type:`ping`,data:`probe`}]),t.once(`packet`,function(a){if(!n){if(a.type===`pong`&&a.data===`probe`){if(i(`probe transport "%s" pong`,e),r.upgrading=!0,r.emit(`upgrading`,t),!t)return;l.priorWebsocketSuccess=t.name===`websocket`,i(`pausing current transport "%s"`,r.transport.name),r.transport.pause(function(){n||r.readyState!==`closed`&&(i(`changing transport and sending upgrade packet`),f(),r.setTransport(t),t.send([{type:`upgrade`}]),r.emit(`upgrade`,t),t=null,r.upgrading=!1,r.flush())})}else{i(`probe transport "%s" failed`,e);var o=Error(`probe error`);o.transport=t.name,r.emit(`upgradeError`,o)}}}))}function o(){n||(n=!0,f(),t.close(),t=null)}function s(n){var a=Error(`probe error: `+n);a.transport=t.name,o(),i(`probe transport "%s" failed because of error: %s`,e,n),r.emit(`upgradeError`,a)}function c(){s(`transport closed`)}function u(){s(`socket closed`)}function d(e){t&&e.name!==t.name&&(i(`"%s" works - aborting "%s"`,e.name,t.name),o())}function f(){t.removeListener(`open`,a),t.removeListener(`error`,s),t.removeListener(`close`,c),r.removeListener(`close`,u),r.removeListener(`upgrading`,d)}t.once(`open`,a),t.once(`error`,s),t.once(`close`,c),this.once(`close`,u),this.once(`upgrading`,d),t.open()},l.prototype.onOpen=function(){if(i(`socket open`),this.readyState=`open`,l.priorWebsocketSuccess=this.transport.name===`websocket`,this.emit(`open`),this.flush(),this.readyState===`open`&&this.upgrade&&this.transport.pause){i(`starting upgrade probes`);for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},l.prototype.onPacket=function(e){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`)switch(i(`socket receive: type "%s", data "%s"`,e.type,e.data),this.emit(`packet`,e),this.emit(`heartbeat`),e.type){case`open`:this.onHandshake(JSON.parse(e.data));break;case`pong`:this.setPing(),this.emit(`pong`);break;case`error`:var t=Error(`server error`);t.code=e.data,this.onError(t);break;case`message`:this.emit(`data`,e.data),this.emit(`message`,e.data)}else i(`packet received with socket readyState "%s"`,this.readyState)},l.prototype.onHandshake=function(e){this.emit(`handshake`,e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),this.readyState!==`closed`&&(this.setPing(),this.removeListener(`heartbeat`,this.onHeartbeat),this.on(`heartbeat`,this.onHeartbeat))},l.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){t.readyState!==`closed`&&t.onClose(`ping timeout`)},e||t.pingInterval+t.pingTimeout)},l.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){i(`writing ping packet - expecting pong within %sms`,e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},l.prototype.ping=function(){var e=this;this.sendPacket(`ping`,function(){e.emit(`ping`)})},l.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emit(`drain`):this.flush()},l.prototype.flush=function(){this.readyState!==`closed`&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(i(`flushing %d packets in socket`,this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit(`flush`))},l.prototype.write=l.prototype.send=function(e,t,n){return this.sendPacket(`message`,e,t,n),this},l.prototype.sendPacket=function(e,t,n,r){if(typeof t==`function`&&(r=t,t=void 0),typeof n==`function`&&(r=n,n=null),this.readyState!==`closing`&&this.readyState!==`closed`){n||={},n.compress=!1!==n.compress;var i={type:e,data:t,options:n};this.emit(`packetCreate`,i),this.writeBuffer.push(i),r&&this.once(`flush`,r),this.flush()}},l.prototype.close=function(){if(this.readyState===`opening`||this.readyState===`open`){this.readyState=`closing`;var e=this;this.writeBuffer.length?this.once(`drain`,function(){this.upgrading?r():t()}):this.upgrading?r():t()}function t(){e.onClose(`forced close`),i(`socket closing - telling transport to close`),e.transport.close()}function n(){e.removeListener(`upgrade`,n),e.removeListener(`upgradeError`,n),t()}function r(){e.once(`upgrade`,n),e.once(`upgradeError`,n)}return this},l.prototype.onError=function(e){i(`socket error %j`,e),l.priorWebsocketSuccess=!1,this.emit(`error`,e),this.onClose(`transport error`,e)},l.prototype.onClose=function(e,t){if(this.readyState===`opening`||this.readyState===`open`||this.readyState===`closing`){i(`socket close with reason: "%s"`,e);var n=this;clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners(`close`),this.transport.close(),this.transport.removeAllListeners(),this.readyState=`closed`,this.id=null,this.emit(`close`,e,t),n.writeBuffer=[],n.prevBufferLen=0}},l.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;n<r;n++)~a(this.transports,e[n])&&t.push(e[n]);return t}})),Ce=t(((e,t)=>{t.exports=Se(),t.exports.parser=q()})),we=t(((e,t)=>{t.exports=n;function n(e,t){var n=[];t||=0;for(var r=t||0;r<e.length;r++)n[r-t]=e[r];return n}})),Te=t(((e,t)=>{t.exports=n;function n(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}}})),Ee=t(((e,t)=>{var n=[].slice;t.exports=function(e,t){if(typeof t==`string`&&(t=e[t]),typeof t!=`function`)throw Error(`bind() requires a function`);var r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}})),De=t(((e,t)=>{var n=U(),r=B(),i=we(),a=Te(),o=Ee(),s=z()(`socket.io-client:socket`),c=Y(),l=K();t.exports=e=f;var u={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},d=r.prototype.emit;function f(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}r(f.prototype),f.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[a(e,`open`,o(this,`onopen`)),a(e,`packet`,o(this,`onpacket`)),a(e,`close`,o(this,`onclose`))]}},f.prototype.open=f.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.reconnecting||this.io.open(),this.io.readyState===`open`&&this.onopen(),this.emit(`connecting`),this)},f.prototype.send=function(){var e=i(arguments);return e.unshift(`message`),this.emit.apply(this,e),this},f.prototype.emit=function(e){if(u.hasOwnProperty(e))return d.apply(this,arguments),this;var t=i(arguments),r={type:(this.flags.binary===void 0?l(t):this.flags.binary)?n.BINARY_EVENT:n.EVENT,data:t};return r.options={},r.options.compress=!this.flags||!1!==this.flags.compress,typeof t[t.length-1]==`function`&&(s(`emitting packet with ack id %d`,this.ids),this.acks[this.ids]=t.pop(),r.id=this.ids++),this.connected?this.packet(r):this.sendBuffer.push(r),this.flags={},this},f.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},f.prototype.onopen=function(){if(s(`transport is open - connecting`),this.nsp!==`/`){if(this.query){var e=typeof this.query==`object`?c.encode(this.query):this.query;s(`sending connect packet with query %s`,e),this.packet({type:n.CONNECT,query:e})}else this.packet({type:n.CONNECT})}},f.prototype.onclose=function(e){s(`close (%s)`,e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit(`disconnect`,e)},f.prototype.onpacket=function(e){var t=e.nsp===this.nsp,r=e.type===n.ERROR&&e.nsp===`/`;if(t||r)switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:this.onevent(e);break;case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:this.onack(e);break;case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit(`error`,e.data)}},f.prototype.onevent=function(e){var t=e.data||[];s(`emitting event %j`,t),e.id!=null&&(s(`attaching ack callback to event`),t.push(this.ack(e.id))),this.connected?d.apply(this,t):this.receiveBuffer.push(t)},f.prototype.ack=function(e){var t=this,r=!1;return function(){if(!r){r=!0;var a=i(arguments);s(`sending ack %j`,a),t.packet({type:l(a)?n.BINARY_ACK:n.ACK,id:e,data:a})}}},f.prototype.onack=function(e){var t=this.acks[e.id];typeof t==`function`?(s(`calling ack %s with %j`,e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):s(`bad ack %s`,e.id)},f.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emitBuffered(),this.emit(`connect`)},f.prototype.emitBuffered=function(){for(var e=0;e<this.receiveBuffer.length;e++)d.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},f.prototype.ondisconnect=function(){s(`server disconnect (%s)`,this.nsp),this.destroy(),this.onclose(`io server disconnect`)},f.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},f.prototype.close=f.prototype.disconnect=function(){return this.connected&&(s(`performing disconnect (%s)`,this.nsp),this.packet({type:n.DISCONNECT})),this.destroy(),this.connected&&this.onclose(`io client disconnect`),this},f.prototype.compress=function(e){return this.flags.compress=e,this},f.prototype.binary=function(e){return this.flags.binary=e,this}})),Oe=t(((e,t)=>{t.exports=n;function n(e){e||={},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}n.prototype.duration=function(){var e=this.ms*this.factor**+this.attempts++;if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0},n.prototype.reset=function(){this.attempts=0},n.prototype.setMin=function(e){this.ms=e},n.prototype.setMax=function(e){this.max=e},n.prototype.setJitter=function(e){this.jitter=e}})),$=t(((e,t)=>{var n=Ce(),r=De(),i=B(),a=U(),o=Te(),s=Ee(),c=z()(`socket.io-client:manager`),l=xe(),u=Oe(),d=Object.prototype.hasOwnProperty;t.exports=f;function f(e,t){if(!(this instanceof f))return new f(e,t);e&&typeof e==`object`&&(t=e,e=void 0),t||={},t.path=t.path||`/socket.io`,this.nsps={},this.subs=[],this.opts=t,this.reconnection(t.reconnection!==!1),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new u({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(t.timeout==null?2e4:t.timeout),this.readyState=`closed`,this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=t.parser||a;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=t.autoConnect!==!1,this.autoConnect&&this.open()}f.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)d.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},f.prototype.updateSocketIds=function(){for(var e in this.nsps)d.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},f.prototype.generateId=function(e){return(e===`/`?``:e+`#`)+this.engine.id},i(f.prototype),f.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},f.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},f.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},f.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},f.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},f.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},f.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()},f.prototype.open=f.prototype.connect=function(e,t){if(c(`readyState %s`,this.readyState),~this.readyState.indexOf(`open`))return this;c(`opening %s`,this.uri),this.engine=n(this.uri,this.opts);var r=this.engine,i=this;this.readyState=`opening`,this.skipReconnect=!1;var a=o(r,`open`,function(){i.onopen(),e&&e()}),s=o(r,`error`,function(t){if(c(`connect_error`),i.cleanup(),i.readyState=`closed`,i.emitAll(`connect_error`,t),e){var n=Error(`Connection error`);n.data=t,e(n)}else i.maybeReconnectOnOpen()});if(!1!==this._timeout){var l=this._timeout;c(`connect attempt will timeout after %d`,l),l===0&&a.destroy();var u=setTimeout(function(){c(`connect attempt timed out after %d`,l),a.destroy(),r.close(),r.emit(`error`,`timeout`),i.emitAll(`connect_timeout`,l)},l);this.subs.push({destroy:function(){clearTimeout(u)}})}return this.subs.push(a),this.subs.push(s),this},f.prototype.onopen=function(){c(`open`),this.cleanup(),this.readyState=`open`,this.emit(`open`);var e=this.engine;this.subs.push(o(e,`data`,s(this,`ondata`))),this.subs.push(o(e,`ping`,s(this,`onping`))),this.subs.push(o(e,`pong`,s(this,`onpong`))),this.subs.push(o(e,`error`,s(this,`onerror`))),this.subs.push(o(e,`close`,s(this,`onclose`))),this.subs.push(o(this.decoder,`decoded`,s(this,`ondecoded`)))},f.prototype.onping=function(){this.lastPing=new Date,this.emitAll(`ping`)},f.prototype.onpong=function(){this.emitAll(`pong`,new Date-this.lastPing)},f.prototype.ondata=function(e){this.decoder.add(e)},f.prototype.ondecoded=function(e){this.emit(`packet`,e)},f.prototype.onerror=function(e){c(`error`,e),this.emitAll(`error`,e)},f.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new r(this,e,t),this.nsps[e]=n;var i=this;n.on(`connecting`,a),n.on(`connect`,function(){n.id=i.generateId(e)}),this.autoConnect&&a()}function a(){~l(i.connecting,n)||i.connecting.push(n)}return n},f.prototype.destroy=function(e){var t=l(this.connecting,e);~t&&this.connecting.splice(t,1),!this.connecting.length&&this.close()},f.prototype.packet=function(e){c(`writing packet %j`,e);var t=this;e.query&&e.type===0&&(e.nsp+=`?`+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()}))},f.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},f.prototype.cleanup=function(){c(`cleanup`);for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},f.prototype.close=f.prototype.disconnect=function(){c(`disconnect`),this.skipReconnect=!0,this.reconnecting=!1,this.readyState===`opening`&&this.cleanup(),this.backoff.reset(),this.readyState=`closed`,this.engine&&this.engine.close()},f.prototype.onclose=function(e){c(`onclose`),this.cleanup(),this.backoff.reset(),this.readyState=`closed`,this.emit(`close`,e),this._reconnection&&!this.skipReconnect&&this.reconnect()},f.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)c(`reconnect failed`),this.backoff.reset(),this.emitAll(`reconnect_failed`),this.reconnecting=!1;else{var t=this.backoff.duration();c(`will wait %dms before reconnect attempt`,t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(c(`attempting reconnect`),e.emitAll(`reconnect_attempt`,e.backoff.attempts),e.emitAll(`reconnecting`,e.backoff.attempts),!e.skipReconnect&&e.open(function(t){t?(c(`reconnect attempt error`),e.reconnecting=!1,e.reconnect(),e.emitAll(`reconnect_error`,t.data)):(c(`reconnect success`),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},f.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll(`reconnect`,e)}})),ke=n(t(((e,t)=>{var n=te(),r=U(),i=$(),a=z()(`socket.io-client`);t.exports=e=s;var o=e.managers={};function s(e,t){typeof e==`object`&&(t=e,e=void 0),t||={};var r=n(e),s=r.source,c=r.id,l=r.path,u=o[c]&&l in o[c].nsps,d=t.forceNew||t[`force new connection`]||!1===t.multiplex||u,f;return d?(a(`ignoring socket cache for %s`,s),f=i(s,t)):(o[c]||(a(`new io instance for %s`,s),o[c]=i(s,t)),f=o[c]),r.query&&!t.query&&(t.query=r.query),f.socket(r.path,t)}e.protocol=r.protocol,e.connect=s,e.Manager=$(),e.Socket=De()}))(),1);function Ae(e,t,n,i,a){let o=(0,r.useRef)(n);(0,r.useEffect)(()=>{o.current=n},[n]),(0,r.useEffect)(()=>{if(!e||!t)return;let n=ke.connect(`wss://ws.djyanbao.com`,{transports:[`websocket`],timeout:3e5,reconnectionDelayMax:1e3,reconnectionDelay:500}),r=()=>{n.emit(i,{scene:t})},s=e=>{o.current(e)};return n.on(`connect`,r),n.on(a,s),n.connected&&r(),()=>{n.off(`connect`,r),n.off(a,s),n.disconnect()}},[e,t,i,a])}export{O as i,F as n,P as r,Ae as t};