cool-common-utils 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/aes.js +1 -1
  2. package/dist/aes.mjs +1 -1
  3. package/dist/amap-utils.js +1 -1
  4. package/dist/amap-utils.mjs +1 -1
  5. package/dist/commons/vendor-crypto-js-AYnBdXB5.js +18 -0
  6. package/dist/commons/vendor-crypto-js-Dhi5niDn.js +18 -0
  7. package/dist/commons/vendor-other-C48Un_So.js +1 -0
  8. package/dist/commons/vendor-other-oYX07ukn.js +1 -0
  9. package/dist/commons/vendor-qs-Dasci0ry.js +1 -0
  10. package/dist/commons/vendor-qs-DpjaCScg.js +1 -0
  11. package/dist/commons/vendor-socket.io-client-CkipB4mt.js +1 -0
  12. package/dist/commons/vendor-socket.io-client-DHDwO2X7.js +1 -0
  13. package/dist/commons/vendor-sweetalert-4FJTrmvX.js +1 -0
  14. package/dist/commons/vendor-sweetalert-KX8J3Sv0.js +1 -0
  15. package/dist/index.d.ts +1 -3
  16. package/dist/index.js +1 -1
  17. package/dist/index.mjs +1 -1
  18. package/dist/message.js +1 -1
  19. package/dist/message.mjs +1 -1
  20. package/dist/request.js +1 -1
  21. package/dist/request.mjs +1 -1
  22. package/dist/socket-io.js +1 -1
  23. package/dist/socket-io.mjs +1 -1
  24. package/dist/utils.js +1 -1
  25. package/dist/utils.mjs +1 -1
  26. package/dist/websocket.js +1 -1
  27. package/dist/websocket.mjs +1 -1
  28. package/package.json +2 -4
  29. package/dist/commons/crypto-CT1W49ET.js +0 -18
  30. package/dist/commons/crypto-DuLLVHQr.js +0 -18
  31. package/dist/commons/mqtt-ClqAR6Iy.js +0 -13
  32. package/dist/commons/mqtt-CsLh6xMv.js +0 -13
  33. package/dist/commons/qs-D46UmmL2.js +0 -1
  34. package/dist/commons/qs-yb498JEx.js +0 -1
  35. package/dist/commons/socket_io-Bw6JUjpU.js +0 -1
  36. package/dist/commons/socket_io-CSNhVzSE.js +0 -1
  37. package/dist/commons/sweetalert-B1ksMzDj.js +0 -1
  38. package/dist/commons/sweetalert-DMYmZawW.js +0 -1
  39. package/dist/commons/tslib.es6-BjAlDJRq.js +0 -1
  40. package/dist/commons/tslib.es6-DVnGIs25.js +0 -1
  41. package/dist/commons/xlsx_js-D6tizOBX.js +0 -2
  42. package/dist/commons/xlsx_js-qidrMB31.js +0 -2
  43. package/dist/excel-xlsx-util.js +0 -1
  44. package/dist/excel-xlsx-util.mjs +0 -1
  45. package/dist/mqtt.js +0 -1
  46. package/dist/mqtt.mjs +0 -1
  47. package/dist/utils/exports/excel-xlsx-util.d.ts +0 -14
  48. package/dist/utils/sockets/mqtt.d.ts +0 -21
  49. /package/dist/commons/{axios-DsdlaZnY.js → vendor-axios-DsdlaZnY.js} +0 -0
  50. /package/dist/commons/{axios-DxFWCEd0.js → vendor-axios-DxFWCEd0.js} +0 -0
