@liascript/exporter
Version:
A generic exporter for LiaScript
1 lines • 466 kB
JavaScript
!function(){var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function t(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}var r=e.parcelRequire55a5;r.register("aB40U",(function(n,i){t(n.exports,"selfId",(function(){return Qs})),t(n.exports,"joinRoom",(function(){return Tu})),t(n.exports,"defaultRelayUrls",(function(){return Mu})),t(n.exports,"getRelaySockets",(function(){return Ru}));var o,a,s,u,l,c,f,d,h,p,v,y,g,b,m=r("f1evb"),w=r("1PH9R"),_=r("3u2tY"),S=r("hnmIs"),k=r("9yQwa"),E=r("9Klpk"),A=r("8qpTe"),x=r("gwSkA"),I=r("7ukXT"),P=r("8TzS1"),O=r("aFAb1"),T=r("kw2NY"),R=r("lxHBR"),M=r("gJ3S3"),C=r("3bWnf"),j=r("eT7f3"),B=r("9WzNc"),N=r("div3d"),U=r("kb0qF"),L=r("bgoEC"),D=r("7j4mF"),F=r("kC9n9"),W=r("1Qswt"),q=r("5ENmm"),H=r("6Wo7Q"),V=r("rJmE6"),z=r("hXL9f"),G=r("fSF4h"),K=r("bWNdT"),Q=r("32Euv"),Y=(Q=r("32Euv"),Object.defineProperty),J=Object.getOwnPropertyDescriptor,$=Object.getOwnPropertyNames,X={}.hasOwnProperty,Z=function(e,t){return function(){return e&&(t=e(e=0)),t}},ee=function(e,t){return function(){return t||e((t={exports:{}}).exports,t),t.exports}},te=function(e,t){for(var r in t)Y(e,r,{get:t[r],enumerable:!0})},re=function(e){return function(e,t,r,n){var i=!0,o=!1,a=void 0;if(t&&"object"==typeof t||"function"==typeof t)try{for(var s,u=function(){var r=s.value;!X.call(e,r)&&undefined!==r&&Y(e,r,{get:function(){return t[r]},enumerable:!(n=J(t,r))||n.enumerable})},l=$(t)[Symbol.iterator]();!(i=(s=l.next()).done);i=!0)u()}catch(e){o=!0,a=e}finally{try{i||null==l.return||l.return()}finally{if(o)throw a}}return e}(Y({},"__esModule",{value:!0}),e)},ne=Z((function(){})),ie={};function oe(e){throw Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function ae(){!Se||!ke||(Se=!1,ke.length?_e=ke.concat(_e):Ee=-1,_e.length&&se())}function se(){if(!Se){var e=setTimeout(ae,0);Se=!0;for(var t=_e.length;t;){for(ke=_e,_e=[];++Ee<t;)ke&&ke[Ee].run();Ee=-1,t=_e.length}ke=null,Se=!1,clearTimeout(e)}}function ue(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];_e.push(new le(e,t)),1===_e.length&&!Se&&setTimeout(se,0)}function le(e,t){this.fun=e,this.array=t}function ce(){}function fe(){oe("_linkedBinding")}function de(){oe("dlopen")}function he(){return[]}function pe(){return[]}function ve(e,t){if(!e)throw Error(t||"assertion error")}function ye(){return!1}function ge(){return mt.now()/1e3}function be(e){var t=Math.floor(.001*(Date.now()-mt.now())),r=.001*mt.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=_t)),[n,i]}function me(){return Ct}function we(){return[]}te(ie,{_debugEnd:function(){return ot},_debugProcess:function(){return it},_events:function(){return kt},_eventsCount:function(){return Et},_exiting:function(){return He},_fatalExceptions:function(){return tt},_getActiveHandles:function(){return pe},_getActiveRequests:function(){return he},_kill:function(){return Ge},_linkedBinding:function(){return fe},_maxListeners:function(){return St},_preload_modules:function(){return gt},_rawDebug:function(){return Fe},_startProfilerIdleNotifier:function(){return at},_stopProfilerIdleNotifier:function(){return st},_tickCallback:function(){return nt},abort:function(){return ft},addListener:function(){return At},allowedNodeEnvironmentFlags:function(){return Ze},arch:function(){return xe},argv:function(){return Oe},argv0:function(){return yt},assert:function(){return ve},binding:function(){return je},browser:function(){return De},chdir:function(){return Ue},config:function(){return Ve},cpuUsage:function(){return Ke},cwd:function(){return Ne},debugPort:function(){return vt},default:function(){return Ct},dlopen:function(){return de},domain:function(){return qe},emit:function(){return Tt},emitWarning:function(){return Ce},env:function(){return Pe},execArgv:function(){return Te},execPath:function(){return pt},exit:function(){return $e},features:function(){return et},hasUncaughtExceptionCaptureCallback:function(){return ye},hrtime:function(){return be},kill:function(){return Je},listeners:function(){return we},memoryUsage:function(){return Ye},moduleLoadList:function(){return We},nextTick:function(){return ue},off:function(){return It},on:function(){return me},once:function(){return xt},openStdin:function(){return Xe},pid:function(){return dt},platform:function(){return Ie},ppid:function(){return ht},prependListener:function(){return Rt},prependOnceListener:function(){return Mt},reallyExit:function(){return ze},release:function(){return Le},removeAllListeners:function(){return Ot},removeListener:function(){return Pt},resourceUsage:function(){return Qe},setSourceMapsEnabled:function(){return bt},setUncaughtExceptionCaptureCallback:function(){return rt},stderr:function(){return lt},stdin:function(){return ct},stdout:function(){return ut},title:function(){return Ae},umask:function(){return Be},uptime:function(){return ge},version:function(){return Re},versions:function(){return Me}});var _e,Se,ke,Ee,Ae,xe,Ie,Pe,Oe,Te,Re,Me,Ce,je,Be,Ne,Ue,Le,De,Fe,We,qe,He,Ve,ze,Ge,Ke,Qe,Ye,Je,$e,Xe,Ze,et,tt,rt,nt,it,ot,at,st,ut,lt,ct,ft,dt,ht,pt,vt,yt,gt,bt,mt,wt,_t,St,kt,Et,At,xt,It,Pt,Ot,Tt,Rt,Mt,Ct,jt=Z((function(){ne(),Jt(),Bt(),_e=[],Se=!1,Ee=-1,le.prototype.run=function(){this.fun.apply(null,this.array)},Ae="browser",xe="x64",Ie="browser",Pe={PATH:"/usr/bin",LANG:("undefined"==typeof navigator?"undefined":(0,V.default)(navigator))<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},Oe=["/usr/bin/node"],Te=[],Re="v16.8.0",Me={},Ce=function(e,t){console.warn((t?t+": ":"")+e)},je=function(){oe("binding")},Be=function(){return 0},Ne=function(){return"/"},Ue=function(){},Le={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},De=!0,Fe=ce,We=[],qe={},He=!1,Ve={},ze=ce,Ge=ce,Qe=Ke=function(){return{}},Ye=Ke,Je=ce,$e=ce,Xe=ce,Ze={},et={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},tt=ce,rt=ce,nt=ce,it=ce,ot=ce,at=ce,st=ce,ut=void 0,lt=void 0,ct=void 0,ft=ce,dt=2,ht=1,pt="/bin/usr/node",vt=9229,yt="node",gt=[],bt=ce,void 0===(mt={now:("undefined"==typeof performance?"undefined":(0,V.default)(performance))<"u"?performance.now.bind(performance):void 0,timing:("undefined"==typeof performance?"undefined":(0,V.default)(performance))<"u"?performance.timing:void 0}).now&&(wt=Date.now(),mt.timing&&mt.timing.navigationStart&&(wt=mt.timing.navigationStart),mt.now=function(){return Date.now()-wt}),_t=1e9,be.bigint=function(e){var t=be(e);return("undefined"==typeof BigInt?"undefined":(0,V.default)(BigInt))>"u"?t[0]*_t+t[1]:BigInt(t[0]*_t)+BigInt(t[1])},Ct={version:Re,versions:Me,arch:xe,platform:Ie,browser:De,release:Le,_rawDebug:Fe,moduleLoadList:We,binding:je,_linkedBinding:fe,_events:kt={},_eventsCount:Et=0,_maxListeners:St=10,on:me,addListener:At=me,once:xt=me,off:It=me,removeListener:Pt=me,removeAllListeners:Ot=me,emit:Tt=ce,prependListener:Rt=me,prependOnceListener:Mt=me,listeners:we,domain:qe,_exiting:He,config:Ve,dlopen:de,uptime:ge,_getActiveRequests:he,_getActiveHandles:pe,reallyExit:ze,_kill:Ge,cpuUsage:Ke,resourceUsage:Qe,memoryUsage:Ye,kill:Je,exit:$e,openStdin:Xe,allowedNodeEnvironmentFlags:Ze,assert:ve,features:et,_fatalExceptions:tt,setUncaughtExceptionCaptureCallback:rt,hasUncaughtExceptionCaptureCallback:ye,emitWarning:Ce,nextTick:ue,_tickCallback:nt,_debugProcess:it,_debugEnd:ot,_startProfilerIdleNotifier:at,_stopProfilerIdleNotifier:st,stdout:ut,stdin:ct,stderr:lt,abort:ft,umask:Be,chdir:Ue,cwd:Ne,env:Pe,title:Ae,argv:Oe,execArgv:Te,pid:dt,ppid:ht,execPath:pt,debugPort:vt,hrtime:be,argv0:yt,_preload_modules:gt,setSourceMapsEnabled:bt}})),Bt=Z((function(){jt()}));function Nt(){var e=function(e){if(e>Z)throw new RangeError('The value "'+e+'" is invalid for option "size"');var r=new Uint8Array(e);return Object.setPrototypeOf(r,t.prototype),r},t=function(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return i(e)}return r(e,t,n)},r=function(r,n,i){if("string"==typeof r)return function(r,n){if(("string"!=typeof n||""===n)&&(n="utf8"),!t.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=0|u(r,n),o=e(i),a=o.write(r,n);return a!==i&&(o=o.slice(0,a)),o}(r,n);if(ArrayBuffer.isView(r))return function(e){if(z(e,Uint8Array)){var t=new Uint8Array(e);return a(t.buffer,t.byteOffset,t.byteLength)}return o(e)}(r);if(null==r)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+(void 0===r?"undefined":(0,V.default)(r)));if(z(r,ArrayBuffer)||r&&z(r.buffer,ArrayBuffer)||("undefined"==typeof SharedArrayBuffer?"undefined":(0,V.default)(SharedArrayBuffer))<"u"&&(z(r,SharedArrayBuffer)||r&&z(r.buffer,SharedArrayBuffer)))return a(r,n,i);if("number"==typeof r)throw new TypeError('The "value" argument must not be of type number. Received type number');var l=r.valueOf&&r.valueOf();if(null!=l&&l!==r)return t.from(l,n,i);var c=function(r){if(t.isBuffer(r)){var n=0|s(r.length),i=e(n);return 0===i.length||r.copy(i,0,0,n),i}return void 0!==r.length?"number"!=typeof r.length||G(r.length)?e(0):o(r):"Buffer"===r.type&&Array.isArray(r.data)?o(r.data):void 0}(r);if(c)return c;if(("undefined"==typeof Symbol?"undefined":(0,V.default)(Symbol))<"u"&&null!=Symbol.toPrimitive&&"function"==typeof r[Symbol.toPrimitive])return t.from(r[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+(void 0===r?"undefined":(0,V.default)(r)))},n=function(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"')},i=function(t){return n(t),e(t<0?0:0|s(t))},o=function(t){for(var r=t.length<0?0:0|s(t.length),n=e(r),i=0;i<r;i+=1)n[i]=255&t[i];return n},a=function(e,r,n){if(r<0||e.byteLength<r)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<r+(n||0))throw new RangeError('"length" is outside of buffer bounds');var i;return i=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),Object.setPrototypeOf(i,t.prototype),i},s=function(e){if(e>=Z)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Z.toString(16)+" bytes");return 0|e},u=function(e,r){if(t.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 '+(void 0===e?"undefined":(0,V.default)(e)));var n=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===n)return 0;for(var o=!1;;)switch(r){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return F(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return q(e).length;default:if(o)return i?-1:F(e).length;r=(""+r).toLowerCase(),o=!0}},l=function(e,t,r){var 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 k(this,t,r);case"utf8":case"utf-8":return w(this,t,r);case"ascii":return _(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return b(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}},c=function(e,t,r){var n=e[t];e[t]=e[r],e[r]=n},f=function(e,r,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),G(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof r&&(r=t.from(r,i)),t.isBuffer(r))return 0===r.length?-1:d(e,r,n,i,o);if("number"==typeof r)return r&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,r,n):Uint8Array.prototype.lastIndexOf.call(e,r,n):d(e,[r],n,i,o);throw new TypeError("val must be string, number or Buffer")},d=function(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=(n+"").toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=r;o<s;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var f=!0,d=0;d<u;d++)if(l(e,o+d)!==l(t,d)){f=!1;break}if(f)return o}return-1},h=function(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o,a=t.length;for(n>a/2&&(n=a/2),o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(G(s))return o;e[r+o]=s}return o},p=function(e,t,r,n){return H(F(t,e.length-r),e,r,n)},v=function(e,t,r,n){return H(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)},y=function(e,t,r,n){return H(q(t),e,r,n)},g=function(e,t,r,n){return H(function(e,t){for(var r,n,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=(r=e.charCodeAt(a))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)},b=function(e,t,r){return 0===t&&r===e.length?J.fromByteArray(e):J.fromByteArray(e.slice(t,r))},w=function(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o=e[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=r){var u=void 0,l=void 0,c=void 0,f=void 0;switch(s){case 1:o<128&&(a=o);break;case 2:128==(192&(u=e[i+1]))&&((f=(31&o)<<6|63&u)>127&&(a=f));break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&((f=(15&o)<<12|(63&u)<<6|63&l)>2047&&(f<55296||f>57343)&&(a=f));break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&((f=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&f<1114112&&(a=f))}}null===a?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|1023&a),n.push(a),i+=s}return function(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=ee));return r}(n)},_=function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n},S=function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n},k=function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=ne[e[o]];return i},A=function(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i},x=function(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")},I=function(e,r,n,i,o,a){if(!t.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<a)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")},P=function(e,t,r,n,i){N(t,n,i,e,r,7);var o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r},O=function(e,t,r,n,i){N(t,n,i,e,r,7);var 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;var a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8},T=function(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")},R=function(e,t,r,n,i){return t=+t,r>>>=0,i||T(e,0,r,4),$.write(e,t,r,n,23,4),r+4},M=function(e,t,r,n,i){return t=+t,r>>>=0,i||T(e,0,r,8),$.write(e,t,r,n,52,8),r+8},j=function(e,t,r){te[e]=function(r){"use strict";(0,U.default)(i,r);var n=(0,K.default)(i);function i(){var r;return(0,E.default)(this,i),r=n.call(this),Object.defineProperty((0,m.default)(r),"message",{value:t.apply((0,m.default)(r),arguments),writable:!0,configurable:!0}),r.name="".concat(r.name," [").concat(e,"]"),r.stack,delete r.name,(0,W.default)(r)}return(0,C.default)(i,[{key:"code",get:function(){return e},set:function(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}},{key:"toString",value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}}]),i}(r)},B=function(e){for(var t="",r=e.length,n="-"===e[0]?1:0;r>=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)},N=function(e,t,r,n,i,o){if(e>r||e<t){var a,s="bigint"==(void 0===t?"undefined":(0,V.default)(t))?"n":"";throw a=0===t||t===BigInt(0)?">= 0".concat(s," and < 2").concat(s," ** ").concat(8*(o+1)).concat(s):">= -(2".concat(s," ** ").concat(8*(o+1)-1).concat(s,") and < 2 ** ").concat(8*(o+1)-1).concat(s),new te.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,r){L(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&D(t,e.length-(r+1))}(n,i,o)},L=function(e,t){if("number"!=typeof e)throw new te.ERR_INVALID_ARG_TYPE(t,"number",e)},D=function(e,t,r){throw Math.floor(e)!==e?(L(e,r),new te.ERR_OUT_OF_RANGE("offset","an integer",e)):t<0?new te.ERR_BUFFER_OUT_OF_BOUNDS:new te.ERR_OUT_OF_RANGE("offset",">= 0 and <= "+t,e)},F=function(e,t){t=t||1/0;for(var r,n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+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 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},q=function(e){return J.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(re,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))},H=function(e,t,r,n){var i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i},z=function(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name},G=function(e){return e!=e},Q=function(e){return("undefined"==typeof BigInt?"undefined":(0,V.default)(BigInt))>"u"?Y:e},Y=function(){throw Error("BigInt not supported")};if(qt)return Wt;qt=!0;var J=function(){var e=function(e){var t=e.length;if(t%4>0)throw 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]},t=function(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]},r=function(e,r,n){for(var i,o=[],a=r;a<n;a+=3)i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(t(i));return o.join("")};if(Lt)return Ut;Lt=!0,Ut.byteLength=function(t){var r=e(t),n=r[0],i=r[1];return 3*(n+i)/4-i},Ut.toByteArray=function(t){var r,n,a=e(t),s=a[0],u=a[1],l=new o(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),c=0,f=u>0?s-4:s;for(n=0;n<f;n+=4)r=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],l[c++]=r>>16&255,l[c++]=r>>8&255,l[c++]=255&r;return 2===u&&(r=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,l[c++]=255&r),1===u&&(r=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,l[c++]=r>>8&255,l[c++]=255&r),l},Ut.fromByteArray=function(e){for(var t,i=e.length,o=i%3,a=[],s=16383,u=0,l=i-o;u<l;u+=s)a.push(r(e,u,u+s>l?l:u+s));return 1===o?(t=e[i-1],a.push(n[t>>2]+n[t<<4&63]+"==")):2===o&&(t=(e[i-2]<<8)+e[i-1],a.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),a.join("")};for(var n=[],i=[],o=("undefined"==typeof Uint8Array?"undefined":(0,V.default)(Uint8Array))<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;return i[45]=62,i[95]=63,Ut}(),$=(Ft||(Ft=!0,Dt.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,l=u>>1,c=-7,f=r?i-1:0,d=r?-1:1,h=e[t+f];for(f+=d,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=256*o+e[t+f],f+=d,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=256*a+e[t+f],f+=d,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),o-=l}return(h?-1:1)*a*Math.pow(2,o-n)},Dt.write=function(e,t,r,n,i,o){var a,s,u,l=8*o-i-1,c=(1<<l)-1,f=c>>1,d=23===i?5.960464477539062e-8:0,h=n?0:o-1,p=n?1:-1,v=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(s=isNaN(t)?1:0,a=c):(t*(u=Math.pow(2,-(a=Math.floor(Math.log(t)/Math.LN2))))<1&&(a--,u*=2),(t+=a+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(a++,u/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*u-1)*Math.pow(2,i),a+=f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[r+h]=255&s,h+=p,s/=256,i-=8);for(a=a<<i|s,l+=i;l>0;e[r+h]=255&a,h+=p,a/=256,l-=8);e[r+h-p]|=128*v}),Dt),X="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;Wt.Buffer=t,Wt.SlowBuffer=function(e){return+e!=e&&(e=0),t.alloc(+e)},Wt.INSPECT_MAX_BYTES=50;var Z=2147483647;Wt.kMaxLength=Z,t.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!t.TYPED_ARRAY_SUPPORT&&("undefined"==typeof console?"undefined":(0,V.default)(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(t.prototype,"parent",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.buffer}}),Object.defineProperty(t.prototype,"offset",{enumerable:!0,get:function(){if(t.isBuffer(this))return this.byteOffset}}),t.poolSize=8192,t.from=function(e,t,n){return r(e,t,n)},Object.setPrototypeOf(t.prototype,Uint8Array.prototype),Object.setPrototypeOf(t,Uint8Array),t.alloc=function(t,r,i){return function(t,r,i){return n(t),t<=0?e(t):void 0!==r?"string"==typeof i?e(t).fill(r,i):e(t).fill(r):e(t)}(t,r,i)},t.allocUnsafe=function(e){return i(e)},t.allocUnsafeSlow=function(e){return i(e)},t.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==t.prototype},t.compare=function(e,r){if(z(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),z(r,Uint8Array)&&(r=t.from(r,r.offset,r.byteLength)),!t.isBuffer(e)||!t.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var n=e.length,i=r.length,o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0},t.isEncoding=function(e){switch((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}},t.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return t.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=t.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){var a=e[n];if(z(a,Uint8Array))o+a.length>i.length?(t.isBuffer(a)||(a=t.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else{if(!t.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o)}o+=a.length}return i},t.byteLength=u,t.prototype._isBuffer=!0,t.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)c(this,t,t+1);return this},t.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)c(this,t,t+3),c(this,t+1,t+2);return this},t.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)c(this,t,t+7),c(this,t+1,t+6),c(this,t+2,t+5),c(this,t+3,t+4);return this},t.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?w(this,0,e):l.apply(this,arguments)},t.prototype.toLocaleString=t.prototype.toString,t.prototype.equals=function(e){if(!t.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===t.compare(this,e)},t.prototype.inspect=function(){var e="",t=Wt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},X&&(t.prototype[X]=t.prototype.inspect),t.prototype.compare=function(e,r,n,i,o){if(z(e,Uint8Array)&&(e=t.from(e,e.offset,e.byteLength)),!t.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+(void 0===e?"undefined":(0,V.default)(e)));if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(n>>>=0)-(r>>>=0),u=Math.min(a,s),l=this.slice(i,o),c=e.slice(r,n),f=0;f<u;++f)if(l[f]!==c[f]){a=l[f],s=c[f];break}return a<s?-1:s<a?1:0},t.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},t.prototype.indexOf=function(e,t,r){return f(this,e,t,r,!0)},t.prototype.lastIndexOf=function(e,t,r){return f(this,e,t,r,!1)},t.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 Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var 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");for(var o=!1;;)switch(n){case"hex":return h(this,e,t,r);case"utf8":case"utf-8":return p(this,e,t,r);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return y(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},t.prototype.toJSON=function(){return{type:"Buffer",data:[].slice.call(this._arr||this,0)}};var ee=4096;t.prototype.slice=function(e,r){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<e&&(r=e);var i=this.subarray(e,r);return Object.setPrototypeOf(i,t.prototype),i},t.prototype.readUintLE=t.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},t.prototype.readUintBE=t.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},t.prototype.readUint8=t.prototype.readUInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),this[e]},t.prototype.readUint16LE=t.prototype.readUInt16LE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]|this[e+1]<<8},t.prototype.readUint16BE=t.prototype.readUInt16BE=function(e,t){return e>>>=0,t||x(e,2,this.length),this[e]<<8|this[e+1]},t.prototype.readUint32LE=t.prototype.readUInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},t.prototype.readUint32BE=t.prototype.readUInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},t.prototype.readBigUInt64LE=Q((function(e){L(e>>>=0,"offset");var t=this[e],r=this[e+7];(void 0===t||void 0===r)&&D(e,this.length-8);var n=t+256*this[++e]+65536*this[++e]+this[++e]*Math.pow(2,24),i=this[++e]+256*this[++e]+65536*this[++e]+r*Math.pow(2,24);return BigInt(n)+(BigInt(i)<<BigInt(32))})),t.prototype.readBigUInt64BE=Q((function(e){L(e>>>=0,"offset");var t=this[e],r=this[e+7];(void 0===t||void 0===r)&&D(e,this.length-8);var n=t*Math.pow(2,24)+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*Math.pow(2,24)+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)})),t.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},t.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||x(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},t.prototype.readInt8=function(e,t){return e>>>=0,t||x(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},t.prototype.readInt16LE=function(e,t){e>>>=0,t||x(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt16BE=function(e,t){e>>>=0,t||x(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},t.prototype.readInt32LE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},t.prototype.readInt32BE=function(e,t){return e>>>=0,t||x(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},t.prototype.readBigInt64LE=Q((function(e){L(e>>>=0,"offset");var t=this[e],r=this[e+7];(void 0===t||void 0===r)&&D(e,this.length-8);var 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]*Math.pow(2,24))})),t.prototype.readBigInt64BE=Q((function(e){L(e>>>=0,"offset");var t=this[e],r=this[e+7];(void 0===t||void 0===r)&&D(e,this.length-8);var n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*Math.pow(2,24)+65536*this[++e]+256*this[++e]+r)})),t.prototype.readFloatLE=function(e,t){return e>>>=0,t||x(e,4,this.length),$.read(this,e,!0,23,4)},t.prototype.readFloatBE=function(e,t){return e>>>=0,t||x(e,4,this.length),$.read(this,e,!1,23,4)},t.prototype.readDoubleLE=function(e,t){return e>>>=0,t||x(e,8,this.length),$.read(this,e,!0,52,8)},t.prototype.readDoubleBE=function(e,t){return e>>>=0,t||x(e,8,this.length),$.read(this,e,!1,52,8)},t.prototype.writeUintLE=t.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},t.prototype.writeUintBE=t.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},t.prototype.writeUint8=t.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,255,0),this[t]=255&e,t+1},t.prototype.writeUint16LE=t.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeUint16BE=t.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeUint32LE=t.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(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},t.prototype.writeUint32BE=t.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(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},t.prototype.writeBigUInt64LE=Q((function(e){return P(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),t.prototype.writeBigUInt64BE=Q((function(e){return O(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,BigInt(0),BigInt("0xffffffffffffffff"))})),t.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},t.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a|0)-s&255;return t+r},t.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},t.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},t.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},t.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(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},t.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(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},t.prototype.writeBigInt64LE=Q((function(e){return P(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),t.prototype.writeBigInt64BE=Q((function(e){return O(this,e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),t.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},t.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},t.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},t.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},t.prototype.copy=function(e,r,n,i){if(!t.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&0!==i&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||0===e.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o},t.prototype.fill=function(e,r,n,i){if("string"==typeof e){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!t.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(1===e.length){var o=e.charCodeAt(0);("utf8"===i&&o<128||"latin1"===i)&&(e=o)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var a;if(r>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=r;a<n;++a)this[a]=e;else{var s=t.isBuffer(e)?e:t.from(e,i),u=s.length;if(0===u)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<n-r;++a)this[a+r]=s[a%u]}return this};var te={};j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?e+" is outside of buffer bounds":"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return'The "'.concat(e,'" argument must be of type number. Received type ').concat(void 0===t?"undefined":(0,V.default)(t))}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){var n='The value of "'.concat(e,'" is out of range.'),i=r;return Number.isInteger(r)&&Math.abs(r)>Math.pow(2,32)?i=B(r+""):"bigint"==(void 0===r?"undefined":(0,V.default)(r))&&(i=r+"",(r>Math.pow(BigInt(2),BigInt(32))||r<-Math.pow(BigInt(2),BigInt(32)))&&(i=B(i)),i+="n"),n+=" It must be ".concat(t,". Received ").concat(i)}),RangeError);var re=/[^+/0-9A-Za-z-_]/g,ne=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}();return Wt}var Ut,Lt,Dt,Ft,Wt,qt,Ht=Z((function(){ne(),Jt(),Bt(),Ut={},Lt=!1,Dt={},Ft=!1,Wt={},qt=!1})),Vt={};te(Vt,{Buffer:function(){return Gt},INSPECT_MAX_BYTES:function(){return Kt},default:function(){return zt},kMaxLength:function(){return Qt}});var zt,Gt,Kt,Qt,Yt=Z((function(){ne(),Jt(),Bt(),Ht(),(zt=Nt()).Buffer,zt.SlowBuffer,zt.INSPECT_MAX_BYTES,zt.kMaxLength,Gt=zt.Buffer,Kt=zt.INSPECT_MAX_BYTES,Qt=zt.kMaxLength})),Jt=Z((function(){Yt()})),$t=ee((function(e,t){var r;ne(),Jt(),Bt(),t.exports={AggregateError:function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e){var n;if((0,E.default)(this,r),!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+(void 0===e?"undefined":(0,V.default)(e)));for(var i="",o=0;o<e.length;o++)i+=" ".concat(e[o].stack,"\n");return(n=t.call(this,i)).name="AggregateError",n.errors=e,(0,W.default)(n)}return r}((0,G.default)(Error)),ArrayIsArray:function(e){return Array.isArray(e)},ArrayPrototypeIncludes:function(e,t){return e.includes(t)},ArrayPrototypeIndexOf:function(e,t){return e.indexOf(t)},ArrayPrototypeJoin:function(e,t){return e.join(t)},ArrayPrototypeMap:function(e,t){return e.map(t)},ArrayPrototypePop:function(e,t){return e.pop(t)},ArrayPrototypePush:function(e,t){return e.push(t)},ArrayPrototypeSlice:function(e,t,r){return e.slice(t,r)},Error:Error,FunctionPrototypeCall:function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),o=2;o<n;o++)i[o-2]=arguments[o];return(r=e).call.apply(r,[t].concat((0,H.default)(i)))},FunctionPrototypeSymbolHasInstance:function(e,t){return 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:function(e,t){return Object.defineProperties(e,t)},ObjectDefineProperty:function(e,t,r){return Object.defineProperty(e,t,r)},ObjectGetOwnPropertyDescriptor:function(e,t){return Object.getOwnPropertyDescriptor(e,t)},ObjectKeys:function(e){return Object.keys(e)},ObjectSetPrototypeOf:function(e,t){return Object.setPrototypeOf(e,t)},Promise:Promise,PromisePrototypeCatch:function(e,t){return e.catch(t)},PromisePrototypeThen:function(e,t,r){return e.then(t,r)},PromiseReject:function(e){return Promise.reject(e)},PromiseResolve:function(e){return Promise.resolve(e)},ReflectApply:Reflect.apply,RegExpPrototypeTest:function(e,t){return e.test(t)},SafeSet:Set,String:String,StringPrototypeSlice:function(e,t,r){return e.slice(t,r)},StringPrototypeToLowerCase:function(e){return e.toLowerCase()},StringPrototypeToUpperCase:function(e){return e.toUpperCase()},StringPrototypeTrim:function(e){return e.trim()},Symbol:Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol(),SymbolAsyncDispose:Symbol.asyncDispose||Symbol(),TypedArrayPrototypeSet:function(e,t,r){return e.set(t,r)},Boolean:Boolean,Uint8Array:Uint8Array}})),Xt=ee((function(e,t){ne(),Jt(),Bt(),t.exports={format:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e.replace(/%([sdifj])/g,(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i=(0,q.default)(t,2),o=(i[0],i[1]),a=r.shift();return"f"===o?a.toFixed(6):"j"===o?JSON.stringify(a):"s"===o&&"object"==typeof a?((a.constructor!==Object?a.constructor.name:"")+" {}").trim():a.toString()}))},inspect:function(e){switch(void 0===e?"undefined":(0,V.default)(e)){case"string":if(e.includes("'")){if(!e.includes('"'))return'"'.concat(e,'"');if(!e.includes("`")&&!e.includes("${"))return"`".concat(e,"`")}return"'".concat(e,"'");case"number":return isNaN(e)?"NaN":Object.is(e,-0)?e+"":e;case"bigint":return e+"n";case"boolean":case"undefined":return e+"";case"object":return"{}"}}}})),Zt=ee((function(e,t){var r=function(e,t){if(!e)throw new p.ERR_INTERNAL_ASSERTION(t)},n=function(e){for(var t="",r=e.length,n="-"===e[0]?1:0;r>=n+4;r-=3)t="_".concat(e.slice(r-3,r)).concat(t);return"".concat(e.slice(0,r)).concat(t)},i=function(e,t,n){n||(n=Error);var i=function(n){"use strict";(0,U.default)(o,n);var i=(0,K.default)(o);function o(){for(var n=arguments.length,a=new Array(n),u=0;u<n;u++)a[u]=arguments[u];return(0,E.default)(this,o),i.call(this,function(e,t,n){if("function"==typeof t)return r(t.length<=n.length,"Code: ".concat(e,"; The provided arguments length (").concat(n.length,") does not match the required ones (").concat(t.length,").")),t.apply(void 0,(0,H.default)(n));var i=(t.match(/%[dfijoOs]/g)||[]).length;return r(i===n.length,"Code: ".concat(e,"; The provided arguments length (").concat(n.length,") does not match the required ones (").concat(i,").")),0===n.length?t:s.apply(void 0,[t].concat((0,H.default)(n)))}(e,t,a))}return(0,C.default)(o,[{key:"toString",value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)}}]),o}(n);Object.defineProperties(i.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:function(){return"".concat(this.name," [").concat(e,"]: ").concat(this.message)},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[f]=!0,p[e]=i},o=function(e){var t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e};ne(),Jt(),Bt();var a=Xt(),s=a.format,u=a.inspect,l=$t().AggregateError,c=globalThis.AggregateError||l,f=Symbol(),d=["string","function","number","object","Function","Object","boolean","bigint","symbol"],h=/^([A-Z][a-z0-9]*)+$/,p={};i("ERR_ASSERTION","%s",Error),i("ERR_INVALID_ARG_TYPE",(function(e,t,n){r("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);var i="The ";e.endsWith(" argument")?i+=e+" ":i+='"'.concat(e,'" ').concat(e.includes(".")?"property":"argument"," "),i+="must be ";var o=[],a=[],s=[],l=!0,c=!1,f=void 0;try{for(var p,v=t[Symbol.iterator]();!(l=(p=v.next()).done);l=!0){var y=p.value;r("string"==typeof y,"All expected entries have to be of type string"),d.includes(y)?o.push(y.toLowerCase()):h.test(y)?a.push(y):(r("object"!==y,'The value "object" should be written as "Object"'),s.push(y))}}catch(e){c=!0,f=e}finally{try{l||null==v.return||v.return()}finally{if(c)throw f}}if(a.length>0){var g=o.indexOf("object");-1!==g&&(o.splice(o,g,1),a.push("Object"))}if(o.length>0){switch(o.length){case 1:i+="of type "+o[0];break;case 2:i+="one of type ".concat(o[0]," or ").concat(o[1]);break;default:var b=o.pop();i+="one of type ".concat(o.join(", "),", or ").concat(b)}(a.length>0||s.length>0)&&(i+=" or ")}if(a.length>0){switch(a.length){case 1:i+="an instance of "+a[0];break;case 2:i+="an instance of ".concat(a[0]," or ").concat(a[1]);break;default:var m=a.pop();i+="an instance of ".concat(a.join(", "),", or ").concat(m)}s.length>0&&(i+=" or ")}switch(s.length){case 0:break;case 1:s[0].toLowerCase()!==s[0]&&(i+="an "),i+=""+s[0];break;case 2:i+="one of ".concat(s[0]," or ").concat(s[1]);break;default:var w=s.pop();i+="one of ".concat(s.join(", "),", or ").concat(w)}if(null==n)i+=". Received "+n;else if("function"==typeof n&&n.name)i+=". Received function "+n.name;else if("object"==typeof n){var _;null!==(_=n.constructor)&&void 0!==_&&_.name?i+=". Received an instance of "+n.constructor.name:i+=". Received "+u(n,{depth:-1})}else{var S=u(n,{colors:!1});S.length>25&&(S=S.slice(0,25)+"..."),i+=". Received type ".concat(void 0===n?"undefined":(0,V.default)(n)," (").concat(S,")")}return i}),TypeError),i("ERR_INVALID_ARG_VALUE",(function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid",n=u(t);return n.length>128&&(n=n.slice(0,128)+"..."),"The ".concat(e.includes(".")?"property":"argument"," '").concat(e,"' ").concat(r,". Received ").concat(n)}),TypeError),i("ERR_INVALID_RETURN_VALUE",(function(e,t,r){var n;return"Expected ".concat(e,' to be returned from the "').concat(t,'" function but got ').concat(null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?"instance of "+r.constructor.name:"type "+(void 0===r?"undefined":(0,V.default)(r)),".")}),TypeError),i("ERR_MISSING_ARGS",(function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];r(t.length>0,"At least one arg needs to be specified");var i,o=t.length;switch(t=(Array.isArray(t)?t:[t]).map((function(e){return'"'.concat(e,'"')})).join(" or "),o){case 1:i+="The ".concat(t[0]," argument");break;case 2:i+="The ".concat(t[0]," and ").concat(t[1]," arguments");break;default:var a=t.pop();i+="The ".concat(t.join(", "),", and ").concat(a," arguments")}return i+" must be specified"}),TypeError),i("ERR_OUT_OF_RANGE",(function(e,t,i){var o;if(r(t,'Missing "range" argument'),Number.isInteger(i)&&Math.abs(i)>Math.pow(2,32))o=n(i+"");else if("bigint"==(void 0===i?"undefined":(0,V.default)(i))){o=i+"";var a=Math.pow(BigInt(2),BigInt(32));(i>a||i<-a)&&(o=n(o)),o+="n"}else o=u(i);return'The value of "'.concat(e,'" is out of range. It must be ').concat(t,". Received ").concat(o)}),RangeError),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),i("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),i("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),i("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),i("ERR_STREAM_WRITE_AFTER_END","write after end",Error),i("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"The operation was aborted",i=arguments.length>1?arguments[1]:void 0;if((0,E.default)(this,r),void 0!==i&&"object"!=typeof i)throw new p.ERR_INVALID_ARG_TYPE("options","Object",i);return(e=t.call(this,n,i)).code="ABORT_ERR",e.name="AbortError",(0,W.default)(e)}return r}((0,G.default)(Error)),aggregateTwoErrors:o((function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;var r=new c([t,e],t.message);return r.code=t.code,r}return e||t})),hideStackFrames:o,codes:p}})),er=ee((function(e,t){ne(),Jt(),Bt();var r=("undefined"==typeof self?"undefined":(0,V.default)(self))<"u"?self:("undefined"==typeof window?"undefined":(0,V.default)(window))<"u"?window:void 0,n=r.AbortController,i=r.AbortSignal;t.exports=n,t.exports.AbortSignal=i,t.exports.default=n})),tr={};te(tr,{EventEmitter:function(){return or},default:function(){return ir},defaultMaxListeners:function(){return ar},init:function(){return sr},listenerCount:function(){return ur},on:function(){return lr},once:function(){return cr}});var rr,nr,ir,or,ar,sr,ur,lr,cr,fr,dr,hr,pr=Z((function(){var e;ne(),Jt(),Bt(),rr={},nr=!1,(ir=function(){var e=function(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+(void 0===e?"undefined":(0,V.default)(e)))},t=function(e){return void 0===e._maxListeners?h.defaultMaxListeners:e._maxListeners},r=function(r,n,i,o){var a,s,u;if(e(i),void 0===(s=r._events)?(s=r._events=Object.create(null),r._eventsCount=0):(void 0!==s.newListener&&(r.emit("newListener",n,i.listener?i.listener:i),s=r._events),u=s[n]),void 0===u)u=s[n]=i,++r._eventsCount;else if("function"==typeof u?u=s[n]=o?[i,u]:[u,i]:o?u.unshift(i):u.push(i),(a=t(r))>0&&u.length>a&&!u.warned){u.warned=!0;var l=Error("Possible EventEmitter memory leak detected. "+u.length+" "+n+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=r,l.type=n,l.count=u.length,function(e){console&&console.warn&&console.warn(e)}(l)}return r},n=function(){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)},i=function(e,t,r){var i={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=n.bind(i);return o.listener=r,i.wrapFn=o,o},o=function(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=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):s(i,i.length)},a=function(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},s=function(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r},u=function(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 '+(void 0===e?"undefined":(0,V.default)(e)));e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}};if(nr)return rr;nr=!0;var l,c="object"==typeof Reflect?Reflect:null,f=c&&"function"==typeof c.apply?c.apply:function(e,t,r){return function(){}.apply.call(e,t,r)};l=c&&"function"==typeof c.ownKeys?c.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var d=Number.isNaN||function(e){return e!=e};function h(){h.init.call(this)}(rr=h).once=function(e,t){return new Promise((function(r,n){var i=function(r){e.removeListener(t,o),n(r)},o=function(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))};u(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&u(e,"error",t,{once:!0})}(e,i)}))},h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var p=10;return Object.defineProperty(h,"defaultMaxListeners",{enumerable:!0,get:function(){return p},set:function(e){if("number"!=typeof e||e<0||d(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");p=e}}),h.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},h.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||d(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},h.prototype.getMaxListeners=function(){return t(this)},h.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)f(u,this,t);else{var l=u.length,c=s(u,l);for(r=0;r<l;++r)f(c[r],this,t)}return!0},h.prototype.addListener=function(e,t){return r(this,e,t,!1)},h.prototype.on=h.prototype.addListener,h.prototype.prependListener=function(e,t){return r(this,e,t,!0)},h.prototype.once=function(t,r){return e(r),this.on(t,i(this,t,r)),this},h.prototype.prependOnceListener=function(t,r){return e(r),this.prependListener(t,i(this,t,r)),this},h.prototype.removeListener=function(t,r){var n,i,o,a,s;if(e(r),void 0===(i=this._events))return this;if(void 0===(n=i[t]))return this;if(n===r||n.listener===r)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,n.listener||r));else if("function"!=typeof n){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){s=n[a].listener,o=a;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(i[t]=n[0]),void 0!==i.removeListener&&this.emit("removeListener",t,s||r)}return this},h.prototype.off=h.prototype.removeListener,h.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},h.prototype.listeners=function(e){return o(this,e,!0)},h.prototype.rawListeners=function(e){return o(this,e,!1)},h.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):a.call(e,t)},h.prototype.listenerCount=a,h.prototype.eventNames=function(){return this._eventsCount>0?l(this._events):[]},rr}()).once,ir.once=function(e,t){return new Promise((function(r,n){var i,o=function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];void 0!==i&&e.removeListener("error",i),r(n)};"error"!==t&&(i=function(t){e.removeListener(name,o),n(t)},e.once("error",i)),e.once(t,o)}))},ir.on=function(e,t){var r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=o.shift();n?n.resolve(createIterResult(t,!1)):i.push(t)},n=function(e){s=!0;var t=o.shift();t?t.reject(e):a=e,u.return()},i=[],o=[],a=null,s=!1,u=(0,j.default)({next:function(){return(0,S.default)((function(){var e,t;return(0,Q.__generator)(this,(function(r){return(e=i.shift())?[2,createIterResult(e,!1)]:a?(t=Promise.reject(a),[2,(a=null,t)]):[2,s?createIterResult(void 0,!0):new Promise((function(e,t){return o.push({resolve:e,reject:t})}))]}))}))()},return:function(){return(0,S.default)((function(){var i,a,u,l,c;return(0,Q.__generator)(this,(function(f){e.removeListener(t,r),e.removeListener("error",n),s=!0,i=!0,a=!1,u=void 0;try{for(l=o[Symbol.iterator]();!(i=(c=l.next()).done);i=!0)c.value.resolve(createIterResult(void 0,!0))}catch(e){a=!0,u=e}finally{try{i||null==l.return||l.return()}finally{if(a)throw u}}return[2,createIterResult(void 0,!0)]}))}))()},throw:function(i){a=i,e.removeListener(t,r),e.removeListener("error",n)}},Symbol.asyncIterator,(function(){return this}));return e.on(t,r),e.on("error",n),u},or=(e=ir).EventEmitter,ar=e.defaultMaxListeners,sr=e.init,ur=e.listenerCount,lr=e.on,cr=e.once})),vr=ee((function(e,t){ne(),Jt(),Bt();var r=(Yt(),re(Vt)),n=Xt(),i=n.format,o=n.inspect,a=Zt().codes.ERR_INVALID_ARG_TYPE,s=$t(),u=s.kResistStopPropagation,l=s.AggregateError,c=s.SymbolDispose,f=globalThis.AbortSignal||er().AbortSignal,d=globalThis.AbortController||er().AbortController,h=Object.getPrototypeOf((0,S.default)((function(){return(0,Q.__generator)(this,(function(e){return[2]}))}))).constructor,p=globalThis.Blob||r.Blob,v=(void 0===p?"undefined":(0,V.default)(p))<"u"?function(e){return e instanceof p}:function(){return!1},y=function(e,t){if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new a(t,"AbortSignal",e)};t.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once:function(e){var t=!1;return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t||(t=!0,e.apply(this,n))}},createDeferredPromise:function(){var e,t;return{promise:new Promise((function(r,n){e=r,t=n})),resolve:e,reject:t}},promisify:function(e){return new Promise((function(t,r){e((function(e){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return e?r(e):t.apply(void 0,(0,H.default)(i))}))}))},debuglog:function(){return function(){}},format:i,inspect:o,types:{isAsyncFunction:function(e){return e instanceof h},isArrayBufferView:function(e){return ArrayBuffer.isView(e)}},isBlob:v,deprecate:function(e){return e},addAbortListener:(pr(),re(tr)).addAbortListener||function(e,t){if(void 0===e)throw new a("signal","AbortSignal",e);var r;return y(e,"signal"),function(e,t){if("function"!=typeof e)throw new a("listener","Function",e)}(t),e.aborted?queueMicrotask((function(){return t()})):(e.addEventListener("abort",t,(0,j.default)({__proto__:null,once:!0},u,!0)),r=function(){e.removeEventListener("abort",t)}),(0,j.default)({__proto__:null},c,(function(){var e;null===(e=r)||void 0===e||e()}))},AbortSignalAny:f.any||function(e){if(1===e.length)return e[0];var t=new d,r=function(){return t.abort()};return e.forEach((function(e){y(e,"signals"),e.addEventListener("abort",r,{once:!0})})),t.signal.addEventListener("abort",(function(){e.forEach((function(e){return e.removeEventListener("abort",r)}))}),{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})),yr=ee((function(e,t){var r=function(e,t){if("string"!=typeof e)throw new A(t,"string",e)},n=function(e,t){if("boolean"!=typeof e)throw new A(t,"boolean",e)},i=function(e,t,r){return null!=e&&y(e,t)?e[t]:r},o=function(e,t){if((void 0===e?"undefined":(0,V.default)(e))>"u"||!g(Q,e))throw new x(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')};ne(),Jt(),Bt();var a=$t(),s=a.ArrayIsArray,u=a.ArrayPrototypeIncludes,l=a.ArrayPrototypeJoin,c=a.ArrayPrototypeMap,f=a.NumberIsInteger,d=a.NumberIsNaN,h=a.NumberMAX_SAFE_INTEGER,p=a.NumberMIN_SAFE_INTEGER,v=a.NumberParseInt,y=a.ObjectPrototypeHasOwnProperty,g=a.RegExpPrototypeExec,b=a.String,m=a.StringPrototypeToUpperCase,w=a.StringPrototypeTrim,_=Zt(),S=_.hideStackFrames,k=_.codes,E=k.ERR_SOCKET_BAD_PORT,A=k.ERR_INVALID_ARG_TYPE,x=k.ERR_INVALID_ARG_VALUE,I=k.ERR_OUT_OF_RANGE,P=k.ERR_UNKNOWN_SIGNAL,O=vr().normalizeEncoding,T=vr().types,R=T.isAsyncFunction,M=T.isArrayBufferView,C={},j=/^[0-7]+$/,B=S((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:p,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:h;if("number"!=typeof e)throw new A(t,"number",e);if(!f(e))throw new I(t,"an integer",e);if(e<r||e>n)throw new I(t,">= ".concat(r," && <= ").concat(n),e)})),N=S((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-2147483648,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2147483647;if("number"!=typeof e)throw new A(t,"number",e);if(!f(e))throw new I(t,"an integer",e);if(e<r||e>n)throw new I(t,">= ".concat(r," && <= ").concat(n),e)})),U=S((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"!=typeof e)throw new A(t,"number",e);if(!f(e))throw new I(t,"an integer",e);var n=r?1:0,i=4294967295;if(e<n||e>i)throw new I(t,">= ".concat(n," && <= ").concat(i),e)})),L=S((function(e,t,r){if(!u(r,e)){var n="must be one of: "+l(c(r,(function(e){return"string"==typeof e?"'".concat(e,"'"):b(e)})),", ");throw new x(t,e,n)}})),D=S((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=i(r,"allowArray",!1),o=i(r,"allowFunction",!1);if(!i(r,"nullable",!1)&&null===e||!n&&s(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new A(t,"Object",e)})),F=S((function(e,t){if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new A(t,"a dictionary",e)})),W=S((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!s(e))throw new A(t,"Array",e);if(e.length<r)throw new x(t,e,"must be longer than "+r)})),q=S((function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"buffer";if(!M(e))throw new A(t,["Buffer","TypedArray","DataView"],e)})),H=S((function(e,t){if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new A(t,"AbortSignal",e)})),z=S((function(e,t){if("function"!=typeof e)throw new A(t,"Function",e)})),G=S((function(e,t){if("function"!=typeof e||R(e))throw new A(t,"Function",e)})),K=S((function(e,t){if(void 0!==e)throw new A(t,"undefined",e)})),Q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;t.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if((void 0===e?"undefined":(0,V.default)(e))>"u"&&(e=r),"string"==typeof e){if(null===g(j,e))throw new x(t,e,"must be a 32-bit unsigned integer or an octal string");e=v(e,8)}return U(e,t),e},validateArray:W,validateStringArray:function(e,t){W(e,t);for(var n=0;n<e.length;n++)r(e[n],"".concat(t,"[").concat(n,"]"))},validateBooleanArray:function(e,t){W(e,t);for(var r=0;r<e.length;r++)n(e[r],"".concat(t,"[").concat(r,"]"))},validateAbortSignalArray:function(e,t){W(e,t);for(var r=0;r<e.length;r++){var n=e[r],i="".concat(t,"[").concat(r,"]");if(null==n)throw new A(i,"AbortSignal",n);H(n,i)}},validateBoolean:n,validateBuffer:q,validateDictionary:F,validateEncoding:function(e,t){var r=O(t),n=e.length;if("hex"===r&&n%2!=0)throw new x("encoding",t,"is invalid for data of length "+n)},validateFunction:z,validateInt32:N,validateInteger:B,validateNumber:function(e,t,r,n){if("number"!=typeof e)throw new A(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&d(e))throw new I(t,"".concat(null!=r?">= "+r:"").concat(null!=r&&null!=n?" && ":"").concat(null!=n?"<= "+n:""),e)},validateObject:D,validateOneOf:L,validatePlainFunction:G,validatePort:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Port",r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===w(e).length||+e!=+e>>>0||e>65535||0===e&&!r)throw new E(t,e,r);return 0|e},validateSignalName:function(e){if(r(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:"signal"),void 0===C[e])throw void 0!==C[m(e)]?new P(e+" (signals must use all capital letters)"):new P(e)},validateString:r,validateUint32:U,validateUndefined:K,validateUnion:function(e,t,r){if(!u(r,e))throw new A(t,"('".concat(l(r,"|"),"')"),e)},validateAbortSignal:H,validateLinkHeaderValue:function(e){if("string"==typeof e)return o(e,"hints"),e;if(s(e)){var t=e.length,r="";if(0===t)return r;for(var n=0;n<t;n++){var i=e[n];o(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new x("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}})),gr=ee((function(e,t){var r=function(){throw Error("setTimeout has not been defined")},n=function(){throw Error("clearTimeout has not been defined")},i=function(e){if(l===setTimeout)return setTimeout(e,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}},o=function(){!p||!d||(p=!1,d.length?h=d.concat(h):v=-1,h.length&&a())},a=function(){if(!p){var e=i(o);p=!0;for(var t=h.length;t;){for(d=h,h=[];++v<t;)d&&d[v].run();v=-1,t=h.length}d=null,p=!1,function(e){if(c===clearTimeout)return clearTimeout(e);if((c===n||!c)&&clearTimeout)return c=clearTimeout,clearTimeout(e);try{return c(e)}catch(t){try{return c.call(null,e)}catch(t){return c.call(this,e)}}}(e)}},s=function(e,t){this.fun=e,this.array=t},u=function(){};ne(),Jt(),Bt();var l,c,f=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(e){l=r}try{c="function"==typeof clearTimeout?clearTimeout:n}catch(e){c=n}}();var d,h=[],p=!1,v=-1;f.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];h.push(new s(e,t)),1===h.length&&!p&&i(a)},s.prototype.run=function(){this.fun.apply(null,this.array)},f.title="browser",f.browser=!0,f.env={},f.argv=[],f.version="",f.versions={},f.on=u,f.addListener=u,f.once=u,f.off=u,f.removeListener=u,f.removeAllListeners=u,f.emit=u,f.prependListener=u,f.prependOnceListener=u,f.listeners=function(){return[]},f.binding=function(){throw Error("process.binding is not supported")},f.cwd=function(){return"/"},f.chdir=function(){throw Error("process.chdir is not supported")},f.umask=function(){return 0}})),br=ee((function(e,t){var r=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||r&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(t=e._readableState)||void 0===t?void 0:t.readable)||e._writableState&&!e._readableState)},n=function(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))},i=function(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)},o=function(e){return!(!e||i(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)},a=function(e){return!(!e||i(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)},s=function(e){return!(!e||i(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)},u=function(e){if(!i(e))return null;var t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[m]||null!=n&&n.destroyed)},l=function(e){if(!n(e))return null;if(!0===e.writableEnded)return!0;var t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},c=function(e,t){if(!r(e))return null;var n=e._readableState;return(null==n||!n.errored)&&("boolean"!=typeof(null==n?void 0:n.endEmitted)?null:!!(n.endEmitted||!1===t&&!0===n.ended&&0===n.length))},f=function(e){return e&&null!=e[_]?e[_]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!u(e)&&r(e)&&e.readable&&!c(e)},d=function(e){return e&&null!=e[S]?e[S]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!u(e)&&n(e)&&e.writable&&!l(e)},h=function(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen},p=function(e){return"boolean"==typeof e._sent100&&h(e)};ne(),Jt(),Bt();var v=$t(),y=v.SymbolAsyncIterator,g=v.SymbolIterator,b=v.SymbolFor,m=b("nodejs.stream.destroyed"),w=b("nodejs.stream.errored"),_=b("nodejs.stream.readable"),S=b("nodejs.stream.writable"),k=b("nodejs.stream.disturbed"),E=b("nodejs.webstream.isClosedPromise"),A=b("nodejs.webstream.controllerErrorFunction");t.exports={isDestroyed:u,kIsDestroyed:m,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[k])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:k,isErrored:function(e){var t,r,n,i,o,a,s,u,l,c;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(a=e[w])&&void 0!==a?a:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(s=e._readableState)||void 0===s?void 0:s.errorEmitted)&&void 0!==n?n:null===(u=e._writableState)||void 0===u?void 0:u.errorEmitted)&&void 0!==r?r:null===(l=e._readableState)||void 0===l?void 0:l.errored)&&void 0!==t?t:null!==(c=e._writableState)&&void 0!==c&&c.errored))},kIsErrored:w,isReadable:f,kIsReadable:_,kIsClosedPromise:E,kControllerErrorFunction:A,kIsWritable:S,isClosed:function(e){if(!i(e))return null;if("boolean"==typeof e.closed)return e.closed;var t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&h(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 i(e)?!!u(e)||!(!1!==(null==t?void 0:t.readable)&&f(e)||!1!==(null==t?void 0:t.writable)&&d(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[y]:!1===t?"function"==typeof e[g]:"function"==typeof e[y]||"function"==typeof e[g])},isReadableNodeStream:r,isReadableStream:o,isReadableEnded:function(e){if(!r(e))return null;if(!0===e.readableEnded)return!0;var t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:c,isReadableErrored:function(e){var t,r;return i(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:i,isWebStream:function(e){return o(e)||a(e)||s(e)},isWritable:d,isWritableNodeStream:n,isWritableStream:a,isWritableEnded:l,isWritableFinished:function(e,t){if(!n(e))return null;if(!0===e.writableFinished)return!0;var r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return i(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:p,willEmitClose:function(e){if(!i(e))return null;var t=e._writableState,r=e._readableState,n=t||r;return!n&&p(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:s}})),mr=ee((function(e,t){var r=function(e,t,r){var o,s;if(2===arguments.length?(r=t,t=f):null==t?t=f:y(t,"options"),v(r,"callback"),p(t.signal,"options.signal"),r=d(r),x(e)||R(e))return function(e,t,r){var o=!1,s=U;if(t.signal)if(s=function(){o=!0,r.call(e,new a(void 0,{cause:t.signal.reason}))},t.signal.aborted)i.nextTick(s);else{var u=(n=n||vr().addAbortListener)(t.signal,s),l=r;r=d((function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];u[_](),l.apply(e,r)}))}var c=function(){for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];o||i.nextTick((function(){return r.apply(e,n)}))};return w(e[N].promise,c,c),U}(e,t,r);if(!j(e))throw new u("stream",["ReadableStream","WritableStream","Stream"],e);var c=null!==(o=t.readable)&&void 0!==o?o:A(e),h=null!==(s=t.writable)&&void 0!==s?s:T(e),g=e._writableState,b=e._readableState,m=function(){e.writable||D()},S=B(e)&&A(e)===c&&T(e)===h,L=M(e,!1),D=function(){L=!0,e.destroyed&&(S=!1),(!S||e.readable&&!c)&&(!c||F)&&r.call(e)},F=I(e,!1),W=function(){F=!0,e.destroyed&&(S=!1),(!S||e.writable&&!h)&&(!h||L)&&r.call(e)},q=function(t){r.call(e,t)},H=k(e),V=function(){H=!0;var t=C(e)||P(e);return t&&"boolean"!=typeof t?r.call(e,t):c&&!F&&A(e,!0)&&!I(e,!1)?r.call(e,new l):!h||L||M(e,!1)?void r.call(e):r.call(e,new l)},z=function(){H=!0;var t=C(e)||P(e);if(t&&"boolean"!=typeof t)return r.call(e,t);r.call(e)},G=function(){e.req.on("finish",D)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?h&&!g&&(e.on("end",m),e.on("close",m)):(e.on("complete",D),S||e.on("abort",V),e.req?G():e.on("request",G)),!S&&"boolean"==typeof e.aborted&&e.on("aborted",V),e.on("end",W),e.on("finish",D),!1!==t.error&&e.on("error",q),e.on("close",V),H?i.nextTick(V):null!=g&&g.errorEmitted||null!=b&&b.errorEmitted?S||i.nextTick(z):(!c&&(!S||E(e))&&(L||!1===O(e))||!h&&(!S||O(e))&&(F||!1===E(e))||b&&e.req&&e.aborted)&&i.nextTick(z);var K=function(){r=U,e.removeListener("aborted",V),e.removeListener("complete",D),e.removeListener("abort",V),e.removeListener("request",G),e.req&&e.req.removeListener("finish",D),e.removeListener("end",m),e.removeListener("close",m),e.removeListener("finish",D),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",V)};if(t.signal&&!H){var Q=function(){var n=r;K(),n.call(e,new a(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)i.nextTick(Q);else{var Y=(n=n||vr().addAbortListener)(t.signal,Q),J=r;r=d((function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];Y[_](),J.apply(e,r)}))}}return K};ne(),Jt(),Bt();var n,i=gr(),o=Zt(),a=o.AbortError,s=o.codes,u=s.ERR_INVALID_ARG_TYPE,l=s.ERR_STREAM_PREMATURE_CLOSE,c=vr(),f=c.kEmptyObject,d=c.once,h=yr(),p=h.validateAbortSignal,v=h.validateFunction,y=h.validateObject,g=h.validateBoolean,b=$t(),m=b.Promise,w=b.PromisePrototypeThen,_=b.SymbolDispose,S=br(),k=S.isClosed,E=S.isReadable,A=S.isReadableNodeStream,x=S.isReadableStream,I=S.isReadableFinished,P=S.isReadableErrored,O=S.isWritable,T=S.isWritableNodeStream,R=S.isWritableStream,M=S.isWritableFinished,C=S.isWritableErrored,j=S.isNodeStream,B=S.willEmitClose,N=S.kIsClosedPromise,U=function(){};t.exports=r,t.exports.finished=function(e,t){var n,i=!1;return null===t&&(t=f),null!==(n=t)&&void 0!==n&&n.cleanup&&(g(t.cleanup,"cleanup"),i=t.cleanup),new m((function(n,o){var a=r(e,t,(function(e){i&&a(),e?o(e):n()}))}))}})),wr=ee((function(e,t){var r=function(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))},n=function(e,t,n){var a=!1;function s(t){if(!a){a=!0;var s=e._readableState,u=e._writableState;r(t,u,s),u&&(u.closed=!0),s&&(s.closed=!0),"function"==typeof n&&n(t),t?h.nextTick(i,e,t):h.nextTick(o,e)}}try{e._destroy(t||null,s)}catch(e){s(e)}},i=function(e,t){a(e,t),o(e)},o=function(e){var 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")},a=function(e,t){var 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))},s=function(e,t,r){var n=e._readableState,i=e._writableState;if(null!=i&&i.destroyed||null!=n&&n.destroyed)return this;null!=n&&n.autoDestroy||null!=i&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),n&&!n.errored&&(n.errored=t),r?h.nextTick(a,e,t):a(e,t))},u=function(e){var t=!1;function r(r){if(t)s(e,null!=r?r:new y);else{t=!0;var n=e._readableState,i=e._writableState,o=i||n;n&&(n.constructed=!0),i&&(i.constructed=!0),o.destroyed?e.emit(E,r):r?s(e,r,!0):h.nextTick(l,e)}}try{e._construct((function(e){h.nextTick(r,e)}))}catch(e){h.nextTick(r,e)}},l=function(e){e.emit(A)},c=function(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort},f=function(e){e.emit("close")},d=function(e,t){e.emit("error",t),h.nextTick(f,e)};ne(),Jt(),Bt();var h=gr(),p=Zt(),v=p.aggregateTwoErrors,y=p.codes.ERR_MULTIPLE_CALLBACK,g=p.AbortError,b=$t().Symbol,m=br(),w=m.kIsDestroyed,_=m.isDestroyed,S=m.isFinished,k=m.isServerRequest,E=b("kDestroy"),A=b("kConstruct");t.exports={construct:function(e,t){if("function"==typeof e._construct){var r=e._readableState,n=e._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),e.once(A,t),!(e.listenerCount(A)>1)&&h.nextTick(u,e)}},destroyer:function(e,t){!e||_(e)||(!t&&!S(e)&&(t=new g),k(e)?(e.socket=null,e.destroy(t)):c(e)?e.abort():c(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?h.nextTick(d,e,t):h.nextTick(f,e),e.destroyed||(e[w]=!0))},destroy:function(e,t){var i=this._readableState,o=this._writableState,a=o||i;return null!=o&&o.destroyed||null!=i&&i.destroyed?("function"==typeof t&&t(),this):(r(e,o,i),o&&(o.destroyed=!0),i&&(i.destroyed=!0),a.constructed?n(this,e,t):this.once(E,(function(r){n(this,v(r,e),t)})),this)},undestroy:function(){var 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:s}})),_r=ee((function(e,t){var r=function(e){s.call(this,e)},n=function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)};ne(),Jt(),Bt();var i=$t(),o=i.ArrayIsArray,a=i.ObjectSetPrototypeOf,s=(pr(),re(tr)).EventEmitter;a(r.prototype,s.prototype),a(r,s),r.prototype.pipe=function(e,t){var r=function(t){e.writable&&!1===e.write(t)&&l.pause&&l.pause()},i=function(){l.readable&&l.resume&&l.resume()},o=function(){c||(c=!0,e.end())},a=function(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())},u=function(e){f(),0===s.listenerCount(this,"error")&&this.emit("error",e)},l=this;l.on("data",r),e.on("drain",i),!e._isStdio&&(!t||!1!==t.end)&&(l.on("end",o),l.on("close",a));var c=!1;function f(){l.removeListener("data",r),e.removeListener("drain",i),l.removeListener("end",o),l.removeListener("close",a),l.removeListener("error",u),e.removeListener("error",u),l.removeListener("end",f),l.removeListener("close",f),e.removeListener("close",f)}return n(l,"error",u),n(e,"error",u),l.on("end",f),l.on("close",f),e.on("close",f),e.emit("pipe",l),e},t.exports={Stream:r,prependListener:n}})),Sr=ee((function(e,t){ne(),Jt(),Bt();var r,n=$t().SymbolDispose,i=Zt(),o=i.AbortError,a=i.codes,s=br(),u=s.isNodeStream,l=s.isWebStream,c=s.kControllerErrorFunction,f=mr(),d=a.ERR_INVALID_ARG_TYPE;t.exports.addAbortSignal=function(e,r){if(function(e,t){if("object"!=typeof e||!("aborted"in e))throw new d("signal","AbortSignal",e)}(e),!u(r)&&!l(r))throw new d("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;var i=u(t)?function(){t.destroy(new o(void 0,{cause:e.reason}))}:function(){t[c](new o(void 0,{cause:e.reason}))};if(e.aborted)i();else{var a=(r=r||vr().addAbortListener)(e,i);f(t,a[n])}return t}})),kr=ee((function(e,t){ne(),Jt(),Bt();var r=$t(),n=r.StringPrototypeSlice,i=r.SymbolIterator,o=r.TypedArrayPrototypeSet,a=r.Uint8Array,s=(Yt(),re(Vt)).Buffer,u=vr().inspect;t.exports=function(){"use strict";function e(){(0,E.default)(this,e),this.head=null,this.tail=null,this.length=0}return(0,C.default)(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;null!==(t=t.next);)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t=s.allocUnsafe(e>>>0),r=this.head,n=0;r;)o(t,r.data,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r=this.head.data;if(e<r.length){var n=r.slice(0,e);return this.head.data=r.slice(e),n}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}},{key:"first",value:function(){return this.head.data}},{key:i,value:function(){var e;return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:e=this.head,t.label=1;case 1:return e?[4,e.data]:[3,4];case 2:t.sent(),t.label=3;case 3:return e=e.next,[3,1];case 4:return[2]}}))}},{key:"_getString",value:function(e){var t="",r=this.head,i=0;do{var o=r.data;if(!(e>o.length)){e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(o,0,e),this.head=r,r.data=n(o,e));break}t+=o,e-=o.length,++i}while(null!==(r=r.next));return this.length-=i,t}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=e,n=this.head,i=0;do{var u=n.data;if(!(e>u.length)){e===u.length?(o(t,u,r-e),++i,n.next?this.head=n.next:this.head=this.tail=null):(o(t,new a(u.buffer,u.byteOffset,e),r-e),this.head=n,n.data=u.slice(e));break}o(t,u,r-e),e-=u.length,++i}while(null!==(n=n.next));return this.length-=i,t}},{key:Symbol.for("nodejs.util.inspect.custom"),value:function(e,t){return u(this,(0,D.default)((0,L.default)({},t),{depth:0,customInspect:!1}))}}]),e}()})),Er=ee((function(e,t){var r=function(e){return e?l:u};ne(),Jt(),Bt();var n=$t(),i=n.MathFloor,o=n.NumberIsInteger,a=yr().validateInteger,s=Zt().codes.ERR_INVALID_ARG_VALUE,u=16384,l=16;t.exports={getHighWaterMark:function(e,t,n,a){var u=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,a,n);if(null!=u){if(!o(u)||u<0)throw new s(a?"options."+n:"options.highWaterMark",u);return i(u)}return r(e.objectMode)},getDefaultHighWaterMark:r,setDefaultHighWaterMark:function(e,t){a(t,"value",0),e?l=t:u=t}}})),Ar=ee((function(e,t){var r=function(e,t){for(var r in e)t[r]=e[r]},n=function(e,t,r){return o(e,t,r)};ne(),Jt(),Bt();var i=(Yt(),re(Vt)),o=i.Buffer;o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=i:(r(i,e),e.Buffer=n),n.prototype=Object.create(o.prototype),r(o,n),n.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return o(e,t,r)},n.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=o(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},n.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return o(e)},n.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i.SlowBuffer(e)}})),xr=ee((function(e){var t=function(e){var t;switch(this.encoding=function(e){var t=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 t&&(c.isEncoding===f||!f(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=i,this.end=o,t=4;break;case"utf8":this.fillLast=n,t=4;break;case"base64":this.text=a,this.end=s,t=3;break;default:return this.write=u,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(t)},r=function(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2},n=function(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))},i=function(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)},o=function(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},a=function(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))},s=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t},u=function(e){return e.toString(this.encoding)},l=function(e){return e&&e.length?this.write(e):""};ne(),Jt(),Bt();var c=Ar().Buffer,f=c.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}};e.StringDecoder=t,t.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||""},t.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},t.prototype.text=function(e,t){var n=function(e,t,n){var i=t.length-1;if(i<n)return 0;var o=r(t[i]);return o>=0?(o>0&&(e.lastNeed=o-1),o):--i<n||-2===o?0:(o=r(t[i]))>=0?(o>0&&(e.lastNeed=o-2),o):--i<n||-2===o?0:(o=r(t[i]))>=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=n;var i=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},t.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}})),Ir=ee((function(e,t){ne(),Jt(),Bt();var r=gr(),n=$t(),i=n.PromisePrototypeThen,o=n.SymbolAsyncIterator,a=n.SymbolIterator,s=(Yt(),re(Vt)).Buffer,u=Zt().codes,l=u.ERR_INVALID_ARG_TYPE,c=u.ERR_STREAM_NULL_VALUES;t.exports=function(e,t,n){var u,f;if("string"==typeof t||t instanceof s)return new e((0,D.default)((0,L.default)({objectMode:!0},n),{read:function(){this.push(t),this.push(null)}}));if(t&&t[o])f=!0,u=t[o]();else{if(!t||!t[a])throw new l("iterable",["Iterable"],t);f=!1,u=t[a]()}var d=new e((0,L.default)({objectMode:!0,highWaterMark:1},n)),h=!1;return d._read=function(){h||(h=!0,(0,S.default)((function(){var e,t,r,n,i,o;return(0,Q.__generator)(this,(function(a){switch(a.label){case 0:return a.trys.push([0,9,,10]),f?[4,u.next()]:[3,2];case 1:return r=a.sent(),[3,3];case 2:r=u.next(),a.label=3;case 3:return t=(e=r).value,e.done?(d.push(null),[3,8]):[3,4];case 4:return t&&"function"==typeof t.then?[4,t]:[3,6];case 5:return i=a.sent(),[3,7];case 6:i=t,a.label=7;case 7:if(null===(n=i))throw h=!1,new c;if(d.push(n))return[3,11];h=!1,a.label=8;case 8:return[3,10];case 9:return o=a.sent(),d.destroy(o),[3,10];case 10:return[3,12];case 11:return[3,0];case 12:return[2]}}))}))())},d._destroy=function(e,t){i(function(){var e=(0,S.default)((function(e){var t,r,n,i,o,a;return(0,Q.__generator)(this,(function(s){switch(s.label){case 0:return t=null!=e,r="function"==typeof u.throw,t&&r?[4,u.throw(e)]:[3,3];case 1:return n=s.sent(),i=n.value,o=n.done,[4,i];case 2:if(s.sent(),o)return[2];s.label=3;case 3:return"function"!=typeof u.return?[3,6]:[4,u.return()];case 4:return a=s.sent(),[4,a.value];case 5:s.sent(),s.label=6;case 6:return[2]}}))}));return function(t){return e.apply(this,arguments)}}()(e),(function(){return r.nextTick(t,e)}),(function(n){return r.nextTick(t,n||e)}))},d}})),Pr=ee((function(e,t){var r=function(e){return{enumerable:!1,get:function(){return!!(this.state&e)},set:function(t){t?this.state|=e:this.state&=~e}}},n=function(e,t,r){"boolean"!=typeof r&&(r=t instanceof Rr()),this.state=we|_e|be|me,e&&e.objectMode&&(this.state|=ge),r&&e&&e.readableObjectMode&&(this.state|=ge),this.highWaterMark=e?$(this,e,"readableHighWaterMark",r):X(!1),this.buffer=new K,this.length=0,this.pipes=[],this.flowing=null,this[fe]=null,e&&!1===e.emitClose&&(this.state&=~we),e&&!1===e.autoDestroy&&(this.state&=~_e),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new de(e.encoding),this.encoding=e.encoding)},i=function(e,t,r,n){G("readableAddChunk",t);var i,a=e._readableState;if(!(a.state&ge)&&("string"==typeof t?(r=r||a.defaultEncoding,a.encoding!==r&&(n&&a.encoding?t=q.from(t,r).toString(a.encoding):(t=q.from(t,r),r=""))):t instanceof q?r="":F._isUint8Array(t)?(t=F._uint8ArrayToBuffer(t),r=""):null!=t&&(i=new ie("chunk",["string","Buffer","Uint8Array"],t))),i)ye(e,i);else if(null===t)a.state&=-9,function(e,t){if(G("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?s(e):(t.needReadable=!1,t.emittedReadable=!0,u(e))}}(e,a);else if(a.state&ge||t&&t.length>0)if(n)if(4&a.state)ye(e,new ue);else{if(a.destroyed||a.errored)return!1;o(e,a,t,!0)}else if(a.ended)ye(e,new se);else{if(a.destroyed||a.errored)return!1;a.state&=-9,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?o(e,a,t,!1):l(e,a)):o(e,a,t,!1)}else n||(a.state&=-9,l(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)},o=function(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)&&s(e)),l(e,t)},a=function(e,t){return e<=0||0===t.length&&t.ended?0:t.state&ge?1:x(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0},s=function(e){var t=e._readableState;G("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(G("emitReadable",t.flowing),t.emittedReadable=!0,_.nextTick(u,e))},u=function(e){var t=e._readableState;G("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,p(e)},l=function(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,_.nextTick(c,e,t))},c=function(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(G("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1},f=function(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[fe]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)},d=function(e){G("readable nexttick read 0"),e.read(0)},h=function(e,t){G("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),p(e),t.flowing&&!t.reading&&e.read(0)},p=function(e){var t=e._readableState;for(G("flow",t.flowing);t.flowing&&null!==e.read(););},v=function(e,t){"function"!=typeof e.read&&(e=Se.wrap(e,{objectMode:!0}));var r=function(){var e=(0,z.default)((function(e,t){var r,n,i,o,a;function s(t){this===e?(r(),r=ve):r=t}return(0,Q.__generator)(this,(function(u){switch(u.label){case 0:r=ve,e.on("readable",s),i=V(e,{writable:!1},(function(e){n=e?ee(n,e):null,r(),r=ve})),u.label=1;case 1:return u.trys.push([1,7,8,9]),null===(o=e.destroyed?null:e.read())?[3,3]:[4,o];case 2:return u.sent(),[3,5];case 3:if(n)throw n;return null===n?[2]:[4,(0,k.default)(new R(s))];case 4:u.sent(),u.label=5;case 5:return[3,1];case 6:return[3,9];case 7:throw a=u.sent(),n=ee(n,a);case 8:return!n&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==n&&!e._readableState.autoDestroy?(e.off("readable",s),i()):Y.destroyer(e,null),[7];case 9:return[2]}}))}));return function(t,r){return e.apply(this,arguments)}}()(e,t);return r.stream=e,r},y=function(e,t){return 0===t.length?null:(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);var r},g=function(e){var t=e._readableState;G("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,_.nextTick(b,t,e))},b=function(e,t){if(G("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)_.nextTick(m,t);else if(e.autoDestroy){var r=t._writableState;(!r||r.autoDestroy&&(r.finished||!1===r.writable))&&t.destroy()}},m=function(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()},w=function(){return void 0===pe&&(pe={}),pe};ne(),Jt(),Bt();var _=gr(),S=$t(),E=S.ArrayPrototypeIndexOf,A=S.NumberIsInteger,x=S.NumberIsNaN,I=S.NumberParseInt,P=S.ObjectDefineProperties,O=S.ObjectKeys,T=S.ObjectSetPrototypeOf,R=S.Promise,M=S.SafeSet,C=S.SymbolAsyncDispose,j=S.SymbolAsyncIterator,B=S.Symbol;t.exports=Se,Se.ReadableState=n;var N=(pr(),re(tr)).EventEmitter,U=_r(),F=U.Stream,W=U.prependListener,q=(Yt(),re(Vt)).Buffer,H=Sr().addAbortSignal,V=mr(),G=vr().debuglog("stream",(function(e){G=e})),K=kr(),Y=wr(),J=Er(),$=J.getHighWaterMark,X=J.getDefaultHighWaterMark,Z=Zt(),ee=Z.aggregateTwoErrors,te=Z.codes,ie=te.ERR_INVALID_ARG_TYPE,oe=te.ERR_METHOD_NOT_IMPLEMENTED,ae=te.ERR_OUT_OF_RANGE,se=te.ERR_STREAM_PUSH_AFTER_EOF,ue=te.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,le=Z.AbortError,ce=yr().validateObject,fe=B("kPaused"),de=xr().StringDecoder,he=Ir();T(Se.prototype,F.prototype),T(Se,F);var pe,ve=function(){},ye=Y.errorOrDestroy,ge=1,be=16,me=32,we=2048,_e=4096;function Se(e){var t=this;if(!(this instanceof Se))return new Se(e);var r=this instanceof Rr();this._readableState=new n(e,this,r),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&&!r&&H(e.signal,this)),F.call(this,e),Y.construct(this,(function(){t._readableState.needReadable&&l(t,t._readableState)}))}P(n.prototype,{objectMode:r(ge),ended:r(2),endEmitted:r(4),reading:r(8),constructed:r(be),sync:r(me),needReadable:r(64),emittedReadable:r(128),readableListening:r(256),resumeScheduled:r(512),errorEmitted:r(1024),emitClose:r(we),autoDestroy:r(_e),destroyed:r(8192),closed:r(16384),closeEmitted:r(32768),multiAwaitDrain:r(65536),readingMore:r(131072),dataEmitted:r(262144)}),Se.prototype.destroy=Y.destroy,Se.prototype._undestroy=Y.undestroy,Se.prototype._destroy=function(e,t){t(e)},Se.prototype[N.captureRejectionSymbol]=function(e){this.destroy(e)},Se.prototype[C]=function(){var e,t=this;return this.destroyed||(e=this.readableEnded?null:new le,this.destroy(e)),new R((function(r,n){return V(t,(function(t){return t&&t!==e?n(t):r(null)}))}))},Se.prototype.push=function(e,t){return i(this,e,t,!1)},Se.prototype.unshift=function(e,t){return i(this,e,t,!0)},Se.prototype.isPaused=function(){var e=this._readableState;return!0===e[fe]||!1===e.flowing},Se.prototype.setEncoding=function(e){var t=new de(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;var r=this._readableState.buffer,n="",i=!0,o=!1,a=void 0;try{for(var s,u=r[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;n+=t.write(l)}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},Se.prototype.read=function(e){G("read",e),void 0===e?e=NaN:A(e)||(e=I(e,10));var t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new ae("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 G("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?g(this):s(this),null;if(0===(e=a(e,t))&&t.ended)return 0===t.length&&g(this),null;var n,i=!!(64&t.state);if(G("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&G("length less than watermark",i=!0),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)G("reading, ended or constructing",i=!1);else if(i){G("do read"),t.state|=8|me,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){ye(this,e)}t.state&=~me,t.reading||(e=a(r,t))}return null===(n=e>0?y(e,t):null)?(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&&g(this)),null!==n&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n},Se.prototype._read=function(){throw new oe("_read()")},Se.prototype.pipe=function(e,t){var r=function(){G("onend"),e.end()},n=function(){d||(1===l.pipes.length&&l.pipes[0]===e?(G("false write response, pause",0),l.awaitDrainWriters=e,l.multiAwaitDrain=!1):l.pipes.length>1&&l.pipes.includes(e)&&(G("false write response, pause",l.awaitDrainWriters.size),l.awaitDrainWriters.add(e)),u.pause()),f||(f=function(e,t){return function(){var r=e._readableState;r.awaitDrainWriters===t?(G("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(G("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),(!r.awaitDrainWriters||0===r.awaitDrainWriters.size)&&e.listenerCount("data")&&e.resume()}}(u,e),e.on("drain",f))},i=function(t){G("ondata");var r=e.write(t);G("dest.write",r),!1===r&&n()},o=function(){e.removeListener("finish",a),s()},a=function(){G("onfinish"),e.removeListener("close",o),s()},s=function(){G("unpipe"),u.unpipe(e)},u=this,l=this._readableState;1===l.pipes.length&&(l.multiAwaitDrain||(l.multiAwaitDrain=!0,l.awaitDrainWriters=new M(l.awaitDrainWriters?[l.awaitDrainWriters]:[]))),l.pipes.push(e),G("pipe count=%d opts=%j",l.pipes.length,t);var c=t&&!1===t.end||e===_.stdout||e===_.stderr?s:r;l.endEmitted?_.nextTick(c):u.once("end",c),e.on("unpipe",(function t(n,c){G("onunpipe"),n===u&&c&&!1===c.hasUnpiped&&(c.hasUnpiped=!0,G("cleanup"),e.removeListener("close",o),e.removeListener("finish",a),f&&e.removeListener("drain",f),e.removeListener("error",h),e.removeListener("unpipe",t),u.removeListener("end",r),u.removeListener("end",s),u.removeListener("data",i),d=!0,f&&l.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&f())}));var f,d=!1;function h(t){if(G("onerror",t),s(),e.removeListener("error",h),0===e.listenerCount("error")){var r=e._writableState||e._readableState;r&&!r.errorEmitted?ye(e,t):e.emit("error",t)}}return u.on("data",i),W(e,"error",h),e.once("close",o),e.once("finish",a),e.emit("pipe",u),!0===e.writableNeedDrain?n():l.flowing||(G("pipe resume"),u.resume()),e},Se.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipes.length)return this;if(!e){var r=t.pipes;t.pipes=[],this.pause();for(var n=0;n<r.length;n++)r[n].emit("unpipe",this,{hasUnpiped:!1});return this}var i=E(t.pipes,e);return-1===i||(t.pipes.splice(i,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},Se.prototype.on=function(e,t){var r=F.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,G("on readable",n.length,n.reading),n.length?s(this):n.reading||_.nextTick(d,this)),r},Se.prototype.addListener=Se.prototype.on,Se.prototype.removeListener=function(e,t){var r=F.prototype.removeListener.call(this,e,t);return"readable"===e&&_.nextTick(f,this),r},Se.prototype.off=Se.prototype.removeListener,Se.prototype.removeAllListeners=function(e){var t=F.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&_.nextTick(f,this),t},Se.prototype.resume=function(){var e=this._readableState;return e.flowing||(G("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,_.nextTick(h,e,t))}(this,e)),e[fe]=!1,this},Se.prototype.pause=function(){return G("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(G("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[fe]=!0,this},Se.prototype.wrap=function(e){var t=this,r=!1;e.on("data",(function(n){!t.push(n)&&e.pause&&(r=!0,e.pause())})),e.on("end",(function(){t.push(null)})),e.on("error",(function(e){ye(t,e)})),e.on("close",(function(){t.destroy()})),e.on("destroy",(function(){t.destroy()})),this._read=function(){r&&e.resume&&(r=!1,e.resume())};for(var n=O(e),i=1;i<n.length;i++){var o=n[i];void 0===this[o]&&"function"==typeof e[o]&&(this[o]=e[o].bind(e))}return this},Se.prototype[j]=function(){return v(this)},Se.prototype.iterator=function(e){return void 0!==e&&ce(e,"options"),v(this,e)},P(Se.prototype,{readable:{__proto__:null,get:function(){var e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set:function(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:function(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get:function(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get:function(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get:function(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get:function(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get:function(){return!!this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get:function(){return!!this._readableState&&this._readableState.endEmitted}}}),P(n.prototype,{pipesCount:{__proto__:null,get:function(){return this.pipes.length}},paused:{__proto__:null,get:function(){return!1!==this[fe]},set:function(e){this[fe]=!!e}}}),Se._fromList=y,Se.from=function(e,t){return he(Se,e,t)},Se.fromWeb=function(e,t){return w().newStreamReadableFromReadableStream(e,t)},Se.toWeb=function(e,t){return w().newReadableStreamFromStreamReadable(e,t)},Se.wrap=function(e,t){var r,n;return new Se((0,D.default)((0,L.default)({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r},t),{destroy:function(t,r){Y.destroyer(e,t),r(t)}})).wrap(e)}})),Or=ee((function(e,t){var r=function(){},n=function(e,t,r){"boolean"!=typeof r&&(r=t instanceof Rr()),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?j(this,e,"writableHighWaterMark",r):B(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var 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=u.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,i(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[K]=[]},i=function(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0},o=function(e,t,n,i){var o,a=e._writableState;if("function"==typeof n)i=n,n=a.defaultEncoding;else{if(n){if("buffer"!==n&&!T.isEncoding(n))throw new z(n)}else n=a.defaultEncoding;"function"!=typeof i&&(i=r)}if(null===t)throw new H;if(!a.objectMode)if("string"==typeof t)!1!==a.decodeStrings&&(t=T.from(t,n),n="buffer");else if(t instanceof T)n="buffer";else{if(!O._isUint8Array(t))throw new U("chunk",["string","Buffer","Uint8Array"],t);t=O._uint8ArrayToBuffer(t),n="buffer"}return a.ending?o=new V:a.destroyed&&(o=new W("write")),o?(g.nextTick(i,o),G(e,o,!0),o):(a.pendingcb++,function(e,t,n,i,o){var a=t.objectMode?1:n.length;t.length+=a;var s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:n,encoding:i,callback:o}),t.allBuffers&&"buffer"!==i&&(t.allBuffers=!1),t.allNoop&&o!==r&&(t.allNoop=!1)):(t.writelen=a,t.writecb=o,t.writing=!0,t.sync=!0,e._write(n,i,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,a,t,n,i))},a=function(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new W("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1},s=function(e,t,r,n){--t.pendingcb,n(r),f(t),G(e,r)},u=function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;"function"==typeof i?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?g.nextTick(s,e,r,t,i):s(e,r,t,i)):(r.buffered.length>r.bufferedIndex&&d(e,r),n?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:e,state:r},g.nextTick(l,r.afterWriteTickInfo)):c(e,r,1,i))):G(e,new D)},l=function(e){var t=e.stream,r=e.state,n=e.count,i=e.cb;return r.afterWriteTickInfo=null,c(t,r,n,i)},c=function(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&&f(t),p(e,t)},f=function(e){if(!e.writing){for(var t=e.bufferedIndex;t<e.buffered.length;++t){var r,n=e.buffered[t],o=n.chunk,a=n.callback,s=e.objectMode?1:o.length;e.length-=s,a(null!==(r=e.errored)&&void 0!==r?r:new W("write"))}for(var u=e[K].splice(0),l=0;l<u.length;l++){var c;u[l](null!==(c=e.errored)&&void 0!==c?c:new W("end"))}i(e)}},d=function(e,t){if(!(t.corked||t.bufferProcessing||t.destroyed)&&t.constructed){var n=t.buffered,o=t.bufferedIndex,s=t.objectMode,u=n.length-o;if(u){var l=o;if(t.bufferProcessing=!0,u>1&&e._writev){t.pendingcb-=u-1;var c=t.allNoop?r:function(e){for(var t=l;t<n.length;++t)n[t].callback(e)},f=t.allNoop&&0===l?n:m(n,l);f.allBuffers=t.allBuffers,a(e,t,!0,t.length,f,"",c),i(t)}else{do{var d=n[l],h=d.chunk,p=d.encoding,v=d.callback;n[l++]=null,a(e,t,!1,s?1:h.length,h,p,v)}while(l<n.length&&!t.writing);l===n.length?i(t):l>256?(n.splice(0,l),t.bufferedIndex=0):t.bufferedIndex=l}t.bufferProcessing=!1}}},h=function(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},p=function(e,t,r){h(t)&&(function(e,t){!t.prefinished&&!t.finalCalled&&("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){var r=!1;function n(n){if(r)G(e,null!=n?n:D());else if(r=!0,t.pendingcb--,n){for(var i=t[K].splice(0),o=0;o<i.length;o++)i[o](n);G(e,n,t.sync)}else h(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,g.nextTick(v,e,t))}t.sync=!0,t.pendingcb++;try{e._final(n)}catch(e){n(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,g.nextTick((function(e,t){h(t)?v(e,t):t.pendingcb--}),e,t)):h(t)&&(t.pendingcb++,v(e,t))))},v=function(e,t){t.pendingcb--,t.finished=!0;for(var r=t[K].splice(0),n=0;n<r.length;n++)r[n]();if(e.emit("finish"),t.autoDestroy){var i=e._readableState;(!i||i.autoDestroy&&(i.endEmitted||!1===i.readable))&&e.destroy()}},y=function(){return void 0===Y&&(Y={}),Y};ne(),Jt(),Bt();var g=gr(),b=$t(),m=b.ArrayPrototypeSlice,w=b.Error,_=b.FunctionPrototypeSymbolHasInstance,S=b.ObjectDefineProperty,k=b.ObjectDefineProperties,E=b.ObjectSetPrototypeOf,A=b.StringPrototypeToLowerCase,x=b.Symbol,I=b.SymbolHasInstance;t.exports=Q,Q.WritableState=n;var P=(pr(),re(tr)).EventEmitter,O=_r().Stream,T=(Yt(),re(Vt)).Buffer,R=wr(),M=Sr().addAbortSignal,C=Er(),j=C.getHighWaterMark,B=C.getDefaultHighWaterMark,N=Zt().codes,U=N.ERR_INVALID_ARG_TYPE,L=N.ERR_METHOD_NOT_IMPLEMENTED,D=N.ERR_MULTIPLE_CALLBACK,F=N.ERR_STREAM_CANNOT_PIPE,W=N.ERR_STREAM_DESTROYED,q=N.ERR_STREAM_ALREADY_FINISHED,H=N.ERR_STREAM_NULL_VALUES,V=N.ERR_STREAM_WRITE_AFTER_END,z=N.ERR_UNKNOWN_ENCODING,G=R.errorOrDestroy;E(Q.prototype,O.prototype),E(Q,O);var K=x("kOnFinished");function Q(e){var t=this,r=this instanceof Rr();if(!r&&!_(Q,this))return new Q(e);this._writableState=new n(e,this,r),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)),O.call(this,e),R.construct(this,(function(){var e=t._writableState;e.writing||d(t,e),p(t,e)}))}n.prototype.getBuffer=function(){return m(this.buffered,this.bufferedIndex)},S(n.prototype,"bufferedRequestCount",{__proto__:null,get:function(){return this.buffered.length-this.bufferedIndex}}),S(Q,I,{__proto__:null,value:function(e){return!!_(this,e)||this===Q&&e&&e._writableState instanceof n}}),Q.prototype.pipe=function(){G(this,new F)},Q.prototype.write=function(e,t,r){return!0===o(this,e,t,r)},Q.prototype.cork=function(){this._writableState.corked++},Q.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||d(this,e))},Q.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=A(e)),!T.isEncoding(e))throw new z(e);return this._writableState.defaultEncoding=e,this},Q.prototype._write=function(e,t,r){if(!this._writev)throw new L("_write()");this._writev([{chunk:e,encoding:t}],r)},Q.prototype._writev=null,Q.prototype.end=function(e,t,r){var n,i=this._writableState;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){var a=o(this,e,t);a instanceof w&&(n=a)}return i.corked&&(i.corked=1,this.uncork()),n||(i.errored||i.ending?i.finished?n=new q("end"):i.destroyed&&(n=new W("end")):(i.ending=!0,p(this,i,!0),i.ended=!0)),"function"==typeof r&&(n||i.finished?g.nextTick(r,n):i[K].push(r)),this},k(Q.prototype,{closed:{__proto__:null,get:function(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get:function(){return!!this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get:function(){var e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set:function(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get:function(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get:function(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get:function(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get:function(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get:function(){var e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get:function(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get:function(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get:function(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get:function(){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 Y,J=R.destroy;Q.prototype.destroy=function(e,t){var r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[K].length)&&g.nextTick(f,r),J.call(this,e,t),this},Q.prototype._undestroy=R.undestroy,Q.prototype._destroy=function(e,t){t(e)},Q.prototype[P.captureRejectionSymbol]=function(e){this.destroy(e)},Q.fromWeb=function(e,t){return y().newStreamWritableFromWritableStream(e,t)},Q.toWeb=function(e){return y().newWritableStreamFromStreamWritable(e)}})),Tr=ee((function(e,t){var r=function(e){var t,r,n,i,o,u=e.readable&&"function"!=typeof e.readable.read?x.wrap(e.readable):e.readable,l=e.writable,c=!!a(u),f=!!s(l);function d(e){var t=i;i=null,t?t(e):e&&o.destroy(e)}return o=new j({readableObjectMode:!(null==u||!u.readableObjectMode),writableObjectMode:!(null==l||!l.writableObjectMode),readable:c,writable:f}),f&&(v(l,(function(e){f=!1,e&&_(u,e),d(e)})),o._write=function(e,r,n){l.write(e,r)?n():t=n},o._final=function(e){l.end(),r=e},l.on("drain",(function(){if(t){var e=t;t=null,e()}})),l.on("finish",(function(){if(r){var e=r;r=null,e()}}))),c&&(v(u,(function(e){c=!1,e&&_(u,e),d(e)})),u.on("readable",(function(){if(n){var e=n;n=null,e()}})),u.on("end",(function(){o.push(null)})),o._read=function(){for(;;){var e=u.read();if(null===e)return void(n=o._read);if(!o.push(e))return}}),o._destroy=function(e,o){!e&&null!==i&&(e=new g),n=null,t=null,r=null,null===i?o(e):(i=o,_(l,e),_(u,e))},o};ne(),Jt(),Bt();var n=gr(),i=(Yt(),re(Vt)),o=br(),a=o.isReadable,s=o.isWritable,u=o.isIterable,l=o.isNodeStream,c=o.isReadableNodeStream,f=o.isWritableNodeStream,d=o.isDuplexNodeStream,h=o.isReadableStream,p=o.isWritableStream,v=mr(),y=Zt(),g=y.AbortError,b=y.codes,m=b.ERR_INVALID_ARG_TYPE,w=b.ERR_INVALID_RETURN_VALUE,_=wr().destroyer,A=Rr(),x=Pr(),I=Or(),P=vr().createDeferredPromise,O=Ir(),T=globalThis.Blob||i.Blob,R=(void 0===T?"undefined":(0,V.default)(T))<"u"?function(e){return e instanceof T}:function(){return!1},M=globalThis.AbortController||er().AbortController,C=$t().FunctionPrototypeCall,j=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e){var n;return(0,E.default)(this,r),n=t.call(this,e),!1===(null==e?void 0:e.readable)&&(n._readableState.readable=!1,n._readableState.ended=!0,n._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(n._writableState.writable=!1,n._writableState.ending=!0,n._writableState.ended=!0,n._writableState.finished=!0),(0,W.default)(n)}return r}(A);t.exports=function e(t,i){if(d(t))return t;if(c(t))return r({readable:t});if(f(t))return r({writable:t});if(l(t))return r({writable:!1,readable:!1});if(h(t))return r({readable:x.fromWeb(t)});if(p(t))return r({writable:I.fromWeb(t)});if("function"==typeof t){var o=function(e){var t=P(),r=t.promise,i=t.resolve,o=new M,a=o.signal;return{value:e((0,z.default)((function(){var e,t,o,s,u,l;return(0,Q.__generator)(this,(function(c){switch(c.label){case 0:return e=r,r=null,[4,(0,k.default)(e)];case 1:if(t=c.sent(),o=t.chunk,s=t.done,u=t.cb,n.nextTick(u),s)return[2];if(a.aborted)throw new g(void 0,{cause:a.reason});return l=P(),r=l.promise,i=l.resolve,[4,o];case 2:c.sent(),c.label=3;case 3:return[3,0];case 4:return[2]}}))}))(),{signal:a}),write:function(e,t,r){var n=i;i=null,n({chunk:e,done:!1,cb:r})},final:function(e){var t=i;i=null,t({done:!0,cb:e})},destroy:function(e,t){o.abort(),t(e)}}}(t),a=o.value,s=o.write,v=o.final,y=o.destroy;if(u(a))return O(j,a,{objectMode:!0,write:s,final:v,destroy:y});var b=null==a?void 0:a.then;if("function"==typeof b){var E,A=C(b,a,(function(e){if(null!=e)throw new w("nully","body",e)}),(function(e){_(E,e)}));return E=new j({objectMode:!0,readable:!1,write:s,final:function(e){v((0,S.default)((function(){var t;return(0,Q.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,A];case 1:return r.sent(),n.nextTick(e,null),[3,3];case 2:return t=r.sent(),n.nextTick(e,t),[3,3];case 3:return[2]}}))})))},destroy:y})}throw new w("Iterable, AsyncIterable or AsyncFunction",i,a)}if(R(t))return e(t.arrayBuffer());if(u(t))return O(j,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&p(null==t?void 0:t.writable))return j.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return r({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?f(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});var T,B=null==t?void 0:t.then;if("function"==typeof B)return C(B,t,(function(e){null!=e&&T.push(e),T.push(null)}),(function(e){_(T,e)})),T=new j({objectMode:!0,writable:!1,read:function(){}});throw new m(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}})),Rr=ee((function(e,t){var r=function(){return void 0===u&&(u={}),u};ne(),Jt(),Bt();var n=$t(),i=n.ObjectDefineProperties,o=n.ObjectGetOwnPropertyDescriptor,a=n.ObjectKeys,s=n.ObjectSetPrototypeOf;t.exports=v;var u,l,c=Pr(),f=Or();s(v.prototype,c.prototype),s(v,c);for(var d=a(f.prototype),h=0;h<d.length;h++){var p=d[h];v.prototype[p]||(v.prototype[p]=f.prototype[p])}function v(e){if(!(this instanceof v))return new v(e);c.call(this,e),f.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}i(v.prototype,{writable:(0,L.default)({__proto__:null},o(f.prototype,"writable")),writableHighWaterMark:(0,L.default)({__proto__:null},o(f.prototype,"writableHighWaterMark")),writableObjectMode:(0,L.default)({__proto__:null},o(f.prototype,"writableObjectMode")),writableBuffer:(0,L.default)({__proto__:null},o(f.prototype,"writableBuffer")),writableLength:(0,L.default)({__proto__:null},o(f.prototype,"writableLength")),writableFinished:(0,L.default)({__proto__:null},o(f.prototype,"writableFinished")),writableCorked:(0,L.default)({__proto__:null},o(f.prototype,"writableCorked")),writableEnded:(0,L.default)({__proto__:null},o(f.prototype,"writableEnded")),writableNeedDrain:(0,L.default)({__proto__:null},o(f.prototype,"writableNeedDrain")),destroyed:{__proto__:null,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),v.fromWeb=function(e,t){return r().newStreamDuplexFromReadableWritablePair(e,t)},v.toWeb=function(e){return r().newReadableWritablePairFromDuplex(e)},v.from=function(e){return l||(l=Tr()),l(e,"body")}})),Mr=ee((function(e,t){var r=function(e){var t=this;"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((function(r,n){r?e?e(r):t.destroy(r):(null!=n&&t.push(n),t.push(null),e&&e())}))},n=function(){this._final!==r&&r.call(this)};ne(),Jt(),Bt();var i=$t(),o=i.ObjectSetPrototypeOf,a=i.Symbol;t.exports=f;var s=Zt().codes.ERR_METHOD_NOT_IMPLEMENTED,u=Rr(),l=Er().getHighWaterMark;o(f.prototype,u.prototype),o(f,u);var c=a("kCallback");function f(e){if(!(this instanceof f))return new f(e);var t=e?l(this,e,"readableHighWaterMark",!0):null;0===t&&(e=(0,D.default)((0,L.default)({},e),{highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0})),u.call(this,e),this._readableState.sync=!1,this[c]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",n)}f.prototype._final=r,f.prototype._transform=function(){throw new s("_transform()")},f.prototype._write=function(e,t,r){var n=this,i=this._readableState,o=this._writableState,a=i.length;this._transform(e,t,(function(e,t){e?r(e):(null!=t&&n.push(t),o.ended||a===i.length||i.length<i.highWaterMark?r():n[c]=r)}))},f.prototype._read=function(){if(this[c]){var e=this[c];this[c]=null,e()}}})),Cr=ee((function(e,t){ne(),Jt(),Bt();var r=$t().ObjectSetPrototypeOf;t.exports=i;var n=Mr();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)}})),jr=ee((function(e,t){var r=function(e,t,r){var n=!1;e.on("close",(function(){n=!0}));var i=v(e,{readable:t,writable:r},(function(e){n=!e}));return{destroy:function(t){n||(n=!0,g.destroyer(e,t||new O("pipe")))},cleanup:i}},n=function(e){if(N(e))return e;if(L(e))return(t=(0,z.default)((function(e){return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:return s||(s=Pr()),[5,(0,Q.__values)((0,w.default)((0,_.default)(s.prototype[h].call(e)),k.default))];case 1:return t.sent(),[2]}}))})),function(e){return t.apply(this,arguments)})(e);var t;throw new x("val",["Readable","Iterable","AsyncIterable"],e)},i=function(e,t,i){var s=function(t){var s=e[t],u=t<e.length-1,c=t>0,f=u||!1!==(null==i?void 0:i.end),d=t===e.length-1;if(D(s)){var p=function(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&E(e)};if(f){var v=r(s,u,c),g=v.destroy,m=v.cleanup;S.push(g),U(s)&&d&&y.push(m)}s.on("error",p),U(s)&&d&&y.push((function(){s.removeListener("error",p)}))}if(0===t)if("function"==typeof s){if(_=s({signal:h}),!N(_))throw new I("Iterable, AsyncIterable or Stream","source",_)}else _=N(s)||L(s)||F(s)?s:b.from(s);else if("function"==typeof s){var A;if(_=F(_)?n(null===(A=_)||void 0===A?void 0:A.readable):n(_),_=s(_,{signal:h}),u){if(!N(_,!0))throw new I("AsyncIterable","transform[".concat(t-1,"]"),_)}else{var P;a||(a=Cr());var O=new a({objectMode:!0}),T=null===(P=_)||void 0===P?void 0:P.then;if("function"==typeof T)k++,T.call(_,(function(e){w=e,null!=e&&O.write(e),f&&O.end(),l.nextTick(E)}),(function(e){O.destroy(e),l.nextTick(E,e)}));else if(N(_,!0))k++,G(_,O,E,{end:f});else{if(!q(_)&&!F(_))throw new I("AsyncIterable or Promise","destination",_);var R=_.readable||_;k++,G(R,O,E,{end:f})}var M=r(_=O,!1,!0),C=M.destroy,j=M.cleanup;S.push(C),d&&y.push(j)}}else if(D(s)){if(L(_)){k+=2;var B=o(_,s,E,{end:f});U(s)&&d&&y.push(B)}else if(F(_)||q(_)){var H=_.readable||_;k++,G(H,s,E,{end:f})}else{if(!N(_))throw new x("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);k++,G(_,s,E,{end:f})}_=s}else if(W(s)){if(L(_))k++,Y(n(_),s,E,{end:f});else if(q(_)||N(_))k++,Y(_,s,E,{end:f});else{if(!F(_))throw new x("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_);k++,Y(_.readable,s,E,{end:f})}_=s}else _=b.from(s)};if(1===e.length&&f(e[0])&&(e=e[0]),e.length<2)throw new P("streams");var c,d=new V,h=d.signal,v=null==i?void 0:i.signal,y=[];function g(){A(new R)}j(v,"options.signal"),u=u||vr().addAbortListener,v&&(c=u(v,g));var m,w,_,S=[],k=0;function E(e){A(e,0==--k)}function A(e,r){var n;if(e&&(!m||"ERR_STREAM_PREMATURE_CLOSE"===m.code)&&(m=e),m||r){for(;S.length;)S.shift()(m);null===(n=c)||void 0===n||n[p](),d.abort(),r&&(m||y.forEach((function(e){return e()})),l.nextTick(t,m,w))}}for(var O=0;O<e.length;O++)s(O);return(null!=h&&h.aborted||null!=v&&v.aborted)&&l.nextTick(g),_},o=function(e,t,r,n){var i=n.end,o=!1;if(t.on("close",(function(){o||r(new T)})),e.pipe(t,{end:!1}),i){var a=function(){o=!0,t.end()};H(e)?l.nextTick(a):e.once("end",a)}else r();return v(e,{readable:!0,writable:!1},(function(t){var 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)})),v(t,{readable:!1,writable:!0},r)};ne(),Jt(),Bt();var a,s,u,l=gr(),c=$t(),f=c.ArrayIsArray,d=c.Promise,h=c.SymbolAsyncIterator,p=c.SymbolDispose,v=mr(),y=vr().once,g=wr(),b=Rr(),m=Zt(),E=m.aggregateTwoErrors,A=m.codes,x=A.ERR_INVALID_ARG_TYPE,I=A.ERR_INVALID_RETURN_VALUE,P=A.ERR_MISSING_ARGS,O=A.ERR_STREAM_DESTROYED,T=A.ERR_STREAM_PREMATURE_CLOSE,R=m.AbortError,M=yr(),C=M.validateFunction,j=M.validateAbortSignal,B=br(),N=B.isIterable,U=B.isReadable,L=B.isReadableNodeStream,D=B.isNodeStream,F=B.isTransformStream,W=B.isWebStream,q=B.isReadableStream,H=B.isReadableFinished,V=globalThis.AbortController||er().AbortController;function G(e,t,r,n){return K.apply(this,arguments)}function K(){return K=(0,S.default)((function(e,t,r,n){var i,o,a,s,u,l,c,f,h,p,y,g,b,m,w;return(0,Q.__generator)(this,(function(S){switch(S.label){case 0:i=n.end,a=null,s=function(e){if(e&&(o=e),a){var t=a;a=null,t()}},u=function(){return new d((function(e,t){o?t(o):a=function(){o?t(o):e()}}))},t.on("drain",s),l=v(t,{readable:!1},s),S.label=1;case 1:return S.trys.push([1,20,21,22]),t.writableNeedDrain?[4,u()]:[3,3];case 2:S.sent(),S.label=3;case 3:c=!1,f=!1,S.label=4;case 4:S.trys.push([4,11,12,17]),p=(0,_.default)(e),S.label=5;case 5:return[4,p.next()];case 6:return(c=!(y=S.sent()).done)?(g=y.value,b=g,t.write(b)?[3,8]:[4,u()]):[3,10];case 7:S.sent(),S.label=8;case 8:S.label=9;case 9:return c=!1,[3,5];case 10:return[3,17];case 11:return m=S.sent(),f=!0,h=m,[3,17];case 12:return S.trys.push([12,,15,16]),c&&null!=p.return?[4,p.return()]:[3,14];case 13:S.sent(),S.label=14;case 14:return[3,16];case 15:if(f)throw h;return[7];case 16:return[7];case 17:return i?(t.end(),[4,u()]):[3,19];case 18:S.sent(),S.label=19;case 19:return r(),[3,22];case 20:return w=S.sent(),r(o!==w?E(o,w):w),[3,22];case 21:return l(),t.off("drain",s),[7];case 22:return[2]}}))})),K.apply(this,arguments)}function Y(e,t,r,n){return J.apply(this,arguments)}function J(){return J=(0,S.default)((function(e,t,r,n){var i,o,a,s,u,l,c,f,d,h,p,v;return(0,Q.__generator)(this,(function(y){switch(y.label){case 0:i=n.end,F(t)&&(t=t.writable),o=t.getWriter(),y.label=1;case 1:y.trys.push([1,18,,23]),a=!1,s=!1,y.label=2;case 2:y.trys.push([2,8,9,14]),l=(0,_.default)(e),y.label=3;case 3:return[4,l.next()];case 4:return(a=!(c=y.sent()).done)?(f=c.value,d=f,[4,o.ready]):[3,7];case 5:y.sent(),o.write(d).catch((function(){})),y.label=6;case 6:return a=!1,[3,3];case 7:return[3,14];case 8:return h=y.sent(),s=!0,u=h,[3,14];case 9:return y.trys.push([9,,12,13]),a&&null!=l.return?[4,l.return()]:[3,11];case 10:y.sent(),y.label=11;case 11:return[3,13];case 12:if(s)throw u;return[7];case 13:return[7];case 14:return[4,o.ready];case 15:return y.sent(),i?[4,o.close()]:[3,17];case 16:y.sent(),y.label=17;case 17:return r(),[3,23];case 18:p=y.sent(),y.label=19;case 19:return y.trys.push([19,21,,22]),[4,o.abort(p)];case 20:return y.sent(),r(p),[3,22];case 21:return v=y.sent(),r(v),[3,22];case 22:return[3,23];case 23:return[2]}}))})),J.apply(this,arguments)}t.exports={pipelineImpl:i,pipeline:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return i(t,y(function(e){return C(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(t)))}}})),Br=ee((function(e,t){ne(),Jt(),Bt();var r=jr().pipeline,n=Rr(),i=wr().destroyer,o=br(),a=o.isNodeStream,s=o.isReadable,u=o.isWritable,l=o.isWebStream,c=o.isTransformStream,f=o.isWritableStream,d=o.isReadableStream,h=Zt(),p=h.AbortError,v=h.codes,y=v.ERR_INVALID_ARG_VALUE,g=v.ERR_MISSING_ARGS,b=mr();t.exports=function(){for(var e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];if(0===t.length)throw new g("streams");if(1===t.length)return n.from(t[0]);var h,v,m,w,_,k=(0,H.default)(t);if("function"==typeof t[0]&&(t[0]=n.from(t[0])),"function"==typeof t[t.length-1]){var E=t.length-1;t[E]=n.from(t[E])}for(var A=0;A<t.length;++A)if(a(t[A])||l(t[A])){if(A<t.length-1&&!(s(t[A])||d(t[A])||c(t[A])))throw new y("streams[".concat(A,"]"),k[A],"must be readable");if(A>0&&!(u(t[A])||f(t[A])||c(t[A])))throw new y("streams[".concat(A,"]"),k[A],"must be writable")}var x,I=t[0],P=r(t,(function(e){var t=w;w=null,t?t(e):e?_.destroy(e):!T&&!O&&_.destroy()})),O=!!(u(I)||f(I)||c(I)),T=!!(s(P)||d(P)||c(P));if(_=new n({writableObjectMode:!(null==I||!I.writableObjectMode),readableObjectMode:!(null==P||!P.readableObjectMode),writable:O,readable:T}),O){if(a(I))_._write=function(e,t,r){I.write(e,t)?r():h=r},_._final=function(e){I.end(),v=e},I.on("drain",(function(){if(h){var e=h;h=null,e()}}));else if(l(I)){var R=(c(I)?I.writable:I).getWriter();_._write=(x=(0,S.default)((function(e,t,r){var n;return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,R.ready];case 1:return t.sent(),R.write(e).catch((function(){})),r(),[3,3];case 2:return n=t.sent(),r(n),[3,3];case 3:return[2]}}))})),function(e,t,r){return x.apply(this,arguments)}),_._final=function(){var e=(0,S.default)((function(e){var t;return(0,Q.__generator)(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,R.ready];case 1:return r.sent(),R.close().catch((function(){})),v=e,[3,3];case 2:return t=r.sent(),e(t),[3,3];case 3:return[2]}}))}));return function(t){return e.apply(this,arguments)}}()}var M=c(P)?P.readable:P;b(M,(function(){if(v){var e=v;v=null,e()}}))}if(T)if(a(P))P.on("readable",(function(){if(m){var e=m;m=null,e()}})),P.on("end",(function(){_.push(null)})),_._read=function(){for(;;){var e=P.read();if(null===e)return void(m=_._read);if(!_.push(e))return}};else if(l(P)){var C=(c(P)?P.readable:P).getReader();_._read=(0,S.default)((function(){var e,t,r;return(0,Q.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,C.read()];case 1:return e=n.sent(),t=e.value,r=e.done,_.push(t)?r?[2,void _.push(null)]:[3,3]:[2];case 2:return n.sent(),[2];case 3:return[3,0];case 4:return[2]}}))}))}return _._destroy=function(e,t){!e&&null!==w&&(e=new p),m=null,h=null,v=null,null===w?t(e):(w=t,a(P)&&i(P,e))},_}})),Nr=ee((function(e,t){var r=function(e,t){if("function"!=typeof e)throw new l("fn",["Function","AsyncFunction"],e);null!=t&&y(t,"options"),null!=(null==t?void 0:t.signal)&&p(t.signal,"options.signal");var r=1;null!=(null==t?void 0:t.concurrency)&&(r=B(t.concurrency));var n=r-1;return null!=(null==t?void 0:t.highWaterMark)&&(n=B(t.highWaterMark)),v(r,"options.concurrency",1),v(n,"options.highWaterMark",0),n+=r,(0,z.default)((function(){var i,o,a,s,u,l,c,f,h;function p(){c=!0,v()}function v(){f-=1,y()}function y(){o&&!c&&f<r&&u.length<n&&(o(),o=null)}return(0,Q.__generator)(this,(function(g){switch(g.label){case 0:a=vr().AbortSignalAny([null==t?void 0:t.signal].filter(C)),s=this,u=[],l={signal:a},c=!1,f=0,(0,S.default)((function(){var t,h,y,g,b,m,w,S,k,E;return(0,Q.__generator)(this,(function(A){switch(A.label){case 0:A.trys.push([0,15,16,17]),t=!1,h=!1,A.label=1;case 1:A.trys.push([1,8,9,14]),g=(0,_.default)(s),A.label=2;case 2:return[4,g.next()];case 3:if(!(t=!(b=A.sent()).done))return[3,7];if(m=b.value,w=m,c)return[2];if(a.aborted)throw new d;try{if((w=e(w,l))===Y)return[3,6];w=q(w)}catch(e){w=F(e)}return f+=1,V(w,v,p),u.push(w),i&&(i(),i=null),!c&&(u.length>=n||f>=r)?[4,new D((function(e){o=e}))]:[3,5];case 4:A.sent(),A.label=5;case 5:A.label=6;case 6:return t=!1,[3,2];case 7:return[3,14];case 8:return S=A.sent(),h=!0,y=S,[3,14];case 9:return A.trys.push([9,,12,13]),t&&null!=g.return?[4,g.return()]:[3,11];case 10:A.sent(),A.label=11;case 11:return[3,13];case 12:if(h)throw y;return[7];case 13:return[7];case 14:return u.push(J),[3,17];case 15:return k=A.sent(),E=F(k),V(E,v,p),u.push(E),[3,17];case 16:return c=!0,i&&(i(),i=null),[7];case 17:return[2]}}))}))(),g.label=1;case 1:return g.trys.push([1,,10,11]),u.length>0?[4,(0,k.default)(u[0])]:[3,6];case 2:if((h=g.sent())===J)return[2];if(a.aborted)throw new d;return h!==Y?[4,h]:[3,4];case 3:g.sent(),g.label=4;case 4:u.shift(),y(),g.label=5;case 5:return[3,1];case 6:return[4,(0,k.default)(new D((function(e){i=e})))];case 7:g.sent(),g.label=8;case 8:return[3,1];case 9:return[3,11];case 10:return c=!0,o&&(o(),o=null),[7];case 11:return[2]}}))})).call(this)},n=function(e,t){if("function"!=typeof e)throw new l("fn",["Function","AsyncFunction"],e);return r.call(this,(n=(0,S.default)((function(t,r){return(0,Q.__generator)(this,(function(n){switch(n.label){case 0:return[4,e(t,r)];case 1:return[2,n.sent()?t:Y]}}))})),function(e,t){return n.apply(this,arguments)}),t);var n},i=function(e){if(e=N(e),L(e))return 0;if(e<0)throw new f("number",">= 0",e);return e};ne(),Jt(),Bt();var o=globalThis.AbortController||er().AbortController,a=Zt(),s=a.codes,u=s.ERR_INVALID_ARG_VALUE,l=s.ERR_INVALID_ARG_TYPE,c=s.ERR_MISSING_ARGS,f=s.ERR_OUT_OF_RANGE,d=a.AbortError,h=yr(),p=h.validateAbortSignal,v=h.validateInteger,y=h.validateObject,g=$t().Symbol("kWeak"),b=$t().Symbol("kResistStopPropagation"),m=mr().finished,A=Br(),x=Sr().addAbortSignalNoValidate,I=br(),P=I.isWritable,O=I.isNodeStream,T=vr().deprecate,R=$t(),M=R.ArrayPrototypePush,C=R.Boolean,B=R.MathFloor,N=R.Number,L=R.NumberIsNaN,D=R.Promise,F=R.PromiseReject,q=R.PromiseResolve,V=R.PromisePrototypeThen,G=R.Symbol,Y=G("kEmpty"),J=G("kEof");function $(e,t){return X.apply(this,arguments)}function X(){return X=(0,S.default)((function(e,t){var r,i,o,a,s,u,l;return(0,Q.__generator)(this,(function(c){switch(c.label){case 0:r=!1,i=!1,c.label=1;case 1:c.trys.push([1,6,7,12]),a=(0,_.default)(n.call(this,e,t)),c.label=2;case 2:return[4,a.next()];case 3:return(r=!(s=c.sent()).done)?(u=s.value,u,[2,!0]):[3,5];case 4:return r=!1,[3,2];case 5:return[3,12];case 6:return l=c.sent(),i=!0,o=l,[3,12];case 7:return c.trys.push([7,,10,11]),r&&null!=a.return?[4,a.return()]:[3,9];case 8:c.sent(),c.label=9;case 9:return[3,11];case 10:if(i)throw o;return[7];case 11:return[7];case 12:return[2,!1]}}))})),X.apply(this,arguments)}var Z=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e;return(0,E.default)(this,r),(e=t.call(this,"reduce")).message="Reduce of an empty stream requires an initial value",(0,W.default)(e)}return r}(c);t.exports.streamReturningOperators={asIndexedPairs:T((function(e){return null!=e&&y(e,"options"),null!=(null==e?void 0:e.signal)&&p(e.signal,"options.signal"),(0,z.default)((function(){var t,r,n,i,o,a,s,u,l,c;return(0,Q.__generator)(this,(function(f){switch(f.label){case 0:t=0,r=!1,n=!1,f.label=1;case 1:f.trys.push([1,7,8,13]),o=(0,_.default)(this),f.label=2;case 2:return[4,(0,k.default)(o.next())];case 3:if(!(r=!(a=f.sent()).done))return[3,6];if(s=a.value,u=s,null!=e&&null!==(l=e.signal)&&void 0!==l&&l.aborted)throw new d({cause:e.signal.reason});return[4,[t++,u]];case 4:f.sent(),f.label=5;case 5:return r=!1,[3,2];case 6:return[3,13];case 7:return c=f.sent(),n=!0,i=c,[3,13];case 8:return f.trys.push([8,,11,12]),r&&null!=o.return?[4,o.return()]:[3,10];case 9:f.sent(),f.label=10;case 10:return[3,12];case 11:if(n)throw i;return[7];case 12:return[7];case 13:return[2]}}))})).call(this)}),"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t){return null!=t&&y(t,"options"),null!=(null==t?void 0:t.signal)&&p(t.signal,"options.signal"),e=i(e),(0,z.default)((function(){var r,n,i,o,a,s,u,l,c,f;return(0,Q.__generator)(this,(function(h){switch(h.label){case 0:if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new d;n=!1,i=!1,h.label=1;case 1:h.trys.push([1,8,9,14]),a=(0,_.default)(this),h.label=2;case 2:return[4,(0,k.default)(a.next())];case 3:if(!(n=!(s=h.sent()).done))return[3,7];if(u=s.value,l=u,null!=t&&null!==(c=t.signal)&&void 0!==c&&c.aborted)throw new d;return e--<=0?[4,l]:[3,5];case 4:h.sent(),h.label=5;case 5:h.label=6;case 6:return n=!1,[3,2];case 7:return[3,14];case 8:return f=h.sent(),i=!0,o=f,[3,14];case 9:return h.trys.push([9,,12,13]),n&&null!=a.return?[4,a.return()]:[3,11];case 10:h.sent(),h.label=11;case 11:return[3,13];case 12:if(i)throw o;return[7];case 13:return[7];case 14:return[2]}}))})).call(this)},filter:n,flatMap:function(e,t){var n=r.call(this,e,t);return(0,z.default)((function(){var e,t,r,i,o,a,s,u;return(0,Q.__generator)(this,(function(l){switch(l.label){case 0:e=!1,t=!1,l.label=1;case 1:l.trys.push([1,7,8,13]),i=(0,_.default)(n),l.label=2;case 2:return[4,(0,k.default)(i.next())];case 3:return(e=!(o=l.sent()).done)?(a=o.value,s=a,[5,(0,Q.__values)((0,w.default)((0,_.default)(s),k.default))]):[3,6];case 4:l.sent(),l.label=5;case 5:return e=!1,[3,2];case 6:return[3,13];case 7:return u=l.sent(),t=!0,r=u,[3,13];case 8:return l.trys.push([8,,11,12]),e&&null!=i.return?[4,i.return()]:[3,10];case 9:l.sent(),l.label=10;case 10:return[3,12];case 11:if(t)throw r;return[7];case 12:return[7];case 13:return[2]}}))}))()},map:r,take:function(e,t){return null!=t&&y(t,"options"),null!=(null==t?void 0:t.signal)&&p(t.signal,"options.signal"),e=i(e),(0,z.default)((function(){var r,n,i,o,a,s,u,l,c,f;return(0,Q.__generator)(this,(function(h){switch(h.label){case 0:if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new d;n=!1,i=!1,h.label=1;case 1:h.trys.push([1,8,9,14]),a=(0,_.default)(this),h.label=2;case 2:return[4,(0,k.default)(a.next())];case 3:if(!(n=!(s=h.sent()).done))return[3,7];if(u=s.value,l=u,null!=t&&null!==(c=t.signal)&&void 0!==c&&c.aborted)throw new d;return e-- >0?[4,l]:[3,5];case 4:h.sent(),h.label=5;case 5:if(e<=0)return[2];h.label=6;case 6:return n=!1,[3,2];case 7:return[3,14];case 8:return f=h.sent(),i=!0,o=f,[3,14];case 9:return h.trys.push([9,,12,13]),n&&null!=a.return?[4,a.return()]:[3,11];case 10:h.sent(),h.label=11;case 11:return[3,13];case 12:if(i)throw o;return[7];case 13:return[7];case 14:return[2]}}))})).call(this)},compose:function(e,t){if(null!=t&&y(t,"options"),null!=(null==t?void 0:t.signal)&&p(t.signal,"options.signal"),O(e)&&!P(e))throw new u("stream",e,"must be writable");var r=A(this,e);return null!=t&&t.signal&&x(t.signal,r),r}},t.exports.promiseReturningOperators={every:function(e,t){return(0,S.default)((function(){return(0,Q.__generator)(this,(function(r){switch(r.label){case 0:if("function"!=typeof e)throw new l("fn",["Function","AsyncFunction"],e);return[4,$.call(this,(0,S.default)((function(){var t,r,n,i=arguments;return(0,Q.__generator)(this,(function(o){switch(o.label){case 0:for(t=i.length,r=new Array(t),n=0;n<t;n++)r[n]=i[n];return[4,e.apply(void 0,(0,H.default)(r))];case 1:return[2,!o.sent()]}}))})),t)];case 1:return[2,!r.sent()]}}))})).apply(this)},forEach:function(e,t){return(0,S.default)((function(){var n,i,o,a,s,u,c;return(0,Q.__generator)(this,(function(f){switch(f.label){case 0:if("function"!=typeof e)throw new l("fn",["Function","AsyncFunction"],e);n=!1,i=!1,f.label=1;case 1:f.trys.push([1,6,7,12]),a=(0,_.default)(r.call(this,(d=(0,S.default)((function(t,r){return(0,Q.__generator)(this,(function(n){switch(n.label){case 0:return[4,e(t,r)];case 1:return[2,(n.sent(),Y)]}}))})),function(e,t){return d.apply(this,arguments)}),t)),f.label=2;case 2:return[4,a.next()];case 3:if(!(n=!(s=f.sent()).done))return[3,5];u=s.value,u,f.label=4;case 4:return n=!1,[3,2];case 5:return[3,12];case 6:return c=f.sent(),i=!0,o=c,[3,12];case 7:return f.trys.push([7,,10,11]),n&&null!=a.return?[4,a.return()]:[3,9];case 8:f.sent(),f.label=9;case 9:return[3,11];case 10:if(i)throw o;return[7];case 11:return[7];case 12:return[2]}var d}))})).apply(this)},reduce:function(e,t,r){return(0,S.default)((function(){var n,i,a,s,u,c,f,h,v,w,S,k,E,A,x,I,P;return(0,Q.__generator)(this,(function(O){switch(O.label){case 0:if("function"!=typeof e)throw new l("reducer",["Function","AsyncFunction"],e);return null!=r&&y(r,"options"),null!=(null==r?void 0:r.signal)&&p(r.signal,"options.signal"),i=arguments.length>1,null!=r&&null!==(n=r.signal)&&void 0!==n&&n.aborted?(a=new d(void 0,{cause:r.signal.reason}),this.once("error",(function(){})),[4,m(this.destroy(a))]):[3,2];case 1:throw O.sent(),a;case 2:s=new o,u=s.signal,null!=r&&r.signal&&(c={once:!0},(0,j.default)(c,g,this),(0,j.default)(c,b,!0),f=c,r.signal.addEventListener("abort",(function(){return s.abort()}),f)),h=!1,O.label=3;case 3:O.trys.push([3,,19,20]),v=!1,w=!1,O.label=4;case 4:O.trys.push([4,12,13,18]),k=(0,_.default)(this),O.label=5;case 5:return[4,k.next()];case 6:if(!(v=!(E=O.sent()).done))return[3,11];if(A=E.value,x=A,h=!0,null!=r&&null!==(I=r.signal)&&void 0!==I&&I.aborted)throw new d;return i?[4,e(t,x,{signal:u})]:[3,8];case 7:return t=O.sent(),[3,9];case 8:t=x,i=!0,O.label=9;case 9:O.label=10;case 10:return v=!1,[3,5];case 11:return[3,18];case 12:return P=O.sent(),w=!0,S=P,[3,18];case 13:return O.trys.push([13,,16,17]),v&&null!=k.return?[4,k.return()]:[3,15];case 14:O.sent(),O.label=15;case 15:return[3,17];case 16:if(w)throw S;return[7];case 17:return[7];case 18:if(!h&&!i)throw new Z;return[3,20];case 19:return s.abort(),[7];case 20:return[2,t]}}))})).apply(this)},toArray:function(e){return(0,S.default)((function(){var t,r,n,i,o,a,s,u,l,c;return(0,Q.__generator)(this,(function(f){switch(f.label){case 0:null!=e&&y(e,"options"),null!=(null==e?void 0:e.signal)&&p(e.signal,"options.signal"),t=[],r=!1,n=!1,f.label=1;case 1:f.trys.push([1,6,7,12]),o=(0,_.default)(this),f.label=2;case 2:return[4,o.next()];case 3:if(!(r=!(a=f.sent()).done))return[3,5];if(s=a.value,u=s,null!=e&&null!==(l=e.signal)&&void 0!==l&&l.aborted)throw new d(void 0,{cause:e.signal.reason});M(t,u),f.label=4;case 4:return r=!1,[3,2];case 5:return[3,12];case 6:return c=f.sent(),n=!0,i=c,[3,12];case 7:return f.trys.push([7,,10,11]),r&&null!=o.return?[4,o.return()]:[3,9];case 8:f.sent(),f.label=9;case 9:return[3,11];case 10:if(n)throw i;return[7];case 11:return[7];case 12:return[2,t]}}))})).apply(this)},some:$,find:function(e,t){return(0,S.default)((function(){var r,i,o,a,s,u,l;return(0,Q.__generator)(this,(function(c){switch(c.label){case 0:r=!1,i=!1,c.label=1;case 1:c.trys.push([1,6,7,12]),a=(0,_.default)(n.call(this,e,t)),c.label=2;case 2:return[4,a.next()];case 3:return(r=!(s=c.sent()).done)?(u=s.value,[2,u]):[3,5];case 4:return r=!1,[3,2];case 5:return[3,12];case 6:return l=c.sent(),i=!0,o=l,[3,12];case 7:return c.trys.push([7,,10,11]),r&&null!=a.return?[4,a.return()]:[3,9];case 8:c.sent(),c.label=9;case 9:return[3,11];case 10:if(i)throw o;return[7];case 11:return[7];case 12:return[2]}}))})).apply(this)}}})),Ur=ee((function(e,t){ne(),Jt(),Bt();var r=$t(),n=r.ArrayPrototypePop,i=r.Promise,o=br(),a=o.isIterable,s=o.isNodeStream,u=o.isWebStream,l=jr().pipelineImpl,c=mr().finished;Lr(),t.exports={finished:c,pipeline:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new i((function(e,r){var i,o,c=t[t.length-1];if(c&&"object"==typeof c&&!s(c)&&!a(c)&&!u(c)){var f=n(t);i=f.signal,o=f.end}l(t,(function(t,n){t?r(t):e(n)}),{signal:i,end:o})}))}}})),Lr=ee((function(e,t){ne(),Jt(),Bt();var r=(Yt(),re(Vt)).Buffer,n=$t(),i=n.ObjectDefineProperty,o=n.ObjectKeys,a=n.ReflectApply,s=vr().promisify.custom,u=Nr(),l=u.streamReturningOperators,c=u.promiseReturningOperators,f=Zt().codes.ERR_ILLEGAL_CONSTRUCTOR,d=Br(),h=Er(),p=h.setDefaultHighWaterMark,v=h.getDefaultHighWaterMark,y=jr().pipeline,g=wr().destroyer,b=mr(),m=Ur(),w=br(),_=t.exports=_r().Stream;_.isDestroyed=w.isDestroyed,_.isDisturbed=w.isDisturbed,_.isErrored=w.isErrored,_.isReadable=w.isReadable,_.isWritable=w.isWritable,_.Readable=Pr();var S=!0,k=!1,E=void 0;try{for(var A,x=function(){var e=A.value,t=function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(this instanceof e?this.constructor:void 0)throw f();return _.Readable.from(a(r,this,n))},r=l[e];i(t,"name",{__proto__:null,value:r.name}),i(t,"length",{__proto__:null,value:r.length}),i(_.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})},I=o(l)[Symbol.iterator]();!(S=(A=I.next()).done);S=!0)x()}catch(e){k=!0,E=e}finally{try{S||null==I.return||I.return()}finally{if(k)throw E}}var P=!0,O=!1,T=void 0;try{for(var R,M=function(){var e=R.value,t=function e(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];if(this instanceof e?this.constructor:void 0)throw f();return a(r,this,n)},r=c[e];i(t,"name",{__proto__:null,value:r.name}),i(t,"length",{__proto__:null,value:r.length}),i(_.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})},C=o(c)[Symbol.iterator]();!(P=(R=C.next()).done);P=!0)M()}catch(e){O=!0,T=e}finally{try{P||null==C.return||C.return()}finally{if(O)throw T}}_.Writable=Or(),_.Duplex=Rr(),_.Transform=Mr(),_.PassThrough=Cr(),_.pipeline=y;var j=Sr().addAbortSignal;_.addAbortSignal=j,_.finished=b,_.destroy=g,_.compose=d,_.setDefaultHighWaterMark=p,_.getDefaultHighWaterMark=v,i(_,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:function(){return m}}),i(y,s,{__proto__:null,enumerable:!0,get:function(){return m.pipeline}}),i(b,s,{__proto__:null,enumerable:!0,get:function(){return m.finished}}),_.Stream=_,_._isUint8Array=function(e){return e instanceof Uint8Array},_._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}})),Dr=ee((function(e,t){ne(),Jt(),Bt();var r=Lr(),n=Ur(),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:function(){return n}}),t.exports.Stream=r.Stream,t.exports.default=t.exports})),Fr=ee((function(e,t){ne(),Jt(),Bt(),t.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),Wr=ee((function(e,t){ne(),Jt(),Bt();var r=(Yt(),re(Vt)).Buffer,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];for(var t=0,r=0;r<this._bufs.length;r++){var 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){for(var t=e[0],r=e[1],n=0;n<t;n++)r+=this._bufs[n].length;return r},i.prototype.getBuffers=function(){return this._bufs},i.prototype.get=function(e){if(!(e>this.length||e<0)){var 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);var o=!!e,a=this._offset(n),s=i-n,u=s,l=o&&t||0,c=a[1];if(0===n&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(var f=0;f<this._bufs.length;f++)this._bufs[f].copy(e,l),l+=this._bufs[f].length;return e}if(u<=this._bufs[a[0]].length-c)return o?this._bufs[a[0]].copy(e,t,c,c+u):this._bufs[a[0]].slice(c,c+u);o||(e=r.allocUnsafe(s));for(var d=a[0];d<this._bufs.length;d++){var h=this._bufs[d].length-c;if(!(u>h)){this._bufs[d].copy(e,l,c,c+u),l+=h;break}this._bufs[d].copy(e,l,c),l+=h,u-=h,c&&(c=0)}return e.length>l?e.slice(0,l):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();var 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(){for(var e=this._new(),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))for(var i=(0,q.default)(n?[e.length-1,-1]:[0,1],2),o=i[0],a=i[1],s=o;s>=0&&s<e.length;s+=a)this._attach(e[s],t,n);else if(this._isBufferList(e))for(var u=(0,q.default)(n?[e._bufs.length-1,-1]:[0,1],2),l=u[0],c=u[1],f=l;f>=0&&f<e._bufs.length;f+=c)this._attach(e._bufs[f],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)),isNaN(t=Number(t||0))&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;for(var i=this._offset(t),o=i[0],a=i[1];o<this._bufs.length;o++){for(var s=this._bufs[o];a<s.length;)if(s.length-a>=e.length){var u=s.indexOf(e,a);if(-1!==u)return this._reverseOffset([o,u]);a=s.length-e.length+1}else{var l=this._reverseOffset([o,a]);if(this._match(l,e))return l;a++}a=0}return-1},i.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(var r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){var 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(var t in e)!function(t){i.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]: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})),qr=ee((function(e,t){ne(),Jt(),Bt();var r=Dr().Duplex,n=Fr(),i=Wr();function o(e){if(!(this instanceof o))return new o(e);if("function"==typeof e){this._callback=e;var 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})),Hr=ee((function(e,t){ne(),Jt(),Bt(),t.exports=function e(){"use strict";(0,E.default)(this,e),this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}})),Vr=ee((function(e,t){var r=function(e){return[0,1,2].map((function(t){return[0,1].map((function(r){return[0,1].map((function(o){var a=i.alloc(1);return a.writeUInt8(n.codes[e]<<n.CMD_SHIFT|(r?n.DUP_MASK:0)|t<<n.QOS_SHIFT|o,0,!0),a}))}))}))};ne(),Jt(),Bt();var n=t.exports,i=(Yt(),re(Vt)).Buffer;for(var o in n.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"},n.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},n.requiredHeaderFlagsErrors={},n.requiredHeaderFlags){var a=n.requiredHeaderFlags[o];n.requiredHeaderFlagsErrors[o]="Invalid header flag bits, must be 0x"+a.toString(16)+" for "+n.types[o]+" packet"}for(var s in n.codes={},n.types){var u=n.types[s];n.codes[u]=s}for(var l in n.CMD_SHIFT=4,n.CMD_MASK=240,n.DUP_MASK=8,n.QOS_MASK=3,n.QOS_SHIFT=1,n.RETAIN_MASK=1,n.VARBYTEINT_MASK=127,n.VARBYTEINT_FIN_MASK=128,n.VARBYTEINT_MAX=268435455,n.SESSIONPRESENT_MASK=1,n.SESSIONPRESENT_HEADER=i.from([n.SESSIONPRESENT_MASK]),n.CONNACK_HEADER=i.from([n.codes.connack<<n.CMD_SHIFT]),n.USERNAME_MASK=128,n.PASSWORD_MASK=64,n.WILL_RETAIN_MASK=32,n.WILL_QOS_MASK=24,n.WILL_QOS_SHIFT=3,n.WILL_FLAG_MASK=4,n.CLEAN_SESSION_MASK=2,n.CONNECT_HEADER=i.from([n.codes.connect<<n.CMD_SHIFT]),n.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},n.propertiesCodes={},n.properties){var c=n.properties[l];n.propertiesCodes[c]=l}n.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"},n.PUBLISH_HEADER=r("publish"),n.SUBSCRIBE_HEADER=r("subscribe"),n.SUBSCRIBE_OPTIONS_QOS_MASK=3,n.SUBSCRIBE_OPTIONS_NL_MASK=1,n.SUBSCRIBE_OPTIONS_NL_SHIFT=2,n.SUBSCRIBE_OPTIONS_RAP_MASK=1,n.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,n.SUBSCRIBE_OPTIONS_RH_MASK=3,n.SUBSCRIBE_OPTIONS_RH_SHIFT=4,n.SUBSCRIBE_OPTIONS_RH=[0,16,32],n.SUBSCRIBE_OPTIONS_NL=4,n.SUBSCRIBE_OPTIONS_RAP=8,n.SUBSCRIBE_OPTIONS_QOS=[0,1,2],n.UNSUBSCRIBE_HEADER=r("unsubscribe"),n.ACKS={unsuback:r("unsuback"),puback:r("puback"),pubcomp:r("pubcomp"),pubrel:r("pubrel"),pubrec:r("pubrec")},n.SUBACK_HEADER=i.from([n.codes.suback<<n.CMD_SHIFT]),n.VERSION3=i.from([3]),n.VERSION4=i.from([4]),n.VERSION5=i.from([5]),n.VERSION131=i.from([131]),n.VERSION132=i.from([132]),n.QOS=[0,1,2].map((function(e){return i.from([e])})),n.EMPTY={pingreq:i.from([n.codes.pingreq<<4,0]),pingresp:i.from([n.codes.pingresp<<4,0]),disconnect:i.from([n.codes.disconnect<<4,0])},n.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"},n.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},n.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"},n.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"},n.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"},n.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}})),zr=ee((function(e,t){var r=function(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")};ne(),Jt(),Bt();var n=1e3,i=6e4,o=60*i,a=24*o,s=7*a;t.exports=function(e,t){t=t||{};var u=void 0===e?"undefined":(0,V.default)(e);if("string"===u&&e.length>0)return function(e){if(!((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 r=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*r;case"weeks":case"week":case"w":return r*s;case"days":case"day":case"d":return r*a;case"hours":case"hour":case"hrs":case"hr":case"h":return r*o;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}(e);if("number"===u&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=a?r(e,t,a,"day"):t>=o?r(e,t,o,"hour"):t>=i?r(e,t,i,"minute"):t>=n?r(e,t,n,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=a?Math.round(e/a)+"d":t>=o?Math.round(e/o)+"h":t>=i?Math.round(e/i)+"m":t>=n?Math.round(e/n)+"s":e+"ms"}(e);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}})),Gr=ee((function(e,t){ne(),Jt(),Bt(),t.exports=function(e){var t=function(e,t){var r=n(this.namespace+((void 0===t?"undefined":(0,V.default)(t))>"u"?":":t)+e);return r.log=this.log,r},r=function(e,t){for(var r=0,n=0,i=-1,o=0;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,r=++o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length};function n(e){var r,i,o,a=null;function s(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];if(s.enabled){var o=s,a=Number(new Date),u=a-(r||a);o.diff=u,o.prev=r,o.curr=a,r=a,t[0]=n.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");var l=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(function(e,r){if("%%"===e)return"%";l++;var i=n.formatters[r];if("function"==typeof i){var a=t[l];e=i.call(o,a),t.splice(l,1),l--}return e})),n.formatArgs.call(o,t),(o.log||n.log).apply(o,t)}}return s.namespace=e,s.useColors=n.useColors(),s.color=n.selectColor(e),s.extend=t,s.destroy=n.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==a?a:(i!==n.namespaces&&(i=n.namespaces,o=n.enabled(e)),o)},set:function(e){a=e}}),"function"==typeof n.init&&n.init(s),s}return n.debug=n,n.default=n,n.coerce=function(e){return e instanceof Error?e.stack||e.message:e},n.disable=function(){var e=(0,H.default)(n.names).concat((0,H.default)(n.skips.map((function(e){return"-"+e})))).join(",");return n.enable(""),e},n.enable=function(e){n.save(e),n.namespaces=e,n.names=[],n.skips=[];var t=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean),r=!0,i=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(r=(a=s.next()).done);r=!0){var u=a.value;"-"===u[0]?n.skips.push(u.slice(1)):n.names.push(u)}}catch(e){i=!0,o=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw o}}},n.enabled=function(e){var t=!0,i=!1,o=void 0;try{for(var a,s=n.skips[Symbol.iterator]();!(t=(a=s.next()).done);t=!0){var u=a.value;if(r(e,u))return!1}}catch(e){i=!0,o=e}finally{try{t||null==s.return||s.return()}finally{if(i)throw o}}var l=!0,c=!1,f=void 0;try{for(var d,h=n.names[Symbol.iterator]();!(l=(d=h.next()).done);l=!0){var p=d.value;if(r(e,p))return!0}}catch(e){c=!0,f=e}finally{try{l||null==h.return||h.return()}finally{if(c)throw f}}return!1},n.humanize=zr(),n.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((function(t){n[t]=e[t]})),n.names=[],n.skips=[],n.formatters={},n.selectColor=function(e){for(var t=0,r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t|=0;return n.colors[Math.abs(t)%n.colors.length]},n.enable(n.load()),n}})),Kr=ee((function(e,t){var r;ne(),Jt(),Bt(),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){var r="color: "+this.color;e.splice(1,0,r,"color: inherit");var n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,(function(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){}},e.load=function(){var t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch(e){}return!t&&(void 0===ie?"undefined":(0,V.default)(ie))<"u"&&"env"in ie&&(t=ie.env.DEBUG),t},e.useColors=function(){return!(!(("undefined"==typeof window?"undefined":(0,V.default)(window))<"u"&&window.process)||"renderer"!==window.process.type&&!window.process.__nwjs)||!(("undefined"==typeof navigator?"undefined":(0,V.default)(navigator))<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&(("undefined"==typeof document?"undefined":(0,V.default)(document))<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||("undefined"==typeof window?"undefined":(0,V.default)(window))<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||("undefined"==typeof navigator?"undefined":(0,V.default)(navigator))<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||("undefined"==typeof navigator?"undefined":(0,V.default)(navigator))<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));var e},e.storage=function(){try{return localStorage}catch(e){}}(),e.destroy=(r=!1,function(){r||(r=!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||function(){},t.exports=Gr()(e),t.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}})),Qr=ee((function(e,t){ne(),Jt(),Bt();var r=qr(),n=(pr(),re(tr)).EventEmitter,i=Hr(),o=Vr(),a=Kr()("mqtt-packet:parser");t.exports=function(e){"use strict";(0,U.default)(n,e);var t=(0,K.default)(n);function n(){var e;return(0,E.default)(this,n),(e=t.call(this)).parser=e.constructor.parser,(0,W.default)(e)}return(0,C.default)(n,[{key:"_resetState",value:function(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new i,this.error=null,this._list=r(),this._stateCounter=0}},{key:"parse",value:function(e){for(this.error&&this._resetState(),this._list.append(e),a("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++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}},{key:"_parseHeader",value:function(){var e=this._list.readUInt8(0),t=e>>o.CMD_SHIFT;this.packet.cmd=o.types[t];var r=15&e,n=o.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(Error(o.requiredHeaderFlagsErrors[t])):(this.packet.retain=!!(e&o.RETAIN_MASK),this.packet.qos=e>>o.QOS_SHIFT&o.QOS_MASK,this.packet.qos>2?this._emitError(Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=!!(e&o.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}},{key:"_parseLength",value:function(){var e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a("_parseLength %d",e.value),!!e}},{key:"_parsePayload",value:function(){a("_parsePayload: payload %O",this._list);var 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(Error("Not supported"))}e=!0}return a("_parsePayload complete result: %s",e),e}},{key:"_parseConnect",value:function(){a("_parseConnect");var e,t,r,n,i={},s=this.packet,u=this._parseString();if(null===u)return this._emitError(Error("Cannot parse protocolId"));if("MQTT"!==u&&"MQIsdp"!==u)return this._emitError(Error("Invalid protocolId"));if(s.protocolId=u,this._pos>=this._list.length)return this._emitError(Error("Packet too short"));if(s.protocolVersion=this._list.readUInt8(this._pos),s.protocolVersion>=128&&(s.bridgeMode=!0,s.protocolVersion=s.protocolVersion-128),3!==s.protocolVersion&&4!==s.protocolVersion&&5!==s.protocolVersion)return this._emitError(Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(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;var l=!!(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)s.will={},s.will.retain=l,s.will.qos=c;else{if(l)return this._emitError(Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(c)return this._emitError(Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(s.clean=!!(this._list.readUInt8(this._pos)&o.CLEAN_SESSION_MASK),this._pos++,s.keepalive=this._parseNum(),-1===s.keepalive)return this._emitError(Error("Packet too short"));if(5===s.protocolVersion){var f=this._parseProperties();Object.getOwnPropertyNames(f).length&&(s.properties=f)}var d=this._parseString();if(null===d)return this._emitError(Error("Packet too short"));if(s.clientId=d,a("_parseConnect: packet.clientId: %s",s.clientId),i.will){if(5===s.protocolVersion){var h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(s.will.properties=h)}if(null===(e=this._parseString()))return this._emitError(Error("Cannot parse will topic"));if(s.will.topic=e,a("_parseConnect: packet.will.topic: %s",s.will.topic),null===(t=this._parseBuffer()))return this._emitError(Error("Cannot parse will payload"));s.will.payload=t,a("_parseConnect: packet.will.paylaod: %s",s.will.payload)}if(i.username){if(null===(n=this._parseString()))return this._emitError(Error("Cannot parse username"));s.username=n,a("_parseConnect: packet.username: %s",s.username)}if(i.password){if(null===(r=this._parseBuffer()))return this._emitError(Error("Cannot parse password"));s.password=r}return this.settings=s,a("_parseConnect: complete"),s}},{key:"_parseConnack",value:function(){a("_parseConnack");var e=this.packet;if(this._list.length<1)return null;var t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(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(Error("Cannot parse return code"));if(5===this.settings.protocolVersion){var r=this._parseProperties();Object.getOwnPropertyNames(r).length&&(e.properties=r)}a("_parseConnack: complete")}},{key:"_parsePublish",value:function(){a("_parsePublish");var e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){var t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),a("_parsePublish: payload from buffer list: %o",e.payload)}}},{key:"_parseSubscribe",value:function(){a("_parseSubscribe");var e,t,r,n,i,s,u,l=this.packet;if(l.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(l.properties=c)}if(l.length<=0)return this._emitError(Error("Malformed subscribe, no payload specified"));for(;this._pos<l.length;){if(null===(e=this._parseString()))return this._emitError(Error("Cannot parse topic"));if(this._pos>=l.length)return this._emitError(Error("Malformed Subscribe Payload"));if(t=this._parseByte(),5===this.settings.protocolVersion){if(192&t)return this._emitError(Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&t)return this._emitError(Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if((r=t&o.SUBSCRIBE_OPTIONS_QOS_MASK)>2)return this._emitError(Error("Invalid subscribe QoS, must be <= 2"));if(s=!!(t>>o.SUBSCRIBE_OPTIONS_NL_SHIFT&o.SUBSCRIBE_OPTIONS_NL_MASK),i=!!(t>>o.SUBSCRIBE_OPTIONS_RAP_SHIFT&o.SUBSCRIBE_OPTIONS_RAP_MASK),(n=t>>o.SUBSCRIBE_OPTIONS_RH_SHIFT&o.SUBSCRIBE_OPTIONS_RH_MASK)>2)return this._emitError(Error("Invalid retain handling, must be <= 2"));u={topic:e,qos:r},5===this.settings.protocolVersion?(u.nl=s,u.rap=i,u.rh=n):this.settings.bridgeMode&&(u.rh=0,u.rap=!0,u.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",u),l.subscriptions.push(u)}}}},{key:"_parseSuback",value:function(){a("_parseSuback");var e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){var r=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!o.MQTT5_SUBACK_CODES[r])return this._emitError(Error("Invalid suback code"))}else if(r>2&&128!==r)return this._emitError(Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(r)}}}},{key:"_parseUnsubscribe",value:function(){a("_parseUnsubscribe");var e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){var r=this._parseString();if(null===r)return this._emitError(Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",r),e.unsubscriptions.push(r)}}}},{key:"_parseUnsuback",value:function(){a("_parseUnsuback");var e=this.packet;if(!this._parseMessageId())return this._emitError(Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)return this._emitError(Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){var t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){var r=this._list.readUInt8(this._pos++);if(!o.MQTT5_UNSUBACK_CODES[r])return this._emitError(Error("Invalid unsuback code"));this.packet.granted.push(r)}}}},{key:"_parseConfirmation",value:function(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);var 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(Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!o.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(Error("Invalid "+this.packet.cmd+" reason code"))}a("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){var t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}},{key:"_parseDisconnect",value:function(){var e=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),o.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(Error("Invalid disconnect reason code"))):e.reasonCode=0;var t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a("_parseDisconnect result: true"),!0}},{key:"_parseAuth",value:function(){a("_parseAuth");var e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!o.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(Error("Invalid auth reason code"));var t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a("_parseAuth: result: true"),!0}},{key:"_parseMessageId",value:function(){var e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",e.messageId),!0)}},{key:"_parseString",value:function(e){var t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;var n=this._list.toString("utf8",this._pos,r);return this._pos+=t,a("_parseString: result: %s",n),n}},{key:"_parseStringPair",value:function(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}},{key:"_parseBuffer",value:function(){var e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;var r=this._list.slice(this._pos,t);return this._pos+=e,a("_parseBuffer: result: %o",r),r}},{key:"_parseNum",value:function(){if(this._list.length-this._pos<2)return-1;var e=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",e),e}},{key:"_parse4ByteNum",value:function(){if(this._list.length-this._pos<4)return-1;var e=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",e),e}},{key:"_parseVarByteNum",value:function(e){a("_parseVarByteNum");for(var t,r=0,n=1,i=0,s=!1,u=this._pos?this._pos:0;r<4&&u+r<this._list.length;){if(i+=n*((t=this._list.readUInt8(u+r++))&o.VARBYTEINT_MASK),n*=128,!(t&o.VARBYTEINT_FIN_MASK)){s=!0;break}if(this._list.length<=r)break}return!s&&4===r&&this._list.length>=r&&this._emitError(Error("Invalid variable byte integer")),u&&(this._pos+=r),a("_parseVarByteNum: result: %o",s=!!s&&(e?{bytes:r,value:i}:i)),s}},{key:"_parseByte",value:function(){var e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",e),e}},{key:"_parseByType",value:function(e){switch(a("_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()}}},{key:"_parseProperties",value:function(){a("_parseProperties");for(var e=this._parseVarByteNum(),t=this._pos+e,r={};this._pos<t;){var n=this._parseByte();if(!n)return this._emitError(Error("Cannot parse property code type")),!1;var i=o.propertiesCodes[n];if(!i)return this._emitError(Error("Unknown property")),!1;if("userProperties"!==i)r[i]?(Array.isArray(r[i])||(r[i]=[r[i]]),r[i].push(this._parseByType(o.propertiesTypes[i]))):r[i]=this._parseByType(o.propertiesTypes[i]);else{r[i]||(r[i]=Object.create(null));var s=this._parseByType(o.propertiesTypes[i]);if(r[i][s.name])if(Array.isArray(r[i][s.name]))r[i][s.name].push(s.value);else{var u=r[i][s.name];r[i][s.name]=[u],r[i][s.name].push(s.value)}else r[i][s.name]=s.value}}return r}},{key:"_newPacket",value:function(){return a("_newPacket"),this.packet&&(this._list.consume(this.packet.length),a("_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)),a("_newPacket: new packet"),this.packet=new i,this._pos=0,!0}},{key:"_emitError",value:function(e){a("_emitError",e),this.error=e,this.emit("error",e)}}],[{key:"parser",value:function(e){return this instanceof n?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new n).parser(e)}}]),n}(n)})),Yr=ee((function(e,t){var r=function(e){var t=n.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t};ne(),Jt(),Bt();var n=(Yt(),re(Vt)).Buffer,i={},o=n.isBuffer(n.from([1,2]).subarray(0,1));t.exports={cache:i,generateCache:function(){for(var e=0;e<65536;e++)i[e]=r(e)},generateNumber:r,genBufVariableByteInt:function(e){var t=0,r=0,i=n.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),i.writeUInt8(t,r++)}while(e>0&&r<4);return e>0&&(r=0),o?i.subarray(0,r):i.slice(0,r)},generate4ByteBuffer:function(e){var t=n.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}})),Jr=ee((function(e,t){ne(),Jt(),Bt(),(void 0===ie?"undefined":(0,V.default)(ie))>"u"||!ie.version||0===ie.version.indexOf("v0.")||0===ie.version.indexOf("v1.")&&0!==ie.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,a=arguments.length;switch(a){case 0:case 1:return ie.nextTick(e);case 2:return ie.nextTick((function(){e.call(null,t)}));case 3:return ie.nextTick((function(){e.call(null,t,r)}));case 4:return ie.nextTick((function(){e.call(null,t,r,n)}));default:for(i=Array(a-1),o=0;o<i.length;)i[o++]=arguments[o];return ie.nextTick((function(){e.apply(null,i)}))}}}:t.exports=ie})),$r=ee((function(e,t){var r=function(e,t,r){switch(S("generate called"),t.cork&&(t.cork(),_(n,t)),O&&(O=!1,A()),S("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){var r=e||{},n=r.protocolId||"MQTT",a=r.protocolVersion||4,s=r.will,u=r.clean,f=r.keepalive||0,d=r.clientId||"",h=r.username,b=r.password,m=r.properties;void 0===u&&(u=!0);var w,_,S=0;if("string"!=typeof n&&!g.isBuffer(n))return t.destroy(Error("Invalid protocolId")),!1;if(S+=n.length+2,3!==a&&4!==a&&5!==a)return t.destroy(Error("Invalid protocol version")),!1;if(S+=1,("string"==typeof d||g.isBuffer(d))&&(d||a>=4)&&(d||u))S+=g.byteLength(d)+2;else{if(a<4)return t.destroy(Error("clientId must be supplied before 3.1.1")),!1;if(1*u==0)return t.destroy(Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof f||f<0||f>65535||f%1!=0)return t.destroy(Error("Invalid keepalive")),!1;if(S+=2,S+=1,5===a){if(!(w=c(t,m)))return!1;S+=w.length}if(s){if("object"!=typeof s)return t.destroy(Error("Invalid will")),!1;if(!s.topic||"string"!=typeof s.topic)return t.destroy(Error("Invalid will topic")),!1;if(S+=g.byteLength(s.topic)+2,S+=2,s.payload){if(!(s.payload.length>=0))return t.destroy(Error("Invalid will payload")),!1;"string"==typeof s.payload?S+=g.byteLength(s.payload):S+=s.payload.length}if(_={},5===a){if(!(_=c(t,s.properties)))return!1;S+=_.length}}var k=!1;if(null!=h){if(!v(h))return t.destroy(Error("Invalid username")),!1;k=!0,S+=g.byteLength(h)+2}if(null!=b){if(!k)return t.destroy(Error("Username is required to use password")),!1;if(!v(b))return t.destroy(Error("Invalid password")),!1;S+=p(b)+2}t.write(y.CONNECT_HEADER),i(t,S),l(t,n),r.bridgeMode&&(a+=128),t.write(131===a?y.VERSION131:132===a?y.VERSION132:4===a?y.VERSION4:5===a?y.VERSION5:y.VERSION3);var E=0;return E|=null!=h?y.USERNAME_MASK:0,E|=null!=b?y.PASSWORD_MASK:0,E|=s&&s.retain?y.WILL_RETAIN_MASK:0,E|=s&&s.qos?s.qos<<y.WILL_QOS_SHIFT:0,E|=s?y.WILL_FLAG_MASK:0,E|=u?y.CLEAN_SESSION_MASK:0,t.write(g.from([E])),P(t,f),5===a&&w.write(),l(t,d),s&&(5===a&&_.write(),o(t,s.topic),l(t,s.payload)),null!=h&&l(t,h),null!=b&&l(t,b),!0}(e,t);case"connack":return function(e,t,r){var n=r?r.protocolVersion:4,o=e||{},a=5===n?o.reasonCode:o.returnCode,s=o.properties,u=2;if("number"!=typeof a)return t.destroy(Error("Invalid return code")),!1;var l=null;if(5===n){if(!(l=c(t,s)))return!1;u+=l.length}return t.write(y.CONNACK_HEADER),i(t,u),t.write(o.sessionPresent?y.SESSIONPRESENT_HEADER:m),t.write(g.from([a])),null==l||l.write(),!0}(e,t,r);case"publish":return function(e,t,r){S("publish: packet: %o",e);var n=r?r.protocolVersion:4,o=e||{},a=o.qos||0,s=o.retain?y.RETAIN_MASK:0,u=o.topic,l=o.payload||b,f=o.messageId,d=o.properties,h=0;if("string"==typeof u)h+=g.byteLength(u)+2;else{if(!g.isBuffer(u))return t.destroy(Error("Invalid topic")),!1;h+=u.length+2}if(g.isBuffer(l)?h+=l.length:h+=g.byteLength(l),a&&"number"!=typeof f)return t.destroy(Error("Invalid messageId")),!1;a&&(h+=2);var v=null;if(5===n){if(!(v=c(t,d)))return!1;h+=v.length}return t.write(y.PUBLISH_HEADER[a][o.dup?1:0][s?1:0]),i(t,h),P(t,p(u)),t.write(u),a>0&&P(t,f),null==v||v.write(),S("publish: payload: %o",l),t.write(l)}(e,t,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,r){var n=r?r.protocolVersion:4,o=e||{},a=o.cmd||"puback",s=o.messageId,u=o.dup&&"pubrel"===a?y.DUP_MASK:0,l=0,c=o.reasonCode,d=o.properties,h=5===n?3:2;if("pubrel"===a&&(l=1),"number"!=typeof s)return t.destroy(Error("Invalid messageId")),!1;var p=null;if(5===n&&"object"==typeof d){if(!(p=f(t,d,r,h)))return!1;h+=p.length}return t.write(y.ACKS[a][l][u][0]),3===h&&(h+=0!==c?1:-1),i(t,h),P(t,s),5===n&&2!==h&&t.write(g.from([c])),null!==p?p.write():4===h&&t.write(g.from([0])),!0}(e,t,r);case"subscribe":return function(e,t,r){S("subscribe: packet: ");var n=r?r.protocolVersion:4,a=e||{},s=a.dup?y.DUP_MASK:0,u=a.messageId,l=a.subscriptions,f=a.properties,d=0;if("number"!=typeof u)return t.destroy(Error("Invalid messageId")),!1;d+=2;var h=null;if(5===n){if(!(h=c(t,f)))return!1;d+=h.length}if("object"!=typeof l||!l.length)return t.destroy(Error("Invalid subscriptions")),!1;for(var p=0;p<l.length;p+=1){var v=l[p].topic,b=l[p].qos;if("string"!=typeof v)return t.destroy(Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof b)return t.destroy(Error("Invalid subscriptions - invalid qos")),!1;if(5===n){if("boolean"!=typeof(l[p].nl||!1))return t.destroy(Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(l[p].rap||!1))return t.destroy(Error("Invalid subscriptions - invalid Retain as Published")),!1;var m=l[p].rh||0;if("number"!=typeof m||m>2)return t.destroy(Error("Invalid subscriptions - invalid Retain Handling")),!1}d+=g.byteLength(v)+2+1}S("subscribe: writing to stream: %o",y.SUBSCRIBE_HEADER),t.write(y.SUBSCRIBE_HEADER[1][s?1:0][0]),i(t,d),P(t,u),null!==h&&h.write();var w=!0,_=!0,k=!1,E=void 0;try{for(var A,x=l[Symbol.iterator]();!(_=(A=x.next()).done);_=!0){var I=A.value,O=void 0,T=I.topic,R=I.qos,M=+I.nl,C=+I.rap,j=I.rh;o(t,T),O=y.SUBSCRIBE_OPTIONS_QOS[R],5===n&&(O|=M?y.SUBSCRIBE_OPTIONS_NL:0,O|=C?y.SUBSCRIBE_OPTIONS_RAP:0,O|=j?y.SUBSCRIBE_OPTIONS_RH[j]:0),w=t.write(g.from([O]))}}catch(e){k=!0,E=e}finally{try{_||null==x.return||x.return()}finally{if(k)throw E}}return w}(e,t,r);case"suback":return function(e,t,r){var n=r?r.protocolVersion:4,o=e||{},a=o.messageId,s=o.granted,u=o.properties,l=0;if("number"!=typeof a)return t.destroy(Error("Invalid messageId")),!1;if(l+=2,"object"!=typeof s||!s.length)return t.destroy(Error("Invalid qos vector")),!1;for(var c=0;c<s.length;c+=1){if("number"!=typeof s[c])return t.destroy(Error("Invalid qos vector")),!1;l+=1}var d=null;if(5===n){if(!(d=f(t,u,r,l)))return!1;l+=d.length}return t.write(y.SUBACK_HEADER),i(t,l),P(t,a),null!==d&&d.write(),t.write(g.from(s))}(e,t,r);case"unsubscribe":return function(e,t,r){var n=r?r.protocolVersion:4,a=e||{},s=a.messageId,u=a.dup?y.DUP_MASK:0,l=a.unsubscriptions,f=a.properties,d=0;if("number"!=typeof s)return t.destroy(Error("Invalid messageId")),!1;if(d+=2,"object"!=typeof l||!l.length)return t.destroy(Error("Invalid unsubscriptions")),!1;for(var h=0;h<l.length;h+=1){if("string"!=typeof l[h])return t.destroy(Error("Invalid unsubscriptions")),!1;d+=g.byteLength(l[h])+2}var p=null;if(5===n){if(!(p=c(t,f)))return!1;d+=p.length}t.write(y.UNSUBSCRIBE_HEADER[1][u?1:0][0]),i(t,d),P(t,s),null!==p&&p.write();for(var v=!0,b=0;b<l.length;b++)v=o(t,l[b]);return v}(e,t,r);case"unsuback":return function(e,t,r){var n=r?r.protocolVersion:4,o=e||{},a=o.messageId,s=o.dup?y.DUP_MASK:0,u=o.granted,l=o.properties,c=o.cmd,d=2;if("number"!=typeof a)return t.destroy(Error("Invalid messageId")),!1;if(5===n){if("object"!=typeof u||!u.length)return t.destroy(Error("Invalid qos vector")),!1;for(var h=0;h<u.length;h+=1){if("number"!=typeof u[h])return t.destroy(Error("Invalid qos vector")),!1;d+=1}}var p=null;if(5===n){if(!(p=f(t,l,r,d)))return!1;d+=p.length}return t.write(y.ACKS[c][0][s][0]),i(t,d),P(t,a),null!==p&&p.write(),5===n&&t.write(g.from(u)),!0}(e,t,r);case"pingreq":case"pingresp":return function(e,t){return t.write(y.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,r){var n=r?r.protocolVersion:4,o=e||{},a=o.reasonCode,s=o.properties,u=5===n?1:0,l=null;if(5===n){if(!(l=f(t,s,r,u)))return!1;u+=l.length}return t.write(g.from([y.codes.disconnect<<4])),i(t,u),5===n&&t.write(g.from([a])),null!==l&&l.write(),!0}(e,t,r);case"auth":return function(e,t,r){var n=r?r.protocolVersion:4,o=e||{},a=o.reasonCode,s=o.properties,u=5===n?1:0;5!==n&&t.destroy(Error("Invalid mqtt version for auth packet"));var l=f(t,s,r,u);return!!l&&(u+=l.length,t.write(g.from([y.codes.auth<<4])),i(t,u),t.write(g.from([a])),null!==l&&l.write(),!0)}(e,t,r);default:return t.destroy(Error("Unknown command")),!1}},n=function(e){e.uncork()},i=function(e,t){if(t>y.VARBYTEINT_MAX)return e.destroy(Error("Invalid variable byte integer: "+t)),!1;var r=T[t];return r||(r=x(t),t<16384&&(T[t]=r)),S("writeVarByteInt: writing to stream: %o",r),e.write(r)},o=function(e,t){var r=g.byteLength(t);return P(e,r),S("writeString: %s",t),e.write(t,"utf8")},a=function(e,t,r){o(e,t),o(e,r)},s=function(e,t){return S("writeNumberCached: number: %d",t),S("writeNumberCached: %o",k[t]),e.write(k[t])},u=function(e,t){var r=E(t);return S("writeNumberGenerated: %o",r),e.write(r)},l=function(e,t){"string"==typeof t?o(e,t):t?(P(e,t.length),e.write(t)):P(e,0)},c=function(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write:function(){h(e,{},0)}};var r=0;function n(t,r){var n=0;switch(y.propertiesTypes[t]){case"byte":if("boolean"!=typeof r)return e.destroy(Error("Invalid ".concat(t,": ").concat(r))),!1;n+=2;break;case"int8":if("number"!=typeof r||r<0||r>255)return e.destroy(Error("Invalid ".concat(t,": ").concat(r))),!1;n+=2;break;case"binary":if(r&&null===r)return e.destroy(Error("Invalid ".concat(t,": ").concat(r))),!1;n+=1+g.byteLength(r)+2;break;case"int16":if("number"!=typeof r||r<0||r>65535)return e.destroy(Error("Invalid ".concat(t,": ").concat(r))),!1;n+=3;break;case"int32":if("number"!=typeof r||r<0||r>4294967295)return e.destroy(Error("Invalid ".concat(t,": ").concat(r))),!1;n+=5;break;case"var":if("number"!=typeof r||r<0||r>268435455)return e.destroy(Error("Invalid ".concat(t,": ").concat(r))),!1;n+=1+g.byteLength(x(r));break;case"string":if("string"!=typeof r)return e.destroy(Error("Invalid ".concat(t,": ").concat(r))),!1;n+=3+g.byteLength(r.toString());break;case"pair":if("object"!=typeof r)return e.destroy(Error("Invalid ".concat(t,": ").concat(r))),!1;n+=Object.getOwnPropertyNames(r).reduce((function(e,t){var n=r[t];return e+(Array.isArray(n)?n.reduce((function(e,r){return e+(3+g.byteLength(t.toString())+2+g.byteLength(r.toString()))}),0):3+g.byteLength(t.toString())+2+g.byteLength(r[t].toString()))}),0);break;default:return e.destroy(Error("Invalid property ".concat(t,": ").concat(r))),!1}return n}if(t)for(var i in t){var o=0,a=0,s=t[i];if(void 0!==s){if(Array.isArray(s))for(var u=0;u<s.length;u++){if(!(a=n(i,s[u])))return!1;o+=a}else{if(!(a=n(i,s)))return!1;o=a}if(!o)return!1;r+=o}}return{length:g.byteLength(x(r))+r,write:function(){h(e,t,r)}}},f=function(e,t,r,n){var i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,a=c(e,t);if(o)for(;n+a.length>o;){var s=i.shift();if(!s||!t[s])return!1;delete t[s],a=c(e,t)}return a},d=function(e,t,r){switch(y.propertiesTypes[t]){case"byte":e.write(g.from([y.properties[t]])),e.write(g.from([+r]));break;case"int8":e.write(g.from([y.properties[t]])),e.write(g.from([r]));break;case"binary":e.write(g.from([y.properties[t]])),l(e,r);break;case"int16":e.write(g.from([y.properties[t]])),P(e,r);break;case"int32":e.write(g.from([y.properties[t]])),function(e,t){var r=I(t);S("write4ByteNumber: %o",r),e.write(r)}(e,r);break;case"var":e.write(g.from([y.properties[t]])),i(e,r);break;case"string":e.write(g.from([y.properties[t]])),o(e,r);break;case"pair":Object.getOwnPropertyNames(r).forEach((function(n){var i=r[n];Array.isArray(i)?i.forEach((function(r){e.write(g.from([y.properties[t]])),a(e,n.toString(),r.toString())})):(e.write(g.from([y.properties[t]])),a(e,n.toString(),i.toString()))}));break;default:return e.destroy(Error("Invalid property ".concat(t," value: ").concat(r))),!1}},h=function(e,t,r){for(var n in i(e,r),t)if({}.hasOwnProperty.call(t,n)&&null!=t[n]){var o=t[n];if(Array.isArray(o))for(var a=0;a<o.length;a++)d(e,n,o[a]);else d(e,n,o)}},p=function(e){return e?e instanceof g?e.length:g.byteLength(e):0},v=function(e){return"string"==typeof e||e instanceof g};ne(),Jt(),Bt();var y=Vr(),g=(Yt(),re(Vt)).Buffer,b=g.allocUnsafe(0),m=g.from([0]),w=Yr(),_=Jr().nextTick,S=Kr()("mqtt-packet:writeToStream"),k=w.cache,E=w.generateNumber,A=w.generateCache,x=w.genBufVariableByteInt,I=w.generate4ByteBuffer,P=s,O=!0;Object.defineProperty(r,"cacheNumbers",{get:function(){return P===s},set:function(e){e?((!k||0===Object.keys(k).length)&&(O=!0),P=s):(O=!1,P=u)}});var T={};t.exports=r})),Xr=ee((function(e,t){ne(),Jt(),Bt();var r=$r(),n=(pr(),re(tr)).EventEmitter,i=(Yt(),re(Vt)).Buffer,o=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e;return(0,E.default)(this,r),(e=t.call(this))._array=Array(20),e._i=0,(0,W.default)(e)}return(0,C.default)(r,[{key:"write",value:function(e){return this._array[this._i++]=e,!0}},{key:"concat",value:function(){var e,t=0,r=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];var a=i.allocUnsafe(t);for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?(n[e].copy(a,o),o+=r[e]):(a.write(n[e],o),o+=r[e]);return a}},{key:"destroy",value:function(e){e&&this.emit("error",e)}}]),r}(n);t.exports=function(e,t){var n=new o;return r(e,n,t),n.concat()}})),Zr=ee((function(e){ne(),Jt(),Bt(),e.parser=Qr().parser,e.generate=Xr(),e.writeToStream=$r()})),en=ee((function(e,t){var r=function(e){return e instanceof Gt?Gt.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)};ne(),Jt(),Bt(),t.exports=function(e){var t=function(e,t){for(var i=Object.keys(e),o=Array(i.length),a=0;a<i.length;a++){var s=i[a],u=e[s];"object"!=typeof u||null===u?o[s]=u:u.constructor!==Object&&(c=n.get(u.constructor))?o[s]=c(u,t):ArrayBuffer.isView(u)?o[s]=r(u):o[s]=t(u)}return o};if((e=e||{}).circles)return function(e){var t=function(e,t){for(var a=Object.keys(e),s=Array(a.length),u=0;u<a.length;u++){var l=a[u],c=e[l];if("object"!=typeof c||null===c)s[l]=c;else if(c.constructor!==Object&&(d=o.get(c.constructor)))s[l]=d(c,t);else if(ArrayBuffer.isView(c))s[l]=r(c);else{var f=n.indexOf(c);s[l]=-1!==f?i[f]:t(c)}}return s},n=[],i=[],o=new Map,a=!0,s=!1,u=void 0;if(o.set(Date,(function(e){return new Date(e)})),o.set(Map,(function(e,r){return new Map(t(Array.from(e),r))})),o.set(Set,(function(e,r){return new Set(t(Array.from(e),r))})),e.constructorHandlers)try{for(var l,c=e.constructorHandlers[Symbol.iterator]();!(a=(l=c.next()).done);a=!0){var f=l.value;o.set(f[0],f[1])}}catch(e){s=!0,u=e}finally{try{a||null==c.return||c.return()}finally{if(s)throw u}}var d=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return t(a,e);if(a.constructor!==Object&&(d=o.get(a.constructor)))return d(a,e);var s={};for(var u in n.push(a),i.push(s),a){var l=a[u];if("object"!=typeof l||null===l)s[u]=l;else if(l.constructor!==Object&&(d=o.get(l.constructor)))s[u]=d(l,e);else if(ArrayBuffer.isView(l))s[u]=r(l);else{var c=n.indexOf(l);s[u]=-1!==c?i[c]:e(l)}}return n.pop(),i.pop(),s}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return t(a,e);if(a.constructor!==Object&&(d=o.get(a.constructor)))return d(a,e);var s={};for(var u in n.push(a),i.push(s),a)if(!1!==Object.hasOwnProperty.call(a,u)){var l=a[u];if("object"!=typeof l||null===l)s[u]=l;else if(l.constructor!==Object&&(d=o.get(l.constructor)))s[u]=d(l,e);else if(ArrayBuffer.isView(l))s[u]=r(l);else{var c=n.indexOf(l);s[u]=-1!==c?i[c]:e(l)}}return n.pop(),i.pop(),s}}(e);var n=new Map,i=!0,o=!1,a=void 0;if(n.set(Date,(function(e){return new Date(e)})),n.set(Map,(function(e,r){return new Map(t(Array.from(e),r))})),n.set(Set,(function(e,r){return new Set(t(Array.from(e),r))})),e.constructorHandlers)try{for(var s,u=e.constructorHandlers[Symbol.iterator]();!(i=(s=u.next()).done);i=!0){var l=s.value;n.set(l[0],l[1])}}catch(e){o=!0,a=e}finally{try{i||null==u.return||u.return()}finally{if(o)throw a}}var c=null;return e.proto?function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return t(i,e);if(i.constructor!==Object&&(c=n.get(i.constructor)))return c(i,e);var o={};for(var a in i){var s=i[a];"object"!=typeof s||null===s?o[a]=s:s.constructor!==Object&&(c=n.get(s.constructor))?o[a]=c(s,e):ArrayBuffer.isView(s)?o[a]=r(s):o[a]=e(s)}return o}:function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return t(i,e);if(i.constructor!==Object&&(c=n.get(i.constructor)))return c(i,e);var o={};for(var a in i)if(!1!==Object.hasOwnProperty.call(i,a)){var s=i[a];"object"!=typeof s||null===s?o[a]=s:s.constructor!==Object&&(c=n.get(s.constructor))?o[a]=c(s,e):ArrayBuffer.isView(s)?o[a]=r(s):o[a]=e(s)}return o}}})),tn=ee((function(e,t){ne(),Jt(),Bt(),t.exports=en()()})),rn=ee((function(e){var t=function(e){for(var t=e.split("/"),r=0;r<t.length;r++)if("+"!==t[r]){if("#"===t[r])return r===t.length-1;if(-1!==t[r].indexOf("+")||-1!==t[r].indexOf("#"))return!1}return!0};ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopic=t,e.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(var r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}})),nn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0});var t=Dr(),r={objectMode:!0},n={clean:!0};e.default=function(){"use strict";function e(t){(0,E.default)(this,e),(0,j.default)(this,"options",void 0),(0,j.default)(this,"_inflights",void 0),this.options=t||{},this.options=(0,L.default)({},n,t),this._inflights=new Map}return(0,C.default)(e,[{key:"put",value:function(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}},{key:"createStream",value:function(){var e=new t.Readable(r),n=[],i=!1,o=0;return this._inflights.forEach((function(e){n.push(e)})),e._read=function(){!i&&o<n.length?e.push(n[o++]):e.push(null)},e.destroy=function(){if(!i)return i=!0,setTimeout((function(){e.emit("close")}),0),e},e}},{key:"del",value:function(e,t){var r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(Error("missing packet")),this}},{key:"get",value:function(e,t){var r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(Error("missing packet")),this}},{key:"close",value:function(e){this.options.clean&&(this._inflights=null),e&&e()}}]),e}()})),on=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0});var t=[0,16,128,131,135,144,145,151,153];e.default=function(e,r,n){e.log("handlePublish: packet %o",r),n=(void 0===n?"undefined":(0,V.default)(n))<"u"?n:e.noop;var i,o=r.topic.toString(),a=r.payload,s=r.qos,u=r.messageId,l=e.options;if(5===e.options.protocolVersion&&(r.properties&&(i=r.properties.topicAlias),(void 0===i?"undefined":(0,V.default)(i))<"u"))if(0===o.length){if(!(i>0&&i<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",i),void e.emit("error",Error("Received Topic Alias is out of range"));var c=e.topicAliasRecv.getTopicByAlias(i);if(!c)return e.log("handlePublish :: unregistered topic alias. alias: %d",i),void e.emit("error",Error("Received unregistered Topic Alias"));o=c,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",o,i)}else{if(!e.topicAliasRecv.put(o,i))return e.log("handlePublish :: topic alias out of range. alias: %d",i),void e.emit("error",Error("Received Topic Alias is out of range"));e.log("handlePublish :: registered topic: %s - alias: %d",o,i)}switch(e.log("handlePublish: qos %d",s),s){case 2:l.customHandleAcks(o,a,r,(function(i,o){return"number"==typeof i&&(o=i,i=null),i?e.emit("error",i):-1===t.indexOf(o)?e.emit("error",Error("Wrong reason code for pubrec")):void(o?e._sendPacket({cmd:"pubrec",messageId:u,reasonCode:o},n):e.incomingStore.put(r,(function(){e._sendPacket({cmd:"pubrec",messageId:u},n)})))}));break;case 1:l.customHandleAcks(o,a,r,(function(i,s){return"number"==typeof i&&(s=i,i=null),i?e.emit("error",i):-1===t.indexOf(s)?e.emit("error",Error("Wrong reason code for puback")):(s||e.emit("message",o,a,r),void e.handleMessage(r,(function(t){if(t)return n&&n(t);e._sendPacket({cmd:"puback",messageId:u,reasonCode:s},n)})))}));break;case 0:e.emit("message",o,a,r),e.handleMessage(r,n);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}})),an=ee((function(e,t){t.exports={version:"5.14.1"}})),sn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.ErrorWithSubackPacket=e.ErrorWithReasonCode=void 0,e.applyMixin=function(e,t){for(var r,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=[t];;){var o=i[0],a=Object.getPrototypeOf(o);if(!(null==a?void 0:a.prototype))break;i.unshift(a)}var s=!0,u=!1,l=void 0,c=!0,f=!1,d=void 0;try{for(var h,p=i[Symbol.iterator]();!(c=(h=p.next()).done);c=!0){var v=h.value;try{for(var y,g=Object.getOwnPropertyNames(v.prototype)[Symbol.iterator]();!(s=(y=g.next()).done);s=!0){var b=y.value;(n||"constructor"!==b)&&Object.defineProperty(e.prototype,b,null!==(r=Object.getOwnPropertyDescriptor(v.prototype,b))&&void 0!==r?r:Object.create(null))}}catch(e){u=!0,l=e}finally{try{s||null==g.return||g.return()}finally{if(u)throw l}}}}catch(e){f=!0,d=e}finally{try{c||null==p.return||p.return()}finally{if(f)throw d}}},e.ErrorWithReasonCode=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n){var i;return(0,E.default)(this,r),i=t.call(this,e),(0,j.default)((0,m.default)(i),"code",void 0),i.code=n,Object.setPrototypeOf((0,m.default)(i),r.prototype),Object.getPrototypeOf(i).name="ErrorWithReasonCode",(0,W.default)(i)}return r}((0,G.default)(Error)),e.ErrorWithSubackPacket=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n){var i;return(0,E.default)(this,r),i=t.call(this,e),(0,j.default)((0,m.default)(i),"packet",void 0),i.packet=n,Object.setPrototypeOf((0,m.default)(i),r.prototype),Object.getPrototypeOf(i).name="ErrorWithSubackPacket",(0,W.default)(i)}return r}((0,G.default)(Error)),e.nextTick="function"==typeof(null==ie?void 0:ie.nextTick)?ie.nextTick:function(e){setTimeout(e,0)},e.MQTTJS_VERSION=an().version})),un=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var t=sn();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=function(r,n){var i=n.messageId,o=n.cmd,a=null,s=r.outgoing[i]?r.outgoing[i].cb:null,u=null;if(s){switch(r.log("_handleAck :: packet type",o),o){case"pubcomp":case"puback":var l=n.reasonCode;l&&l>0&&16!==l?(u=new t.ErrorWithReasonCode("Publish error: "+e.ReasonCodes[l],l),r._removeOutgoingAndStoreMessage(i,(function(){s(u,n)}))):r._removeOutgoingAndStoreMessage(i,s);break;case"pubrec":a={cmd:"pubrel",qos:2,messageId:i};var c=n.reasonCode;c&&c>0&&16!==c?(u=new t.ErrorWithReasonCode("Publish error: "+e.ReasonCodes[c],c),r._removeOutgoingAndStoreMessage(i,(function(){s(u,n)}))):r._sendPacket(a);break;case"suback":delete r.outgoing[i],r.messageIdProvider.deallocate(i);for(var f=n.granted,d=0;d<f.length;d++){var h=f[d];if(128&h){(u=Error("Subscribe error: "+e.ReasonCodes[h])).code=h;var p=r.messageIdToTopic[i];p&&p.forEach((function(e){delete r._resubscribeTopics[e]}))}}delete r.messageIdToTopic[i],r._invokeStoreProcessingQueue(),s(u,n);break;case"unsuback":delete r.outgoing[i],r.messageIdProvider.deallocate(i),r._invokeStoreProcessingQueue(),s(null,n);break;default:r.emit("error",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.")}})),ln=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0});var t=sn(),r=un();e.default=function(e,n){var i=e.options.protocolVersion,o=5===i?n.reasonCode:n.returnCode;if(5===i)e.handleAuth(n,(function(n,i){if(n)e.emit("error",n);else if(24===o)e.reconnecting=!1,e._sendPacket(i);else{var a=new t.ErrorWithReasonCode("Connection refused: "+r.ReasonCodes[o],o);e.emit("error",a)}}));else{var a=new t.ErrorWithReasonCode("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+i,o);e.emit("error",a)}}})),cn=ee((function(e){var t,r,n,i,o,a,s,u,l,c,f,d,h,p,v,y,g,b,m,w,_,k,B,N,z,Y,J,$,X,Z,ee,te,re,oe,ae,se,ue,le,ce,fe,de,he,pe,ve,ye,ge,be=function(){var e=this,t=new qe((0,A.default)(this,o)),r=new qe((0,A.default)(this,o));(0,I.default)(this,N,t),(0,I.default)(this,B,r),(0,I.default)(this,ee,(function(n,i){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Re.now();if(r[n]=0!==i?o:0,t[n]=i,0!==i&&e.ttlAutopurge){var a=setTimeout((function(){(0,A.default)(e,te).call(e,n)&&(0,O.default)(e,ye,Pe).call(e,(0,A.default)(e,p)[n],"expire")}),i+1);a.unref&&a.unref()}})),(0,I.default)(this,X,(function(e){r[e]=0!==t[e]?Re.now():0})),(0,I.default)(this,Z,(function(e,o){if(t[o]){var a=t[o],s=r[o];if(!a||!s)return;e.ttl=a,e.start=s,e.now=n||i();var u=e.now-s;e.remainingTTL=a-u}}));var n=0,i=function(){var t=Re.now();if(e.ttlResolution>0){n=t;var r=setTimeout((function(){return n=0}),e.ttlResolution);r.unref&&r.unref()}return t};this.getRemainingTTL=function(o){var a=(0,A.default)(e,h).get(o);if(void 0===a)return 0;var s=t[a],u=r[a];return s&&u?s-((n||i())-u):1/0},(0,I.default)(this,te,(function(e){var o=r[e],a=t[e];return!!a&&!!o&&(n||i())-o>a}))},me=function(){var e=this,t=new qe((0,A.default)(this,o));(0,I.default)(this,d,0),(0,I.default)(this,k,t),(0,I.default)(this,oe,(function(r){(0,I.default)(e,d,(0,A.default)(e,d)-t[r]),t[r]=0})),(0,I.default)(this,se,(function(t,r,n,i){if((0,O.default)(e,he,Ae).call(e,r))return 0;if(!Fe(n)){if(!i)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 i)throw new TypeError("sizeCalculation must be a function");if(n=i(r,t),!Fe(n))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return n})),(0,I.default)(this,ae,(function(r,n,i){if(t[r]=n,(0,A.default)(e,a))for(var o=(0,A.default)(e,a)-t[r];(0,A.default)(e,d)>o;)(0,O.default)(e,fe,ke).call(e,!0);(0,I.default)(e,d,(0,A.default)(e,d)+t[r]),i&&(i.entrySize=n,i.totalCalculatedSize=(0,A.default)(e,d))}))},we=function(){var e,t,r,n,i=arguments;return(0,Q.__generator)(this,(function(o){switch(o.label){case 0:if(e=(i.length>0&&void 0!==i[0]?i[0]:{}).allowStale,t=void 0===e?this.allowStale:e,!(0,A.default)(this,f))return[3,6];r=(0,A.default)(this,m),o.label=1;case 1:return(n=(0,O.default)(this,ce,Se).call(this,r))?t||!(0,A.default)(this,te).call(this,r)?[4,r]:[3,3]:[3,4];case 2:o.sent(),o.label=3;case 3:n=r!==(0,A.default)(this,b),o.label=4;case 4:if(!n)return[3,6];r=(0,A.default)(this,g)[r],o.label=5;case 5:return[3,1];case 6:return[2]}}))},_e=function(){var e,t,r,n,i=arguments;return(0,Q.__generator)(this,(function(o){switch(o.label){case 0:if(e=(i.length>0&&void 0!==i[0]?i[0]:{}).allowStale,t=void 0===e?this.allowStale:e,!(0,A.default)(this,f))return[3,6];r=(0,A.default)(this,b),o.label=1;case 1:return(n=(0,O.default)(this,ce,Se).call(this,r))?t||!(0,A.default)(this,te).call(this,r)?[4,r]:[3,3]:[3,4];case 2:o.sent(),o.label=3;case 3:n=r!==(0,A.default)(this,m),o.label=4;case 4:if(!n)return[3,6];r=(0,A.default)(this,y)[r],o.label=5;case 5:return[3,1];case 6:return[2]}}))},Se=function(e){return void 0!==e&&(0,A.default)(this,h).get((0,A.default)(this,p)[e])===e},ke=function(e){var t,r,n=(0,A.default)(this,b),i=(0,A.default)(this,p)[n],o=(0,A.default)(this,v)[n];return(0,A.default)(this,Y)&&(0,O.default)(this,he,Ae).call(this,o)?o.__abortController.abort(Error("evicted")):((0,A.default)(this,z)||(0,A.default)(this,J))&&((0,A.default)(this,z)&&(null===(t=(0,A.default)(this,s))||void 0===t||t.call(this,o,i,"evict")),(0,A.default)(this,J)&&(null===(r=(0,A.default)(this,_))||void 0===r||r.push([o,i,"evict"]))),(0,A.default)(this,oe).call(this,n),e&&((0,A.default)(this,p)[n]=void 0,(0,A.default)(this,v)[n]=void 0,(0,A.default)(this,w).push(n)),1===(0,A.default)(this,f)?((0,I.default)(this,b,(0,I.default)(this,m,0)),(0,A.default)(this,w).length=0):(0,I.default)(this,b,(0,A.default)(this,y)[n]),(0,A.default)(this,h).delete(i),(0,P.default)(this,f).value--,n},Ee=function(e,t,r,n){var i=this,o=void 0===t?void 0:(0,A.default)(this,v)[t];if((0,O.default)(this,he,Ae).call(this,o))return o;var a=new Be,s=r.signal;null==s||s.addEventListener("abort",(function(){return a.abort(s.reason)}),{signal:a.signal});var u={signal:a.signal,options:r,context:n},c=function(n){var o=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=a.signal.aborted,l=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!o?(r.status.fetchAborted=!0,r.status.fetchError=a.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!l&&!o)return f(a.signal.reason);var c=d;return(0,A.default)(i,v)[t]===d&&(void 0===n?c.__staleWhileFetching?(0,A.default)(i,v)[t]=c.__staleWhileFetching:(0,O.default)(i,ye,Pe).call(i,e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),i.set(e,n,u.options))),n},f=function(n){var o=a.signal.aborted&&r.allowStaleOnFetchAbort,s=o||r.allowStaleOnFetchRejection,u=s||r.noDeleteOnFetchRejection,l=d;if((0,A.default)(i,v)[t]===d&&(u&&void 0!==l.__staleWhileFetching?o||((0,A.default)(i,v)[t]=l.__staleWhileFetching):(0,O.default)(i,ye,Pe).call(i,e,"fetch")),s)return r.status&&void 0!==l.__staleWhileFetching&&(r.status.returnedStale=!0),l.__staleWhileFetching;if(l.__returned===l)throw n};r.status&&(r.status.fetchDispatched=!0);var d=new Promise((function(t,n){var s,f=null===(s=(0,A.default)(i,l))||void 0===s?void 0:s.call(i,e,o,u);f&&f instanceof Promise&&f.then((function(e){return t(void 0===e?void 0:e)}),n),a.signal.addEventListener("abort",(function(){(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=function(e){return c(e,!0)}))}))})).then(c,(function(e){return r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),f(e)})),p=Object.assign(d,{__abortController:a,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,p,(0,D.default)((0,L.default)({},u.options),{status:void 0})),t=(0,A.default)(this,h).get(e)):(0,A.default)(this,v)[t]=p,p},Ae=function(e){if(!(0,A.default)(this,Y))return!1;var t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Be},xe=function(e,t){(0,A.default)(this,g)[t]=e,(0,A.default)(this,y)[e]=t},Ie=function(e){e!==(0,A.default)(this,m)&&(e===(0,A.default)(this,b)?(0,I.default)(this,b,(0,A.default)(this,y)[e]):(0,O.default)(this,pe,xe).call(this,(0,A.default)(this,g)[e],(0,A.default)(this,y)[e]),(0,O.default)(this,pe,xe).call(this,(0,A.default)(this,m),e),(0,I.default)(this,m,e))},Pe=function(e,t){var r,n=!1;if(0!==(0,A.default)(this,f)){var i=(0,A.default)(this,h).get(e);if(void 0!==i)if(n=!0,1===(0,A.default)(this,f))(0,O.default)(this,ge,Oe).call(this,t);else{var o,a;(0,A.default)(this,oe).call(this,i);var l=(0,A.default)(this,v)[i];if((0,O.default)(this,he,Ae).call(this,l)?l.__abortController.abort(Error("deleted")):((0,A.default)(this,z)||(0,A.default)(this,J))&&((0,A.default)(this,z)&&(null===(o=(0,A.default)(this,s))||void 0===o||o.call(this,l,e,t)),(0,A.default)(this,J)&&(null===(a=(0,A.default)(this,_))||void 0===a||a.push([l,e,t]))),(0,A.default)(this,h).delete(e),(0,A.default)(this,p)[i]=void 0,(0,A.default)(this,v)[i]=void 0,i===(0,A.default)(this,m))(0,I.default)(this,m,(0,A.default)(this,g)[i]);else if(i===(0,A.default)(this,b))(0,I.default)(this,b,(0,A.default)(this,y)[i]);else{var c=(0,A.default)(this,g)[i];(0,A.default)(this,y)[c]=(0,A.default)(this,y)[i];var d=(0,A.default)(this,y)[i];(0,A.default)(this,g)[d]=(0,A.default)(this,g)[i]}(0,P.default)(this,f).value--,(0,A.default)(this,w).push(i)}}if((0,A.default)(this,J)&&(null===(r=(0,A.default)(this,_))||void 0===r?void 0:r.length))for(var S,k,E=(0,A.default)(this,_);k=null==E?void 0:E.shift();)null===(S=(0,A.default)(this,u))||void 0===S||S.call.apply(S,[this].concat((0,H.default)(k)));return n},Oe=function(e){var t=!0,r=!1,n=void 0;try{for(var i,o=(0,O.default)(this,le,_e).call(this,{allowStale:!0})[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,l=(0,A.default)(this,v)[a];if((0,O.default)(this,he,Ae).call(this,l))l.__abortController.abort(Error("deleted"));else{var c,y,g=(0,A.default)(this,p)[a];(0,A.default)(this,z)&&(null===(c=(0,A.default)(this,s))||void 0===c||c.call(this,l,g,e)),(0,A.default)(this,J)&&(null===(y=(0,A.default)(this,_))||void 0===y||y.push([l,g,e]))}}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}if((0,A.default)(this,h).clear(),(0,A.default)(this,v).fill(void 0),(0,A.default)(this,p).fill(void 0),(0,A.default)(this,N)&&(0,A.default)(this,B)&&((0,A.default)(this,N).fill(0),(0,A.default)(this,B).fill(0)),(0,A.default)(this,k)&&(0,A.default)(this,k).fill(0),(0,I.default)(this,b,0),(0,I.default)(this,m,0),(0,A.default)(this,w).length=0,(0,I.default)(this,d,0),(0,I.default)(this,f,0),(0,A.default)(this,J)&&(0,A.default)(this,_))for(var S,E,x=(0,A.default)(this,_);E=null==x?void 0:x.shift();)null===(S=(0,A.default)(this,u))||void 0===S||S.call.apply(S,[this].concat((0,H.default)(E)))};ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var Te,Re="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,Me=new Set,Ce="object"==typeof ie&&ie?ie:{},je=function(e,t,r,n){"function"==typeof Ce.emitWarning?Ce.emitWarning(e,t,r,n):console.error("[".concat(r,"] ").concat(t,": ").concat(e))},Be=globalThis.AbortController,Ne=globalThis.AbortSignal;if((void 0===Be?"undefined":(0,V.default)(Be))>"u"){var Ue;Ne=function(){"use strict";function e(){(0,E.default)(this,e),(0,j.default)(this,"onabort",void 0),(0,j.default)(this,"_onabort",[]),(0,j.default)(this,"reason",void 0),(0,j.default)(this,"aborted",!1)}return(0,C.default)(e,[{key:"addEventListener",value:function(e,t){this._onabort.push(t)}}]),e}(),Be=function(){"use strict";function e(){(0,E.default)(this,e),(0,j.default)(this,"signal",new Ne),De()}return(0,C.default)(e,[{key:"abort",value:function(e){if(!this.signal.aborted){var t,r;this.signal.reason=e,this.signal.aborted=!0;var n=!0,i=!1,o=void 0;try{for(var a,s=this.signal._onabort[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){(0,a.value)(e)}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}null===(r=(t=this.signal).onabort)||void 0===r||r.call(t,e)}}}]),e}();var Le="1"!==(null===(Ue=Ce.env)||void 0===Ue?void 0:Ue.LRU_CACHE_IGNORE_AC_WARNING),De=function(){Le&&(Le=!1,je("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",De))}}var Fe=function(e){return e&&e===Math.floor(e)&&e>0&&isFinite(e)},We=function(e){return Fe(e)?e<=256?Uint8Array:e<=65536?Uint16Array:e<=4294967296?Uint32Array:e<=Number.MAX_SAFE_INTEGER?qe:null:null},qe=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e){var n;return(0,E.default)(this,r),(n=t.call(this,e)).fill(0),(0,W.default)(n)}return r}((0,G.default)(Array)),He=(n=function(){"use strict";function e(t,r){if((0,E.default)(this,e),(0,j.default)(this,"heap",void 0),(0,j.default)(this,"length",void 0),!(0,R.default)(e,n,i))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}return(0,C.default)(e,[{key:"push",value:function(e){this.heap[this.length++]=e}},{key:"pop",value:function(){return this.heap[--this.length]}}],[{key:"create",value:function(t){var r=We(t);if(!r)return[];(0,M.default)(e,n,i,!0);var o=new e(t,r);return(0,M.default)(e,n,i,!1),o}}]),e}(),i={writable:!0,value:!1},n),Ve=(o=new WeakMap,a=new WeakMap,s=new WeakMap,u=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,d=new WeakMap,h=new WeakMap,p=new WeakMap,v=new WeakMap,y=new WeakMap,g=new WeakMap,b=new WeakMap,m=new WeakMap,w=new WeakMap,_=new WeakMap,k=new WeakMap,B=new WeakMap,N=new WeakMap,z=new WeakMap,Y=new WeakMap,J=new WeakMap,$=new WeakSet,X=new WeakMap,Z=new WeakMap,ee=new WeakMap,te=new WeakMap,re=new WeakSet,oe=new WeakMap,ae=new WeakMap,se=new WeakMap,ue=new WeakSet,le=new WeakSet,ce=new WeakSet,fe=new WeakSet,de=new WeakSet,he=new WeakSet,pe=new WeakSet,ve=new WeakSet,ye=new WeakSet,ge=new WeakSet,t=Symbol.iterator,r=Symbol.toStringTag,Te=function(){"use strict";function e(t){(0,E.default)(this,e),(0,T.default)(this,$),(0,T.default)(this,re),(0,T.default)(this,ue),(0,T.default)(this,le),(0,T.default)(this,ce),(0,T.default)(this,fe),(0,T.default)(this,de),(0,T.default)(this,he),(0,T.default)(this,pe),(0,T.default)(this,ve),(0,T.default)(this,ye),(0,T.default)(this,ge),(0,x.default)(this,o,{writable:!0,value:void 0}),(0,x.default)(this,a,{writable:!0,value:void 0}),(0,x.default)(this,s,{writable:!0,value:void 0}),(0,x.default)(this,u,{writable:!0,value:void 0}),(0,x.default)(this,l,{writable:!0,value:void 0}),(0,x.default)(this,c,{writable:!0,value:void 0}),(0,j.default)(this,"ttl",void 0),(0,j.default)(this,"ttlResolution",void 0),(0,j.default)(this,"ttlAutopurge",void 0),(0,j.default)(this,"updateAgeOnGet",void 0),(0,j.default)(this,"updateAgeOnHas",void 0),(0,j.default)(this,"allowStale",void 0),(0,j.default)(this,"noDisposeOnSet",void 0),(0,j.default)(this,"noUpdateTTL",void 0),(0,j.default)(this,"maxEntrySize",void 0),(0,j.default)(this,"sizeCalculation",void 0),(0,j.default)(this,"noDeleteOnFetchRejection",void 0),(0,j.default)(this,"noDeleteOnStaleGet",void 0),(0,j.default)(this,"allowStaleOnFetchAbort",void 0),(0,j.default)(this,"allowStaleOnFetchRejection",void 0),(0,j.default)(this,"ignoreFetchAbort",void 0),(0,x.default)(this,f,{writable:!0,value:void 0}),(0,x.default)(this,d,{writable:!0,value:void 0}),(0,x.default)(this,h,{writable:!0,value:void 0}),(0,x.default)(this,p,{writable:!0,value:void 0}),(0,x.default)(this,v,{writable:!0,value:void 0}),(0,x.default)(this,y,{writable:!0,value:void 0}),(0,x.default)(this,g,{writable:!0,value:void 0}),(0,x.default)(this,b,{writable:!0,value:void 0}),(0,x.default)(this,m,{writable:!0,value:void 0}),(0,x.default)(this,w,{writable:!0,value:void 0}),(0,x.default)(this,_,{writable:!0,value:void 0}),(0,x.default)(this,k,{writable:!0,value:void 0}),(0,x.default)(this,B,{writable:!0,value:void 0}),(0,x.default)(this,N,{writable:!0,value:void 0}),(0,x.default)(this,z,{writable:!0,value:void 0}),(0,x.default)(this,Y,{writable:!0,value:void 0}),(0,x.default)(this,J,{writable:!0,value:void 0}),(0,x.default)(this,X,{writable:!0,value:function(){}}),(0,x.default)(this,Z,{writable:!0,value:function(){}}),(0,x.default)(this,ee,{writable:!0,value:function(){}}),(0,x.default)(this,te,{writable:!0,value:function(){return!1}}),(0,x.default)(this,oe,{writable:!0,value:function(){}}),(0,x.default)(this,ae,{writable:!0,value:function(){}}),(0,x.default)(this,se,{writable:!0,value:function(e,t,r,n){if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0}}),(0,j.default)(this,r,"LRUCache");var n=t.max,i=void 0===n?0:n,S=t.ttl,P=t.ttlResolution,R=void 0===P?1:P,M=t.ttlAutopurge,C=t.updateAgeOnGet,U=t.updateAgeOnHas,L=t.allowStale,D=t.dispose,F=t.disposeAfter,W=t.noDisposeOnSet,q=t.noUpdateTTL,H=t.maxSize,V=void 0===H?0:H,G=t.maxEntrySize,K=void 0===G?0:G,Q=t.sizeCalculation,ne=t.fetchMethod,ie=t.memoMethod,we=t.noDeleteOnFetchRejection,_e=t.noDeleteOnStaleGet,Se=t.allowStaleOnFetchRejection,ke=t.allowStaleOnFetchAbort,Ee=t.ignoreFetchAbort;if(0!==i&&!Fe(i))throw new TypeError("max option must be a nonnegative integer");var Ae=i?We(i):Array;if(!Ae)throw Error("invalid max value: "+i);if((0,I.default)(this,o,i),(0,I.default)(this,a,V),this.maxEntrySize=K||(0,A.default)(this,a),this.sizeCalculation=Q,this.sizeCalculation){if(!(0,A.default)(this,a)&&!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!==ie&&"function"!=typeof ie)throw new TypeError("memoMethod must be a function if defined");if((0,I.default)(this,c,ie),void 0!==ne&&"function"!=typeof ne)throw new TypeError("fetchMethod must be a function if specified");if((0,I.default)(this,l,ne),(0,I.default)(this,Y,!!ne),(0,I.default)(this,h,new Map),(0,I.default)(this,p,Array(i).fill(void 0)),(0,I.default)(this,v,Array(i).fill(void 0)),(0,I.default)(this,y,new Ae(i)),(0,I.default)(this,g,new Ae(i)),(0,I.default)(this,b,0),(0,I.default)(this,m,0),(0,I.default)(this,w,He.create(i)),(0,I.default)(this,f,0),(0,I.default)(this,d,0),"function"==typeof D&&(0,I.default)(this,s,D),"function"==typeof F?((0,I.default)(this,u,F),(0,I.default)(this,_,[])):((0,I.default)(this,u,void 0),(0,I.default)(this,_,void 0)),(0,I.default)(this,z,!!(0,A.default)(this,s)),(0,I.default)(this,J,!!(0,A.default)(this,u)),this.noDisposeOnSet=!!W,this.noUpdateTTL=!!q,this.noDeleteOnFetchRejection=!!we,this.allowStaleOnFetchRejection=!!Se,this.allowStaleOnFetchAbort=!!ke,this.ignoreFetchAbort=!!Ee,0!==this.maxEntrySize){if(0!==(0,A.default)(this,a)&&!Fe((0,A.default)(this,a)))throw new TypeError("maxSize must be a positive integer if specified");if(!Fe(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");(0,O.default)(this,re,me).call(this)}if(this.allowStale=!!L,this.noDeleteOnStaleGet=!!_e,this.updateAgeOnGet=!!C,this.updateAgeOnHas=!!U,this.ttlResolution=Fe(R)||0===R?R:1,this.ttlAutopurge=!!M,this.ttl=S||0,this.ttl){if(!Fe(this.ttl))throw new TypeError("ttl must be a positive integer if specified");(0,O.default)(this,$,be).call(this)}if(0===(0,A.default)(this,o)&&0===this.ttl&&0===(0,A.default)(this,a))throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!(0,A.default)(this,o)&&!(0,A.default)(this,a)){var xe="LRU_CACHE_UNBOUNDED";(function(e){return!Me.has(e)})(xe)&&(Me.add(xe),je("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",xe,e))}}return(0,C.default)(e,[{key:"max",get:function(){return(0,A.default)(this,o)}},{key:"maxSize",get:function(){return(0,A.default)(this,a)}},{key:"calculatedSize",get:function(){return(0,A.default)(this,d)}},{key:"size",get:function(){return(0,A.default)(this,f)}},{key:"fetchMethod",get:function(){return(0,A.default)(this,l)}},{key:"memoMethod",get:function(){return(0,A.default)(this,c)}},{key:"dispose",get:function(){return(0,A.default)(this,s)}},{key:"disposeAfter",get:function(){return(0,A.default)(this,u)}},{key:"getRemainingTTL",value:function(e){return(0,A.default)(this,h).has(e)?1/0:0}},{key:"entries",value:function(){var e,t,r,n,i,o,a;return(0,Q.__generator)(this,(function(s){switch(s.label){case 0:e=!0,t=!1,r=void 0,s.label=1;case 1:s.trys.push([1,7,8,9]),n=(0,O.default)(this,ue,we).call(this)[Symbol.iterator](),s.label=2;case 2:return(e=(i=n.next()).done)?[3,6]:(o=i.value,void 0!==(0,A.default)(this,v)[o]&&void 0!==(0,A.default)(this,p)[o]&&!(0,O.default)(this,he,Ae).call(this,(0,A.default)(this,v)[o])?[4,[(0,A.default)(this,p)[o],(0,A.default)(this,v)[o]]]:[3,4]);case 3:s.sent(),s.label=4;case 4:s.label=5;case 5:return e=!0,[3,2];case 6:return[3,9];case 7:return a=s.sent(),t=!0,r=a,[3,9];case 8:try{e||null==n.return||n.return()}finally{if(t)throw r}return[7];case 9:return[2]}}))}},{key:"rentries",value:function(){var e,t,r,n,i,o,a;return(0,Q.__generator)(this,(function(s){switch(s.label){case 0:e=!0,t=!1,r=void 0,s.label=1;case 1:s.trys.push([1,7,8,9]),n=(0,O.default)(this,le,_e).call(this)[Symbol.iterator](),s.label=2;case 2:return(e=(i=n.next()).done)?[3,6]:(o=i.value,void 0!==(0,A.default)(this,v)[o]&&void 0!==(0,A.default)(this,p)[o]&&!(0,O.default)(this,he,Ae).call(this,(0,A.default)(this,v)[o])?[4,[(0,A.default)(this,p)[o],(0,A.default)(this,v)[o]]]:[3,4]);case 3:s.sent(),s.label=4;case 4:s.label=5;case 5:return e=!0,[3,2];case 6:return[3,9];case 7:return a=s.sent(),t=!0,r=a,[3,9];case 8:try{e||null==n.return||n.return()}finally{if(t)throw r}return[7];case 9:return[2]}}))}},{key:"keys",value:function(){var e,t,r,n,i,o,a,s;return(0,Q.__generator)(this,(function(u){switch(u.label){case 0:e=!0,t=!1,r=void 0,u.label=1;case 1:u.trys.push([1,7,8,9]),n=(0,O.default)(this,ue,we).call(this)[Symbol.iterator](),u.label=2;case 2:return(e=(i=n.next()).done)?[3,6]:(o=i.value,a=(0,A.default)(this,p)[o],void 0!==a&&!(0,O.default)(this,he,Ae).call(this,(0,A.default)(this,v)[o])?[4,a]:[3,4]);case 3:u.sent(),u.label=4;case 4:u.label=5;case 5:return e=!0,[3,2];case 6:return[3,9];case 7:return s=u.sent(),t=!0,r=s,[3,9];case 8:try{e||null==n.return||n.return()}finally{if(t)throw r}return[7];case 9:return[2]}}))}},{key:"rkeys",value:function(){var e,t,r,n,i,o,a,s;return(0,Q.__generator)(this,(function(u){switch(u.label){case 0:e=!0,t=!1,r=void 0,u.label=1;case 1:u.trys.push([1,7,8,9]),n=(0,O.default)(this,le,_e).call(this)[Symbol.iterator](),u.label=2;case 2:return(e=(i=n.next()).done)?[3,6]:(o=i.value,a=(0,A.default)(this,p)[o],void 0!==a&&!(0,O.default)(this,he,Ae).call(this,(0,A.default)(this,v)[o])?[4,a]:[3,4]);case 3:u.sent(),u.label=4;case 4:u.label=5;case 5:return e=!0,[3,2];case 6:return[3,9];case 7:return s=u.sent(),t=!0,r=s,[3,9];case 8:try{e||null==n.return||n.return()}finally{if(t)throw r}return[7];case 9:return[2]}}))}},{key:"values",value:function(){var e,t,r,n,i,o,a;return(0,Q.__generator)(this,(function(s){switch(s.label){case 0:e=!0,t=!1,r=void 0,s.label=1;case 1:s.trys.push([1,7,8,9]),n=(0,O.default)(this,ue,we).call(this)[Symbol.iterator](),s.label=2;case 2:return(e=(i=n.next()).done)?[3,6]:(o=i.value,void 0!==(0,A.default)(this,v)[o]&&!(0,O.default)(this,he,Ae).call(this,(0,A.default)(this,v)[o])?[4,(0,A.default)(this,v)[o]]:[3,4]);case 3:s.sent(),s.label=4;case 4:s.label=5;case 5:return e=!0,[3,2];case 6:return[3,9];case 7:return a=s.sent(),t=!0,r=a,[3,9];case 8:try{e||null==n.return||n.return()}finally{if(t)throw r}return[7];case 9:return[2]}}))}},{key:"rvalues",value:function(){var e,t,r,n,i,o,a;return(0,Q.__generator)(this,(function(s){switch(s.label){case 0:e=!0,t=!1,r=void 0,s.label=1;case 1:s.trys.push([1,7,8,9]),n=(0,O.default)(this,le,_e).call(this)[Symbol.iterator](),s.label=2;case 2:return(e=(i=n.next()).done)?[3,6]:(o=i.value,void 0!==(0,A.default)(this,v)[o]&&!(0,O.default)(this,he,Ae).call(this,(0,A.default)(this,v)[o])?[4,(0,A.default)(this,v)[o]]:[3,4]);case 3:s.sent(),s.label=4;case 4:s.label=5;case 5:return e=!0,[3,2];case 6:return[3,9];case 7:return a=s.sent(),t=!0,r=a,[3,9];case 8:try{e||null==n.return||n.return()}finally{if(t)throw r}return[7];case 9:return[2]}}))}},{key:t,value:function(){return this.entries()}},{key:"find",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!0,n=!1,i=void 0;try{for(var o,a=(0,O.default)(this,ue,we).call(this)[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,u=(0,A.default)(this,v)[s],l=(0,O.default)(this,he,Ae).call(this,u)?u.__staleWhileFetching:u;if(void 0!==l&&e(l,(0,A.default)(this,p)[s],this))return this.get((0,A.default)(this,p)[s],t)}}catch(e){n=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"forEach",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=!0,n=!1,i=void 0;try{for(var o,a=(0,O.default)(this,ue,we).call(this)[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,u=(0,A.default)(this,v)[s],l=(0,O.default)(this,he,Ae).call(this,u)?u.__staleWhileFetching:u;void 0!==l&&e.call(t,l,(0,A.default)(this,p)[s],this)}}catch(e){n=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"rforEach",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this,r=!0,n=!1,i=void 0;try{for(var o,a=(0,O.default)(this,le,_e).call(this)[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var s=o.value,u=(0,A.default)(this,v)[s],l=(0,O.default)(this,he,Ae).call(this,u)?u.__staleWhileFetching:u;void 0!==l&&e.call(t,l,(0,A.default)(this,p)[s],this)}}catch(e){n=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"purgeStale",value:function(){var e=!1,t=!0,r=!1,n=void 0;try{for(var i,o=(0,O.default)(this,le,_e).call(this,{allowStale:!0})[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value;(0,A.default)(this,te).call(this,a)&&((0,O.default)(this,ye,Pe).call(this,(0,A.default)(this,p)[a],"expire"),e=!0)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}return e}},{key:"info",value:function(e){var t=(0,A.default)(this,h).get(e);if(void 0!==t){var r=(0,A.default)(this,v)[t],n=(0,O.default)(this,he,Ae).call(this,r)?r.__staleWhileFetching:r;if(void 0!==n){var i={value:n};if((0,A.default)(this,N)&&(0,A.default)(this,B)){var o=(0,A.default)(this,N)[t],a=(0,A.default)(this,B)[t];if(o&&a){var s=o-(Re.now()-a);i.ttl=s,i.start=Date.now()}}return(0,A.default)(this,k)&&(i.size=(0,A.default)(this,k)[t]),i}}}},{key:"dump",value:function(){var e=[],t=!0,r=!1,n=void 0;try{for(var i,o=(0,O.default)(this,ue,we).call(this,{allowStale:!0})[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=i.value,s=(0,A.default)(this,p)[a],u=(0,A.default)(this,v)[a],l=(0,O.default)(this,he,Ae).call(this,u)?u.__staleWhileFetching:u;if(void 0!==l&&void 0!==s){var c={value:l};if((0,A.default)(this,N)&&(0,A.default)(this,B)){c.ttl=(0,A.default)(this,N)[a];var f=Re.now()-(0,A.default)(this,B)[a];c.start=Math.floor(Date.now()-f)}(0,A.default)(this,k)&&(c.size=(0,A.default)(this,k)[a]),e.unshift([s,c])}}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}return e}},{key:"load",value:function(e){this.clear();var t=!0,r=!1,n=void 0;try{for(var i,o=e[Symbol.iterator]();!(t=(i=o.next()).done);t=!0){var a=(0,q.default)(i.value,2),s=a[0],u=a[1];if(u.start){var l=Date.now()-u.start;u.start=Re.now()-l}this.set(s,u.value,u)}}catch(e){r=!0,n=e}finally{try{t||null==o.return||o.return()}finally{if(r)throw n}}}},{key:"set",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(void 0===t)return this.delete(e),this;var n=r.ttl,i=void 0===n?this.ttl:n,a=r.start,l=r.noDisposeOnSet,c=void 0===l?this.noDisposeOnSet:l,d=r.sizeCalculation,b=void 0===d?this.sizeCalculation:d,S=r.status,k=r.noUpdateTTL,E=void 0===k?this.noUpdateTTL:k,x=(0,A.default)(this,se).call(this,e,t,r.size||0,b);if(this.maxEntrySize&&x>this.maxEntrySize)return S&&(S.set="miss",S.maxEntrySizeExceeded=!0),(0,O.default)(this,ye,Pe).call(this,e,"set"),this;var T=0===(0,A.default)(this,f)?void 0:(0,A.default)(this,h).get(e);if(void 0===T)T=0===(0,A.default)(this,f)?(0,A.default)(this,m):0!==(0,A.default)(this,w).length?(0,A.default)(this,w).pop():(0,A.default)(this,f)===(0,A.default)(this,o)?(0,O.default)(this,fe,ke).call(this,!1):(0,A.default)(this,f),(0,A.default)(this,p)[T]=e,(0,A.default)(this,v)[T]=t,(0,A.default)(this,h).set(e,T),(0,A.default)(this,y)[(0,A.default)(this,m)]=T,(0,A.default)(this,g)[T]=(0,A.default)(this,m),(0,I.default)(this,m,T),(0,P.default)(this,f).value++,(0,A.default)(this,ae).call(this,T,x,S),S&&(S.set="add"),E=!1;else{(0,O.default)(this,ve,Ie).call(this,T);var R=(0,A.default)(this,v)[T];if(t!==R){var M,C;if((0,A.default)(this,Y)&&(0,O.default)(this,he,Ae).call(this,R)){var j,B;R.__abortController.abort(Error("replaced"));var U=R.__staleWhileFetching;void 0!==U&&!c&&((0,A.default)(this,z)&&(null===(j=(0,A.default)(this,s))||void 0===j||j.call(this,U,e,"set")),(0,A.default)(this,J)&&(null===(B=(0,A.default)(this,_))||void 0===B||B.push([U,e,"set"])))}else c||((0,A.default)(this,z)&&(null===(M=(0,A.default)(this,s))||void 0===M||M.call(this,R,e,"set")),(0,A.default)(this,J)&&(null===(C=(0,A.default)(this,_))||void 0===C||C.push([R,e,"set"])));if((0,A.default)(this,oe).call(this,T),(0,A.default)(this,ae).call(this,T,x,S),(0,A.default)(this,v)[T]=t,S){S.set="replace";var L=R&&(0,O.default)(this,he,Ae).call(this,R)?R.__staleWhileFetching:R;void 0!==L&&(S.oldValue=L)}}else S&&(S.set="update")}if(0!==i&&!(0,A.default)(this,N)&&(0,O.default)(this,$,be).call(this),(0,A.default)(this,N)&&(E||(0,A.default)(this,ee).call(this,T,i,a),S&&(0,A.default)(this,Z).call(this,S,T)),!c&&(0,A.default)(this,J)&&(0,A.default)(this,_))for(var D,F,W=(0,A.default)(this,_);F=null==W?void 0:W.shift();)null===(D=(0,A.default)(this,u))||void 0===D||D.call.apply(D,[this].concat((0,H.default)(F)));return this}},{key:"pop",value:function(){try{for(;(0,A.default)(this,f);){var e=(0,A.default)(this,v)[(0,A.default)(this,b)];if((0,O.default)(this,fe,ke).call(this,!0),(0,O.default)(this,he,Ae).call(this,e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if((0,A.default)(this,J)&&(0,A.default)(this,_))for(var t,r,n=(0,A.default)(this,_);r=null==n?void 0:n.shift();)null===(t=(0,A.default)(this,u))||void 0===t||t.call.apply(t,[this].concat((0,H.default)(r)))}}},{key:"has",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.updateAgeOnHas,n=void 0===r?this.updateAgeOnHas:r,i=t.status,o=(0,A.default)(this,h).get(e);if(void 0!==o){var a=(0,A.default)(this,v)[o];if((0,O.default)(this,he,Ae).call(this,a)&&void 0===a.__staleWhileFetching)return!1;if(!(0,A.default)(this,te).call(this,o))return n&&(0,A.default)(this,X).call(this,o),i&&(i.has="hit",(0,A.default)(this,Z).call(this,i,o)),!0;i&&(i.has="stale",(0,A.default)(this,Z).call(this,i,o))}else i&&(i.has="miss");return!1}},{key:"peek",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowStale,r=void 0===t?this.allowStale:t,n=(0,A.default)(this,h).get(e);if(void 0!==n&&(r||!(0,A.default)(this,te).call(this,n))){var i=(0,A.default)(this,v)[n];return(0,O.default)(this,he,Ae).call(this,i)?i.__staleWhileFetching:i}}},{key:"fetch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this;return(0,S.default)((function(){var n,i,o,a,s,u,l,c,f,d,p,y,g,b,m,w,_,S,k,E,x,I,P,T,R,M,C,j,B,N,U,L,D,F,W,q,H;return(0,Q.__generator)(this,(function(V){return n=t.allowStale,i=void 0===n?r.allowStale:n,o=t.updateAgeOnGet,a=void 0===o?r.updateAgeOnGet:o,s=t.noDeleteOnStaleGet,u=void 0===s?r.noDeleteOnStaleGet:s,l=t.ttl,c=void 0===l?r.ttl:l,f=t.noDisposeOnSet,d=void 0===f?r.noDisposeOnSet:f,p=t.size,y=void 0===p?0:p,g=t.sizeCalculation,b=void 0===g?r.sizeCalculation:g,m=t.noUpdateTTL,w=void 0===m?r.noUpdateTTL:m,_=t.noDeleteOnFetchRejection,S=void 0===_?r.noDeleteOnFetchRejection:_,k=t.allowStaleOnFetchRejection,E=void 0===k?r.allowStaleOnFetchRejection:k,x=t.ignoreFetchAbort,I=void 0===x?r.ignoreFetchAbort:x,P=t.allowStaleOnFetchAbort,T=void 0===P?r.allowStaleOnFetchAbort:P,R=t.context,M=t.forceRefresh,C=void 0!==M&&M,j=t.status,B=t.signal,(0,A.default)(r,Y)?(N={allowStale:i,updateAgeOnGet:a,noDeleteOnStaleGet:u,ttl:c,noDisposeOnSet:d,size:y,sizeCalculation:b,noUpdateTTL:w,noDeleteOnFetchRejection:S,allowStaleOnFetchRejection:E,allowStaleOnFetchAbort:T,ignoreFetchAbort:I,status:j,signal:B},void 0===(U=(0,A.default)(r,h).get(e))?(j&&(j.fetch="miss"),[2,(L=(0,O.default)(r,de,Ee).call(r,e,U,N,R)).__returned=L]):(D=(0,A.default)(r,v)[U],(0,O.default)(r,he,Ae).call(r,D)?(F=i&&void 0!==D.__staleWhileFetching,[2,(j&&(j.fetch="inflight",F&&(j.returnedStale=!0)),F?D.__staleWhileFetching:D.__returned=D)]):(W=(0,A.default)(r,te).call(r,U),C||W?(q=(0,O.default)(r,de,Ee).call(r,e,U,N,R),H=void 0!==q.__staleWhileFetching&&i,[2,(j&&(j.fetch=W?"stale":"refresh",H&&W&&(j.returnedStale=!0)),H?q.__staleWhileFetching:q.__returned=q)]):[2,(j&&(j.fetch="hit"),(0,O.default)(r,ve,Ie).call(r,U),a&&(0,A.default)(r,X).call(r,U),j&&(0,A.default)(r,Z).call(r,j,U),D)]))):[2,(j&&(j.fetch="get"),r.get(e,{allowStale:i,updateAgeOnGet:a,noDeleteOnStaleGet:u,status:j}))]}))}))()}},{key:"forceFetch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=this;return(0,S.default)((function(){var n;return(0,Q.__generator)(this,(function(i){switch(i.label){case 0:return[4,r.fetch(e,t)];case 1:if(void 0===(n=i.sent()))throw Error("fetch() returned undefined");return[2,n]}}))}))()}},{key:"memo",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,A.default)(this,c);if(!r)throw Error("no memoMethod provided to constructor");var n=t.context,i=t.forceRefresh,o=(0,F.default)(t,["context","forceRefresh"]),a=this.get(e,o);if(!i&&void 0!==a)return a;var s=r(e,a,{options:o,context:n});return this.set(e,s,o),s}},{key:"get",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.allowStale,n=void 0===r?this.allowStale:r,i=t.updateAgeOnGet,o=void 0===i?this.updateAgeOnGet:i,a=t.noDeleteOnStaleGet,s=void 0===a?this.noDeleteOnStaleGet:a,u=t.status,l=(0,A.default)(this,h).get(e);if(void 0!==l){var c=(0,A.default)(this,v)[l],f=(0,O.default)(this,he,Ae).call(this,c);return u&&(0,A.default)(this,Z).call(this,u,l),(0,A.default)(this,te).call(this,l)?(u&&(u.get="stale"),f?(u&&n&&void 0!==c.__staleWhileFetching&&(u.returnedStale=!0),n?c.__staleWhileFetching:void 0):(s||(0,O.default)(this,ye,Pe).call(this,e,"expire"),u&&n&&(u.returnedStale=!0),n?c:void 0)):(u&&(u.get="hit"),f?c.__staleWhileFetching:((0,O.default)(this,ve,Ie).call(this,l),o&&(0,A.default)(this,X).call(this,l),c))}u&&(u.get="miss")}},{key:"delete",value:function(e){return(0,O.default)(this,ye,Pe).call(this,e,"delete")}},{key:"clear",value:function(){return(0,O.default)(this,ge,Oe).call(this,"delete")}}],[{key:"unsafeExposeInternals",value:function(e){return{starts:(0,A.default)(e,B),ttls:(0,A.default)(e,N),sizes:(0,A.default)(e,k),keyMap:(0,A.default)(e,h),keyList:(0,A.default)(e,p),valList:(0,A.default)(e,v),next:(0,A.default)(e,y),prev:(0,A.default)(e,g),get head(){return(0,A.default)(e,b)},get tail(){return(0,A.default)(e,m)},free:(0,A.default)(e,w),isBackgroundFetch:function(t){return(0,O.default)(e,he,Ae).call(e,t)},backgroundFetch:function(t,r,n,i){return(0,O.default)(e,de,Ee).call(e,t,r,n,i)},moveToTail:function(t){return(0,O.default)(e,ve,Ie).call(e,t)},indexes:function(t){return(0,O.default)(e,ue,we).call(e,t)},rindexes:function(t){return(0,O.default)(e,le,_e).call(e,t)},isStale:function(t){return(0,A.default)(e,te).call(e,t)}}}}]),e}(),Te);e.LRUCache=Ve})),fn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.ContainerIterator=e.Container=e.Base=void 0,e.ContainerIterator=function(){"use strict";function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(0,E.default)(this,e),this.iteratorType=t}return(0,C.default)(e,[{key:"equals",value:function(e){return this.o===e.o}}]),e}();var t=function(){"use strict";function e(){(0,E.default)(this,e),this.i=0}return(0,C.default)(e,[{key:"length",get:function(){return this.i}},{key:"size",value:function(){return this.i}},{key:"empty",value:function(){return 0===this.i}}]),e}();e.Base=t,e.Container=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){return(0,E.default)(this,r),t.apply(this,arguments)}return r}(t)})),dn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,E.default)(this,r),(e=t.call(this)).S=[];var i=(0,m.default)(e);return n.forEach((function(e){i.push(e)})),(0,W.default)(e)}return(0,C.default)(r,[{key:"clear",value:function(){this.i=0,this.S=[]}},{key:"push",value:function(e){return this.S.push(e),this.i+=1,this.i}},{key:"pop",value:function(){if(0!==this.i)return this.i-=1,this.S.pop()}},{key:"top",value:function(){return this.S[this.i-1]}}]),r}(fn().Base);e.default=t})),hn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,E.default)(this,r),(e=t.call(this)).j=0,e.q=[];var i=(0,m.default)(e);return n.forEach((function(e){i.push(e)})),(0,W.default)(e)}return(0,C.default)(r,[{key:"clear",value:function(){this.q=[],this.i=this.j=0}},{key:"push",value:function(e){var t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){for(var r=this.i,n=0;n<r;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=e}else this.q[this.j+this.i]=e;return++this.i}},{key:"pop",value:function(){if(0!==this.i){var e=this.q[this.j++];return this.i-=1,e}}},{key:"front",value:function(){if(0!==this.i)return this.q[this.j]}}]),r}(fn().Base);e.default=t})),pn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(e,t){return e>t?-1:e<t?1:0},o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if((0,E.default)(this,r),(e=t.call(this)).v=i,Array.isArray(n))e.C=o?(0,H.default)(n):n;else{e.C=[];var a=(0,m.default)(e);n.forEach((function(e){a.C.push(e)}))}e.i=e.C.length;for(var s=e.i>>1,u=e.i-1>>1;u>=0;--u)e.k(u,s);return(0,W.default)(e)}return(0,C.default)(r,[{key:"m",value:function(e){for(var t=this.C[e];e>0;){var 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}},{key:"k",value:function(e,t){for(var r=this.C[e];e<t;){var n=e<<1|1,i=n+1,o=this.C[n];if(i<this.i&&this.v(o,this.C[i])>0&&(n=i,o=this.C[i]),this.v(o,r)>=0)break;this.C[e]=o,e=n}this.C[e]=r}},{key:"clear",value:function(){this.i=0,this.C.length=0}},{key:"push",value:function(e){this.C.push(e),this.m(this.i),this.i+=1}},{key:"pop",value:function(){if(0!==this.i){var 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}}},{key:"top",value:function(){return this.C[0]}},{key:"find",value:function(e){return this.C.indexOf(e)>=0}},{key:"remove",value:function(e){var 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))}},{key:"updateItem",value:function(e){var t=this.C.indexOf(e);return!(t<0||(this.m(t),this.k(t,this.i>>1),0))}},{key:"toArray",value:function(){return(0,H.default)(this.C)}}]),r}(fn().Base);e.default=t})),vn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){return(0,E.default)(this,r),t.apply(this,arguments)}return r}(fn().Container);e.default=t})),yn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.throwIteratorAccessError=function(){throw new RangeError("Iterator access denied!")}})),gn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.RandomIterator=void 0;var t=fn(),r=yn(),n=function(e){"use strict";(0,U.default)(n,e);var t=(0,K.default)(n);function n(e,i){var o;return(0,E.default)(this,n),(o=t.call(this,i)).o=e,0===o.iteratorType?(o.pre=function(){return 0===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this},o.next=function(){return this.o===this.container.size()&&(0,r.throwIteratorAccessError)(),this.o+=1,this}):(o.pre=function(){return this.o===this.container.size()-1&&(0,r.throwIteratorAccessError)(),this.o+=1,this},o.next=function(){return-1===this.o&&(0,r.throwIteratorAccessError)(),this.o-=1,this}),(0,W.default)(o)}return(0,C.default)(n,[{key:"pointer",get:function(){return this.container.getElementByPos(this.o)},set:function(e){this.container.setElementByPos(this.o,e)}}]),n}(t.ContainerIterator);e.RandomIterator=n})),bn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=vn())&&t.t?t:{default:t},n=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n,i){var o;return(0,E.default)(this,r),(o=t.call(this,e,i)).container=n,(0,W.default)(o)}return(0,C.default)(r,[{key:"copy",value:function(){return new r(this.o,this.container,this.iteratorType)}}]),r}(gn().RandomIterator),i=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if((0,E.default)(this,r),e=t.call(this),Array.isArray(n))e.J=i?(0,H.default)(n):n,e.i=n.length;else{e.J=[];var o=(0,m.default)(e);n.forEach((function(e){o.pushBack(e)}))}return(0,W.default)(e)}return(0,C.default)(r,[{key:"clear",value:function(){this.i=0,this.J.length=0}},{key:"begin",value:function(){return new n(0,this)}},{key:"end",value:function(){return new n(this.i,this)}},{key:"rBegin",value:function(){return new n(this.i-1,this,1)}},{key:"rEnd",value:function(){return new n(-1,this,1)}},{key:"front",value:function(){return this.J[0]}},{key:"back",value:function(){return this.J[this.i-1]}},{key:"getElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;return this.J[e]}},{key:"eraseElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}},{key:"eraseElementByValue",value:function(e){for(var t=0,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}},{key:"eraseElementByIterator",value:function(e){var t=e.o;return e=e.next(),this.eraseElementByPos(t),e}},{key:"pushBack",value:function(e){return this.J.push(e),this.i+=1,this.i}},{key:"popBack",value:function(){if(0!==this.i)return this.i-=1,this.J.pop()}},{key:"setElementByPos",value:function(e,t){if(e<0||e>this.i-1)throw new RangeError;this.J[e]=t}},{key:"insert",value:function(e,t){var r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(e<0||e>this.i)throw new RangeError;return(r=this.J).splice.apply(r,[e,0].concat((0,H.default)(Array(n).fill(t)))),this.i+=n,this.i}},{key:"find",value:function(e){for(var t=0;t<this.i;++t)if(this.J[t]===e)return new n(t,this);return this.end()}},{key:"reverse",value:function(){this.J.reverse()}},{key:"unique",value:function(){for(var e=1,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}},{key:"sort",value:function(e){this.J.sort(e)}},{key:"forEach",value:function(e){for(var t=0;t<this.i;++t)e(this.J[t],t,this)}},{key:Symbol.iterator,value:function(){return function(){return(0,Q.__generator)(this,(function(e){switch(e.label){case 0:return[5,(0,Q.__values)(this.J)];case 1:return e.sent(),[2]}}))}.bind(this)()}}]),r}(r.default);e.default=i})),mn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=vn())&&t.t?t:{default:t},n=fn(),i=yn(),o=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n,o,a){var s;return(0,E.default)(this,r),(s=t.call(this,a)).o=e,s.h=n,s.container=o,0===s.iteratorType?(s.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},s.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(s.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},s.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this}),(0,W.default)(s)}return(0,C.default)(r,[{key:"pointer",get:function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l},set:function(e){this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.l=e}},{key:"copy",value:function(){return new r(this.o,this.h,this.container,this.iteratorType)}}]),r}(n.ContainerIterator),a=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,E.default)(this,r),(e=t.call(this)).h={},e.p=e._=e.h.L=e.h.B=e.h;var i=(0,m.default)(e);return n.forEach((function(e){i.pushBack(e)})),(0,W.default)(e)}return(0,C.default)(r,[{key:"V",value:function(e){var t=e.L,r=e.B;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}},{key:"G",value:function(e,t){var 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}},{key:"clear",value:function(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}},{key:"begin",value:function(){return new o(this.p,this.h,this)}},{key:"end",value:function(){return new o(this.h,this.h,this)}},{key:"rBegin",value:function(){return new o(this._,this.h,this,1)}},{key:"rEnd",value:function(){return new o(this.h,this.h,this,1)}},{key:"front",value:function(){return this.p.l}},{key:"back",value:function(){return this._.l}},{key:"getElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;for(var t=this.p;e--;)t=t.B;return t.l}},{key:"eraseElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;for(var t=this.p;e--;)t=t.B;return this.V(t),this.i}},{key:"eraseElementByValue",value:function(e){for(var t=this.p;t!==this.h;)t.l===e&&this.V(t),t=t.B;return this.i}},{key:"eraseElementByIterator",value:function(e){var t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),e=e.next(),this.V(t),e}},{key:"pushBack",value:function(e){return this.G(e,this._),this.i}},{key:"popBack",value:function(){if(0!==this.i){var e=this._.l;return this.V(this._),e}}},{key:"pushFront",value:function(e){return this.G(e,this.h),this.i}},{key:"popFront",value:function(){if(0!==this.i){var e=this.p.l;return this.V(this.p),e}}},{key:"setElementByPos",value:function(e,t){if(e<0||e>this.i-1)throw new RangeError;for(var r=this.p;e--;)r=r.B;r.l=t}},{key:"insert",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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{for(var n=this.p,i=1;i<e;++i)n=n.B;var o=n.B;for(this.i+=r;r--;)n.B={l:t,L:n},n.B.L=n,n=n.B;n.B=o,o.L=n}return this.i}},{key:"find",value:function(e){for(var t=this.p;t!==this.h;){if(t.l===e)return new o(t,this.h,this);t=t.B}return this.end()}},{key:"reverse",value:function(){if(!(this.i<=1))for(var e=this.p,t=this._,r=0;r<<1<this.i;){var n=e.l;e.l=t.l,t.l=n,e=e.B,t=t.L,r+=1}}},{key:"unique",value:function(){if(this.i<=1)return this.i;for(var e=this.p;e!==this.h;){for(var t=e;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}},{key:"sort",value:function(e){if(!(this.i<=1)){var t=[];this.forEach((function(e){t.push(e)})),t.sort(e);var r=this.p;t.forEach((function(e){r.l=e,r=r.B}))}}},{key:"merge",value:function(e){var t=this;if(0===this.i)e.forEach((function(e){t.pushBack(e)}));else{var 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}},{key:"forEach",value:function(e){for(var t=this.p,r=0;t!==this.h;)e(t.l,r++,this),t=t.B}},{key:Symbol.iterator,value:function(){return function(){var e;return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:if(0===this.i)return[2];e=this.p,t.label=1;case 1:return e===this.h?[3,4]:[4,e.l];case 2:t.sent(),e=e.B,t.label=3;case 3:return[3,1];case 4:return[2]}}))}.bind(this)()}}]),r}(r.default);e.default=a})),wn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=(t=vn())&&t.t?t:{default:t},n=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n,i){var o;return(0,E.default)(this,r),(o=t.call(this,e,i)).container=n,(0,W.default)(o)}return(0,C.default)(r,[{key:"copy",value:function(){return new r(this.o,this.container,this.iteratorType)}}]),r}(gn().RandomIterator),i=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:4096;(0,E.default)(this,r),(e=t.call(this)).j=0,e.D=0,e.R=0,e.N=0,e.P=0,e.A=[];var o=function(){if("number"==typeof n.length)return n.length;if("number"==typeof n.size)return n.size;if("function"==typeof n.size)return n.size();throw new TypeError("Cannot get the length or size of the container")}();e.F=i,e.P=Math.max(Math.ceil(o/e.F),1);for(var a=0;a<e.P;++a)e.A.push(Array(e.F));var s=Math.ceil(o/e.F);e.j=e.R=(e.P>>1)-(s>>1),e.D=e.N=e.F-o%e.F>>1;var u=(0,m.default)(e);return n.forEach((function(e){u.pushBack(e)})),(0,W.default)(e)}return(0,C.default)(r,[{key:"T",value:function(){for(var e=[],t=Math.max(this.P>>1,1),r=0;r<t;++r)e[r]=Array(this.F);for(var n=this.j;n<this.P;++n)e[e.length]=this.A[n];for(var i=0;i<this.R;++i)e[e.length]=this.A[i];e[e.length]=(0,H.default)(this.A[this.R]),this.j=t,this.R=e.length-1;for(var o=0;o<t;++o)e[e.length]=Array(this.F);this.A=e,this.P=e.length}},{key:"O",value:function(e){var 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}}},{key:"clear",value:function(){this.A=[Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}},{key:"begin",value:function(){return new n(0,this)}},{key:"end",value:function(){return new n(this.i,this)}},{key:"rBegin",value:function(){return new n(this.i-1,this,1)}},{key:"rEnd",value:function(){return new n(-1,this,1)}},{key:"front",value:function(){if(0!==this.i)return this.A[this.j][this.D]}},{key:"back",value:function(){if(0!==this.i)return this.A[this.R][this.N]}},{key:"pushBack",value:function(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}},{key:"popBack",value:function(){if(0!==this.i){var 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}}},{key:"pushFront",value:function(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}},{key:"popFront",value:function(){if(0!==this.i){var 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}}},{key:"getElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;var t=this.O(e),r=t.curNodeBucketIndex,n=t.curNodePointerIndex;return this.A[r][n]}},{key:"setElementByPos",value:function(e,t){if(e<0||e>this.i-1)throw new RangeError;var r=this.O(e),n=r.curNodeBucketIndex,i=r.curNodePointerIndex;this.A[n][i]=t}},{key:"insert",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]: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{for(var n=[],i=e;i<this.i;++i)n.push(this.getElementByPos(i));this.cut(e-1);for(var o=0;o<r;++o)this.pushBack(t);for(var a=0;a<n.length;++a)this.pushBack(n[a])}return this.i}},{key:"cut",value:function(e){if(e<0)return this.clear(),0;var t=this.O(e),r=t.curNodeBucketIndex,n=t.curNodePointerIndex;return this.R=r,this.N=n,this.i=e+1,this.i}},{key:"eraseElementByPos",value:function(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{for(var t=[],r=e+1;r<this.i;++r)t.push(this.getElementByPos(r));this.cut(e),this.popBack();var n=this;t.forEach((function(e){n.pushBack(e)}))}return this.i}},{key:"eraseElementByValue",value:function(e){if(0===this.i)return 0;for(var t=[],r=0;r<this.i;++r){var n=this.getElementByPos(r);n!==e&&t.push(n)}for(var i=t.length,o=0;o<i;++o)this.setElementByPos(o,t[o]);return this.cut(i-1)}},{key:"eraseElementByIterator",value:function(e){var t=e.o;return this.eraseElementByPos(t),e.next()}},{key:"find",value:function(e){for(var t=0;t<this.i;++t)if(this.getElementByPos(t)===e)return new n(t,this);return this.end()}},{key:"reverse",value:function(){for(var e=0,t=this.i-1;e<t;){var r=this.getElementByPos(e);this.setElementByPos(e,this.getElementByPos(t)),this.setElementByPos(t,r),e+=1,t-=1}}},{key:"unique",value:function(){if(this.i<=1)return this.i;for(var e=1,t=this.getElementByPos(0),r=1;r<this.i;++r){var n=this.getElementByPos(r);n!==t&&(t=n,this.setElementByPos(e++,n))}for(;this.i>e;)this.popBack();return this.i}},{key:"sort",value:function(e){for(var t=[],r=0;r<this.i;++r)t.push(this.getElementByPos(r));t.sort(e);for(var n=0;n<this.i;++n)this.setElementByPos(n,t[n])}},{key:"shrinkToFit",value:function(){if(0!==this.i){var 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(var t=0;t<this.P;++t)this.A.push(Array(this.F));for(var r=0;r<e.length;++r)this.pushBack(e[r])}}},{key:"forEach",value:function(e){for(var t=0;t<this.i;++t)e(this.getElementByPos(t),t,this)}},{key:Symbol.iterator,value:function(){return function(){var e;return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:e=0,t.label=1;case 1:return e<this.i?[4,this.getElementByPos(e)]:[3,4];case 2:t.sent(),t.label=3;case 3:return++e,[3,1];case 4:return[2]}}))}.bind(this)()}}]),r}(r.default);e.default=i})),_n=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.TreeNodeEnableIndex=e.TreeNode=void 0;var t=function(){"use strict";function e(t,r){(0,E.default)(this,e),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=t,this.l=r}return(0,C.default)(e,[{key:"L",value:function(){var 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{for(var t=e.tt;t.U===e;)t=(e=t).tt;e=t}return e}},{key:"B",value:function(){var e=this;if(e.W){for(e=e.W;e.U;)e=e.U;return e}for(var t=e.tt;t.W===e;)t=(e=t).tt;return e.W!==t?t:e}},{key:"te",value:function(){var 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}},{key:"se",value:function(){var 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}();e.TreeNode=t,e.TreeNodeEnableIndex=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e;return(0,E.default)(this,r),(e=t.call.apply(t,[this].concat(Array.prototype.slice.call(arguments)))).rt=1,(0,W.default)(e)}return(0,C.default)(r,[{key:"te",value:function(){var e=(0,B.default)((0,N.default)(r.prototype),"te",this).call(this);return this.ie(),e.ie(),e}},{key:"se",value:function(){var e=(0,B.default)((0,N.default)(r.prototype),"se",this).call(this);return this.ie(),e.ie(),e}},{key:"ie",value:function(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}}]),r}(t)})),Sn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=_n(),r=fn(),n=yn(),i=function(e){"use strict";(0,U.default)(i,e);var r=(0,K.default)(i);function i(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e,t){return e<t?-1:e>t?1:0},o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return(0,E.default)(this,i),(e=r.call(this)).Y=void 0,e.v=n,o?(e.re=t.TreeNodeEnableIndex,e.M=function(e,t,r){var n=this.ne(e,t,r);if(n){for(var i=n.tt;i!==this.h;)i.rt+=1,i=i.tt;var o=this.he(n);if(o){var a=o.parentNode,s=o.grandParent,u=o.curNode;a.ie(),s.ie(),u.ie()}}return this.i},e.V=function(e){for(var t=this.fe(e);t!==this.h;)t.rt-=1,t=t.tt}):(e.re=t.TreeNode,e.M=function(e,t,r){var n=this.ne(e,t,r);return n&&this.he(n),this.i},e.V=e.fe),e.h=new e.re,(0,W.default)(e)}return(0,C.default)(i,[{key:"X",value:function(e,t){for(var r=this.h;e;){var 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}},{key:"Z",value:function(e,t){for(var r=this.h;e;)this.v(e.u,t)<=0?e=e.W:(r=e,e=e.U);return r}},{key:"$",value:function(e,t){for(var r=this.h;e;){var 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}},{key:"rr",value:function(e,t){for(var r=this.h;e;)this.v(e.u,t)<0?(r=e,e=e.W):e=e.U;return r}},{key:"ue",value:function(e){for(;;){var t=e.tt;if(t===this.h)return;if(1===e.ee)return void(e.ee=0);if(e===t.U){var 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{var n=t.U;if(1===n.ee)n.ee=0,t.ee=1,t===this.Y?this.Y=t.se():t.se();else{if(n.U&&1===n.U.ee)return n.ee=t.ee,t.ee=0,n.U.ee=0,void(t===this.Y?this.Y=t.se():t.se());n.W&&1===n.W.ee?(n.ee=1,n.W.ee=0,n.te()):(n.ee=1,e=t)}}}}},{key:"fe",value:function(e){if(1===this.i)return this.clear(),this.h;for(var t=e;t.U||t.W;){if(t.W)for(t=t.W;t.U;)t=t.U;else t=t.U;var r,n;r=[t.u,e.u],e.u=r[0],t.u=r[1],n=[t.l,e.l],e.l=n[0],t.l=n[1],e=t}this.h.U===t?this.h.U=t.tt:this.h.W===t&&(this.h.W=t.tt),this.ue(t);var i=t.tt;return t===i.U?i.U=void 0:i.W=void 0,this.i-=1,this.Y.ee=0,i}},{key:"oe",value:function(e,t){return void 0!==e&&(!(!this.oe(e.U,t)&&!t(e))||this.oe(e.W,t))}},{key:"he",value:function(e){for(;;){var t=e.tt;if(0===t.ee)return;var r=t.tt;if(t===r.U){var 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{var i=r.tt;i.U===r?i.U=e:i.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{var o=r.U;if(o&&1===o.ee){if(o.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{var a=r.tt;a.U===r?a.U=e:a.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}}},{key:"ne",value:function(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);var 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{var a=this.h.W,s=this.v(a.u,e);if(0===s)return void(a.l=t);if(s<0)a.W=new this.re(e,t),a.W.tt=a,n=a.W,this.h.W=n;else{if(void 0!==r){var u=r.o;if(u!==this.h){var l=this.v(u.u,e);if(0===l)return void(u.l=t);if(l>0){var c=u.L(),f=this.v(c.u,e);if(0===f)return void(c.l=t);f<0&&(n=new this.re(e,t),void 0===c.W?(c.W=n,n.tt=c):(u.U=n,n.tt=u))}}}if(void 0===n)for(n=this.Y;;){var d=this.v(n.u,e);if(d>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(!(d<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}},{key:"I",value:function(e,t){for(;e;){var 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}},{key:"clear",value:function(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}},{key:"updateKeyByIterator",value:function(e,t){var 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);var i=r.L().u;if(this.v(i,t)>=0)return!1;var o=r.B().u;return!(this.v(o,t)<=0||(r.u=t,0))}},{key:"eraseElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;var t=0,r=this;return this.oe(this.Y,(function(n){return e===t?(r.V(n),!0):(t+=1,!1)})),this.i}},{key:"eraseElementByKey",value:function(e){if(0===this.i)return!1;var t=this.I(this.Y,e);return t!==this.h&&(this.V(t),!0)}},{key:"eraseElementByIterator",value:function(e){var t=e.o;t===this.h&&(0,n.throwIteratorAccessError)();var r=void 0===t.W;return 0===e.iteratorType?r&&e.next():(!r||void 0===t.U)&&e.next(),this.V(t),e}},{key:"forEach",value:function(e){var t=0,r=!0,n=!1,i=void 0;try{for(var o,a=this[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){e(o.value,t++,this)}}catch(e){n=!0,i=e}finally{try{r||null==a.return||a.return()}finally{if(n)throw i}}}},{key:"getElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;var t,r=0,n=!0,i=!1,o=void 0;try{for(var a,s=this[Symbol.iterator]();!(n=(a=s.next()).done);n=!0){var u=a.value;if(r===e){t=u;break}r+=1}}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return t}},{key:"getHeight",value:function(){if(0===this.i)return 0;var e=function(t){return t?Math.max(e(t.U),e(t.W))+1:0};return e(this.Y)}}]),i}(r.Container);e.default=i})),kn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=fn(),r=yn(),n=function(e){"use strict";(0,U.default)(n,e);var t=(0,K.default)(n);function n(e,i,o){var a;return(0,E.default)(this,n),(a=t.call(this,o)).o=e,a.h=i,0===a.iteratorType?(a.pre=function(){return this.o===this.h.U&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this},a.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this}):(a.pre=function(){return this.o===this.h.W&&(0,r.throwIteratorAccessError)(),this.o=this.o.B(),this},a.next=function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o=this.o.L(),this}),(0,W.default)(a)}return(0,C.default)(n,[{key:"index",get:function(){var e=this.o,t=this.h.tt;if(e===this.h)return t?t.rt-1:0;var r=0;for(e.U&&(r+=e.U.rt);e!==t;){var n=e.tt;e===n.W&&(r+=1,n.U&&(r+=n.U.rt)),e=n}return r}}]),n}(t.ContainerIterator);e.default=n})),En=ee((function(e){var t=function(e){return e&&e.t?e:{default:e}};ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var r=t(Sn()),n=t(kn()),i=yn(),o=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n,i,o){var a;return(0,E.default)(this,r),(a=t.call(this,e,n,o)).container=i,(0,W.default)(a)}return(0,C.default)(r,[{key:"pointer",get:function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o.u}},{key:"copy",value:function(){return new r(this.o,this.h,this.container,this.iteratorType)}}]),r}(n.default),a=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;(0,E.default)(this,r),e=t.call(this,i,o);var a=(0,m.default)(e);return n.forEach((function(e){a.insert(e)})),e}return(0,C.default)(r,[{key:"K",value:function(e){return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:return void 0!==e?[5,(0,Q.__values)(this.K(e.U))]:[3,4];case 1:return t.sent(),[4,e.u];case 2:return t.sent(),[5,(0,Q.__values)(this.K(e.W))];case 3:t.sent(),t.label=4;case 4:return[2]}}))}},{key:"begin",value:function(){return new o(this.h.U||this.h,this.h,this)}},{key:"end",value:function(){return new o(this.h,this.h,this)}},{key:"rBegin",value:function(){return new o(this.h.W||this.h,this.h,this,1)}},{key:"rEnd",value:function(){return new o(this.h,this.h,this,1)}},{key:"front",value:function(){return this.h.U?this.h.U.u:void 0}},{key:"back",value:function(){return this.h.W?this.h.W.u:void 0}},{key:"insert",value:function(e,t){return this.M(e,void 0,t)}},{key:"find",value:function(e){var t=this.I(this.Y,e);return new o(t,this.h,this)}},{key:"lowerBound",value:function(e){var t=this.X(this.Y,e);return new o(t,this.h,this)}},{key:"upperBound",value:function(e){var t=this.Z(this.Y,e);return new o(t,this.h,this)}},{key:"reverseLowerBound",value:function(e){var t=this.$(this.Y,e);return new o(t,this.h,this)}},{key:"reverseUpperBound",value:function(e){var t=this.rr(this.Y,e);return new o(t,this.h,this)}},{key:"union",value:function(e){var t=this;return e.forEach((function(e){t.insert(e)})),this.i}},{key:Symbol.iterator,value:function(){return this.K(this.Y)}}]),r}(r.default);e.default=a})),An=ee((function(e){var t=function(e){return e&&e.t?e:{default:e}};ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var r=t(Sn()),n=t(kn()),i=yn(),o=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n,i,o){var a;return(0,E.default)(this,r),(a=t.call(this,e,n,o)).container=i,(0,W.default)(a)}return(0,C.default)(r,[{key:"pointer",get:function(){this.o===this.h&&(0,i.throwIteratorAccessError)();var e=this;return new Proxy([],{get:function(t,r){return"0"===r?e.o.u:"1"===r?e.o.l:void 0},set:function(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}},{key:"copy",value:function(){return new r(this.o,this.h,this.container,this.iteratorType)}}]),r}(n.default),a=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1?arguments[1]:void 0,o=arguments.length>2?arguments[2]:void 0;(0,E.default)(this,r),e=t.call(this,i,o);var a=(0,m.default)(e);return n.forEach((function(e){a.setElement(e[0],e[1])})),e}return(0,C.default)(r,[{key:"K",value:function(e){return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:return void 0!==e?[5,(0,Q.__values)(this.K(e.U))]:[3,4];case 1:return t.sent(),[4,[e.u,e.l]];case 2:return t.sent(),[5,(0,Q.__values)(this.K(e.W))];case 3:t.sent(),t.label=4;case 4:return[2]}}))}},{key:"begin",value:function(){return new o(this.h.U||this.h,this.h,this)}},{key:"end",value:function(){return new o(this.h,this.h,this)}},{key:"rBegin",value:function(){return new o(this.h.W||this.h,this.h,this,1)}},{key:"rEnd",value:function(){return new o(this.h,this.h,this,1)}},{key:"front",value:function(){if(0!==this.i){var e=this.h.U;return[e.u,e.l]}}},{key:"back",value:function(){if(0!==this.i){var e=this.h.W;return[e.u,e.l]}}},{key:"lowerBound",value:function(e){var t=this.X(this.Y,e);return new o(t,this.h,this)}},{key:"upperBound",value:function(e){var t=this.Z(this.Y,e);return new o(t,this.h,this)}},{key:"reverseLowerBound",value:function(e){var t=this.$(this.Y,e);return new o(t,this.h,this)}},{key:"reverseUpperBound",value:function(e){var t=this.rr(this.Y,e);return new o(t,this.h,this)}},{key:"setElement",value:function(e,t,r){return this.M(e,t,r)}},{key:"find",value:function(e){var t=this.I(this.Y,e);return new o(t,this.h,this)}},{key:"getElementByKey",value:function(e){return this.I(this.Y,e).l}},{key:"union",value:function(e){var t=this;return e.forEach((function(e){t.setElement(e[0],e[1])})),this.i}},{key:Symbol.iterator,value:function(){return this.K(this.Y)}}]),r}(r.default);e.default=a})),xn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=function(e){var t=void 0===e?"undefined":(0,V.default)(e);return"object"===t&&null!==e||"function"===t}})),In=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.HashContainerIterator=e.HashContainer=void 0;var t,r=fn(),n=(t=xn())&&t.t?t:{default:t},i=yn(),o=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n,o){var a;return(0,E.default)(this,r),(a=t.call(this,o)).o=e,a.h=n,0===a.iteratorType?(a.pre=function(){return this.o.L===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this},a.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this}):(a.pre=function(){return this.o.B===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.B,this},a.next=function(){return this.o===this.h&&(0,i.throwIteratorAccessError)(),this.o=this.o.L,this}),(0,W.default)(a)}return r}(r.ContainerIterator);e.HashContainerIterator=o;var a=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e;return(0,E.default)(this,r),(e=t.call(this)).H=[],e.g={},e.HASH_TAG=Symbol(),Object.setPrototypeOf(e.g,null),e.h={},e.h.L=e.h.B=e.p=e._=e.h,(0,W.default)(e)}return(0,C.default)(r,[{key:"V",value:function(e){var t=e.L,r=e.B;t.B=r,r.L=t,e===this.p&&(this.p=r),e===this._&&(this._=t),this.i-=1}},{key:"M",value:function(e,t,r){var i;if(void 0===r&&(r=(0,n.default)(e)),r){var o=e[this.HASH_TAG];if(void 0!==o)return this.H[o].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{var a=this.g[e];if(a)return a.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}},{key:"I",value:function(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){var r=e[this.HASH_TAG];return void 0===r?this.h:this.H[r]}return this.g[e]||this.h}},{key:"clear",value:function(){var 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}},{key:"eraseElementByKey",value:function(e,t){var r;if(void 0===t&&(t=(0,n.default)(e)),t){var i=e[this.HASH_TAG];if(void 0===i)return!1;delete e[this.HASH_TAG],r=this.H[i],delete this.H[i]}else{if(void 0===(r=this.g[e]))return!1;delete this.g[e]}return this.V(r),!0}},{key:"eraseElementByIterator",value:function(e){var t=e.o;return t===this.h&&(0,i.throwIteratorAccessError)(),this.V(t),e.next()}},{key:"eraseElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;for(var t=this.p;e--;)t=t.B;return this.V(t),this.i}}]),r}(r.Container);e.HashContainer=a})),Pn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t=In(),r=yn(),n=function(e){"use strict";(0,U.default)(n,e);var t=(0,K.default)(n);function n(e,r,i,o){var a;return(0,E.default)(this,n),(a=t.call(this,e,r,o)).container=i,(0,W.default)(a)}return(0,C.default)(n,[{key:"pointer",get:function(){return this.o===this.h&&(0,r.throwIteratorAccessError)(),this.o.u}},{key:"copy",value:function(){return new n(this.o,this.h,this.container,this.iteratorType)}}]),n}(t.HashContainerIterator),i=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,E.default)(this,r),e=t.call(this);var i=(0,m.default)(e);return n.forEach((function(e){i.insert(e)})),e}return(0,C.default)(r,[{key:"begin",value:function(){return new n(this.p,this.h,this)}},{key:"end",value:function(){return new n(this.h,this.h,this)}},{key:"rBegin",value:function(){return new n(this._,this.h,this,1)}},{key:"rEnd",value:function(){return new n(this.h,this.h,this,1)}},{key:"front",value:function(){return this.p.u}},{key:"back",value:function(){return this._.u}},{key:"insert",value:function(e,t){return this.M(e,void 0,t)}},{key:"getElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;for(var t=this.p;e--;)t=t.B;return t.u}},{key:"find",value:function(e,t){var r=this.I(e,t);return new n(r,this.h,this)}},{key:"forEach",value:function(e){for(var t=0,r=this.p;r!==this.h;)e(r.u,t++,this),r=r.B}},{key:Symbol.iterator,value:function(){return function(){var e;return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:e=this.p,t.label=1;case 1:return e===this.h?[3,4]:[4,e.u];case 2:t.sent(),e=e.B,t.label=3;case 3:return[3,1];case 4:return[2]}}))}.bind(this)()}}]),r}(t.HashContainer);e.default=i})),On=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"t",{value:!0}),e.default=void 0;var t,r=In(),n=(t=xn())&&t.t?t:{default:t},i=yn(),o=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n,i,o){var a;return(0,E.default)(this,r),(a=t.call(this,e,n,o)).container=i,(0,W.default)(a)}return(0,C.default)(r,[{key:"pointer",get:function(){this.o===this.h&&(0,i.throwIteratorAccessError)();var e=this;return new Proxy([],{get:function(t,r){return"0"===r?e.o.u:"1"===r?e.o.l:void 0},set:function(t,r,n){if("1"!==r)throw new TypeError("props must be 1");return e.o.l=n,!0}})}},{key:"copy",value:function(){return new r(this.o,this.h,this.container,this.iteratorType)}}]),r}(r.HashContainerIterator),a=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,E.default)(this,r),e=t.call(this);var i=(0,m.default)(e);return n.forEach((function(e){i.setElement(e[0],e[1])})),e}return(0,C.default)(r,[{key:"begin",value:function(){return new o(this.p,this.h,this)}},{key:"end",value:function(){return new o(this.h,this.h,this)}},{key:"rBegin",value:function(){return new o(this._,this.h,this,1)}},{key:"rEnd",value:function(){return new o(this.h,this.h,this,1)}},{key:"front",value:function(){if(0!==this.i)return[this.p.u,this.p.l]}},{key:"back",value:function(){if(0!==this.i)return[this._.u,this._.l]}},{key:"setElement",value:function(e,t,r){return this.M(e,t,r)}},{key:"getElementByKey",value:function(e,t){if(void 0===t&&(t=(0,n.default)(e)),t){var r=e[this.HASH_TAG];return void 0!==r?this.H[r].l:void 0}var i=this.g[e];return i?i.l:void 0}},{key:"getElementByPos",value:function(e){if(e<0||e>this.i-1)throw new RangeError;for(var t=this.p;e--;)t=t.B;return[t.u,t.l]}},{key:"find",value:function(e,t){var r=this.I(e,t);return new o(r,this.h,this)}},{key:"forEach",value:function(e){for(var t=0,r=this.p;r!==this.h;)e([r.u,r.l],t++,this),r=r.B}},{key:Symbol.iterator,value:function(){return function(){var e;return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:e=this.p,t.label=1;case 1:return e===this.h?[3,4]:[4,[e.u,e.l]];case 2:t.sent(),e=e.B,t.label=3;case 3:return[3,1];case 4:return[2]}}))}.bind(this)()}}]),r}(r.HashContainer);e.default=a})),Tn=ee((function(e){var t=function(e){return e&&e.t?e:{default:e}};ne(),Jt(),Bt(),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 f.default}}),Object.defineProperty(e,"HashSet",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(e,"LinkList",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(e,"OrderedMap",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(e,"OrderedSet",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(e,"PriorityQueue",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(e,"Queue",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(e,"Stack",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(e,"Vector",{enumerable:!0,get:function(){return o.default}});var r=t(dn()),n=t(hn()),i=t(pn()),o=t(bn()),a=t(mn()),s=t(wn()),u=t(En()),l=t(An()),c=t(Pn()),f=t(On())})),Rn=ee((function(e,t){var r=function(e,t){this.low=e,this.high=t};ne(),Jt(),Bt();var n=Tn().OrderedSet,i=Kr()("number-allocator:trace"),o=Kr()("number-allocator:error");function a(e,t){if(!(this instanceof a))return new a(e,t);this.min=e,this.max=t,this.ss=new n([],(function(e,t){return e.compare(t)})),i("Create"),this.clear()}r.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},r.prototype.compare=function(e){return this.low<e.low&&this.high<e.low?-1:e.low<this.low&&e.high<this.low?1:0},a.prototype.firstVacant=function(){return 0===this.ss.size()?null:this.ss.front().low},a.prototype.alloc=function(){if(0===this.ss.size())return i("alloc():empty"),null;var e=this.ss.begin(),t=e.pointer.low,n=e.pointer.high,o=t;return o+1<=n?this.ss.updateKeyByIterator(e,new r(t+1,n)):this.ss.eraseElementByPos(0),i("alloc():"+o),o},a.prototype.use=function(e){var t=new r(e,e),n=this.ss.lowerBound(t);if(!n.equals(this.ss.end())){var o=n.pointer.low,a=n.pointer.high;return n.pointer.equals(t)?(this.ss.eraseElementByIterator(n),i("use():"+e),!0):!(o>e||(o===e?(this.ss.updateKeyByIterator(n,new r(o+1,a)),i("use():"+e),0):a===e?(this.ss.updateKeyByIterator(n,new r(o,a-1)),i("use():"+e),0):(this.ss.updateKeyByIterator(n,new r(e+1,a)),this.ss.insert(new r(o,e-1)),i("use():"+e),0)))}return i("use():failed"),!1},a.prototype.free=function(e){if(e<this.min||e>this.max)o("free():"+e+" is out of range");else{var t=new r(e,e),n=this.ss.upperBound(t);if(n.equals(this.ss.end())){if(n.equals(this.ss.begin()))return void this.ss.insert(t);n.pre();var a=n.pointer.high;n.pointer.high+1===e?this.ss.updateKeyByIterator(n,new r(a,e)):this.ss.insert(t)}else if(n.equals(this.ss.begin()))if(e+1===n.pointer.low){var s=n.pointer.high;this.ss.updateKeyByIterator(n,new r(e,s))}else this.ss.insert(t);else{var u=n.pointer.low,l=n.pointer.high;n.pre();var c=n.pointer.low;n.pointer.high+1===e?e+1===u?(this.ss.eraseElementByIterator(n),this.ss.updateKeyByIterator(n,new r(c,l))):this.ss.updateKeyByIterator(n,new r(c,e)):e+1===u?(this.ss.eraseElementByIterator(n.next()),this.ss.insert(new r(e,l))):this.ss.insert(t)}i("free():"+e)}},a.prototype.clear=function(){i("clear()"),this.ss.clear(),this.ss.insert(new r(this.min,this.max))},a.prototype.intervalCount=function(){return this.ss.size()},a.prototype.dump=function(){var e=!0,t=!1,r=void 0;try{for(var n,i=this.ss[Symbol.iterator]();!(e=(n=i.next()).done);e=!0)n.value}catch(e){t=!0,r=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw r}}},t.exports=a})),Mn=ee((function(e,t){ne(),Jt(),Bt();var r=Rn();t.exports.NumberAllocator=r})),Cn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0});var t=cn(),r=Mn();e.default=function(){"use strict";function e(n){(0,E.default)(this,e),(0,j.default)(this,"aliasToTopic",void 0),(0,j.default)(this,"topicToAlias",void 0),(0,j.default)(this,"max",void 0),(0,j.default)(this,"numberAllocator",void 0),(0,j.default)(this,"length",void 0),n>0&&(this.aliasToTopic=new t.LRUCache({max:n}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,n),this.max=n,this.length=0)}return(0,C.default)(e,[{key:"put",value:function(e,t){if(0===t||t>this.max)return!1;var 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}},{key:"getTopicByAlias",value:function(e){return this.aliasToTopic.get(e)}},{key:"getAliasByTopic",value:function(e){var t=this.topicToAlias[e];return(void 0===t?"undefined":(0,V.default)(t))<"u"&&this.aliasToTopic.get(t),t}},{key:"clear",value:function(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}},{key:"getLruAlias",value:function(){return this.numberAllocator.firstVacant()||(0,H.default)(this.aliasToTopic.keys())[this.aliasToTopic.size-1]}}]),e}()})),jn=ee((function(e){ne(),Jt(),Bt();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=un(),n=t(Cn()),i=sn();e.default=function(e,t){e.log("_handleConnack");var o=e.options,a=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",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===a)e.reconnecting=!1,e._onConnect(t);else if(a>0){var s=new i.ErrorWithReasonCode("Connection refused: "+r.ReasonCodes[a],a);e.emit("error",s),e.options.reconnectOnConnackError&&e._cleanUp(!0)}}})),Bn=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(e,t,r){e.log("handling pubrel packet");var n=(void 0===r?"undefined":(0,V.default)(r))<"u"?r:e.noop,i={cmd:"pubcomp",messageId:t.messageId};e.incomingStore.get(t,(function(t,r){t?e._sendPacket(i,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,(function(t){if(t)return n(t);e.incomingStore.del(r,e.noop),e._sendPacket(i,n)})))}))}})),Nn=ee((function(e){ne(),Jt(),Bt();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(on()),n=t(ln()),i=t(jn()),o=t(un()),a=t(Bn());e.default=function(e,t,s){var u=e.options;if(5===u.protocolVersion&&u.properties&&u.properties.maximumPacketSize&&u.properties.maximumPacketSize<t.length)return e.emit("error",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,s);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,o.default)(e,t),s();break;case"pubrel":e.reschedulePing(),(0,a.default)(e,t,s);break;case"connack":(0,i.default)(e,t),s();break;case"auth":e.reschedulePing(),(0,n.default)(e,t),s();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),s();break;case"disconnect":e.emit("disconnect",t),s();break;default:e.log("_handlePacket :: unknown command"),s()}}})),Un=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){"use strict";function e(){(0,E.default)(this,e),(0,j.default)(this,"nextId",void 0),this.nextId=Math.max(1,Math.floor(65535*Math.random()))}return(0,C.default)(e,[{key:"allocate",value:function(){var e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}},{key:"getLastAllocated",value:function(){return 1===this.nextId?65535:this.nextId-1}},{key:"register",value:function(e){return!0}},{key:"deallocate",value:function(e){}},{key:"clear",value:function(){}}]),e}()})),Ln=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(){"use strict";function e(t){(0,E.default)(this,e),(0,j.default)(this,"aliasToTopic",void 0),(0,j.default)(this,"max",void 0),(0,j.default)(this,"length",void 0),this.aliasToTopic={},this.max=t}return(0,C.default)(e,[{key:"put",value:function(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))}},{key:"getTopicByAlias",value:function(e){return this.aliasToTopic[e]}},{key:"clear",value:function(){this.aliasToTopic={}}}]),e}()})),Dn=ee((function(e){ne(),Jt(),Bt();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((pr(),re(tr))),n=sn(),i=function e(){"use strict";(0,E.default)(this,e)};e.TypedEventEmitter=i,(0,n.applyMixin)(i,r.default)})),Fn=ee((function(e,t){function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==(0,V.default)(Symbol.iterator)?function(e){return void 0===e?"undefined":(0,V.default)(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":void 0===e?"undefined":(0,V.default)(e)},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}ne(),Jt(),Bt(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),Wn=ee((function(e,t){ne(),Jt(),Bt();var r=Fn().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})),qn=ee((function(e,t){ne(),Jt(),Bt();var r=Fn().default,n=Wn();t.exports=function(e){var t=n(e,"string");return"symbol"==r(t)?t:t+""},t.exports.__esModule=!0,t.exports.default=t.exports})),Hn=ee((function(e,t){ne(),Jt(),Bt();var r=qn();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})),Vn=ee((function(e,t){ne(),Jt(),Bt(),t.exports=function(e){if(Array.isArray(e))return e},t.exports.__esModule=!0,t.exports.default=t.exports})),zn=ee((function(e,t){ne(),Jt(),Bt(),t.exports=function(e,t){var r=null==e?null:("undefined"==typeof Symbol?"undefined":(0,V.default)(Symbol))<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,a,s=[],u=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=o.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,i=e}finally{try{if(!u&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(l)throw i}}return s}},t.exports.__esModule=!0,t.exports.default=t.exports})),Gn=ee((function(e,t){ne(),Jt(),Bt(),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})),Kn=ee((function(e,t){ne(),Jt(),Bt();var r=Gn();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})),Qn=ee((function(e,t){ne(),Jt(),Bt(),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})),Yn=ee((function(e,t){ne(),Jt(),Bt();var r=Vn(),n=zn(),i=Kn(),o=Qn();t.exports=function(e,t){return r(e)||n(e,t)||i(e,t)||o()},t.exports.__esModule=!0,t.exports.default=t.exports})),Jn=ee((function(e,t){var r,n;ne(),Jt(),Bt(),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,a=function(e,t){return function(o){var a=t.get(o),s=void 0===a?o.size:a<i?a+1:0;if(!o.has(s))return e(o,s);if(o.size<n){for(;o.has(s);)s=Math.floor(Math.random()*i);return e(o,s)}if(o.size>r)throw Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;o.has(s);)s=Math.floor(Math.random()*r);return e(o,s)}}((t=o,function(e,r){return t.set(e,r),r}),o),s=function(e){return function(t){var r=e(t);return t.add(r),r}}(a);e.addUniqueNumber=s,e.generateUniqueNumber=a},"object"==typeof e&&(void 0===t?"undefined":(0,V.default)(t))<"u"?n(e):"function"==typeof define&&define.amd?define(["exports"],n):n((r=("undefined"==typeof globalThis?"undefined":(0,V.default)(globalThis))<"u"?globalThis:r||self).fastUniqueNumbers={})})),$n=ee((function(e,t){var r=function(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void r(e)}s.done?t(u):Promise.resolve(u).then(n,i)};ne(),Jt(),Bt(),t.exports=function(e){return function(){var t=this,n=arguments;return new Promise((function(i,o){var a=e.apply(t,n);function s(e){r(a,i,o,s,u,"next",e)}function u(e){r(a,i,o,s,u,"throw",e)}s(void 0)}))}},t.exports.__esModule=!0,t.exports.default=t.exports})),Xn=ee((function(e,t){ne(),Jt(),Bt(),t.exports=function(e,t){this.v=e,this.k=t},t.exports.__esModule=!0,t.exports.default=t.exports})),Zn=ee((function(e,t){function r(e,n,i,o){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=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?a?a(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)}ne(),Jt(),Bt(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports})),ei=ee((function(e,t){ne(),Jt(),Bt();var r=Zn();function n(){var e,i,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.toStringTag||"@@toStringTag";function u(t,n,o,a){var s=n&&n.prototype instanceof c?n:c,u=Object.create(s.prototype);return r(u,"_invoke",function(t,r,n){var o,a,s,u=0,c=n||[],f=!1,d={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return o=t,a=0,s=e,d.n=r,l}};function h(t,r){for(a=t,s=r,i=0;!f&&u&&!n&&i<c.length;i++){var n,o=c[i],h=d.p,p=o[2];t>3?(n=p===r)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=e):o[0]<=h&&((n=t<2&&h<o[1])?(a=0,d.v=r,d.n=o[1]):h<p&&(n=t<3||o[0]>r||r>p)&&(o[4]=t,o[5]=r,d.n=p,a=0))}if(n||t>1)return l;throw f=!0,r}return function(n,c,p){if(u>1)throw TypeError("Generator is already running");for(f&&1===c&&h(c,p),a=c,s=p;(i=a<2?e:s)||!f;){o||(a?a<3?(a>1&&(d.n=-1),h(a,s)):d.n=s:d.v=s);try{if(u=2,o){if(a||(n="next"),i=o[n]){if(!(i=i.call(o,s)))throw TypeError("iterator result is not an object");if(!i.done)return i;s=i.value,a<2&&(a=0)}else 1===a&&(i=o.return)&&i.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+n+"' method"),a=1);o=e}else if((i=(f=d.n<0)?s:t.call(r,d))!==l)break}catch(t){o=e,a=1,s=t}finally{u=1}}return{value:i,done:f}}}(t,o,a),!0),u}var l={};function c(){}function f(){}function d(){}i=Object.getPrototypeOf;var h=[][a]?i(i([][a]())):(r(i={},a,(function(){return this})),i),p=d.prototype=c.prototype=Object.create(h);function v(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,d):(e.__proto__=d,r(e,s,"GeneratorFunction")),e.prototype=Object.create(p),e}return f.prototype=d,r(p,"constructor",d),r(d,"constructor",f),f.displayName="GeneratorFunction",r(d,s,"GeneratorFunction"),r(p),r(p,s,"Generator"),r(p,a,(function(){return this})),r(p,"toString",(function(){return"[object Generator]"})),(t.exports=n=function(){return{w:u,m:v}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports})),ti=ee((function(e,t){ne(),Jt(),Bt();var r=Xn(),n=Zn();t.exports=function e(t,i){function o(e,n,a,s){try{var u=t[e](n),l=u.value;return l instanceof r?i.resolve(l.v).then((function(e){o("next",e,a,s)}),(function(e){o("throw",e,a,s)})):i.resolve(l).then((function(e){u.value=e,a(u)}),(function(e){return o("throw",e,a,s)}))}catch(e){s(e)}}var a;this.next||(n(e.prototype),n(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),n(this,"_invoke",(function(e,t,r){var n=function(){return new i((function(t,n){o(e,r,t,n)}))};return a=a?a.then(n,n):n()}),!0)},t.exports.__esModule=!0,t.exports.default=t.exports})),ri=ee((function(e,t){ne(),Jt(),Bt();var r=ei(),n=ti();t.exports=function(e,t,i,o,a){return new n(r().w(e,t,i,o),a||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports})),ni=ee((function(e,t){ne(),Jt(),Bt();var r=ri();t.exports=function(e,t,n,i,o){var a=r(e,t,n,i,o);return a.next().then((function(e){return e.done?e.value:a.next()}))},t.exports.__esModule=!0,t.exports.default=t.exports})),ii=ee((function(e,t){ne(),Jt(),Bt(),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})),oi=ee((function(e,t){ne(),Jt(),Bt();var r=Fn().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})),ai=ee((function(e,t){ne(),Jt(),Bt();var r=Xn(),n=ei(),i=ni(),o=ri(),a=ti(),s=ii(),u=oi();function l(){var e=n(),c=e.m(l),f=(Object.getPrototypeOf?Object.getPrototypeOf(c):c.__proto__).constructor;function d(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))}var h={throw:1,return:2,break:3,continue:3};function p(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,h[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=l=function(){return{wrap:function(t,r,n,i){return e.w(p(t),r,n,i&&i.reverse())},isGeneratorFunction:d,mark:e.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:a,async:function(e,t,r,n,a){return(d(t)?o:i)(p(e),t,r,n,a)},keys:s,values:u}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=l,t.exports.__esModule=!0,t.exports.default=t.exports})),si=ee((function(e,t){ne(),Jt(),Bt();var r=ai()();t.exports=r;try{regeneratorRuntime=r}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}})),ui=ee((function(e,t){var r,n;ne(),Jt(),Bt(),r=e,n=function(e,t,r,n,i,o){var a=function(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},s=function(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},u=function(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},l=function(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},c=new WeakMap,f=new WeakMap;e.createBroker=function(e){var a=function(e){return s(s({},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,c.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=c.get(t))){e.next=1;break}throw 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(f.has(e))return f.get(e);var t=new Map;return f.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,a=n.resolve;i.delete(r),void 0===t.error?a(t.result):o(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(a,s){var u=n.generateUniqueNumber(i);i.set(u,{reject:s,resolve:a}),null===r?e.postMessage({id:u,method:t},o):e.postMessage({id:u,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)},u={},c=0,d=Object.entries(a);c<d.length;c++){var h=r(d[c],2),p=h[0],v=h[1];u=l(l({},u),{},t({},p,v({call:o,notify:s})))}return l({},u)}}},"object"==typeof e&&(void 0===t?"undefined":(0,V.default)(t))<"u"?n(e,Hn(),Yn(),Jn(),$n(),si()):"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=("undefined"==typeof globalThis?"undefined":(0,V.default)(globalThis))<"u"?globalThis:r||self).brokerFactory={},r._defineProperty,r._slicedToArray,r.fastUniqueNumbers,r._asyncToGenerator,r._regeneratorRuntime)})),li=ee((function(e,t){var r,n;ne(),Jt(),Bt(),r=e,n=function(e,t,r,n){var i=new Map([[0,null]]),o=new Map([[0,null]]),a=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,a=Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];var u=Symbol(),l=n.generateUniqueNumber(i);i.set(l,u);var c=function(){return t("set",{delay:r,now:performance.timeOrigin+performance.now(),timerId:l,timerType:"interval"}).then((function(){var t=i.get(l);if(void 0===t)throw Error("The timer is in an undefined state.");t===u&&(e.apply(void 0,a),i.get(l)===u&&c())}))};return c(),l}},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,a=Array(i>2?i-2:0),s=2;s<i;s++)a[s-2]=arguments[s];var u=Symbol(),l=n.generateUniqueNumber(o);return o.set(l,u),t("set",{delay:r,now:performance.timeOrigin+performance.now(),timerId:l,timerType:"timeout"}).then((function(){var t=o.get(l);if(void 0===t)throw Error("The timer is in an undefined state.");t===u&&(o.delete(l),e.apply(void 0,a))})),l}}});e.load=function(e){var t=new Worker(e);return a(t)},e.wrap=a},"object"==typeof e&&(void 0===t?"undefined":(0,V.default)(t))<"u"?n(e,Fn(),ui(),Jn()):"function"==typeof define&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],n):n((r=("undefined"==typeof globalThis?"undefined":(0,V.default)(globalThis))<"u"?globalThis:r||self).workerTimersBroker={},r._typeof,r.brokerFactory,r.fastUniqueNumbers)})),ci=ee((function(e,t){var r,n;ne(),Jt(),Bt(),r=e,n=function(e,t){var r,n,i=(r=t.load,'(()=>{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)})()})();',n=null,function(){if(null!==n)return n;var e=new Blob(['(()=>{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)})()})();'],{type:"application/javascript; charset=utf-8"}),t=URL.createObjectURL(e);return n=r(t),setTimeout((function(){return URL.revokeObjectURL(t)})),n});e.clearInterval=function(e){return i().clearInterval(e)},e.clearTimeout=function(e){return i().clearTimeout(e)},e.setInterval=function(){var e;return(e=i()).setInterval.apply(e,arguments)},e.setTimeout=function(){var e;return(e=i()).setTimeout.apply(e,arguments)}},"object"==typeof e&&(void 0===t?"undefined":(0,V.default)(t))<"u"?n(e,li()):"function"==typeof define&&define.amd?define(["exports","worker-timers-broker"],n):n((r=("undefined"==typeof globalThis?"undefined":(0,V.default)(globalThis))<"u"?globalThis:r||self).workerTimers={},r.workerTimersBroker)})),fi=ee((function(e){var t;ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var r=function(){var e,t;return!!("object"==typeof self&&(null===self||void 0===self||null===(e=self.constructor)||void 0===e||null===(t=e.name)||void 0===t?void 0:t.includes("WorkerGlobalScope"))&&("undefined"==typeof Deno?"undefined":(0,V.default)(Deno))>"u")},n=function(){return("undefined"==typeof navigator?"undefined":(0,V.default)(navigator))<"u"&&"ReactNative"===navigator.product},i=("undefined"==typeof window?"undefined":(0,V.default)(window))<"u"&&(("undefined"==typeof navigator?"undefined":(0,V.default)(navigator))<"u"&&(null===(t=navigator.userAgent)||void 0===t?void 0:t.toLowerCase().indexOf(" electron/"))>-1&&(null==ie?void 0:ie.versions)?!{}.hasOwnProperty.call(ie.versions,"electron"):(0,V.default)(window.document)<"u")||r()||n();e.isWebWorker=r(),e.isReactNativeBrowser=n(),e.default=i})),di=ee((function(e){ne(),Jt(),Bt();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)({}).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),a=0;a<o.length;a++)"default"!==o[a]&&r(i,e,o[a]);return n(i,e),i});Object.defineProperty(e,"__esModule",{value:!0});var o=ci(),a=i(fi()),s={set:o.setInterval,clear:o.clearInterval},u={set:function(e,t){return setInterval(e,t)},clear:function(e){return clearInterval(e)}};e.default=function(e){switch(e){case"native":return u;case"worker":return s;default:return!a.default||a.isWebWorker||a.isReactNativeBrowser?u:s}}})),hi=ee((function(e){ne(),Jt(),Bt();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(di());e.default=function(){"use strict";function e(t,n){(0,E.default)(this,e),(0,j.default)(this,"_keepalive",void 0),(0,j.default)(this,"timerId",void 0),(0,j.default)(this,"timer",void 0),(0,j.default)(this,"destroyed",!1),(0,j.default)(this,"counter",void 0),(0,j.default)(this,"client",void 0),(0,j.default)(this,"_keepaliveTimeoutTimestamp",void 0),(0,j.default)(this,"_intervalEvery",void 0),this.client=t,this.timer="object"==typeof n&&"set"in n&&"clear"in n?n:(0,r.default)(n),this.setKeepalive(t.options.keepalive)}return(0,C.default)(e,[{key:"keepaliveTimeoutTimestamp",get:function(){return this._keepaliveTimeoutTimestamp}},{key:"intervalEvery",get:function(){return this._intervalEvery}},{key:"keepalive",get:function(){return this._keepalive}},{key:"clear",value:function(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}},{key:"setKeepalive",value:function(e){if(isNaN(e*=1e3)||e<=0||e>2147483647)throw 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 ".concat(e,"ms"))}},{key:"destroy",value:function(){this.clear(),this.destroyed=!0}},{key:"reschedule",value:function(){var e=this;if(!this.destroyed){this.clear(),this.counter=0;var t=Math.ceil(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+t,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set((function(){e.destroyed||(e.counter+=1,2===e.counter?e.client.sendPing():e.counter>2&&e.client.onKeepaliveTimeout())}),this._intervalEvery)}}}]),e}()})),pi=ee((function(e){var t;ne(),Jt(),Bt();var r,n=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]}),i=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=e&&e.__importStar||(r=function(e){return(r=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)({}).hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var o=r(e),a=0;a<o.length;a++)"default"!==o[a]&&n(t,e,o[a]);return i(t,e),t}),a=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var s=a(Zr()),u=Dr(),l=a(tn()),c=a(Kr()),f=o(rn()),d=a(nn()),h=a(Nn()),p=a(Un()),v=a(Ln()),y=sn(),g=Dn(),b=a(hi()),w=o(fi()),_=globalThis.setImmediate||function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.shift();(0,y.nextTick)((function(){n.apply(void 0,(0,H.default)(t))}))},S={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},k=(t=function(e){"use strict";(0,U.default)(r,e);var t=(0,K.default)(r);function r(e,n){var i;for(var o in(0,E.default)(this,r),i=t.call(this),(0,j.default)((0,m.default)(i),"connected",void 0),(0,j.default)((0,m.default)(i),"disconnecting",void 0),(0,j.default)((0,m.default)(i),"disconnected",void 0),(0,j.default)((0,m.default)(i),"reconnecting",void 0),(0,j.default)((0,m.default)(i),"incomingStore",void 0),(0,j.default)((0,m.default)(i),"outgoingStore",void 0),(0,j.default)((0,m.default)(i),"options",void 0),(0,j.default)((0,m.default)(i),"queueQoSZero",void 0),(0,j.default)((0,m.default)(i),"_reconnectCount",void 0),(0,j.default)((0,m.default)(i),"log",void 0),(0,j.default)((0,m.default)(i),"messageIdProvider",void 0),(0,j.default)((0,m.default)(i),"outgoing",void 0),(0,j.default)((0,m.default)(i),"messageIdToTopic",void 0),(0,j.default)((0,m.default)(i),"noop",void 0),(0,j.default)((0,m.default)(i),"keepaliveManager",void 0),(0,j.default)((0,m.default)(i),"stream",void 0),(0,j.default)((0,m.default)(i),"queue",void 0),(0,j.default)((0,m.default)(i),"streamBuilder",void 0),(0,j.default)((0,m.default)(i),"_resubscribeTopics",void 0),(0,j.default)((0,m.default)(i),"connackTimer",void 0),(0,j.default)((0,m.default)(i),"reconnectTimer",void 0),(0,j.default)((0,m.default)(i),"_storeProcessing",void 0),(0,j.default)((0,m.default)(i),"_packetIdsDuringStoreProcessing",void 0),(0,j.default)((0,m.default)(i),"_storeProcessingQueue",void 0),(0,j.default)((0,m.default)(i),"_firstConnection",void 0),(0,j.default)((0,m.default)(i),"topicAliasRecv",void 0),(0,j.default)((0,m.default)(i),"topicAliasSend",void 0),(0,j.default)((0,m.default)(i),"_deferredReconnect",void 0),(0,j.default)((0,m.default)(i),"connackPacket",void 0),i.options=n||{},S)(0,V.default)(i.options[o])>"u"?i.options[o]=S[o]:i.options[o]=n[o];return i.log=i.options.log||(0,c.default)("mqttjs:client"),i.noop=i._noop.bind((0,m.default)(i)),i.log("MqttClient :: version:",r.VERSION),w.isWebWorker?i.log("MqttClient :: environment","webworker"):i.log("MqttClient :: environment",w.default?"browser":"node"),i.log("MqttClient :: options.protocol",n.protocol),i.log("MqttClient :: options.protocolVersion",n.protocolVersion),i.log("MqttClient :: options.username",n.username),i.log("MqttClient :: options.keepalive",n.keepalive),i.log("MqttClient :: options.reconnectPeriod",n.reconnectPeriod),i.log("MqttClient :: options.rejectUnauthorized",n.rejectUnauthorized),i.log("MqttClient :: options.properties.topicAliasMaximum",n.properties?n.properties.topicAliasMaximum:void 0),i.options.clientId="string"==typeof n.clientId?n.clientId:r.defaultId(),i.log("MqttClient :: clientId",i.options.clientId),i.options.customHandleAcks=5===n.protocolVersion&&n.customHandleAcks?n.customHandleAcks:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];t[3](null,0)},i.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),i.streamBuilder=e,i.messageIdProvider=(0,V.default)(i.options.messageIdProvider)>"u"?new p.default:i.options.messageIdProvider,i.outgoingStore=n.outgoingStore||new d.default,i.incomingStore=n.incomingStore||new d.default,i.queueQoSZero=void 0===n.queueQoSZero||n.queueQoSZero,i._resubscribeTopics={},i.messageIdToTopic={},i.keepaliveManager=null,i.connected=!1,i.disconnecting=!1,i.reconnecting=!1,i.queue=[],i.connackTimer=null,i.reconnectTimer=null,i._storeProcessing=!1,i._packetIdsDuringStoreProcessing={},i._storeProcessingQueue=[],i.outgoing={},i._firstConnection=!0,n.properties&&n.properties.topicAliasMaximum>0&&(n.properties.topicAliasMaximum>65535?i.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):i.topicAliasRecv=new v.default(n.properties.topicAliasMaximum)),i.on("connect",(function(){var e=(0,m.default)(i).queue,t=function(){var r=e.shift();i.log("deliver :: entry %o",r);var n;if(r){n=r.packet,i.log("deliver :: call _sendPacket for %o",n);var o=!0;n.messageId&&0!==n.messageId&&(i.messageIdProvider.register(n.messageId)||(o=!1)),o?i._sendPacket(n,(function(e){r.cb&&r.cb(e),t()})):(i.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())}else i._resubscribe()};i.log("connect :: sending queued packets"),t()})),i.on("close",(function(){i.log("close :: connected set to `false`"),i.connected=!1,i.log("close :: clearing connackTimer"),clearTimeout(i.connackTimer),i._destroyKeepaliveManager(),i.topicAliasRecv&&i.topicAliasRecv.clear(),i.log("close :: calling _setupReconnect"),i._setupReconnect()})),i.options.manualConnect||(i.log("MqttClient :: setting up stream"),i.connect()),(0,W.default)(i)}return(0,C.default)(r,[{key:"handleAuth",value:function(e,t){t()}},{key:"handleMessage",value:function(e,t){t()}},{key:"_nextId",value:function(){return this.messageIdProvider.allocate()}},{key:"getLastMessageId",value:function(){return this.messageIdProvider.getLastAllocated()}},{key:"connect",value:function(){var e,t=this,r=new u.Writable,n=s.default.parser(this.options),i=null,o=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new d.default,this.outgoingStore=this.options.outgoingStore||new d.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),n.on("packet",(function(e){t.log("parser :: on packet push to packets array."),o.push(e)}));var a=function(){t.log("work :: getting next packet in queue");var e=o.shift();if(e)t.log("work :: packet pulled from queue"),(0,h.default)(t,e,l);else{t.log("work :: no packets in queue");var r=i;i=null,t.log("work :: done flag is %s",!!r),r&&r()}},l=function(){if(o.length)(0,y.nextTick)(a);else{var e=i;i=null,e()}};r._write=function(e,r,o){i=o,t.log("writable stream :: parsing buffer"),n.parse(e),a()},this.log("connect :: pipe stream to writable stream"),this.stream.pipe(r),this.stream.on("error",(function(e){t.log("streamErrorHandler :: error",e.message),e.code?(t.log("streamErrorHandler :: emitting error"),t.emit("error",e)):t.noop(e)})),this.stream.on("close",(function(){t.log("(%s)stream :: on close",t.options.clientId),t._flushVolatile(),t.log("stream: emit close to MqttClient"),t.emit("close")})),this.log("connect: sending packet `connect`");var c={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&&(c.will=(0,D.default)((0,L.default)({},this.options.will),{payload:null===(e=this.options.will)||void 0===e?void 0:e.payload})),this.topicAliasRecv&&(c.properties||(c.properties={}),this.topicAliasRecv&&(c.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(c),n.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end((function(){return t.emit("error",Error("Packet has no Authentication Method"))})),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){var f=(0,L.default)({cmd:"auth",reasonCode:0},this.options.authPacket);this._writePacket(f)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((function(){t.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),t.emit("error",Error("connack timeout")),t._cleanUp(!0)}),this.options.connectTimeout),this}},{key:"publish",value:function(e,t,r,n){var i=this;this.log("publish :: message `%s` to topic `%s`",t,e);var o=this.options;"function"==typeof r&&(n=r,r=null),r=r||{};var a=(r=(0,L.default)({qos:0,retain:!1,dup:!1},r)).qos,s=r.retain,u=r.dup,l=r.properties,c=r.cbStorePut;if(this._checkDisconnecting(n))return this;var f=function(){var r=0;if((1===a||2===a)&&null===(r=i._nextId()))return i.log("No messageId left"),!1;var f={cmd:"publish",topic:e,payload:t,qos:a,retain:s,messageId:r,dup:u};switch(5===o.protocolVersion&&(f.properties=l),i.log("publish :: qos",a),a){case 1:case 2:i.outgoing[f.messageId]={volatile:!1,cb:n||i.noop},i.log("MqttClient:publish: packet cmd: %s",f.cmd),i._sendPacket(f,void 0,c);break;default:i.log("MqttClient:publish: packet cmd: %s",f.cmd),i._sendPacket(f,n,c)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!f())&&this._storeProcessingQueue.push({invoke:f,cbStorePut:r.cbStorePut,callback:n}),this}},{key:"publishAsync",value:function(e,t,r){var n=this;return new Promise((function(i,o){n.publish(e,t,r,(function(e,t){e?o(e):i(t)}))}))}},{key:"subscribe",value:function(e,t,r){var n=this,i=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;var o=!1,a=[];"string"==typeof e?a=e=[e]:Array.isArray(e)?a=e:"object"==typeof e&&(o=e.resubscribe,delete e.resubscribe,a=Object.keys(e));var s=f.validateTopics(a);if(null!==s)return _(r,Error("Invalid topic "+s)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;var u={qos:0};5===i&&(u.nl=!1,u.rap=!1,u.rh=0);var l=(t=(0,L.default)({},u,t)).properties,c=[],d=function(e,r){if(r=r||t,!{}.hasOwnProperty.call(n._resubscribeTopics,e)||n._resubscribeTopics[e].qos<r.qos||o){var a={topic:e,qos:r.qos};5===i&&(a.nl=r.nl,a.rap=r.rap,a.rh=r.rh,a.properties=l),n.log("subscribe: pushing topic `%s` and qos `%s` to subs list",a.topic,a.qos),c.push(a)}};if(Array.isArray(e)?e.forEach((function(e){n.log("subscribe: array topic %s",e),d(e)})):Object.keys(e).forEach((function(t){n.log("subscribe: object topic %s, %o",t,e[t]),d(t,e[t])})),!c.length)return r(null,[]),this;var h=function(e,t){var r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),n.options.resubscribe){n.log("subscribe :: resubscribe true");var o=[];e.forEach((function(e){if(n.options.reconnectPeriod>0){var t={qos:e.qos};5===i&&(t.nl=e.nl||!1,t.rap=e.rap||!1,t.rh=e.rh||0,t.properties=e.properties),n._resubscribeTopics[e.topic]=t,o.push(e.topic)}})),n.messageIdToTopic[r.messageId]=o}var a=new Promise((function(t,i){n.outgoing[r.messageId]={volatile:!0,cb:function(r,n){if(!r)for(var o=n.granted,a=0;a<o.length;a+=1)e[a].qos=o[a];r?i(new y.ErrorWithSubackPacket(r.message,n)):t(n)}}}));return n.log("subscribe :: call _sendPacket"),n._sendPacket(r),a},p=function(){for(var e,t=null!==(e=n.options.subscribeBatchSize)&&void 0!==e?e:c.length,i=[],o=0;o<c.length;o+=t){var a=c.slice(o,o+t),s=n._nextId();if(null===s)return n.log("No messageId left"),!1;i.push(h(a,s))}return Promise.all(i).then((function(e){r(null,c,e.at(-1))})).catch((function(e){r(e,c,e.packet)})),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!p())&&this._storeProcessingQueue.push({invoke:p,callback:r}),this}},{key:"subscribeAsync",value:function(e,t){var r=this;return new Promise((function(n,i){r.subscribe(e,t,(function(e,t){e?i(e):n(t)}))}))}},{key:"unsubscribe",value:function(e,t,r){var n=this;"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;var i=f.validateTopics(e);if(null!==i)return _(r,Error("Invalid topic "+i)),this;if(this._checkDisconnecting(r))return this;var o=function(){var i=n._nextId();if(null===i)return n.log("No messageId left"),!1;var o={cmd:"unsubscribe",messageId:i,unsubscriptions:[]};return"string"==typeof e?o.unsubscriptions=[e]:Array.isArray(e)&&(o.unsubscriptions=e),n.options.resubscribe&&o.unsubscriptions.forEach((function(e){delete n._resubscribeTopics[e]})),"object"==typeof t&&t.properties&&(o.properties=t.properties),n.outgoing[o.messageId]={volatile:!0,cb:r},n.log("unsubscribe: call _sendPacket"),n._sendPacket(o),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!o())&&this._storeProcessingQueue.push({invoke:o,callback:r}),this}},{key:"unsubscribeAsync",value:function(e,t){var r=this;return new Promise((function(n,i){r.unsubscribe(e,t,(function(e,t){e?i(e):n(t)}))}))}},{key:"end",value:function(e,t,r){var n=this;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);var i=function(){n.log("end :: closeStores: closing incoming and outgoing stores"),n.disconnected=!0,n.incomingStore.close((function(e){n.outgoingStore.close((function(t){if(n.log("end :: closeStores: emitting end"),n.emit("end"),r){var i=e||t;n.log("end :: closeStores: invoking callback with args"),r(i)}}))})),n._deferredReconnect?n._deferredReconnect():(0===n.options.reconnectPeriod||n.options.manualConnect)&&(n.disconnecting=!1)},o=function(){n.log("end :: (%s) :: finish :: calling _cleanUp with force %s",n.options.clientId,e),n._cleanUp(e,(function(){n.log("end :: finish :: calling process.nextTick on closeStores"),(0,y.nextTick)(i)}),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,o,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),o()),this)}},{key:"endAsync",value:function(e,t){var r=this;return new Promise((function(n,i){r.end(e,t,(function(e){e?i(e):n()}))}))}},{key:"removeOutgoingMessage",value:function(e){if(this.outgoing[e]){var t=this.outgoing[e].cb;this._removeOutgoingAndStoreMessage(e,(function(){t(Error("Message removed"))}))}return this}},{key:"reconnect",value:function(e){var t=this;this.log("client reconnect");var r=function(){e?(t.options.incomingStore=e.incomingStore,t.options.outgoingStore=e.outgoingStore):(t.options.incomingStore=null,t.options.outgoingStore=null),t.incomingStore=t.options.incomingStore||new d.default,t.outgoingStore=t.options.outgoingStore||new d.default,t.disconnecting=!1,t.disconnected=!1,t._deferredReconnect=null,t._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this}},{key:"_flushVolatile",value:function(){var e=this;this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach((function(t){e.outgoing[t].volatile&&"function"==typeof e.outgoing[t].cb&&(e.outgoing[t].cb(Error("Connection closed")),delete e.outgoing[t])})))}},{key:"_flush",value:function(){var e=this;this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach((function(t){"function"==typeof e.outgoing[t].cb&&(e.outgoing[t].cb(Error("Connection closed")),delete e.outgoing[t])})))}},{key:"_removeTopicAliasAndRecoverTopicName",value:function(e){var t;e.properties&&(t=e.properties.topicAlias);var r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if((void 0===t?"undefined":(0,V.default)(t))>"u")return Error("Unregistered Topic Alias");if((void 0===(r=this.topicAliasSend.getTopicByAlias(t))?"undefined":(0,V.default)(r))>"u")return Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}},{key:"_checkDisconnecting",value:function(e){return this.disconnecting&&(e&&e!==this.noop?e(Error("client disconnecting")):this.emit("error",Error("client disconnecting"))),this.disconnecting}},{key:"_reconnect",value:function(){var e=this;this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end((function(){e.connect()})),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}},{key:"_setupReconnect",value:function(){var e=this;!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((function(){e.log("reconnectTimer :: reconnect triggered!"),e._reconnect()}),this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}},{key:"_clearReconnect",value:function(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}},{key:"_cleanUp",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=this;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{var i=(0,L.default)({cmd:"disconnect"},r);this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(i,(function(){n.log("_cleanUp :: (%s) :: destroying stream",n.options.clientId),_((function(){n.stream.end((function(){n.log("_cleanUp :: (%s) :: stream destroyed",n.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())}},{key:"_storeAndSend",value:function(e,t,r){var n=this;this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);var i,o=e;if("publish"===o.cmd&&(o=(0,l.default)(e),i=this._removeTopicAliasAndRecoverTopicName(o)))return t&&t(i);this.outgoingStore.put(o,(function(i){if(i)return t&&t(i);r(),n._writePacket(e,t)}))}},{key:"_applyTopicAlias",value:function(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){var t;e.properties&&(t=e.properties.topicAlias);var 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),Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r))?(e.topic="",e.properties=(0,D.default)((0,L.default)({},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=(0,D.default)((0,L.default)({},e.properties),{topicAlias:t}),this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t)):this.options.autoUseTopicAlias&&((t=this.topicAliasSend.getAliasByTopic(r))&&(e.topic="",e.properties=(0,D.default)((0,L.default)({},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),Error("Sending Topic Alias out of range")}}},{key:"_noop",value:function(e){this.log("noop ::",e)}},{key:"_writePacket",value:function(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");var 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())}},{key:"_sendPacket",value:function(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;var 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)}}}},{key:"_storePacket",value:function(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;var n=e;if("publish"===n.cmd){n=(0,l.default)(e);var i=this._removeTopicAliasAndRecoverTopicName(n);if(i)return t&&t(i)}var o=n.qos||0;0===o&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):o>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,(function(e){if(e)return t&&t(e);r()}))):t&&t(Error("No connection to broker"))}},{key:"_setupKeepaliveManager",value:function(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new b.default(this,this.options.timerVariant))}},{key:"_destroyKeepaliveManager",value:function(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}},{key:"reschedulePing",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.keepaliveManager&&this.options.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}},{key:"_reschedulePing",value:function(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}},{key:"sendPing",value:function(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}},{key:"onKeepaliveTimeout",value:function(){this.emit("error",Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}},{key:"_resubscribe",value:function(){this.log("_resubscribe");var 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(var t=0;t<e.length;t++){var 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}},{key:"_onConnect",value:function(e){var t=this;if(this.disconnected)this.emit("connect",e);else{this.connackPacket=e,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;var r=function(){var n=t.outgoingStore.createStream(),i=function(){n.destroy(),n=null,t._flushStoreProcessingQueue(),o()},o=function(){t._storeProcessing=!1,t._packetIdsDuringStoreProcessing={}};t.once("close",i),n.on("error",(function(e){o(),t._flushStoreProcessingQueue(),t.removeListener("close",i),t.emit("error",e)}));var a=function(){if(n){var e,r=n.read(1);r?(t._storeProcessing=!0,t._packetIdsDuringStoreProcessing[r.messageId]?a():t.disconnecting||t.reconnectTimer?n.destroy&&n.destroy():(e=t.outgoing[r.messageId]?t.outgoing[r.messageId].cb:null,t.outgoing[r.messageId]={volatile:!1,cb:function(t,r){e&&e(t,r),a()}},t._packetIdsDuringStoreProcessing[r.messageId]=!0,t.messageIdProvider.register(r.messageId)?t._sendPacket(r,void 0,void 0,!0):t.log("messageId: %d has already used.",r.messageId))):n.once("readable",a)}};n.on("end",(function(){var n=!0;for(var a in t._packetIdsDuringStoreProcessing)if(!t._packetIdsDuringStoreProcessing[a]){n=!1;break}t.removeListener("close",i),n?(o(),t._invokeAllStoreProcessingQueue(),t.emit("connect",e)):r()})),a()};r()}}},{key:"_invokeStoreProcessingQueue",value:function(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){var e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}},{key:"_invokeAllStoreProcessingQueue",value:function(){for(;this._invokeStoreProcessingQueue(););}},{key:"_flushStoreProcessingQueue",value:function(){var e=!0,t=!1,r=void 0;try{for(var n,i=this._storeProcessingQueue[Symbol.iterator]();!(e=(n=i.next()).done);e=!0){var o=n.value;o.cbStorePut&&o.cbStorePut(Error("Connection closed")),o.callback&&o.callback(Error("Connection closed"))}}catch(e){t=!0,r=e}finally{try{e||null==i.return||i.return()}finally{if(t)throw r}}this._storeProcessingQueue.splice(0)}},{key:"_removeOutgoingAndStoreMessage",value:function(e,t){var r=this;delete this.outgoing[e],this.outgoingStore.del({messageId:e},(function(n,i){t(n,i),r.messageIdProvider.deallocate(e),r._invokeStoreProcessingQueue()}))}}],[{key:"defaultId",value:function(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}}]),r}(g.TypedEventEmitter),(0,j.default)(t,"VERSION",y.MQTTJS_VERSION),t);e.default=k})),vi=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0});var t=Mn();e.default=function(){"use strict";function e(){(0,E.default)(this,e),(0,j.default)(this,"numberAllocator",void 0),(0,j.default)(this,"lastId",void 0),this.numberAllocator=new t.NumberAllocator(1,65535)}return(0,C.default)(e,[{key:"allocate",value:function(){return this.lastId=this.numberAllocator.alloc(),this.lastId}},{key:"getLastAllocated",value:function(){return this.lastId}},{key:"register",value:function(e){return this.numberAllocator.use(e)}},{key:"deallocate",value:function(e){this.numberAllocator.free(e)}},{key:"clear",value:function(){this.numberAllocator.clear()}}]),e}()})),yi=Z((function(){ne(),Jt(),Bt(),fr={},dr=!1,(hr=function(){var e,t=function(e){throw new RangeError(l[e])},r=function(e,t){var r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);var i=function(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}((e=e.replace(u,".")).split("."),t).join(".");return n+i},n=function(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);56320==(64512&o)?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t};if(dr)return fr;dr=!0;var i=2147483647,o=36,a=/^xn--/,s=/[^\0-\x7F]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,l={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},c=Math.floor,f=String.fromCharCode,d=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:o},h=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},p=function(e,t,r){var n=0;for(e=r?c(e/700):e>>1,e+=c(e/t);e>455;n+=o)e=c(e/35);return c(n+36*e/(e+38))},v=function(e){var r,n=[],a=e.length,s=0,u=128,l=72,f=e.lastIndexOf("-");f<0&&(f=0);for(var h=0;h<f;++h)e.charCodeAt(h)>=128&&t("not-basic"),n.push(e.charCodeAt(h));for(var v=f>0?f+1:0;v<a;){for(var y=s,g=1,b=o;;b+=o){v>=a&&t("invalid-input");var m=d(e.charCodeAt(v++));m>=o&&t("invalid-input"),m>c((i-s)/g)&&t("overflow"),s+=m*g;var w=b<=l?1:b>=l+26?26:b-l;if(m<w)break;var _=o-w;g>c(i/_)&&t("overflow"),g*=_}var S=n.length+1;l=p(s-y,S,0==y),c(s/S)>i-u&&t("overflow"),u+=c(s/S),s%=S,n.splice(s++,0,u)}return(r=String).fromCodePoint.apply(r,(0,H.default)(n))},y=function(e){var r=[],a=(e=n(e)).length,s=128,u=0,l=72,d=!0,v=!1,y=void 0;try{for(var g,b=e[Symbol.iterator]();!(d=(g=b.next()).done);d=!0){var m=g.value;m<128&&r.push(f(m))}}catch(e){v=!0,y=e}finally{try{d||null==b.return||b.return()}finally{if(v)throw y}}var w=r.length,_=w;for(w&&r.push("-");_<a;){var S=i,k=!0,E=!1,A=void 0;try{for(var x,I=e[Symbol.iterator]();!(k=(x=I.next()).done);k=!0){var P=x.value;P>=s&&P<S&&(S=P)}}catch(e){E=!0,A=e}finally{try{k||null==I.return||I.return()}finally{if(E)throw A}}var O=_+1;S-s>c((i-u)/O)&&t("overflow"),u+=(S-s)*O,s=S;var T=!0,R=!1,M=void 0;try{for(var C,j=e[Symbol.iterator]();!(T=(C=j.next()).done);T=!0){var B=C.value;if(B<s&&++u>i&&t("overflow"),B===s){for(var N=u,U=o;;U+=o){var L=U<=l?1:U>=l+26?26:U-l;if(N<L)break;var D=N-L,F=o-L;r.push(f(h(L+D%F,0))),N=c(D/F)}r.push(f(h(N,0))),l=p(u,O,_===w),u=0,++_}}}catch(e){R=!0,M=e}finally{try{T||null==j.return||j.return()}finally{if(R)throw M}}++u,++s}return r.join("")};return fr={version:"2.3.1",ucs2:{decode:n,encode:function(t){return(e=String).fromCodePoint.apply(e,(0,H.default)(t))}},decode:v,encode:y,toASCII:function(e){return r(e,(function(e){return s.test(e)?"xn--"+y(e):e}))},toUnicode:function(e){return r(e,(function(e){return a.test(e)?v(e.slice(4).toLowerCase()):e}))}}}()).decode,hr.encode,hr.toASCII,hr.toUnicode,hr.ucs2,hr.version}));function gi(){return Bi||(Bi=!0,ji=SyntaxError),ji}function bi(){return Ui||(Ui=!0,Ni=TypeError),Ni}function mi(){if(Ki)return Gi;Ki=!0;var e=function(){if(zi)return Vi;zi=!0;var e={}.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 Vi=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,a=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),s=t(0,i.length-a.length),u=[],l=0;l<s;l++)u[l]="$"+l;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+=",");return r}(u)+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof o){var e=i.apply(this,r(a,arguments));return Object(e)===e?e:this}return i.apply(n,r(a,arguments))})),i.prototype){var c=function(){};c.prototype=i.prototype,o.prototype=new c,c.prototype=null}return o},Vi}();return Gi=function(){}.bind||e}function wi(){if($i)return Ji;$i=!0;var e,t=(Ii||(Ii=!0,xi=Error),xi),r=(Oi||(Oi=!0,Pi=EvalError),Pi),n=(Ri||(Ri=!0,Ti=RangeError),Ti),i=(Ci||(Ci=!0,Mi=ReferenceError),Mi),o=gi(),a=bi(),s=(Di||(Di=!0,Li=URIError),Li),u=Function,l=function(e){try{return u('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var f=function(){throw new a},d=c?function(){try{return f}catch(e){try{return c(arguments,"callee").get}catch(e){return f}}}():f,h=function(){if(Wi)return Fi;Wi=!0;var e=("undefined"==typeof Symbol?"undefined":(0,V.default)(Symbol))<"u"&&Symbol,t=(Ai||(Ai=!0,Ei=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==(0,V.default)(Symbol.iterator))return!0;var e={},t=Symbol(),r=Object(t);if("string"==typeof t||"[object Symbol]"!=={}.toString.call(t)||"[object Symbol]"!=={}.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||!{}.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}),Ei);return Fi=function(){return"function"==typeof e&&"function"==typeof Symbol&&"symbol"==(0,V.default)(e("foo"))&&"symbol"==(0,V.default)(Symbol())&&t()}}()(),p=function(){if(Hi)return qi;Hi=!0;var e={__proto__:null,foo:{}},t=Object;return qi=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)}}()(),v=Object.getPrototypeOf||(p?function(e){return e.__proto__}:null),y={},g=("undefined"==typeof Uint8Array?"undefined":(0,V.default)(Uint8Array))>"u"||!v?e:v(Uint8Array),b={__proto__:null,"%AggregateError%":("undefined"==typeof AggregateError?"undefined":(0,V.default)(AggregateError))>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":("undefined"==typeof ArrayBuffer?"undefined":(0,V.default)(ArrayBuffer))>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":h&&v?v([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":("undefined"==typeof Atomics?"undefined":(0,V.default)(Atomics))>"u"?e:Atomics,"%BigInt%":("undefined"==typeof BigInt?"undefined":(0,V.default)(BigInt))>"u"?e:BigInt,"%BigInt64Array%":("undefined"==typeof BigInt64Array?"undefined":(0,V.default)(BigInt64Array))>"u"?e:BigInt64Array,"%BigUint64Array%":("undefined"==typeof BigUint64Array?"undefined":(0,V.default)(BigUint64Array))>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":("undefined"==typeof DataView?"undefined":(0,V.default)(DataView))>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":("undefined"==typeof Float32Array?"undefined":(0,V.default)(Float32Array))>"u"?e:Float32Array,"%Float64Array%":("undefined"==typeof Float64Array?"undefined":(0,V.default)(Float64Array))>"u"?e:Float64Array,"%FinalizationRegistry%":("undefined"==typeof FinalizationRegistry?"undefined":(0,V.default)(FinalizationRegistry))>"u"?e:FinalizationRegistry,"%Function%":u,"%GeneratorFunction%":y,"%Int8Array%":("undefined"==typeof Int8Array?"undefined":(0,V.default)(Int8Array))>"u"?e:Int8Array,"%Int16Array%":("undefined"==typeof Int16Array?"undefined":(0,V.default)(Int16Array))>"u"?e:Int16Array,"%Int32Array%":("undefined"==typeof Int32Array?"undefined":(0,V.default)(Int32Array))>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":h&&v?v(v([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":("undefined"==typeof Map?"undefined":(0,V.default)(Map))>"u"?e:Map,"%MapIteratorPrototype%":("undefined"==typeof Map?"undefined":(0,V.default)(Map))>"u"||!h||!v?e:v((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":("undefined"==typeof Promise?"undefined":(0,V.default)(Promise))>"u"?e:Promise,"%Proxy%":("undefined"==typeof Proxy?"undefined":(0,V.default)(Proxy))>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":i,"%Reflect%":("undefined"==typeof Reflect?"undefined":(0,V.default)(Reflect))>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":("undefined"==typeof Set?"undefined":(0,V.default)(Set))>"u"?e:Set,"%SetIteratorPrototype%":("undefined"==typeof Set?"undefined":(0,V.default)(Set))>"u"||!h||!v?e:v((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":("undefined"==typeof SharedArrayBuffer?"undefined":(0,V.default)(SharedArrayBuffer))>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":h&&v?v(""[Symbol.iterator]()):e,"%Symbol%":h?Symbol:e,"%SyntaxError%":o,"%ThrowTypeError%":d,"%TypedArray%":g,"%TypeError%":a,"%Uint8Array%":("undefined"==typeof Uint8Array?"undefined":(0,V.default)(Uint8Array))>"u"?e:Uint8Array,"%Uint8ClampedArray%":("undefined"==typeof Uint8ClampedArray?"undefined":(0,V.default)(Uint8ClampedArray))>"u"?e:Uint8ClampedArray,"%Uint16Array%":("undefined"==typeof Uint16Array?"undefined":(0,V.default)(Uint16Array))>"u"?e:Uint16Array,"%Uint32Array%":("undefined"==typeof Uint32Array?"undefined":(0,V.default)(Uint32Array))>"u"?e:Uint32Array,"%URIError%":s,"%WeakMap%":("undefined"==typeof WeakMap?"undefined":(0,V.default)(WeakMap))>"u"?e:WeakMap,"%WeakRef%":("undefined"==typeof WeakRef?"undefined":(0,V.default)(WeakRef))>"u"?e:WeakRef,"%WeakSet%":("undefined"==typeof WeakSet?"undefined":(0,V.default)(WeakSet))>"u"?e:WeakSet};if(v)try{null.error}catch(e){var m=v(v(e));b["%Error.prototype%"]=m}var w=function e(t){var r;if("%AsyncFunction%"===t)r=l("async function () {}");else if("%GeneratorFunction%"===t)r=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=l("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&v&&(r=v(i.prototype))}return b[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=mi(),k=function(){if(Yi)return Qi;Yi=!0;var e=function(){}.call,t={}.hasOwnProperty,r=mi();return Qi=r.call(e,t)}(),E=S.call(Function.call,[].concat),A=S.call(Function.apply,[].splice),x=S.call(Function.call,"".replace),I=S.call(Function.call,"".slice),P=S.call(Function.call,/t/.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,T=/\\(\\)?/g;return Ji=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===P(/^%?[^%]*%?$/,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=I(e,0,1),r=I(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 x(e,O,(function(e,t,r,i){n[n.length]=r?x(i,T,"$1"):t||e})),n}(e),n=r.length>0?r[0]:"",i=function(e,t){var r,n=e;if(k(_,n)&&(n="%"+(r=_[n])[0]+"%"),k(b,n)){var i=b[n];if(i===y&&(i=w(n)),(void 0===i?"undefined":(0,V.default)(i))>"u"&&!t)throw new a("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!")}("%"+n+"%",t),s=i.name,u=i.value,l=!1,f=i.alias;f&&(n=f[0],A(r,E([0,1],f)));for(var d=1,h=!0;d<r.length;d+=1){var p=r[d],v=I(p,0,1),g=I(p,-1);if(('"'===v||"'"===v||"`"===v||'"'===g||"'"===g||"`"===g)&&v!==g)throw new o("property names with quotes must have matching quotes");if(("constructor"===p||!h)&&(l=!0),k(b,s="%"+(n+="."+p)+"%"))u=b[s];else if(null!=u){if(!(p in u)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&d+1>=r.length){var m=c(u,p);u=(h=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:u[p]}else h=k(u,p),u=u[p];h&&!l&&(b[s]=u)}}return u},Ji}function _i(){if(Zi)return Xi;Zi=!0;var e=wi()("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch(t){e=!1}return Xi=e}function Si(){if(to)return eo;to=!0;var e=wi()("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch(t){e=null}return eo=e}function ki(){if(fo)return co;fo=!0;var e=wi(),t=function(){if(lo)return uo;lo=!0;var e=mi(),t=wi(),r=function(){if(so)return ao;so=!0;var e=wi(),t=function(){if(no)return ro;no=!0;var e=_i(),t=gi(),r=bi(),n=Si();return ro=function(i,o,a){if(!i||"object"!=typeof i&&"function"!=typeof i)throw new r("`obj` must be an object or a function`");if("string"!=typeof o&&"symbol"!=(void 0===o?"undefined":(0,V.default)(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 s=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],f=!!n&&n(i,o);if(e)e(i,o,{configurable:null===l&&f?f.configurable:!l,enumerable:null===s&&f?f.enumerable:!s,value:a,writable:null===u&&f?f.writable:!u});else{if(!c&&(s||u||l))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");i[o]=a}},ro}(),r=function(){if(oo)return io;oo=!0;var e=_i(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch(e){return!0}},io=t}()(),n=Si(),i=bi(),o=e("%Math.floor%");return ao=function(e,a){if("function"!=typeof e)throw new i("`fn` is not a function");if("number"!=typeof a||a<0||a>4294967295||o(a)!==a)throw new i("`length` must be a positive 32-bit integer");var s=arguments.length>2&&!!arguments[2],u=!0,l=!0;if("length"in e&&n){var c=n(e,"length");c&&!c.configurable&&(u=!1),c&&!c.writable&&(l=!1)}return(u||l||!s)&&(r?t(e,"length",a,!0,!0):t(e,"length",a)),e},ao}(),n=bi(),i=t("%Function.prototype.apply%"),o=t("%Function.prototype.call%"),a=t("%Reflect.apply%",!0)||e.call(o,i),s=_i(),u=t("%Math.max%");uo=function(t){if("function"!=typeof t)throw new n("a function is required");var i=a(e,o,arguments);return r(i,1+u(0,t.length-(arguments.length-1)),!0)};var l=function(){return a(e,i,arguments)};return s?s(uo,"apply",{value:l}):uo.apply=l,uo}(),r=t(e("String.prototype.indexOf"));return co=function(n,i){var o=e(n,!!i);return"function"==typeof o&&r(n,".prototype.")>-1?t(o):o}}var Ei,Ai,xi,Ii,Pi,Oi,Ti,Ri,Mi,Ci,ji,Bi,Ni,Ui,Li,Di,Fi,Wi,qi,Hi,Vi,zi,Gi,Ki,Qi,Yi,Ji,$i,Xi,Zi,eo,to,ro,no,io,oo,ao,so,uo,lo,co,fo,ho=Z((function(){ne(),Jt(),Bt(),Ei={},Ai=!1,xi={},Ii=!1,Pi={},Oi=!1,Ti={},Ri=!1,Mi={},Ci=!1,ji={},Bi=!1,Ni={},Ui=!1,Li={},Di=!1,Fi={},Wi=!1,qi={},Hi=!1,Vi={},zi=!1,Gi={},Ki=!1,Qi={},Yi=!1,Ji={},$i=!1,Xi={},Zi=!1,eo={},to=!1,ro={},no=!1,io={},oo=!1,ao={},so=!1,uo={},lo=!1,co={},fo=!1}));function po(e){throw Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function vo(){!Ro||!Mo||(Ro=!1,Mo.length?To=Mo.concat(To):Co=-1,To.length&&yo())}function yo(){if(!Ro){var e=setTimeout(vo,0);Ro=!0;for(var t=To.length;t;){for(Mo=To,To=[];++Co<t;)Mo&&Mo[Co].run();Co=-1,t=To.length}Mo=null,Ro=!1,clearTimeout(e)}}function go(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];To.push(new bo(e,t)),1===To.length&&!Ro&&setTimeout(yo,0)}function bo(e,t){this.fun=e,this.array=t}function mo(){}function wo(){po("_linkedBinding")}function _o(){po("dlopen")}function So(){return[]}function ko(){return[]}function Eo(e,t){if(!e)throw Error(t||"assertion error")}function Ao(){return!1}function xo(){return pa.now()/1e3}function Io(e){var t=Math.floor(.001*(Date.now()-pa.now())),r=.001*pa.now(),n=Math.floor(r)+t,i=Math.floor(r%1*1e9);return e&&(n-=e[0],(i-=e[1])<0&&(n--,i+=ya)),[n,i]}function Po(){return ga}function Oo(){return[]}var To,Ro,Mo,Co,jo,Bo,No,Uo,Lo,Do,Fo,Wo,qo,Ho,Vo,zo,Go,Ko,Qo,Yo,Jo,$o,Xo,Zo,ea,ta,ra,na,ia,oa,aa,sa,ua,la,ca,fa,da,ha,pa,va,ya,ga,ba,ma,wa,_a=Z((function(){ne(),Jt(),Bt(),To=[],Ro=!1,Co=-1,bo.prototype.run=function(){this.fun.apply(null,this.array)},jo={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Bo=["/usr/bin/node"],No=[],Uo={},Lo=function(e,t){console.warn((t?t+": ":"")+e)},Do=function(){po("binding")},Fo=function(){return 0},Wo=function(){return"/"},qo=function(){},Ho={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},Vo=mo,zo=[],Go={},Ko={},Qo=mo,Yo=mo,$o=Jo=function(){return{}},Xo=Jo,Zo=mo,ea=mo,ta=mo,ra={},na={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ia=mo,oa=mo,aa=mo,sa=mo,ua=mo,la=mo,ca=mo,fa=mo,da=[],ha=mo,void 0===(pa={now:("undefined"==typeof performance?"undefined":(0,V.default)(performance))<"u"?performance.now.bind(performance):void 0,timing:("undefined"==typeof performance?"undefined":(0,V.default)(performance))<"u"?performance.timing:void 0}).now&&(va=Date.now(),pa.timing&&pa.timing.navigationStart&&(va=pa.timing.navigationStart),pa.now=function(){return Date.now()-va}),ya=1e9,Io.bigint=function(e){var t=Io(e);return("undefined"==typeof BigInt?"undefined":(0,V.default)(BigInt))>"u"?t[0]*ya+t[1]:BigInt(t[0]*ya)+BigInt(t[1])},ga={version:"v16.8.0",versions:Uo,arch:"x64",platform:"browser",release:Ho,_rawDebug:Vo,moduleLoadList:zo,binding:Do,_linkedBinding:wo,_events:{},_eventsCount:0,_maxListeners:10,on:Po,addListener:Po,once:Po,off:Po,removeListener:Po,removeAllListeners:Po,emit:mo,prependListener:Po,prependOnceListener:Po,listeners:Oo,domain:Go,_exiting:!1,config:Ko,dlopen:_o,uptime:xo,_getActiveRequests:So,_getActiveHandles:ko,reallyExit:Qo,_kill:Yo,cpuUsage:Jo,resourceUsage:$o,memoryUsage:Xo,kill:Zo,exit:ea,openStdin:ta,allowedNodeEnvironmentFlags:ra,assert:Eo,features:na,_fatalExceptions:ia,setUncaughtExceptionCaptureCallback:oa,hasUncaughtExceptionCaptureCallback:Ao,emitWarning:Lo,nextTick:go,_tickCallback:aa,_debugProcess:sa,_debugEnd:ua,_startProfilerIdleNotifier:la,_stopProfilerIdleNotifier:ca,stdout:void 0,stdin:void 0,stderr:void 0,abort:fa,umask:Fo,chdir:qo,cwd:Wo,env:jo,title:"browser",argv:Bo,execArgv:No,pid:2,ppid:1,execPath:"/bin/usr/node",debugPort:9229,hrtime:Io,argv0:"node",_preload_modules:da,setSourceMapsEnabled:ha}})),Sa=Z((function(){ne(),Jt(),Bt(),_a(),ba={},ma=!1,wa=function(){var e=function(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))},t=function(e,t){for(var r,n="",i=0,o=-1,a=0,s=0;s<=e.length;++s){if(s<e.length)r=e.charCodeAt(s);else{if(47===r)break;r=47}if(47===r){if(o!==s-1&&1!==a)if(o!==s-1&&2===a){if(n.length<2||2!==i||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var u=n.lastIndexOf("/");if(u!==n.length-1){-1===u?(n="",i=0):i=(n=n.slice(0,u)).length-1-n.lastIndexOf("/"),o=s,a=0;continue}}else if(2===n.length||1===n.length){n="",i=0,o=s,a=0;continue}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,s):n=e.slice(o+1,s),i=s-o-1;o=s,a=0}else 46===r&&-1!==a?++a:a=-1}return n};if(ma)return ba;ma=!0;var r=ga,n={resolve:function(){for(var n,i="",o=!1,a=arguments.length-1;a>=-1&&!o;a--){var s;a>=0?s=arguments[a]:(void 0===n&&(n=r.cwd()),s=n),e(s),0!==s.length&&(i=s+"/"+i,o=47===s.charCodeAt(0))}return i=t(i,!o),o?i.length>0?"/"+i:"/":i.length>0?i:"."},normalize:function(r){if(e(r),0===r.length)return".";var n=47===r.charCodeAt(0),i=47===r.charCodeAt(r.length-1);return 0===(r=t(r,!n)).length&&!n&&(r="."),r.length>0&&i&&(r+="/"),n?"/"+r:r},isAbsolute:function(t){return e(t),t.length>0&&47===t.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var t,r=0;r<arguments.length;++r){var i=arguments[r];e(i),i.length>0&&(void 0===t?t=i:t+="/"+i)}return void 0===t?".":n.normalize(t)},relative:function(t,r){if(e(t),e(r),t===r||(t=n.resolve(t))===(r=n.resolve(r)))return"";for(var i=1;i<t.length&&47===t.charCodeAt(i);++i);for(var o=t.length,a=o-i,s=1;s<r.length&&47===r.charCodeAt(s);++s);for(var u=r.length-s,l=a<u?a:u,c=-1,f=0;f<=l;++f){if(f===l){if(u>l){if(47===r.charCodeAt(s+f))return r.slice(s+f+1);if(0===f)return r.slice(s+f)}else a>l&&(47===t.charCodeAt(i+f)?c=f:0===f&&(c=0));break}var d=t.charCodeAt(i+f);if(d!==r.charCodeAt(s+f))break;47===d&&(c=f)}var h="";for(f=i+c+1;f<=o;++f)(f===o||47===t.charCodeAt(f))&&(0===h.length?h+="..":h+="/..");return h.length>0?h+r.slice(s+c):(s+=c,47===r.charCodeAt(s)&&++s,r.slice(s))},_makeLong:function(e){return e},dirname:function(t){if(e(t),0===t.length)return".";for(var r=t.charCodeAt(0),n=47===r,i=-1,o=!0,a=t.length-1;a>=1;--a)if(47===(r=t.charCodeAt(a))){if(!o){i=a;break}}else o=!1;return-1===i?n?"/":".":n&&1===i?"//":t.slice(0,i)},basename:function(t,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');e(t);var n,i=0,o=-1,a=!0;if(void 0!==r&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var s=r.length-1,u=-1;for(n=t.length-1;n>=0;--n){var l=t.charCodeAt(n);if(47===l){if(!a){i=n+1;break}}else-1===u&&(a=!1,u=n+1),s>=0&&(l===r.charCodeAt(s)?-1==--s&&(o=n):(s=-1,o=u))}return i===o?o=u:-1===o&&(o=t.length),t.slice(i,o)}for(n=t.length-1;n>=0;--n)if(47===t.charCodeAt(n)){if(!a){i=n+1;break}}else-1===o&&(a=!1,o=n+1);return-1===o?"":t.slice(i,o)},extname:function(t){e(t);for(var r=-1,n=0,i=-1,o=!0,a=0,s=t.length-1;s>=0;--s){var u=t.charCodeAt(s);if(47!==u)-1===i&&(o=!1,i=s+1),46===u?-1===r?r=s:1!==a&&(a=1):-1!==r&&(a=-1);else if(!o){n=s+1;break}}return-1===r||-1===i||0===a||1===a&&r===i-1&&r===n+1?"":t.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 '+(void 0===e?"undefined":(0,V.default)(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+"/"+n:n}(0,e)},parse:function(t){e(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===t.length)return r;var n,i=t.charCodeAt(0),o=47===i;o?(r.root="/",n=1):n=0;for(var a=-1,s=0,u=-1,l=!0,c=t.length-1,f=0;c>=n;--c)if(47!==(i=t.charCodeAt(c)))-1===u&&(l=!1,u=c+1),46===i?-1===a?a=c:1!==f&&(f=1):-1!==a&&(f=-1);else if(!l){s=c+1;break}return-1===a||-1===u||0===f||1===f&&a===u-1&&a===s+1?-1!==u&&(r.base=r.name=0===s&&o?t.slice(1,u):t.slice(s,u)):(0===s&&o?(r.name=t.slice(1,a),r.base=t.slice(1,u)):(r.name=t.slice(s,a),r.base=t.slice(s,u)),r.ext=t.slice(a,u)),s>0?r.dir=t.slice(0,s-1):o&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,ba=n}()})),ka={};function Ea(){if(Ba)return ja;Ba=!0;var e=wi(),t=ki(),r=function(){var e=function(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||j.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-L(-e):L(e);if(n!==e){var i=n+"",o=T.call(t,i.length+1);return R.call(i,r,"$&_")+"."+R.call(R.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return R.call(t,r,"$&_")},t=function(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n},r=function(e){return R.call(e+"",/"/g,""")},n=function(e){return!("[object Array]"!==s(e)||H&&"object"==typeof e&&H in e)},i=function(e){return!("[object RegExp]"!==s(e)||H&&"object"==typeof e&&H in e)},o=function(e){if(q)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==(void 0===e?"undefined":(0,V.default)(e)))return!0;if(!e||"object"!=typeof e||!W)return!1;try{return W.call(e),!0}catch(e){}return!1},a=function(e,t){return J.call(e,t)},s=function(e){return I.call(e)},u=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},l=function(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":"")+M.call(t.toString(16))},c=function(e){return"Object("+e+")"},f=function(e){return e+" { ? }"},d=function(e,t,r,n){return e+" ("+t+") {"+(n?h(r,n):N.call(r,", "))+"}"},h=function(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+N.call(e,","+r)+"\n"+t.prev},p=function(e,t){var r=n(e),i=[];if(r){i.length=e.length;for(var o=0;o<e.length;o++)i[o]=a(e,o)?t(e[o],e):""}var s,u="function"==typeof F?F(e):[];if(q){s={};for(var l=0;l<u.length;l++)s["$"+u[l]]=u[l]}for(var c in e)a(e,c)&&(r&&Number(c)+""===c&&c<e.length||q&&s["$"+c]instanceof Symbol||(j.call(/[^\w$]/,c)?i.push(t(c,e)+": "+t(e[c],e)):i.push(c+": "+t(e[c],e))));if("function"==typeof F)for(var f=0;f<u.length;f++)z.call(e,u[f])&&i.push("["+t(u[f])+"]: "+t(e[u[f]],e));return i};if(Ma)return Ra;Ma=!0;var v="function"==typeof Map&&Map.prototype,y=Object.getOwnPropertyDescriptor&&v?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,g=v&&y&&"function"==typeof y.get?y.get:null,b=v&&Map.prototype.forEach,m="function"==typeof Set&&Set.prototype,w=Object.getOwnPropertyDescriptor&&m?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,_=m&&w&&"function"==typeof w.get?w.get:null,S=m&&Set.prototype.forEach,k="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,E="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,A="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,x=Boolean.prototype.valueOf,I={}.toString,P=function(){}.toString,O="".match,T="".slice,R="".replace,M="".toUpperCase,C="".toLowerCase,j=/t/.test,B=[].concat,N=[].join,U=[].slice,L=Math.floor,D="function"==typeof BigInt?BigInt.prototype.valueOf:null,F=Object.getOwnPropertySymbols,W="function"==typeof Symbol&&"symbol"==(0,V.default)(Symbol.iterator)?Symbol.prototype.toString:null,q="function"==typeof Symbol&&"object"==typeof Symbol.iterator,H="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,z={}.propertyIsEnumerable,G=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null),K=Ta,Q=K.custom,Y=o(Q)?Q:null,J={}.hasOwnProperty||function(e){return e in(this||Ca)};function $(e,r){if(e.length>r.maxStringLength){var n=e.length-r.maxStringLength,i="... "+n+" more character"+(n>1?"s":"");return $(T.call(e,0,r.maxStringLength),r)+i}return t(R.call(R.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,l),"single",r)}return Ra=function l(v,y,m,w){var I=function(e,t,r){if(t&&(w=U.call(w)).push(t),r){var n={depth:M.depth};return a(M,"quoteStyle")&&(n.quoteStyle=M.quoteStyle),l(e,n,m+1,w)}return l(e,M,m+1,w)},M=y||{};if(a(M,"quoteStyle")&&"single"!==M.quoteStyle&&"double"!==M.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(a(M,"maxStringLength")&&("number"==typeof M.maxStringLength?M.maxStringLength<0&&M.maxStringLength!==1/0:null!==M.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var j=!a(M,"customInspect")||M.customInspect;if("boolean"!=typeof j&&"symbol"!==j)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(a(M,"indent")&&null!==M.indent&&"\t"!==M.indent&&!(parseInt(M.indent,10)===M.indent&&M.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(a(M,"numericSeparator")&&"boolean"!=typeof M.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var L=M.numericSeparator;if((void 0===v?"undefined":(0,V.default)(v))>"u")return"undefined";if(null===v)return"null";if("boolean"==typeof v)return v?"true":"false";if("string"==typeof v)return $(v,M);if("number"==typeof v){if(0===v)return 1/0/v>0?"0":"-0";var F=v+"";return L?e(v,F):F}if("bigint"==(void 0===v?"undefined":(0,V.default)(v))){var Q=v+"n";return L?e(v,Q):Q}var J=(0,V.default)(M.depth)>"u"?5:M.depth;if((void 0===m?"undefined":(0,V.default)(m))>"u"&&(m=0),m>=J&&J>0&&"object"==typeof v)return n(v)?"[Array]":"[Object]";var X=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=N.call(Array(e.indent+1)," ")}return{base:r,prev:N.call(Array(t+1),r)}}(M,m);if((void 0===w?"undefined":(0,V.default)(w))>"u")w=[];else if(u(w,v)>=0)return"[Circular]";if("function"==typeof v&&!i(v)){var Z=function(e){if(e.name)return e.name;var t=O.call(P.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(v),ee=p(v,I);return"[Function"+(Z?": "+Z:" (anonymous)")+"]"+(ee.length>0?" { "+N.call(ee,", ")+" }":"")}if(o(v)){var te=q?R.call(v+"",/^(Symbol\(.*\))_[^)]*$/,"$1"):W.call(v);return"object"!=typeof v||q?te:c(te)}if(function(e){return!(!e||"object"!=typeof e)&&(("undefined"==typeof HTMLElement?"undefined":(0,V.default)(HTMLElement))<"u"&&e instanceof HTMLElement||"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}(v)){for(var re="<"+C.call(v.nodeName+""),ne=v.attributes||[],ie=0;ie<ne.length;ie++)re+=" "+ne[ie].name+"="+t(r(ne[ie].value),"double",M);return re+=">",v.childNodes&&v.childNodes.length&&(re+="..."),re+"</"+C.call(v.nodeName+"")+">"}if(n(v)){if(0===v.length)return"[]";var oe=p(v,I);return X&&!function(e){for(var t=0;t<e.length;t++)if(u(e[t],"\n")>=0)return!1;return!0}(oe)?"["+h(oe,X)+"]":"[ "+N.call(oe,", ")+" ]"}if(function(e){return!("[object Error]"!==s(e)||H&&"object"==typeof e&&H in e)}(v)){var ae=p(v,I);return"cause"in Error.prototype||!("cause"in v)||z.call(v,"cause")?0===ae.length?"["+v+"]":"{ ["+v+"] "+N.call(ae,", ")+" }":"{ ["+v+"] "+N.call(B.call("[cause]: "+I(v.cause),ae),", ")+" }"}if("object"==typeof v&&j){if(Y&&"function"==typeof v[Y]&&K)return K(v,{depth:J-m});if("symbol"!==j&&"function"==typeof v.inspect)return v.inspect()}if(function(e){if(!g||!e||"object"!=typeof e)return!1;try{g.call(e);try{_.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(v)){var se=[];return b&&b.call(v,(function(e,t){se.push(I(t,v,!0)+" => "+I(e,v))})),d("Map",g.call(v),se,X)}if(function(e){if(!_||!e||"object"!=typeof e)return!1;try{_.call(e);try{g.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(v)){var ue=[];return S&&S.call(v,(function(e){ue.push(I(e,v))})),d("Set",_.call(v),ue,X)}if(function(e){if(!k||!e||"object"!=typeof e)return!1;try{k.call(e,k);try{E.call(e,E)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(v))return f("WeakMap");if(function(e){if(!E||!e||"object"!=typeof e)return!1;try{E.call(e,E);try{k.call(e,k)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(v))return f("WeakSet");if(function(e){if(!A||!e||"object"!=typeof e)return!1;try{return A.call(e),!0}catch(e){}return!1}(v))return f("WeakRef");if(function(e){return!("[object Number]"!==s(e)||H&&"object"==typeof e&&H in e)}(v))return c(I(Number(v)));if(function(e){if(!e||"object"!=typeof e||!D)return!1;try{return D.call(e),!0}catch(e){}return!1}(v))return c(I(D.call(v)));if(function(e){return!("[object Boolean]"!==s(e)||H&&"object"==typeof e&&H in e)}(v))return c(x.call(v));if(function(e){return!("[object String]"!==s(e)||H&&"object"==typeof e&&H in e)}(v))return c(I(v+""));if(("undefined"==typeof window?"undefined":(0,V.default)(window))<"u"&&v===window)return"{ [object Window] }";if(("undefined"==typeof globalThis?"undefined":(0,V.default)(globalThis))<"u"&&v===globalThis||(void 0===Ca?"undefined":(0,V.default)(Ca))<"u"&&v===Ca)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==s(e)||H&&"object"==typeof e&&H in e)}(v)&&!i(v)){var le=p(v,I),ce=G?G(v)===Object.prototype:v instanceof Object||v.constructor===Object,fe=v instanceof Object?"":"null prototype",de=!ce&&H&&Object(v)===v&&H in v?T.call(s(v),8,-1):fe?"Object":"",he=(ce||"function"!=typeof v.constructor?"":v.constructor.name?v.constructor.name+" ":"")+(de||fe?"["+N.call(B.call([],de||[],fe||[]),": ")+"] ":"");return 0===le.length?he+"{}":X?he+"{"+h(le,X)+"}":he+"{ "+N.call(le,", ")+" }"}return v+""}}(),n=bi(),i=e("%WeakMap%",!0),o=e("%Map%",!0),a=t("WeakMap.prototype.get",!0),s=t("WeakMap.prototype.set",!0),u=t("WeakMap.prototype.has",!0),l=t("Map.prototype.get",!0),c=t("Map.prototype.set",!0),f=t("Map.prototype.has",!0),d=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 ja=function(){var e,t,h,p={assert:function(e){if(!p.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 a(e,r)}else if(o){if(t)return l(t,r)}else if(h)return function(e,t){var r=d(e,t);return r&&r.value}(h,r)},has:function(r){if(i&&r&&("object"==typeof r||"function"==typeof r)){if(e)return u(e,r)}else if(o){if(t)return f(t,r)}else if(h)return function(e,t){return!!d(e,t)}(h,r);return!1},set:function(r,n){i&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new i),s(e,r,n)):o?(t||(t=new o),c(t,r,n)):(h||(h={key:{},next:null}),function(e,t,r){var n=d(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(h,r,n))}};return p}}function Aa(){if(Ua)return Na;Ua=!0;var e="".replace,t=/%20/g,r="RFC3986";return Na={default:r,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(e){return e+""}},RFC1738:"RFC1738",RFC3986:r}}function xa(){if(Da)return La;Da=!0;var e=Aa(),t={}.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)(0,V.default)(e[n])<"u"&&(r[n]=e[n]);return r},o=1024;return La={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],a=o.obj[o.prop],s=Object.keys(a),u=0;u<s.length;++u){var l=s[u],c=a[l];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:a,prop:l}),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)(0,V.default)(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(e){return n}},encode:function(t,r,i,a,s){if(0===t.length)return t;var u=t;if("symbol"==(void 0===t?"undefined":(0,V.default)(t))?u=Symbol.prototype.toString.call(t):"string"!=typeof t&&(u=t+""),"iso-8859-1"===i)return escape(u).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var l="",c=0;c<u.length;c+=o){for(var f=u.length>=o?u.slice(c,c+o):u,d=[],h=0;h<f.length;++h){var p=f.charCodeAt(h);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||s===e.RFC1738&&(40===p||41===p)?d[d.length]=f.charAt(h):p<128?d[d.length]=n[p]:p<2048?d[d.length]=n[192|p>>6]+n[128|63&p]:p<55296||p>=57344?d[d.length]=n[224|p>>12]+n[128|p>>6&63]+n[128|63&p]:(h+=1,p=65536+((1023&p)<<10|1023&f.charCodeAt(h)),d[d.length]=n[240|p>>18]+n[128|p>>12&63]+n[128|p>>6&63]+n[128|63&p])}l+=d.join("")}return l},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"==={}.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,a){if(!o)return n;if("object"!=typeof o){if(r(n))n.push(o);else{if(!n||"object"!=typeof n)return[n,o];(a&&(a.plainObjects||a.allowPrototypes)||!t.call(Object.prototype,o))&&(n[o]=!0)}return n}if(!n||"object"!=typeof n)return[n].concat(o);var s=n;return r(n)&&!r(o)&&(s=i(n,a)),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,a):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,a):r[n]=i,r}),s)}}}function Ia(){var e=function(){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},t=function(t,r,n){if(t&&"object"==typeof t&&t instanceof e)return t;var i=new e;return i.parse(t,r,n),i};if(Ka)return Ga;Ka=!0;var r=hr,n=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,a=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),s=["'"].concat(a),u=["%","/","?",";","#"].concat(s),l=["/","?","#"],c=/^[+a-z0-9A-Z_-]{0,63}$/,f=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},h={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},v=function(){if(za)return Va;za=!0;var e=function(){if(Wa)return Fa;Wa=!0;var e=Ea(),t=xa(),r=Aa(),n={}.hasOwnProperty,i={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},o=Array.isArray,a=[].push,s=function(e,t){a.apply(e,o(t)?t:[t])},u=Date.prototype.toISOString,l=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:l,formatter:r.formatters[l],indices:!1,serializeDate:function(e){return u.call(e)},skipNulls:!1,strictNullHandling:!1},f={},d=function r(n,i,a,u,l,d,h,p,v,y,g,b,m,w,_,S,k,E){for(var A=n,x=E,I=0,P=!1;void 0!==(x=x.get(f))&&!P;){var O=x.get(n);if(I+=1,(void 0===O?"undefined":(0,V.default)(O))<"u"){if(O===I)throw new RangeError("Cyclic object value");P=!0}(0,V.default)(x.get(f))>"u"&&(I=0)}if("function"==typeof y?A=y(i,A):A instanceof Date?A=m(A):"comma"===a&&o(A)&&(A=t.maybeMap(A,(function(e){return e instanceof Date?m(e):e}))),null===A){if(d)return v&&!S?v(i,c.encoder,k,"key",w):i;A=""}if(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==(void 0===e?"undefined":(0,V.default)(e))||"bigint"==(void 0===e?"undefined":(0,V.default)(e))}(A)||t.isBuffer(A))return v?[_(S?i:v(i,c.encoder,k,"key",w))+"="+_(v(A,c.encoder,k,"value",w))]:[_(i)+"="+_(A+"")];var T,R=[];if((void 0===A?"undefined":(0,V.default)(A))>"u")return R;if("comma"===a&&o(A))S&&v&&(A=t.maybeMap(A,v)),T=[{value:A.length>0?A.join(",")||null:void 0}];else if(o(y))T=y;else{var M=Object.keys(A);T=g?M.sort(g):M}var C=p?i.replace(/\./g,"%2E"):i,j=u&&o(A)&&1===A.length?C+"[]":C;if(l&&o(A)&&0===A.length)return j+"[]";for(var B=0;B<T.length;++B){var N=T[B],U="object"==typeof N&&(0,V.default)(N.value)<"u"?N.value:A[N];if(!h||null!==U){var L=b&&p?N.replace(/\./g,"%2E"):N,D=o(A)?"function"==typeof a?a(j,L):j:j+(b?"."+L:"["+L+"]");E.set(n,I);var F=e();F.set(f,E),s(R,r(U,D,a,u,l,d,h,p,"comma"===a&&S&&o(A)?null:v,y,g,b,m,w,_,S,k,F))}}return R};return Fa=function(t,a){var u,l=t,f=function(e){if(!e)return c;if((0,V.default)(e.allowEmptyArrays)<"u"&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if((0,V.default)(e.encodeDotInKeys)<"u"&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&(0,V.default)(e.encoder)<"u"&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||c.charset;if((0,V.default)(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 a=r.default;if((0,V.default)(e.format)<"u"){if(!n.call(r.formatters,e.format))throw new TypeError("Unknown format option provided.");a=e.format}var s,u=r.formatters[a],l=c.filter;if(("function"==typeof e.filter||o(e.filter))&&(l=e.filter),s=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 f=(0,V.default)(e.allowDots)>"u"?!0===e.encodeDotInKeys||c.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:c.addQueryPrefix,allowDots:f,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:s,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:c.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:(0,V.default)(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:l,format:a,formatter:u,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}}(a);"function"==typeof f.filter?l=(0,f.filter)("",l):o(f.filter)&&(u=f.filter);var h=[];if("object"!=typeof l||null===l)return"";var p=i[f.arrayFormat],v="comma"===p&&f.commaRoundTrip;u||(u=Object.keys(l)),f.sort&&u.sort(f.sort);for(var y=e(),g=0;g<u.length;++g){var b=u[g];f.skipNulls&&null===l[b]||s(h,d(l[b],b,p,v,f.allowEmptyArrays,f.strictNullHandling,f.skipNulls,f.encodeDotInKeys,f.encode?f.encoder:null,f.filter,f.sort,f.allowDots,f.serializeDate,f.format,f.formatter,f.encodeValuesOnly,f.charset,y))}var m=h.join(f.delimiter),w=!0===f.addQueryPrefix?"?":"";return f.charsetSentinel&&("iso-8859-1"===f.charset?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),m.length>0?w+m:""}}(),t=function(){if(Ha)return qa;Ha=!0;var e=xa(),t={}.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,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},o=function(e,r,n,o){if(e){var a=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/g,u=n.depth>0&&/(\[[^[\]]*])/.exec(a),l=u?a.slice(0,u.index):a,c=[];if(l){if(!n.plainObjects&&t.call(Object.prototype,l)&&!n.allowPrototypes)return;c.push(l)}for(var f=0;n.depth>0&&null!==(u=s.exec(a))&&f<n.depth;){if(f+=1,!n.plainObjects&&t.call(Object.prototype,u[1].slice(1,-1))&&!n.allowPrototypes)return;c.push(u[1])}if(u){if(!0===n.strictDepth)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");c.push("["+a.slice(u.index)+"]")}return function(e,t,r,n){for(var o=n?t:i(t,r),a=e.length-1;a>=0;--a){var s,u=e[a];if("[]"===u&&r.parseArrays)s=r.allowEmptyArrays&&(""===o||r.strictNullHandling&&null===o)?[]:[].concat(o);else{s=r.plainObjects?Object.create(null):{};var l="["===u.charAt(0)&&"]"===u.charAt(u.length-1)?u.slice(1,-1):u,c=r.decodeDotInKeys?l.replace(/%2E/g,"."):l,f=parseInt(c,10);r.parseArrays||""!==c?!isNaN(f)&&u!==c&&f+""===c&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(s=[])[f]=o:"__proto__"!==c&&(s[c]=o):s={0:o}}o=s}return o}(c,r,n,o)}};return qa=function(a,s){var u=function(t){if(!t)return n;if((0,V.default)(t.allowEmptyArrays)<"u"&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if((0,V.default)(t.decodeDotInKeys)<"u"&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&(0,V.default)(t.decoder)<"u"&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if((0,V.default)(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=(0,V.default)(t.charset)>"u"?n.charset:t.charset,i=(0,V.default)(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:(0,V.default)(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}}(s);if(""===a||null===a||(void 0===a?"undefined":(0,V.default)(a))>"u")return u.plainObjects?Object.create(null):{};for(var l="string"==typeof a?function(o,a){var s={__proto__:null},u=a.ignoreQueryPrefix?o.replace(/^\?/,""):o;u=u.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var l,c=a.parameterLimit===1/0?void 0:a.parameterLimit,f=u.split(a.delimiter,c),d=-1,h=a.charset;if(a.charsetSentinel)for(l=0;l<f.length;++l)0===f[l].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[l]?h="utf-8":"utf8=%26%2310003%3B"===f[l]&&(h="iso-8859-1"),d=l,l=f.length);for(l=0;l<f.length;++l)if(l!==d){var p,v,y=f[l],g=y.indexOf("]="),b=-1===g?y.indexOf("="):g+1;-1===b?(p=a.decoder(y,n.decoder,h,"key"),v=a.strictNullHandling?null:""):(p=a.decoder(y.slice(0,b),n.decoder,h,"key"),v=e.maybeMap(i(y.slice(b+1),a),(function(e){return a.decoder(e,n.decoder,h,"value")}))),v&&a.interpretNumericEntities&&"iso-8859-1"===h&&(v=v.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(parseInt(t,10))}))),y.indexOf("[]=")>-1&&(v=r(v)?[v]:v);var m=t.call(s,p);m&&"combine"===a.duplicates?s[p]=e.combine(s[p],v):(!m||"last"===a.duplicates)&&(s[p]=v)}return s}(a,u):a,c=u.plainObjects?Object.create(null):{},f=Object.keys(l),d=0;d<f.length;++d){var h=f[d],p=o(h,l[h],u,"string"==typeof a);c=e.merge(c,p,u)}return!0===u.allowSparse?c:e.compact(c)}}(),r=Aa();return Va={formats:r,parse:t,stringify:e}}();return e.prototype.parse=function(e,t,i){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+(void 0===e?"undefined":(0,V.default)(e)));var a=e.indexOf("?"),y=-1!==a&&a<e.indexOf("#")?"?":"#",g=e.split(y);g[0]=g[0].replace(/\\/g,"/");var b=e=g.join(y);if(b=b.trim(),!i&&1===e.split("#").length){var m=o.exec(b);if(m)return this.path=b,this.href=b,this.pathname=m[1],m[2]?(this.search=m[2],this.query=t?v.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=n.exec(b);if(w){var _=(w=w[0]).toLowerCase();this.protocol=_,b=b.substr(w.length)}if(i||w||b.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===b.substr(0,2);S&&(!w||!h[w])&&(b=b.substr(2),this.slashes=!0)}if(!h[w]&&(S||w&&!p[w])){for(var k=-1,E=0;E<l.length;E++)-1!==(I=b.indexOf(l[E]))&&(-1===k||I<k)&&(k=I);var A,x;for(-1!==(x=-1===k?b.lastIndexOf("@"):b.lastIndexOf("@",k))&&(A=b.slice(0,x),b=b.slice(x+1),this.auth=decodeURIComponent(A)),k=-1,E=0;E<u.length;E++){var I;-1!==(I=b.indexOf(u[E]))&&(-1===k||I<k)&&(k=I)}-1===k&&(k=b.length),this.host=b.slice(0,k),b=b.slice(k),this.parseHost(),this.hostname=this.hostname||"";var P="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!P)for(var O=this.hostname.split(/\./),T=(E=0,O.length);E<T;E++){var R=O[E];if(R&&!R.match(c)){for(var M="",C=0,j=R.length;C<j;C++)R.charCodeAt(C)>127?M+="x":M+=R[C];if(!M.match(c)){var B=O.slice(0,E),N=O.slice(E+1),U=R.match(f);U&&(B.push(U[1]),N.unshift(U[2])),N.length&&(b="/"+N.join(".")+b),this.hostname=B.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=r.toASCII(this.hostname));var L=this.port?":"+this.port:"",D=this.hostname||"";this.host=D+L,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!d[_])for(E=0,T=s.length;E<T;E++){var F=s[E];if(-1!==b.indexOf(F)){var W=encodeURIComponent(F);W===F&&(W=escape(F)),b=b.split(F).join(W)}}var q=b.indexOf("#");-1!==q&&(this.hash=b.substr(q),b=b.slice(0,q));var H=b.indexOf("?");if(-1!==H?(this.search=b.substr(H),this.query=b.substr(H+1),t&&(this.query=v.parse(this.query)),b=b.slice(0,H)):t&&(this.search="",this.query={}),b&&(this.pathname=b),p[_]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){L=this.pathname||"";var z=this.search||"";this.path=L+z}return this.href=this.format(),this},e.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=v.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var a=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),a&&"?"!==a.charAt(0)&&(a="?"+a),t+i+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+n},e.prototype.resolve=function(e){return this.resolveObject(t(e,!1,!0)).format()},e.prototype.resolveObject=function(t){if("string"==typeof t){var r=new e;r.parse(t,!1,!0),t=r}for(var n=new e,i=Object.keys(this),o=0;o<i.length;o++){var a=i[o];n[a]=this[a]}if(n.hash=t.hash,""===t.href)return n.href=n.format(),n;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),u=0;u<s.length;u++){var l=s[u];"protocol"!==l&&(n[l]=t[l])}return p[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(t.protocol&&t.protocol!==n.protocol){if(!p[t.protocol]){for(var c=Object.keys(t),f=0;f<c.length;f++){var d=c[f];n[d]=t[d]}return n.href=n.format(),n}if(n.protocol=t.protocol,t.host||h[t.protocol])n.pathname=t.pathname;else{for(var v=(t.pathname||"").split("/");v.length&&!(t.host=v.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),""!==v[0]&&v.unshift(""),v.length<2&&v.unshift(""),n.pathname=v.join("/")}if(n.search=t.search,n.query=t.query,n.host=t.host||"",n.auth=t.auth,n.hostname=t.hostname||t.host,n.port=t.port,n.pathname||n.search){var y=n.pathname||"",g=n.search||"";n.path=y+g}return n.slashes=n.slashes||t.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),m=t.host||t.pathname&&"/"===t.pathname.charAt(0),w=m||b||n.host&&t.pathname,_=w,S=n.pathname&&n.pathname.split("/")||[],k=(v=t.pathname&&t.pathname.split("/")||[],n.protocol&&!p[n.protocol]);if(k&&(n.hostname="",n.port=null,n.host&&(""===S[0]?S[0]=n.host:S.unshift(n.host)),n.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(""===v[0]?v[0]=t.host:v.unshift(t.host)),t.host=null),w=w&&(""===v[0]||""===S[0])),m)n.host=t.host||""===t.host?t.host:n.host,n.hostname=t.hostname||""===t.hostname?t.hostname:n.hostname,n.search=t.search,n.query=t.query,S=v;else if(v.length)S||(S=[]),S.pop(),S=S.concat(v),n.search=t.search,n.query=t.query;else if(null!=t.search)return k&&(n.host=S.shift(),n.hostname=n.host,(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.hostname=P.shift(),n.host=n.hostname)),n.search=t.search,n.query=t.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 E=S.slice(-1)[0],A=(n.host||t.host||S.length>1)&&("."===E||".."===E)||""===E,x=0,I=S.length;I>=0;I--)"."===(E=S[I])?S.splice(I,1):".."===E?(S.splice(I,1),x++):x&&(S.splice(I,1),x--);if(!w&&!_)for(;x--;x)S.unshift("..");w&&""!==S[0]&&(!S[0]||"/"!==S[0].charAt(0))&&S.unshift(""),A&&"/"!==S.join("/").substr(-1)&&S.push("");var P,O=""===S[0]||S[0]&&"/"===S[0].charAt(0);return k&&(n.hostname=O?"":S.length?S.shift():"",n.host=n.hostname,(P=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=P.shift(),n.hostname=P.shift(),n.host=n.hostname)),(w=w||n.host&&S.length)&&!O&&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=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},e.prototype.parseHost=function(){var e=this.host,t=i.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},Ga.parse=t,Ga.resolve=function(e,r){return t(e,!1,!0).resolve(r)},Ga.resolveObject=function(e,r){return e?t(e,!1,!0).resolveObject(r):r},Ga.format=function(r){return"string"==typeof r&&(r=t(r)),r instanceof e?r.format():e.prototype.format.call(r)},Ga.Url=e,Ga}function Pa(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 as?function(e){for(var t=e.hostname,r=e.pathname,n=0;n<r.length;n++)if("%"===r[n]){var i=r.codePointAt(n+2)||32;if("2"===r[n+1]&&102===i||"5"===r[n+1]&&99===i)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(ss,"\\"),r=decodeURIComponent(r),""!==t)return"\\\\".concat(t).concat(r);var o=32|r.codePointAt(1),a=r[2];if(o<is||o>os||":"!==a)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");for(var t=e.pathname,r=0;r<t.length;r++)if("%"===t[r]){var n=t.codePointAt(r+2)||32;if("2"===t[r+1]&&102===n)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function Oa(e){var t=wa.resolve(e),r=e.charCodeAt(e.length-1);(r===ns||as&&r===rs)&&t[t.length-1]!==wa.sep&&(t+="/");var n=new URL("file://");return t.includes("%")&&(t=t.replace(us,"%25")),!as&&t.includes("\\")&&(t=t.replace(ls,"%5C")),t.includes("\n")&&(t=t.replace(cs,"%0A")),t.includes("\r")&&(t=t.replace(fs,"%0D")),t.includes("\t")&&(t=t.replace(ds,"%09")),n.pathname=t,n}te(ka,{URL:function(){return ts},Url:function(){return Ja},default:function(){return Qa},fileURLToPath:function(){return Pa},format:function(){return $a},parse:function(){return es},pathToFileURL:function(){return Oa},resolve:function(){return Xa},resolveObject:function(){return Za}});var Ta,Ra,Ma,Ca,ja,Ba,Na,Ua,La,Da,Fa,Wa,qa,Ha,Va,za,Ga,Ka,Qa,Ya,Ja,$a,Xa,Za,es,ts,rs,ns,is,os,as,ss,us,ls,cs,fs,ds,hs=Z((function(){ne(),Jt(),Bt(),yi(),ho(),Sa(),_a(),Ta=Object.freeze(Object.create(null)),Ra={},Ma=!1,Ca=("undefined"==typeof globalThis?"undefined":(0,V.default)(globalThis))<"u"?globalThis:("undefined"==typeof self?"undefined":(0,V.default)(self))<"u"?self:e,ja={},Ba=!1,Na={},Ua=!1,La={},Da=!1,Fa={},Wa=!1,qa={},Ha=!1,Va={},za=!1,Ga={},Ka=!1,(Qa=Ia()).parse,Qa.resolve,Qa.resolveObject,Qa.format,Qa.Url,Ya=("undefined"==typeof Deno?"undefined":(0,V.default)(Deno))<"u"?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,Qa.URL=("undefined"==typeof URL?"undefined":(0,V.default)(URL))<"u"?URL:null,Qa.pathToFileURL=Oa,Qa.fileURLToPath=Pa,Ja=Qa.Url,$a=Qa.format,Xa=Qa.resolve,Za=Qa.resolveObject,es=Qa.parse,ts=Qa.URL,rs=92,ns=47,is=97,os=122,as="win32"===Ya,ss=/\//g,us=/%/g,ls=/\\/g,cs=/\n/g,fs=/\r/g,ds=/\t/g})),ps=ee((function(e,t){ne(),Jt(),Bt(),t.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}})),vs=ee((function(e){var t=function(e,t){for(var r=Array(e.length),i=0;i<e.length;i++)"string"==typeof e[i].chunk?r[i]=n.Buffer.from(e[i].chunk,"utf8"):r[i]=e[i].chunk;this._write(n.Buffer.concat(r),"binary",t)};ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=void 0,e.writev=t;var r=Dr(),n=(Yt(),re(Vt)),i=function(e){"use strict";(0,U.default)(n,e);var r=(0,K.default)(n);function n(e,i,o){var a;return(0,E.default)(this,n),a=r.call(this,{objectMode:!0}),(0,j.default)((0,m.default)(a),"socket",void 0),(0,j.default)((0,m.default)(a),"proxy",void 0),(0,j.default)((0,m.default)(a),"isSocketOpen",void 0),(0,j.default)((0,m.default)(a),"writeQueue",void 0),a.proxy=i,a.socket=o,a.writeQueue=[],e.objectMode||(a._writev=t.bind((0,m.default)(a))),a.isSocketOpen=!1,a.proxy.on("data",(function(e){!a.destroyed&&a.readable&&a.push(e)})),(0,W.default)(a)}return(0,C.default)(n,[{key:"_read",value:function(e){this.proxy.read(e)}},{key:"_write",value:function(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}},{key:"_final",value:function(e){this.writeQueue=[],this.proxy.end(e)}},{key:"_destroy",value:function(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}},{key:"socketReady",value:function(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}},{key:"writeToProxy",value:function(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}},{key:"processWriteQueue",value:function(){for(;this.writeQueue.length>0;){var e=this.writeQueue.shift(),t=e.chunk,r=e.encoding,n=e.cb;this.writeToProxy(t,r,n)}}}]),n}(r.Duplex);e.BufferedDuplex=i})),ys=ee((function(e){var t=function(e,t){var r="".concat(e.protocol,"://").concat(e.hostname,":").concat(e.port).concat(e.path);return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r},r=function(e){var t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),!u.default&&!e.forceNativeWebSocket&&"wss"===e.protocol&&f.forEach((function(r){({}).hasOwnProperty.call(e,r)&&!{}.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])})),t};ne(),Jt(),Bt();var n=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 i=(Yt(),re(Vt)),o=n(ps()),a=n(Kr()),s=Dr(),u=n(fi()),l=vs(),c=(0,a.default)("mqttjs:ws"),f=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];e.streamBuilder=function(e,n){c("streamBuilder");var i=r(n);i.hostname=i.hostname||i.host||"localhost";var a=t(i,e),s=function(e,t,r){c("createWebSocket"),c("protocol: ".concat(r.protocolId," ").concat(r.protocolVersion));var n="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return c("creating new Websocket for url: ".concat(t," and protocol: ").concat(n)),r.createWebsocket?r.createWebsocket(t,[n],r):new o.default(t,[n],r.wsOptions)}(0,a,i),u=o.default.createWebSocketStream(s,i.wsOptions);return u.url=a,s.on("close",(function(){u.destroy()})),u},e.browserStreamBuilder=function(e,n){var o=function(){c("WebSocket onOpen"),f instanceof l.BufferedDuplex&&f.socketReady()},a=function(e){c("WebSocket onClose",e),f.end(),f.destroy()},u=function(e){c("WebSocket onError",e);var t=Error("WebSocket error");t.event=e,f.destroy(t)};c("browserStreamBuilder");var f,d=function(e){var t=r(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if(("undefined"==typeof document?"undefined":(0,V.default)(document))>"u")throw Error("Could not determine host. Specify host manually.");var n=new URL(document.URL);t.hostname=n.hostname,t.port||(t.port=Number(n.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(n).browserBufferSize||524288,h=n.browserBufferTimeout||1e3,p=!n.objectMode,v=function(e,r){var n,i="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt",o=t(r,e);return(n=r.createWebsocket?r.createWebsocket(o,[i],r):new WebSocket(o,[i])).binaryType="arraybuffer",n}(e,n),y=function(e,t,r){var n=new s.Transform({objectMode:e.objectMode});return n._write=t,n._flush=function(e){v.close(),e()},n}(n,(function e(t,r,n){if(v.bufferedAmount>d)setTimeout(e,h,t,r,n);else{p&&"string"==typeof t&&(t=i.Buffer.from(t,"utf8"));try{v.send(t)}catch(e){return n(e)}n()}}));n.objectMode||(y._writev=l.writev.bind(y)),y.on("close",(function(){v.close()}));var g=(0,V.default)(v.addEventListener)<"u";function b(e){return m.apply(this,arguments)}function m(){return m=(0,S.default)((function(e){var t,r,n,o,a;return(0,Q.__generator)(this,(function(s){switch(s.label){case 0:return y&&y.readable&&y.writable?(t=e.data)instanceof ArrayBuffer?(r=i.Buffer.from(t),[3,5]):[3,1]:[2];case 1:return t instanceof Blob?(a=(o=i.Buffer).from,[4,new Response(t).arrayBuffer()]):[3,3];case 2:return n=a.apply(o,[s.sent()]),[3,4];case 3:n=i.Buffer.from(t,"utf8"),s.label=4;case 4:r=n,s.label=5;case 5:return t=r,y.push(t),[2]}}))})),m.apply(this,arguments)}return v.readyState===v.OPEN?(f=y).socket=v:(f=new l.BufferedDuplex(n,y,v),g?v.addEventListener("open",o):v.onopen=o),g?(v.addEventListener("close",a),v.addEventListener("error",u),v.addEventListener("message",b)):(v.onclose=a,v.onerror=u,v.onmessage=b),f}})),gs={};function bs(){throw Error("Node.js net module is not supported by JSPM core outside of Node.js")}te(gs,{Server:function(){return bs},Socket:function(){return bs},Stream:function(){return bs},_createServerHandle:function(){return bs},_normalizeArgs:function(){return bs},_setSimultaneousAccepts:function(){return bs},connect:function(){return bs},createConnection:function(){return bs},createServer:function(){return bs},default:function(){return ms},isIP:function(){return bs},isIPv4:function(){return bs},isIPv6:function(){return bs}});var ms,ws=Z((function(){ne(),Jt(),Bt(),ms={_createServerHandle:bs,_normalizeArgs:bs,_setSimultaneousAccepts:bs,connect:bs,createConnection:bs,createServer:bs,isIP:bs,isIPv4:bs,isIPv6:bs,Server:bs,Socket:bs,Stream:bs}})),_s=ee((function(e,t){ne(),Jt(),Bt(),t.exports={}})),Ss=ee((function(e){ne(),Jt(),Bt();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((ws(),re(gs))),n=t(Kr()),i=t(_s()),o=(0,n.default)("mqttjs:tcp");e.default=function(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});var n=t.port,a=t.path,s=t.hostname;return o("port %d and host %s",n,s),r.default.createConnection({port:n,host:s,path:a})}})),ks={};te(ks,{default:function(){return Es}});var Es,As,xs,Is,Ps,Os,Ts,Rs,Ms,Cs,js,Bs,Ns=Z((function(){ne(),Jt(),Bt(),Es={}})),Us=ee((function(e){ne(),Jt(),Bt();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r,n=(Ns(),re(ks)),i=t((ws(),re(gs))),o=t(Kr()),a=t(_s()),s=(0,o.default)("mqttjs:tls");r=function(e,t){var r=function(r){t.rejectUnauthorized&&e.emit("error",r),o.end()};t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===i.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);var o=function(e){var t=e.host,r=e.port,i=e.socksProxy,o=(0,F.default)(e,["host","port","socksProxy"]);if(void 0!==i){var s=(0,a.default)(t,r,i,{timeout:e.socksTimeout});return(0,n.connect)((0,D.default)((0,L.default)({},o),{socket:s}))}return(0,n.connect)(e)}(t);return o.on("secureConnect",(function(){t.rejectUnauthorized&&!o.authorized?o.emit("error",Error("TLS not authorized")):o.removeListener("error",r)})),o.on("error",r),o},e.default=r})),Ls=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(Yt(),re(Vt)),o=Dr(),a=vs();e.default=function(e,s){if(s.hostname=s.hostname||s.host,!s.hostname)throw Error("Could not determine host. Specify host manually.");var u="MQIsdp"===s.protocolId&&3===s.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(s);var l,c=function(e,t){var r="wxs"===e.protocol?"wss":"ws",n="".concat(r,"://").concat(e.hostname).concat(e.path);return e.port&&80!==e.port&&443!==e.port&&(n="".concat(r,"://").concat(e.hostname,":").concat(e.port).concat(e.path)),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(s,e);t=wx.connectSocket({url:c,protocols:[u]}),(l=new o.Transform)._write=function(e,r,n){t.send({data:e.buffer,success:function(){n()},fail:function(e){n(Error(e))}})},l._flush=function(e){t.close({success:function(){e()}})},r=l,(n=new a.BufferedDuplex(s,r,t))._destroy=function(e,r){t.close({success:function(){r&&r(e)}})};var f=n.destroy;return n.destroy=function(e,r){return n.destroy=f,setTimeout((function(){t.close({fail:function(){n._destroy(e,r)}})}),0),n},t.onOpen((function(){n.socketReady()})),t.onMessage((function(e){var t=e.data;t=t instanceof ArrayBuffer?i.Buffer.from(t):i.Buffer.from(t,"utf8"),r.push(t)})),t.onClose((function(){n.emit("close"),n.end(),n.destroy()})),t.onError((function(e){var t=Error(e.errMsg);n.destroy(t)})),n}})),Ds=ee((function(e){ne(),Jt(),Bt(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,i=(Yt(),re(Vt)),o=Dr(),a=vs(),s=!1;e.default=function(e,u){if(u.hostname=u.hostname||u.host,!u.hostname)throw Error("Could not determine host. Specify host manually.");var l="MQIsdp"===u.protocolId&&3===u.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(u);var c,f=function(e,t){var r="alis"===e.protocol?"wss":"ws",n="".concat(r,"://").concat(e.hostname).concat(e.path);return e.port&&80!==e.port&&443!==e.port&&(n="".concat(r,"://").concat(e.hostname,":").concat(e.port).concat(e.path)),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(u,e);return(t=u.my).connectSocket({url:f,protocols:l}),(c=new o.Transform)._write=function(e,r,n){t.sendSocketMessage({data:e.buffer,success:function(){n()},fail:function(){n(Error())}})},c._flush=function(e){t.closeSocket({success:function(){e()}})},r=c,n=new a.BufferedDuplex(u,r,t),s||(s=!0,t.onSocketOpen((function(){n.socketReady()})),t.onSocketMessage((function(e){if("string"==typeof e.data){var t=i.Buffer.from(e.data,"base64");r.push(t)}else{var n=new FileReader;n.addEventListener("load",(function(){n.result instanceof ArrayBuffer?r.push(i.Buffer.from(n.result)):r.push(i.Buffer.from(n.result,"utf-8"))})),n.readAsArrayBuffer(e.data)}})),t.onSocketClose((function(){n.end(),n.destroy()})),t.onSocketError((function(e){n.destroy(e)}))),n}})),Fs=ee((function(e){var t=function(e,t){var r,n,l;if(s("connecting to an MQTT broker..."),"object"==typeof e&&!t&&(t=e,e=""),t=t||{},e&&"string"==typeof e){var c=i.default.parse(e,!0),f={};if(null!=c.port&&(f.port=Number(c.port)),f.host=c.hostname,f.query=c.query,f.auth=c.auth,f.protocol=c.protocol,f.path=c.path,!(t=(0,L.default)({},f,t)).protocol)throw Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(t.unixSocket=t.unixSocket||(null===(r=t.protocol)||void 0===r?void 0:r.includes("+unix")),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):!(null===(n=t.protocol)||void 0===n?void 0:n.startsWith("ws"))&&!(null===(l=t.protocol)||void 0===l?void 0:l.startsWith("wx"))&&delete t.path,function(e){var t;if(e.auth)if(t=e.auth.match(/^(.+):(.+)$/)){var r=(0,q.default)(t,3),n=r[1],i=r[2];e.username=n,e.password=i}else e.username=e.auth}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),a.default||t.unixSocket?t.socksProxy=void 0:void 0===t.socksProxy&&(void 0===ie?"undefined":(0,V.default)(ie))<"u"&&(t.socksProxy=ie.env.MQTTJS_SOCKS_PROXY),t.cert&&t.key){if(!t.protocol)throw 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 Error('Unknown protocol for secure connection: "'.concat(t.protocol,'"!'))}}if(u||(u={},a.default||t.forceNativeWebSocket?(u.ws=ys().browserStreamBuilder,u.wss=ys().browserStreamBuilder,u.wx=Ls().default,u.wxs=Ls().default,u.ali=Ds().default,u.alis=Ds().default):(u.ws=ys().streamBuilder,u.wss=ys().streamBuilder,u.mqtt=Ss().default,u.tcp=Ss().default,u.ssl=Us().default,u.tls=u.ssl,u.mqtts=Us().default)),!u[t.protocol]){var d=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((function(e,t){return(!d||t%2!=0)&&"function"==typeof u[e]}))[0]}if(!1===t.clean&&!t.clientId)throw Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);var h=new o.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),u[t.protocol](e,t)}),t);return h.on("error",(function(){})),h};ne(),Jt(),Bt();var r=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=function(e,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return new Promise((function(i,o){var a=function(){Object.keys(u).forEach((function(e){s.off(e,u[e])}))},s=t(e,r),u={connect:function(){a(),i(s)},end:function(){a(),i(s)},error:function(e){a(),s.end(),o(e)}};!1===n&&(u.close=function(){u.error(Error("Couldn't connect to server"))}),Object.keys(u).forEach((function(e){s.on(e,u[e])}))}))};var n=r(Kr()),i=r((hs(),re(ka))),o=r(pi()),a=r(fi());"function"!=typeof(null==ie?void 0:ie.nextTick)&&(ie.nextTick=setImmediate);var s=(0,n.default)("mqttjs"),u=null;e.default=t})),Ws=ee((function(e){ne(),Jt(),Bt();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)({}).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),a=0;a<o.length;a++)"default"!==o[a]&&r(i,e,o[a]);return n(i,e),i}),o=e&&e.__exportStar||function(e,t){for(var n in e)"default"!==n&&!{}.hasOwnProperty.call(t,n)&&r(t,e,n)},a=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 s=a(pi());e.MqttClient=s.default;var u=a(Un());e.DefaultMessageIdProvider=u.default;var l=a(vi());e.UniqueMessageIdProvider=l.default;var c=a(nn());e.Store=c.default;var f=i(Fs());e.connect=f.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return f.connectAsync}});var d=a(hi());e.KeepaliveManager=d.default,e.Client=s.default,o(pi(),e),o(sn(),e);var h=un();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return h.ReasonCodes}})})),qs=ee((function(e){ne(),Jt(),Bt();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)({}).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),a=0;a<o.length;a++)"default"!==o[a]&&r(i,e,o[a]);return n(i,e),i}),o=e&&e.__exportStar||function(e,t){for(var n in e)"default"!==n&&!{}.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0});var a=i(Ws());e.default=a,o(Ws(),e)})),Hs=qs(),Vs=Math.floor,zs=Math.random,Gs="Trystero",Ks=function(e,t){return Array(e).fill().map(t)},Qs=Ks(20,(function(){return"0123456789AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz"[Vs(62*zs())]})).join(""),Ys=Promise.all.bind(Promise),Js="undefined"!=typeof window,$s=Object.entries,Xs=Object.fromEntries,Zs=Object.keys,eu=function(){},tu=function(e){return Error("".concat(Gs,": ").concat(e))},ru=new TextEncoder,nu=new TextDecoder,iu=function(e){return ru.encode(e)},ou=function(e){return nu.decode(e)},au=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.join("@")},su=JSON.stringify,uu=JSON.parse,lu=null,cu=null,fu=function(){lu||(lu=new Promise((function(e){cu=e})).finally((function(){cu=null,lu=null})))},du=function(){return null==cu?void 0:cu()},hu="AES-GCM",pu={},vu=(As=(0,S.default)((function(e){var t,r;return(0,Q.__generator)(this,(function(n){switch(n.label){case 0:return(t=(o=pu)[a=e])?[3,2]:(r=Array.from,[4,function(){var e=(0,S.default)((function(e,t){var r;return(0,Q.__generator)(this,(function(n){switch(n.label){case 0:return r=Uint8Array.bind,[4,crypto.subtle.digest(e,iu(t))];case 1:return[2,new(r.apply(Uint8Array,[void 0,n.sent()]))]}}))}));return function(t,r){return e.apply(this,arguments)}}()("SHA-1",e)]);case 1:t=o[a]=r.apply(Array,[n.sent()]).map((function(e){return e.toString(36)})).join(""),n.label=2;case 2:return[2,t]}}))})),function(e){return As.apply(this,arguments)}),yu=function(){var e=(0,S.default)((function(e,t){var r,n,i,o,a,s;return(0,Q.__generator)(this,(function(u){switch(u.label){case 0:return r=crypto.getRandomValues(new Uint8Array(16)),i=r.join(",")+"$",a=(o=crypto.subtle).encrypt,s=[{name:hu,iv:r}],[4,e];case 1:return[4,a.apply(o,s.concat([u.sent(),iu(t)]))];case 2:return[2,i+(n=u.sent(),btoa(String.fromCharCode.apply(null,new Uint8Array(n))))]}}))}));return function(t,r){return e.apply(this,arguments)}}(),gu=function(){var e=(0,S.default)((function(e,t){var r,n,i,o,a,s;return(0,Q.__generator)(this,(function(u){switch(u.label){case 0:return r=(0,q.default)(t.split("$"),2),n=r[0],i=r[1],a=(o=crypto.subtle).decrypt,s=[{name:hu,iv:new Uint8Array(n.split(","))}],[4,e];case 1:return[4,a.apply(o,s.concat([u.sent(),function(e){var t=atob(e);return new Uint8Array(t.length).map((function(e,r){return t.charCodeAt(r)})).buffer}(i)]))];case 2:return[2,ou.apply(void 0,[u.sent()])]}}))}));return function(t,r){return e.apply(this,arguments)}}(),bu="icegatheringstatechange",mu="offer",wu=function(e,t){var r=t.rtcConfig,n=t.rtcPolyfill,i=t.turnConfig,o=new(n||RTCPeerConnection)((0,L.default)({iceServers:_u.concat(i||[])},r)),a={},s=!1,u=!1,l=null,c=function(e){e.binaryType="arraybuffer",e.bufferedAmountLowThreshold=65535,e.onmessage=function(e){var t;return null===(t=a.data)||void 0===t?void 0:t.call(a,e.data)},e.onopen=function(){var e;return null===(e=a.connect)||void 0===e?void 0:e.call(a)},e.onclose=function(){var e;return null===(e=a.close)||void 0===e?void 0:e.call(a)},e.onerror=function(e){var t;return null===(t=a.error)||void 0===t?void 0:t.call(a,e)}},f=function(e){return Promise.race([new Promise((function(t){var r=function(){"complete"===e.iceGatheringState&&(e.removeEventListener(bu,r),t())};e.addEventListener(bu,r),r()})),new Promise((function(e){return setTimeout(e,5e3)}))]).then((function(){return{type:e.localDescription.type,sdp:e.localDescription.sdp.replace(/a=ice-options:trickle\s\n/g,"")}}))};return e?(l=o.createDataChannel("data"),c(l)):o.ondatachannel=function(e){var t=e.channel;l=t,c(t)},o.onnegotiationneeded=(0,S.default)((function(){var e,t,r,n;return(0,Q.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,4,5]),s=!0,[4,o.setLocalDescription()];case 1:return i.sent(),[4,f(o)];case 2:return t=i.sent(),null===(e=a.signal)||void 0===e||e.call(a,t),[3,5];case 3:return r=i.sent(),null===(n=a.error)||void 0===n||n.call(a,r),[3,5];case 4:return s=!1,[7];case 5:return[2]}}))})),o.onconnectionstatechange=function(){var e;["disconnected","failed","closed"].includes(o.connectionState)&&(null===(e=a.close)||void 0===e||e.call(a))},o.ontrack=function(e){var t,r;null===(t=a.track)||void 0===t||t.call(a,e.track,e.streams[0]),null===(r=a.stream)||void 0===r||r.call(a,e.streams[0])},o.onremovestream=function(e){var t;return null===(t=a.stream)||void 0===t?void 0:t.call(a,e.stream)},e&&(o.canTrickleIceCandidates||o.onnegotiationneeded()),{created:Date.now(),connection:o,get channel(){return l},get isDead(){return"closed"===o.connectionState},signal:function(t){return(0,S.default)((function(){var r,n,i,c,d;return(0,Q.__generator)(this,(function(h){switch(h.label){case 0:if("open"===(null==l?void 0:l.readyState)&&!(null===(r=t.sdp)||void 0===r?void 0:r.includes("a=rtpmap")))return[3,14];h.label=1;case 1:return h.trys.push([1,13,,14]),t.type!==mu?[3,8]:s||"stable"!==o.signalingState&&!u?e?[2]:[4,Ys([o.setLocalDescription({type:"rollback"}),o.setRemoteDescription(t)])]:[3,3];case 2:return h.sent(),[3,5];case 3:return[4,o.setRemoteDescription(t)];case 4:h.sent(),h.label=5;case 5:return[4,o.setLocalDescription()];case 6:return h.sent(),[4,f(o)];case 7:return i=h.sent(),[2,(null===(n=a.signal)||void 0===n||n.call(a,i),i)];case 8:if("answer"!==t.type)return[3,12];u=!0,h.label=9;case 9:return h.trys.push([9,,11,12]),[4,o.setRemoteDescription(t)];case 10:return h.sent(),[3,12];case 11:return u=!1,[7];case 12:return[3,14];case 13:return c=h.sent(),null===(d=a.error)||void 0===d||d.call(a,c),[3,14];case 14:return[2]}}))}))()},sendData:function(e){return l.send(e)},destroy:function(){null==l||l.close(),o.close(),s=!1,u=!1},setHandlers:function(e){return Object.assign(a,e)},offerPromise:e?new Promise((function(e){return a.signal=function(t){t.type===mu&&e(t)}})):Promise.resolve(),addStream:function(e){return e.getTracks().forEach((function(t){return o.addTrack(t,e)}))},removeStream:function(e){return o.getSenders().filter((function(t){return e.getTracks().includes(t.track)})).forEach((function(e){return o.removeTrack(e)}))},addTrack:function(e,t){return o.addTrack(e,t)},removeTrack:function(e){var t=o.getSenders().find((function(t){return t.track===e}));t&&o.removeTrack(t)},replaceTrack:function(e,t){var r=o.getSenders().find((function(t){return t.track===e}));if(r)return r.replaceTrack(t)}}},_u=(0,H.default)(Ks(3,(function(e,t){return"stun:stun".concat(t||"",".l.google.com:19302")}))).concat(["stun:stun.cloudflare.com:3478"]).map((function(e){return{urls:e}})),Su=Object.getPrototypeOf(Uint8Array),ku=16369,Eu=255,Au="bufferedamountlow",xu=function(e){return"@_"+e},Iu={},Pu={},Ou=function(e){var t=e.options;return t.host+t.path},Tu=(xs={init:function(e){return function(e,t,r){return(e.relayUrls||t).slice(0,e.relayUrls?e.relayUrls.length:e.relayRedundancy||4)}(e,Mu).map((function(e){var t=Hs.connect(e),r=Ou(t);return Iu[r]=t.stream.socket,Pu[r]={},t.on("message",(function(e,t){var n,i;return null===(i=(n=Pu[r])[e])||void 0===i?void 0:i.call(n,e,t.toString())})).on("error",(function(e){return console.error(e)})),new Promise((function(e){return t.on("connect",(function(){return e(t)}))}))}))},subscribe:function(e,t,r,n){var i=Ou(e);return Pu[i][t]=Pu[i][r]=function(t,r){return n(t,r,e.publish.bind(e))},e.subscribe(t),e.subscribe(r),function(){e.unsubscribe(t),e.unsubscribe(r),delete Pu[i][t],delete Pu[i][r]}},announce:function(e,t){return e.publish(t,su({peerId:Qs}))}},Rs=xs.init,Ms=xs.subscribe,Cs=xs.announce,js={},Bs=!1,function(e,t,r){var n,i,o=e.appId;if(null===(i=js[o])||void 0===i?void 0:i[t])return js[o][t];var a={},m={},w=au(Gs,o,t),_=vu(w),k=vu(au(w,Qs)),E=function(){var e=(0,S.default)((function(e,t,r){var n,i,o;return(0,Q.__generator)(this,(function(a){switch(a.label){case 0:return i=(n=crypto.subtle).importKey,o=["raw"],[4,crypto.subtle.digest({name:"SHA-256"},iu("".concat(e,":").concat(t,":").concat(r)))];case 1:return[2,i.apply(n,o.concat([a.sent(),{name:hu},!1,["encrypt","decrypt"]]))]}}))}));return function(t,r,n){return e.apply(this,arguments)}}()(e.password||"",o,t),A=function(e){return function(){var t=(0,S.default)((function(t){var r;return(0,Q.__generator)(this,(function(n){switch(n.label){case 0:return r={type:t.type},[4,e(E,t.sdp)];case 1:return[2,(r.sdp=n.sent(),r)]}}))}));return function(e){return t.apply(this,arguments)}}()},x=A(gu),I=A(yu),P=function(){return wu(!0,e)},O=function(e,t,r){var n;m[t]?m[t]!==e&&e.destroy():(m[t]=e,F(e,t),null===(n=a[t])||void 0===n||n.forEach((function(e,t){t!==r&&e.destroy()})),delete a[t])},T=function(e,t){m[t]===e&&delete m[t]},R=function(e){return(n=Ps).push.apply(n,(0,H.default)(Ks(e,P))),Ys(Ps.splice(0,e).map((function(e){return e.offerPromise.then(I).then((function(t){return{peer:e,offer:t}}))})))},M=function(n,i){return null==r?void 0:r({error:"incorrect password (".concat(e.password,") when decrypting ").concat(i),appId:o,peerId:n,roomId:t})},C=function(t){return function(){var r=(0,S.default)((function(r,n,i){var o,s,u,l,c,f,d,h,p,g,b,S,E,A,P,C,j,N,U,L,D,F,W,H,V,z;return(0,Q.__generator)(this,(function(G){switch(G.label){case 0:return[4,Ys([_,k])];case 1:if(o=q.default.apply(void 0,[G.sent(),2]),s=o[0],u=o[1],r!==s&&r!==u)return[2];if(l="string"==typeof n?uu(n):n,c=l.peerId,f=l.offer,d=l.answer,h=l.peer,c===Qs||m[c])return[3,16];if(c&&!f&&!d)return[3,14];if(!f)return[3,8];if((null===(p=a[c])||void 0===p?void 0:p[t])&&Qs>c)return[2];(g=wu(!1,e)).setHandlers({connect:function(){return O(g,c,t)},close:function(){return T(g,c)}}),G.label=2;case 2:return G.trys.push([2,4,,5]),[4,x(f)];case 3:return b=G.sent(),[3,5];case 4:return G.sent(),[2,void M(c,"offer")];case 5:return g.isDead?[2]:[4,Ys([vu(au(w,c)),g.signal(b)])];case 6:return S=q.default.apply(void 0,[G.sent(),2]),E=S[0],A=S[1],P=[E],C={peerId:Qs},[4,I(A)];case 7:return i.apply(void 0,P.concat([su.apply(void 0,[(C.answer=G.sent(),C)])])),[3,13];case 8:if(!d)return[3,13];G.label=9;case 9:return G.trys.push([9,11,,12]),[4,x(d)];case 10:return j=G.sent(),[3,12];case 11:return G.sent(),[2,void M(c,"answer")];case 12:h?(h.setHandlers({connect:function(){return O(h,c,t)},close:function(){return T(h,c)}}),h.signal(j)):(U=null===(N=a[c])||void 0===N?void 0:N[t])&&!U.isDead&&U.signal(j),G.label=13;case 13:return[3,16];case 14:return(null===(L=a[c])||void 0===L?void 0:L[t])?[2]:[4,Ys([R(1),vu(au(w,c))])];case 15:D=q.default.apply(void 0,[G.sent(),2]),F=(0,q.default)(D[0],1),W=F[0],H=W.peer,V=W.offer,z=D[1],(v=a)[y=c]||(v[y]=[]),a[c][t]=H,setTimeout((function(){return function(e,t){var r;if(!m[e]){var n=null===(r=a[e])||void 0===r?void 0:r[t];n&&(delete a[e][t],n.destroy())}}(c,t)}),.9*B[t]),H.setHandlers({connect:function(){return O(H,c,t)},close:function(){return T(H,c)}}),i(z,su({peerId:Qs,offer:V})),G.label=16;case 16:return[2]}}))}));return function(e,t,n){return r.apply(this,arguments)}}()};if(!e)throw tu("requires a config map as the first argument");if(!o&&!e.firebaseApp)throw tu("config map is missing appId field");if(!t)throw tu("roomId argument required");if(!Bs){var j=Rs(e);Ps=Ks(20,P),Is=Array.isArray(j)?j:[j],Bs=!0,Os=setInterval((function(){return Ps=Ps.filter((function(e){var t=Date.now()-e.created<57333;return t||e.destroy(),t}))}),59052.99),Ts=e.manualRelayReconnection?eu:function(){if(Js){var e=new AbortController;return addEventListener("online",du,{signal:e.signal}),addEventListener("offline",fu,{signal:e.signal}),function(){return e.abort()}}return eu}()}var B=Is.map((function(){return 5333})),N=[],U=Is.map(function(){var e=(0,S.default)((function(e,t){var r;return(0,Q.__generator)(this,(function(n){switch(n.label){case 0:return[4,e];case 1:return r=[n.sent()],[4,_];case 2:return r=r.concat(n.sent()),[4,k];case 3:return[2,Ms.apply(void 0,r.concat([n.sent(),C(t),R]))]}}))}));return function(t,r){return e.apply(this,arguments)}}());Ys([_,k]).then((function(e){var t=(0,q.default)(e,2),r=t[0],n=t[1],i=function(){var e=(0,S.default)((function(e,t){var o;return(0,Q.__generator)(this,(function(a){switch(a.label){case 0:return[4,Cs(e,r,n)];case 1:return"number"==typeof(o=a.sent())&&(B[t]=o),N[t]=setTimeout((function(){return i(e,t)}),B[t]),[2]}}))}));return function(t,r){return e.apply(this,arguments)}}();U.forEach(function(){var e=(0,S.default)((function(e,t){return(0,Q.__generator)(this,(function(r){switch(r.label){case 0:return[4,e];case 1:return r.sent(),[4,Is[t]];case 2:return i.apply(void 0,[r.sent(),t]),[2]}}))}));return function(t,r){return e.apply(this,arguments)}}())}));var F=eu;return(g=js)[b=o]||(g[b]={}),js[o][t]=function(e,t,r){var n={},i={},o={},a={},v={},y={},g={},b={onPeerJoin:eu,onPeerLeave:eu,onPeerStream:eu,onPeerTrack:eu},m=function(e,t){return(e?Array.isArray(e)?e:[e]:Zs(n)).flatMap((function(e){var r=n[e];return r?t(e,r):(console.warn("".concat(Gs,": no peer with id ").concat(e," found")),[])}))},w=function(e){n[e]&&(n[e].destroy(),delete n[e],delete a[e],delete v[e],b.onPeerLeave(e),t(e))},_=function(e){if(i[e])return o[e];if(!e)throw tu("action type argument is required");var t=iu(e);if(t.byteLength>12)throw tu('action type string "'.concat(e,'" (').concat(t.byteLength,"b) exceeds byte limit (12). Hint: choose a shorter name."));var r=new Uint8Array(12);r.set(t);var a=0;return i[e]={onComplete:eu,onProgress:eu,setOnComplete:function(t){return i[e]=(0,D.default)((0,L.default)({},i[e]),{onComplete:t})},setOnProgress:function(t){return i[e]=(0,D.default)((0,L.default)({},i[e]),{onProgress:t})},send:function(e,t,i,o){return(0,S.default)((function(){var s,u,l,c,f,d,h,p,v,y,g;return(0,Q.__generator)(this,(function(b){switch(b.label){case 0:if(i&&"object"!=typeof i)throw tu("action meta argument must be an object");if("undefined"===(s=void 0===e?"undefined":(0,V.default)(e)))throw tu("action data cannot be undefined");if(u="string"!==s,l=e instanceof Blob,c=l||e instanceof ArrayBuffer||e instanceof Su,i&&!c)throw tu("action meta argument can only be used with binary data");return c?(y=Uint8Array.bind,l?[4,e.arrayBuffer()]:[3,2]):[3,4];case 1:return g=b.sent(),[3,3];case 2:g=e,b.label=3;case 3:return v=new(y.apply(Uint8Array,[void 0,g])),[3,5];case 4:v=iu(u?su(e):e),b.label=5;case 5:return f=v,d=i?iu(su(i)):null,h=Math.ceil(f.byteLength/ku)+(i?1:0)||1,p=Ks(h,(function(e,t){var n=t===h-1,o=i&&0===t,s=new Uint8Array(15+(o?d.byteLength:n?f.byteLength-ku*(h-(i?2:1)):ku));return s.set(r),s.set([a],12),s.set([n|o<<1|c<<2|u<<3],13),s.set([Math.round((t+1)/h*Eu)],14),s.set(i?o?d:f.subarray((t-1)*ku,t*ku):f.subarray(t*ku,(t+1)*ku),15),s})),[2,(a=a+1&Eu,Ys(m(t,function(){var e=(0,S.default)((function(e,t){var r,a,s;return(0,Q.__generator)(this,(function(u){switch(u.label){case 0:r=t.channel,a=0,u.label=1;case 1:return a<h?(s=p[a],r.bufferedAmount>r.bufferedAmountLowThreshold?[4,new Promise((function(e){var t=function(){r.removeEventListener(Au,t),e()};r.addEventListener(Au,t)}))]:[3,3]):[3,5];case 2:u.sent(),u.label=3;case 3:if(!n[e])return[3,5];t.sendData(s),a++,null==o||o(s[14]/Eu,e,i),u.label=4;case 4:return[3,1];case 5:return[2]}}))}));return function(t,r){return e.apply(this,arguments)}}())))]}}))}))()}},(s=o)[u=e]||(s[u]=[i[e].send,i[e].setOnComplete,i[e].setOnProgress])},k=function(){var e=(0,S.default)((function(){return(0,Q.__generator)(this,(function(e){switch(e.label){case 0:return[4,H("")];case 1:return e.sent(),[4,new Promise((function(e){return setTimeout(e,99)}))];case 2:return e.sent(),$s(n).forEach((function(e){var t=(0,q.default)(e,2),r=t[0];t[1].destroy(),delete n[r]})),r(),[2]}}))}));return function(){return e.apply(this,arguments)}}(),E=(0,q.default)(_(xu("ping")),2),A=E[0],x=E[1],I=(0,q.default)(_(xu("pong")),2),P=I[0],O=I[1],T=(0,q.default)(_(xu("signal")),2),R=T[0],M=T[1],C=(0,q.default)(_(xu("stream")),2),j=C[0],B=C[1],N=(0,q.default)(_(xu("track")),2),U=N[0],F=N[1],W=(0,q.default)(_(xu("leave")),2),H=W[0],z=W[1];return e((function(e,t){n[t]||(n[t]=e,e.setHandlers({data:function(e){return function(e,t){var r=new Uint8Array(t),n=ou(r.subarray(0,12)).replaceAll("\0",""),o=(0,q.default)(r.subarray(12,13),1)[0],s=(0,q.default)(r.subarray(13,14),1)[0],u=(0,q.default)(r.subarray(14,15),1)[0],v=r.subarray(15),y=!!(1&s),g=!!(2&s),b=!!(4&s),m=!!(8&s);if(i[n]){(l=a)[c=e]||(l[c]={}),(f=a[e])[d=n]||(f[d]={});var w=(h=a[e][n])[p=o]||(h[p]={chunks:[]});if(g?w.meta=uu(ou(v)):w.chunks.push(v),i[n].onProgress(u/Eu,e,w.meta),y){var _=new Uint8Array(w.chunks.reduce((function(e,t){return e+t.byteLength}),0));if(w.chunks.reduce((function(e,t){return _.set(t,e),e+t.byteLength}),0),delete a[e][n][o],b)i[n].onComplete(_,e,w.meta);else{var S=ou(_);i[n].onComplete(m?uu(S):S,e)}}}else console.warn("".concat(Gs,": received message with unregistered type (").concat(n,")"))}(t,e)},stream:function(e){b.onPeerStream(e,t,y[t]),delete y[t]},track:function(e,r){b.onPeerTrack(e,r,t,g[t]),delete g[t]},signal:function(e){return R(e,t)},close:function(){return w(t)},error:function(e){console.error(e),w(t)}}),b.onPeerJoin(t))})),x((function(e,t){return P("",t)})),O((function(e,t){var r;null===(r=v[t])||void 0===r||r.call(v),delete v[t]})),M((function(e,t){var r;return null===(r=n[t])||void 0===r?void 0:r.signal(e)})),B((function(e,t){return y[t]=e})),F((function(e,t){return g[t]=e})),z((function(e,t){return w(t)})),Js&&addEventListener("beforeunload",k),{makeAction:_,leave:k,ping:function(e){return(0,S.default)((function(){var t;return(0,Q.__generator)(this,(function(r){switch(r.label){case 0:if(!e)throw tu("ping() must be called with target peer ID");return t=Date.now(),A("",e),[4,new Promise((function(t){return v[e]=t}))];case 1:return[2,(r.sent(),Date.now()-t)]}}))}))()},getPeers:function(){return Xs($s(n).map((function(e){var t=(0,q.default)(e,2);return[t[0],t[1].connection]})))},addStream:function(e,t,r){return m(t,function(){var t=(0,S.default)((function(t,n){return(0,Q.__generator)(this,(function(i){switch(i.label){case 0:return r?[4,j(r,t)]:[3,2];case 1:i.sent(),i.label=2;case 2:return n.addStream(e),[2]}}))}));return function(e,r){return t.apply(this,arguments)}}())},removeStream:function(e,t){return m(t,(function(t,r){return r.removeStream(e)}))},addTrack:function(e,t,r,n){return m(r,function(){var r=(0,S.default)((function(r,i){return(0,Q.__generator)(this,(function(o){switch(o.label){case 0:return n?[4,U(n,r)]:[3,2];case 1:o.sent(),o.label=2;case 2:return i.addTrack(e,t),[2]}}))}));return function(e,t){return r.apply(this,arguments)}}())},removeTrack:function(e,t){return m(t,(function(t,r){return r.removeTrack(e)}))},replaceTrack:function(e,t,r,n){return m(r,function(){var r=(0,S.default)((function(r,i){return(0,Q.__generator)(this,(function(o){switch(o.label){case 0:return n?[4,U(n,r)]:[3,2];case 1:o.sent(),o.label=2;case 2:return i.replaceTrack(e,t),[2]}}))}));return function(e,t){return r.apply(this,arguments)}}())},onPeerJoin:function(e){return b.onPeerJoin=e},onPeerLeave:function(e){return b.onPeerLeave=e},onPeerStream:function(e){return b.onPeerStream=e},onPeerTrack:function(e){return b.onPeerTrack=e}}}((function(e){return F=e}),(function(e){return delete m[e]}),(function(){delete js[o][t],N.forEach(clearTimeout),U.forEach(function(){var e=(0,S.default)((function(e){return(0,Q.__generator)(this,(function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()()]}}))}));return function(t){return e.apply(this,arguments)}}()),clearInterval(Os),Ts(),Bs=!1}))}),Ru=function(){return(0,L.default)({},Iu)},Mu=["test.mosquitto.org:8081/mqtt","broker.emqx.io:8084/mqtt","broker.hivemq.com:8884/mqtt"].map((function(e){return"wss://"+e}))})),r.register("1PH9R",(function(e,r){function n(e,t){var r={},n=!1;function i(r,i){return n=!0,i=new Promise((function(t){t(e[r](i))})),{done:!1,value:t(i)}}return"function"==typeof Symbol&&Symbol.iterator&&(r[Symbol.iterator]=function(){return this}),r.next=function(e){return n?(n=!1,e):i("next",e)},"function"==typeof e.throw&&(r.throw=function(e){if(n)throw n=!1,e;return i("throw",e)}),"function"==typeof e.return&&(r.return=function(e){return i("return",e)}),r}t(e.exports,"default",(function(){return n}))})),r.register("3u2tY",(function(e,r){function n(e){var t,r,n,o=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);o--;){if(r&&null!=(t=e[r]))return t.call(e);if(n&&null!=(t=e[n]))return new i(t.call(e));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function i(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return i=function(e){this.s=e,this.n=e.next},i.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new i(e)}t(e.exports,"default",(function(){return n}))})),r.register("9yQwa",(function(e,n){t(e.exports,"default",(function(){return o}));var i=r("kRxx3");function o(e){return new(0,i.default)(e)}})),r.register("kRxx3",(function(e,r){function n(e){this.wrapped=e}t(e.exports,"default",(function(){return n}))})),r.register("8qpTe",(function(e,n){t(e.exports,"default",(function(){return a}));var i=r("k7SOi"),o=r("laD7J");function a(e,t){var r=(0,i.default)(e,t,"get");return(0,o.default)(e,r)}})),r.register("k7SOi",(function(e,r){function n(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}t(e.exports,"default",(function(){return n}))})),r.register("laD7J",(function(e,r){function n(e,t){return t.get?t.get.call(e):t.value}t(e.exports,"default",(function(){return n}))})),r.register("gwSkA",(function(e,n){t(e.exports,"default",(function(){return o}));var i=r("hv1Iw");function o(e,t,r){(0,i.default)(e,t),t.set(e,r)}})),r.register("hv1Iw",(function(e,r){function n(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}t(e.exports,"default",(function(){return n}))})),r.register("7ukXT",(function(e,n){t(e.exports,"default",(function(){return a}));var i=r("k7SOi"),o=r("c4HTA");function a(e,t,r){var n=(0,i.default)(e,t,"set");return(0,o.default)(e,n,r),r}})),r.register("c4HTA",(function(e,r){function n(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}t(e.exports,"default",(function(){return n}))})),r.register("8TzS1",(function(e,n){t(e.exports,"default",(function(){return a}));var i=r("k7SOi"),o=r("Fzx8d");function a(e,t){var r=(0,i.default)(e,t,"update");return(0,o.default)(e,r)}})),r.register("Fzx8d",(function(e,r){function n(e,t){if(t.set){if(!t.get)throw new TypeError("attempted to read set only private field");return"__destrWrapper"in t||(t.__destrWrapper={set value(r){t.set.call(e,r)},get value(){return t.get.call(e)}}),t.__destrWrapper}if(!t.writable)throw new TypeError("attempted to set read only private field");return t}t(e.exports,"default",(function(){return n}))})),r.register("aFAb1",(function(e,r){function n(e,t,r){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return r}t(e.exports,"default",(function(){return n}))})),r.register("kw2NY",(function(e,n){t(e.exports,"default",(function(){return o}));var i=r("hv1Iw");function o(e,t){(0,i.default)(e,t),t.add(e)}})),r.register("lxHBR",(function(e,n){t(e.exports,"default",(function(){return s}));var i=r("a3i4E"),o=r("jX9Fw"),a=r("laD7J");function s(e,t,r){return(0,i.default)(e,t),(0,o.default)(r,"get"),(0,a.default)(e,r)}})),r.register("a3i4E",(function(e,r){function n(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}t(e.exports,"default",(function(){return n}))})),r.register("jX9Fw",(function(e,r){function n(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}t(e.exports,"default",(function(){return n}))})),r.register("gJ3S3",(function(e,n){t(e.exports,"default",(function(){return s}));var i=r("a3i4E"),o=r("jX9Fw"),a=r("c4HTA");function s(e,t,r,n){return(0,i.default)(e,t),(0,o.default)(r,"set"),(0,a.default)(e,r,n),n}})),r.register("hXL9f",(function(e,n){t(e.exports,"default",(function(){return o}));var i=r("4pMaJ");function o(e){return function(){return new(0,i.default)(e.apply(this,arguments))}}})),r.register("4pMaJ",(function(e,n){t(e.exports,"default",(function(){return o}));var i=r("kRxx3");function o(e){var t,r;function n(t,r){try{var a=e[t](r),s=a.value,u=s instanceof i.default;Promise.resolve(u?s.wrapped:s).then((function(e){u?n("next",e):o(a.done?"return":"normal",e)}),(function(e){n("throw",e)}))}catch(e){o("throw",e)}}function o(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null};r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}"function"==typeof Symbol&&Symbol.asyncIterator&&(o.prototype[Symbol.asyncIterator]=function(){return this}),o.prototype.next=function(e){return this._invoke("next",e)},o.prototype.throw=function(e){return this._invoke("throw",e)},o.prototype.return=function(e){return this._invoke("return",e)}}))}();