@@ -1,13 +0,0 @@
1
- var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i=(e,t)=>()=>(e&&(t=e(e=0)),t),o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(t,r)=>{for(var n in r)e(t,n,{get:r[n],enumerable:!0})},a=i=>((i,o,s,a)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let l of r(o))!n.call(i,l)&&l!==s&&e(i,l,{get:()=>o[l],enumerable:!(a=t(o,l))||a.enumerable});return i})(e({},"__esModule",{value:!0}),i),l=i(()=>{}),u={};function c(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function h(){!O||!x||(O=!1,x.length?k=x.concat(k):P=-1,k.length&&f())}function f(){if(!O){var e=setTimeout(h,0);O=!0;for(var t=k.length;t;){for(x=k,k=[];++P<t;)x&&x[P].run();P=-1,t=k.length}x=null,O=!1,clearTimeout(e)}}function p(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];k.push(new d(e,t)),1===k.length&&!O&&setTimeout(f,0)}function d(e,t){this.fun=e,this.array=t}function g(){}function y(e){c("_linkedBinding")}function b(e){c("dlopen")}function m(){return[]}function w(){return[]}function v(e,t){if(!e)throw new Error(t||"assertion error")}function _(){return!1}function S(){return Ae.now()/1e3}function E(e){var t=Math.floor(.001*(Date.now()-Ae.now())),r=.001*Ae.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=ke)),[n,i]}function A(){return Le}function I(e){return[]}s(u,{_debugEnd:()=>ce,_debugProcess:()=>ue,_events:()=>xe,_eventsCount:()=>Pe,_exiting:()=>G,_fatalExceptions:()=>se,_getActiveHandles:()=>w,_getActiveRequests:()=>m,_kill:()=>J,_linkedBinding:()=>y,_maxListeners:()=>Oe,_preload_modules:()=>Se,_rawDebug:()=>V,_startProfilerIdleNotifier:()=>he,_stopProfilerIdleNotifier:()=>fe,_tickCallback:()=>le,abort:()=>ye,addListener:()=>Te,allowedNodeEnvironmentFlags:()=>ie,arch:()=>R,argv:()=>M,argv0:()=>_e,assert:()=>v,binding:()=>D,browser:()=>H,chdir:()=>q,config:()=>Q,cpuUsage:()=>X,cwd:()=>W,debugPort:()=>ve,default:()=>Le,dlopen:()=>b,domain:()=>K,emit:()=>Be,emitWarning:()=>L,env:()=>j,execArgv:()=>B,execPath:()=>we,exit:()=>re,features:()=>oe,hasUncaughtExceptionCaptureCallback:()=>_,hrtime:()=>E,kill:()=>te,listeners:()=>I,memoryUsage:()=>ee,moduleLoadList:()=>z,nextTick:()=>p,off:()=>Ce,on:()=>A,once:()=>Re,openStdin:()=>ne,pid:()=>be,platform:()=>C,ppid:()=>me,prependListener:()=>Ne,prependOnceListener:()=>Ue,reallyExit:()=>Y,release:()=>$,removeAllListeners:()=>Me,removeListener:()=>je,resourceUsage:()=>Z,setSourceMapsEnabled:()=>Ee,setUncaughtExceptionCaptureCallback:()=>ae,stderr:()=>de,stdin:()=>ge,stdout:()=>pe,title:()=>T,umask:()=>F,uptime:()=>S,version:()=>N,versions:()=>U});var k,O,x,P,T,R,C,j,M,B,N,U,L,D,F,W,q,$,H,V,z,K,G,Q,Y,J,X,Z,ee,te,re,ne,ie,oe,se,ae,le,ue,ce,he,fe,pe,de,ge,ye,be,me,we,ve,_e,Se,Ee,Ae,Ie,ke,Oe,xe,Pe,Te,Re,Ce,je,Me,Be,Ne,Ue,Le,De=i(()=>{l(),tt(),Fe(),k=[],O=!1,P=-1,d.prototype.run=function(){this.fun.apply(null,this.array)},T="browser",R="x64",C="browser",j={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},M=["/usr/bin/node"],B=[],N="v16.8.0",U={},L=function(e,t){console.warn((t?t+": ":"")+e)},D=function(e){c("binding")},F=function(e){return 0},W=function(){return"/"},q=function(e){},$={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},H=!0,V=g,z=[],K={},G=!1,Q={},Y=g,J=g,Z=X=function(){return{}},ee=X,te=g,re=g,ne=g,ie={},oe={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},se=g,ae=g,le=g,ue=g,ce=g,he=g,fe=g,pe=void 0,de=void 0,ge=void 0,ye=g,be=2,me=1,we="/bin/usr/node",ve=9229,_e="node",Se=[],Ee=g,void 0===(Ae={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0}).now&&(Ie=Date.now(),Ae.timing&&Ae.timing.navigationStart&&(Ie=Ae.timing.navigationStart),Ae.now=()=>Date.now()-Ie),ke=1e9,E.bigint=function(e){var t=E(e);return typeof BigInt>"u"?t[0]*ke+t[1]:BigInt(t[0]*ke)+BigInt(t[1])},Le={version:N,versions:U,arch:R,platform:C,browser:H,release:$,_rawDebug:V,moduleLoadList:z,binding:D,_linkedBinding:y,_events:xe={},_eventsCount:Pe=0,_maxListeners:Oe=10,on:A,addListener:Te=A,once:Re=A,off:Ce=A,removeListener:je=A,removeAllListeners:Me=A,emit:Be=g,prependListener:Ne=A,prependOnceListener:Ue=A,listeners:I,domain:K,_exiting:G,config:Q,dlopen:b,uptime:S,_getActiveRequests:m,_getActiveHandles:w,reallyExit:Y,_kill:J,cpuUsage:X,resourceUsage:Z,memoryUsage:ee,kill:te,exit:re,openStdin:ne,allowedNodeEnvironmentFlags:ie,assert:v,features:oe,_fatalExceptions:se,setUncaughtExceptionCaptureCallback:ae,hasUncaughtExceptionCaptureCallback:_,emitWarning:L,nextTick:p,_tickCallback:le,_debugProcess:ue,_debugEnd:ce,_startProfilerIdleNotifier:he,_stopProfilerIdleNotifier:fe,stdout:pe,stdin:ge,stderr:de,abort:ye,umask:F,chdir:q,cwd:W,env:j,title:T,argv:M,execArgv:B,pid:be,ppid:me,execPath:we,debugPort:ve,hrtime:E,argv0:_e,_preload_modules:Se,setSourceMapsEnabled:Ee}}),Fe=i(()=>{De()});function We(){if(Ke)return ze;Ke=!0;let e=function(){if($e)return qe;$e=!0,qe.byteLength=function(e){var t=o(e),r=t[0],n=t[1];return 3*(r+n)/4-n},qe.toByteArray=function(e){var n,i,s=o(e),a=s[0],l=s[1],u=new r(function(e,t,r){return 3*(t+r)/4-r}(0,a,l)),c=0,h=l>0?a-4:a;for(i=0;i<h;i+=4)n=t[e.charCodeAt(i)]<<18|t[e.charCodeAt(i+1)]<<12|t[e.charCodeAt(i+2)]<<6|t[e.charCodeAt(i+3)],u[c++]=n>>16&255,u[c++]=n>>8&255,u[c++]=255&n;return 2===l&&(n=t[e.charCodeAt(i)]<<2|t[e.charCodeAt(i+1)]>>4,u[c++]=255&n),1===l&&(n=t[e.charCodeAt(i)]<<10|t[e.charCodeAt(i+1)]<<4|t[e.charCodeAt(i+2)]>>2,u[c++]=n>>8&255,u[c++]=255&n),u},qe.fromByteArray=function(t){for(var r,n=t.length,i=n%3,o=[],s=16383,l=0,u=n-i;l<u;l+=s)o.push(a(t,l,l+s>u?u:l+s));return 1===i?(r=t[n-1],o.push(e[r>>2]+e[r<<4&63]+"==")):2===i&&(r=(t[n-2]<<8)+t[n-1],o.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),o.join("")};for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0;i<64;++i)e[i]=n[i],t[n.charCodeAt(i)]=i;function o(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function a(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(s(n));return i.join("")}return t[45]=62,t[95]=63,qe}(),t=(Ve||(Ve=!0,He.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,u=l>>1,c=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-c)-1,p>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-u;else{if(o===l)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},He.write=function(e,t,r,n,i,o){var s,a,l,u=8*o-i-1,c=(1<<u)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+h>=1?f/l:f*Math.pow(2,1-h))*l>=2&&(s++,l/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*l-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+p]=255&s,p+=d,s/=256,u-=8);e[r+p-d]|=128*g}),He),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;ze.Buffer=o,ze.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},ze.INSPECT_MAX_BYTES=50;let n=2147483647;function i(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=0|f(e,t),n=i(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(z(e,Uint8Array)){let t=new Uint8Array(e);return c(t.buffer,t.byteOffset,t.byteLength)}return u(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(z(e,ArrayBuffer)||e&&z(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(z(e,SharedArrayBuffer)||e&&z(e.buffer,SharedArrayBuffer)))return c(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);let s=function(e){if(o.isBuffer(e)){let t=0|h(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}if(void 0!==e.length)return"number"!=typeof e.length||K(e.length)?i(0):u(e);if("Buffer"===e.type&&Array.isArray(e.data))return u(e.data)}(e);if(s)return s;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return a(e),i(e<0?0:0|h(e))}function u(e){let t=e.length<0?0:0|h(e.length),r=i(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function c(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,o.prototype),n}function h(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function f(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||z(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(e).length;default:if(i)return n?-1:$(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return k(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),K(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return-1}function b(e,t,r,n){r=Number(r)||0;let i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;let o,s=t.length;for(n>s/2&&(n=s/2),o=0;o<n;++o){let n=parseInt(t.substr(2*o,2),16);if(K(n))return o;e[r+o]=n}return o}function m(e,t,r,n){return V($(t,e.length-r),e,r,n)}function w(e,t,r,n){return V(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function v(e,t,r,n){return V(H(t),e,r,n)}function _(e,t,r,n){return V(function(e,t){let r,n,i,o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function S(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function E(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){let t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}ze.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return function(e,t,r){return a(e),e<=0?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)}(e,t,r)},o.allocUnsafe=function(e){return l(e)},o.allocUnsafeSlow=function(e){return l(e)},o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(z(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),z(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=o.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(z(t,Uint8Array))i+t.length>n.length?(o.isBuffer(t)||(t=o.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!o.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},o.byteLength=f,o.prototype._isBuffer=!0,o.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)d(this,t,t+1);return this},o.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)d(this,t,t+3),d(this,t+1,t+2);return this},o.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},o.prototype.toString=function(){let e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):p.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){let e="",t=ze.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(z(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),l=Math.min(s,a),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e<l;++e)if(u[e]!==c[e]){s=u[e],a=c[e];break}return s<a?-1:a<s?1:0},o.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return m(this,e,t,r);case"ascii":case"latin1":case"binary":return w(this,e,t,r);case"base64":return v(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let A=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function k(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=G[e[n]];return i}function x(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function R(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function C(e,t,r,n,i){D(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function M(e,r,n,i,o){return r=+r,n>>>=0,o||j(e,0,n,4),t.write(e,r,n,i,23,4),n+4}function B(e,r,n,i,o){return r=+r,n>>>=0,o||j(e,0,n,8),t.write(e,r,n,i,52,8),n+8}o.prototype.slice=function(e,t){let r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||P(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=Q(function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),o.prototype.readBigUInt64BE=Q(function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||P(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||P(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||P(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=Q(function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),o.prototype.readBigInt64BE=Q(function(e){F(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),o.prototype.readFloatLE=function(e,r){return e>>>=0,r||P(e,4,this.length),t.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,r){return e>>>=0,r||P(e,4,this.length),t.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,r){return e>>>=0,r||P(e,8,this.length),t.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,r){return e>>>=0,r||P(e,8,this.length),t.read(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){T(this,e,t,r,Math.pow(2,8*r)-1,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigUInt64LE=Q(function(e,t=0){return R(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=Q(function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);T(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeBigInt64LE=Q(function(e,t=0){return R(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=Q(function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeFloatLE=function(e,t,r){return M(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return M(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let s=o.isBuffer(e)?e:o.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=s[i%a]}return this};let N={};function U(e,t,r){N[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function L(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function D(e,t,r,n,i,o){if(e>r||e<t){let r,n="bigint"==typeof t?"n":"";throw r=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`,new N.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,r){F(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&W(t,e.length-(r+1))}(n,i,o)}function F(e,t){if("number"!=typeof e)throw new N.ERR_INVALID_ARG_TYPE(t,"number",e)}function W(e,t,r){throw Math.floor(e)!==e?(F(e,r),new N.ERR_OUT_OF_RANGE("offset","an integer",e)):t<0?new N.ERR_BUFFER_OUT_OF_BOUNDS:new N.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),U("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=L(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=L(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);let q=/[^+/0-9A-Za-z-_]/g;function $(e,t){t=t||1/0;let r,n=e.length,i=null,o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return e.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(t))}function V(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function z(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}let G=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function Q(e){return typeof BigInt>"u"?Y:e}function Y(){throw new Error("BigInt not supported")}return ze}var qe,$e,He,Ve,ze,Ke,Ge=i(()=>{l(),tt(),Fe(),qe={},$e=!1,He={},Ve=!1,ze={},Ke=!1}),Qe={};s(Qe,{Buffer:()=>Je,INSPECT_MAX_BYTES:()=>Xe,default:()=>Ye,kMaxLength:()=>Ze});var Ye,Je,Xe,Ze,et=i(()=>{l(),tt(),Fe(),Ge(),(Ye=We()).Buffer,Ye.SlowBuffer,Ye.INSPECT_MAX_BYTES,Ye.kMaxLength,Je=Ye.Buffer,Xe=Ye.INSPECT_MAX_BYTES,Ze=Ye.kMaxLength}),tt=i(()=>{et()}),rt=o((e,t)=>{l(),tt(),Fe();var r=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}};t.exports={AggregateError:r,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error:Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number:Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise:Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String:String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol:Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean:Boolean,Uint8Array:Uint8Array}}),nt=o((e,t)=>{l(),tt(),Fe(),t.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){let n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}}),it=o((e,t)=>{l(),tt(),Fe();var{format:r,inspect:n}=nt(),{AggregateError:i}=rt(),o=globalThis.AggregateError||i,s=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,c={};function h(e,t){if(!e)throw new c.ERR_INTERNAL_ASSERTION(t)}function f(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function p(e,t,n){n||(n=Error);class i extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return h(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);let i=(t.match(/%[dfijoOs]/g)||[]).length;return h(i===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${i}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[s]=!0,c[e]=i}function d(e){let t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}var g=class extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new c.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};p("ERR_ASSERTION","%s",Error),p("ERR_INVALID_ARG_TYPE",(e,t,r)=>{h("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";let o=[],s=[],l=[];for(let e of t)h("string"==typeof e,"All expected entries have to be of type string"),a.includes(e)?o.push(e.toLowerCase()):u.test(e)?s.push(e):(h("object"!==e,'The value "object" should be written as "Object"'),l.push(e));if(s.length>0){let e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:i+=`of type ${o[0]}`;break;case 2:i+=`one of type ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||l.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let e=s.pop();i+=`an instance of ${s.join(", ")}, or ${e}`}}l.length>0&&(i+=" or ")}switch(l.length){case 0:break;case 1:l[0].toLowerCase()!==l[0]&&(i+="an "),i+=`${l[0]}`;break;case 2:i+=`one of ${l[0]} or ${l[1]}`;break;default:{let e=l.pop();i+=`one of ${l.join(", ")}, or ${e}`}}if(null==r)i+=`. Received ${r}`;else if("function"==typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"==typeof r){var c;if(null!==(c=r.constructor)&&void 0!==c&&c.name)i+=`. Received an instance of ${r.constructor.name}`;else{i+=`. Received ${n(r,{depth:-1})}`}}else{let e=n(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof r} (${e})`}return i},TypeError),p("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let i=n(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`},TypeError),p("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`},TypeError),p("ERR_MISSING_ARGS",(...e)=>{h(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),p("ERR_OUT_OF_RANGE",(e,t,r)=>{let i;if(h(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)i=f(String(r));else if("bigint"==typeof r){i=String(r);let e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(i=f(i)),i+="n"}else i=n(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),p("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),p("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),p("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),p("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),p("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),p("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),p("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),p("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),p("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),p("ERR_STREAM_WRITE_AFTER_END","write after end",Error),p("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:g,aggregateTwoErrors:d(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new o([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:d,codes:c}}),ot=o((e,t)=>{l(),tt(),Fe();var{AbortController:r,AbortSignal:n}=typeof self<"u"?self:typeof window<"u"?window:void 0;t.exports=r,t.exports.AbortSignal=n,t.exports.default=r}),st={};function at(){if(ut)return lt;ut=!0;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}(lt=i).once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}d(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&d(e,"error",t,r)}(e,i,{once:!0})})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var o=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,l;if(s(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),l=o[t]),void 0===l)l=o[t]=r,++e._eventsCount;else if("function"==typeof l?l=o[t]=n?[r,l]:[l,r]:n?l.unshift(r):l.push(r),(i=a(e))>0&&l.length>i&&!l.warned){l.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=l.length,function(e){console&&console.warn&&console.warn(e)}(u)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function f(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function d(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)})}}return Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return o},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");o=e}}),i.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return a(this)},i.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var u=l.length,c=p(l,u);for(n=0;n<u;++n)r(c[n],this,t)}return!0},i.prototype.addListener=function(e,t){return l(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return l(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,c(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,c(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,i,o,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},i.prototype.listenerCount=f,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},lt}s(st,{EventEmitter:()=>ht,default:()=>ct,defaultMaxListeners:()=>ft,init:()=>pt,listenerCount:()=>dt,on:()=>gt,once:()=>yt});var lt,ut,ct,ht,ft,pt,dt,gt,yt,bt=i(()=>{l(),tt(),Fe(),lt={},ut=!1,(ct=at()).once,ct.once=function(e,t){return new Promise((r,n)=>{function i(...t){void 0!==o&&e.removeListener("error",o),r(t)}let o;"error"!==t&&(o=t=>{e.removeListener(name,i),n(t)},e.once("error",o)),e.once(t,i)})},ct.on=function(e,t){let r=[],n=[],i=null,o=!1,s={async next(){let e=r.shift();if(e)return createIterResult(e,!1);if(i){let e=Promise.reject(i);return i=null,e}return o?createIterResult(void 0,!0):new Promise((e,t)=>n.push({resolve:e,reject:t}))},async return(){e.removeListener(t,a),e.removeListener("error",l),o=!0;for(let e of n)e.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(r){i=r,e.removeListener(t,a),e.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",l),s;function a(...e){let t=n.shift();t?t.resolve(createIterResult(e,!1)):r.push(e)}function l(e){o=!0;let t=n.shift();t?t.reject(e):i=e,s.return()}},({EventEmitter:ht,defaultMaxListeners:ft,init:pt,listenerCount:dt,on:gt,once:yt}=ct)}),mt=o((e,t)=>{l(),tt(),Fe();var r=(et(),a(Qe)),{format:n,inspect:i}=nt(),{codes:{ERR_INVALID_ARG_TYPE:o}}=it(),{kResistStopPropagation:s,AggregateError:u,SymbolDispose:c}=rt(),h=globalThis.AbortSignal||ot().AbortSignal,f=globalThis.AbortController||ot().AbortController,p=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||r.Blob,g=typeof d<"u"?function(e){return e instanceof d}:function(e){return!1},y=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new o(t,"AbortSignal",e)};t.exports={AggregateError:u,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...n)=>e?r(e):t(...n))}),debuglog:()=>function(){},format:n,inspect:i,types:{isAsyncFunction:e=>e instanceof p,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:g,deprecate:(e,t)=>e,addAbortListener:(bt(),a(st)).addAbortListener||function(e,t){if(void 0===e)throw new o("signal","AbortSignal",e);let r;return y(e,"signal"),((e,t)=>{if("function"!=typeof e)throw new o(t,"Function",e)})(t,"listener"),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[s]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:h.any||function(e){if(1===e.length)return e[0];let t=new f,r=()=>t.abort();return e.forEach(e=>{y(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),wt=o((e,t)=>{l(),tt(),Fe();var{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:i,ArrayPrototypeMap:o,NumberIsInteger:s,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:u,NumberMIN_SAFE_INTEGER:c,NumberParseInt:h,ObjectPrototypeHasOwnProperty:f,RegExpPrototypeExec:p,String:d,StringPrototypeToUpperCase:g,StringPrototypeTrim:y}=rt(),{hideStackFrames:b,codes:{ERR_SOCKET_BAD_PORT:m,ERR_INVALID_ARG_TYPE:w,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:_,ERR_UNKNOWN_SIGNAL:S}}=it(),{normalizeEncoding:E}=mt(),{isAsyncFunction:A,isArrayBufferView:I}=mt().types,k={};var O=/^[0-7]+$/;var x=b((e,t,r=c,n=u)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)}),P=b((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);if(e<r||e>n)throw new _(t,`>= ${r} && <= ${n}`,e)}),T=b((e,t,r=!1)=>{if("number"!=typeof e)throw new w(t,"number",e);if(!s(e))throw new _(t,"an integer",e);let n=r?1:0,i=4294967295;if(e<n||e>i)throw new _(t,`>= ${n} && <= ${i}`,e)});function R(e,t){if("string"!=typeof e)throw new w(t,"string",e)}var C=b((e,t,r)=>{if(!n(r,e)){let n="must be one of: "+i(o(r,e=>"string"==typeof e?`'${e}'`:d(e)),", ");throw new v(t,e,n)}});function j(e,t){if("boolean"!=typeof e)throw new w(t,"boolean",e)}function M(e,t,r){return null!=e&&f(e,t)?e[t]:r}var B=b((e,t,n=null)=>{let i=M(n,"allowArray",!1),o=M(n,"allowFunction",!1);if(!M(n,"nullable",!1)&&null===e||!i&&r(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new w(t,"Object",e)}),N=b((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new w(t,"a dictionary",e)}),U=b((e,t,n=0)=>{if(!r(e))throw new w(t,"Array",e);if(e.length<n){throw new v(t,e,`must be longer than ${n}`)}});var L=b((e,t="buffer")=>{if(!I(e))throw new w(t,["Buffer","TypedArray","DataView"],e)});var D=b((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new w(t,"AbortSignal",e)}),F=b((e,t)=>{if("function"!=typeof e)throw new w(t,"Function",e)}),W=b((e,t)=>{if("function"!=typeof e||A(e))throw new w(t,"Function",e)}),q=b((e,t)=>{if(void 0!==e)throw new w(t,"undefined",e)});var $=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function H(e,t){if(typeof e>"u"||!p($,e))throw new v(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(typeof e>"u"&&(e=r),"string"==typeof e){if(null===p(O,e))throw new v(t,e,"must be a 32-bit unsigned integer or an octal string");e=h(e,8)}return T(e,t),e},validateArray:U,validateStringArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)R(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++)j(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){U(e,t);for(let r=0;r<e.length;r++){let n=e[r],i=`${t}[${r}]`;if(null==n)throw new w(i,"AbortSignal",n);D(n,i)}},validateBoolean:j,validateBuffer:L,validateDictionary:N,validateEncoding:function(e,t){let r=E(t),n=e.length;if("hex"===r&&n%2!=0)throw new v("encoding",t,`is invalid for data of length ${n}`)},validateFunction:F,validateInt32:P,validateInteger:x,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new w(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&a(e))throw new _(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:B,validateOneOf:C,validatePlainFunction:W,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===y(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new m(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(R(e,t),void 0===k[e])throw void 0!==k[g(e)]?new S(e+" (signals must use all capital letters)"):new S(e)},validateString:R,validateUint32:T,validateUndefined:q,validateUnion:function(e,t,r){if(!n(r,e))throw new w(t,`('${i(r,"|")}')`,e)},validateAbortSignal:D,validateLinkHeaderValue:function(e){if("string"==typeof e)return H(e,"hints"),e;if(r(e)){let t=e.length,r="";if(0===t)return r;for(let n=0;n<t;n++){let i=e[n];H(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new v("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}}),vt=o((e,t)=>{l(),tt(),Fe();var r,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch{r=o}try{n="function"==typeof clearTimeout?clearTimeout:s}catch{n=s}}();var u,c=[],h=!1,f=-1;function p(){!h||!u||(h=!1,u.length?c=u.concat(c):f=-1,c.length&&d())}function d(){if(!h){var e=a(p);h=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,h=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch{try{return n.call(null,e)}catch{return n.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function y(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new g(e,t)),1===c.length&&!h&&a(d)},g.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=y,i.addListener=y,i.once=y,i.off=y,i.removeListener=y,i.removeAllListeners=y,i.emit=y,i.prependListener=y,i.prependOnceListener=y,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}}),_t=o((e,t)=>{l(),tt(),Fe();var{SymbolAsyncIterator:r,SymbolIterator:n,SymbolFor:i}=rt(),o=i("nodejs.stream.destroyed"),s=i("nodejs.stream.errored"),a=i("nodejs.stream.readable"),u=i("nodejs.stream.writable"),c=i("nodejs.stream.disturbed"),h=i("nodejs.webstream.isClosedPromise"),f=i("nodejs.webstream.controllerErrorFunction");function p(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function d(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function y(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function b(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function m(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function w(e){if(!g(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[o]||null!=n&&n.destroyed)}function v(e){if(!d(e))return null;if(!0===e.writableEnded)return!0;let t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)}function _(e,t){if(!p(e))return null;let r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.endEmitted?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[a]?e[a]:"boolean"!=typeof e?.readable?null:!w(e)&&(p(e)&&e.readable&&!_(e))}function E(e){return e&&null!=e[u]?e[u]:"boolean"!=typeof e?.writable?null:!w(e)&&(d(e)&&e.writable&&!v(e))}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function I(e){return"boolean"==typeof e._sent100&&A(e)}t.exports={isDestroyed:w,kIsDestroyed:o,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[c])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:c,isErrored:function(e){var t,r,n,i,o,a,l,u,c,h;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(a=e[s])&&void 0!==a?a:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(c=e._readableState)||void 0===c?void 0:c.errored)&&void 0!==t?t:null!==(h=e._writableState)&&void 0!==h&&h.errored))},kIsErrored:s,isReadable:S,kIsReadable:a,kIsClosedPromise:h,kControllerErrorFunction:f,kIsWritable:u,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;let t=e._writableState,r=e._readableState;return"boolean"==typeof t?.closed||"boolean"==typeof r?.closed?t?.closed||r?.closed:"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!!w(e)||!(!1!==t?.readable&&S(e)||!1!==t?.writable&&E(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[r]:!1===t?"function"==typeof e[n]:"function"==typeof e[r]||"function"==typeof e[n])},isReadableNodeStream:p,isReadableStream:y,isReadableEnded:function(e){if(!p(e))return null;if(!0===e.readableEnded)return!0;let t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)},isReadableFinished:_,isReadableErrored:function(e){var t,r;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return y(e)||b(e)||m(e)},isWritable:E,isWritableNodeStream:d,isWritableStream:b,isWritableEnded:v,isWritableFinished:function(e,t){if(!d(e))return null;if(!0===e.writableFinished)return!0;let r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.finished?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:I,willEmitClose:function(e){if(!g(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&I(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:m}}),St=o((e,t)=>{l(),tt(),Fe();var r,n=vt(),{AbortError:i,codes:o}=it(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:u,once:c}=mt(),{validateAbortSignal:h,validateFunction:f,validateObject:p,validateBoolean:d}=wt(),{Promise:g,PromisePrototypeThen:y,SymbolDispose:b}=rt(),{isClosed:m,isReadable:w,isReadableNodeStream:v,isReadableStream:_,isReadableFinished:S,isReadableErrored:E,isWritable:A,isWritableNodeStream:I,isWritableStream:k,isWritableFinished:O,isWritableErrored:x,isNodeStream:P,willEmitClose:T,kIsClosedPromise:R}=_t();var C=()=>{};function j(e,t,o){var l,d;if(2===arguments.length?(o=t,t=u):null==t?t=u:p(t,"options"),f(o,"callback"),h(t.signal,"options.signal"),o=c(o),_(e)||k(e))return function(e,t,o){let s=!1,a=C;if(t.signal)if(a=()=>{s=!0,o.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{let n=(r=r||mt().addAbortListener)(t.signal,a),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}let l=(...t)=>{s||n.nextTick(()=>o.apply(e,t))};return y(e[R].promise,l,l),C}(e,t,o);if(!P(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);let g=null!==(l=t.readable)&&void 0!==l?l:v(e),j=null!==(d=t.writable)&&void 0!==d?d:I(e),M=e._writableState,B=e._readableState,N=()=>{e.writable||D()},U=T(e)&&v(e)===g&&I(e)===j,L=O(e,!1),D=()=>{L=!0,e.destroyed&&(U=!1),(!U||e.readable&&!g)&&(!g||F)&&o.call(e)},F=S(e,!1),W=()=>{F=!0,e.destroyed&&(U=!1),(!U||e.writable&&!j)&&(!j||L)&&o.call(e)},q=t=>{o.call(e,t)},$=m(e),H=()=>{$=!0;let t=x(e)||E(e);return t&&"boolean"!=typeof t?o.call(e,t):g&&!F&&v(e,!0)&&!S(e,!1)?o.call(e,new a):!j||L||O(e,!1)?void o.call(e):o.call(e,new a)},V=()=>{$=!0;let t=x(e)||E(e);if(t&&"boolean"!=typeof t)return o.call(e,t);o.call(e)},z=()=>{e.req.on("finish",D)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?j&&!M&&(e.on("end",N),e.on("close",N)):(e.on("complete",D),U||e.on("abort",H),e.req?z():e.on("request",z)),!U&&"boolean"==typeof e.aborted&&e.on("aborted",H),e.on("end",W),e.on("finish",D),!1!==t.error&&e.on("error",q),e.on("close",H),$?n.nextTick(H):null!=M&&M.errorEmitted||null!=B&&B.errorEmitted?U||n.nextTick(V):(!g&&(!U||w(e))&&(L||!1===A(e))||!j&&(!U||A(e))&&(F||!1===w(e))||B&&e.req&&e.aborted)&&n.nextTick(V);let K=()=>{o=C,e.removeListener("aborted",H),e.removeListener("complete",D),e.removeListener("abort",H),e.removeListener("request",z),e.req&&e.req.removeListener("finish",D),e.removeListener("end",N),e.removeListener("close",N),e.removeListener("finish",D),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",H)};if(t.signal&&!$){let s=()=>{let r=o;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{let n=(r=r||mt().addAbortListener)(t.signal,s),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}}return K}t.exports=j,t.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=u),null!==(r=t)&&void 0!==r&&r.cleanup&&(d(t.cleanup,"cleanup"),n=t.cleanup),new g((r,i)=>{let o=j(e,t,e=>{n&&o(),e?i(e):r()})})}}),Et=o((e,t)=>{l(),tt(),Fe();var r=vt(),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:i},AbortError:o}=it(),{Symbol:s}=rt(),{kIsDestroyed:a,isDestroyed:u,isFinished:c,isServerRequest:h}=_t(),f=s("kDestroy"),p=s("kConstruct");function d(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g(e,t,n){let i=!1;function o(t){if(i)return;i=!0;let o=e._readableState,s=e._writableState;d(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(y,e,t):r.nextTick(b,e)}try{e._destroy(t||null,o)}catch(e){o(e)}}function y(e,t){m(e,t),b(e)}function b(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function m(e,t){let r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function w(e,t,n){let i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),n?r.nextTick(m,e,t):m(e,t))}function v(e){let t=!1;function n(n){if(t)return void w(e,n??new i);t=!0;let o=e._readableState,s=e._writableState,a=s||o;o&&(o.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(f,n):n?w(e,n,!0):r.nextTick(_,e)}try{e._construct(e=>{r.nextTick(n,e)})}catch(e){r.nextTick(n,e)}}function _(e){e.emit(p)}function S(e){return e?.setHeader&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),r.nextTick(E,e)}t.exports={construct:function(e,t){if("function"!=typeof e._construct)return;let n=e._readableState,i=e._writableState;n&&(n.constructed=!1),i&&(i.constructed=!1),e.once(p,t),!(e.listenerCount(p)>1)&&r.nextTick(v,e)},destroyer:function(e,t){!e||u(e)||(!t&&!c(e)&&(t=new o),h(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(A,e,t):r.nextTick(E,e),e.destroyed||(e[a]=!0))},destroy:function(e,t){let r=this._readableState,i=this._writableState,o=i||r;return null!=i&&i.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(d(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),o.constructed?g(this,e,t):this.once(f,function(r){g(this,n(r,e),t)}),this)},undestroy:function(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:w}}),At=o((e,t)=>{l(),tt(),Fe();var{ArrayIsArray:r,ObjectSetPrototypeOf:n}=rt(),{EventEmitter:i}=(bt(),a(st));function o(e){i.call(this,e)}function s(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}n(o.prototype,i.prototype),n(o,i),o.prototype.pipe=function(e,t){let r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",o),!e._isStdio&&(!t||!1!==t.end)&&(r.on("end",l),r.on("close",u));let a=!1;function l(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){h(),0===i.listenerCount(this,"error")&&this.emit("error",e)}function h(){r.removeListener("data",n),e.removeListener("drain",o),r.removeListener("end",l),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",h),r.removeListener("close",h),e.removeListener("close",h)}return s(r,"error",c),s(e,"error",c),r.on("end",h),r.on("close",h),e.on("close",h),e.emit("pipe",r),e},t.exports={Stream:o,prependListener:s}}),It=o((e,t)=>{l(),tt(),Fe();var r,{SymbolDispose:n}=rt(),{AbortError:i,codes:o}=it(),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:u}=_t(),c=St(),{ERR_INVALID_ARG_TYPE:h}=o;t.exports.addAbortSignal=function(e,r){if(((e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new h(t,"AbortSignal",e)})(e,"signal"),!s(r)&&!a(r))throw new h("stream",["ReadableStream","WritableStream","Stream"],r);return t.exports.addAbortSignalNoValidate(e,r)},t.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;let o=s(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[u](new i(void 0,{cause:e.reason}))};if(e.aborted)o();else{let i=(r=r||mt().addAbortListener)(e,o);c(t,i[n])}return t}}),kt=o((e,t)=>{l(),tt(),Fe();var{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:i,Uint8Array:o}=rt(),{Buffer:s}=(et(),a(Qe)),{inspect:u}=mt();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;let e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);let t=s.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)i(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){let r=this.head.data;if(e<r.length){let t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[n](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,i=0;do{let o=n.data;if(!(e>o.length)){e===o.length?(t+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(o,0,e),this.head=n,n.data=r(o,e));break}t+=o,e-=o.length,++i}while(null!==(n=n.next));return this.length-=i,t}_getBuffer(e){let t=s.allocUnsafe(e),r=e,n=this.head,a=0;do{let s=n.data;if(!(e>s.length)){e===s.length?(i(t,s,r-e),++a,n.next?this.head=n.next:this.head=this.tail=null):(i(t,new o(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}i(t,s,r-e),e-=s.length,++a}while(null!==(n=n.next));return this.length-=a,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return u(this,{...t,depth:0,customInspect:!1})}}}),Ot=o((e,t)=>{l(),tt(),Fe();var{MathFloor:r,NumberIsInteger:n}=rt(),{validateInteger:i}=wt(),{ERR_INVALID_ARG_VALUE:o}=it().codes,s=16384,a=16;function u(e){return e?a:s}t.exports={getHighWaterMark:function(e,t,i,s){let a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,s,i);if(null!=a){if(!n(a)||a<0){throw new o(s?`options.${i}`:"options.highWaterMark",a)}return r(a)}return u(e.objectMode)},getDefaultHighWaterMark:u,setDefaultHighWaterMark:function(e,t){i(t,"value",0),e?a=t:s=t}}}),xt=o((e,t)=>{l(),tt(),Fe();var r=(et(),a(Qe)),n=r.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(i(r,e),e.Buffer=o),o.prototype=Object.create(n.prototype),i(n,o),o.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var i=n(e);return void 0!==t?"string"==typeof r?i.fill(t,r):i.fill(t):i.fill(0),i},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}),Pt=o(e=>{l(),tt(),Fe();var t=xt().Buffer,r=t.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(e){var n;switch(this.encoding=function(e){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof n&&(t.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return n||e}(e),this.encoding){case"utf16le":this.text=s,this.end=a,n=4;break;case"utf8":this.fillLast=o,n=4;break;case"base64":this.text=u,this.end=c,n=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function o(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}e.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},n.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var o=i(t[n]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--n<r||-2===o?0:(o=i(t[n]),o>=0?(o>0&&(e.lastNeed=o-2),o):--n<r||-2===o?0:(o=i(t[n]),o>=0?(o>0&&(2===o?o=0:e.lastNeed=o-3),o):0))}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}}),Tt=o((e,t)=>{l(),tt(),Fe();var r=vt(),{PromisePrototypeThen:n,SymbolAsyncIterator:i,SymbolIterator:o}=rt(),{Buffer:s}=(et(),a(Qe)),{ERR_INVALID_ARG_TYPE:u,ERR_STREAM_NULL_VALUES:c}=it().codes;t.exports=function(e,t,a){let l,h;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...a,read(){this.push(t),this.push(null)}});if(t&&t[i])h=!0,l=t[i]();else{if(!t||!t[o])throw new u("iterable",["Iterable"],t);h=!1,l=t[o]()}let f=new e({objectMode:!0,highWaterMark:1,...a}),p=!1;return f._read=function(){p||(p=!0,async function(){for(;;){try{let{value:e,done:t}=h?await l.next():l.next();if(t)f.push(null);else{let t=e&&"function"==typeof e.then?await e:e;if(null===t)throw p=!1,new c;if(f.push(t))continue;p=!1}}catch(e){f.destroy(e)}break}}())},f._destroy=function(e,t){n(async function(e){let t=null!=e,r="function"==typeof l.throw;if(t&&r){let{value:t,done:r}=await l.throw(e);if(await t,r)return}if("function"==typeof l.return){let{value:e}=await l.return();await e}}(e),()=>r.nextTick(t,e),n=>r.nextTick(t,n||e))},f}}),Rt=o((e,t)=>{l(),tt(),Fe();var r=vt(),{ArrayPrototypeIndexOf:n,NumberIsInteger:i,NumberIsNaN:o,NumberParseInt:s,ObjectDefineProperties:u,ObjectKeys:c,ObjectSetPrototypeOf:h,Promise:f,SafeSet:p,SymbolAsyncDispose:d,SymbolAsyncIterator:g,Symbol:y}=rt();t.exports=G,G.ReadableState=K;var{EventEmitter:b}=(bt(),a(st)),{Stream:m,prependListener:w}=At(),{Buffer:v}=(et(),a(Qe)),{addAbortSignal:_}=It(),S=St(),E=mt().debuglog("stream",e=>{E=e}),A=kt(),I=Et(),{getHighWaterMark:k,getDefaultHighWaterMark:O}=Ot(),{aggregateTwoErrors:x,codes:{ERR_INVALID_ARG_TYPE:P,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:R,ERR_STREAM_PUSH_AFTER_EOF:C,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:j},AbortError:M}=it(),{validateObject:B}=wt(),N=y("kPaused"),{StringDecoder:U}=Pt(),L=Tt();h(G.prototype,m.prototype),h(G,m);var D=()=>{},{errorOrDestroy:F}=I,W=1,q=16,$=32,H=2048,V=4096;function z(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function K(e,t,r){"boolean"!=typeof r&&(r=t instanceof Mt()),this.state=H|V|q|$,e&&e.objectMode&&(this.state|=W),r&&e&&e.readableObjectMode&&(this.state|=W),this.highWaterMark=e?k(this,e,"readableHighWaterMark",r):O(!1),this.buffer=new A,this.length=0,this.pipes=[],this.flowing=null,this[N]=null,e&&!1===e.emitClose&&(this.state&=~H),e&&!1===e.autoDestroy&&(this.state&=~V),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new U(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);let t=this instanceof Mt();this._readableState=new K(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&_(e.signal,this)),m.call(this,e),I.construct(this,()=>{this._readableState.needReadable&&te(this,this._readableState)})}function Q(e,t,r,n){E("readableAddChunk",t);let i,o=e._readableState;if(0===(o.state&W)&&("string"==typeof t?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?t=v.from(t,r).toString(o.encoding):(t=v.from(t,r),r=""))):t instanceof v?r="":m._isUint8Array(t)?(t=m._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new P("chunk",["string","Buffer","Uint8Array"],t))),i)F(e,i);else if(null===t)o.state&=-9,function(e,t){if(E("onEofChunk"),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Z(e):(t.needReadable=!1,t.emittedReadable=!0,ee(e))}}(e,o);else if(0!==(o.state&W)||t&&t.length>0)if(n)if(4&o.state)F(e,new j);else{if(o.destroyed||o.errored)return!1;Y(e,o,t,!0)}else if(o.ended)F(e,new C);else{if(o.destroyed||o.errored)return!1;o.state&=-9,o.decoder&&!r?(t=o.decoder.write(t),o.objectMode||0!==t.length?Y(e,o,t,!1):te(e,o)):Y(e,o,t,!1)}else n||(o.state&=-9,te(e,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function Y(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),!!(64&t.state)&&Z(e)),te(e,t)}u(K.prototype,{objectMode:z(W),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(q),sync:z($),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(H),autoDestroy:z(V),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(65536),readingMore:z(1<<17),dataEmitted:z(1<<18)}),G.prototype.destroy=I.destroy,G.prototype._undestroy=I.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[b.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[d]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new M,this.destroy(e)),new f((t,r)=>S(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return Q(this,e,t,!1)},G.prototype.unshift=function(e,t){return Q(this,e,t,!0)},G.prototype.isPaused=function(){let e=this._readableState;return!0===e[N]||!1===e.flowing},G.prototype.setEncoding=function(e){let t=new U(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this};var J;function X(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&W)?1:o(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Z(e){let t=e._readableState;E("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(E("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(ee,e))}function ee(e){let t=e._readableState;E("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,se(e)}function te(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(re,e,t))}function re(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){let r=t.length;if(E("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function ne(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[N]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ie(e){E("readable nexttick read 0"),e.read(0)}function oe(e,t){E("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),se(e),t.flowing&&!t.reading&&e.read(0)}function se(e){let t=e._readableState;for(E("flow",t.flowing);t.flowing&&null!==e.read(););}function ae(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));let r=async function*(e,t){let r=D;function n(t){this===e?(r(),r=D):r=t}e.on("readable",n);let i,o=S(e,{writable:!1},e=>{i=e?x(i,e):null,r(),r=D});try{for(;;){let t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(i)throw i;if(null===i)return;await new f(n)}}}catch(e){throw i=x(i,e),i}finally{!i&&!1===t?.destroyOnReturn||void 0!==i&&!e._readableState.autoDestroy?(e.off("readable",n),o()):I.destroyer(e,null)}}(e,t);return r.stream=e,r}function le(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ue(e){let t=e._readableState;E("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(ce,t,e))}function ce(e,t){if(E("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(he,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function he(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}function fe(){return void 0===J&&(J={}),J}G.prototype.read=function(e){E("read",e),void 0===e?e=NaN:i(e)||(e=s(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new R("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return E("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ue(this):Z(this),null;if(0===(e=X(e,t))&&t.ended)return 0===t.length&&ue(this),null;let n,o=!!(64&t.state);if(E("need readable",o),(0===t.length||t.length-e<t.highWaterMark)&&(o=!0,E("length less than watermark",o)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)o=!1,E("reading, ended or constructing",o);else if(o){E("do read"),t.state|=8|$,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){F(this,e)}t.state&=~$,t.reading||(e=X(r,t))}return n=e>0?le(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ue(this)),null!==n&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new T("_read()")},G.prototype.pipe=function(e,t){let n=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new p(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),E("pipe count=%d opts=%j",i.pipes.length,t);let o=t&&!1===t.end||e===r.stdout||e===r.stderr?y:a;function s(t,r){E("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,E("cleanup"),e.removeListener("close",d),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",y),n.removeListener("data",h),u=!0,l&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l())}function a(){E("onend"),e.end()}i.endEmitted?r.nextTick(o):n.once("end",o),e.on("unpipe",s);let l,u=!1;function c(){u||(1===i.pipes.length&&i.pipes[0]===e?(E("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(E("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),n.pause()),l||(l=function(e,t){return function(){let r=e._readableState;r.awaitDrainWriters===t?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),(!r.awaitDrainWriters||0===r.awaitDrainWriters.size)&&e.listenerCount("data")&&e.resume()}}(n,e),e.on("drain",l))}function h(t){E("ondata");let r=e.write(t);E("dest.write",r),!1===r&&c()}function f(t){if(E("onerror",t),y(),e.removeListener("error",f),0===e.listenerCount("error")){let r=e._writableState||e._readableState;r&&!r.errorEmitted?F(e,t):e.emit("error",t)}}function d(){e.removeListener("finish",g),y()}function g(){E("onfinish"),e.removeListener("close",d),y()}function y(){E("unpipe"),n.unpipe(e)}return n.on("data",h),w(e,"error",f),e.once("close",d),e.once("finish",g),e.emit("pipe",n),!0===e.writableNeedDrain?c():i.flowing||(E("pipe resume"),n.resume()),e},G.prototype.unpipe=function(e){let t=this._readableState;if(0===t.pipes.length)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}let r=n(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},G.prototype.on=function(e,t){let n=m.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,E("on readable",i.length,i.reading),i.length?Z(this):i.reading||r.nextTick(ie,this)),n},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){let n=m.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(ne,this),n},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){let t=m.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&r.nextTick(ne,this),t},G.prototype.resume=function(){let e=this._readableState;return e.flowing||(E("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(oe,e,t))}(this,e)),e[N]=!1,this},G.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[N]=!0,this},G.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{F(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=c(e);for(let t=1;t<r.length;t++){let n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},G.prototype[g]=function(){return ae(this)},G.prototype.iterator=function(e){return void 0!==e&&B(e,"options"),ae(this,e)},u(G.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),u(K.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[N]},set(e){this[N]=!!e}}}),G._fromList=le,G.from=function(e,t){return L(G,e,t)},G.fromWeb=function(e,t){return fe().newStreamReadableFromReadableStream(e,t)},G.toWeb=function(e,t){return fe().newReadableStreamFromStreamReadable(e,t)},G.wrap=function(e,t){var r,n;return new G({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){I.destroyer(e,t),r(t)}}).wrap(e)}}),Ct=o((e,t)=>{l(),tt(),Fe();var r=vt(),{ArrayPrototypeSlice:n,Error:i,FunctionPrototypeSymbolHasInstance:o,ObjectDefineProperty:s,ObjectDefineProperties:u,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:h,Symbol:f,SymbolHasInstance:p}=rt();t.exports=B,B.WritableState=j;var{EventEmitter:d}=(bt(),a(st)),g=At().Stream,{Buffer:y}=(et(),a(Qe)),b=Et(),{addAbortSignal:m}=It(),{getHighWaterMark:w,getDefaultHighWaterMark:v}=Ot(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:E,ERR_STREAM_CANNOT_PIPE:A,ERR_STREAM_DESTROYED:I,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:O,ERR_STREAM_WRITE_AFTER_END:x,ERR_UNKNOWN_ENCODING:P}=it().codes,{errorOrDestroy:T}=b;function R(){}c(B.prototype,g.prototype),c(B,g);var C=f("kOnFinished");function j(e,t,r){"boolean"!=typeof r&&(r=t instanceof Mt()),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?w(this,e,"writableHighWaterMark",r):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!(!e||!1!==e.decodeStrings);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=D.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,M(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[C]=[]}function M(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function B(e){let t=this instanceof Mt();if(!t&&!o(B,this))return new B(e);this._writableState=new j(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&m(e.signal,this)),g.call(this,e),b.construct(this,()=>{let e=this._writableState;e.writing||$(this,e),z(this,e)})}function N(e,t,n,i){let o,s=e._writableState;if("function"==typeof n)i=n,n=s.defaultEncoding;else{if(n){if("buffer"!==n&&!y.isEncoding(n))throw new P(n)}else n=s.defaultEncoding;"function"!=typeof i&&(i=R)}if(null===t)throw new O;if(!s.objectMode)if("string"==typeof t)!1!==s.decodeStrings&&(t=y.from(t,n),n="buffer");else if(t instanceof y)n="buffer";else{if(!g._isUint8Array(t))throw new _("chunk",["string","Buffer","Uint8Array"],t);t=g._uint8ArrayToBuffer(t),n="buffer"}return s.ending?o=new x:s.destroyed&&(o=new I("write")),o?(r.nextTick(i,o),T(e,o,!0),o):(s.pendingcb++,function(e,t,r,n,i){let o=t.objectMode?1:r.length;t.length+=o;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==R&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,s,t,n,i))}function U(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new I("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function L(e,t,r,n){--t.pendingcb,n(r),q(t),T(e,r)}function D(e,t){let n=e._writableState,i=n.sync,o=n.writecb;"function"==typeof o?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?r.nextTick(L,e,n,t,o):L(e,n,t,o)):(n.buffered.length>n.bufferedIndex&&$(e,n),i?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===o?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:o,stream:e,state:n},r.nextTick(F,n.afterWriteTickInfo)):W(e,n,1,o))):T(e,new E)}function F({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,W(e,t,r,n)}function W(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&q(t),z(e,t)}function q(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new I("write"))}let r=e[C].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new I("end"))}M(e)}function $(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:i,objectMode:o}=t,s=r.length-i;if(!s)return;let a=i;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let i=t.allNoop?R:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:n(r,a);o.allBuffers=t.allBuffers,U(e,t,!0,t.length,o,"",i),M(t)}else{do{let{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,U(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?M(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function H(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function V(e,t){!t.prefinished&&!t.finalCalled&&("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let n=!1;function i(i){if(n)T(e,i??E());else if(n=!0,t.pendingcb--,i){let r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e](i);T(e,i,t.sync)}else H(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(K,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}function z(e,t,n){H(t)&&(V(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick((e,t)=>{H(t)?K(e,t):t.pendingcb--},e,t)):H(t)&&(t.pendingcb++,K(e,t))))}function K(e,t){t.pendingcb--,t.finished=!0;let r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){let t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}j.prototype.getBuffer=function(){return n(this.buffered,this.bufferedIndex)},s(j.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(B,p,{__proto__:null,value:function(e){return!!o(this,e)||this===B&&(e&&e._writableState instanceof j)}}),B.prototype.pipe=function(){T(this,new A)},B.prototype.write=function(e,t,r){return!0===N(this,e,t,r)},B.prototype.cork=function(){this._writableState.corked++},B.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||$(this,e))},B.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=h(e)),!y.isEncoding(e))throw new P(e);return this._writableState.defaultEncoding=e,this},B.prototype._write=function(e,t,r){if(!this._writev)throw new S("_write()");this._writev([{chunk:e,encoding:t}],r)},B.prototype._writev=null,B.prototype.end=function(e,t,n){let o,s=this._writableState;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){let r=N(this,e,t);r instanceof i&&(o=r)}return s.corked&&(s.corked=1,this.uncork()),o||(s.errored||s.ending?s.finished?o=new k("end"):s.destroyed&&(o=new I("end")):(s.ending=!0,z(this,s,!0),s.ended=!0)),"function"==typeof n&&(o||s.finished?r.nextTick(n,o):s[C].push(n)),this},u(B.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return!!e&&(!e.destroyed&&!e.ending&&e.needDrain)}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});var G,Q=b.destroy;function Y(){return void 0===G&&(G={}),G}B.prototype.destroy=function(e,t){let n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[C].length)&&r.nextTick(q,n),Q.call(this,e,t),this},B.prototype._undestroy=b.undestroy,B.prototype._destroy=function(e,t){t(e)},B.prototype[d.captureRejectionSymbol]=function(e){this.destroy(e)},B.fromWeb=function(e,t){return Y().newStreamWritableFromWritableStream(e,t)},B.toWeb=function(e){return Y().newWritableStreamFromStreamWritable(e)}}),jt=o((e,t)=>{l(),tt(),Fe();var r=vt(),n=(et(),a(Qe)),{isReadable:i,isWritable:o,isIterable:s,isNodeStream:u,isReadableNodeStream:c,isWritableNodeStream:h,isDuplexNodeStream:f,isReadableStream:p,isWritableStream:d}=_t(),g=St(),{AbortError:y,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:m}}=it(),{destroyer:w}=Et(),v=Mt(),_=Rt(),S=Ct(),{createDeferredPromise:E}=mt(),A=Tt(),I=globalThis.Blob||n.Blob,k=typeof I<"u"?function(e){return e instanceof I}:function(e){return!1},O=globalThis.AbortController||ot().AbortController,{FunctionPrototypeCall:x}=rt(),P=class extends v{constructor(e){super(e),!1===e?.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e?.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};function T(e){let t,r,n,s,a,l=e.readable&&"function"!=typeof e.readable.read?_.wrap(e.readable):e.readable,u=e.writable,c=!!i(l),h=!!o(u);function f(e){let t=s;s=null,t?t(e):e&&a.destroy(e)}return a=new P({readableObjectMode:!(null==l||!l.readableObjectMode),writableObjectMode:!(null==u||!u.writableObjectMode),readable:c,writable:h}),h&&(g(u,e=>{h=!1,e&&w(l,e),f(e)}),a._write=function(e,r,n){u.write(e,r)?n():t=n},a._final=function(e){u.end(),r=e},u.on("drain",function(){if(t){let e=t;t=null,e()}}),u.on("finish",function(){if(r){let e=r;r=null,e()}})),c&&(g(l,e=>{c=!1,e&&w(l,e),f(e)}),l.on("readable",function(){if(n){let e=n;n=null,e()}}),l.on("end",function(){a.push(null)}),a._read=function(){for(;;){let e=l.read();if(null===e)return void(n=a._read);if(!a.push(e))return}}),a._destroy=function(e,i){!e&&null!==s&&(e=new y),n=null,t=null,r=null,null===s?i(e):(s=i,w(u,e),w(l,e))},a}t.exports=function e(t,n){if(f(t))return t;if(c(t))return T({readable:t});if(h(t))return T({writable:t});if(u(t))return T({writable:!1,readable:!1});if(p(t))return T({readable:_.fromWeb(t)});if(d(t))return T({writable:S.fromWeb(t)});if("function"==typeof t){let{value:e,write:i,final:o,destroy:a}=function(e){let{promise:t,resolve:n}=E(),i=new O,o=i.signal;return{value:e(async function*(){for(;;){let e=t;t=null;let{chunk:i,done:s,cb:a}=await e;if(r.nextTick(a),s)return;if(o.aborted)throw new y(void 0,{cause:o.reason});({promise:t,resolve:n}=E()),yield i}}(),{signal:o}),write(e,t,r){let i=n;n=null,i({chunk:e,done:!1,cb:r})},final(e){let t=n;n=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(s(e))return A(P,e,{objectMode:!0,write:i,final:o,destroy:a});let l=e?.then;if("function"==typeof l){let t,n=x(l,e,e=>{if(null!=e)throw new m("nully","body",e)},e=>{w(t,e)});return t=new P({objectMode:!0,readable:!1,write:i,final(e){o(async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}})},destroy:a})}throw new m("Iterable, AsyncIterable or AsyncFunction",n,e)}if(k(t))return e(t.arrayBuffer());if(s(t))return A(P,t,{objectMode:!0,writable:!1});if(p(t?.readable)&&d(t?.writable))return P.fromWeb(t);if("object"==typeof t?.writable||"object"==typeof t?.readable){return T({readable:null!=t&&t.readable?c(t?.readable)?t?.readable:e(t.readable):void 0,writable:null!=t&&t.writable?h(t?.writable)?t?.writable:e(t.writable):void 0})}let i=t?.then;if("function"==typeof i){let e;return x(i,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{w(e,t)}),e=new P({objectMode:!0,writable:!1,read(){}})}throw new b(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}}),Mt=o((e,t)=>{l(),tt(),Fe();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:i,ObjectSetPrototypeOf:o}=rt();t.exports=h;var s,a,u=Rt(),c=Ct();o(h.prototype,u.prototype),o(h,u);{let e=i(c.prototype);for(let t=0;t<e.length;t++){let r=e[t];h.prototype[r]||(h.prototype[r]=c.prototype[r])}}function h(e){if(!(this instanceof h))return new h(e);u.call(this,e),c.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}function f(){return void 0===s&&(s={}),s}r(h.prototype,{writable:{__proto__:null,...n(c.prototype,"writable")},writableHighWaterMark:{__proto__:null,...n(c.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...n(c.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...n(c.prototype,"writableBuffer")},writableLength:{__proto__:null,...n(c.prototype,"writableLength")},writableFinished:{__proto__:null,...n(c.prototype,"writableFinished")},writableCorked:{__proto__:null,...n(c.prototype,"writableCorked")},writableEnded:{__proto__:null,...n(c.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...n(c.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),h.fromWeb=function(e,t){return f().newStreamDuplexFromReadableWritablePair(e,t)},h.toWeb=function(e){return f().newReadableWritablePairFromDuplex(e)},h.from=function(e){return a||(a=jt()),a(e,"body")}}),Bt=o((e,t)=>{l(),tt(),Fe();var{ObjectSetPrototypeOf:r,Symbol:n}=rt();t.exports=u;var{ERR_METHOD_NOT_IMPLEMENTED:i}=it().codes,o=Mt(),{getHighWaterMark:s}=Ot();r(u.prototype,o.prototype),r(u,o);var a=n("kCallback");function u(e){if(!(this instanceof u))return new u(e);let t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[a]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function c(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())})}function h(){this._final!==c&&c.call(this)}u.prototype._final=c,u.prototype._transform=function(e,t,r){throw new i("_transform()")},u.prototype._write=function(e,t,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[a]=r)})},u.prototype._read=function(){if(this[a]){let e=this[a];this[a]=null,e()}}}),Nt=o((e,t)=>{l(),tt(),Fe();var{ObjectSetPrototypeOf:r}=rt();t.exports=i;var n=Bt();function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(i.prototype,n.prototype),r(i,n),i.prototype._transform=function(e,t,r){r(null,e)}}),Ut=o((e,t)=>{l(),tt(),Fe();var r,n,i,o=vt(),{ArrayIsArray:s,Promise:a,SymbolAsyncIterator:u,SymbolDispose:c}=rt(),h=St(),{once:f}=mt(),p=Et(),d=Mt(),{aggregateTwoErrors:g,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:b,ERR_MISSING_ARGS:m,ERR_STREAM_DESTROYED:w,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:_}=it(),{validateFunction:S,validateAbortSignal:E}=wt(),{isIterable:A,isReadable:I,isReadableNodeStream:k,isNodeStream:O,isTransformStream:x,isWebStream:P,isReadableStream:T,isReadableFinished:R}=_t(),C=globalThis.AbortController||ot().AbortController;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,p.destroyer(e,t||new w("pipe")))},cleanup:h(e,{readable:t,writable:r},e=>{n=!e})}}function M(e){if(A(e))return e;if(k(e))return async function*(e){n||(n=Rt()),yield*n.prototype[u].call(e)}(e);throw new y("val",["Readable","Iterable","AsyncIterable"],e)}async function B(e,t,r,{end:n}){let i,o=null,s=e=>{if(e&&(i=e),o){let e=o;o=null,e()}},l=()=>new a((e,t)=>{i?t(i):o=()=>{i?t(i):e()}});t.on("drain",s);let u=h(t,{readable:!1},s);try{t.writableNeedDrain&&await l();for await(let r of e)t.write(r)||await l();n&&(t.end(),await l()),r()}catch(e){r(i!==e?g(i,e):e)}finally{u(),t.off("drain",s)}}async function N(e,t,r,{end:n}){x(t)&&(t=t.writable);let i=t.getWriter();try{for await(let t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function U(e,t,n){if(1===e.length&&s(e[0])&&(e=e[0]),e.length<2)throw new m("streams");let a,l=new C,u=l.signal,h=n?.signal,f=[];function p(){D(new _)}E(h,"options.signal"),i=i||mt().addAbortListener,h&&(a=i(h,p));let g,w,v,S=[],R=0;function U(e){D(e,0===--R)}function D(e,r){var n;if(e&&(!g||"ERR_STREAM_PREMATURE_CLOSE"===g.code)&&(g=e),g||r){for(;S.length;)S.shift()(g);null===(n=a)||void 0===n||n[c](),l.abort(),r&&(g||f.forEach(e=>e()),o.nextTick(t,g,w))}}for(let t=0;t<e.length;t++){let i=e[t],s=t<e.length-1,a=t>0,l=s||!1!==n?.end,c=t===e.length-1;if(O(i)){let e=function(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&U(e)};if(l){let{destroy:e,cleanup:t}=j(i,s,a);S.push(e),I(i)&&c&&f.push(t)}i.on("error",e),I(i)&&c&&f.push(()=>{i.removeListener("error",e)})}if(0===t)if("function"==typeof i){if(v=i({signal:u}),!A(v))throw new b("Iterable, AsyncIterable or Stream","source",v)}else v=A(i)||k(i)||x(i)?i:d.from(i);else if("function"==typeof i){var F;if(x(v))v=M(null===(F=v)||void 0===F?void 0:F.readable);else v=M(v);if(v=i(v,{signal:u}),s){if(!A(v,!0))throw new b("AsyncIterable",`transform[${t-1}]`,v)}else{var W;r||(r=Nt());let e=new r({objectMode:!0}),t=null===(W=v)||void 0===W?void 0:W.then;if("function"==typeof t)R++,t.call(v,t=>{w=t,null!=t&&e.write(t),l&&e.end(),o.nextTick(U)},t=>{e.destroy(t),o.nextTick(U,t)});else if(A(v,!0))R++,B(v,e,U,{end:l});else{if(!T(v)&&!x(v))throw new b("AsyncIterable or Promise","destination",v);{let t=v.readable||v;R++,B(t,e,U,{end:l})}}v=e;let{destroy:n,cleanup:i}=j(v,!1,!0);S.push(n),c&&f.push(i)}}else if(O(i)){if(k(v)){R+=2;let e=L(v,i,U,{end:l});I(i)&&c&&f.push(e)}else if(x(v)||T(v)){let e=v.readable||v;R++,B(e,i,U,{end:l})}else{if(!A(v))throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);R++,B(v,i,U,{end:l})}v=i}else if(P(i)){if(k(v))R++,N(M(v),i,U,{end:l});else if(T(v)||A(v))R++,N(v,i,U,{end:l});else{if(!x(v))throw new y("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);R++,N(v.readable,i,U,{end:l})}v=i}else v=d.from(i)}return(null!=u&&u.aborted||null!=h&&h.aborted)&&o.nextTick(p),v}function L(e,t,r,{end:n}){let i=!1;if(t.on("close",()=>{i||r(new v)}),e.pipe(t,{end:!1}),n){let r=function(){i=!0,t.end()};R(e)?o.nextTick(r):e.once("end",r)}else r();return h(e,{readable:!0,writable:!1},t=>{let n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)}),h(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:U,pipeline:function(...e){return U(e,f(function(e){return S(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}}),Lt=o((e,t)=>{l(),tt(),Fe();var{pipeline:r}=Ut(),n=Mt(),{destroyer:i}=Et(),{isNodeStream:o,isReadable:s,isWritable:a,isWebStream:u,isTransformStream:c,isWritableStream:h,isReadableStream:f}=_t(),{AbortError:p,codes:{ERR_INVALID_ARG_VALUE:d,ERR_MISSING_ARGS:g}}=it(),y=St();t.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return n.from(e[0]);let t,l,b,m,w,v=[...e];if("function"==typeof e[0]&&(e[0]=n.from(e[0])),"function"==typeof e[e.length-1]){let t=e.length-1;e[t]=n.from(e[t])}for(let t=0;t<e.length;++t)if(o(e[t])||u(e[t])){if(t<e.length-1&&!(s(e[t])||f(e[t])||c(e[t])))throw new d(`streams[${t}]`,v[t],"must be readable");if(t>0&&!(a(e[t])||h(e[t])||c(e[t])))throw new d(`streams[${t}]`,v[t],"must be writable")}let _=e[0],S=r(e,function(e){let t=m;m=null,t?t(e):e?w.destroy(e):!A&&!E&&w.destroy()}),E=!!(a(_)||h(_)||c(_)),A=!!(s(S)||f(S)||c(S));if(w=new n({writableObjectMode:!(null==_||!_.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(o(_))w._write=function(e,r,n){_.write(e,r)?n():t=n},w._final=function(e){_.end(),l=e},_.on("drain",function(){if(t){let e=t;t=null,e()}});else if(u(_)){let e=(c(_)?_.writable:_).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),l=t}catch(e){t(e)}}}let e=c(S)?S.readable:S;y(e,()=>{if(l){let e=l;l=null,e()}})}if(A)if(o(S))S.on("readable",function(){if(b){let e=b;b=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){let e=S.read();if(null===e)return void(b=w._read);if(!w.push(e))return}};else if(u(S)){let e=(c(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{let{value:t,done:r}=await e.read();if(!w.push(t))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,r){!e&&null!==m&&(e=new p),b=null,t=null,l=null,null===m?r(e):(m=r,o(S)&&i(S,e))},w}}),Dt=o((e,t)=>{l(),tt(),Fe();var r=globalThis.AbortController||ot().AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:i,ERR_MISSING_ARGS:o,ERR_OUT_OF_RANGE:s},AbortError:a}=it(),{validateAbortSignal:u,validateInteger:c,validateObject:h}=wt(),f=rt().Symbol("kWeak"),p=rt().Symbol("kResistStopPropagation"),{finished:d}=St(),g=Lt(),{addAbortSignalNoValidate:y}=It(),{isWritable:b,isNodeStream:m}=_t(),{deprecate:w}=mt(),{ArrayPrototypePush:v,Boolean:_,MathFloor:S,Number:E,NumberIsNaN:A,Promise:I,PromiseReject:k,PromiseResolve:O,PromisePrototypeThen:x,Symbol:P}=rt(),T=P("kEmpty"),R=P("kEof");function C(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);null!=t&&h(t,"options"),null!=t?.signal&&u(t.signal,"options.signal");let r=1;null!=t?.concurrency&&(r=S(t.concurrency));let n=r-1;return null!=t?.highWaterMark&&(n=S(t.highWaterMark)),c(r,"options.concurrency",1),c(n,"options.highWaterMark",0),n+=r,async function*(){let i,o,s=mt().AbortSignalAny([t?.signal].filter(_)),l=this,u=[],c={signal:s},h=!1,f=0;function p(){h=!0,d()}function d(){f-=1,g()}function g(){o&&!h&&f<r&&u.length<n&&(o(),o=null)}!async function(){try{for await(let t of l){if(h)return;if(s.aborted)throw new a;try{if(t=e(t,c),t===T)continue;t=O(t)}catch(e){t=k(e)}f+=1,x(t,d,p),u.push(t),i&&(i(),i=null),!h&&(u.length>=n||f>=r)&&await new I(e=>{o=e})}u.push(R)}catch(e){let t=k(e);x(t,d,p),u.push(t)}finally{h=!0,i&&(i(),i=null)}}();try{for(;;){for(;u.length>0;){let e=await u[0];if(e===R)return;if(s.aborted)throw new a;e!==T&&(yield e),u.shift(),g()}await new I(e=>{i=e})}}finally{h=!0,o&&(o(),o=null)}}.call(this)}async function j(e,t=void 0){for await(let r of M.call(this,e,t))return!0;return!1}function M(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return C.call(this,async function(t,r){return await e(t,r)?t:T},t)}var B=class extends o{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};function N(e){if(e=E(e),A(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}t.exports.streamReturningOperators={asIndexedPairs:w(function(e=void 0){return null!=e&&h(e,"options"),null!=e?.signal&&u(e.signal,"options.signal"),async function*(){let t=0;for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a({cause:e.signal.reason});yield[t++,n]}}.call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&h(t,"options"),null!=t?.signal&&u(t.signal,"options.signal"),e=N(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;e--<=0&&(yield r)}}.call(this)},filter:M,flatMap:function(e,t){let r=C.call(this,e,t);return async function*(){for await(let e of r)yield*e}.call(this)},map:C,take:function(e,t=void 0){return null!=t&&h(t,"options"),null!=t?.signal&&u(t.signal,"options.signal"),e=N(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&h(t,"options"),null!=t?.signal&&u(t.signal,"options.signal"),m(e)&&!b(e))throw new n("stream",e,"must be writable");let r=g(this,e);return null!=t&&t.signal&&y(t.signal,r),r}},t.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);return!await j.call(this,async(...t)=>!await e(...t),t)},forEach:async function(e,t){if("function"!=typeof e)throw new i("fn",["Function","AsyncFunction"],e);for await(let r of C.call(this,async function(t,r){return await e(t,r),T},t));},reduce:async function(e,t,n){var o;if("function"!=typeof e)throw new i("reducer",["Function","AsyncFunction"],e);null!=n&&h(n,"options"),null!=n?.signal&&u(n.signal,"options.signal");let s=arguments.length>1;if(null!=n&&null!==(o=n.signal)&&void 0!==o&&o.aborted){let e=new a(void 0,{cause:n.signal.reason});throw this.once("error",()=>{}),await d(this.destroy(e)),e}let l=new r,c=l.signal;if(null!=n&&n.signal){let e={once:!0,[f]:this,[p]:!0};n.signal.addEventListener("abort",()=>l.abort(),e)}let g=!1;try{for await(let r of this){var y;if(g=!0,null!=n&&null!==(y=n.signal)&&void 0!==y&&y.aborted)throw new a;s?t=await e(t,r,{signal:c}):(t=r,s=!0)}if(!g&&!s)throw new B}finally{l.abort()}return t},toArray:async function(e){null!=e&&h(e,"options"),null!=e?.signal&&u(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a(void 0,{cause:e.signal.reason});v(t,n)}return t},some:j,find:async function(e,t){for await(let r of M.call(this,e,t))return r}}}),Ft=o((e,t)=>{l(),tt(),Fe();var{ArrayPrototypePop:r,Promise:n}=rt(),{isIterable:i,isNodeStream:o,isWebStream:s}=_t(),{pipelineImpl:a}=Ut(),{finished:u}=St();Wt(),t.exports={finished:u,pipeline:function(...e){return new n((t,n)=>{let l,u,c=e[e.length-1];if(c&&"object"==typeof c&&!o(c)&&!i(c)&&!s(c)){let t=r(e);l=t.signal,u=t.end}a(e,(e,r)=>{e?n(e):t(r)},{signal:l,end:u})})}}}),Wt=o((e,t)=>{l(),tt(),Fe();var{Buffer:r}=(et(),a(Qe)),{ObjectDefineProperty:n,ObjectKeys:i,ReflectApply:o}=rt(),{promisify:{custom:s}}=mt(),{streamReturningOperators:u,promiseReturningOperators:c}=Dt(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:h}}=it(),f=Lt(),{setDefaultHighWaterMark:p,getDefaultHighWaterMark:d}=Ot(),{pipeline:g}=Ut(),{destroyer:y}=Et(),b=St(),m=Ft(),w=_t(),v=t.exports=At().Stream;v.isDestroyed=w.isDestroyed,v.isDisturbed=w.isDisturbed,v.isErrored=w.isErrored,v.isReadable=w.isReadable,v.isWritable=w.isWritable,v.Readable=Rt();for(let e of i(u)){let t=function(...e){if(new.target)throw h();return v.Readable.from(o(r,this,e))},r=u[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}for(let e of i(c)){let t=function(...e){if(new.target)throw h();return o(r,this,e)},r=c[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}v.Writable=Ct(),v.Duplex=Mt(),v.Transform=Bt(),v.PassThrough=Nt(),v.pipeline=g;var{addAbortSignal:_}=It();v.addAbortSignal=_,v.finished=b,v.destroy=y,v.compose=f,v.setDefaultHighWaterMark=p,v.getDefaultHighWaterMark=d,n(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>m}),n(g,s,{__proto__:null,enumerable:!0,get:()=>m.pipeline}),n(b,s,{__proto__:null,enumerable:!0,get:()=>m.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}}),qt=o((e,t)=>{l(),tt(),Fe();var r=Wt(),n=Ft(),i=r.Readable.destroy;t.exports=r.Readable,t.exports._uint8ArrayToBuffer=r._uint8ArrayToBuffer,t.exports._isUint8Array=r._isUint8Array,t.exports.isDisturbed=r.isDisturbed,t.exports.isErrored=r.isErrored,t.exports.isReadable=r.isReadable,t.exports.Readable=r.Readable,t.exports.Writable=r.Writable,t.exports.Duplex=r.Duplex,t.exports.Transform=r.Transform,t.exports.PassThrough=r.PassThrough,t.exports.addAbortSignal=r.addAbortSignal,t.exports.finished=r.finished,t.exports.destroy=r.destroy,t.exports.destroy=i,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>n}),t.exports.Stream=r.Stream,t.exports.default=t.exports}),$t=o((e,t)=>{l(),tt(),Fe(),"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}),Ht=o((e,t)=>{l(),tt(),Fe();var{Buffer:r}=(et(),a(Qe)),n=Symbol.for("BufferList");function i(e){if(!(this instanceof i))return new i(e);i._init.call(this,e)}i._init=function(e){Object.defineProperty(this,n,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},i.prototype._new=function(e){return new i(e)},i.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){let n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},i.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},i.prototype.getBuffers=function(){return this._bufs},i.prototype.get=function(e){if(e>this.length||e<0)return;let t=this._offset(e);return this._bufs[t[0]][t[1]]},i.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},i.prototype.copy=function(e,t,n,i){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof i||i>this.length)&&(i=this.length),n>=this.length||i<=0)return e||r.alloc(0);let o=!!e,s=this._offset(n),a=i-n,l=a,u=o&&t||0,c=s[1];if(0===n&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,u),u+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-c)return o?this._bufs[s[0]].copy(e,t,c,c+l):this._bufs[s[0]].slice(c,c+l);o||(e=r.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){let r=this._bufs[t].length-c;if(!(l>r)){this._bufs[t].copy(e,u,c,c+l),u+=r;break}this._bufs[t].copy(e,u,c),u+=r,l-=r,c&&(c=0)}return e.length>u?e.slice(0,u):e},i.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();let r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},i.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},i.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},i.prototype.duplicate=function(){let e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},i.prototype.append=function(e){return this._attach(e,i.prototype._appendBuffer)},i.prototype.prepend=function(e){return this._attach(e,i.prototype._prependBuffer,!0)},i.prototype._attach=function(e,t,n){if(null==e)return this;if(e.buffer)t.call(this,r.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){let[r,i]=n?[e.length-1,-1]:[0,1];for(let o=r;o>=0&&o<e.length;o+=i)this._attach(e[o],t,n)}else if(this._isBufferList(e)){let[r,i]=n?[e._bufs.length-1,-1]:[0,1];for(let o=r;o>=0&&o<e._bufs.length;o+=i)this._attach(e._bufs[o],t,n)}else"number"==typeof e&&(e=e.toString()),t.call(this,r.from(e));return this},i.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},i.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length},i.prototype.indexOf=function(e,t,n){if(void 0===n&&"string"==typeof t&&(n=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=r.from([e]):"string"==typeof e?e=r.from(e,n):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=r.from(e.buffer,e.byteOffset,e.byteLength):r.isBuffer(e)||(e=r.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;let i=this._offset(t),o=i[0],s=i[1];for(;o<this._bufs.length;o++){let t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){let r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{let t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},i.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)(function(t){i.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}})(t)}(),i.prototype._isBufferList=function(e){return e instanceof i||i.isBufferList(e)},i.isBufferList=function(e){return null!=e&&e[n]},t.exports=i}),Vt=o((e,t)=>{l(),tt(),Fe();var r=qt().Duplex,n=$t(),i=Ht();function o(e){if(!(this instanceof o))return new o(e);if("function"==typeof e){this._callback=e;let t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",function(e){e.on("error",t)}),this.on("unpipe",function(e){e.removeListener("error",t)}),e=null}i._init.call(this,e),r.call(this)}n(o,r),Object.assign(o.prototype,i.prototype),o.prototype._new=function(e){return new o(e)},o.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},o.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},o.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},o.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},o.prototype._isBufferList=function(e){return e instanceof o||e instanceof i||o.isBufferList(e)},o.isBufferList=i.isBufferList,t.exports=o,t.exports.BufferListStream=o,t.exports.BufferList=i}),zt=o((e,t)=>{l(),tt(),Fe();t.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}}),Kt=o((e,t)=>{l(),tt(),Fe();var r=t.exports,{Buffer:n}=(et(),a(Qe));r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},r.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},r.requiredHeaderFlagsErrors={};for(let e in r.requiredHeaderFlags){let t=r.requiredHeaderFlags[e];r.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+r.types[e]+" packet"}r.codes={};for(let e in r.types){let t=r.types[e];r.codes[t]=e}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=n.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=n.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=n.from([r.codes.connect<<r.CMD_SHIFT]),r.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},r.propertiesCodes={};for(let e in r.properties){let t=r.properties[e];r.propertiesCodes[t]=e}function i(e){return[0,1,2].map(t=>[0,1].map(i=>[0,1].map(o=>{let s=n.alloc(1);return s.writeUInt8(r.codes[e]<<r.CMD_SHIFT|(i?r.DUP_MASK:0)|t<<r.QOS_SHIFT|o,0,!0),s})))}r.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},r.PUBLISH_HEADER=i("publish"),r.SUBSCRIBE_HEADER=i("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=i("unsubscribe"),r.ACKS={unsuback:i("unsuback"),puback:i("puback"),pubcomp:i("pubcomp"),pubrel:i("pubrel"),pubrec:i("pubrec")},r.SUBACK_HEADER=n.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=n.from([3]),r.VERSION4=n.from([4]),r.VERSION5=n.from([5]),r.VERSION131=n.from([131]),r.VERSION132=n.from([132]),r.QOS=[0,1,2].map(e=>n.from([e])),r.EMPTY={pingreq:n.from([r.codes.pingreq<<4,0]),pingresp:n.from([r.codes.pingresp<<4,0]),disconnect:n.from([r.codes.disconnect<<4,0])},r.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},r.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),Gt=o((e,t)=>{l(),tt(),Fe();var r=1e3,n=6e4,i=60*n,o=24*i,s=7*o,a=365.25*o;function u(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}t.exports=function(e,t){t=t||{};var l=typeof e;if("string"===l&&e.length>0)return function(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|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var l=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*a;case"weeks":case"week":case"w":return l*s;case"days":case"day":case"d":return l*o;case"hours":case"hour":case"hrs":case"hr":case"h":return l*i;case"minutes":case"minute":case"mins":case"min":case"m":return l*n;case"seconds":case"second":case"secs":case"sec":case"s":return l*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}}}(e);if("number"===l&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=o?u(e,t,o,"day"):t>=i?u(e,t,i,"hour"):t>=n?u(e,t,n,"minute"):t>=r?u(e,t,r,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=o?Math.round(e/o)+"d":t>=i?Math.round(e/i)+"h":t>=n?Math.round(e/n)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}),Qt=o((e,t)=>{l(),tt(),Fe(),t.exports=function(e){function t(e){let n,i,o,s=null;function a(...e){if(!a.enabled)return;let r=a,i=Number(new Date),o=i-(n||i);r.diff=o,r.prev=n,r.curr=i,n=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,i)=>{if("%%"===n)return"%";s++;let o=t.formatters[i];if("function"==typeof o){let t=e[s];n=o.call(r,t),e.splice(s,1),s--}return n}),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,i=-1,o=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,o=r,n++):(r++,n++);else{if(-1===i)return!1;n=i+1,o++,r=o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];let r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=Gt(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}}),Yt=o((e,t)=>{l(),tt(),Fe(),e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),e.splice(i,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch{}},e.load=function(){let t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!t&&typeof u<"u"&&"env"in u&&(t=u.env.DEBUG),t},e.useColors=function(){if(typeof window<"u"&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return 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&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),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"],e.log=console.debug||console.log||(()=>{}),t.exports=Qt()(e);var{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),Jt=o((e,t)=>{l(),tt(),Fe();var r=Vt(),{EventEmitter:n}=(bt(),a(st)),i=zt(),o=Kt(),s=Yt()("mqtt-packet:parser");t.exports=class e extends n{constructor(){super(),this.parser=this.constructor.parser}static parser(t){return this instanceof e?(this.settings=t||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new e).parser(t)}_resetState(){s("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=r(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),s("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,s("parse: state complete. _stateCounter is now: %d",this._stateCounter),s("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return s("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0),t=e>>o.CMD_SHIFT;this.packet.cmd=o.types[t];let r=15&e,n=o.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(o.requiredHeaderFlagsErrors[t])):(this.packet.retain=0!==(e&o.RETAIN_MASK),this.packet.qos=e>>o.QOS_SHIFT&o.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=0!==(e&o.DUP_MASK),s("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),s("_parseLength %d",e.value),!!e}_parsePayload(){s("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return s("_parsePayload complete result: %s",e),e}_parseConnect(){s("_parseConnect");let e,t,r,n,i={},a=this.packet,l=this._parseString();if(null===l)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(new Error("Invalid protocolId"));if(a.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(a.protocolVersion=this._list.readUInt8(this._pos),a.protocolVersion>=128&&(a.bridgeMode=!0,a.protocolVersion=a.protocolVersion-128),3!==a.protocolVersion&&4!==a.protocolVersion&&5!==a.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));i.username=this._list.readUInt8(this._pos)&o.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&o.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&o.WILL_FLAG_MASK;let u=!!(this._list.readUInt8(this._pos)&o.WILL_RETAIN_MASK),c=(this._list.readUInt8(this._pos)&o.WILL_QOS_MASK)>>o.WILL_QOS_SHIFT;if(i.will)a.will={},a.will.retain=u,a.will.qos=c;else{if(u)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(a.clean=0!==(this._list.readUInt8(this._pos)&o.CLEAN_SESSION_MASK),this._pos++,a.keepalive=this._parseNum(),-1===a.keepalive)return this._emitError(new Error("Packet too short"));if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.properties=e)}let h=this._parseString();if(null===h)return this._emitError(new Error("Packet too short"));if(a.clientId=h,s("_parseConnect: packet.clientId: %s",a.clientId),i.will){if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(a.will.topic=e,s("_parseConnect: packet.will.topic: %s",a.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));a.will.payload=t,s("_parseConnect: packet.will.paylaod: %s",a.will.payload)}if(i.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));a.username=n,s("_parseConnect: packet.username: %s",a.username)}if(i.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));a.password=r}return this.settings=a,s("_parseConnect: complete"),a}_parseConnack(){s("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(t&o.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}s("_parseConnack: complete")}_parsePublish(){s("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),s("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){s("_parseSubscribe");let e,t,r,n,i,a,l,u=this.packet;if(u.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(u.properties=e)}if(u.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<u.length;){if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=u.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(t=this._parseByte(),5===this.settings.protocolVersion){if(192&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(r=t&o.SUBSCRIBE_OPTIONS_QOS_MASK,r>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=0!==(t>>o.SUBSCRIBE_OPTIONS_NL_SHIFT&o.SUBSCRIBE_OPTIONS_NL_MASK),i=0!==(t>>o.SUBSCRIBE_OPTIONS_RAP_SHIFT&o.SUBSCRIBE_OPTIONS_RAP_MASK),n=t>>o.SUBSCRIBE_OPTIONS_RH_SHIFT&o.SUBSCRIBE_OPTIONS_RH_MASK,n>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));l={topic:e,qos:r},5===this.settings.protocolVersion?(l.nl=a,l.rap=i,l.rh=n):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),s("_parseSubscribe: push subscription `%s` to subscription",l),u.subscriptions.push(l)}}}_parseSuback(){s("_parseSuback");let e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!o.MQTT5_SUBACK_CODES[e])return this._emitError(new Error("Invalid suback code"))}else if(e>2&&128!==e)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(e)}}}_parseUnsubscribe(){s("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));s("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){s("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){let t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(!o.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){s("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!o.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!o.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}s("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){let e=this.packet;if(s("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),o.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return s("_parseDisconnect result: true"),!0}_parseAuth(){s("_parseAuth");let e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!o.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),s("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(s("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,r);return this._pos+=t,s("_parseString: result: %s",n),n}_parseStringPair(){return s("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;let r=this._list.slice(this._pos,t);return this._pos+=e,s("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,s("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,s("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){s("_parseVarByteNum");let t,r=0,n=1,i=0,a=!1,l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),i+=n*(t&o.VARBYTEINT_MASK),n*=128,0===(t&o.VARBYTEINT_FIN_MASK)){a=!0;break}if(this._list.length<=r)break}return!a&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),a=!!a&&(e?{bytes:r,value:i}:i),s("_parseVarByteNum: result: %o",a),a}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),s("_parseByte: result: %o",e),e}_parseByType(e){switch(s("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){s("_parseProperties");let e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){let e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;let t=o.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));let e=this._parseByType(o.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{let n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value;continue}r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(o.propertiesTypes[t]))):r[t]=this._parseByType(o.propertiesTypes[t])}return r}_newPacket(){return s("_newPacket"),this.packet&&(this._list.consume(this.packet.length),s("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),s("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}_emitError(e){s("_emitError",e),this.error=e,this.emit("error",e)}}}),Xt=o((e,t)=>{l(),tt(),Fe();var{Buffer:r}=(et(),a(Qe)),n={},i=r.isBuffer(r.from([1,2]).subarray(0,1));function o(e){let t=r.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}t.exports={cache:n,generateCache:function(){for(let e=0;e<65536;e++)n[e]=o(e)},generateNumber:o,genBufVariableByteInt:function(e){let t=0,n=0,o=r.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),o.writeUInt8(t,n++)}while(e>0&&n<4);return e>0&&(n=0),i?o.subarray(0,n):o.slice(0,n)},generate4ByteBuffer:function(e){let t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}}),Zt=o((e,t)=>{l(),tt(),Fe(),typeof u>"u"||!u.version||0===u.version.indexOf("v0.")||0===u.version.indexOf("v1.")&&0!==u.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,r,n){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,s=arguments.length;switch(s){case 0:case 1:return u.nextTick(e);case 2:return u.nextTick(function(){e.call(null,t)});case 3:return u.nextTick(function(){e.call(null,t,r)});case 4:return u.nextTick(function(){e.call(null,t,r,n)});default:for(i=new Array(s-1),o=0;o<i.length;)i[o++]=arguments[o];return u.nextTick(function(){e.apply(null,i)})}}}:t.exports=u}),er=o((e,t)=>{l(),tt(),Fe();var r=Kt(),{Buffer:n}=(et(),a(Qe)),i=n.allocUnsafe(0),o=n.from([0]),s=Xt(),u=Zt().nextTick,c=Yt()("mqtt-packet:writeToStream"),h=s.cache,f=s.generateNumber,p=s.generateCache,d=s.genBufVariableByteInt,g=s.generate4ByteBuffer,y=A,b=!0;function m(e,t,s){switch(c("generate called"),t.cork&&(t.cork(),u(w,t)),b&&(b=!1,p()),c("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){let i=e||{},o=i.protocolId||"MQTT",s=i.protocolVersion||4,a=i.will,l=i.clean,u=i.keepalive||0,c=i.clientId||"",h=i.username,f=i.password,p=i.properties;void 0===l&&(l=!0);let d,g,b=0;if("string"!=typeof o&&!n.isBuffer(o))return t.destroy(new Error("Invalid protocolId")),!1;if(b+=o.length+2,3!==s&&4!==s&&5!==s)return t.destroy(new Error("Invalid protocol version")),!1;if(b+=1,("string"==typeof c||n.isBuffer(c))&&(c||s>=4)&&(c||l))b+=n.byteLength(c)+2;else{if(s<4)return t.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return t.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof u||u<0||u>65535||u%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(b+=2,b+=1,5===s){if(d=O(t,p),!d)return!1;b+=d.length}if(a){if("object"!=typeof a)return t.destroy(new Error("Invalid will")),!1;if(!a.topic||"string"!=typeof a.topic)return t.destroy(new Error("Invalid will topic")),!1;if(b+=n.byteLength(a.topic)+2,b+=2,a.payload){if(!(a.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof a.payload?b+=n.byteLength(a.payload):b+=a.payload.length}if(g={},5===s){if(g=O(t,a.properties),!g)return!1;b+=g.length}}let m=!1;if(null!=h){if(!C(h))return t.destroy(new Error("Invalid username")),!1;m=!0,b+=n.byteLength(h)+2}if(null!=f){if(!m)return t.destroy(new Error("Username is required to use password")),!1;if(!C(f))return t.destroy(new Error("Invalid password")),!1;b+=R(f)+2}t.write(r.CONNECT_HEADER),_(t,b),k(t,o),i.bridgeMode&&(s+=128),t.write(131===s?r.VERSION131:132===s?r.VERSION132:4===s?r.VERSION4:5===s?r.VERSION5:r.VERSION3);let w=0;return w|=null!=h?r.USERNAME_MASK:0,w|=null!=f?r.PASSWORD_MASK:0,w|=a&&a.retain?r.WILL_RETAIN_MASK:0,w|=a&&a.qos?a.qos<<r.WILL_QOS_SHIFT:0,w|=a?r.WILL_FLAG_MASK:0,w|=l?r.CLEAN_SESSION_MASK:0,t.write(n.from([w])),y(t,u),5===s&&d.write(),k(t,c),a&&(5===s&&g.write(),S(t,a.topic),k(t,a.payload)),null!=h&&k(t,h),null!=f&&k(t,f),!0}(e,t);case"connack":return function(e,t,i){let s=i?i.protocolVersion:4,a=e||{},l=5===s?a.reasonCode:a.returnCode,u=a.properties,c=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let h=null;if(5===s){if(h=O(t,u),!h)return!1;c+=h.length}return t.write(r.CONNACK_HEADER),_(t,c),t.write(a.sessionPresent?r.SESSIONPRESENT_HEADER:o),t.write(n.from([l])),h?.write(),!0}(e,t,s);case"publish":return function(e,t,o){c("publish: packet: %o",e);let s=o?o.protocolVersion:4,a=e||{},l=a.qos||0,u=a.retain?r.RETAIN_MASK:0,h=a.topic,f=a.payload||i,p=a.messageId,d=a.properties,g=0;if("string"==typeof h)g+=n.byteLength(h)+2;else{if(!n.isBuffer(h))return t.destroy(new Error("Invalid topic")),!1;g+=h.length+2}if(n.isBuffer(f)?g+=f.length:g+=n.byteLength(f),l&&"number"!=typeof p)return t.destroy(new Error("Invalid messageId")),!1;l&&(g+=2);let b=null;if(5===s){if(b=O(t,d),!b)return!1;g+=b.length}return t.write(r.PUBLISH_HEADER[l][a.dup?1:0][u?1:0]),_(t,g),y(t,R(h)),t.write(h),l>0&&y(t,p),b?.write(),c("publish: payload: %o",f),t.write(f)}(e,t,s);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,u=s.dup&&"pubrel"===a?r.DUP_MASK:0,c=0,h=s.reasonCode,f=s.properties,p=5===o?3:2;if("pubrel"===a&&(c=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let d=null;if(5===o&&"object"==typeof f){if(d=x(t,f,i,p),!d)return!1;p+=d.length}return t.write(r.ACKS[a][c][u][0]),3===p&&(p+=0!==h?1:-1),_(t,p),y(t,l),5===o&&2!==p&&t.write(n.from([h])),null!==d?d.write():4===p&&t.write(n.from([0])),!0}(e,t,s);case"subscribe":return function(e,t,i){c("subscribe: packet: ");let o=i?i.protocolVersion:4,s=e||{},a=s.dup?r.DUP_MASK:0,l=s.messageId,u=s.subscriptions,h=s.properties,f=0;if("number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;f+=2;let p=null;if(5===o){if(p=O(t,h),!p)return!1;f+=p.length}if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){let r=u[e].topic,i=u[e].qos;if("string"!=typeof r)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof i)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(u[e].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let r=u[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=n.byteLength(r)+2+1}c("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),t.write(r.SUBSCRIBE_HEADER[1][a?1:0][0]),_(t,f),y(t,l),null!==p&&p.write();let d=!0;for(let e of u){let i,s=e.topic,a=e.qos,l=+e.nl,u=+e.rap,c=e.rh;S(t,s),i=r.SUBSCRIBE_OPTIONS_QOS[a],5===o&&(i|=l?r.SUBSCRIBE_OPTIONS_NL:0,i|=u?r.SUBSCRIBE_OPTIONS_RAP:0,i|=c?r.SUBSCRIBE_OPTIONS_RH[c]:0),d=t.write(n.from([i]))}return d}(e,t,s);case"suback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,u=s.properties,c=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(c+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(new Error("Invalid qos vector")),!1;c+=1}let h=null;if(5===o){if(h=x(t,u,i,c),!h)return!1;c+=h.length}return t.write(r.SUBACK_HEADER),_(t,c),y(t,a),null!==h&&h.write(),t.write(n.from(l))}(e,t,s);case"unsubscribe":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.unsubscriptions,c=s.properties,h=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof u||!u.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let e=0;e<u.length;e+=1){if("string"!=typeof u[e])return t.destroy(new Error("Invalid unsubscriptions")),!1;h+=n.byteLength(u[e])+2}let f=null;if(5===o){if(f=O(t,c),!f)return!1;h+=f.length}t.write(r.UNSUBSCRIBE_HEADER[1][l?1:0][0]),_(t,h),y(t,a),null!==f&&f.write();let p=!0;for(let e=0;e<u.length;e++)p=S(t,u[e]);return p}(e,t,s);case"unsuback":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,u=s.granted,c=s.properties,h=s.cmd,f=0,p=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<u.length;e+=1){if("number"!=typeof u[e])return t.destroy(new Error("Invalid qos vector")),!1;p+=1}}let d=null;if(5===o){if(d=x(t,c,i,p),!d)return!1;p+=d.length}return t.write(r.ACKS[h][f][l][0]),_(t,p),y(t,a),null!==d&&d.write(),5===o&&t.write(n.from(u)),!0}(e,t,s);case"pingreq":case"pingresp":return function(e,t){return t.write(r.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0,c=null;if(5===o){if(c=x(t,l,i,u),!c)return!1;u+=c.length}return t.write(n.from([r.codes.disconnect<<4])),_(t,u),5===o&&t.write(n.from([a])),null!==c&&c.write(),!0}(e,t,s);case"auth":return function(e,t,i){let o=i?i.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,u=5===o?1:0;5!==o&&t.destroy(new Error("Invalid mqtt version for auth packet"));let c=x(t,l,i,u);return!!c&&(u+=c.length,t.write(n.from([r.codes.auth<<4])),_(t,u),t.write(n.from([a])),null!==c&&c.write(),!0)}(e,t,s);default:return t.destroy(new Error("Unknown command")),!1}}function w(e){e.uncork()}Object.defineProperty(m,"cacheNumbers",{get:()=>y===A,set(e){e?((!h||0===Object.keys(h).length)&&(b=!0),y=A):(b=!1,y=I)}});var v={};function _(e,t){if(t>r.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let n=v[t];return n||(n=d(t),t<16384&&(v[t]=n)),c("writeVarByteInt: writing to stream: %o",n),e.write(n)}function S(e,t){let r=n.byteLength(t);return y(e,r),c("writeString: %s",t),e.write(t,"utf8")}function E(e,t,r){S(e,t),S(e,r)}function A(e,t){return c("writeNumberCached: number: %d",t),c("writeNumberCached: %o",h[t]),e.write(h[t])}function I(e,t){let r=f(t);return c("writeNumberGenerated: %o",r),e.write(r)}function k(e,t){"string"==typeof t?S(e,t):t?(y(e,t.length),e.write(t)):y(e,0)}function O(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){T(e,{},0)}};let i=0;function o(t,i){let o=0;switch(r.propertiesTypes[t]){case"byte":if("boolean"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=2;break;case"int8":if("number"!=typeof i||i<0||i>255)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=2;break;case"binary":if(i&&null===i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=1+n.byteLength(i)+2;break;case"int16":if("number"!=typeof i||i<0||i>65535)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=3;break;case"int32":if("number"!=typeof i||i<0||i>4294967295)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=5;break;case"var":if("number"!=typeof i||i<0||i>268435455)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=1+n.byteLength(d(i));break;case"string":if("string"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=3+n.byteLength(i.toString());break;case"pair":if("object"!=typeof i)return e.destroy(new Error(`Invalid ${t}: ${i}`)),!1;o+=Object.getOwnPropertyNames(i).reduce((e,t)=>{let r=i[t];return Array.isArray(r)?e+=r.reduce((e,r)=>e+=3+n.byteLength(t.toString())+2+n.byteLength(r.toString()),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(i[t].toString()),e},0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${i}`)),!1}return o}if(t)for(let e in t){let r=0,n=0,s=t[e];if(void 0!==s){if(Array.isArray(s))for(let t=0;t<s.length;t++){if(n=o(e,s[t]),!n)return!1;r+=n}else{if(n=o(e,s),!n)return!1;r=n}if(!r)return!1;i+=r}}return{length:n.byteLength(d(i))+i,write(){T(e,t,i)}}}function x(e,t,r,n){let i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=O(e,t);if(o)for(;n+s.length>o;){let r=i.shift();if(!r||!t[r])return!1;delete t[r],s=O(e,t)}return s}function P(e,t,i){switch(r.propertiesTypes[t]){case"byte":e.write(n.from([r.properties[t]])),e.write(n.from([+i]));break;case"int8":e.write(n.from([r.properties[t]])),e.write(n.from([i]));break;case"binary":e.write(n.from([r.properties[t]])),k(e,i);break;case"int16":e.write(n.from([r.properties[t]])),y(e,i);break;case"int32":e.write(n.from([r.properties[t]])),function(e,t){let r=g(t);c("write4ByteNumber: %o",r),e.write(r)}(e,i);break;case"var":e.write(n.from([r.properties[t]])),_(e,i);break;case"string":e.write(n.from([r.properties[t]])),S(e,i);break;case"pair":Object.getOwnPropertyNames(i).forEach(o=>{let s=i[o];Array.isArray(s)?s.forEach(i=>{e.write(n.from([r.properties[t]])),E(e,o.toString(),i.toString())}):(e.write(n.from([r.properties[t]])),E(e,o.toString(),s.toString()))});break;default:return e.destroy(new Error(`Invalid property ${t} value: ${i}`)),!1}}function T(e,t,r){_(e,r);for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!=t[r]){let n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)P(e,r,n[t]);else P(e,r,n)}}function R(e){return e?e instanceof n?e.length:n.byteLength(e):0}function C(e){return"string"==typeof e||e instanceof n}t.exports=m}),tr=o((e,t)=>{l(),tt(),Fe();var r=er(),{EventEmitter:n}=(bt(),a(st)),{Buffer:i}=(et(),a(Qe));var o=class extends n{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e,t=0,r=new Array(this._array.length),n=this._array,o=0;for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?r[e]=n[e].length:r[e]=i.byteLength(n[e]),t+=r[e];let s=i.allocUnsafe(t);for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?(n[e].copy(s,o),o+=r[e]):(s.write(n[e],o),o+=r[e]);return s}destroy(e){e&&this.emit("error",e)}};t.exports=function(e,t){let n=new o;return r(e,n,t),n.concat()}}),rr=o(e=>{l(),tt(),Fe(),e.parser=Jt().parser,e.generate=tr(),e.writeToStream=er()}),nr=o((e,t)=>{function r(e){return e instanceof Je?Je.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}l(),tt(),Fe(),t.exports=function(e){if((e=e||{}).circles)return function(e){let t=[],n=[],i=new Map;if(i.set(Date,e=>new Date(e)),i.set(Map,(e,t)=>new Map(s(Array.from(e),t))),i.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(let t of e.constructorHandlers)i.set(t[0],t[1]);let o=null;return e.proto?l:a;function s(e,s){let a=Object.keys(e),l=new Array(a.length);for(let u=0;u<a.length;u++){let c=a[u],h=e[c];if("object"!=typeof h||null===h)l[c]=h;else if(h.constructor!==Object&&(o=i.get(h.constructor)))l[c]=o(h,s);else if(ArrayBuffer.isView(h))l[c]=r(h);else{let e=t.indexOf(h);l[c]=-1!==e?n[e]:s(h)}}return l}function a(e){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return s(e,a);if(e.constructor!==Object&&(o=i.get(e.constructor)))return o(e,a);let l={};t.push(e),n.push(l);for(let s in e){if(!1===Object.hasOwnProperty.call(e,s))continue;let u=e[s];if("object"!=typeof u||null===u)l[s]=u;else if(u.constructor!==Object&&(o=i.get(u.constructor)))l[s]=o(u,a);else if(ArrayBuffer.isView(u))l[s]=r(u);else{let e=t.indexOf(u);l[s]=-1!==e?n[e]:a(u)}}return t.pop(),n.pop(),l}function l(e){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return s(e,l);if(e.constructor!==Object&&(o=i.get(e.constructor)))return o(e,l);let a={};t.push(e),n.push(a);for(let s in e){let u=e[s];if("object"!=typeof u||null===u)a[s]=u;else if(u.constructor!==Object&&(o=i.get(u.constructor)))a[s]=o(u,l);else if(ArrayBuffer.isView(u))a[s]=r(u);else{let e=t.indexOf(u);a[s]=-1!==e?n[e]:l(u)}}return t.pop(),n.pop(),a}}(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(i(Array.from(e),t))),t.set(Set,(e,t)=>new Set(i(Array.from(e),t))),e.constructorHandlers)for(let r of e.constructorHandlers)t.set(r[0],r[1]);let n=null;return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return i(o,e);if(o.constructor!==Object&&(n=t.get(o.constructor)))return n(o,e);let s={};for(let i in o){let a=o[i];"object"!=typeof a||null===a?s[i]=a:a.constructor!==Object&&(n=t.get(a.constructor))?s[i]=n(a,e):ArrayBuffer.isView(a)?s[i]=r(a):s[i]=e(a)}return s}:function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return i(o,e);if(o.constructor!==Object&&(n=t.get(o.constructor)))return n(o,e);let s={};for(let i in o){if(!1===Object.hasOwnProperty.call(o,i))continue;let a=o[i];"object"!=typeof a||null===a?s[i]=a:a.constructor!==Object&&(n=t.get(a.constructor))?s[i]=n(a,e):ArrayBuffer.isView(a)?s[i]=r(a):s[i]=e(a)}return s};function i(e,i){let o=Object.keys(e),s=new Array(o.length);for(let a=0;a<o.length;a++){let l=o[a],u=e[l];"object"!=typeof u||null===u?s[l]=u:u.constructor!==Object&&(n=t.get(u.constructor))?s[l]=n(u,i):ArrayBuffer.isView(u)?s[l]=r(u):s[l]=i(u)}return s}}}),ir=o((e,t)=>{l(),tt(),Fe(),t.exports=nr()()}),or=o(e=>{function t(e){let t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopic=t,e.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}}),sr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});var t=qt(),r={objectMode:!0},n={clean:!0};e.default=class{options;_inflights;constructor(e){this.options=e||{},this.options={...n,...e},this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){let e=new t.Readable(r),n=[],i=!1,o=0;return this._inflights.forEach((e,t)=>{n.push(e)}),e._read=()=>{!i&&o<n.length?e.push(n[o++]):e.push(null)},e.destroy=t=>{if(!i)return i=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,t){let r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){let r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}}),ar=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153];e.default=(e,r,n)=>{e.log("handlePublish: packet %o",r),n=typeof n<"u"?n:e.noop;let i=r.topic.toString(),o=r.payload,{qos:s}=r,{messageId:a}=r,{options:l}=e;if(5===e.options.protocolVersion){let t;if(r.properties&&(t=r.properties.topicAlias),typeof t<"u")if(0===i.length){if(!(t>0&&t<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",t),void e.emit("error",new Error("Received Topic Alias is out of range"));{let r=e.topicAliasRecv.getTopicByAlias(t);if(!r)return e.log("handlePublish :: unregistered topic alias. alias: %d",t),void e.emit("error",new Error("Received unregistered Topic Alias"));i=r,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",i,t)}}else{if(!e.topicAliasRecv.put(i,t))return e.log("handlePublish :: topic alias out of range. alias: %d",t),void e.emit("error",new Error("Received Topic Alias is out of range"));e.log("handlePublish :: registered topic: %s - alias: %d",i,t)}}switch(e.log("handlePublish: qos %d",s),s){case 2:l.customHandleAcks(i,o,r,(i,o)=>("number"==typeof i&&(o=i,i=null),i?e.emit("error",i):-1===t.indexOf(o)?e.emit("error",new Error("Wrong reason code for pubrec")):void(o?e._sendPacket({cmd:"pubrec",messageId:a,reasonCode:o},n):e.incomingStore.put(r,()=>{e._sendPacket({cmd:"pubrec",messageId:a},n)}))));break;case 1:l.customHandleAcks(i,o,r,(s,l)=>("number"==typeof s&&(l=s,s=null),s?e.emit("error",s):-1===t.indexOf(l)?e.emit("error",new Error("Wrong reason code for puback")):(l||e.emit("message",i,o,r),void e.handleMessage(r,t=>{if(t)return n&&n(t);e._sendPacket({cmd:"puback",messageId:a,reasonCode:l},n)}))));break;case 0:e.emit("message",i,o,r),e.handleMessage(r,n);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}}),lr=o((e,t)=>{t.exports={version:"5.14.1"}}),ur=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.ErrorWithSubackPacket=e.ErrorWithReasonCode=void 0,e.applyMixin=function(e,t,r=!1){let n=[t];for(;;){let e=n[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;n.unshift(t)}for(let t of n)for(let n of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==n)&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n)??Object.create(null))};var t=class e extends Error{code;constructor(t,r){super(t),this.code=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=t;var r=class e extends Error{packet;constructor(t,r){super(t),this.packet=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};e.ErrorWithSubackPacket=r,e.nextTick="function"==typeof u?.nextTick?u.nextTick:e=>{setTimeout(e,0)},e.MQTTJS_VERSION=lr().version}),cr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var t=ur();e.ReasonCodes={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};e.default=(r,n)=>{let{messageId:i}=n,o=n.cmd,s=null,a=r.outgoing[i]?r.outgoing[i].cb:null,l=null;if(a){switch(r.log("_handleAck :: packet type",o),o){case"pubcomp":case"puback":{let o=n.reasonCode;o&&o>0&&16!==o?(l=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[o]}`,o),r._removeOutgoingAndStoreMessage(i,()=>{a(l,n)})):r._removeOutgoingAndStoreMessage(i,a);break}case"pubrec":{s={cmd:"pubrel",qos:2,messageId:i};let o=n.reasonCode;o&&o>0&&16!==o?(l=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[o]}`,o),r._removeOutgoingAndStoreMessage(i,()=>{a(l,n)})):r._sendPacket(s);break}case"suback":{delete r.outgoing[i],r.messageIdProvider.deallocate(i);let t=n.granted;for(let n=0;n<t.length;n++){let o=t[n];if(128&o){l=new Error(`Subscribe error: ${e.ReasonCodes[o]}`),l.code=o;let t=r.messageIdToTopic[i];t&&t.forEach(e=>{delete r._resubscribeTopics[e]})}}delete r.messageIdToTopic[i],r._invokeStoreProcessingQueue(),a(l,n);break}case"unsuback":delete r.outgoing[i],r.messageIdProvider.deallocate(i),r._invokeStoreProcessingQueue(),a(null,n);break;default:r.emit("error",new Error("unrecognized packet type"))}r.disconnecting&&0===Object.keys(r.outgoing).length&&r.emit("outgoingEmpty")}else r.log("_handleAck :: Server sent an ack in error. Ignoring.")}}),hr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});var t=ur(),r=cr();e.default=(e,n)=>{let{options:i}=e,o=i.protocolVersion,s=5===o?n.reasonCode:n.returnCode;if(5!==o){let r=new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${o}`,s);return void e.emit("error",r)}e.handleAuth(n,(n,i)=>{if(n)e.emit("error",n);else if(24===s)e.reconnecting=!1,e._sendPacket(i);else{let n=new t.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",n)}})}}),fr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,r=new Set,n="object"==typeof u&&u?u:{},i=(e,t,r,i)=>{"function"==typeof n.emitWarning?n.emitWarning(e,t,r,i):console.error(`[${r}] ${t}: ${e}`)},o=globalThis.AbortController,s=globalThis.AbortSignal;if(typeof o>"u"){s=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},o=class{constructor(){t()}signal=new s;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==n.env?.LRU_CACHE_IGNORE_AC_WARNING,t=()=>{e&&(e=!1,i("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}var a=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),c=e=>a(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?h:null:null,h=class extends Array{constructor(e){super(e),this.fill(0)}},f=class e{heap;length;static#e=!1;static create(t){let r=c(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},p=class e{#e;#t;#r;#n;#i;#o;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#l;#u;#c;#h;#f;#p;#d;#g;#y;#b;#m;#w;#v;#_;#S;static unsafeExposeInternals(e){return{starts:e.#m,ttls:e.#w,sizes:e.#b,keyMap:e.#l,keyList:e.#u,valList:e.#c,next:e.#h,prev:e.#f,get head(){return e.#p},get tail(){return e.#d},free:e.#g,isBackgroundFetch:t=>e.#E(t),backgroundFetch:(t,r,n,i)=>e.#A(t,r,n,i),moveToTail:t=>e.#I(t),indexes:t=>e.#k(t),rindexes:t=>e.#O(t),isStale:t=>e.#x(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#i}get memoMethod(){return this.#o}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(t){let{max:n=0,ttl:o,ttlResolution:s=1,ttlAutopurge:l,updateAgeOnGet:u,updateAgeOnHas:h,allowStale:p,dispose:d,disposeAfter:g,noDisposeOnSet:y,noUpdateTTL:b,maxSize:m=0,maxEntrySize:w=0,sizeCalculation:v,fetchMethod:_,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:k,ignoreFetchAbort:O}=t;if(0!==n&&!a(n))throw new TypeError("max option must be a nonnegative integer");let x=n?c(n):Array;if(!x)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=m,this.maxEntrySize=w||this.#t,this.sizeCalculation=v,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==S&&"function"!=typeof S)throw new TypeError("memoMethod must be a function if defined");if(this.#o=S,void 0!==_&&"function"!=typeof _)throw new TypeError("fetchMethod must be a function if specified");if(this.#i=_,this.#_=!!_,this.#l=new Map,this.#u=new Array(n).fill(void 0),this.#c=new Array(n).fill(void 0),this.#h=new x(n),this.#f=new x(n),this.#p=0,this.#d=0,this.#g=f.create(n),this.#s=0,this.#a=0,"function"==typeof d&&(this.#r=d),"function"==typeof g?(this.#n=g,this.#y=[]):(this.#n=void 0,this.#y=void 0),this.#v=!!this.#r,this.#S=!!this.#n,this.noDisposeOnSet=!!y,this.noUpdateTTL=!!b,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!k,this.ignoreFetchAbort=!!O,0!==this.maxEntrySize){if(0!==this.#t&&!a(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#P()}if(this.allowStale=!!p,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!u,this.updateAgeOnHas=!!h,this.ttlResolution=a(s)||0===s?s:1,this.ttlAutopurge=!!l,this.ttl=o||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#T()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!r.has(e))(t)&&(r.add(t),i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#T(){let e=new h(this.#e),r=new h(this.#e);this.#w=e,this.#m=r,this.#R=(n,i,o=t.now())=>{if(r[n]=0!==i?o:0,e[n]=i,0!==i&&this.ttlAutopurge){let e=setTimeout(()=>{this.#x(n)&&this.#C(this.#u[n],"expire")},i+1);e.unref&&e.unref()}},this.#j=n=>{r[n]=0!==e[n]?t.now():0},this.#M=(t,o)=>{if(e[o]){let s=e[o],a=r[o];if(!s||!a)return;t.ttl=s,t.start=a,t.now=n||i();let l=t.now-a;t.remainingTTL=s-l}};let n=0,i=()=>{let e=t.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let o=this.#l.get(t);if(void 0===o)return 0;let s=e[o],a=r[o];return s&&a?s-((n||i())-a):1/0},this.#x=t=>{let o=r[t],s=e[t];return!!s&&!!o&&(n||i())-o>s}}#j=()=>{};#M=()=>{};#R=()=>{};#x=()=>!1;#P(){let e=new h(this.#e);this.#a=0,this.#b=e,this.#B=t=>{this.#a-=e[t],e[t]=0},this.#N=(e,t,r,n)=>{if(this.#E(t))return 0;if(!a(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!a(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#U=(t,r,n)=>{if(e[t]=r,this.#t){let r=this.#t-e[t];for(;this.#a>r;)this.#L(!0)}this.#a+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#a)}}#B=e=>{};#U=(e,t,r)=>{};#N=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#k({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#d;this.#D(t)&&((e||!this.#x(t))&&(yield t),t!==this.#p);)t=this.#f[t]}*#O({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#p;this.#D(t)&&((e||!this.#x(t))&&(yield t),t!==this.#d);)t=this.#h[t]}#D(e){return void 0!==e&&this.#l.get(this.#u[e])===e}*entries(){for(let e of this.#k())void 0!==this.#c[e]&&void 0!==this.#u[e]&&!this.#E(this.#c[e])&&(yield[this.#u[e],this.#c[e]])}*rentries(){for(let e of this.#O())void 0!==this.#c[e]&&void 0!==this.#u[e]&&!this.#E(this.#c[e])&&(yield[this.#u[e],this.#c[e]])}*keys(){for(let e of this.#k()){let t=this.#u[e];void 0!==t&&!this.#E(this.#c[e])&&(yield t)}}*rkeys(){for(let e of this.#O()){let t=this.#u[e];void 0!==t&&!this.#E(this.#c[e])&&(yield t)}}*values(){for(let e of this.#k())void 0!==this.#c[e]&&!this.#E(this.#c[e])&&(yield this.#c[e])}*rvalues(){for(let e of this.#O())void 0!==this.#c[e]&&!this.#E(this.#c[e])&&(yield this.#c[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#k()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(let r of this.#k()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}rforEach(e,t=this){for(let r of this.#O()){let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}purgeStale(){let e=!1;for(let t of this.#O({allowStale:!0}))this.#x(t)&&(this.#C(this.#u[t],"expire"),e=!0);return e}info(e){let r=this.#l.get(e);if(void 0===r)return;let n=this.#c[r],i=this.#E(n)?n.__staleWhileFetching:n;if(void 0===i)return;let o={value:i};if(this.#w&&this.#m){let e=this.#w[r],n=this.#m[r];if(e&&n){let r=e-(t.now()-n);o.ttl=r,o.start=Date.now()}}return this.#b&&(o.size=this.#b[r]),o}dump(){let e=[];for(let r of this.#k({allowStale:!0})){let n=this.#u[r],i=this.#c[r],o=this.#E(i)?i.__staleWhileFetching:i;if(void 0===o||void 0===n)continue;let s={value:o};if(this.#w&&this.#m){s.ttl=this.#w[r];let e=t.now()-this.#m[r];s.start=Math.floor(Date.now()-e)}this.#b&&(s.size=this.#b[r]),e.unshift([n,s])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let e=Date.now()-n.start;n.start=t.now()-e}this.set(r,n.value,n)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;let{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,u=this.#N(e,t,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#C(e,"set"),this;let c=0===this.#s?void 0:this.#l.get(e);if(void 0===c)c=0===this.#s?this.#d:0!==this.#g.length?this.#g.pop():this.#s===this.#e?this.#L(!1):this.#s,this.#u[c]=e,this.#c[c]=t,this.#l.set(e,c),this.#h[this.#d]=c,this.#f[c]=this.#d,this.#d=c,this.#s++,this.#U(c,u,a),a&&(a.set="add"),l=!1;else{this.#I(c);let r=this.#c[c];if(t!==r){if(this.#_&&this.#E(r)){r.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:t}=r;void 0!==t&&!o&&(this.#v&&this.#r?.(t,e,"set"),this.#S&&this.#y?.push([t,e,"set"]))}else o||(this.#v&&this.#r?.(r,e,"set"),this.#S&&this.#y?.push([r,e,"set"]));if(this.#B(c),this.#U(c,u,a),this.#c[c]=t,a){a.set="replace";let e=r&&this.#E(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0!==n&&!this.#w&&this.#T(),this.#w&&(l||this.#R(c,n,i),a&&this.#M(a,c)),!o&&this.#S&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}return this}pop(){try{for(;this.#s;){let e=this.#c[this.#p];if(this.#L(!0),this.#E(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#S&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}}}#L(e){let t=this.#p,r=this.#u[t],n=this.#c[t];return this.#_&&this.#E(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#S)&&(this.#v&&this.#r?.(n,r,"evict"),this.#S&&this.#y?.push([n,r,"evict"])),this.#B(t),e&&(this.#u[t]=void 0,this.#c[t]=void 0,this.#g.push(t)),1===this.#s?(this.#p=this.#d=0,this.#g.length=0):this.#p=this.#h[t],this.#l.delete(r),this.#s--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#l.get(e);if(void 0!==i){let e=this.#c[i];if(this.#E(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#x(i))return r&&this.#j(i),n&&(n.has="hit",this.#M(n,i)),!0;n&&(n.has="stale",this.#M(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#l.get(e);if(void 0===n||!r&&this.#x(n))return;let i=this.#c[n];return this.#E(i)?i.__staleWhileFetching:i}#A(e,t,r,n){let i=void 0===t?void 0:this.#c[t];if(this.#E(i))return i;let s=new o,{signal:a}=r;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});let l={signal:s.signal,options:r,context:n},u=(n,i=!1)=>{let{aborted:o}=s.signal,a=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(o&&!i?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),o&&!a&&!i)return c(s.signal.reason);let u=h;return this.#c[t]===h&&(void 0===n?u.__staleWhileFetching?this.#c[t]=u.__staleWhileFetching:this.#C(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,l.options))),n},c=n=>{let{aborted:i}=s.signal,o=i&&r.allowStaleOnFetchAbort,a=o||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,u=h;if(this.#c[t]===h&&(l&&void 0!==u.__staleWhileFetching?o||(this.#c[t]=u.__staleWhileFetching):this.#C(e,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);let h=new Promise((t,n)=>{let o=this.#i?.(e,i,l);o&&o instanceof Promise&&o.then(e=>t(void 0===e?void 0:e),n),s.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>u(e,!0)))})}).then(u,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),c(e))),f=Object.assign(h,{__abortController:s,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,f,{...l.options,status:void 0}),t=this.#l.get(e)):this.#c[t]=f,f}#E(e){if(!this.#_)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof o}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:c=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:g=!1,status:y,signal:b}=t;if(!this.#_)return y&&(y.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:y});let m={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:u,noDeleteOnFetchRejection:c,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:y,signal:b},w=this.#l.get(e);if(void 0===w){y&&(y.fetch="miss");let t=this.#A(e,w,m,d);return t.__returned=t}{let t=this.#c[w];if(this.#E(t)){let e=r&&void 0!==t.__staleWhileFetching;return y&&(y.fetch="inflight",e&&(y.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let i=this.#x(w);if(!g&&!i)return y&&(y.fetch="hit"),this.#I(w),n&&this.#j(w),y&&this.#M(y,w),t;let o=this.#A(e,w,m,d),s=void 0!==o.__staleWhileFetching&&r;return y&&(y.fetch=i?"stale":"refresh",s&&i&&(y.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#o;if(!r)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:i,...o}=t,s=this.get(e,o);if(!i&&void 0!==s)return s;let a=r(e,s,{options:o,context:n});return this.set(e,a,o),a}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,s=this.#l.get(e);if(void 0!==s){let t=this.#c[s],a=this.#E(t);return o&&this.#M(o,s),this.#x(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.#C(e,"expire"),o&&r&&(o.returnedStale=!0),r?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#I(s),n&&this.#j(s),t))}o&&(o.get="miss")}#F(e,t){this.#f[t]=e,this.#h[e]=t}#I(e){e!==this.#d&&(e===this.#p?this.#p=this.#h[e]:this.#F(this.#f[e],this.#h[e]),this.#F(this.#d,e),this.#d=e)}delete(e){return this.#C(e,"delete")}#C(e,t){let r=!1;if(0!==this.#s){let n=this.#l.get(e);if(void 0!==n)if(r=!0,1===this.#s)this.#W(t);else{this.#B(n);let r=this.#c[n];if(this.#E(r)?r.__abortController.abort(new Error("deleted")):(this.#v||this.#S)&&(this.#v&&this.#r?.(r,e,t),this.#S&&this.#y?.push([r,e,t])),this.#l.delete(e),this.#u[n]=void 0,this.#c[n]=void 0,n===this.#d)this.#d=this.#f[n];else if(n===this.#p)this.#p=this.#h[n];else{let e=this.#f[n];this.#h[e]=this.#h[n];let t=this.#h[n];this.#f[t]=this.#f[n]}this.#s--,this.#g.push(n)}}if(this.#S&&this.#y?.length){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}return r}clear(){return this.#W("delete")}#W(e){for(let t of this.#O({allowStale:!0})){let r=this.#c[t];if(this.#E(r))r.__abortController.abort(new Error("deleted"));else{let n=this.#u[t];this.#v&&this.#r?.(r,n,e),this.#S&&this.#y?.push([r,n,e])}}if(this.#l.clear(),this.#c.fill(void 0),this.#u.fill(void 0),this.#w&&this.#m&&(this.#w.fill(0),this.#m.fill(0)),this.#b&&this.#b.fill(0),this.#p=0,this.#d=0,this.#g.length=0,this.#a=0,this.#s=0,this.#S&&this.#y){let e,t=this.#y;for(;e=t?.shift();)this.#n?.(...e)}}};e.LRUCache=p}),pr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0;e.ContainerIterator=class{constructor(e=0){this.iteratorType=e}equals(e){return this.o===e.o}};var t=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return 0===this.i}};e.Base=t;e.Container=class extends t{}}),dr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=pr(),r=class extends t.Base{constructor(e=[]){super(),this.S=[];let t=this;e.forEach(function(e){t.push(e)})}clear(){this.i=0,this.S=[]}push(e){return this.S.push(e),this.i+=1,this.i}pop(){if(0!==this.i)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}};e.default=r}),gr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=pr(),r=class extends t.Base{constructor(e=[]){super(),this.j=0,this.q=[];let t=this;e.forEach(function(e){t.push(e)})}clear(){this.q=[],this.i=this.j=0}push(e){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let t=this.i;for(let e=0;e<t;++e)this.q[e]=this.q[this.j+e];this.j=0,this.q[this.i]=e}else this.q[this.j+this.i]=e;return++this.i}pop(){if(0===this.i)return;let e=this.q[this.j++];return this.i-=1,e}front(){if(0!==this.i)return this.q[this.j]}};e.default=r}),yr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=pr(),r=class extends t.Base{constructor(e=[],t=function(e,t){return e>t?-1:e<t?1:0},r=!0){if(super(),this.v=t,Array.isArray(e))this.C=r?[...e]:e;else{this.C=[];let t=this;e.forEach(function(e){t.C.push(e)})}this.i=this.C.length;let n=this.i>>1;for(let e=this.i-1>>1;e>=0;--e)this.k(e,n)}m(e){let t=this.C[e];for(;e>0;){let r=e-1>>1,n=this.C[r];if(this.v(n,t)<=0)break;this.C[e]=n,e=r}this.C[e]=t}k(e,t){let r=this.C[e];for(;e<t;){let t=e<<1|1,n=t+1,i=this.C[t];if(n<this.i&&this.v(i,this.C[n])>0&&(t=n,i=this.C[n]),this.v(i,r)>=0)break;this.C[e]=i,e=t}this.C[e]=r}clear(){this.i=0,this.C.length=0}push(e){this.C.push(e),this.m(this.i),this.i+=1}pop(){if(0===this.i)return;let e=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),e}top(){return this.C[0]}find(e){return this.C.indexOf(e)>=0}remove(e){let t=this.C.indexOf(e);return!(t<0)&&(0===t?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(e){let t=this.C.indexOf(e);return!(t<0)&&(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}};e.default=r}),br=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=pr(),r=class extends t.Container{};e.default=r}),mr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=function(){throw new RangeError("Iterator access denied!")}}),wr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=pr(),r=mr(),n=class extends t.ContainerIterator{constructor(e,t){super(t),this.o=e,0===this.iteratorType?(this.pre=function(){return 0===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return-1===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(e){this.container.setElementByPos(this.o,e)}};e.RandomIterator=n}),vr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=br())&&t.t?t:{default:t},n=wr();var i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=!0){if(super(),Array.isArray(e))this.J=t?[...e]:e,this.i=e.length;else{this.J=[];let t=this;e.forEach(function(e){t.pushBack(e)})}}clear(){this.i=0,this.J.length=0}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let t=0;for(let r=0;r<this.i;++r)this.J[r]!==e&&(this.J[t++]=this.J[r]);return this.i=this.J.length=t,this.i}eraseElementByIterator(e){let t=e.o;return e=e.next(),this.eraseElementByPos(t),e}pushBack(e){return this.J.push(e),this.i+=1,this.i}popBack(){if(0!==this.i)return this.i-=1,this.J.pop()}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(r).fill(t)),this.i+=r,this.i}find(e){for(let t=0;t<this.i;++t)if(this.J[t]===e)return new i(t,this);return this.end()}reverse(){this.J.reverse()}unique(){let e=1;for(let t=1;t<this.i;++t)this.J[t]!==this.J[t-1]&&(this.J[e++]=this.J[t]);return this.i=this.J.length=e,this.i}sort(e){this.J.sort(e)}forEach(e){for(let t=0;t<this.i;++t)e(this.J[t],t,this)}[Symbol.iterator](){return function*(){yield*this.J}.bind(this)()}};e.default=o}),_r=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=br())&&t.t?t:{default:t},n=pr(),i=mr();var o=class e extends n.ContainerIterator{constructor(e,t,r,n){super(n),this.o=e,this.h=t,this.container=r,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l}set pointer(e){this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l=e}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let t=this;e.forEach(function(e){t.pushBack(e)})}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}G(e,t){let r=t.B,n={l:e,L:t,B:r};t.B=n,r.L=n,t===this.h&&(this.p=n),r===this.h&&(this._=n),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return t.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}eraseElementByValue(e){let t=this.p;for(;t!==this.h;)t.l===e&&this.V(t),t=t.B;return this.i}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),e=e.next(),this.V(t),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(0===this.i)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(0===this.i)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let r=this.p;for(;e--;)r=r.B;r.l=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;if(r<=0)return this.i;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=this.p;for(let t=1;t<e;++t)n=n.B;let i=n.B;for(this.i+=r;r--;)n.B={l:t,L:n},n.B.L=n,n=n.B;n.B=i,i.L=n}return this.i}find(e){let t=this.p;for(;t!==this.h;){if(t.l===e)return new o(t,this.h,this);t=t.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,t=this._,r=0;for(;r<<1<this.i;){let n=e.l;e.l=t.l,t.l=n,e=e.B,t=t.L,r+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let t=e;for(;t.B!==this.h&&t.l===t.B.l;)t=t.B,this.i-=1;e.B=t.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let t=[];this.forEach(function(e){t.push(e)}),t.sort(e);let r=this.p;t.forEach(function(e){r.l=e,r=r.B})}merge(e){let t=this;if(0===this.i)e.forEach(function(e){t.pushBack(e)});else{let r=this.p;e.forEach(function(e){for(;r!==t.h&&r.l<=e;)r=r.B;t.G(e,r.L)})}return this.i}forEach(e){let t=this.p,r=0;for(;t!==this.h;)e(t.l,r++,this),t=t.B}[Symbol.iterator](){return function*(){if(0===this.i)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}.bind(this)()}};e.default=s}),Sr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=br())&&t.t?t:{default:t},n=wr();var i=class e extends n.RandomIterator{constructor(e,t,r){super(e,r),this.container=t}copy(){return new e(this.o,this.container,this.iteratorType)}},o=class extends r.default{constructor(e=[],t=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let r=(()=>{if("number"==typeof e.length)return e.length;if("number"==typeof e.size)return e.size;if("function"==typeof e.size)return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(r/this.F),1);for(let e=0;e<this.P;++e)this.A.push(new Array(this.F));let n=Math.ceil(r/this.F);this.j=this.R=(this.P>>1)-(n>>1),this.D=this.N=this.F-r%this.F>>1;let i=this;e.forEach(function(e){i.pushBack(e)})}T(){let e=[],t=Math.max(this.P>>1,1);for(let r=0;r<t;++r)e[r]=new Array(this.F);for(let t=this.j;t<this.P;++t)e[e.length]=this.A[t];for(let t=0;t<this.R;++t)e[e.length]=this.A[t];e[e.length]=[...this.A[this.R]],this.j=t,this.R=e.length-1;for(let r=0;r<t;++r)e[e.length]=new Array(this.F);this.A=e,this.P=e.length}O(e){let t=this.D+e+1,r=t%this.F,n=r-1,i=this.j+(t-r)/this.F;return 0===r&&(i-=1),i%=this.P,n<0&&(n+=this.F),{curNodeBucketIndex:i,curNodePointerIndex:n}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new i(0,this)}end(){return new i(this.i,this)}rBegin(){return new i(this.i-1,this,1)}rEnd(){return new i(-1,this,1)}front(){if(0!==this.i)return this.A[this.j][this.D]}back(){if(0!==this.i)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=e,this.i}popBack(){if(0===this.i)return;let e=this.A[this.R][this.N];return 1!==this.i&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(0===this.i)return;let e=this.A[this.j][this.D];return 1!==this.i&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,e}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.A[t][r]}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:r,curNodePointerIndex:n}=this.O(e);this.A[r][n]=t}insert(e,t,r=1){if(e<0||e>this.i)throw new RangeError;if(0===e)for(;r--;)this.pushFront(t);else if(e===this.i)for(;r--;)this.pushBack(t);else{let n=[];for(let t=e;t<this.i;++t)n.push(this.getElementByPos(t));this.cut(e-1);for(let e=0;e<r;++e)this.pushBack(t);for(let e=0;e<n.length;++e)this.pushBack(n[e])}return this.i}cut(e){if(e<0)return this.clear(),0;let{curNodeBucketIndex:t,curNodePointerIndex:r}=this.O(e);return this.R=t,this.N=r,this.i=e+1,this.i}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;if(0===e)this.popFront();else if(e===this.i-1)this.popBack();else{let t=[];for(let r=e+1;r<this.i;++r)t.push(this.getElementByPos(r));this.cut(e),this.popBack();let r=this;t.forEach(function(e){r.pushBack(e)})}return this.i}eraseElementByValue(e){if(0===this.i)return 0;let t=[];for(let r=0;r<this.i;++r){let n=this.getElementByPos(r);n!==e&&t.push(n)}let r=t.length;for(let e=0;e<r;++e)this.setElementByPos(e,t[e]);return this.cut(r-1)}eraseElementByIterator(e){let t=e.o;return this.eraseElementByPos(t),e=e.next()}find(e){for(let t=0;t<this.i;++t)if(this.getElementByPos(t)===e)return new i(t,this);return this.end()}reverse(){let e=0,t=this.i-1;for(;e<t;){let r=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,r),e+=1,t-=1}}unique(){if(this.i<=1)return this.i;let e=1,t=this.getElementByPos(0);for(let r=1;r<this.i;++r){let n=this.getElementByPos(r);n!==t&&(t=n,this.setElementByPos(e++,n))}for(;this.i>e;)this.popBack();return this.i}sort(e){let t=[];for(let e=0;e<this.i;++e)t.push(this.getElementByPos(e));t.sort(e);for(let e=0;e<this.i;++e)this.setElementByPos(e,t[e])}shrinkToFit(){if(0===this.i)return;let e=[];this.forEach(function(t){e.push(t)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let e=0;e<this.P;++e)this.A.push(new Array(this.F));for(let t=0;t<e.length;++t)this.pushBack(e[t])}forEach(e){for(let t=0;t<this.i;++t)e(this.getElementByPos(t),t,this)}[Symbol.iterator](){return function*(){for(let e=0;e<this.i;++e)yield this.getElementByPos(e)}.bind(this)()}};e.default=o}),Er=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=class{constructor(e,t){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=e,this.l=t}L(){let e=this;if(1===e.ee&&e.tt.tt===e)e=e.W;else if(e.U)for(e=e.U;e.W;)e=e.W;else{let t=e.tt;for(;t.U===e;)e=t,t=e.tt;e=t}return e}B(){let e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}{let t=e.tt;for(;t.W===e;)e=t,t=e.tt;return e.W!==t?t:e}}te(){let e=this.tt,t=this.W,r=t.U;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.U=this,this.tt=t,this.W=r,r&&(r.tt=this),t}se(){let e=this.tt,t=this.U,r=t.W;return e.tt===this?e.tt=t:e.U===this?e.U=t:e.W=t,t.tt=e,t.W=this,this.tt=t,this.U=r,r&&(r.tt=this),t}};e.TreeNode=t;e.TreeNodeEnableIndex=class extends t{constructor(){super(...arguments),this.rt=1}te(){let e=super.te();return this.ie(),e.ie(),e}se(){let e=super.se();return this.ie(),e.ie(),e}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}}}),Ar=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Er(),r=pr(),n=mr(),i=class extends r.Container{constructor(e=function(e,t){return e<t?-1:e>t?1:0},r=!1){super(),this.Y=void 0,this.v=e,r?(this.re=t.TreeNodeEnableIndex,this.M=function(e,t,r){let n=this.ne(e,t,r);if(n){let e=n.tt;for(;e!==this.h;)e.rt+=1,e=e.tt;let t=this.he(n);if(t){let{parentNode:e,grandParent:r,curNode:n}=t;e.ie(),r.ie(),n.ie()}}return this.i},this.V=function(e){let t=this.fe(e);for(;t!==this.h;)t.rt-=1,t=t.tt}):(this.re=t.TreeNode,this.M=function(e,t,r){let n=this.ne(e,t,r);return n&&this.he(n),this.i},this.V=this.fe),this.h=new this.re}X(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)e=e.W;else{if(!(n>0))return e;r=e,e=e.U}}return r}Z(e,t){let r=this.h;for(;e;)this.v(e.u,t)<=0?e=e.W:(r=e,e=e.U);return r}$(e,t){let r=this.h;for(;e;){let n=this.v(e.u,t);if(n<0)r=e,e=e.W;else{if(!(n>0))return e;e=e.U}}return r}rr(e,t){let r=this.h;for(;e;)this.v(e.u,t)<0?(r=e,e=e.W):e=e.U;return r}ue(e){for(;;){let t=e.tt;if(t===this.h)return;if(1===e.ee)return void(e.ee=0);if(e===t.U){let r=t.W;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.te():t.te();else{if(r.W&&1===r.W.ee)return r.ee=t.ee,t.ee=0,r.W.ee=0,void(t===this.Y?this.Y=t.te():t.te());r.U&&1===r.U.ee?(r.ee=1,r.U.ee=0,r.se()):(r.ee=1,e=t)}}else{let r=t.U;if(1===r.ee)r.ee=0,t.ee=1,t===this.Y?this.Y=t.se():t.se();else{if(r.U&&1===r.U.ee)return r.ee=t.ee,t.ee=0,r.U.ee=0,void(t===this.Y?this.Y=t.se():t.se());r.W&&1===r.W.ee?(r.ee=1,r.W.ee=0,r.te()):(r.ee=1,e=t)}}}}fe(e){if(1===this.i)return this.clear(),this.h;let t=e;for(;t.U||t.W;){if(t.W)for(t=t.W;t.U;)t=t.U;else t=t.U;[e.u,t.u]=[t.u,e.u],[e.l,t.l]=[t.l,e.l],e=t}this.h.U===t?this.h.U=t.tt:this.h.W===t&&(this.h.W=t.tt),this.ue(t);let r=t.tt;return t===r.U?r.U=void 0:r.W=void 0,this.i-=1,this.Y.ee=0,r}oe(e,t){return void 0!==e&&(!(!this.oe(e.U,t)&&!t(e))||this.oe(e.W,t))}he(e){for(;;){let t=e.tt;if(0===t.ee)return;let r=t.tt;if(t===r.U){let n=r.W;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.W){if(e.ee=0,e.U&&(e.U.tt=t),e.W&&(e.W.tt=r),t.W=e.U,r.U=e.W,e.U=t,e.W=r,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.se():r.se(),r.ee=1}else{let n=r.U;if(n&&1===n.ee){if(n.ee=t.ee=0,r===this.Y)return;r.ee=1,e=r;continue}if(e===t.U){if(e.ee=0,e.U&&(e.U.tt=r),e.W&&(e.W.tt=t),r.W=e.U,t.U=e.W,e.U=r,e.W=t,r===this.Y)this.Y=e,this.h.tt=e;else{let t=r.tt;t.U===r?t.U=e:t.W=e}return e.tt=r.tt,t.tt=e,r.tt=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e}}t.ee=0,r===this.Y?this.Y=r.te():r.te(),r.ee=1}return}}ne(e,t,r){if(void 0===this.Y)return this.i+=1,this.Y=new this.re(e,t),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,void(this.h.W=this.Y);let n,i=this.h.U,o=this.v(i.u,e);if(0!==o){if(o>0)i.U=new this.re(e,t),i.U.tt=i,n=i.U,this.h.U=n;else{let i=this.h.W,o=this.v(i.u,e);if(0===o)return void(i.l=t);if(o<0)i.W=new this.re(e,t),i.W.tt=i,n=i.W,this.h.W=n;else{if(void 0!==r){let i=r.o;if(i!==this.h){let r=this.v(i.u,e);if(0===r)return void(i.l=t);if(r>0){let r=i.L(),o=this.v(r.u,e);if(0===o)return void(r.l=t);o<0&&(n=new this.re(e,t),void 0===r.W?(r.W=n,n.tt=r):(i.U=n,n.tt=i))}}}if(void 0===n)for(n=this.Y;;){let r=this.v(n.u,e);if(r>0){if(void 0===n.U){n.U=new this.re(e,t),n.U.tt=n,n=n.U;break}n=n.U}else{if(!(r<0))return void(n.l=t);if(void 0===n.W){n.W=new this.re(e,t),n.W.tt=n,n=n.W;break}n=n.W}}}}return this.i+=1,n}i.l=t}I(e,t){for(;e;){let r=this.v(e.u,t);if(r<0)e=e.W;else{if(!(r>0))return e;e=e.U}}return e||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(e,t){let r=e.o;if(r===this.h&&(0,n.throwIteratorAccessError)(),1===this.i)return r.u=t,!0;if(r===this.h.U)return this.v(r.B().u,t)>0&&(r.u=t,!0);if(r===this.h.W)return this.v(r.L().u,t)<0&&(r.u=t,!0);let i=r.L().u;if(this.v(i,t)>=0)return!1;let o=r.B().u;return!(this.v(o,t)<=0)&&(r.u=t,!0)}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=0,r=this;return this.oe(this.Y,function(n){return e===t?(r.V(n),!0):(t+=1,!1)}),this.i}eraseElementByKey(e){if(0===this.i)return!1;let t=this.I(this.Y,e);return t!==this.h&&(this.V(t),!0)}eraseElementByIterator(e){let t=e.o;t===this.h&&(0,n.throwIteratorAccessError)();let r=void 0===t.W;return 0===e.iteratorType?r&&e.next():(!r||void 0===t.U)&&e.next(),this.V(t),e}forEach(e){let t=0;for(let r of this)e(r,t++,this)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t,r=0;for(let n of this){if(r===e){t=n;break}r+=1}return t}getHeight(){if(0===this.i)return 0;let e=function(t){return t?Math.max(e(t.U),e(t.W))+1:0};return e(this.Y)}};e.default=i}),Ir=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=pr(),r=mr(),n=class extends t.ContainerIterator{constructor(e,t,n){super(n),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let e=this.o,t=this.h.tt;if(e===this.h)return t?t.rt-1:0;let r=0;for(e.U&&(r+=e.U.rt);e!==t;){let t=e.tt;e===t.W&&(r+=1,t.U&&(r+=t.U.rt)),e=t}return r}};e.default=n}),kr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(Ar()),r=i(Ir()),n=mr();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,n.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach(function(e){n.insert(e)})}*K(e){void 0!==e&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,t){return this.M(e,void 0,t)}find(e){let t=this.I(this.Y,e);return new o(t,this.h,this)}lowerBound(e){let t=this.X(this.Y,e);return new o(t,this.h,this)}upperBound(e){let t=this.Z(this.Y,e);return new o(t,this.h,this)}reverseLowerBound(e){let t=this.$(this.Y,e);return new o(t,this.h,this)}reverseUpperBound(e){let t=this.rr(this.Y,e);return new o(t,this.h,this)}union(e){let t=this;return e.forEach(function(e){t.insert(e)}),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s}),Or=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=i(Ar()),r=i(Ir()),n=mr();function i(e){return e&&e.t?e:{default:e}}var o=class e extends r.default{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){this.o===this.h&&(0,n.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends t.default{constructor(e=[],t,r){super(t,r);let n=this;e.forEach(function(e){n.setElement(e[0],e[1])})}*K(e){void 0!==e&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0===this.i)return;let e=this.h.U;return[e.u,e.l]}back(){if(0===this.i)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let t=this.X(this.Y,e);return new o(t,this.h,this)}upperBound(e){let t=this.Z(this.Y,e);return new o(t,this.h,this)}reverseLowerBound(e){let t=this.$(this.Y,e);return new o(t,this.h,this)}reverseUpperBound(e){let t=this.rr(this.Y,e);return new o(t,this.h,this)}setElement(e,t,r){return this.M(e,t,r)}find(e){let t=this.I(this.Y,e);return new o(t,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let t=this;return e.forEach(function(e){t.setElement(e[0],e[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}};e.default=s}),xr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=function(e){let t=typeof e;return"object"===t&&null!==e||"function"===t}}),Pr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t,r=pr(),n=(t=xr())&&t.t?t:{default:t},i=mr();var o=class extends r.ContainerIterator{constructor(e,t,r){super(r),this.o=e,this.h=t,0===this.iteratorType?(this.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this})}};e.HashContainerIterator=o;var s=class extends r.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:t,B:r}=e;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}M(e,t,r){let i;if(void 0===r&&(r=(0,n.default)(e)),r){let r=e[this.HASH_TAG];if(void 0!==r)return this.H[r].l=t,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),i={u:e,l:t,L:this._,B:this.h},this.H.push(i)}else{let r=this.g[e];if(r)return r.l=t,this.i;i={u:e,l:t,L:this._,B:this.h},this.g[e]=i}return 0===this.i?(this.p=i,this.h.B=i):this._.B=i,this._=i,this.h.L=i,++this.i}I(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0===t?this.h:this.H[t]}return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(t){delete t.u[e]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,t){let r;if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];if(void 0===t)return!1;delete e[this.HASH_TAG],r=this.H[t],delete this.H[t]}else{if(r=this.g[e],void 0===r)return!1;delete this.g[e]}return this.V(r),!0}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),this.V(t),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}};e.HashContainer=s}),Tr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=Pr(),r=mr(),n=class e extends t.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},i=class extends t.HashContainer{constructor(e=[]){super();let t=this;e.forEach(function(e){t.insert(e)})}begin(){return new n(this.p,this.h,this)}end(){return new n(this.h,this.h,this)}rBegin(){return new n(this._,this.h,this,1)}rEnd(){return new n(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(e,t){return this.M(e,void 0,t)}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return t.u}find(e,t){let r=this.I(e,t);return new n(r,this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e(r.u,t++,this),r=r.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield e.u,e=e.B}.bind(this)()}};e.default=i}),Rr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=Pr(),n=(t=xr())&&t.t?t:{default:t},i=mr();var o=class e extends r.HashContainerIterator{constructor(e,t,r,n){super(e,t,n),this.container=r}get pointer(){this.o===this.h&&(0,i.throwIteratorAccessError)();let e=this;return new Proxy([],{get:(t,r)=>"0"===r?e.o.u:"1"===r?e.o.l:void 0,set(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}copy(){return new e(this.o,this.h,this.container,this.iteratorType)}},s=class extends r.HashContainer{constructor(e=[]){super();let t=this;e.forEach(function(e){t.setElement(e[0],e[1])})}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(0!==this.i)return[this.p.u,this.p.l]}back(){if(0!==this.i)return[this._.u,this._.l]}setElement(e,t,r){return this.M(e,t,r)}getElementByKey(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){let t=e[this.HASH_TAG];return void 0!==t?this.H[t].l:void 0}let r=this.g[e];return r?r.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return[t.u,t.l]}find(e,t){let r=this.I(e,t);return new o(r,this.h,this)}forEach(e){let t=0,r=this.p;for(;r!==this.h;)e([r.u,r.l],t++,this),r=r.B}[Symbol.iterator](){return function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}.bind(this)()}};e.default=s}),Cr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"t",{value:!0}),Object.defineProperty(e,"Deque",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(e,"HashMap",{enumerable:!0,get:function(){return h.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return i.default}});var t=f(dr()),r=f(gr()),n=f(yr()),i=f(vr()),o=f(_r()),s=f(Sr()),a=f(kr()),u=f(Or()),c=f(Tr()),h=f(Rr());function f(e){return e&&e.t?e:{default:e}}}),jr=o((e,t)=>{l(),tt(),Fe();var r=Cr().OrderedSet,n=Yt()("number-allocator:trace"),i=Yt()("number-allocator:error");function o(e,t){this.low=e,this.high=t}function s(e,t){if(!(this instanceof s))return new s(e,t);this.min=e,this.max=t,this.ss=new r([],(e,t)=>e.compare(t)),n("Create"),this.clear()}o.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},o.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},s.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},s.prototype.alloc=function(){if(0===this.ss.size())return n("alloc():empty"),null;let e=this.ss.begin(),t=e.pointer.low,r=e.pointer.high,i=t;return i+1<=r?this.ss.updateKeyByIterator(e,new o(t+1,r)):this.ss.eraseElementByPos(0),n("alloc():"+i),i},s.prototype.use=function(e){let t=new o(e,e),r=this.ss.lowerBound(t);if(!r.equals(this.ss.end())){let i=r.pointer.low,s=r.pointer.high;return r.pointer.equals(t)?(this.ss.eraseElementByIterator(r),n("use():"+e),!0):!(i>e)&&(i===e?(this.ss.updateKeyByIterator(r,new o(i+1,s)),n("use():"+e),!0):s===e?(this.ss.updateKeyByIterator(r,new o(i,s-1)),n("use():"+e),!0):(this.ss.updateKeyByIterator(r,new o(e+1,s)),this.ss.insert(new o(i,e-1)),n("use():"+e),!0))}return n("use():failed"),!1},s.prototype.free=function(e){if(e<this.min||e>this.max)return void i("free():"+e+" is out of range");let t=new o(e,e),r=this.ss.upperBound(t);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin()))return void this.ss.insert(t);r.pre();let n=r.pointer.high;r.pointer.high+1===e?this.ss.updateKeyByIterator(r,new o(n,e)):this.ss.insert(t)}else if(r.equals(this.ss.begin()))if(e+1===r.pointer.low){let t=r.pointer.high;this.ss.updateKeyByIterator(r,new o(e,t))}else this.ss.insert(t);else{let n=r.pointer.low,i=r.pointer.high;r.pre();let s=r.pointer.low;r.pointer.high+1===e?e+1===n?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new o(s,i))):this.ss.updateKeyByIterator(r,new o(s,e)):e+1===n?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new o(e,i))):this.ss.insert(t)}n("free():"+e)},s.prototype.clear=function(){n("clear()"),this.ss.clear(),this.ss.insert(new o(this.min,this.max))},s.prototype.intervalCount=function(){return this.ss.size()},s.prototype.dump=function(){console.log("length:"+this.ss.size());for(let e of this.ss)console.log(e)},t.exports=s}),Mr=o((e,t)=>{l(),tt(),Fe();var r=jr();t.exports.NumberAllocator=r}),Br=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});var t=fr(),r=Mr();e.default=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new t.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let t=this.topicToAlias[e];return typeof t<"u"&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}}),Nr=o(e=>{l(),tt(),Fe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=cr(),n=t(Br()),i=ur();e.default=(e,t)=>{e.log("_handleConnack");let{options:o}=e,s=5===o.protocolVersion?t.reasonCode:t.returnCode;if(clearTimeout(e.connackTimer),delete e.topicAliasSend,t.properties){if(t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new n.default(t.properties.topicAliasMaximum))}t.properties.serverKeepAlive&&o.keepalive&&(o.keepalive=t.properties.serverKeepAlive),t.properties.maximumPacketSize&&(o.properties||(o.properties={}),o.properties.maximumPacketSize=t.properties.maximumPacketSize)}if(0===s)e.reconnecting=!1,e._onConnect(t);else if(s>0){let t=new i.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[s]}`,s);e.emit("error",t),e.options.reconnectOnConnackError&&e._cleanUp(!0)}}}),Ur=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});e.default=(e,t,r)=>{e.log("handling pubrel packet");let n=typeof r<"u"?r:e.noop,{messageId:i}=t,o={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,(t,r)=>{t?e._sendPacket(o,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._sendPacket(o,n)}))})}}),Lr=o(e=>{l(),tt(),Fe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(ar()),n=t(hr()),i=t(Nr()),o=t(cr()),s=t(Ur());e.default=(e,t,a)=>{let{options:l}=e;if(5===l.protocolVersion&&l.properties&&l.properties.maximumPacketSize&&l.properties.maximumPacketSize<t.length)return e.emit("error",new Error(`exceeding packets size ${t.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,r.default)(e,t,a);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,o.default)(e,t),a();break;case"pubrel":e.reschedulePing(),(0,s.default)(e,t,a);break;case"connack":(0,i.default)(e,t),a();break;case"auth":e.reschedulePing(),(0,n.default)(e,t),a();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),a();break;case"disconnect":e.emit("disconnect",t),a();break;default:e.log("_handlePacket :: unknown command"),a()}}}),Dr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});e.default=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){let e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}}),Fr=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});e.default=class{aliasToTopic;max;length;constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max)&&(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}}),Wr=o(e=>{l(),tt(),Fe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.TypedEventEmitter=void 0;var r=t((bt(),a(st))),n=ur(),i=class{};e.TypedEventEmitter=i,(0,n.applyMixin)(i,r.default)}),qr=o((e,t)=>{function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}l(),tt(),Fe(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),$r=o((e,t)=>{l(),tt(),Fe();var r=qr().default;t.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=r(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},t.exports.__esModule=!0,t.exports.default=t.exports}),Hr=o((e,t)=>{l(),tt(),Fe();var r=qr().default,n=$r();t.exports=function(e){var t=n(e,"string");return"symbol"==r(t)?t:t+""},t.exports.__esModule=!0,t.exports.default=t.exports}),Vr=o((e,t)=>{l(),tt(),Fe();var r=Hr();t.exports=function(e,t,n){return(t=r(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},t.exports.__esModule=!0,t.exports.default=t.exports}),zr=o((e,t)=>{l(),tt(),Fe(),t.exports=function(e){if(Array.isArray(e))return e},t.exports.__esModule=!0,t.exports.default=t.exports}),Kr=o((e,t)=>{l(),tt(),Fe(),t.exports=function(e,t){var r=null==e?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}},t.exports.__esModule=!0,t.exports.default=t.exports}),Gr=o((e,t)=>{l(),tt(),Fe(),t.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports}),Qr=o((e,t)=>{l(),tt(),Fe();var r=Gr();t.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports}),Yr=o((e,t)=>{l(),tt(),Fe(),t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports}),Jr=o((e,t)=>{l(),tt(),Fe();var r=zr(),n=Kr(),i=Qr(),o=Yr();t.exports=function(e,t){return r(e)||n(e,t)||i(e,t)||o()},t.exports.__esModule=!0,t.exports.default=t.exports}),Xr=o((e,t)=>{var r,n;l(),tt(),Fe(),r=e,n=function(e){var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,i=2*n,o=new WeakMap,s=function(e,t){return function(o){var s=t.get(o),a=void 0===s?o.size:s<i?s+1:0;if(!o.has(a))return e(o,a);if(o.size<n){for(;o.has(a);)a=Math.floor(Math.random()*i);return e(o,a)}if(o.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;o.has(a);)a=Math.floor(Math.random()*r);return e(o,a)}}((t=o,function(e,r){return t.set(e,r),r}),o),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(s);e.addUniqueNumber=a,e.generateUniqueNumber=s},"object"==typeof e&&typeof t<"u"?n(e):"function"==typeof define&&define.amd?define(["exports"],n):n((r=typeof globalThis<"u"?globalThis:r||self).fastUniqueNumbers={})}),Zr=o((e,t)=>{function r(e,t,r,n,i,o,s){try{var a=e[o](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,i)}l(),tt(),Fe(),t.exports=function(e){return function(){var t=this,n=arguments;return new Promise(function(i,o){var s=e.apply(t,n);function a(e){r(s,i,o,a,l,"next",e)}function l(e){r(s,i,o,a,l,"throw",e)}a(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports}),en=o((e,t)=>{l(),tt(),Fe(),t.exports=function(e,t){this.v=e,this.k=t},t.exports.__esModule=!0,t.exports.default=t.exports}),tn=o((e,t)=>{function r(e,n,i,o){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}t.exports=r=function(e,t,n,i){function o(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!i,configurable:!i,writable:!i}):e[t]=n:(o("next",0),o("throw",1),o("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,n,i,o)}l(),tt(),Fe(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),rn=o((e,t)=>{l(),tt(),Fe();var r=tn();function n(){var e,i,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.toStringTag||"@@toStringTag";function l(t,n,o,s){var a=n&&n.prototype instanceof c?n:c,l=Object.create(a.prototype);return r(l,"_invoke",function(t,r,n){var o,s,a,l=0,c=n||[],h=!1,f={p:0,n:0,v:e,a:p,f:p.bind(e,4),d:function(t,r){return o=t,s=0,a=e,f.n=r,u}};function p(t,r){for(s=t,a=r,i=0;!h&&l&&!n&&i<c.length;i++){var n,o=c[i],p=f.p,d=o[2];t>3?(n=d===r)&&(a=o[(s=o[4])?5:(s=3,3)],o[4]=o[5]=e):o[0]<=p&&((n=t<2&&p<o[1])?(s=0,f.v=r,f.n=o[1]):p<d&&(n=t<3||o[0]>r||r>d)&&(o[4]=t,o[5]=r,f.n=d,s=0))}if(n||t>1)return u;throw h=!0,r}return function(n,c,d){if(l>1)throw TypeError("Generator is already running");for(h&&1===c&&p(c,d),s=c,a=d;(i=s<2?e:a)||!h;){o||(s?s<3?(s>1&&(f.n=-1),p(s,a)):f.n=a:f.v=a);try{if(l=2,o){if(s||(n="next"),i=o[n]){if(!(i=i.call(o,a)))throw TypeError("iterator result is not an object");if(!i.done)return i;a=i.value,s<2&&(s=0)}else 1===s&&(i=o.return)&&i.call(o),s<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),s=1);o=e}else if((i=(h=f.n<0)?a:t.call(r,f))!==u)break}catch(t){o=e,s=1,a=t}finally{l=1}}return{value:i,done:h}}}(t,o,s),!0),l}var u={};function c(){}function h(){}function f(){}i=Object.getPrototypeOf;var p=[][s]?i(i([][s]())):(r(i={},s,function(){return this}),i),d=f.prototype=c.prototype=Object.create(p);function g(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,r(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return h.prototype=f,r(d,"constructor",f),r(f,"constructor",h),h.displayName="GeneratorFunction",r(f,a,"GeneratorFunction"),r(d),r(d,a,"Generator"),r(d,s,function(){return this}),r(d,"toString",function(){return"[object Generator]"}),(t.exports=n=function(){return{w:l,m:g}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),nn=o((e,t)=>{l(),tt(),Fe();var r=en(),n=tn();t.exports=function e(t,i){function o(e,n,s,a){try{var l=t[e](n),u=l.value;return u instanceof r?i.resolve(u.v).then(function(e){o("next",e,s,a)},function(e){o("throw",e,s,a)}):i.resolve(u).then(function(e){l.value=e,s(l)},function(e){return o("throw",e,s,a)})}catch(e){a(e)}}var s;this.next||(n(e.prototype),n(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(e,t,r){function n(){return new i(function(t,n){o(e,r,t,n)})}return s=s?s.then(n,n):n()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports}),on=o((e,t)=>{l(),tt(),Fe();var r=rn(),n=nn();t.exports=function(e,t,i,o,s){return new n(r().w(e,t,i,o),s||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports}),sn=o((e,t)=>{l(),tt(),Fe();var r=on();t.exports=function(e,t,n,i,o){var s=r(e,t,n,i,o);return s.next().then(function(e){return e.done?e.value:s.next()})},t.exports.__esModule=!0,t.exports.default=t.exports}),an=o((e,t)=>{l(),tt(),Fe(),t.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},t.exports.__esModule=!0,t.exports.default=t.exports}),ln=o((e,t)=>{l(),tt(),Fe();var r=qr().default;t.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],n=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}throw new TypeError(r(e)+" is not iterable")},t.exports.__esModule=!0,t.exports.default=t.exports}),un=o((e,t)=>{l(),tt(),Fe();var r=en(),n=rn(),i=sn(),o=on(),s=nn(),a=an(),u=ln();function c(){var e=n(),l=e.m(c),h=(Object.getPrototypeOf?Object.getPrototypeOf(l):l.__proto__).constructor;function f(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))}var p={throw:1,return:2,break:3,continue:3};function d(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,p[e],t)},delegateYield:function(e,i,o){return t.resultName=i,r(n.d,u(e),o)},finish:function(e){return r(n.f,e)}},r=function(e,r,i){n.p=t.prev,n.n=t.next;try{return e(r,i)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(t.exports=c=function(){return{wrap:function(t,r,n,i){return e.w(d(t),r,n,i&&i.reverse())},isGeneratorFunction:f,mark:e.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,r,n,s){return(f(t)?o:i)(d(e),t,r,n,s)},keys:a,values:u}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}),cn=o((e,t)=>{l(),tt(),Fe();var r=un()();t.exports=r;try{regeneratorRuntime=r}catch{"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),hn=o((e,t)=>{var r,n;l(),tt(),Fe(),r=e,n=function(e,t,r,n,i,o){var s=new WeakMap;function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?a(Object(n),!0).forEach(function(r){t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):a(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{};r%2?u(Object(n),!0).forEach(function(r){t(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):u(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var h=new WeakMap;e.createBroker=function(e){var a=function(e){return l(l({},e),{},{connect:function(e){var t=e.call;return i(o.mark(function e(){var r,n,i,a;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=new MessageChannel,n=r.port1,i=r.port2,e.next=1,t("connect",{port:n},[n]);case 1:return a=e.sent,s.set(i,a),e.abrupt("return",i);case 2:case"end":return e.stop()}},e)}))},disconnect:function(e){var t,r=e.call;return t=i(o.mark(function e(t){var n;return o.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(n=s.get(t))){e.next=1;break}throw new Error("The given port is not connected.");case 1:return e.next=2,r("disconnect",{portId:n});case 2:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)}},isSupported:function(e){var t=e.call;return function(){return t("isSupported")}}})}(e);return function(e){var i=function(e){if(h.has(e))return h.get(e);var t=new Map;return h.set(e,t),t}(e);e.addEventListener("message",function(e){var t=e.data,r=t.id;if(null!==r&&i.has(r)){var n=i.get(r),o=n.reject,s=n.resolve;i.delete(r),void 0===t.error?s(t.result):o(new Error(t.error.message))}}),function(e){return"function"==typeof e.start}(e)&&e.start();for(var o=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return new Promise(function(s,a){var l=n.generateUniqueNumber(i);i.set(l,{reject:a,resolve:s}),null===r?e.postMessage({id:l,method:t},o):e.postMessage({id:l,method:t,params:r},o)})},s=function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];e.postMessage({id:null,method:t,params:r},n)},l={},u=0,f=Object.entries(a);u<f.length;u++){var p=r(f[u],2),d=p[0],g=p[1];l=c(c({},l),{},t({},d,g({call:o,notify:s})))}return c({},l)}}},"object"==typeof e&&typeof t<"u"?n(e,Vr(),Jr(),Xr(),Zr(),cn()):"function"==typeof define&&define.amd?define(["exports","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","fast-unique-numbers","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],n):n((r=typeof globalThis<"u"?globalThis:r||self).brokerFactory={},r._defineProperty,r._slicedToArray,r.fastUniqueNumbers,r._asyncToGenerator,r._regeneratorRuntime)}),fn=o((e,t)=>{var r,n;l(),tt(),Fe(),r=e,n=function(e,t,r,n){var i=new Map([[0,null]]),o=new Map([[0,null]]),s=r.createBroker({clearInterval:function(e){var r=e.call;return function(e){"symbol"===t(i.get(e))&&(i.set(e,null),r("clear",{timerId:e,timerType:"interval"}).then(function(){i.delete(e)}))}},clearTimeout:function(e){var r=e.call;return function(e){"symbol"===t(o.get(e))&&(o.set(e,null),r("clear",{timerId:e,timerType:"timeout"}).then(function(){o.delete(e)}))}},setInterval:function(e){var t=e.call;return function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=arguments.length,s=new Array(o>2?o-2:0),a=2;a<o;a++)s[a-2]=arguments[a];var l=Symbol(),u=n.generateUniqueNumber(i);i.set(u,l);var c=function(){return t("set",{delay:r,now:performance.timeOrigin+performance.now(),timerId:u,timerType:"interval"}).then(function(){var t=i.get(u);if(void 0===t)throw new Error("The timer is in an undefined state.");t===l&&(e.apply(void 0,s),i.get(u)===l&&c())})};return c(),u}},setTimeout:function(e){var t=e.call;return function(e){for(var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length,s=new Array(i>2?i-2:0),a=2;a<i;a++)s[a-2]=arguments[a];var l=Symbol(),u=n.generateUniqueNumber(o);return o.set(u,l),t("set",{delay:r,now:performance.timeOrigin+performance.now(),timerId:u,timerType:"timeout"}).then(function(){var t=o.get(u);if(void 0===t)throw new Error("The timer is in an undefined state.");t===l&&(o.delete(u),e.apply(void 0,s))}),u}}});e.load=function(e){var t=new Worker(e);return s(t)},e.wrap=s},"object"==typeof e&&typeof t<"u"?n(e,qr(),hn(),Xr()):"function"==typeof define&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],n):n((r=typeof globalThis<"u"?globalThis:r||self).workerTimersBroker={},r._typeof,r.brokerFactory,r.fastUniqueNumbers)}),pn=o((e,t)=>{var r,n;l(),tt(),Fe(),r=e,n=function(e,t){var r,n,i,o=(r=t.load,n='(()=>{var e={45:(e,t,r)=>{var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},293:e=>{function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},472:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise((function(t){e.set(a,[r(n,s,i,e,t,a),t])}))}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark((function e(r){var n,o,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark((function e(r){var n,o,u,a,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},546:e=>{function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){if(r)a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n;else{var u=function(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))};u("next",0),u("throw",1),u("return",2)}},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},623:function(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a(\'The requested method called "\'.concat(e,\'" is not supported.\'),u.METHOD_NOT_FOUND)},s=function(e){return a(\'The handler of the method called "\'.concat(e,\'" returned no required result.\'),u.INTERNAL_ERROR)},c=function(e){return a(\'The handler of the method called "\'.concat(e,\'" returned an unexpected result.\'),u.INTERNAL_ERROR)},f=function(e){return a(\'The specified parameter called "portId" with the given value "\'.concat(e,\'" does not identify a port connected to this worker.\'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark((function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])}))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,(function(){u(),r.close(),x.delete(a)})),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark((function e(){var t,n,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},633:(e,t,r)=>{var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,r)=>{var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then((function(e){u("next",e,a,i)}),(function(e){u("throw",e,a,i)})):r.resolve(c).then((function(e){s.value=e,a(s)}),(function(e){return u("throw",e,a,i)}))}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(e,t,n){function o(){return new r((function(t,r){u(e,n,t,r)}))}return a=a?a.then(o,o):o()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then((function(e){return e.done?e.value:a.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a \'"+o+"\' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();',i=null,function(){if(null!==i)return i;var e=new Blob([n],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return i=r(t),setTimeout(function(){return URL.revokeObjectURL(t)}),i});e.clearInterval=function(e){return o().clearInterval(e)},e.clearTimeout=function(e){return o().clearTimeout(e)},e.setInterval=function(){var e;return(e=o()).setInterval.apply(e,arguments)},e.setTimeout=function(){var e;return(e=o()).setTimeout.apply(e,arguments)}},"object"==typeof e&&typeof t<"u"?n(e,fn()):"function"==typeof define&&define.amd?define(["exports","worker-timers-broker"],n):n((r=typeof globalThis<"u"?globalThis:r||self).workerTimers={},r.workerTimersBroker)}),dn=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t=()=>!!("object"==typeof self&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),r=()=>typeof navigator<"u"&&"ReactNative"===navigator.product,n=typeof window<"u"&&(typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&u?.versions?!Object.prototype.hasOwnProperty.call(u.versions,"electron"):typeof window.document<"u")||t()||r();e.isWebWorker=t(),e.isReactNativeBrowser=r(),e.default=n}),gn=o(e=>{l(),tt(),Fe();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i});Object.defineProperty(e,"__esModule",{value:!0});var o=pn(),s=i(dn()),a={set:o.setInterval,clear:o.clearInterval},u={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};e.default=e=>{switch(e){case"native":return u;case"worker":return a;default:return!s.default||s.isWebWorker||s.isReactNativeBrowser?u:a}}}),yn=o(e=>{l(),tt(),Fe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(gn());e.default=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,t){this.client=e,this.timer="object"==typeof t&&"set"in t&&"clear"in t?t:(0,r.default)(t),this.setKeepalive(e.options.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let e=Math.ceil(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,2===this.counter?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}}}),bn=o(e=>{l(),tt(),Fe();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var s=o(rr()),a=qt(),u=o(ir()),c=o(Yt()),h=i(or()),f=o(sr()),p=o(Lr()),d=o(Dr()),g=o(Fr()),y=ur(),b=Wr(),m=o(yn()),w=i(dn()),v=globalThis.setImmediate||((...e)=>{let t=e.shift();(0,y.nextTick)(()=>{t(...e)})}),_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},S=class e extends b.TypedEventEmitter{static VERSION=y.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_deferredReconnect;connackPacket;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(t,r){super(),this.options=r||{};for(let e in _)typeof this.options[e]>"u"?this.options[e]=_[e]:this.options[e]=r[e];this.log=this.options.log||(0,c.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",e.VERSION),w.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",w.default?"browser":"node"),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof r.clientId?r.clientId:e.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===r.protocolVersion&&r.customHandleAcks?r.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),this.streamBuilder=t,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new d.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new f.default,this.incomingStore=r.incomingStore||new f.default,this.queueQoSZero=void 0===r.queueQoSZero||r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new g.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:e}=this,t=()=>{let r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,e=>{r.cb&&r.cb(e),t()}):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){let e=new a.Writable,t=s.default.parser(this.options),r=null,n=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new f.default,this.outgoingStore=this.options.outgoingStore||new f.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),t.on("packet",e=>{this.log("parser :: on packet push to packets array."),n.push(e)});let i=()=>{this.log("work :: getting next packet in queue");let e=n.shift();if(e)this.log("work :: packet pulled from queue"),(0,p.default)(this,e,o);else{this.log("work :: no packets in queue");let e=r;r=null,this.log("work :: done flag is %s",!!e),e&&e()}},o=()=>{if(n.length)(0,y.nextTick)(i);else{let e=r;r=null,e()}};e._write=(e,n,o)=>{r=o,this.log("writable stream :: parsing buffer"),t.parse(e),i()};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",e=>{this.log("streamErrorHandler :: error",e.message),e.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)}),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let l={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(l.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(l.properties||(l.properties={}),this.topicAliasRecv&&(l.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(l),t.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){let e={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);let{options:i}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r={qos:0,retain:!1,dup:!1,...r};let{qos:o,retain:s,dup:a,properties:l,cbStorePut:u}=r;if(this._checkDisconnecting(n))return this;let c=()=>{let r=0;if((1===o||2===o)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;let c={cmd:"publish",topic:e,payload:t,qos:o,retain:s,messageId:r,dup:a};switch(5===i.protocolVersion&&(c.properties=l),this.log("publish :: qos",o),o){case 1:case 2:this.outgoing[c.messageId]={volatile:!1,cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,void 0,u);break;default:this.log("MqttClient:publish: packet cmd: %s",c.cmd),this._sendPacket(c,n,u)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!c())&&this._storeProcessingQueue.push({invoke:c,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise((n,i)=>{this.publish(e,t,r,(e,t)=>{e?i(e):n(t)})})}subscribe(e,t,r){let n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,o=[];"string"==typeof e?o=e=[e]:Array.isArray(e)?o=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,o=Object.keys(e));let s=h.validateTopics(o);if(null!==s)return v(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;let a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0),t={...a,...t};let{properties:l}=t,u=[],c=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){let t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),u.push(t)}};if(Array.isArray(e)?e.forEach(e=>{this.log("subscribe: array topic %s",e),c(e)}):Object.keys(e).forEach(t=>{this.log("subscribe: object topic %s, %o",t,e[t]),c(t,e[t])}),!u.length)return r(null,[]),this;let f=(e,t)=>{let r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");let t=[];e.forEach(e=>{if(this.options.reconnectPeriod>0){let r={qos:e.qos};5===n&&(r.nl=e.nl||!1,r.rap=e.rap||!1,r.rh=e.rh||0,r.properties=e.properties),this._resubscribeTopics[e.topic]=r,t.push(e.topic)}}),this.messageIdToTopic[r.messageId]=t}let i=new Promise((t,n)=>{this.outgoing[r.messageId]={volatile:!0,cb(r,i){if(!r){let{granted:t}=i;for(let r=0;r<t.length;r+=1)e[r].qos=t[r]}r?n(new y.ErrorWithSubackPacket(r.message,i)):t(i)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(r),i},p=()=>{let e=this.options.subscribeBatchSize??u.length,t=[];for(let r=0;r<u.length;r+=e){let n=u.slice(r,r+e),i=this._nextId();if(null===i)return this.log("No messageId left"),!1;t.push(f(n,i))}return Promise.all(t).then(e=>{r(null,u,e.at(-1))}).catch(e=>{r(e,u,e.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!p())&&this._storeProcessingQueue.push({invoke:p,callback:r}),this}subscribeAsync(e,t){return new Promise((r,n)=>{this.subscribe(e,t,(e,t)=>{e?n(e):r(t)})})}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;let n=h.validateTopics(e);if(null!==n)return v(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;let i=()=>{let n=this._nextId();if(null===n)return this.log("No messageId left"),!1;let i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach(e=>{delete this._resubscribeTopics[e]}),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise((r,n)=>{this.unsubscribe(e,t,(e,t)=>{e?n(e):r(t)})})}end(e,t,r){this.log("end :: (%s)",this.options.clientId),(null==e||"boolean"!=typeof e)&&(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),(!r||"function"!=typeof r)&&(r=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(e=>{this.outgoingStore.close(t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){let n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}})}),this._deferredReconnect?this._deferredReconnect():(0===this.options.reconnectPeriod||this.options.manualConnect)&&(this.disconnecting=!1)},i=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,y.nextTick)(n)},t)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i()),this)}endAsync(e,t){return new Promise((r,n)=>{this.end(e,t,e=>{e?n(e):r()})})}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{t(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");let t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new f.default,this.outgoingStore=this.options.outgoingStore||new f.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(typeof t>"u")return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),typeof r>"u")return new Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let e={cmd:"disconnect",...r};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),v(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,i=e;if("publish"===i.cmd&&(i=(0,u.default)(e),n=this._removeTopicAliasAndRecoverTopicName(i),n))return t&&t(n);this.outgoingStore.put(i,n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)})}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");let r=s.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;let i=this._applyTopicAlias(e);if(i)t(i);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,u.default)(e);let r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}let i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,e=>{if(e)return t&&t(e);r()})):t&&t(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new m.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(e=!1){this.keepaliveManager&&this.options.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){let r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let t=()=>{let r=this.outgoingStore.createStream(),n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)});let o=()=>{if(!r)return;let e,t=r.read(1);t?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[t.messageId]?o():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(e=this.outgoing[t.messageId]?this.outgoing[t.messageId].cb:null,this.outgoing[t.messageId]={volatile:!1,cb(t,r){e&&e(t,r),o()}},this._packetIdsDuringStoreProcessing[t.messageId]=!0,this.messageIdProvider.register(t.messageId)?this._sendPacket(t,void 0,void 0,!0):this.log("messageId: %d has already used.",t.messageId))):r.once("readable",o)};r.on("end",()=>{let r=!0;for(let e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(i(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()}),o()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}};e.default=S}),mn=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});var t=Mr();e.default=class{numberAllocator;lastId;constructor(){this.numberAllocator=new t.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e)}clear(){this.numberAllocator.clear()}}});var wn,vn,_n,Sn=i(()=>{l(),tt(),Fe(),wn={},vn=!1,(_n=function(){if(vn)return wn;vn=!0;let e=2147483647,t=36,r=/^xn--/,n=/[^\0-\x7F]/,i=/[\x2E\u3002\uFF0E\uFF61]/g,o={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},s=Math.floor,a=String.fromCharCode;function l(e){throw new RangeError(o[e])}function u(e,t){let r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);let o=function(e,t){let r=[],n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(i,".")).split("."),t).join(".");return n+o}function c(e){let t=[],r=0,n=e.length;for(;r<n;){let i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){let n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&i)<<10)+(1023&n)+65536):(t.push(i),r--)}else t.push(i)}return t}let h=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},f=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},p=function(e,r,n){let i=0;for(e=n?s(e/700):e>>1,e+=s(e/r);e>455;i+=t)e=s(e/35);return s(i+36*e/(e+38))},d=function(r){let n=[],i=r.length,o=0,a=128,u=72,c=r.lastIndexOf("-");c<0&&(c=0);for(let e=0;e<c;++e)r.charCodeAt(e)>=128&&l("not-basic"),n.push(r.charCodeAt(e));for(let f=c>0?c+1:0;f<i;){let c=o;for(let n=1,a=t;;a+=t){f>=i&&l("invalid-input");let c=h(r.charCodeAt(f++));c>=t&&l("invalid-input"),c>s((e-o)/n)&&l("overflow"),o+=c*n;let p=a<=u?1:a>=u+26?26:a-u;if(c<p)break;let d=t-p;n>s(e/d)&&l("overflow"),n*=d}let d=n.length+1;u=p(o-c,d,0==c),s(o/d)>e-a&&l("overflow"),a+=s(o/d),o%=d,n.splice(o++,0,a)}return String.fromCodePoint(...n)},g=function(r){let n=[],i=(r=c(r)).length,o=128,u=0,h=72;for(let e of r)e<128&&n.push(a(e));let d=n.length,g=d;for(d&&n.push("-");g<i;){let i=e;for(let e of r)e>=o&&e<i&&(i=e);let c=g+1;i-o>s((e-u)/c)&&l("overflow"),u+=(i-o)*c,o=i;for(let i of r)if(i<o&&++u>e&&l("overflow"),i===o){let e=u;for(let r=t;;r+=t){let i=r<=h?1:r>=h+26?26:r-h;if(e<i)break;let o=e-i,l=t-i;n.push(a(f(i+o%l,0))),e=s(o/l)}n.push(a(f(e,0))),h=p(u,c,g===d),u=0,++g}++u,++o}return n.join("")};return wn={version:"2.3.1",ucs2:{decode:c,encode:e=>String.fromCodePoint(...e)},decode:d,encode:g,toASCII:function(e){return u(e,function(e){return n.test(e)?"xn--"+g(e):e})},toUnicode:function(e){return u(e,function(e){return r.test(e)?d(e.slice(4).toLowerCase()):e})}}}()).decode,_n.encode,_n.toASCII,_n.toUnicode,_n.ucs2,_n.version});function En(){return $n||($n=!0,qn=SyntaxError),qn}function An(){return Vn||(Vn=!0,Hn=TypeError),Hn}function In(){if(Qn)return Gn;Qn=!0;var e=typeof Symbol<"u"&&Symbol,t=(jn||(jn=!0,Cn=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(e,t);if(42!==i.value||!0!==i.enumerable)return!1}return!0}),Cn);return Gn=function(){return"function"==typeof e&&"function"==typeof Symbol&&"symbol"==typeof e("foo")&&"symbol"==typeof Symbol("bar")&&t()}}function kn(){if(ti)return ei;ti=!0;var e=function(){if(Zn)return Xn;Zn=!0;var e=Object.prototype.toString,t=Math.max,r=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};return Xn=function(n){var i=this;if("function"!=typeof i||"[object Function]"!==e.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,s=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),a=t(0,i.length-s.length),l=[],u=0;u<a;u++)l[u]="$"+u;if(o=Function("binder","return function ("+function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r}(l,",")+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var e=i.apply(this,r(s,arguments));return Object(e)===e?e:this}return i.apply(n,r(s,arguments))}),i.prototype){var c=function(){};c.prototype=i.prototype,o.prototype=new c,c.prototype=null}return o},Xn}();return ei=Function.prototype.bind||e}function On(){if(oi)return ii;oi=!0;var e,t=(Bn||(Bn=!0,Mn=Error),Mn),r=(Un||(Un=!0,Nn=EvalError),Nn),n=(Dn||(Dn=!0,Ln=RangeError),Ln),i=(Wn||(Wn=!0,Fn=ReferenceError),Fn),o=En(),s=An(),a=(Kn||(Kn=!0,zn=URIError),zn),l=Function,u=function(e){try{return l('"use strict"; return ('+e+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var h=function(){throw new s},f=c?function(){try{return h}catch{try{return c(arguments,"callee").get}catch{return h}}}():h,p=In()(),d=function(){if(Jn)return Yn;Jn=!0;var e={__proto__:null,foo:{}},t=Object;return Yn=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)}}()(),g=Object.getPrototypeOf||(d?function(e){return e.__proto__}:null),y={},b=typeof Uint8Array>"u"||!g?e:g(Uint8Array),m={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":p&&g?g([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":y,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":p&&g?g(g([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!p||!g?e:g((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!p||!g?e:g((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":p&&g?g(""[Symbol.iterator]()):e,"%Symbol%":p?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":b,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(g)try{null.error}catch(e){var w=g(g(e));m["%Error.prototype%"]=w}var v=function e(t){var r;if("%AsyncFunction%"===t)r=u("async function () {}");else if("%GeneratorFunction%"===t)r=u("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=u("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&g&&(r=g(i.prototype))}return m[t]=r,r},_={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},S=kn(),E=function(){if(ni)return ri;ni=!0;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=kn();return ri=r.call(e,t)}(),A=S.call(Function.call,Array.prototype.concat),I=S.call(Function.apply,Array.prototype.splice),k=S.call(Function.call,String.prototype.replace),O=S.call(Function.call,String.prototype.slice),x=S.call(Function.call,RegExp.prototype.exec),P=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g,R=function(e,t){var r,n=e;if(E(_,n)&&(n="%"+(r=_[n])[0]+"%"),E(m,n)){var i=m[n];if(i===y&&(i=v(n)),typeof i>"u"&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};return ii=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===x(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=O(e,0,1),r=O(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return k(e,P,function(e,t,r,i){n[n.length]=r?k(i,T,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=R("%"+n+"%",t),a=i.name,l=i.value,u=!1,h=i.alias;h&&(n=h[0],I(r,A([0,1],h)));for(var f=1,p=!0;f<r.length;f+=1){var d=r[f],g=O(d,0,1),y=O(d,-1);if(('"'===g||"'"===g||"`"===g||'"'===y||"'"===y||"`"===y)&&g!==y)throw new o("property names with quotes must have matching quotes");if(("constructor"===d||!p)&&(u=!0),E(m,a="%"+(n+="."+d)+"%"))l=m[a];else if(null!=l){if(!(d in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&f+1>=r.length){var b=c(l,d);l=(p=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:l[d]}else p=E(l,d),l=l[d];p&&!u&&(m[a]=l)}}return l},ii}function xn(){if(ai)return si;ai=!0;var e=On()("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return si=e}function Pn(){if(ui)return li;ui=!0;var e=On()("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return li=e}function Tn(){if(gi)return di;gi=!0;var e=On(),t=function(){if(hi)return ci;hi=!0;var e=xn(),t=En(),r=An(),n=Pn();return ci=function(i,o,s){if(!i||"object"!=typeof i&&"function"!=typeof i)throw new r("`obj` must be an object or a function`");if("string"!=typeof o&&"symbol"!=typeof o)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],h=!!n&&n(i,o);if(e)e(i,o,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:s,writable:null===l&&h?h.writable:!l});else{if(!c&&(a||l||u))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");i[o]=s}},ci}(),r=function(){if(pi)return fi;pi=!0;var e=xn(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch{return!0}},fi=t}()(),n=Pn(),i=An(),o=e("%Math.floor%");return di=function(e,s){if("function"!=typeof e)throw new i("`fn` is not a function");if("number"!=typeof s||s<0||s>4294967295||o(s)!==s)throw new i("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],l=!0,u=!0;if("length"in e&&n){var c=n(e,"length");c&&!c.configurable&&(l=!1),c&&!c.writable&&(u=!1)}return(l||u||!a)&&(r?t(e,"length",s,!0,!0):t(e,"length",s)),e},di}function Rn(){if(wi)return mi;wi=!0;var e=On(),t=function(){if(bi)return yi;bi=!0;var e=kn(),t=On(),r=Tn(),n=An(),i=t("%Function.prototype.apply%"),o=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||e.call(o,i),a=xn(),l=t("%Math.max%");yi=function(t){if("function"!=typeof t)throw new n("a function is required");var i=s(e,o,arguments);return r(i,1+l(0,t.length-(arguments.length-1)),!0)};var u=function(){return s(e,i,arguments)};return a?a(yi,"apply",{value:u}):yi.apply=u,yi}(),r=t(e("String.prototype.indexOf"));return mi=function(n,i){var o=e(n,!!i);return"function"==typeof o&&r(n,".prototype.")>-1?t(o):o}}var Cn,jn,Mn,Bn,Nn,Un,Ln,Dn,Fn,Wn,qn,$n,Hn,Vn,zn,Kn,Gn,Qn,Yn,Jn,Xn,Zn,ei,ti,ri,ni,ii,oi,si,ai,li,ui,ci,hi,fi,pi,di,gi,yi,bi,mi,wi,vi=i(()=>{l(),tt(),Fe(),Cn={},jn=!1,Mn={},Bn=!1,Nn={},Un=!1,Ln={},Dn=!1,Fn={},Wn=!1,qn={},$n=!1,Hn={},Vn=!1,zn={},Kn=!1,Gn={},Qn=!1,Yn={},Jn=!1,Xn={},Zn=!1,ei={},ti=!1,ri={},ni=!1,ii={},oi=!1,si={},ai=!1,li={},ui=!1,ci={},hi=!1,fi={},pi=!1,di={},gi=!1,yi={},bi=!1,mi={},wi=!1});function _i(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function Si(){!Li||!Di||(Li=!1,Di.length?Ui=Di.concat(Ui):Fi=-1,Ui.length&&Ei())}function Ei(){if(!Li){var e=setTimeout(Si,0);Li=!0;for(var t=Ui.length;t;){for(Di=Ui,Ui=[];++Fi<t;)Di&&Di[Fi].run();Fi=-1,t=Ui.length}Di=null,Li=!1,clearTimeout(e)}}function Ai(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];Ui.push(new Ii(e,t)),1===Ui.length&&!Li&&setTimeout(Ei,0)}function Ii(e,t){this.fun=e,this.array=t}function ki(){}function Oi(e){_i("_linkedBinding")}function xi(e){_i("dlopen")}function Pi(){return[]}function Ti(){return[]}function Ri(e,t){if(!e)throw new Error(t||"assertion error")}function Ci(){return!1}function ji(){return So.now()/1e3}function Mi(e){var t=Math.floor(.001*(Date.now()-So.now())),r=.001*So.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=Ao)),[n,i]}function Bi(){return Io}function Ni(e){return[]}var Ui,Li,Di,Fi,Wi,qi,$i,Hi,Vi,zi,Ki,Gi,Qi,Yi,Ji,Xi,Zi,eo,to,ro,no,io,oo,so,ao,lo,uo,co,ho,fo,po,go,yo,bo,mo,wo,vo,_o,So,Eo,Ao,Io,ko=i(()=>{l(),tt(),Fe(),Ui=[],Li=!1,Fi=-1,Ii.prototype.run=function(){this.fun.apply(null,this.array)},Wi={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},qi=["/usr/bin/node"],$i=[],Hi={},Vi=function(e,t){console.warn((t?t+": ":"")+e)},zi=function(e){_i("binding")},Ki=function(e){return 0},Gi=function(){return"/"},Qi=function(e){},Yi={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},Ji=ki,Xi=[],Zi={},eo={},to=ki,ro=ki,io=no=function(){return{}},oo=no,so=ki,ao=ki,lo=ki,uo={},co={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ho=ki,fo=ki,po=ki,go=ki,yo=ki,bo=ki,mo=ki,wo=ki,vo=[],_o=ki,void 0===(So={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0}).now&&(Eo=Date.now(),So.timing&&So.timing.navigationStart&&(Eo=So.timing.navigationStart),So.now=()=>Date.now()-Eo),Ao=1e9,Mi.bigint=function(e){var t=Mi(e);return typeof BigInt>"u"?t[0]*Ao+t[1]:BigInt(t[0]*Ao)+BigInt(t[1])},Io={version:"v16.8.0",versions:Hi,arch:"x64",platform:"browser",release:Yi,_rawDebug:Ji,moduleLoadList:Xi,binding:zi,_linkedBinding:Oi,_events:{},_eventsCount:0,_maxListeners:10,on:Bi,addListener:Bi,once:Bi,off:Bi,removeListener:Bi,removeAllListeners:Bi,emit:ki,prependListener:Bi,prependOnceListener:Bi,listeners:Ni,domain:Zi,_exiting:false,config:eo,dlopen:xi,uptime:ji,_getActiveRequests:Pi,_getActiveHandles:Ti,reallyExit:to,_kill:ro,cpuUsage:no,resourceUsage:io,memoryUsage:oo,kill:so,exit:ao,openStdin:lo,allowedNodeEnvironmentFlags:uo,assert:Ri,features:co,_fatalExceptions:ho,setUncaughtExceptionCaptureCallback:fo,hasUncaughtExceptionCaptureCallback:Ci,emitWarning:Vi,nextTick:Ai,_tickCallback:po,_debugProcess:go,_debugEnd:yo,_startProfilerIdleNotifier:bo,_stopProfilerIdleNotifier:mo,stdout:undefined,stdin:undefined,stderr:undefined,abort:wo,umask:Ki,chdir:Qi,cwd:Gi,env:Wi,title:"browser",argv:qi,execArgv:$i,pid:2,ppid:1,execPath:"/bin/usr/node",debugPort:9229,hrtime:Mi,argv0:"node",_preload_modules:vo,setSourceMapsEnabled:_o}});var Oo,xo,Po,To=i(()=>{l(),tt(),Fe(),ko(),Oo={},xo=!1,Po=function(){if(xo)return Oo;xo=!0;var e=Io;function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",i=0,o=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(o!==a-1&&1!==s)if(o!==a-1&&2===s){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",i=0):i=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),o=a,s=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,a):n=e.slice(o+1,a),i=a-o-1;o=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var n,i="",o=!1,s=arguments.length-1;s>=-1&&!o;s--){var a;s>=0?a=arguments[s]:(void 0===n&&(n=e.cwd()),a=n),t(a),0!==a.length&&(i=a+"/"+i,o=47===a.charCodeAt(0))}return i=r(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),i=47===e.charCodeAt(e.length-1);return 0===(e=r(e,!n)).length&&!n&&(e="."),e.length>0&&i&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];t(i),i.length>0&&(void 0===e?e=i:e+="/"+i)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var i=1;i<e.length&&47===e.charCodeAt(i);++i);for(var o=e.length,s=o-i,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var l=r.length-a,u=s<l?s:l,c=-1,h=0;h<=u;++h){if(h===u){if(l>u){if(47===r.charCodeAt(a+h))return r.slice(a+h+1);if(0===h)return r.slice(a+h)}else s>u&&(47===e.charCodeAt(i+h)?c=h:0===h&&(c=0));break}var f=e.charCodeAt(i+h);if(f!==r.charCodeAt(a+h))break;47===f&&(c=h)}var p="";for(h=i+c+1;h<=o;++h)(h===o||47===e.charCodeAt(h))&&(0===p.length?p+="..":p+="/..");return p.length>0?p+r.slice(a+c):(a+=c,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,i=-1,o=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!o){i=s;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":e.slice(0,i)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,i=0,o=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var u=e.charCodeAt(n);if(47===u){if(!s){i=n+1;break}}else-1===l&&(s=!1,l=n+1),a>=0&&(u===r.charCodeAt(a)?-1===--a&&(o=n):(a=-1,o=l))}return i===o?o=l:-1===o&&(o=e.length),e.slice(i,o)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){i=n+1;break}}else-1===o&&(s=!1,o=n+1);return-1===o?"":e.slice(i,o)},extname:function(e){t(e);for(var r=-1,n=0,i=-1,o=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===i&&(o=!1,i=a+1),46===l?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!o){n=a+1;break}}return-1===r||-1===i||0===s||1===s&&r===i-1&&r===n+1?"":e.slice(r,i)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+e+n:n}("/",e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,i=e.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,u=!0,c=e.length-1,h=0;c>=n;--c)if(47!==(i=e.charCodeAt(c)))-1===l&&(u=!1,l=c+1),46===i?-1===s?s=c:1!==h&&(h=1):-1!==s&&(h=-1);else if(!u){a=c+1;break}return-1===s||-1===l||0===h||1===h&&s===l-1&&s===a+1?-1!==l&&(r.base=r.name=0===a&&o?e.slice(1,l):e.slice(a,l)):(0===a&&o?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,Oo=n}()}),Ro={};function Co(){if($o)return qo;$o=!0;var e="function"==typeof Map&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&"function"==typeof t.get?t.get:null,n=e&&Map.prototype.forEach,i="function"==typeof Set&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=i&&o&&"function"==typeof o.get?o.get:null,a=i&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,u="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,c="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,f=Object.prototype.toString,p=Function.prototype.toString,d=String.prototype.match,g=String.prototype.slice,y=String.prototype.replace,b=String.prototype.toUpperCase,m=String.prototype.toLowerCase,w=RegExp.prototype.test,v=Array.prototype.concat,_=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"==typeof Symbol.iterator,x="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,P=Object.prototype.propertyIsEnumerable,T=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function R(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||w.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-E(-e):E(e);if(n!==e){var i=String(n),o=g.call(t,i.length+1);return y.call(i,r,"$&_")+"."+y.call(y.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return y.call(t,r,"$&_")}var C=Wo,j=C.custom,M=D(j)?j:null;function B(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function N(e){return y.call(String(e),/"/g,"&quot;")}function U(e){return!("[object Array]"!==q(e)||x&&"object"==typeof e&&x in e)}function L(e){return!("[object RegExp]"!==q(e)||x&&"object"==typeof e&&x in e)}function D(e){if(O)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!k)return!1;try{return k.call(e),!0}catch{}return!1}qo=function e(t,i,o,f){var b=i||{};if(W(b,"quoteStyle")&&"single"!==b.quoteStyle&&"double"!==b.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(W(b,"maxStringLength")&&("number"==typeof b.maxStringLength?b.maxStringLength<0&&b.maxStringLength!==1/0:null!==b.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var w=!W(b,"customInspect")||b.customInspect;if("boolean"!=typeof w&&"symbol"!==w)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(W(b,"indent")&&null!==b.indent&&"\t"!==b.indent&&!(parseInt(b.indent,10)===b.indent&&b.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(W(b,"numericSeparator")&&"boolean"!=typeof b.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=b.numericSeparator;if(typeof t>"u")return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return H(t,b);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var I=String(t);return E?R(t,I):I}if("bigint"==typeof t){var j=String(t)+"n";return E?R(t,j):j}var F=typeof b.depth>"u"?5:b.depth;if(typeof o>"u"&&(o=0),o>=F&&F>0&&"object"==typeof t)return U(t)?"[Array]":"[Object]";var V=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=_.call(Array(e.indent+1)," ")}return{base:r,prev:_.call(Array(t+1),r)}}(b,o);if(typeof f>"u")f=[];else if($(f,t)>=0)return"[Circular]";function J(t,r,n){if(r&&(f=S.call(f)).push(r),n){var i={depth:b.depth};return W(b,"quoteStyle")&&(i.quoteStyle=b.quoteStyle),e(t,i,o+1,f)}return e(t,b,o+1,f)}if("function"==typeof t&&!L(t)){var X=function(e){if(e.name)return e.name;var t=d.call(p.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),Z=Y(t,J);return"[Function"+(X?": "+X:" (anonymous)")+"]"+(Z.length>0?" { "+_.call(Z,", ")+" }":"")}if(D(t)){var ee=O?y.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):k.call(t);return"object"!=typeof t||O?ee:z(ee)}if(function(e){return!(!e||"object"!=typeof e)&&(typeof HTMLElement<"u"&&e instanceof HTMLElement||"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}(t)){for(var te="<"+m.call(String(t.nodeName)),re=t.attributes||[],ne=0;ne<re.length;ne++)te+=" "+re[ne].name+"="+B(N(re[ne].value),"double",b);return te+=">",t.childNodes&&t.childNodes.length&&(te+="..."),te+="</"+m.call(String(t.nodeName))+">"}if(U(t)){if(0===t.length)return"[]";var ie=Y(t,J);return V&&!function(e){for(var t=0;t<e.length;t++)if($(e[t],"\n")>=0)return!1;return!0}(ie)?"["+Q(ie,V)+"]":"[ "+_.call(ie,", ")+" ]"}if(function(e){return!("[object Error]"!==q(e)||x&&"object"==typeof e&&x in e)}(t)){var oe=Y(t,J);return"cause"in Error.prototype||!("cause"in t)||P.call(t,"cause")?0===oe.length?"["+String(t)+"]":"{ ["+String(t)+"] "+_.call(oe,", ")+" }":"{ ["+String(t)+"] "+_.call(v.call("[cause]: "+J(t.cause),oe),", ")+" }"}if("object"==typeof t&&w){if(M&&"function"==typeof t[M]&&C)return C(t,{depth:F-o});if("symbol"!==w&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!r||!e||"object"!=typeof e)return!1;try{r.call(e);try{s.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}(t)){var se=[];return n&&n.call(t,function(e,r){se.push(J(r,t,!0)+" => "+J(e,t))}),G("Map",r.call(t),se,V)}if(function(e){if(!s||!e||"object"!=typeof e)return!1;try{s.call(e);try{r.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}(t)){var ae=[];return a&&a.call(t,function(e){ae.push(J(e,t))}),G("Set",s.call(t),ae,V)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e,l);try{u.call(e,u)}catch{return!0}return e instanceof WeakMap}catch{}return!1}(t))return K("WeakMap");if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{u.call(e,u);try{l.call(e,l)}catch{return!0}return e instanceof WeakSet}catch{}return!1}(t))return K("WeakSet");if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{return c.call(e),!0}catch{}return!1}(t))return K("WeakRef");if(function(e){return!("[object Number]"!==q(e)||x&&"object"==typeof e&&x in e)}(t))return z(J(Number(t)));if(function(e){if(!e||"object"!=typeof e||!A)return!1;try{return A.call(e),!0}catch{}return!1}(t))return z(J(A.call(t)));if(function(e){return!("[object Boolean]"!==q(e)||x&&"object"==typeof e&&x in e)}(t))return z(h.call(t));if(function(e){return!("[object String]"!==q(e)||x&&"object"==typeof e&&x in e)}(t))return z(J(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Ho<"u"&&t===Ho)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==q(e)||x&&"object"==typeof e&&x in e)}(t)&&!L(t)){var le=Y(t,J),ue=T?T(t)===Object.prototype:t instanceof Object||t.constructor===Object,ce=t instanceof Object?"":"null prototype",he=!ue&&x&&Object(t)===t&&x in t?g.call(q(t),8,-1):ce?"Object":"",fe=(ue||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(he||ce?"["+_.call(v.call([],he||[],ce||[]),": ")+"] ":"");return 0===le.length?fe+"{}":V?fe+"{"+Q(le,V)+"}":fe+"{ "+_.call(le,", ")+" }"}return String(t)};var F=Object.prototype.hasOwnProperty||function(e){return e in(this||Ho)};function W(e,t){return F.call(e,t)}function q(e){return f.call(e)}function $(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function H(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return H(g.call(e,0,t.maxStringLength),t)+n}return B(y.call(y.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,V),"single",t)}function V(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+b.call(t.toString(16))}function z(e){return"Object("+e+")"}function K(e){return e+" { ? }"}function G(e,t,r,n){return e+" ("+t+") {"+(n?Q(r,n):_.call(r,", "))+"}"}function Q(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+_.call(e,","+r)+"\n"+t.prev}function Y(e,t){var r=U(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=W(e,i)?t(e[i],e):""}var o,s="function"==typeof I?I(e):[];if(O){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var l in e)W(e,l)&&(r&&String(Number(l))===l&&l<e.length||O&&o["$"+l]instanceof Symbol||(w.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof I)for(var u=0;u<s.length;u++)P.call(e,s[u])&&n.push("["+t(s[u])+"]: "+t(e[s[u]],e));return n}return qo}function jo(){if(zo)return Vo;zo=!0;var e=On(),t=Rn(),r=Co(),n=An(),i=e("%WeakMap%",!0),o=e("%Map%",!0),s=t("WeakMap.prototype.get",!0),a=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),u=t("Map.prototype.get",!0),c=t("Map.prototype.set",!0),h=t("Map.prototype.has",!0),f=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r};return Vo=function(){var e,t,p,d={assert:function(e){if(!d.has(e))throw new n("Side channel does not contain "+r(e))},get:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(e)return s(e,r)}else if(o){if(t)return u(t,r)}else if(p)return function(e,t){var r=f(e,t);return r&&r.value}(p,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(o){if(t)return h(t,r)}else if(p)return function(e,t){return!!f(e,t)}(p,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new i),a(e,r,n)):o?(t||(t=new o),c(t,r,n)):(p||(p={key:{},next:null}),function(e,t,r){var n=f(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(p,r,n))}};return d}}function Mo(){if(Go)return Ko;Go=!0;var e=String.prototype.replace,t=/%20/g,r="RFC3986";return Ko={default:r,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}}function Bo(){if(Yo)return Qo;Yo=!0;var e=Mo(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),i=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)typeof e[n]<"u"&&(r[n]=e[n]);return r},o=1024;return Qo={arrayToObject:i,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],i=0;i<t.length;++i)for(var o=t[i],s=o.obj[o.prop],a=Object.keys(s),l=0;l<a.length;++l){var u=a[l],c=s[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:s,prop:u}),n.push(c))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var i=[],o=0;o<n.length;++o)typeof n[o]<"u"&&i.push(n[o]);t.obj[t.prop]=i}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},encode:function(t,r,i,s,a){if(0===t.length)return t;var l=t;if("symbol"==typeof t?l=Symbol.prototype.toString.call(t):"string"!=typeof t&&(l=String(t)),"iso-8859-1"===i)return escape(l).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var u="",c=0;c<l.length;c+=o){for(var h=l.length>=o?l.slice(c,c+o):l,f=[],p=0;p<h.length;++p){var d=h.charCodeAt(p);45===d||46===d||95===d||126===d||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||a===e.RFC1738&&(40===d||41===d)?f[f.length]=h.charAt(p):d<128?f[f.length]=n[d]:d<2048?f[f.length]=n[192|d>>6]+n[128|63&d]:d<55296||d>=57344?f[f.length]=n[224|d>>12]+n[128|d>>6&63]+n[128|63&d]:(p+=1,d=65536+((1023&d)<<10|1023&h.charCodeAt(p)),f[f.length]=n[240|d>>18]+n[128|d>>12&63]+n[128|d>>6&63]+n[128|63&d])}u+=f.join("")}return u},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(r(e)){for(var n=[],i=0;i<e.length;i+=1)n.push(t(e[i]));return n}return t(e)},merge:function e(n,o,s){if(!o)return n;if("object"!=typeof o){if(r(n))n.push(o);else{if(!n||"object"!=typeof n)return[n,o];(s&&(s.plainObjects||s.allowPrototypes)||!t.call(Object.prototype,o))&&(n[o]=!0)}return n}if(!n||"object"!=typeof n)return[n].concat(o);var a=n;return r(n)&&!r(o)&&(a=i(n,s)),r(n)&&r(o)?(o.forEach(function(r,i){if(t.call(n,i)){var o=n[i];o&&"object"==typeof o&&r&&"object"==typeof r?n[i]=e(o,r,s):n.push(r)}else n[i]=r}),n):Object.keys(o).reduce(function(r,n){var i=o[n];return t.call(r,n)?r[n]=e(r[n],i,s):r[n]=i,r},a)}}}function No(){if(Xo)return Jo;Xo=!0;var e=jo(),t=Bo(),r=Mo(),n=Object.prototype.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Array.isArray,s=Array.prototype.push,a=function(e,t){s.apply(e,o(t)?t:[t])},l=Date.prototype.toISOString,u=r.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:u,formatter:r.formatters[u],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},h={},f=function r(n,i,s,l,u,f,p,d,g,y,b,m,w,v,_,S,E,A){for(var I=n,k=A,O=0,x=!1;void 0!==(k=k.get(h))&&!x;){var P=k.get(n);if(O+=1,typeof P<"u"){if(P===O)throw new RangeError("Cyclic object value");x=!0}typeof k.get(h)>"u"&&(O=0)}if("function"==typeof y?I=y(i,I):I instanceof Date?I=w(I):"comma"===s&&o(I)&&(I=t.maybeMap(I,function(e){return e instanceof Date?w(e):e})),null===I){if(f)return g&&!S?g(i,c.encoder,E,"key",v):i;I=""}if(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e}(I)||t.isBuffer(I))return g?[_(S?i:g(i,c.encoder,E,"key",v))+"="+_(g(I,c.encoder,E,"value",v))]:[_(i)+"="+_(String(I))];var T,R=[];if(typeof I>"u")return R;if("comma"===s&&o(I))S&&g&&(I=t.maybeMap(I,g)),T=[{value:I.length>0?I.join(",")||null:void 0}];else if(o(y))T=y;else{var C=Object.keys(I);T=b?C.sort(b):C}var j=d?i.replace(/\./g,"%2E"):i,M=l&&o(I)&&1===I.length?j+"[]":j;if(u&&o(I)&&0===I.length)return M+"[]";for(var B=0;B<T.length;++B){var N=T[B],U="object"==typeof N&&typeof N.value<"u"?N.value:I[N];if(!p||null!==U){var L=m&&d?N.replace(/\./g,"%2E"):N,D=o(I)?"function"==typeof s?s(M,L):M:M+(m?"."+L:"["+L+"]");A.set(n,O);var F=e();F.set(h,A),a(R,r(U,D,s,l,u,f,p,d,"comma"===s&&S&&o(I)?null:g,y,b,m,w,v,_,S,E,F))}}return R};return Jo=function(t,s){var l,u=t,h=function(e){if(!e)return c;if(typeof e.allowEmptyArrays<"u"&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&typeof e.encoder<"u"&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||c.charset;if(typeof e.charset<"u"&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var s=r.default;if(typeof e.format<"u"){if(!n.call(r.formatters,e.format))throw new TypeError("Unknown format option provided.");s=e.format}var a,l=r.formatters[s],u=c.filter;if(("function"==typeof e.filter||o(e.filter))&&(u=e.filter),a=e.arrayFormat in i?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":c.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var h=typeof e.allowDots>"u"?!0===e.encodeDotInKeys||c.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:c.addQueryPrefix,allowDots:h,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:c.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?c.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:c.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:c.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:c.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:c.encodeValuesOnly,filter:u,format:s,formatter:l,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:c.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:c.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:c.strictNullHandling}}(s);"function"==typeof h.filter?u=(0,h.filter)("",u):o(h.filter)&&(l=h.filter);var p=[];if("object"!=typeof u||null===u)return"";var d=i[h.arrayFormat],g="comma"===d&&h.commaRoundTrip;l||(l=Object.keys(u)),h.sort&&l.sort(h.sort);for(var y=e(),b=0;b<l.length;++b){var m=l[b];h.skipNulls&&null===u[m]||a(p,f(u[m],m,d,g,h.allowEmptyArrays,h.strictNullHandling,h.skipNulls,h.encodeDotInKeys,h.encode?h.encoder:null,h.filter,h.sort,h.allowDots,h.serializeDate,h.format,h.formatter,h.encodeValuesOnly,h.charset,y))}var w=p.join(h.delimiter),v=!0===h.addQueryPrefix?"?":"";return h.charsetSentinel&&("iso-8859-1"===h.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),w.length>0?v+w:""}}function Uo(){if(es)return Zo;es=!0;var e=Bo(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},i=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},o=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s=function(e,r,n,i){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(s),u=l?s.slice(0,l.index):s,c=[];if(u){if(!n.plainObjects&&t.call(Object.prototype,u)&&!n.allowPrototypes)return;c.push(u)}for(var h=0;n.depth>0&&null!==(l=a.exec(s))&&h<n.depth;){if(h+=1,!n.plainObjects&&t.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(l[1])}if(l){if(!0===n.strictDepth)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");c.push("["+s.slice(l.index)+"]")}return function(e,t,r,n){for(var i=n?t:o(t,r),s=e.length-1;s>=0;--s){var a,l=e[s];if("[]"===l&&r.parseArrays)a=r.allowEmptyArrays&&(""===i||r.strictNullHandling&&null===i)?[]:[].concat(i);else{a=r.plainObjects?Object.create(null):{};var u="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,c=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,h=parseInt(c,10);r.parseArrays||""!==c?!isNaN(h)&&l!==c&&String(h)===c&&h>=0&&r.parseArrays&&h<=r.arrayLimit?(a=[])[h]=i:"__proto__"!==c&&(a[c]=i):a={0:i}}i=a}return i}(c,r,n,i)}};return Zo=function(a,l){var u=function(t){if(!t)return n;if(typeof t.allowEmptyArrays<"u"&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&typeof t.decoder<"u"&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?n.charset:t.charset,i=typeof t.duplicates>"u"?n.duplicates:t.duplicates;if("combine"!==i&&"first"!==i&&"last"!==i)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:typeof t.allowDots>"u"?!0===t.decodeDotInKeys||n.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:n.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:n.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:n.arrayLimit,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:n.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:n.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:n.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:n.decoder,delimiter:"string"==typeof t.delimiter||e.isRegExp(t.delimiter)?t.delimiter:n.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:n.depth,duplicates:i,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:n.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:n.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:n.strictDepth,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:n.strictNullHandling}}(l);if(""===a||null===a||typeof a>"u")return u.plainObjects?Object.create(null):{};for(var c="string"==typeof a?function(s,a){var l={__proto__:null},u=a.ignoreQueryPrefix?s.replace(/^\?/,""):s;u=u.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var c,h=a.parameterLimit===1/0?void 0:a.parameterLimit,f=u.split(a.delimiter,h),p=-1,d=a.charset;if(a.charsetSentinel)for(c=0;c<f.length;++c)0===f[c].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[c]?d="utf-8":"utf8=%26%2310003%3B"===f[c]&&(d="iso-8859-1"),p=c,c=f.length);for(c=0;c<f.length;++c)if(c!==p){var g,y,b=f[c],m=b.indexOf("]="),w=-1===m?b.indexOf("="):m+1;-1===w?(g=a.decoder(b,n.decoder,d,"key"),y=a.strictNullHandling?null:""):(g=a.decoder(b.slice(0,w),n.decoder,d,"key"),y=e.maybeMap(o(b.slice(w+1),a),function(e){return a.decoder(e,n.decoder,d,"value")})),y&&a.interpretNumericEntities&&"iso-8859-1"===d&&(y=i(y)),b.indexOf("[]=")>-1&&(y=r(y)?[y]:y);var v=t.call(l,g);v&&"combine"===a.duplicates?l[g]=e.combine(l[g],y):(!v||"last"===a.duplicates)&&(l[g]=y)}return l}(a,u):a,h=u.plainObjects?Object.create(null):{},f=Object.keys(c),p=0;p<f.length;++p){var d=f[p],g=s(d,c[d],u,"string"==typeof a);h=e.merge(h,g,u)}return!0===u.allowSparse?h:e.compact(h)}}function Lo(){if(is)return ns;is=!0;var e=_n;function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,i=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,o=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),s=["'"].concat(o),a=["%","/","?",";","#"].concat(s),l=["/","?","#"],u=/^[+a-z0-9A-Z_-]{0,63}$/,c=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},f={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},d=function(){if(rs)return ts;rs=!0;var e=No(),t=Uo(),r=Mo();return ts={formats:r,parse:t,stringify:e}}();function g(e,r,n){if(e&&"object"==typeof e&&e instanceof t)return e;var i=new t;return i.parse(e,r,n),i}return t.prototype.parse=function(t,n,o){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var g=t.indexOf("?"),y=-1!==g&&g<t.indexOf("#")?"?":"#",b=t.split(y);b[0]=b[0].replace(/\\/g,"/");var m=t=b.join(y);if(m=m.trim(),!o&&1===t.split("#").length){var w=i.exec(m);if(w)return this.path=m,this.href=m,this.pathname=w[1],w[2]?(this.search=w[2],this.query=n?d.parse(this.search.substr(1)):this.search.substr(1)):n&&(this.search="",this.query={}),this}var v=r.exec(m);if(v){var _=(v=v[0]).toLowerCase();this.protocol=_,m=m.substr(v.length)}if(o||v||m.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===m.substr(0,2);S&&(!v||!f[v])&&(m=m.substr(2),this.slashes=!0)}if(!f[v]&&(S||v&&!p[v])){for(var E=-1,A=0;A<l.length;A++){-1!==(O=m.indexOf(l[A]))&&(-1===E||O<E)&&(E=O)}var I,k;-1!==(k=-1===E?m.lastIndexOf("@"):m.lastIndexOf("@",E))&&(I=m.slice(0,k),m=m.slice(k+1),this.auth=decodeURIComponent(I)),E=-1;for(A=0;A<a.length;A++){var O;-1!==(O=m.indexOf(a[A]))&&(-1===E||O<E)&&(E=O)}-1===E&&(E=m.length),this.host=m.slice(0,E),m=m.slice(E),this.parseHost(),this.hostname=this.hostname||"";var x="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!x)for(var P=this.hostname.split(/\./),T=(A=0,P.length);A<T;A++){var R=P[A];if(R&&!R.match(u)){for(var C="",j=0,M=R.length;j<M;j++)R.charCodeAt(j)>127?C+="x":C+=R[j];if(!C.match(u)){var B=P.slice(0,A),N=P.slice(A+1),U=R.match(c);U&&(B.push(U[1]),N.unshift(U[2])),N.length&&(m="/"+N.join(".")+m),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),x||(this.hostname=e.toASCII(this.hostname));var L=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+L,this.href+=this.host,x&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==m[0]&&(m="/"+m))}if(!h[_])for(A=0,T=s.length;A<T;A++){var F=s[A];if(-1!==m.indexOf(F)){var W=encodeURIComponent(F);W===F&&(W=escape(F)),m=m.split(F).join(W)}}var q=m.indexOf("#");-1!==q&&(this.hash=m.substr(q),m=m.slice(0,q));var $=m.indexOf("?");if(-1!==$?(this.search=m.substr($),this.query=m.substr($+1),n&&(this.query=d.parse(this.query)),m=m.slice(0,$)):n&&(this.search="",this.query={}),m&&(this.pathname=m),p[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var H=this.search||"";this.path=L+H}return this.href=this.format(),this},t.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=d.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||p[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},t.prototype.resolve=function(e){return this.resolveObject(g(e,!1,!0)).format()},t.prototype.resolveObject=function(e){if("string"==typeof e){var r=new t;r.parse(e,!1,!0),e=r}for(var n=new t,i=Object.keys(this),o=0;o<i.length;o++){var s=i[o];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var u=a[l];"protocol"!==u&&(n[u]=e[u])}return p[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!p[e.protocol]){for(var c=Object.keys(e),h=0;h<c.length;h++){var d=c[h];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||f[e.protocol])n.pathname=e.pathname;else{for(var g=(e.pathname||"").split("/");g.length&&!(e.host=g.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==g[0]&&g.unshift(""),g.length<2&&g.unshift(""),n.pathname=g.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var y=n.pathname||"",b=n.search||"";n.path=y+b}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m=n.pathname&&"/"===n.pathname.charAt(0),w=e.host||e.pathname&&"/"===e.pathname.charAt(0),v=w||m||n.host&&e.pathname,_=v,S=n.pathname&&n.pathname.split("/")||[],E=(g=e.pathname&&e.pathname.split("/")||[],n.protocol&&!p[n.protocol]);if(E&&(n.hostname="",n.port=null,n.host&&(""===S[0]?S[0]=n.host:S.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===g[0]?g[0]=e.host:g.unshift(e.host)),e.host=null),v=v&&(""===g[0]||""===S[0])),w)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,S=g;else if(g.length)S||(S=[]),S.pop(),S=S.concat(g),n.search=e.search,n.query=e.query;else if(null!=e.search){if(E)n.host=S.shift(),n.hostname=n.host,(x=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=x.shift(),n.hostname=x.shift(),n.host=n.hostname);return n.search=e.search,n.query=e.query,(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var A=S.slice(-1)[0],I=(n.host||e.host||S.length>1)&&("."===A||".."===A)||""===A,k=0,O=S.length;O>=0;O--)"."===(A=S[O])?S.splice(O,1):".."===A?(S.splice(O,1),k++):k&&(S.splice(O,1),k--);if(!v&&!_)for(;k--;k)S.unshift("..");v&&""!==S[0]&&(!S[0]||"/"!==S[0].charAt(0))&&S.unshift(""),I&&"/"!==S.join("/").substr(-1)&&S.push("");var x,P=""===S[0]||S[0]&&"/"===S[0].charAt(0);E&&(n.hostname=P?"":S.length?S.shift():"",n.host=n.hostname,(x=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=x.shift(),n.hostname=x.shift(),n.host=n.hostname));return(v=v||n.host&&S.length)&&!P&&S.unshift(""),S.length>0?n.pathname=S.join("/"):(n.pathname=null,n.path=null),(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},t.prototype.parseHost=function(){var e=this.host,t=n.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},ns.parse=g,ns.resolve=function(e,t){return g(e,!1,!0).resolve(t)},ns.resolveObject=function(e,t){return e?g(e,!1,!0).resolveObject(t):t},ns.format=function(e){return"string"==typeof e&&(e=g(e)),e instanceof t?e.format():t.prototype.format.call(e)},ns.Url=t,ns}function Do(e){if("string"==typeof e)e=new URL(e);else if(!(e instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if("file:"!==e.protocol)throw new Deno.errors.InvalidData("invalid url scheme");return bs?function(e){let t=e.hostname,r=e.pathname;for(let e=0;e<r.length;e++)if("%"===r[e]){let t=r.codePointAt(e+2)||32;if("2"===r[e+1]&&102===t||"5"===r[e+1]&&99===t)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(ms,"\\"),r=decodeURIComponent(r),""!==t)return`\\\\${t}${r}`;{let e=32|r.codePointAt(1),t=r[2];if(e<gs||e>ys||":"!==t)throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}(e):function(e){if(""!==e.hostname)throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=t.codePointAt(e+2)||32;if("2"===t[e+1]&&102===r)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function Fo(e){let t=Po.resolve(e),r=e.charCodeAt(e.length-1);(r===ds||bs&&r===ps)&&t[t.length-1]!==Po.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(ws,"%25")),!bs&&t.includes("\\")&&(t=t.replace(vs,"%5C")),t.includes("\n")&&(t=t.replace(_s,"%0A")),t.includes("\r")&&(t=t.replace(Ss,"%0D")),t.includes("\t")&&(t=t.replace(Es,"%09")),n.pathname=t,n}s(Ro,{URL:()=>fs,Url:()=>as,default:()=>os,fileURLToPath:()=>Do,format:()=>ls,parse:()=>hs,pathToFileURL:()=>Fo,resolve:()=>us,resolveObject:()=>cs});var Wo,qo,$o,Ho,Vo,zo,Ko,Go,Qo,Yo,Jo,Xo,Zo,es,ts,rs,ns,is,os,ss,as,ls,us,cs,hs,fs,ps,ds,gs,ys,bs,ms,ws,vs,_s,Ss,Es,As=i(()=>{l(),tt(),Fe(),Sn(),vi(),To(),ko(),Wo=Object.freeze(Object.create(null)),qo={},$o=!1,Ho=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Vo={},zo=!1,Ko={},Go=!1,Qo={},Yo=!1,Jo={},Xo=!1,Zo={},es=!1,ts={},rs=!1,ns={},is=!1,(os=Lo()).parse,os.resolve,os.resolveObject,os.format,os.Url,ss=typeof Deno<"u"?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,os.URL=typeof URL<"u"?URL:null,os.pathToFileURL=Fo,os.fileURLToPath=Do,as=os.Url,ls=os.format,us=os.resolve,cs=os.resolveObject,hs=os.parse,fs=os.URL,ps=92,ds=47,gs=97,ys=122,bs="win32"===ss,ms=/\//g,ws=/%/g,vs=/\\/g,_s=/\n/g,Ss=/\r/g,Es=/\t/g}),Is=o((e,t)=>{l(),tt(),Fe(),t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),ks=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=void 0,e.writev=n;var t=qt(),r=(et(),a(Qe));function n(e,t){let n=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?n[t]=r.Buffer.from(e[t].chunk,"utf8"):n[t]=e[t].chunk;this._write(r.Buffer.concat(n),"binary",t)}var i=class extends t.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=n.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",e=>{!this.destroyed&&this.readable&&this.push(e)})}_read(e){this.proxy.read(e)}_write(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}};e.BufferedDuplex=i}),Os=o(e=>{l(),tt(),Fe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var r=(et(),a(Qe)),n=t(Is()),i=t(Yt()),o=qt(),s=t(dn()),u=ks(),c=(0,i.default)("mqttjs:ws"),h=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function f(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function p(e){let t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),!s.default&&!e.forceNativeWebSocket&&"wss"===e.protocol&&h.forEach(r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])}),t}e.streamBuilder=(e,t)=>{c("streamBuilder");let r=p(t);r.hostname=r.hostname||r.host||"localhost";let i=f(r,e),o=function(e,t,r){c("createWebSocket"),c(`protocol: ${r.protocolId} ${r.protocolVersion}`);let i,o="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return c(`creating new Websocket for url: ${t} and protocol: ${o}`),i=r.createWebsocket?r.createWebsocket(t,[o],r):new n.default(t,[o],r.wsOptions),i}(0,i,r),s=n.default.createWebSocketStream(o,r.wsOptions);return s.url=i,o.on("close",()=>{s.destroy()}),s};e.browserStreamBuilder=(e,t)=>{c("browserStreamBuilder");let n,i=function(e){let t=p(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t).browserBufferSize||524288,s=t.browserBufferTimeout||1e3,a=!t.objectMode,l=function(e,t){let r,n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",i=f(t,e);return r=t.createWebsocket?t.createWebsocket(i,[n],t):new WebSocket(i,[n]),r.binaryType="arraybuffer",r}(e,t),h=function(e,t,r){let n=new o.Transform({objectMode:e.objectMode});return n._write=t,n._flush=r,n}(t,function e(t,n,o){if(l.bufferedAmount>i)return void setTimeout(e,s,t,n,o);a&&"string"==typeof t&&(t=r.Buffer.from(t,"utf8"));try{l.send(t)}catch(e){return o(e)}o()},function(e){l.close(),e()});t.objectMode||(h._writev=u.writev.bind(h)),h.on("close",()=>{l.close()});let d=typeof l.addEventListener<"u";function g(){c("WebSocket onOpen"),n instanceof u.BufferedDuplex&&n.socketReady()}function y(e){c("WebSocket onClose",e),n.end(),n.destroy()}function b(e){c("WebSocket onError",e);let t=new Error("WebSocket error");t.event=e,n.destroy(t)}async function m(e){if(!h||!h.readable||!h.writable)return;let{data:t}=e;t=t instanceof ArrayBuffer?r.Buffer.from(t):t instanceof Blob?r.Buffer.from(await new Response(t).arrayBuffer()):r.Buffer.from(t,"utf8"),h.push(t)}return l.readyState===l.OPEN?(n=h,n.socket=l):(n=new u.BufferedDuplex(t,h,l),d?l.addEventListener("open",g):l.onopen=g),d?(l.addEventListener("close",y),l.addEventListener("error",b),l.addEventListener("message",m)):(l.onclose=y,l.onerror=b,l.onmessage=m),n}}),xs={};function Ps(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}s(xs,{Server:()=>Ps,Socket:()=>Ps,Stream:()=>Ps,_createServerHandle:()=>Ps,_normalizeArgs:()=>Ps,_setSimultaneousAccepts:()=>Ps,connect:()=>Ps,createConnection:()=>Ps,createServer:()=>Ps,default:()=>Ts,isIP:()=>Ps,isIPv4:()=>Ps,isIPv6:()=>Ps});var Ts,Rs=i(()=>{l(),tt(),Fe(),Ts={_createServerHandle:Ps,_normalizeArgs:Ps,_setSimultaneousAccepts:Ps,connect:Ps,createConnection:Ps,createServer:Ps,isIP:Ps,isIPv4:Ps,isIPv6:Ps,Server:Ps,Socket:Ps,Stream:Ps}}),Cs=o((e,t)=>{l(),tt(),Fe(),t.exports={}}),js=o(e=>{l(),tt(),Fe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((Rs(),a(xs))),n=t(Yt()),i=t(Cs()),o=(0,n.default)("mqttjs:tcp");e.default=(e,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,i.default)(t.hostname,t.port,t.socksProxy,{timeout:t.socksTimeout});let{port:n,path:s}=t,a=t.hostname;return o("port %d and host %s",n,a),r.default.createConnection({port:n,host:a,path:s})}}),Ms={};s(Ms,{default:()=>Bs});var Bs,Ns=i(()=>{l(),tt(),Fe(),Bs={}}),Us=o(e=>{l(),tt(),Fe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=(Ns(),a(Ms)),n=t((Rs(),a(xs))),i=t(Yt()),o=t(Cs()),s=(0,i.default)("mqttjs:tls");e.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===n.default.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,s("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);let i=function(e){let{host:t,port:n,socksProxy:i,...s}=e;if(void 0!==i){let a=(0,o.default)(t,n,i,{timeout:e.socksTimeout});return(0,r.connect)({...s,socket:a})}return(0,r.connect)(e)}(t);function a(r){t.rejectUnauthorized&&e.emit("error",r),i.end()}return i.on("secureConnect",()=>{t.rejectUnauthorized&&!i.authorized?i.emit("error",new Error("TLS not authorized")):i.removeListener("error",a)}),i.on("error",a),i}}),Ls=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(et(),a(Qe)),o=qt(),s=ks();e.default=(e,a)=>{if(a.hostname=a.hostname||a.host,!a.hostname)throw new Error("Could not determine host. Specify host manually.");let l="MQIsdp"===a.protocolId&&3===a.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(a);let u=function(e,t){let r="wxs"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(a,e);t=wx.connectSocket({url:u,protocols:[l]}),r=function(){let e=new o.Transform;return e._write=(e,r,n)=>{t.send({data:e.buffer,success(){n()},fail(e){n(new Error(e))}})},e._flush=e=>{t.close({success(){e()}})},e}(),(n=new s.BufferedDuplex(a,r,t))._destroy=(e,r)=>{t.close({success(){r&&r(e)}})};let c=n.destroy;return n.destroy=(e,r)=>(n.destroy=c,setTimeout(()=>{t.close({fail(){n._destroy(e,r)}})},0),n),t.onOpen(()=>{n.socketReady()}),t.onMessage(e=>{let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),r.push(t)}),t.onClose(()=>{n.emit("close"),n.end(),n.destroy()}),t.onError(e=>{let t=new Error(e.errMsg);n.destroy(t)}),n}}),Ds=o(e=>{l(),tt(),Fe(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(et(),a(Qe)),o=qt(),s=ks(),u=!1;e.default=(e,a)=>{if(a.hostname=a.hostname||a.host,!a.hostname)throw new Error("Could not determine host. Specify host manually.");let l="MQIsdp"===a.protocolId&&3===a.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(a);let c=function(e,t){let r="alis"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(a,e);return(t=a.my).connectSocket({url:c,protocols:l}),r=function(){let e=new o.Transform;return e._write=(e,r,n)=>{t.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(new Error)}})},e._flush=e=>{t.closeSocket({success(){e()}})},e}(),n=new s.BufferedDuplex(a,r,t),u||(u=!0,t.onSocketOpen(()=>{n.socketReady()}),t.onSocketMessage(e=>{if("string"==typeof e.data){let t=i.Buffer.from(e.data,"base64");r.push(t)}else{let t=new FileReader;t.addEventListener("load",()=>{t.result instanceof ArrayBuffer?r.push(i.Buffer.from(t.result)):r.push(i.Buffer.from(t.result,"utf-8"))}),t.readAsArrayBuffer(e.data)}}),t.onSocketClose(()=>{n.end(),n.destroy()}),t.onSocketError(e=>{n.destroy(e)})),n}}),Fs=o(e=>{l(),tt(),Fe();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=function(e,t,r=!0){return new Promise((n,i)=>{let o=h(e,t),s={connect:e=>{a(),n(o)},end:()=>{a(),n(o)},error:e=>{a(),o.end(),i(e)}};function a(){Object.keys(s).forEach(e=>{o.off(e,s[e])})}!1===r&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))}),Object.keys(s).forEach(e=>{o.on(e,s[e])})})};var r=t(Yt()),n=t((As(),a(Ro))),i=t(bn()),o=t(dn());"function"!=typeof u?.nextTick&&(u.nextTick=setImmediate);var s=(0,r.default)("mqttjs"),c=null;function h(e,t){if(s("connecting to an MQTT broker..."),"object"==typeof e&&!t&&(t=e,e=""),t=t||{},e&&"string"==typeof e){let r=n.default.parse(e,!0),i={};if(null!=r.port&&(i.port=Number(r.port)),i.host=r.hostname,i.query=r.query,i.auth=r.auth,i.protocol=r.protocol,i.path=r.path,!(t={...i,...t}).protocol)throw new Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(t.unixSocket=t.unixSocket||t.protocol?.includes("+unix"),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):!t.protocol?.startsWith("ws")&&!t.protocol?.startsWith("wx")&&delete t.path,function(e){let t;if(e.auth)if(t=e.auth.match(/^(.+):(.+)$/),t){let[,r,n]=t;e.username=r,e.password=n}else e.username=e.auth}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),o.default||t.unixSocket?t.socksProxy=void 0:void 0===t.socksProxy&&typeof u<"u"&&(t.socksProxy=u.env.MQTTJS_SOCKS_PROXY),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(c||(c={},o.default||t.forceNativeWebSocket?(c.ws=Os().browserStreamBuilder,c.wss=Os().browserStreamBuilder,c.wx=Ls().default,c.wxs=Ls().default,c.ali=Ds().default,c.alis=Ds().default):(c.ws=Os().streamBuilder,c.wss=Os().streamBuilder,c.mqtt=js().default,c.tcp=js().default,c.ssl=Us().default,c.tls=c.ssl,c.mqtts=Us().default)),!c[t.protocol]){let e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((t,r)=>(!e||r%2!=0)&&"function"==typeof c[t])[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);let r=new i.default(function(e){return t.servers&&((!e._reconnectCount||e._reconnectCount===t.servers.length)&&(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),s("calling streambuilder for",t.protocol),c[t.protocol](e,t)},t);return r.on("error",()=>{}),r}e.default=h}),Ws=o(e=>{l(),tt(),Fe();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)},s=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var a=s(bn());e.MqttClient=a.default;var u=s(Dr());e.DefaultMessageIdProvider=u.default;var c=s(mn());e.UniqueMessageIdProvider=c.default;var h=s(sr());e.Store=h.default;var f=i(Fs());e.connect=f.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}});var p=s(yn());e.KeepaliveManager=p.default,e.Client=a.default,o(bn(),e),o(ur(),e);var d=cr();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})}),qs=o(e=>{l(),tt(),Fe();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),n=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var i={};if(null!=e)for(var o=t(e),s=0;s<o.length;s++)"default"!==o[s]&&r(i,e,o[s]);return n(i,e),i}),o=e&&e.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0});var s=i(Ws());e.default=s,o(Ws(),e)})();
2
- /*! Bundled license information:
3
-
4
- @jspm/core/nodelibs/browser/chunk-DtuTasat.js:
5
- (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
6
-
7
- safe-buffer/index.js:
8
- (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
9
-
10
- @babel/runtime/helpers/regenerator.js:
11
- (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
12
- */
13
- export{qs as m};