vrpc 3.10.0 → 3.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/vrpc.js +6 -6
- package/browser/vrpc.js.LICENSE.txt +9 -8
- package/package.json +2 -2
- package/vrpc/VrpcAgent.js +9 -1
- package/vrpc/VrpcClient.js +4 -1
package/browser/vrpc.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! For license information please see vrpc.js.LICENSE.txt */
|
|
2
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vrpc=t():e.vrpc=t()}(self,()=>(()=>{var e={
|
|
3
|
-
|| (${a} == "string" && ${
|
|
4
|
-
|| (${a} === "string" && ${
|
|
5
|
-
|| ${a} === "boolean" || ${i} === null`).assign(c,s._`[${i}]`)}}n.else(),d(e),n.endIf(),n.if(s._`${c} !== undefined`,()=>{n.assign(i,c),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,()=>e.assign(s._`${t}[${r}]`,n))}(e,c)})}(e,t,a):d(e)})}return l};const u=new Set(["string","number","integer","boolean","null"]);function h(e,t,r,n=c.Correct){const i=n===c.Correct?s.operators.EQ:s.operators.NEQ;let o;switch(e){case"null":return s._`${t} ${i} null`;case"array":o=s._`Array.isArray(${t})`;break;case"object":o=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=a();break;default:return s._`typeof ${t} ${i} ${e}`}return n===c.Correct?o:(0,s.not)(o);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function f(e,t,r,n){if(1===e.length)return h(e[0],t,r,n);let i;const o=(0,a.toHash)(e);if(o.array&&o.object){const e=s._`typeof ${t} != "object"`;i=o.null?e:s._`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=s.nil;o.number&&delete o.integer;for(const e in o)i=(0,s.and)(i,h(e,t,r,n));return i}t.checkDataType=h,t.checkDataTypes=f;const p={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function d(e){const t=function(e){const{gen:t,data:r,schema:n}=e,i=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}(e);(0,o.reportError)(t,p)}t.reportTypeError=d},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,l=c>>1,u=-7,h=r?i-1:0,f=r?-1:1,p=e[t+h];for(h+=f,o=p&(1<<-u)-1,p>>=-u,u+=a;u>0;o=256*o+e[t+h],h+=f,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+h],h+=f,u-=8);if(0===o)o=1-l;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=l}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,l=8*o-i-1,u=(1<<l)-1,h=u>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*c-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+p]=255&s,p+=d,s/=256,l-=8);e[r+p-d]|=128*m}},259:e=>{"use strict";e.exports=function(e){e.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}},343:(e,t,r)=>{"use strict";const{isUUID:n}=r(4834),i=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&!(3!==e.scheme.length||"w"!==e.scheme[0]&&"W"!==e.scheme[0]||"s"!==e.scheme[1]&&"S"!==e.scheme[1]||"s"!==e.scheme[2]&&"S"!==e.scheme[2])}function a(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function c(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const l={scheme:"http",domainHost:!0,parse:a,serialize:c},u={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=s(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(s(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},h={http:l,https:{scheme:"https",domainHost:l.domainHost,parse:a,serialize:c},ws:u,wss:{scheme:"wss",domainHost:u.domainHost,parse:u.parse,serialize:u.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(i);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const i=f(`${n}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=f(`${r}:${t.nid||n}`);i&&(e=i.serialize(e,t));const o=e,s=e.nss;return o.path=`${n||t.nid}:${s}`,t.skipEscape=!0,o},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&n(r.uuid)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};function f(e){return e&&(h[e]||h[e.toLowerCase()])||void 0}Object.setPrototypeOf(h,null),e.exports={wsIsSecure:s,SCHEMES:h,isValidSchemeName:function(e){return-1!==o.indexOf(e)},getSchemeHandler:f}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},414:e=>{"use strict";e.exports=Math.round},422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),i=r(9029),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>i.str`must match pattern "${e}"`,params:({schemaCode:e})=>i._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:o,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",l=r?i._`(new RegExp(${s}, ${c}))`:(0,n.usePattern)(e,o);e.fail$data(i._`!${l}.test(${t})`)}};t.default=o},453:(e,t,r)=>{"use strict";var n,i=r(9612),o=r(9383),s=r(1237),a=r(6909),c=r(9538),l=r(8068),u=r(9675),h=r(5345),f=r(1514),p=r(8968),d=r(6188),m=r(8002),y=r(5880),g=r(414),b=r(3093),_=Function,v=function(e){try{return _('"use strict"; return ('+e+").constructor;")()}catch(e){}},w=r(5795),S=r(655),E=function(){throw new u},k=w?function(){try{return E}catch(e){try{return w(arguments,"callee").get}catch(e){return E}}}():E,I=r(4039)(),P=r(3628),A=r(1064),$=r(8648),R=r(1002),O=r(76),T={},C="undefined"!=typeof Uint8Array&&P?P(Uint8Array):n,x={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":I&&P?P([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":T,"%AsyncGenerator%":T,"%AsyncGeneratorFunction%":T,"%AsyncIteratorPrototype%":T,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":_,"%GeneratorFunction%":T,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":I&&P?P(P([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&I&&P?P((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":w,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":c,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&I&&P?P((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":I&&P?P(""[Symbol.iterator]()):n,"%Symbol%":I?Symbol:n,"%SyntaxError%":l,"%ThrowTypeError%":k,"%TypedArray%":C,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":h,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":O,"%Function.prototype.apply%":R,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":A,"%Math.abs%":f,"%Math.floor%":p,"%Math.max%":d,"%Math.min%":m,"%Math.pow%":y,"%Math.round%":g,"%Math.sign%":b,"%Reflect.getPrototypeOf%":$};if(P)try{null.error}catch(e){var N=P(P(e));x["%Error.prototype%"]=N}var j=function e(t){var r;if("%AsyncFunction%"===t)r=v("async function () {}");else if("%GeneratorFunction%"===t)r=v("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=v("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&P&&(r=P(i.prototype))}return x[t]=r,r},M={__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"]},L=r(6743),B=r(9957),U=L.call(O,Array.prototype.concat),D=L.call(R,Array.prototype.splice),F=L.call(O,String.prototype.replace),q=L.call(O,String.prototype.slice),V=L.call(O,RegExp.prototype.exec),K=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,W=/\\(\\)?/g,H=function(e,t){var r,n=e;if(B(M,n)&&(n="%"+(r=M[n])[0]+"%"),B(x,n)){var i=x[n];if(i===T&&(i=j(n)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new l("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===V(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=q(e,0,1),r=q(e,-1);if("%"===t&&"%"!==r)throw new l("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new l("invalid intrinsic syntax, expected opening `%`");var n=[];return F(e,K,function(e,t,r,i){n[n.length]=r?F(i,W,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=H("%"+n+"%",t),o=i.name,s=i.value,a=!1,c=i.alias;c&&(n=c[0],D(r,U([0,1],c)));for(var h=1,f=!0;h<r.length;h+=1){var p=r[h],d=q(p,0,1),m=q(p,-1);if(('"'===d||"'"===d||"`"===d||'"'===m||"'"===m||"`"===m)&&d!==m)throw new l("property names with quotes must have matching quotes");if("constructor"!==p&&f||(a=!0),B(x,o="%"+(n+="."+p)+"%"))s=x[o];else if(null!=s){if(!(p in s)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(w&&h+1>=r.length){var y=w(s,p);s=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:s[p]}else f=B(s,p),s=s[p];f&&!a&&(x[o]=s)}}return s}},494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(9029),i=r(4227),o=r(5765),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,i.alwaysValidSchema)(r,t)||e.ok((0,o.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:o,parentSchema:s,data:a,keyword:c,it:l}=e;!function(e){const{opts:n,errSchemaPath:o}=l,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${c}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(l,e,n.strictTuples)}}(s),l.opts.unevaluated&&r.length&&!0!==l.items&&(l.items=i.mergeEvaluated.items(o,r.length,l.items));const u=o.name("valid"),h=o.const("len",n._`${a}.length`);r.forEach((t,r)=>{(0,i.alwaysValidSchema)(l,t)||(o.if(n._`${h} > ${r}`,()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},u)),e.ok(u))})}t.validateTuple=a,t.default=s},507:(e,t,r)=>{"use strict";var n=r(453),i=r(6556),o=r(8859),s=r(9675),a=n("%Map%",!0),c=i("Map.prototype.get",!0),l=i("Map.prototype.set",!0),u=i("Map.prototype.has",!0),h=i("Map.prototype.delete",!0),f=i("Map.prototype.size",!0);e.exports=!!a&&function(){var e,t={assert:function(e){if(!t.has(e))throw new s("Side channel does not contain "+o(e))},delete:function(t){if(e){var r=h(e,t);return 0===f(e)&&(e=void 0),r}return!1},get:function(t){if(e)return c(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,r){e||(e=new a),l(e,t,r)}};return t}},510:(e,t,r)=>{"use strict";var n=r(5606);const i=r(4624),o=r(4046),s=r(8835),a=r(7510),c=r(7833)("mqttjs"),l={};function u(e,t){if(c("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=null),t=t||{},e){const r=s.parse(e,!0);if(null!=r.port&&(r.port=Number(r.port)),null===(t=a(r,t)).protocol)throw new Error("Missing protocol");t.protocol=t.protocol.replace(/:$/,"")}if(function(e){let t;e.auth&&(t=e.auth.match(/^(.+):(.+)$/),t?(e.username=t[1],e.password=t[2]):e.username=e.auth)}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+t.protocol+'"!')}}if(!l[t.protocol]){const e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(t,r){return(!e||r%2!=0)&&"function"==typeof l[t]})[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);const r=new i(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++),c("calling streambuilder for",t.protocol),l[t.protocol](e,t)},t);return r.on("error",function(){}),r}void 0!==n&&"browser"!==n.title||"function"!=typeof r?(l.mqtt=r(93),l.tcp=r(93),l.ssl=r(8803),l.tls=r(8803),l.mqtts=r(8803)):(l.wx=r(9455),l.wxs=r(9455),l.ali=r(1426),l.alis=r(1426)),l.ws=r(8490),l.wss=r(8490),e.exports=u,e.exports.connect=u,e.exports.MqttClient=i,e.exports.Store=o},554:()=>{},576:e=>{e.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}},617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(208),i=r(9029),o=r(4227),s=r(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>i.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>i._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:a,schema:c,parentSchema:l,schemaCode:u,it:h}=e;if(!a&&!c)return;const f=t.let("valid"),p=l.items?(0,n.getSchemaTypes)(l.items):[];function d(o,s){const a=t.name("item"),c=(0,n.checkDataTypes)(p,a,h.opts.strictNumbers,n.DataType.Wrong),l=t.const("indices",i._`{}`);t.for(i._`;${o}--;`,()=>{t.let(a,i._`${r}[${o}]`),t.if(c,i._`continue`),p.length>1&&t.if(i._`typeof ${a} == "string"`,i._`${a} += "_"`),t.if(i._`typeof ${l}[${a}] == "number"`,()=>{t.assign(s,i._`${l}[${a}]`),e.error(),t.assign(f,!1).break()}).code(i._`${l}[${a}] = ${o}`)})}function m(n,a){const c=(0,o.useFunc)(t,s.default),l=t.name("outer");t.label(l).for(i._`;${n}--;`,()=>t.for(i._`${a} = ${n}; ${a}--;`,()=>t.if(i._`${c}(${r}[${n}], ${r}[${a}])`,()=>{e.error(),t.assign(f,!1).break(l)})))}e.block$data(f,function(){const n=t.let("i",i._`${r}.length`),o=t.let("j");e.setParams({i:n,j:o}),t.assign(f,!0),t.if(i._`${n} > 1`,()=>(p.length>0&&!p.some(e=>"object"===e||"array"===e)?d:m)(n,o))},i._`${u} === false`),e.ok(f)}};t.default=a},626:(e,t,r)=>{"use strict";var n,i=r(5606);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=I,I.WritableState=k;var s,a={deprecate:r(4643)},c=r(2463),l=r(8109).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},h=r(5542),f=r(3081).getHighWaterMark,p=r(2014).F,d=p.ERR_INVALID_ARG_TYPE,m=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,b=p.ERR_STREAM_DESTROYED,_=p.ERR_STREAM_NULL_VALUES,v=p.ERR_STREAM_WRITE_AFTER_END,w=p.ERR_UNKNOWN_ENCODING,S=h.errorOrDestroy;function E(){}function k(e,t,s){n=n||r(5240),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(T,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),T(e,t))}(e,r,n,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||$(e,r),n?i.nextTick(A,e,r,s,o):A(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function I(e){var t=this instanceof(n=n||r(5240));if(!t&&!s.call(I,this))return new I(e);this._writableState=new k(e,this,t),this.writable=!0,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)),c.call(this)}function P(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function $(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,P(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,h=r.callback;if(P(e,t,!1,t.objectMode?1:l.length,l,u,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(I,c),k.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(k.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===I&&e&&e._writableState instanceof k}})):s=function(e){return e instanceof this},I.prototype.pipe=function(){S(this,new g)},I.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,l.isBuffer(n)||n instanceof u);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new v;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new _:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else P(e,t,!1,a,n,i,o);return c}(this,o,a,e,t,r)),s},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||$(this,e))},I.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,t,r){r(new m("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=h.destroy,I.prototype._undestroy=h.undestroy,I.prototype._destroy=function(e,t){t(e)}},655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},720:(e,t,r)=>{const n=r(9291);e.exports.t=n},736:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e,t){let r=0,n=0,i=-1,o=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,o=r,n++):(r++,n++);else{if(-1===i)return!1;n=i+1,o++,r=o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(i(e,r))return!1;for(const r of t.names)if(i(e,r))return!0;return!1},t.humanize=r(6585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},920:(e,t,r)=>{"use strict";var n=r(9675),i=r(8859),o=r(4803),s=r(507),a=r(2271)||s||o;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+i(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=a()),e.set(t,r)}};return t}},1002:e=>{"use strict";e.exports=Function.prototype.apply},1064:(e,t,r)=>{"use strict";var n=r(9612);e.exports=n.getPrototypeOf||null},1072:(e,t)=>{t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},1163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:i}=e,o="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${o} ${i}`)}};t.default=i},1237:e=>{"use strict";e.exports=EvalError},1239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(4227),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:o}=e;void 0===r.then&&void 0===r.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');const a=s(o,"then"),c=s(o,"else");if(!a&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&c){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(u,h("then",r),h("else",r))}else a?t.if(u,h("then")):t.if((0,n.not)(u),h("else"));function h(r,i){return()=>{const o=e.subschema({keyword:r},u);t.assign(l,u),e.mergeValidEvaluated(o,l),i?t.assign(i,n._`${r}`):e.setParams({ifClause:r})}}e.pass(l,()=>e.error(!0))}};function s(e,t){const r=e.schema[t];return void 0!==r&&!(0,i.alwaysValidSchema)(e,r)}t.default=o},1278:(e,t,r)=>{t.parser=r(3079).parser,t.generate=r(2535),t.writeToStream=r(3132)},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},1426:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),i=r(7041).Transform,o=r(2623);let s,a,c,l=!1;e.exports=function(e,t){if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const u=function(e,t){const r="alis"===e.protocol?"wss":"ws";let n=r+"://"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(n=r+"://"+e.hostname+":"+e.port+e.path),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);return s=t.my,s.connectSocket({url:u,protocols:r}),a=function(){const e=new i;return e._write=function(e,t,r){s.sendSocketMessage({data:e.buffer,success:function(){r()},fail:function(){r(new Error)}})},e._flush=function(e){s.closeSocket({success:function(){e()}})},e}(),c=o.obj(),l||(l=!0,s.onSocketOpen(function(){c.setReadable(a),c.setWritable(a),c.emit("connect")}),s.onSocketMessage(function(e){if("string"==typeof e.data){const t=n.from(e.data,"base64");a.push(t)}else{const t=new FileReader;t.addEventListener("load",function(){let e=t.result;e=e instanceof ArrayBuffer?n.from(e):n.from(e,"utf8"),a.push(e)}),t.readAsArrayBuffer(e.data)}}),s.onSocketClose(function(){c.end(),c.destroy()}),s.onSocketError(function(e){c.destroy(e)})),c}},1438:(e,t,r)=>{"use strict";var n,i=r(5606);e.exports=I,I.ReadableState=k,r(7007).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(2463),c=r(8109).Buffer,l=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(164);o=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,p,d=r(2899),m=r(5542),y=r(3081).getHighWaterMark,g=r(2014).F,b=g.ERR_INVALID_ARG_TYPE,_=g.ERR_STREAM_PUSH_AFTER_EOF,v=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(I,a);var S=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function k(e,t,i){n=n||r(5240),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=r(3141).I),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function I(e){if(n=n||r(5240),!(this instanceof I))return new I(e);var t=this instanceof n;this._readableState=new k(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function P(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("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?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,T(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,c.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n)a.endEmitted?S(e,new w):A(e,a,t,!0);else if(a.ended)S(e,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?A(e,a,t,!1):C(e,a)):A(e,a,t,!1)}else n||(a.reading=!1,C(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&O(e)),C(e,t)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),I.prototype.destroy=m.destroy,I.prototype._undestroy=m.undestroy,I.prototype._destroy=function(e,t){t(e)},I.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),P(this,e,t,!1,r)},I.prototype.unshift=function(e){return P(this,e,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(e){h||(h=r(3141).I);var t=new h(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var $=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=$?e=$:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(T,e))}function T(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function C(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(x,e,t))}function x(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function j(e){o("readable nexttick read 0"),e.read(0)}function M(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function B(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}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(D,t,e))}function D(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}I.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):O(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},I.prototype._read=function(e){S(this,new v("_read()"))},I.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?m:c;function c(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",h),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",l);var u=!1;function h(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==F(n.pipes,e))&&!u&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){o("onerror",t),m(),e.removeListener("error",f),0===s(e,"error")&&S(e,t)}function p(){e.removeListener("finish",d),m()}function d(){o("onfinish"),e.removeListener("close",p),m()}function m(){o("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},I.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},I.prototype.on=function(e,t){var r=a.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,o("on readable",n.length,n.reading),n.length?O(this):n.reading||i.nextTick(j,this))),r},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(N,this),r},I.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(N,this),t},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(M,e,t))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(I.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(1637)),f(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),I._fromList=B,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(I.from=function(e,t){return void 0===p&&(p=r(7471)),p(I,e,t)})},1514:e=>{"use strict";e.exports=Math.abs},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class i extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function o(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)c(r,t[n]),r.push(e[++n]);return new i(r)}t._Code=i,t.nil=new i(""),t._=o;const s=new i("+");function a(e,...t){const r=[u(e[0])];let n=0;for(;n<t.length;)r.push(s),c(r,t[n]),r.push(s,u(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){const r=l(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new i(r)}function c(e,t){var r;t instanceof i?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function l(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=c,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new i(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new i(`.${e}`):o`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new i(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new i(e.toString())}},1591:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},1608:()=>{},1637:(e,t,r)=>{"use strict";var n,i=r(5606);function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(7452),a=Symbol("lastResolve"),c=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function m(e){var t=e[a];if(null!==t){var r=e[p].read();null!==r&&(e[h]=null,e[a]=null,e[c]=null,t(d(r,!1)))}}function y(e){i.nextTick(m,e)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,r){i.nextTick(function(){e[l]?r(e[l]):t(d(void 0,!0))})});var r,n=this[h];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[u]?r(d(void 0,!0)):t[f](r,n)},n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[f])}return this[h]=r,r}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),n),g);e.exports=function(e){var t,r=Object.create(b,(o(t={},p,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,u,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[p].read();n?(r[h]=null,r[a]=null,r[c]=null,e(d(n,!1))):(r[a]=e,r[c]=t)},writable:!0}),t));return r[h]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];return null!==t&&(r[h]=null,r[a]=null,r[c]=null,t(e)),void(r[l]=e)}var n=r[a];null!==n&&(r[h]=null,r[a]=null,r[c]=null,n(d(void 0,!0))),r[u]=!0}),e.on("readable",y.bind(null,r)),r}},1860:(e,t,r)=>{"use strict";e.exports={VrpcClient:r(8577),VrpcAgent:r(6171),VrpcAdapter:r(8665)}},2014:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,o,s,a,c;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=("number"!=typeof c&&(c=0),c+1>(a=e).length||-1===a.indexOf(".",c)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},2017:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!==i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!==i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!==i--;){var s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},2023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=i},2079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2110:(e,t,r)=>{"use strict";var n=r(5606);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3463),i=r(3693),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,i.default];t.default=o},2271:(e,t,r)=>{"use strict";var n=r(453),i=r(6556),o=r(8859),s=r(507),a=r(9675),c=n("%WeakMap%",!0),l=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),h=i("WeakMap.prototype.has",!0),f=i("WeakMap.prototype.delete",!0);e.exports=c?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+o(e))},delete:function(r){if(c&&r&&("object"==typeof r||"function"==typeof r)){if(e)return f(e,r)}else if(s&&t)return t.delete(r);return!1},get:function(r){return c&&r&&("object"==typeof r||"function"==typeof r)&&e?l(e,r):t&&t.get(r)},has:function(r){return c&&r&&("object"==typeof r||"function"==typeof r)&&e?h(e,r):!!t&&t.has(r)},set:function(r,n){c&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new c),u(e,r,n)):s&&(t||(t=s()),t.set(r,n))}};return r}:s},2463:(e,t,r)=>{e.exports=r(7007).EventEmitter},2493:(e,t,r)=>{"use strict";var n,i=r(5606);function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(5076),a=Symbol("lastResolve"),c=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function m(e){var t=e[a];if(null!==t){var r=e[p].read();null!==r&&(e[h]=null,e[a]=null,e[c]=null,t(d(r,!1)))}}function y(e){i.nextTick(m,e)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,r){i.nextTick(function(){e[l]?r(e[l]):t(d(void 0,!0))})});var r,n=this[h];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[u]?r(d(void 0,!0)):t[f](r,n)},n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[f])}return this[h]=r,r}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),n),g);e.exports=function(e){var t,r=Object.create(b,(o(t={},p,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,u,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[p].read();n?(r[h]=null,r[a]=null,r[c]=null,e(d(n,!1))):(r[a]=e,r[c]=t)},writable:!0}),t));return r[h]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];return null!==t&&(r[h]=null,r[a]=null,r[c]=null,t(e)),void(r[l]=e)}var n=r[a];null!==n&&(r[h]=null,r[a]=null,r[c]=null,n(d(void 0,!0))),r[u]=!0}),e.on("readable",y.bind(null,r)),r}},2535:(e,t,r)=>{var n=r(8287).Buffer;const i=r(3132),o=r(7007);class s extends o{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0;const t=new Array(this._array.length),r=this._array;let i,o=0;for(i=0;i<r.length&&void 0!==r[i];i++)"string"!=typeof r[i]?t[i]=r[i].length:t[i]=n.byteLength(r[i]),e+=t[i];const s=n.allocUnsafe(e);for(i=0;i<r.length&&void 0!==r[i];i++)"string"!=typeof r[i]?(r[i].copy(s,o),o+=t[i]):(s.write(r[i],o),o+=t[i]);return s}}e.exports=function(e,t){const r=new s;return i(e,r,t),r.concat()}},2586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(8727),i=r(208),o=r(7887),s=r(208),a=r(7870),c=r(3673),l=r(4495),u=r(9029),h=r(2023),f=r(6939),p=r(4227),d=r(8708);function m({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,u._`${h.default.data}, ${h.default.valCxt}`,n.$async,()=>{e.code(u._`"use strict"; ${y(r,i)}`),function(e,t){e.if(h.default.valCxt,()=>{e.var(h.default.instancePath,u._`${h.default.valCxt}.${h.default.instancePath}`),e.var(h.default.parentData,u._`${h.default.valCxt}.${h.default.parentData}`),e.var(h.default.parentDataProperty,u._`${h.default.valCxt}.${h.default.parentDataProperty}`),e.var(h.default.rootData,u._`${h.default.valCxt}.${h.default.rootData}`),t.dynamicRef&&e.var(h.default.dynamicAnchors,u._`${h.default.valCxt}.${h.default.dynamicAnchors}`)},()=>{e.var(h.default.instancePath,u._`""`),e.var(h.default.parentData,u._`undefined`),e.var(h.default.parentDataProperty,u._`undefined`),e.var(h.default.rootData,h.default.data),t.dynamicRef&&e.var(h.default.dynamicAnchors,u._`{}`)})}(e,i),e.code(o)}):e.func(t,u._`${h.default.data}, ${function(e){return u._`{${h.default.instancePath}="", ${h.default.parentData}, ${h.default.parentDataProperty}, ${h.default.rootData}=${h.default.data}${e.dynamicRef?u._`, ${h.default.dynamicAnchors}={}`:u.nil}}={}`}(i)}`,n.$async,()=>e.code(y(r,i)).code(o))}function y(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?u._`/*# sourceURL=${r} */`:u.nil}function g({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function _(e){(0,p.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return S(e,[],!1,t);const r=(0,i.getSchemaTypes)(e.schema);S(e,r,!(0,i.coerceAndCheckDataType)(e,r),t)}function w({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){const o=r.$comment;if(!0===i.$comment)e.code(u._`${h.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){const r=u.str`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code(u._`${h.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function S(e,t,r,n){const{gen:i,schema:a,data:c,allErrors:l,opts:f,self:d}=e,{RULES:m}=d;function y(p){(0,o.shouldUseGroup)(a,p)&&(p.type?(i.if((0,s.checkDataType)(p.type,c,f.strictNumbers)),E(e,p),1===t.length&&t[0]===p.type&&r&&(i.else(),(0,s.reportTypeError)(e)),i.endIf()):E(e,p),l||i.if(u._`${h.default.errors} === ${n||0}`))}!a.$ref||!f.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(a,m)?(f.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach(t=>{k(e.dataTypes,t)||I(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const r=[];for(const n of e.dataTypes)k(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&I(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const n in r){const i=r[n];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){const{type:r}=i.definition;r.length&&!r.some(e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n})&&I(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),i.block(()=>{for(const e of m.rules)y(e);y(m.post)})):i.block(()=>A(e,"$ref",m.all.$ref.definition))}function E(e,t){const{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,a.assignDefaults)(e,t.type),r.block(()=>{for(const r of t.rules)(0,o.shouldUseRule)(n,r)&&A(e,r.keyword,r.definition,t.type)})}function k(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function I(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(_(e),g(e))?function(e){const{schema:t,opts:r,gen:n}=e;m(e,()=>{r.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(h.default.vErrors,null),n.let(h.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",u._`${r}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`)),t.if(u._`${e.evaluated}.dynamicItems`,()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`))}(e),v(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if(u._`${h.default.errors} === 0`,()=>t.return(h.default.data),()=>t.throw(u._`new ${i}(${h.default.vErrors})`)):(t.assign(u._`${n}.errors`,h.default.vErrors),o.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof u.Name&&e.assign(u._`${t}.props`,r),n instanceof u.Name&&e.assign(u._`${t}.items`,n)}(e),t.return(u._`${h.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,n.topBoolOrEmptySchema)(e))};class P{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",O(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",h.default.errors))}result(e,t,r){this.failResult((0,u.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?d.reportExtraError:d.reportError)(this,this.def.error,t)}$dataError(){(0,d.reportError)(this,this.def.$dataError||d.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,d.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=u.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,u.or)(u._`${n} === undefined`,t)),e!==u.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,u.or)(function(){if(r.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return u._`${(0,s.checkDataTypes)(e,t,i.opts.strictNumbers,s.DataType.Wrong)}`}return u.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return u._`!${r}(${t})`}return u.nil}())}subschema(e,t){const r=(0,l.getSubschema)(this.it,e);(0,l.extendSubschemaData)(r,this.it,e),(0,l.extendSubschemaMode)(r,e);const i={...this.it,...r,items:void 0,props:void 0};return function(e,t){b(e)&&(_(e),g(e))?function(e,t){const{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,f.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const o=n.const("_errs",h.default.errors);v(e,o),n.var(t,u._`${o} === ${h.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(i,t),i}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=p.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=p.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,()=>this.mergeEvaluated(e,u.Name)),!0}}function A(e,t,r,n){const i=new P(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,c.funcKeywordCode)(i,r):"macro"in r?(0,c.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(i,r)}t.KeywordCxt=P;const $=/^\/(?:[^~]|~0|~1)*$/,R=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function O(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return h.default.rootData;if("/"===e[0]){if(!$.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);i=e,o=h.default.rootData}else{const s=R.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(i=s[2],"#"===i){if(a>=t)throw new Error(c("property/index",a));return n[t-a]}if(a>t)throw new Error(c("data",a));if(o=r[t-a],!i)return o}let s=o;const a=i.split("/");for(const e of a)e&&(o=u._`${o}${(0,u.getProperty)((0,p.unescapeJsonPointer)(e))}`,s=u._`${s} && ${o}`);return s;function c(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=O},2623:(e,t,r)=>{var n=r(8287).Buffer,i=r(5606),o=r(2713),s=r(6611),a=r(6698),c=r(5332),l=n.from&&n.from!==Uint8Array.from?n.from([0]):new n([0]),u=function(e,t){e._corked?e.once("uncork",t):t()},h=function(e,t){return function(r){r?function(e,t){e._autoDestroy&&e.destroy(t)}(e,"premature close"===r.message?null:r):t&&!e._ended&&e.end()}},f=function(){},p=function(e,t,r){if(!(this instanceof p))return new p(e,t,r);o.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||!1!==r.autoDestroy,this._forwardDestroy=!r||!1!==r.destroy,this._forwardEnd=!r||!1!==r.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,e&&this.setWritable(e),t&&this.setReadable(t)};a(p,o.Duplex),p.obj=function(e,t,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new p(e,t,r)},p.prototype.cork=function(){1===++this._corked&&this.emit("cork")},p.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},p.prototype.setWritable=function(e){if(this._unwrite&&this._unwrite(),this.destroyed)e&&e.destroy&&e.destroy();else if(null!==e&&!1!==e){var t=this,r=s(e,{writable:!0,readable:!1},h(this,this._forwardEnd)),n=function(){var e=t._ondrain;t._ondrain=null,e&&e()};this._unwrite&&i.nextTick(n),this._writable=e,this._writable.on("drain",n),this._unwrite=function(){t._writable.removeListener("drain",n),r()},this.uncork()}else this.end()},p.prototype.setReadable=function(e){if(this._unread&&this._unread(),this.destroyed)e&&e.destroy&&e.destroy();else{if(null===e||!1===e)return this.push(null),void this.resume();var t,r=this,n=s(e,{writable:!1,readable:!0},h(this)),i=function(){r._forward()},a=function(){r.push(null)};this._drained=!0,this._readable=e,this._readable2=e._readableState?e:(t=e,new o.Readable({objectMode:!0,highWaterMark:16}).wrap(t)),this._readable2.on("readable",i),this._readable2.on("end",a),this._unread=function(){r._readable2.removeListener("readable",i),r._readable2.removeListener("end",a),n()},this._forward()}},p.prototype._read=function(){this._drained=!0,this._forward()},p.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var e;for(this._forwarding=!0;this._drained&&null!==(e=c(this._readable2));)this.destroyed||(this._drained=this.push(e));this._forwarding=!1}},p.prototype.destroy=function(e,t){if(t||(t=f),this.destroyed)return t(null);this.destroyed=!0;var r=this;i.nextTick(function(){r._destroy(e),t(null)})},p.prototype._destroy=function(e){if(e){var t=this._ondrain;this._ondrain=null,t?t(e):this.emit("error",e)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},p.prototype._write=function(e,t,r){if(!this.destroyed)return this._corked?u(this,this._write.bind(this,e,t,r)):e===l?this._finish(r):this._writable?void(!1===this._writable.write(e)?this._ondrain=r:this.destroyed||r()):r()},p.prototype._finish=function(e){var t=this;this.emit("preend"),u(this,function(){var r,n;n=function(){!1===t._writableState.prefinished&&(t._writableState.prefinished=!0),t.emit("prefinish"),u(t,e)},(r=t._forwardEnd&&t._writable)?r._writableState&&r._writableState.finished?n():r._writableState?r.end(n):(r.end(),n()):n()})},p.prototype.end=function(e,t,r){return"function"==typeof e?this.end(null,null,e):"function"==typeof t?this.end(e,null,t):(this._ended=!0,e&&this.write(e),this._writableState.ending||this._writableState.destroyed||this.write(l),o.Writable.prototype.end.call(this,r))},e.exports=p},2634:()=>{},2642:(e,t,r)=>{"use strict";var n=r(7720),i=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},c=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},l=function(e,t,r,o){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,l=r.depth>0&&/(\[[^[\]]*])/.exec(s),u=l?s.slice(0,l.index):s,h=[];if(u){if(!r.plainObjects&&i.call(Object.prototype,u)&&!r.allowPrototypes)return;h.push(u)}for(var f=0;r.depth>0&&null!==(l=a.exec(s))&&f<r.depth;){if(f+=1,!r.plainObjects&&i.call(Object.prototype,l[1].slice(1,-1))&&!r.allowPrototypes)return;h.push(l[1])}if(l){if(!0===r.strictDepth)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");h.push("["+s.slice(l.index)+"]")}return function(e,t,r,i){var o=0;if(e.length>0&&"[]"===e[e.length-1]){var s=e.slice(0,-1).join("");o=Array.isArray(t)&&t[s]?t[s].length:0}for(var a=i?t:c(t,r,o),l=e.length-1;l>=0;--l){var u,h=e[l];if("[]"===h&&r.parseArrays)u=r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:n.combine([],a);else{u=r.plainObjects?{__proto__:null}:{};var f="["===h.charAt(0)&&"]"===h.charAt(h.length-1)?h.slice(1,-1):h,p=r.decodeDotInKeys?f.replace(/%2E/g,"."):f,d=parseInt(p,10);r.parseArrays||""!==p?!isNaN(d)&&h!==p&&String(d)===p&&d>=0&&r.parseArrays&&d<=r.arrayLimit?(u=[])[d]=a:"__proto__"!==p&&(u[p]=a):u={0:a}}a=u}return a}(h,t,r,o)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"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");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?s.charset:e.charset,r=void 0===e.duplicates?s.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||s.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:s.strictDepth,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var u="string"==typeof e?function(e,t){var r={__proto__:null},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;l=l.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,h=l.split(t.delimiter,t.throwOnLimitExceeded?u+1:u);if(t.throwOnLimitExceeded&&h.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var f,p=-1,d=t.charset;if(t.charsetSentinel)for(f=0;f<h.length;++f)0===h[f].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[f]?d="utf-8":"utf8=%26%2310003%3B"===h[f]&&(d="iso-8859-1"),p=f,f=h.length);for(f=0;f<h.length;++f)if(f!==p){var m,y,g=h[f],b=g.indexOf("]="),_=-1===b?g.indexOf("="):b+1;-1===_?(m=t.decoder(g,s.decoder,d,"key"),y=t.strictNullHandling?null:""):(m=t.decoder(g.slice(0,_),s.decoder,d,"key"),y=n.maybeMap(c(g.slice(_+1),t,o(r[m])?r[m].length:0),function(e){return t.decoder(e,s.decoder,d,"value")})),y&&t.interpretNumericEntities&&"iso-8859-1"===d&&(y=a(String(y))),g.indexOf("[]=")>-1&&(y=o(y)?[y]:y);var v=i.call(r,m);v&&"combine"===t.duplicates?r[m]=n.combine(r[m],y):v&&"last"!==t.duplicates||(r[m]=y)}return r}(e,r):e,h=r.plainObjects?{__proto__:null}:{},f=Object.keys(u),p=0;p<f.length;++p){var d=f[p],m=l(d,u[d],r,"string"==typeof e);h=n.merge(h,m,r)}return!0===r.allowSparse?h:n.compact(h)}},2661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(4227),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:o,data:s,it:a}=e;let c,l;const{minContains:u,maxContains:h}=o;a.opts.next?(c=void 0===u?1:u,l=h):c=1;const f=t.const("len",n._`${s}.length`);if(e.setParams({min:c,max:l}),void 0===l&&0===c)return void(0,i.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==l&&c>l)return(0,i.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,i.alwaysValidSchema)(a,r)){let t=n._`${f} >= ${c}`;return void 0!==l&&(t=n._`${t} && ${f} <= ${l}`),void e.pass(t)}a.items=!0;const p=t.name("valid");function d(){const e=t.name("_valid"),r=t.let("count",0);m(e,()=>t.if(e,()=>function(e){t.code(n._`${e}++`),void 0===l?t.if(n._`${e} >= ${c}`,()=>t.assign(p,!0).break()):(t.if(n._`${e} > ${l}`,()=>t.assign(p,!1).break()),1===c?t.assign(p,!0):t.if(n._`${e} >= ${c}`,()=>t.assign(p,!0)))}(r)))}function m(r,n){t.forRange("i",0,f,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:i.Type.Num,compositeRule:!0},r),n()})}void 0===l&&1===c?m(p,()=>t.if(p,()=>t.break())):0===c?(t.let(p,!0),void 0!==l&&t.if(n._`${s}.length > 0`,d)):(t.let(p,!1),d()),e.result(p,()=>e.reset())}};t.default=o},2713:(e,t,r)=>{(t=e.exports=r(9158)).Stream=t,t.Readable=t,t.Writable=r(8522),t.Duplex=r(7920),t.Transform=r(6608),t.PassThrough=r(8290),t.finished=r(5076),t.pipeline=r(4136)},2855:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},2899:(e,t,r)=>{"use strict";function n(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 i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var c=r(8109).Buffer,l=r(4030).inspect,u=l&&l.custom||"inspect";function h(e,t,r){c.prototype.copy.call(e,t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{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;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),r=this.head,n=0;r;)h(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},3025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(9029),i=r(4227),o=r(5765);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const i=1===t?"property":"properties";return n.str`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>n._`{property: ${e},
|
|
6
|
-
missingProperty: ${
|
|
2
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vrpc=t():e.vrpc=t()}(self,()=>(()=>{var e={117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2586),o=r(5765),i=r(4227),s=r(8660),a={keyword:"properties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,parentSchema:a,data:l,it:c}=e;"all"===c.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new n.KeywordCxt(c,s.default,"additionalProperties"));const u=(0,o.allSchemaProperties)(r);for(const e of u)c.definedProperties.add(e);c.opts.unevaluated&&u.length&&!0!==c.props&&(c.props=i.mergeEvaluated.props(t,(0,i.toHash)(u),c.props));const f=u.filter(e=>!(0,i.alwaysValidSchema)(c,r[e]));if(0===f.length)return;const h=t.name("valid");for(const r of f)d(r)?p(r):(t.if((0,o.propertyInData)(t,l,r,c.opts.ownProperties)),p(r),c.allErrors||t.else().var(h,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(h);function d(e){return c.opts.useDefaults&&!c.compositeRule&&void 0!==r[e].default}function p(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},h)}}};t.default=a},208:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;const n=r(396),o=r(7887),i=r(8708),s=r(9029),a=r(4227);var l;function c(e){const t=Array.isArray(e)?e:e?[e]:[];if(t.every(n.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(l||(t.DataType=l={})),t.getSchemaTypes=function(e){const t=c(e.type);if(t.includes("null")){if(!1===e.nullable)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw new Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},t.getJSONTypes=c,t.coerceAndCheckDataType=function(e,t){const{gen:r,data:n,opts:i}=e,a=function(e,t){return t?e.filter(e=>u.has(e)||"array"===t&&"array"===e):[]}(t,i.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(c){const o=h(t,n,i.strictNumbers,l.Wrong);r.if(o,()=>{a.length?function(e,t,r){const{gen:n,data:o,opts:i}=e,a=n.let("dataType",s._`typeof ${o}`),l=n.let("coerced",s._`undefined`);"array"===i.coerceTypes&&n.if(s._`${a} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,s._`${o}[0]`).assign(a,s._`typeof ${o}`).if(h(t,o,i.strictNumbers),()=>n.assign(l,o))),n.if(s._`${l} !== undefined`);for(const e of r)(u.has(e)||"array"===e&&"array"===i.coerceTypes)&&c(e);function c(e){switch(e){case"string":return void n.elseIf(s._`${a} == "number" || ${a} == "boolean"`).assign(l,s._`"" + ${o}`).elseIf(s._`${o} === null`).assign(l,s._`""`);case"number":return void n.elseIf(s._`${a} == "boolean" || ${o} === null
|
|
3
|
+
|| (${a} == "string" && ${o} && ${o} == +${o})`).assign(l,s._`+${o}`);case"integer":return void n.elseIf(s._`${a} === "boolean" || ${o} === null
|
|
4
|
+
|| (${a} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(l,s._`+${o}`);case"boolean":return void n.elseIf(s._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(l,!1).elseIf(s._`${o} === "true" || ${o} === 1`).assign(l,!0);case"null":return n.elseIf(s._`${o} === "" || ${o} === 0 || ${o} === false`),void n.assign(l,null);case"array":n.elseIf(s._`${a} === "string" || ${a} === "number"
|
|
5
|
+
|| ${a} === "boolean" || ${o} === null`).assign(l,s._`[${o}]`)}}n.else(),p(e),n.endIf(),n.if(s._`${l} !== undefined`,()=>{n.assign(o,l),function({gen:e,parentData:t,parentDataProperty:r},n){e.if(s._`${t} !== undefined`,()=>e.assign(s._`${t}[${r}]`,n))}(e,l)})}(e,t,a):p(e)})}return c};const u=new Set(["string","number","integer","boolean","null"]);function f(e,t,r,n=l.Correct){const o=n===l.Correct?s.operators.EQ:s.operators.NEQ;let i;switch(e){case"null":return s._`${t} ${o} null`;case"array":i=s._`Array.isArray(${t})`;break;case"object":i=s._`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":i=a(s._`!(${t} % 1) && !isNaN(${t})`);break;case"number":i=a();break;default:return s._`typeof ${t} ${o} ${e}`}return n===l.Correct?i:(0,s.not)(i);function a(e=s.nil){return(0,s.and)(s._`typeof ${t} == "number"`,e,r?s._`isFinite(${t})`:s.nil)}}function h(e,t,r,n){if(1===e.length)return f(e[0],t,r,n);let o;const i=(0,a.toHash)(e);if(i.array&&i.object){const e=s._`typeof ${t} != "object"`;o=i.null?e:s._`!${t} || ${e}`,delete i.null,delete i.array,delete i.object}else o=s.nil;i.number&&delete i.integer;for(const e in i)o=(0,s.and)(o,f(e,t,r,n));return o}t.checkDataType=f,t.checkDataTypes=h;const d={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?s._`{type: ${e}}`:s._`{type: ${t}}`};function p(e){const t=function(e){const{gen:t,data:r,schema:n}=e,o=(0,a.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:o,schemaValue:o,parentSchema:n,params:{},it:e}}(e);(0,i.reportError)(t,d)}t.reportTypeError=p},343:(e,t,r)=>{"use strict";const{isUUID:n}=r(4834),o=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=["http","https","ws","wss","urn","urn:uuid"];function s(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&!(3!==e.scheme.length||"w"!==e.scheme[0]&&"W"!==e.scheme[0]||"s"!==e.scheme[1]&&"S"!==e.scheme[1]||"s"!==e.scheme[2]&&"S"!==e.scheme[2])}function a(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function l(e){const t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}const c={scheme:"http",domainHost:!0,parse:a,serialize:l},u={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=s(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if(e.port!==(s(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){const[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},f={http:c,https:{scheme:"https",domainHost:c.domainHost,parse:a,serialize:l},ws:u,wss:{scheme:"wss",domainHost:u.domainHost,parse:u.parse,serialize:u.serialize},urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;const r=e.path.match(o);if(r){const n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];const o=h(`${n}:${t.nid||e.nid}`);e.path=void 0,o&&(e=o.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw new Error("URN without nid cannot be serialized");const r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),o=h(`${r}:${t.nid||n}`);o&&(e=o.serialize(e,t));const i=e,s=e.nss;return i.path=`${n||t.nid}:${s}`,t.skipEscape=!0,i},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){const r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&n(r.uuid)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e){const t=e;return t.nss=(e.uuid||"").toLowerCase(),t},skipNormalize:!0}};function h(e){return e&&(f[e]||f[e.toLowerCase()])||void 0}Object.setPrototypeOf(f,null),e.exports={wsIsSecure:s,SCHEMES:f,isValidSchemeName:function(e){return-1!==i.indexOf(e)},getSchemeHandler:h}},396:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;const r=new Set(["string","number","integer","boolean","null","object","array"]);t.isJSONType=function(e){return"string"==typeof e&&r.has(e)},t.getRules=function(){const e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},422:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>o.str`must match pattern "${e}"`,params:({schemaCode:e})=>o._`{pattern: ${e}}`},code(e){const{data:t,$data:r,schema:i,schemaCode:s,it:a}=e,l=a.opts.unicodeRegExp?"u":"",c=r?o._`(new RegExp(${s}, ${l}))`:(0,n.usePattern)(e,i);e.fail$data(o._`!${c}.test(${t})`)}};t.default=i},494:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;const n=r(9029),o=r(4227),i=r(5765),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){const{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,o.alwaysValidSchema)(r,t)||e.ok((0,i.validateArray)(e))}};function a(e,t,r=e.schema){const{gen:i,parentSchema:s,data:a,keyword:l,it:c}=e;!function(e){const{opts:n,errSchemaPath:i}=c,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){const e=`"${l}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${i}"`;(0,o.checkStrictMode)(c,e,n.strictTuples)}}(s),c.opts.unevaluated&&r.length&&!0!==c.items&&(c.items=o.mergeEvaluated.items(i,r.length,c.items));const u=i.name("valid"),f=i.const("len",n._`${a}.length`);r.forEach((t,r)=>{(0,o.alwaysValidSchema)(c,t)||(i.if(n._`${f} > ${r}`,()=>e.subschema({keyword:l,schemaProp:r,dataProp:r},u)),e.ok(u))})}t.validateTuple=a,t.default=s},617:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(208),o=r(9029),i=r(4227),s=r(6250),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>o.str`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>o._`{i: ${e}, j: ${t}}`},code(e){const{gen:t,data:r,$data:a,schema:l,parentSchema:c,schemaCode:u,it:f}=e;if(!a&&!l)return;const h=t.let("valid"),d=c.items?(0,n.getSchemaTypes)(c.items):[];function p(i,s){const a=t.name("item"),l=(0,n.checkDataTypes)(d,a,f.opts.strictNumbers,n.DataType.Wrong),c=t.const("indices",o._`{}`);t.for(o._`;${i}--;`,()=>{t.let(a,o._`${r}[${i}]`),t.if(l,o._`continue`),d.length>1&&t.if(o._`typeof ${a} == "string"`,o._`${a} += "_"`),t.if(o._`typeof ${c}[${a}] == "number"`,()=>{t.assign(s,o._`${c}[${a}]`),e.error(),t.assign(h,!1).break()}).code(o._`${c}[${a}] = ${i}`)})}function m(n,a){const l=(0,i.useFunc)(t,s.default),c=t.name("outer");t.label(c).for(o._`;${n}--;`,()=>t.for(o._`${a} = ${n}; ${a}--;`,()=>t.if(o._`${l}(${r}[${n}], ${r}[${a}])`,()=>{e.error(),t.assign(h,!1).break(c)})))}e.block$data(h,function(){const n=t.let("i",o._`${r}.length`),i=t.let("j");e.setParams({i:n,j:i}),t.assign(h,!0),t.if(o._`${n} > 1`,()=>(d.length>0&&!d.some(e=>"object"===e||"array"===e)?p:m)(n,i))},o._`${u} === false`),e.ok(h)}};t.default=a},1072:(e,t)=>{t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},1163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxItems"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`${r}.length ${i} ${o}`)}};t.default=o},1239:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>n.str`must match "${e.ifClause}" schema`,params:({params:e})=>n._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:r,it:i}=e;void 0===r.then&&void 0===r.else&&(0,o.checkStrictMode)(i,'"if" without "then" and "else" is ignored');const a=s(i,"then"),l=s(i,"else");if(!a&&!l)return;const c=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),a&&l){const r=t.let("ifClause");e.setParams({ifClause:r}),t.if(u,f("then",r),f("else",r))}else a?t.if(u,f("then")):t.if((0,n.not)(u),f("else"));function f(r,o){return()=>{const i=e.subschema({keyword:r},u);t.assign(c,u),e.mergeValidEvaluated(i,c),o?t.assign(o,n._`${r}`):e.setParams({ifClause:r})}}e.pass(c,()=>e.error(!0))}};function s(e,t){const r=e.schema[t];return void 0!==r&&!(0,o.alwaysValidSchema)(e,r)}t.default=i},1520:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class o extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;const e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function i(e,...t){const r=[e[0]];let n=0;for(;n<t.length;)l(r,t[n]),r.push(e[++n]);return new o(r)}t._Code=o,t.nil=new o(""),t._=i;const s=new o("+");function a(e,...t){const r=[u(e[0])];let n=0;for(;n<t.length;)r.push(s),l(r,t[n]),r.push(s,u(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===s){const r=c(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}(r),new o(r)}function l(e,t){var r;t instanceof o?e.push(...t._items):t instanceof n?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function c(e,t){if('""'===t)return e;if('""'===e)return t;if("string"==typeof e){if(t instanceof n||'"'!==e[e.length-1])return;return"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0}return"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}t.str=a,t.addCodeArg=l,t.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`},t.stringify=function(e){return new o(u(e))},t.safeStringify=u,t.getProperty=function(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new o(`.${e}`):i`[${e}]`},t.getEsmExportName=function(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new o(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},t.regexpCode=function(e){return new o(e.toString())}},1860:(e,t,r)=>{"use strict";e.exports={VrpcClient:r(8577),VrpcAgent:r(6171),VrpcAdapter:r(8665)}},2017:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,o,i;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!==o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(i=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!==o--;)if(!Object.prototype.hasOwnProperty.call(r,i[o]))return!1;for(o=n;0!==o--;){var s=i[o];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},2023:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=o},2079:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},2128:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(3463),o=r(3693),i=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,o.default];t.default=i},2586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;const n=r(8727),o=r(208),i=r(7887),s=r(208),a=r(7870),l=r(3673),c=r(4495),u=r(9029),f=r(2023),h=r(6939),d=r(4227),p=r(8708);function m({gen:e,validateName:t,schema:r,schemaEnv:n,opts:o},i){o.code.es5?e.func(t,u._`${f.default.data}, ${f.default.valCxt}`,n.$async,()=>{e.code(u._`"use strict"; ${g(r,o)}`),function(e,t){e.if(f.default.valCxt,()=>{e.var(f.default.instancePath,u._`${f.default.valCxt}.${f.default.instancePath}`),e.var(f.default.parentData,u._`${f.default.valCxt}.${f.default.parentData}`),e.var(f.default.parentDataProperty,u._`${f.default.valCxt}.${f.default.parentDataProperty}`),e.var(f.default.rootData,u._`${f.default.valCxt}.${f.default.rootData}`),t.dynamicRef&&e.var(f.default.dynamicAnchors,u._`${f.default.valCxt}.${f.default.dynamicAnchors}`)},()=>{e.var(f.default.instancePath,u._`""`),e.var(f.default.parentData,u._`undefined`),e.var(f.default.parentDataProperty,u._`undefined`),e.var(f.default.rootData,f.default.data),t.dynamicRef&&e.var(f.default.dynamicAnchors,u._`{}`)})}(e,o),e.code(i)}):e.func(t,u._`${f.default.data}, ${function(e){return u._`{${f.default.instancePath}="", ${f.default.parentData}, ${f.default.parentDataProperty}, ${f.default.rootData}=${f.default.data}${e.dynamicRef?u._`, ${f.default.dynamicAnchors}={}`:u.nil}}={}`}(o)}`,n.$async,()=>e.code(g(r,o)).code(i))}function g(e,t){const r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?u._`/*# sourceURL=${r} */`:u.nil}function y({schema:e,self:t}){if("boolean"==typeof e)return!e;for(const r in e)if(t.RULES.all[r])return!0;return!1}function b(e){return"boolean"!=typeof e.schema}function _(e){(0,d.checkUnknownRules)(e),function(e){const{schema:t,errSchemaPath:r,opts:n,self:o}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,o.RULES)&&o.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function v(e,t){if(e.opts.jtd)return S(e,[],!1,t);const r=(0,o.getSchemaTypes)(e.schema);S(e,r,!(0,o.coerceAndCheckDataType)(e,r),t)}function w({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:o}){const i=r.$comment;if(!0===o.$comment)e.code(u._`${f.default.self}.logger.log(${i})`);else if("function"==typeof o.$comment){const r=u.str`${n}/$comment`,o=e.scopeValue("root",{ref:t.root});e.code(u._`${f.default.self}.opts.$comment(${i}, ${r}, ${o}.schema)`)}}function S(e,t,r,n){const{gen:o,schema:a,data:l,allErrors:c,opts:h,self:p}=e,{RULES:m}=p;function g(d){(0,i.shouldUseGroup)(a,d)&&(d.type?(o.if((0,s.checkDataType)(d.type,l,h.strictNumbers)),E(e,d),1===t.length&&t[0]===d.type&&r&&(o.else(),(0,s.reportTypeError)(e)),o.endIf()):E(e,d),c||o.if(u._`${f.default.errors} === ${n||0}`))}!a.$ref||!h.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(a,m)?(h.jtd||function(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(function(e,t){t.length&&(e.dataTypes.length?(t.forEach(t=>{k(e.dataTypes,t)||I(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){const r=[];for(const n of e.dataTypes)k(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)):e.dataTypes=t)}(e,t),e.opts.allowUnionTypes||function(e,t){t.length>1&&(2!==t.length||!t.includes("null"))&&I(e,"use allowUnionTypes to allow union type keyword")}(e,t),function(e,t){const r=e.self.RULES.all;for(const n in r){const o=r[n];if("object"==typeof o&&(0,i.shouldUseRule)(e.schema,o)){const{type:r}=o.definition;r.length&&!r.some(e=>{return n=e,(r=t).includes(n)||"number"===n&&r.includes("integer");var r,n})&&I(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(e,e.dataTypes))}(e,t),o.block(()=>{for(const e of m.rules)g(e);g(m.post)})):o.block(()=>P(e,"$ref",m.all.$ref.definition))}function E(e,t){const{gen:r,schema:n,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),r.block(()=>{for(const r of t.rules)(0,i.shouldUseRule)(n,r)&&P(e,r.keyword,r.definition,t.type)})}function k(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function I(e,t){t+=` at "${e.schemaEnv.baseId+e.errSchemaPath}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=function(e){b(e)&&(_(e),y(e))?function(e){const{schema:t,opts:r,gen:n}=e;m(e,()=>{r.$comment&&t.$comment&&w(e),function(e){const{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,d.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(f.default.vErrors,null),n.let(f.default.errors,0),r.unevaluated&&function(e){const{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",u._`${r}.evaluated`),t.if(u._`${e.evaluated}.dynamicProps`,()=>t.assign(u._`${e.evaluated}.props`,u._`undefined`)),t.if(u._`${e.evaluated}.dynamicItems`,()=>t.assign(u._`${e.evaluated}.items`,u._`undefined`))}(e),v(e),function(e){const{gen:t,schemaEnv:r,validateName:n,ValidationError:o,opts:i}=e;r.$async?t.if(u._`${f.default.errors} === 0`,()=>t.return(f.default.data),()=>t.throw(u._`new ${o}(${f.default.vErrors})`)):(t.assign(u._`${n}.errors`,f.default.vErrors),i.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof u.Name&&e.assign(u._`${t}.props`,r),n instanceof u.Name&&e.assign(u._`${t}.items`,n)}(e),t.return(u._`${f.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,n.topBoolOrEmptySchema)(e))};class A{constructor(e,t,r){if((0,l.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",x(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,l.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw new Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",f.default.errors))}result(e,t,r){this.failResult((0,u.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e)return this.error(),void(this.allErrors||this.gen.if(!1));this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);const{schemaCode:t}=this;this.fail(u._`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t)return this.setParams(t),this._error(e,r),void this.setParams({});this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw new Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=u.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=u.nil,t=u.nil){if(!this.$data)return;const{gen:r,schemaCode:n,schemaType:o,def:i}=this;r.if((0,u.or)(u._`${n} === undefined`,t)),e!==u.nil&&r.assign(e,!0),(o.length||i.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&r.assign(e,!1)),r.else()}invalid$data(){const{gen:e,schemaCode:t,schemaType:r,def:n,it:o}=this;return(0,u.or)(function(){if(r.length){if(!(t instanceof u.Name))throw new Error("ajv implementation error");const e=Array.isArray(r)?r:[r];return u._`${(0,s.checkDataTypes)(e,t,o.opts.strictNumbers,s.DataType.Wrong)}`}return u.nil}(),function(){if(n.validateSchema){const r=e.scopeValue("validate$data",{ref:n.validateSchema});return u._`!${r}(${t})`}return u.nil}())}subschema(e,t){const r=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(r,this.it,e),(0,c.extendSubschemaMode)(r,e);const o={...this.it,...r,items:void 0,props:void 0};return function(e,t){b(e)&&(_(e),y(e))?function(e,t){const{schema:r,gen:n,opts:o}=e;o.$comment&&r.$comment&&w(e),function(e){const t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,h.resolveUrl)(e.opts.uriResolver,e.baseId,t))}(e),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw new Error("async schema in sync schema")}(e);const i=n.const("_errs",f.default.errors);v(e,i),n.var(t,u._`${i} === ${f.default.errors}`)}(e,t):(0,n.boolOrEmptySchema)(e,t)}(o,t),o}mergeEvaluated(e,t){const{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=d.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=d.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){const{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,()=>this.mergeEvaluated(e,u.Name)),!0}}function P(e,t,r,n){const o=new A(e,r,t);"code"in r?r.code(o,n):o.$data&&r.validate?(0,l.funcKeywordCode)(o,r):"macro"in r?(0,l.macroKeywordCode)(o,r):(r.compile||r.validate)&&(0,l.funcKeywordCode)(o,r)}t.KeywordCxt=A;const $=/^\/(?:[^~]|~0|~1)*$/,O=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function x(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let o,i;if(""===e)return f.default.rootData;if("/"===e[0]){if(!$.test(e))throw new Error(`Invalid JSON-pointer: ${e}`);o=e,i=f.default.rootData}else{const s=O.exec(e);if(!s)throw new Error(`Invalid JSON-pointer: ${e}`);const a=+s[1];if(o=s[2],"#"===o){if(a>=t)throw new Error(l("property/index",a));return n[t-a]}if(a>t)throw new Error(l("data",a));if(i=r[t-a],!o)return i}let s=i;const a=o.split("/");for(const e of a)e&&(i=u._`${i}${(0,u.getProperty)((0,d.unescapeJsonPointer)(e))}`,s=u._`${s} && ${i}`);return s;function l(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=x},2661:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?n.str`must contain at least ${e} valid item(s)`:n.str`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?n._`{minContains: ${e}}`:n._`{minContains: ${e}, maxContains: ${t}}`},code(e){const{gen:t,schema:r,parentSchema:i,data:s,it:a}=e;let l,c;const{minContains:u,maxContains:f}=i;a.opts.next?(l=void 0===u?1:u,c=f):l=1;const h=t.const("len",n._`${s}.length`);if(e.setParams({min:l,max:c}),void 0===c&&0===l)return void(0,o.checkStrictMode)(a,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==c&&l>c)return(0,o.checkStrictMode)(a,'"minContains" > "maxContains" is always invalid'),void e.fail();if((0,o.alwaysValidSchema)(a,r)){let t=n._`${h} >= ${l}`;return void 0!==c&&(t=n._`${t} && ${h} <= ${c}`),void e.pass(t)}a.items=!0;const d=t.name("valid");function p(){const e=t.name("_valid"),r=t.let("count",0);m(e,()=>t.if(e,()=>function(e){t.code(n._`${e}++`),void 0===c?t.if(n._`${e} >= ${l}`,()=>t.assign(d,!0).break()):(t.if(n._`${e} > ${c}`,()=>t.assign(d,!1).break()),1===l?t.assign(d,!0):t.if(n._`${e} >= ${l}`,()=>t.assign(d,!0)))}(r)))}function m(r,n){t.forRange("i",0,h,t=>{e.subschema({keyword:"contains",dataProp:t,dataPropType:o.Type.Num,compositeRule:!0},r),n()})}void 0===c&&1===l?m(d,()=>t.if(d,()=>t.break())):0===l?(t.let(d,!0),void 0!==c&&t.if(n._`${s}.length > 0`,p)):(t.let(d,!1),p()),e.result(d,()=>e.reset())}};t.default=i},3025:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;const n=r(9029),o=r(4227),i=r(5765);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{const o=1===t?"property":"properties";return n.str`must have ${o} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:o}})=>n._`{property: ${e},
|
|
6
|
+
missingProperty: ${o},
|
|
7
7
|
depsCount: ${t},
|
|
8
|
-
deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),c(e,r)}};function a(e,t=e.schema){const{gen:r,data:i,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const c in t){const l=t[c];if(0===l.length)continue;const u=(0,o.propertyInData)(r,i,c,s.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(", ")}),s.allErrors?r.if(u,()=>{for(const t of l)(0,o.checkReportMissingProp)(e,t)}):(r.if(n._`${u} && (${(0,o.checkMissingProp)(e,l,a)})`),(0,o.reportMissingProp)(e,a),r.else())}}function c(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(const l in t)(0,i.alwaysValidSchema)(a,t[l])||(r.if((0,o.propertyInData)(r,n,l,a.opts.ownProperties),()=>{const t=e.subschema({keyword:s,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>r.var(c,!0)),e.ok(c))}t.validatePropertyDeps=a,t.validateSchemaDeps=c,t.default=s},3079:(e,t,r)=>{const n=r(4829),i=r(7007),o=r(576),s=r(5399),a=r(7833)("mqtt-packet:parser");class c extends i{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof c?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new c).parser(e)}_resetState(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new o,this.error=null,this._list=n(),this._stateCounter=0}parse(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}_parseHeader(){const e=this._list.readUInt8(0);return this.packet.cmd=s.types[e>>s.CMD_SHIFT],this.packet.retain=0!==(e&s.RETAIN_MASK),this.packet.qos=e>>s.QOS_SHIFT&s.QOS_MASK,this.packet.dup=0!==(e&s.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a("_parseLength %d",e.value),!!e}_parsePayload(){a("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return a("_parsePayload complete result: %s",e),e}_parseConnect(){let e,t,r,n;a("_parseConnect");const i={},o=this.packet,c=this._parseString();if(null===c)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==c&&"MQIsdp"!==c)return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=c,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),3!==o.protocolVersion&&4!==o.protocolVersion&&5!==o.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(i.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK,i.will&&(o.will={},o.will.retain=0!==(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),o.will.qos=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT),o.clean=0!==(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,o.keepalive=this._parseNum(),-1===o.keepalive)return this._emitError(new Error("Packet too short"));if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.properties=e)}const l=this._parseString();if(null===l)return this._emitError(new Error("Packet too short"));if(o.clientId=l,a("_parseConnect: packet.clientId: %s",o.clientId),i.will){if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(o.will.topic=e,a("_parseConnect: packet.will.topic: %s",o.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));o.will.payload=t,a("_parseConnect: packet.will.paylaod: %s",o.will.payload)}if(i.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));o.username=n,a("_parseConnect: packet.username: %s",o.username)}if(i.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));o.password=r}return this.settings=o,a("_parseConnect: complete"),o}_parseConnack(){a("_parseConnack");const e=this.packet;if(this._list.length<1)return null;if(e.sessionPresent=!!(this._list.readUInt8(this._pos++)&s.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");const e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){const 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)}}_parseSubscribe(){a("_parseSubscribe");const e=this.packet;let t,r,n,i,o,c,l;if(1!==e.qos)return this._emitError(new Error("Wrong subscribe header"));if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));r=this._parseByte(),n=r&s.SUBSCRIBE_OPTIONS_QOS_MASK,c=0!==(r>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),o=0!==(r>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),i=r>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,l={topic:t,qos:n},5===this.settings.protocolVersion?(l.nl=c,l.rap=o,l.rh=i):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",l),e.subscriptions.push(l)}}}_parseSuback(){a("_parseSuback");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseUnsubscribe(){a("_parseUnsubscribe");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos<e.length;){const t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){a("_parseUnsuback");const e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if(5===this.settings.protocolVersion){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;)this.packet.granted.push(this._list.readUInt8(this._pos++))}}_parseConfirmation(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion&&(e.length>2?(e.reasonCode=this._parseByte(),a("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)):e.reasonCode=0,e.length>3)){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return!0}_parseDisconnect(){const e=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?e.reasonCode=this._parseByte():e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");const e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));e.reasonCode=this._parseByte();const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a("_parseAuth: result: true"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){const t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;const n=this._list.toString("utf8",this._pos,r);return this._pos+=t,a("_parseString: result: %s",n),n}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const r=this._list.slice(this._pos,t);return this._pos+=e,a("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){a("_parseVarByteNum");let t,r=0,n=1,i=0,o=!1;const c=this._pos?this._pos:0;for(;r<4&&c+r<this._list.length;){if(t=this._list.readUInt8(c+r++),i+=n*(t&s.VARBYTEINT_MASK),n*=128,0===(t&s.VARBYTEINT_FIN_MASK)){o=!0;break}if(this._list.length<=r)break}return!o&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),c&&(this._pos+=r),o=!!o&&(e?{bytes:r,value:i}:i),a("_parseVarByteNum: result: %o",o),o}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",e),e}_parseByType(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()}}_parseProperties(){a("_parseProperties");const e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;const t=s.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));const e=this._parseByType(s.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{const n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value;continue}r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(s.propertiesTypes[t]))):r[t]=this._parseByType(s.propertiesTypes[t])}return r}_newPacket(){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 o,this._pos=0,!0}_emitError(e){a("_emitError"),this.error=e,this.emit("error",e)}}e.exports=c},3080:(e,t,r)=>{"use strict";e.exports=u;var n=r(9470).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(6888);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);c.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush(function(t,r){f(e,t,r)})}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(6698)(u,c),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new i("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},3081:(e,t,r)=>{"use strict";var n=r(2014).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},3093:(e,t,r)=>{"use strict";var n=r(4459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3126:(e,t,r)=>{"use strict";var n=r(6743),i=r(9675),o=r(76),s=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return s(n,o,e)}},3132:(e,t,r)=>{var n=r(8287).Buffer;const i=r(5399),o=n.allocUnsafe(0),s=n.from([0]),a=r(6172),c=r(3225).nextTick,l=r(7833)("mqtt-packet:writeToStream"),u=a.cache,h=a.generateNumber,f=a.generateCache,p=a.genBufVariableByteInt,d=a.generate4ByteBuffer;let m=E,y=!0;function g(e,t,r){switch(l("generate called"),t.cork&&(t.cork(),c(b,t)),y&&(y=!1,f()),l("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){const r=e||{},o=r.protocolId||"MQTT";let s=r.protocolVersion||4;const a=r.will;let c=r.clean;const l=r.keepalive||0,u=r.clientId||"",h=r.username,f=r.password,p=r.properties;void 0===c&&(c=!0);let d=0;if(!o||"string"!=typeof o&&!n.isBuffer(o))return t.emit("error",new Error("Invalid protocolId")),!1;if(d+=o.length+2,3!==s&&4!==s&&5!==s)return t.emit("error",new Error("Invalid protocol version")),!1;if(d+=1,("string"==typeof u||n.isBuffer(u))&&(u||s>=4)&&(u||c))d+=n.byteLength(u)+2;else{if(s<4)return t.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*c==0)return t.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof l||l<0||l>65535||l%1!=0)return t.emit("error",new Error("Invalid keepalive")),!1;if(d+=2,d+=1,5===s){var y=P(t,p);if(!y)return!1;d+=y.length}if(a){if("object"!=typeof a)return t.emit("error",new Error("Invalid will")),!1;if(!a.topic||"string"!=typeof a.topic)return t.emit("error",new Error("Invalid will topic")),!1;if(d+=n.byteLength(a.topic)+2,d+=2,a.payload){if(!(a.payload.length>=0))return t.emit("error",new Error("Invalid will payload")),!1;"string"==typeof a.payload?d+=n.byteLength(a.payload):d+=a.payload.length}var g={};if(5===s){if(!(g=P(t,a.properties)))return!1;d+=g.length}}let b=!1;if(null!=h){if(!T(h))return t.emit("error",new Error("Invalid username")),!1;b=!0,d+=n.byteLength(h)+2}if(null!=f){if(!b)return t.emit("error",new Error("Username is required to use password")),!1;if(!T(f))return t.emit("error",new Error("Invalid password")),!1;d+=O(f)+2}t.write(i.CONNECT_HEADER),v(t,d),I(t,o),r.bridgeMode&&(s+=128),t.write(131===s?i.VERSION131:132===s?i.VERSION132:4===s?i.VERSION4:5===s?i.VERSION5:i.VERSION3);let _=0;return _|=null!=h?i.USERNAME_MASK:0,_|=null!=f?i.PASSWORD_MASK:0,_|=a&&a.retain?i.WILL_RETAIN_MASK:0,_|=a&&a.qos?a.qos<<i.WILL_QOS_SHIFT:0,_|=a?i.WILL_FLAG_MASK:0,_|=c?i.CLEAN_SESSION_MASK:0,t.write(n.from([_])),m(t,l),5===s&&y.write(),I(t,u),a&&(5===s&&g.write(),w(t,a.topic),I(t,a.payload)),null!=h&&I(t,h),null!=f&&I(t,f),!0}(e,t);case"connack":return function(e,t,r){const o=r?r.protocolVersion:4,a=e||{},c=5===o?a.reasonCode:a.returnCode,l=a.properties;let u=2;if("number"!=typeof c)return t.emit("error",new Error("Invalid return code")),!1;let h=null;if(5===o){if(h=P(t,l),!h)return!1;u+=h.length}return t.write(i.CONNACK_HEADER),v(t,u),t.write(a.sessionPresent?i.SESSIONPRESENT_HEADER:s),t.write(n.from([c])),null!=h&&h.write(),!0}(e,t,r);case"publish":return function(e,t,r){l("publish: packet: %o",e);const s=r?r.protocolVersion:4,a=e||{},c=a.qos||0,u=a.retain?i.RETAIN_MASK:0,h=a.topic,f=a.payload||o,p=a.messageId,d=a.properties;let y=0;if("string"==typeof h)y+=n.byteLength(h)+2;else{if(!n.isBuffer(h))return t.emit("error",new Error("Invalid topic")),!1;y+=h.length+2}if(n.isBuffer(f)?y+=f.length:y+=n.byteLength(f),c&&"number"!=typeof p)return t.emit("error",new Error("Invalid messageId")),!1;c&&(y+=2);let g=null;if(5===s){if(g=P(t,d),!g)return!1;y+=g.length}return t.write(i.PUBLISH_HEADER[c][a.dup?1:0][u?1:0]),v(t,y),m(t,O(h)),t.write(h),c>0&&m(t,p),null!=g&&g.write(),l("publish: payload: %o",f),t.write(f)}(e,t,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.cmd||"puback",c=s.messageId,l=s.dup&&"pubrel"===a?i.DUP_MASK:0;let u=0;const h=s.reasonCode,f=s.properties;let p=5===o?3:2;if("pubrel"===a&&(u=1),"number"!=typeof c)return t.emit("error",new Error("Invalid messageId")),!1;let d=null;if(5===o&&"object"==typeof f){if(d=A(t,f,r,p),!d)return!1;p+=d.length}return t.write(i.ACKS[a][u][l][0]),v(t,p),m(t,c),5===o&&t.write(n.from([h])),null!==d&&d.write(),!0}(e,t,r);case"subscribe":return function(e,t,r){l("subscribe: packet: ");const o=r?r.protocolVersion:4,s=e||{},a=s.dup?i.DUP_MASK:0,c=s.messageId,u=s.subscriptions,h=s.properties;let f=0;if("number"!=typeof c)return t.emit("error",new Error("Invalid messageId")),!1;f+=2;let p=null;if(5===o){if(p=P(t,h),!p)return!1;f+=p.length}if("object"!=typeof u||!u.length)return t.emit("error",new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){const r=u[e].topic,i=u[e].qos;if("string"!=typeof r)return t.emit("error",new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof i)return t.emit("error",new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(u[e].nl||!1))return t.emit("error",new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return t.emit("error",new Error("Invalid subscriptions - invalid Retain as Published")),!1;const r=u[e].rh||0;if("number"!=typeof r||r>2)return t.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}f+=n.byteLength(r)+2+1}l("subscribe: writing to stream: %o",i.SUBSCRIBE_HEADER),t.write(i.SUBSCRIBE_HEADER[1][a?1:0][0]),v(t,f),m(t,c),null!==p&&p.write();let d=!0;for(const e of u){const r=e.topic,s=e.qos,a=+e.nl,c=+e.rap,l=e.rh;let u;w(t,r),u=i.SUBSCRIBE_OPTIONS_QOS[s],5===o&&(u|=a?i.SUBSCRIBE_OPTIONS_NL:0,u|=c?i.SUBSCRIBE_OPTIONS_RAP:0,u|=l?i.SUBSCRIBE_OPTIONS_RH[l]:0),d=t.write(n.from([u]))}return d}(e,t,r);case"suback":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,c=s.granted,l=s.properties;let u=0;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(u+=2,"object"!=typeof c||!c.length)return t.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;e<c.length;e+=1){if("number"!=typeof c[e])return t.emit("error",new Error("Invalid qos vector")),!1;u+=1}let h=null;if(5===o){if(h=A(t,l,r,u),!h)return!1;u+=h.length}return t.write(i.SUBACK_HEADER),v(t,u),m(t,a),null!==h&&h.write(),t.write(n.from(c))}(e,t,r);case"unsubscribe":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,c=s.dup?i.DUP_MASK:0,l=s.unsubscriptions,u=s.properties;let h=0;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(h+=2,"object"!=typeof l||!l.length)return t.emit("error",new Error("Invalid unsubscriptions")),!1;for(let e=0;e<l.length;e+=1){if("string"!=typeof l[e])return t.emit("error",new Error("Invalid unsubscriptions")),!1;h+=n.byteLength(l[e])+2}let f=null;if(5===o){if(f=P(t,u),!f)return!1;h+=f.length}t.write(i.UNSUBSCRIBE_HEADER[1][c?1:0][0]),v(t,h),m(t,a),null!==f&&f.write();let p=!0;for(let e=0;e<l.length;e++)p=w(t,l[e]);return p}(e,t,r);case"unsuback":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,c=s.dup?i.DUP_MASK:0,l=s.granted,u=s.properties,h=s.cmd;let f=2;if("number"!=typeof a)return t.emit("error",new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof l||!l.length)return t.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.emit("error",new Error("Invalid qos vector")),!1;f+=1}}let p=null;if(5===o){if(p=A(t,u,r,f),!p)return!1;f+=p.length}return t.write(i.ACKS[h][0][c][0]),v(t,f),m(t,a),null!==p&&p.write(),5===o&&t.write(n.from(l)),!0}(e,t,r);case"pingreq":case"pingresp":return function(e,t){return t.write(i.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,c=s.properties;let l=5===o?1:0,u=null;if(5===o){if(u=A(t,c,r,l),!u)return!1;l+=u.length}return t.write(n.from([i.codes.disconnect<<4])),v(t,l),5===o&&t.write(n.from([a])),null!==u&&u.write(),!0}(e,t,r);case"auth":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,c=s.properties;let l=5===o?1:0;5!==o&&t.emit("error",new Error("Invalid mqtt version for auth packet"));const u=A(t,c,r,l);return!!u&&(l+=u.length,t.write(n.from([i.codes.auth<<4])),v(t,l),t.write(n.from([a])),null!==u&&u.write(),!0)}(e,t,r);default:return t.emit("error",new Error("Unknown command")),!1}}function b(e){e.uncork()}Object.defineProperty(g,"cacheNumbers",{get:()=>m===E,set(e){e?(u&&0!==Object.keys(u).length||(y=!0),m=E):(y=!1,m=k)}});const _={};function v(e,t){if(t>i.VARBYTEINT_MAX)return e.emit("error",new Error(`Invalid variable byte integer: ${t}`)),!1;let r=_[t];return r||(r=p(t),t<16384&&(_[t]=r)),l("writeVarByteInt: writing to stream: %o",r),e.write(r)}function w(e,t){const r=n.byteLength(t);return m(e,r),l("writeString: %s",t),e.write(t,"utf8")}function S(e,t,r){w(e,t),w(e,r)}function E(e,t){return l("writeNumberCached: number: %d",t),l("writeNumberCached: %o",u[t]),e.write(u[t])}function k(e,t){const r=h(t);return l("writeNumberGenerated: %o",r),e.write(r)}function I(e,t){"string"==typeof t?w(e,t):t?(m(e,t.length),e.write(t)):m(e,0)}function P(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){R(e,{},0)}};let r=0;function o(t,r){let o=0;switch(i.propertiesTypes[t]){case"byte":if("boolean"!=typeof r)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case"int8":if("number"!=typeof r||r<0||r>255)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case"binary":if(r&&null===r)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=1+n.byteLength(r)+2;break;case"int16":if("number"!=typeof r||r<0||r>65535)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=3;break;case"int32":if("number"!=typeof r||r<0||r>4294967295)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=5;break;case"var":if("number"!=typeof r||r<0||r>268435455)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=1+n.byteLength(p(r));break;case"string":if("string"!=typeof r)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=3+n.byteLength(r.toString());break;case"pair":if("object"!=typeof r)return e.emit("error",new Error(`Invalid ${t}: ${r}`)),!1;o+=Object.getOwnPropertyNames(r).reduce((e,t)=>{const i=r[t];return Array.isArray(i)?e+=i.reduce((e,r)=>e+(3+n.byteLength(t.toString())+2+n.byteLength(r.toString())),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(r[t].toString()),e},0);break;default:return e.emit("error",new Error(`Invalid property ${t}: ${r}`)),!1}return o}if(t)for(const e in t){let n=0,i=0;const s=t[e];if(Array.isArray(s))for(let t=0;t<s.length;t++){if(i=o(e,s[t]),!i)return!1;n+=i}else{if(i=o(e,s),!i)return!1;n=i}if(!n)return!1;r+=n}return{length:n.byteLength(p(r))+r,write(){R(e,t,r)}}}function A(e,t,r,n){const i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0;let s=P(e,t);if(o)for(;n+s.length>o;){const r=i.shift();if(!r||!t[r])return!1;delete t[r],s=P(e,t)}return s}function $(e,t,r){switch(i.propertiesTypes[t]){case"byte":e.write(n.from([i.properties[t]])),e.write(n.from([+r]));break;case"int8":e.write(n.from([i.properties[t]])),e.write(n.from([r]));break;case"binary":e.write(n.from([i.properties[t]])),I(e,r);break;case"int16":e.write(n.from([i.properties[t]])),m(e,r);break;case"int32":e.write(n.from([i.properties[t]])),function(e,t){const r=d(t);l("write4ByteNumber: %o",r),e.write(r)}(e,r);break;case"var":e.write(n.from([i.properties[t]])),v(e,r);break;case"string":e.write(n.from([i.properties[t]])),w(e,r);break;case"pair":Object.getOwnPropertyNames(r).forEach(o=>{const s=r[o];Array.isArray(s)?s.forEach(r=>{e.write(n.from([i.properties[t]])),S(e,o.toString(),r.toString())}):(e.write(n.from([i.properties[t]])),S(e,o.toString(),s.toString()))});break;default:return e.emit("error",new Error(`Invalid property ${t} value: ${r}`)),!1}}function R(e,t,r){v(e,r);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!==t[r]){const n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)$(e,r,n[t]);else $(e,r,n)}}function O(e){return e?e instanceof n?e.length:n.byteLength(e):0}function T(e){return"string"==typeof e||e instanceof n}e.exports=g},3141:(e,t,r)=>{"use strict";var n=r(5003).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(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&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=l,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=h,t=3;break;default:return this.write=f,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function f(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.I=o,o.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||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.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}},3144:(e,t,r)=>{"use strict";var n=r(6743),i=r(1002),o=r(76),s=r(7119);e.exports=s||n.call(o,i)},3225:(e,t,r)=>{"use strict";var n=r(5606);void 0===n||!n.version||0===n.version.indexOf("v0.")||0===n.version.indexOf("v1.")&&0!==n.version.indexOf("v1.8.")?e.exports={nextTick:function(e,t,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick(function(){e.call(null,t)});case 3:return n.nextTick(function(){e.call(null,t,r)});case 4:return n.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return n.nextTick(function(){e.apply(null,o)})}}}:e.exports=n},3253:(e,t,r)=>{"use strict";var n,i=r(5606);function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(6364),a=Symbol("lastResolve"),c=Symbol("lastReject"),l=Symbol("error"),u=Symbol("ended"),h=Symbol("lastPromise"),f=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function m(e){var t=e[a];if(null!==t){var r=e[p].read();null!==r&&(e[h]=null,e[a]=null,e[c]=null,t(d(r,!1)))}}function y(e){i.nextTick(m,e)}var g=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[l];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise(function(t,r){i.nextTick(function(){e[l]?r(e[l]):t(d(void 0,!0))})});var r,n=this[h];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[u]?r(d(void 0,!0)):t[f](r,n)},n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[f])}return this[h]=r,r}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[p].destroy(null,function(e){e?r(e):t(d(void 0,!0))})})}),n),g);e.exports=function(e){var t,r=Object.create(b,(o(t={},p,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,u,{value:e._readableState.endEmitted,writable:!0}),o(t,f,{value:function(e,t){var n=r[p].read();n?(r[h]=null,r[a]=null,r[c]=null,e(d(n,!1))):(r[a]=e,r[c]=t)},writable:!0}),t));return r[h]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];return null!==t&&(r[h]=null,r[a]=null,r[c]=null,t(e)),void(r[l]=e)}var n=r[a];null!==n&&(r[h]=null,r[a]=null,r[c]=null,n(d(void 0,!0))),r[u]=!0}),e.on("readable",y.bind(null,r)),r}},3282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(4042),i=r(6144),o=r(6653),s=r(2079),a=["/properties"],c="http://json-schema.org/draft-07/schema";class l extends n.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=l,e.exports=t=l,e.exports.Ajv=l,Object.defineProperty(t,"__esModule",{value:!0}),t.default=l;var u=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var h=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return h._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return h.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return h.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return h.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return h.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return h.CodeGen}});var f=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},3439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:i,it:o}=e,s=o.opts.multipleOfPrecision,a=t.let("res"),c=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${i} === 0 || (${a} = ${r}/${i}, ${c}))`)}};t.default=i},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},3513:(e,t,r)=>{"use strict";var n=r(9470).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},3519:(e,t,r)=>{var n=r(6587);function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}e.exports=n(i),e.exports.strict=n(o),i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})})},3530:e=>{e.exports=class{constructor({subscribe:e,log:t,initialDelayMs:r=1e3,maxDelayMs:n=3e4}){this._subscribe=e,this._log=t,this._initialDelayMs=r,this._maxDelayMs=n,this._pending=new Map,this._inFlight=new Set,this._timer=null,this._attempt=0}get pending(){const e=[];for(const t of this._pending.values())e.push(...t.topics);return e}get nextDelayMs(){return Math.min(this._initialDelayMs*2**this._attempt,this._maxDelayMs)}schedule(e,t={}){if(!e||0===e.length)return;for(const t of e)this._inFlight.delete(t);const r=JSON.stringify(t),n=this._pending.get(r)||{options:t,topics:new Set};for(const t of e)n.topics.add(t);if(this._pending.set(r,n),this._timer)return;const i=this.nextDelayMs;this._log&&this._log.warn(`Retrying ${this.pending.length} refused subscription(s) in ${i} ms: ${this.pending}`),this._timer=setTimeout(()=>this._fire(),i)}granted(e){for(const t of e)this._inFlight.delete(t);for(const t of this._pending.values())for(const r of e)t.topics.delete(r);for(const[e,t]of this._pending)0===t.topics.size&&this._pending.delete(e);0!==this._pending.size||0!==this._inFlight.size||this._timer||(this._attempt=0)}cancel(){clearTimeout(this._timer),this._timer=null,this._pending.clear(),this._inFlight.clear(),this._attempt=0}_fire(){this._timer=null,this._attempt+=1;const e=Array.from(this._pending.values());this._pending.clear();for(const{topics:t}of e)for(const e of t)this._inFlight.add(e);for(const{options:t,topics:r}of e)try{this._subscribe(Array.from(r),t)}catch(e){this._log&&this._log.warn(`Retrying subscription failed: ${e.message}`),this.schedule(Array.from(r),t)}}}},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},3561:(e,t,r)=>{"use strict";r.r(t),r.d(t,{customAlphabet:()=>s,customRandom:()=>o,nanoid:()=>a,random:()=>i,urlAlphabet:()=>n});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",i=e=>crypto.getRandomValues(new Uint8Array(e)),o=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return(o=t)=>{let s="";for(;;){let t=r(i),a=0|i;for(;a--;)if(s+=e[t[a]&n]||"",s.length===o)return s}}},s=(e,t=21)=>o(e,t,i),a=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")},3616:(e,t,r)=>{"use strict";var n,i=r(9470).F,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function l(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var u,h=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var f=t.map(function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",function(){a=!0}),void 0===n&&(n=r(6364)),n(e,{readable:t,writable:i},function(e){if(e)return o(e);a=!0,o()});var c=!1;return function(t){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,function(e){u||(u=e),e&&f.forEach(c),o||(f.forEach(c),h(u))})});return t.reduce(l)}},3628:(e,t,r)=>{"use strict";var n=r(8648),i=r(1064),o=r(7176);e.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:o?function(e){return o(e)}:null},3673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9029),i=r(2023),o=r(5765),s=r(8708);function a(e){const{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,n._`${i.parentData}[${i.parentDataProperty}]`))}function c(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:i,schema:o,parentSchema:s,it:a}=e,l=t.macro.call(a.self,o,s,a),u=c(r,i,l);!1!==a.opts.validateSchema&&a.self.validateSchema(l,!0);const h=r.name("valid");e.subschema({schema:l,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:u,compositeRule:!0},h),e.pass(h,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;const{gen:l,keyword:u,schema:h,parentSchema:f,$data:p,it:d}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(d,t);const m=!p&&t.compile?t.compile.call(d.self,h,f,d):t.validate,y=c(l,u,m),g=l.let("valid");function b(r=(t.async?n._`await `:n.nil)){const s=d.opts.passContext?i.default.this:i.default.self,a=!("compile"in t&&!p||!1===t.schema);l.assign(g,n._`${r}${(0,o.callValidateCode)(e,y,s,a)}`,t.modifying)}function _(e){var r;l.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:g),e)}e.block$data(g,function(){if(!1===t.errors)b(),t.modifying&&a(e),_(()=>e.error());else{const r=t.async?function(){const e=l.let("ruleErrs",null);return l.try(()=>b(n._`await `),t=>l.assign(g,!1).if(n._`${t} instanceof ${d.ValidationError}`,()=>l.assign(e,n._`${t}.errors`),()=>l.throw(t))),e}():function(){const e=n._`${y}.errors`;return l.assign(e,null),b(n.nil),e}();t.modifying&&a(e),_(()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,()=>{r.assign(i.default.vErrors,n._`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,n._`${i.default.vErrors}.length`),(0,s.extendErrors)(e)},()=>e.error())}(e,r))}}),e.ok(null!==(r=t.valid)&&void 0!==r?r:g)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw new Error("ajv implementation error");const s=i.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[o])){const e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},3693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(4551),i=r(5765),o=r(9029),s=r(2023),a=r(3835),c=r(4227),l={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:i}=e,{baseId:s,schemaEnv:c,validateName:l,opts:f,self:p}=i,{root:d}=c;if(("#"===r||"#/"===r)&&s===d.baseId)return function(){if(c===d)return h(e,l,c,c.$async);const r=t.scopeValue("root",{ref:d});return h(e,o._`${r}.validate`,d,d.$async)}();const m=a.resolveRef.call(p,d,s,r);if(void 0===m)throw new n.default(i.opts.uriResolver,s,r);return m instanceof a.SchemaEnv?function(t){const r=u(e,t);h(e,r,t,t.$async)}(m):function(n){const i=t.scopeValue("schema",!0===f.code.source?{ref:n,code:(0,o.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):o._`${r.scopeValue("wrapper",{ref:t})}.validate`}function h(e,t,r,n){const{gen:a,it:l}=e,{allErrors:u,schemaEnv:h,opts:f}=l,p=f.passContext?s.default.this:o.nil;function d(e){const t=o._`${e}.errors`;a.assign(s.default.vErrors,o._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,o._`${s.default.vErrors}.length`)}function m(e){var t;if(!l.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==l.props)if(n&&!n.dynamicProps)void 0!==n.props&&(l.props=c.mergeEvaluated.props(a,n.props,l.props));else{const t=a.var("props",o._`${e}.evaluated.props`);l.props=c.mergeEvaluated.props(a,t,l.props,o.Name)}if(!0!==l.items)if(n&&!n.dynamicItems)void 0!==n.items&&(l.items=c.mergeEvaluated.items(a,n.items,l.items));else{const t=a.var("items",o._`${e}.evaluated.items`);l.items=c.mergeEvaluated.items(a,t,l.items,o.Name)}}n?function(){if(!h.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try(()=>{a.code(o._`await ${(0,i.callValidateCode)(e,t,p)}`),m(t),u||a.assign(r,!0)},e=>{a.if(o._`!(${e} instanceof ${l.ValidationError})`,()=>a.throw(e)),d(e),u||a.assign(r,!1)}),e.ok(r)}():e.result((0,i.callValidateCode)(e,t,p),()=>m(t),()=>d(t))}t.getValidate=u,t.callRef=h,t.default=l},3835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9029),i=r(3558),o=r(2023),s=r(6939),a=r(4227),c=r(2586);class l{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){const t=f.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:l}=this.opts.code,{ownProperties:u}=this.opts,h=new n.CodeGen(this.scope,{es5:a,lines:l,ownProperties:u});let p;e.$async&&(p=h.scopeValue("Error",{ref:i.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const d=h.scopeName("validate");e.validateName=d;const m={gen:h,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:d,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let y;try{this._compilations.add(e),(0,c.validateFunctionCode)(m),h.optimize(this.opts.code.optimize);const t=h.toString();y=`${h.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(y=this.opts.code.process(y,e));const r=new Function(`${o.default.self}`,`${o.default.scope}`,y)(this,this.scope.get());if(this.scope.value(d,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:d,validateCode:t,scopeValues:h._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,y&&this.logger.error("Error compiling schema, function code:",y),t}finally{this._compilations.delete(e)}}function h(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function f(e){for(const t of this._compilations)if(p(t,e))return t}function p(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function d(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let i=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return g.call(this,r,e);const o=(0,s.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),o===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,s.resolveUrl)(this.opts.uriResolver,i,n)),new l({schema:t,schemaId:r,root:e,baseId:i})}return g.call(this,r,a)}}t.SchemaEnv=l,t.compileSchema=u,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const i=e.refs[r];if(i)return i;let o=d.call(this,e,r);if(void 0===o){const i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;i&&(o=new l({schema:i,schemaId:s,root:e,baseId:t}))}return void 0!==o?e.refs[r]=h.call(this,o):void 0},t.getCompilingSchema=f,t.resolveSchema=m;const y=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:r,root:n}){var i;if("/"!==(null===(i=e.fragment)||void 0===i?void 0:i[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const i="object"==typeof(r=e)&&r[this.opts.schemaId];!y.has(n)&&i&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,i))}let o;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=m.call(this,n,e)}const{schemaId:c}=this.opts;return o=o||new l({schema:r,schemaId:c,root:n,baseId:t}),o.schema!==o.root.schema?o:void 0}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3853:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,i=0;for(;i<t;)n++,r=e.charCodeAt(i++),r>=55296&&r<=56319&&i<t&&(r=e.charCodeAt(i),56320==(64512&r)&&i++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},3885:(e,t,r)=>{"use strict";e.exports=r(9844)()},3966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(4227),o=r(5765),s=r(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,i.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},4003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),i=r(9029),o=r(4227),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>i.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>i._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:l}=e,{opts:u}=l;if(!c&&0===r.length)return;const h=r.length>=u.loopRequired;if(l.allErrors?function(){if(h||c)e.block$data(i.nil,f);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const o=t.let("missing");if(h||c){const r=t.let("valid",!0);e.block$data(r,()=>function(r,o){e.setParams({missingProperty:r}),t.forOf(r,s,()=>{t.assign(o,(0,n.propertyInData)(t,a,r,u.ownProperties)),t.if((0,i.not)(o),()=>{e.error(),t.break()})},i.nil)}(o,r)),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,o)),(0,n.reportMissingProp)(e,o),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,o.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,u.ownProperties),()=>e.error())})}}};t.default=s},4030:()=>{},4039:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var i=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});const o=r(3558),s=r(4551),a=r(396),c=r(3835),l=r(9029),u=r(6939),h=r(208),f=r(4227),p=r(3837),d=r(5944),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const y=["removeAdditional","useDefaults","coerceTypes"],g=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,r,n,i,o,s,a,c,l,u,h,f,p,y,g,b,_,v,w,S,E,k,I,P,A;const $=e.strict,R=null===(t=e.code)||void 0===t?void 0:t.optimize,O=!0===R||void 0===R?1:R||0,T=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:m,C=null!==(i=e.uriResolver)&&void 0!==i?i:d.default;return{strictSchema:null===(s=null!==(o=e.strictSchema)&&void 0!==o?o:$)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===c||c,strictTypes:null!==(u=null!==(l=e.strictTypes)&&void 0!==l?l:$)&&void 0!==u?u:"log",strictTuples:null!==(f=null!==(h=e.strictTuples)&&void 0!==h?h:$)&&void 0!==f?f:"log",strictRequired:null!==(y=null!==(p=e.strictRequired)&&void 0!==p?p:$)&&void 0!==y&&y,code:e.code?{...e.code,optimize:O,regExp:T}:{optimize:O,regExp:T},loopRequired:null!==(g=e.loopRequired)&&void 0!==g?g:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(k=e.validateSchema)||void 0===k||k,validateFormats:null===(I=e.validateFormats)||void 0===I||I,unicodeRegExp:null===(P=e.unicodeRegExp)||void 0===P||P,int32range:null===(A=e.int32range)||void 0===A||A,uriResolver:C}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new l.ValueScope({scope:{},prefixes:g,es5:t,lines:r}),this.logger=function(e){if(!1===e)return $;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,b,e,"NOT SUPPORTED"),S.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=A.call(this),e.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&P.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),k.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=p;"id"===r&&(n={...p},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await i.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||o.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){const r=await l.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function l(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let i;if("object"==typeof e){const{schemaId:t}=this.opts;if(i=e[t],void 0!==i&&"string"!=typeof i)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(t=c.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,u.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(O.call(this,r,t),!t)return(0,f.eachItem)(r,e=>T.call(this,e)),this;x.call(this,t);const n={...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>T.call(this,e,n):e=>n.type.forEach(t=>T.call(this,e,n,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let i=e;for(const e of t)i=i[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=j(o))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;const{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,u.normalizeId)(o||r);const l=u.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:l}),this._cache.set(a.schema,a),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function S(e,t,r,n="error"){for(const i in e){const o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function E(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function k(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function I(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function P(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function A(){const e={...this.opts};for(const t of y)delete e[t];return e}w.ValidationError=o.default,w.MissingRefError=s.default,t.default=w;const $={log(){},warn(){},error(){}},R=/^[a-z_$][a-z0-9_$:-]*$/i;function O(e,t){const{RULES:r}=this;if((0,f.eachItem)(e,e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!R.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function T(e,t,r){var n;const i=null==t?void 0:t.post;if(r&&i)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:o}=this;let s=i?o.post:o.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,h.getJSONTypes)(t.type),schemaType:(0,h.getJSONTypes)(t.schemaType)}};t.before?C.call(this,s,a,t.before):s.rules.push(a),o.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach(e=>this.addKeyword(e))}function C(e,t,r){const n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function x(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=j(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function j(e){return{anyOf:[e,N]}}},4046:(e,t,r)=>{"use strict";const n=r(7510),i=r(7041).Readable,o={objectMode:!0},s={clean:!0};function a(e){if(!(this instanceof a))return new a(e);this.options=e||{},this.options=n(s,e),this._inflights=new Map}a.prototype.put=function(e,t){return this._inflights.set(e.messageId,e),t&&t(),this},a.prototype.createStream=function(){const e=new i(o),t=[];let r=!1,n=0;return this._inflights.forEach(function(e,r){t.push(e)}),e._read=function(){!r&&n<t.length?this.push(t[n++]):this.push(null)},e.destroy=function(){if(r)return;const e=this;r=!0,setTimeout(function(){e.emit("close")},0)},e},a.prototype.del=function(e,t){return(e=this._inflights.get(e.messageId))?(this._inflights.delete(e.messageId),t(null,e)):t&&t(new Error("missing packet")),this},a.prototype.get=function(e,t){return(e=this._inflights.get(e.messageId))?t(null,e):t&&t(new Error("missing packet")),this},a.prototype.close=function(e){this.options.clean&&(this._inflights=null),e&&e()},e.exports=a},4136:(e,t,r)=>{"use strict";var n,i=r(9046).F,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function l(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var u,h=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var f=t.map(function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",function(){a=!0}),void 0===n&&(n=r(5076)),n(e,{readable:t,writable:i},function(e){if(e)return o(e);a=!0,o()});var c=!1;return function(t){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,function(e){u||(u=e),e&&f.forEach(c),o||(f.forEach(c),h(u))})});return t.reduce(l)}},4227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9029),i=r(1520);function o(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const i=n.RULES.keywords;for(const r in t)i[r]||d(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function c(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function l({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:i}){return(o,s,a,c)=>{const l=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(o,s,a):t(o,s,a),a):s instanceof n.Name?(t(o,a,s),s):r(s,a);return c!==n.Name||l instanceof n.Name?l:i(o,l)}}function u(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&h(e,r,t),r}function h(e,t,r){Object.keys(r).forEach(r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=o,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,i,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(i)}`},t.unescapeFragment=function(e){return c(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=c,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:l({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,()=>{e.if(n._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),h(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:l({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=h;const f={};var p;function d(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:f[t.code]||(f[t.code]=new i._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(p||(t.Type=p={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const i=t===p.Num;return r?i?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:i?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=d},4254:(e,t,r)=>{"use strict";var n,i=r(5606);e.exports=I,I.ReadableState=k,r(7007).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(4415),c=r(8287).Buffer,l=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(1608);o=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,p,d=r(9075),m=r(7302),y=r(3513).getHighWaterMark,g=r(9470).F,b=g.ERR_INVALID_ARG_TYPE,_=g.ERR_STREAM_PUSH_AFTER_EOF,v=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(I,a);var S=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function k(e,t,i){n=n||r(6888),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=r(3141).I),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function I(e){if(n=n||r(6888),!(this instanceof I))return new I(e);var t=this instanceof n;this._readableState=new k(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function P(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("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?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,T(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,c.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n)a.endEmitted?S(e,new w):A(e,a,t,!0);else if(a.ended)S(e,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?A(e,a,t,!1):C(e,a)):A(e,a,t,!1)}else n||(a.reading=!1,C(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&O(e)),C(e,t)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),I.prototype.destroy=m.destroy,I.prototype._undestroy=m.undestroy,I.prototype._destroy=function(e,t){t(e)},I.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),P(this,e,t,!1,r)},I.prototype.unshift=function(e){return P(this,e,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(e){h||(h=r(3141).I);var t=new h(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var $=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=$?e=$:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(T,e))}function T(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function C(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(x,e,t))}function x(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function j(e){o("readable nexttick read 0"),e.read(0)}function M(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function B(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}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(D,t,e))}function D(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}I.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):O(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},I.prototype._read=function(e){S(this,new v("_read()"))},I.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?m:c;function c(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",h),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",l);var u=!1;function h(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==F(n.pipes,e))&&!u&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){o("onerror",t),m(),e.removeListener("error",f),0===s(e,"error")&&S(e,t)}function p(){e.removeListener("finish",d),m()}function d(){o("onfinish"),e.removeListener("close",p),m()}function m(){o("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},I.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},I.prototype.on=function(e,t){var r=a.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,o("on readable",n.length,n.reading),n.length?O(this):n.reading||i.nextTick(j,this))),r},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(N,this),r},I.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(N,this),t},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(M,e,t))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(I.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(3253)),f(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),I._fromList=B,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(I.from=function(e,t){return void 0===p&&(p=r(4623)),p(I,e,t)})},4392:(e,t,r)=>{"use strict";const n=r(9749),i=r(720).t;function o(e){if(!(this instanceof o))return new o(e);e>0&&(this.aliasToTopic=new n({max:e}),this.topicToAlias={},this.numberAllocator=new i(1,e),this.max=e,this.length=0)}o.prototype.put=function(e,t){if(0===t||t>this.max)return!1;const 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.length,!0},o.prototype.getTopicByAlias=function(e){return this.aliasToTopic.get(e)},o.prototype.getAliasByTopic=function(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t},o.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},o.prototype.getLruAlias=function(){return this.numberAllocator.firstVacant()||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},e.exports=o},4415:(e,t,r)=>{e.exports=r(7007).EventEmitter},4426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),i={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=i},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:i}=e,o="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${o} ${i}`)}};t.default=i},4495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9029),i=r(4227);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:o,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const o=e.schema[t];return void 0===r?{schema:o,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,i.escapeFragment)(r)}`}}if(void 0!==o){if(void 0===s||void 0===a||void 0===c)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:o,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:l}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:c}=t;u(l.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,i.getErrorPath)(r,o,c.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(u(s instanceof n.Name?s:l.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}},4551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6939);class i extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=i},4599:()=>{},4623:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},4624:(e,t,r)=>{"use strict";var n=r(5606);const i=r(7007).EventEmitter,o=r(4046),s=r(7354),a=r(4392),c=r(1278),l=r(8840),u=r(7041).Writable,h=r(6698),f=r(7881),p=r(3885),d=r(4707),m=r(7510),y=r(7833)("mqttjs:client"),g=n?n.nextTick:function(e){setTimeout(e,0)},b=r.g.setImmediate||function(e){g(e)},_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0},v={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"};function w(e,t){let r;t.properties&&(r=t.properties.topicAlias);let n=t.topic.toString();if(0===n.length){if(void 0===r)return new Error("Unregistered Topic Alias");if(n=e.topicAliasSend.getTopicByAlias(r),void 0===n)return new Error("Unregistered Topic Alias");t.topic=n}r&&delete t.properties.topicAlias}function S(e,t,r){y("sendPacket :: packet: %O",t),y("sendPacket :: emitting `packetsend`"),e.emit("packetsend",t),y("sendPacket :: writing to stream");const n=c.writeToStream(t,e.stream,e.options);y("sendPacket :: writeToStream result %s",n),!n&&r&&r!==k?(y("sendPacket :: handle events on `drain` once through callback."),e.stream.once("drain",r)):r&&(y("sendPacket :: invoking cb"),r())}function E(e,t,r,n){y("storeAndSend :: store packet with cmd %s to outgoingStore",t.cmd);let i,o=t;if("publish"===o.cmd&&(o=p(t),i=w(e,o),i))return r&&r(i);e.outgoingStore.put(o,function(i){if(i)return r&&r(i);n(),S(e,t,r)})}function k(e){y("nop ::",e)}function I(e,t){let r;const n=this;if(!(this instanceof I))return new I(e,t);for(r in this.options=t||{},_)void 0===this.options[r]?this.options[r]=_[r]:this.options[r]=t[r];y("MqttClient :: options.protocol",t.protocol),y("MqttClient :: options.protocolVersion",t.protocolVersion),y("MqttClient :: options.username",t.username),y("MqttClient :: options.keepalive",t.keepalive),y("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),y("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),y("MqttClient :: options.topicAliasMaximum",t.topicAliasMaximum),this.options.clientId="string"==typeof t.clientId?t.clientId:"mqttjs_"+Math.random().toString(16).substr(2,8),y("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new l:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new o,this.incomingStore=t.incomingStore||new o,this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.topicAliasMaximum>0&&(t.topicAliasMaximum>65535?y("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new s(t.topicAliasMaximum)),this.on("connect",function(){const e=this.queue;y("connect :: sending queued packets"),function t(){const r=e.shift();y("deliver :: entry %o",r);let i=null;if(!r)return void n._resubscribe();i=r.packet,y("deliver :: call _sendPacket for %o",i);let o=!0;i.messageId&&0!==i.messageId&&(n.messageIdProvider.register(i.messageId)||(o=!1)),o?n._sendPacket(i,function(e){r.cb&&r.cb(e),t()}):(y("messageId: %d has already used. The message is skipped and removed.",i.messageId),t())}()}),this.on("close",function(){y("close :: connected set to `false`"),this.connected=!1,y("close :: clearing connackTimer"),clearTimeout(this.connackTimer),y("close :: clearing ping timer"),null!==n.pingTimer&&(n.pingTimer.clear(),n.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),y("close :: calling _setupReconnect"),this._setupReconnect()}),i.call(this),y("MqttClient :: setting up stream"),this._setupStream()}h(I,i),I.prototype._setupStream=function(){const e=this,t=new u,r=c.parser(this.options);let n=null;const i=[];function o(){if(i.length)g(s);else{const e=n;n=null,e()}}function s(){y("work :: getting next packet in queue");const t=i.shift();if(t)y("work :: packet pulled from queue"),e._handlePacket(t,o);else{y("work :: no packets in queue");const e=n;n=null,y("work :: done flag is %s",!!e),e&&e()}}y("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),y("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),r.on("packet",function(e){y("parser :: on packet push to packets array."),i.push(e)}),t._write=function(e,t,i){n=i,y("writable stream :: parsing buffer"),r.parse(e),s()},y("_setupStream :: pipe stream to writable stream"),this.stream.pipe(t),this.stream.on("error",function(t){y("streamErrorHandler :: error",t.message),t.code?(y("streamErrorHandler :: emitting error"),e.emit("error",t)):k(t)}),this.stream.on("close",function(){var t;y("(%s)stream :: on close",e.options.clientId),(t=e.outgoing)&&(y("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(t).forEach(function(e){t[e].volatile&&"function"==typeof t[e].cb&&(t[e].cb(new Error("Connection closed")),delete t[e])})),y("stream: emit close to MqttClient"),e.emit("close")}),y("_setupStream: sending packet `connect`");const a=Object.create(this.options);if(a.cmd="connect",this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),S(this,a),r.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return e.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket&&S(this,m({cmd:"auth",reasonCode:0},this.options.authPacket))}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){y("!!connectTimeout hit!! Calling _cleanUp with force `true`"),e._cleanUp(!0)},this.options.connectTimeout)},I.prototype._handlePacket=function(e,t){const r=this.options;if(5===r.protocolVersion&&r.properties&&r.properties.maximumPacketSize&&r.properties.maximumPacketSize<e.length)return this.emit("error",new Error("exceeding packets size "+e.cmd)),this.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),this;switch(y("_handlePacket :: emitting packetreceive"),this.emit("packetreceive",e),e.cmd){case"publish":this._handlePublish(e,t);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(e),t();break;case"pubrel":this._handlePubrel(e,t);break;case"connack":this._handleConnack(e),t();break;case"auth":this._handleAuth(e),t();break;case"pingresp":this._handlePingresp(e),t();break;case"disconnect":this._handleDisconnect(e),t()}},I.prototype._checkDisconnecting=function(e){return this.disconnecting&&(e&&e!==k?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},I.prototype.publish=function(e,t,r,n){y("publish :: message `%s` to topic `%s`",t,e);const i=this.options;if("function"==typeof r&&(n=r,r=null),r=m({qos:0,retain:!1,dup:!1},r),this._checkDisconnecting(n))return this;const o=this,s=function(){let s=0;if((1===r.qos||2===r.qos)&&(s=o._nextId(),null===s))return y("No messageId left"),!1;const a={cmd:"publish",topic:e,payload:t,qos:r.qos,retain:r.retain,messageId:s,dup:r.dup};switch(5===i.protocolVersion&&(a.properties=r.properties),y("publish :: qos",r.qos),r.qos){case 1:case 2:o.outgoing[a.messageId]={volatile:!1,cb:n||k},y("MqttClient:publish: packet cmd: %s",a.cmd),o._sendPacket(a,void 0,r.cbStorePut);break;default:y("MqttClient:publish: packet cmd: %s",a.cmd),o._sendPacket(a,n,r.cbStorePut)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,cbStorePut:r.cbStorePut,callback:n}),this},I.prototype.subscribe=function(){const e=this,t=new Array(arguments.length);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];const r=[];let n=t.shift();const i=n.resubscribe;let o=t.pop()||k,s=t.pop();const a=this.options.protocolVersion;delete n.resubscribe,"string"==typeof n&&(n=[n]),"function"!=typeof o&&(s=o,o=k);const c=d.validateTopics(n);if(null!==c)return b(o,new Error("Invalid topic "+c)),this;if(this._checkDisconnecting(o))return y("subscribe: discconecting true"),this;const l={qos:0};if(5===a&&(l.nl=!1,l.rap=!1,l.rh=0),s=m(l,s),Array.isArray(n)?n.forEach(function(t){if(y("subscribe: array topic %s",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<s.qos||i){const e={topic:t,qos:s.qos};5===a&&(e.nl=s.nl,e.rap=s.rap,e.rh=s.rh,e.properties=s.properties),y("subscribe: pushing topic `%s` and qos `%s` to subs list",e.topic,e.qos),r.push(e)}}):Object.keys(n).forEach(function(t){if(y("subscribe: object topic %s",t),!Object.prototype.hasOwnProperty.call(e._resubscribeTopics,t)||e._resubscribeTopics[t].qos<n[t].qos||i){const e={topic:t,qos:n[t].qos};5===a&&(e.nl=n[t].nl,e.rap=n[t].rap,e.rh=n[t].rh,e.properties=s.properties),y("subscribe: pushing `%s` to subs list",e),r.push(e)}}),!r.length)return o(null,[]),this;const u=function(){const t=e._nextId();if(null===t)return y("No messageId left"),!1;const n={cmd:"subscribe",subscriptions:r,qos:1,retain:!1,dup:!1,messageId:t};if(s.properties&&(n.properties=s.properties),e.options.resubscribe){y("subscribe :: resubscribe true");const t=[];r.forEach(function(r){if(e.options.reconnectPeriod>0){const n={qos:r.qos};5===a&&(n.nl=r.nl||!1,n.rap=r.rap||!1,n.rh=r.rh||0,n.properties=r.properties),e._resubscribeTopics[r.topic]=n,t.push(r.topic)}}),e.messageIdToTopic[n.messageId]=t}return e.outgoing[n.messageId]={volatile:!0,cb:function(e,t){if(!e){const e=t.granted;for(let t=0;t<e.length;t+=1)r[t].qos=e[t]}o(e,r)}},y("subscribe :: call _sendPacket"),e._sendPacket(n),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!u())&&this._storeProcessingQueue.push({invoke:u,callback:o}),this},I.prototype.unsubscribe=function(){const e=this,t=new Array(arguments.length);for(let e=0;e<arguments.length;e++)t[e]=arguments[e];let r=t.shift(),n=t.pop()||k,i=t.pop();"string"==typeof r&&(r=[r]),"function"!=typeof n&&(i=n,n=k);const o=d.validateTopics(r);if(null!==o)return b(n,new Error("Invalid topic "+o)),this;if(e._checkDisconnecting(n))return this;const s=function(){const t=e._nextId();if(null===t)return y("No messageId left"),!1;const o={cmd:"unsubscribe",qos:1,messageId:t};return"string"==typeof r?o.unsubscriptions=[r]:Array.isArray(r)&&(o.unsubscriptions=r),e.options.resubscribe&&o.unsubscriptions.forEach(function(t){delete e._resubscribeTopics[t]}),"object"==typeof i&&i.properties&&(o.properties=i.properties),e.outgoing[o.messageId]={volatile:!0,cb:n},y("unsubscribe: call _sendPacket"),e._sendPacket(o),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!s())&&this._storeProcessingQueue.push({invoke:s,callback:n}),this},I.prototype.end=function(e,t,r){const n=this;function i(){y("end :: closeStores: closing incoming and outgoing stores"),n.disconnected=!0,n.incomingStore.close(function(e){n.outgoingStore.close(function(t){if(y("end :: closeStores: emitting end"),n.emit("end"),r){const n=e||t;y("end :: closeStores: invoking callback with args"),r(n)}})}),n._deferredReconnect&&n._deferredReconnect()}function o(){y("end :: (%s) :: finish :: calling _cleanUp with force %s",n.options.clientId,e),n._cleanUp(e,()=>{y("end :: finish :: calling process.nextTick on closeStores"),g(i.bind(n))},t)}return y("end :: (%s)",this.options.clientId),null!=e&&"boolean"==typeof e||(r=t||k,t=e,e=!1,"object"!=typeof t&&(r=t,t=null,"function"!=typeof r&&(r=k))),"object"!=typeof t&&(r=t,t=null),y("end :: cb? %s",!!r),r=r||k,this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(y("end :: (%s) :: calling finish in 10ms once outgoing is empty",n.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,o,10))):(y("end :: (%s) :: immediately calling finish",n.options.clientId),o()),this)},I.prototype.removeOutgoingMessage=function(e){const t=this.outgoing[e]?this.outgoing[e].cb:null;return delete this.outgoing[e],this.outgoingStore.del({messageId:e},function(){t(new Error("Message removed"))}),this},I.prototype.reconnect=function(e){y("client reconnect");const t=this,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 o,t.outgoingStore=t.options.outgoingStore||new o,t.disconnecting=!1,t.disconnected=!1,t._deferredReconnect=null,t._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this},I.prototype._reconnect=function(){y("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),y("client already connected. disconnecting first.")):(y("_reconnect: calling _setupStream"),this._setupStream())},I.prototype._setupReconnect=function(){const e=this;!e.disconnecting&&!e.reconnectTimer&&e.options.reconnectPeriod>0?(this.reconnecting||(y("_setupReconnect :: emit `offline` state"),this.emit("offline"),y("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),y("_setupReconnect :: setting reconnectTimer for %d ms",e.options.reconnectPeriod),e.reconnectTimer=setInterval(function(){y("reconnectTimer :: reconnect triggered!"),e._reconnect()},e.options.reconnectPeriod)):y("_setupReconnect :: doing nothing...")},I.prototype._clearReconnect=function(){y("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},I.prototype._cleanUp=function(e,t){const r=arguments[2];if(t&&(y("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),y("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&(n=this.outgoing)&&(y("flush: queue exists? %b",!!n),Object.keys(n).forEach(function(e){"function"==typeof n[e].cb&&(n[e].cb(new Error("Connection closed")),delete n[e])})),y("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const e=m({cmd:"disconnect"},r);y("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,b.bind(null,this.stream.end.bind(this.stream)))}var n;this.disconnecting||(y("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(y("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),t&&!this.connected&&(y("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())},I.prototype._sendPacket=function(e,t,r){y("_sendPacket :: (%s) :: start",this.options.clientId),r=r||k,t=t||k;const n=function(e,t){if(5===e.options.protocolVersion&&"publish"===t.cmd){let r;t.properties&&(r=t.properties.topicAlias);const n=t.topic.toString();if(e.topicAliasSend)if(r){if(0!==n.length&&(y("applyTopicAlias :: register topic: %s - alias: %d",n,r),!e.topicAliasSend.put(n,r)))return y("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,r),new Error("Sending Topic Alias out of range")}else 0!==n.length&&(e.options.autoAssignTopicAlias?(r=e.topicAliasSend.getAliasByTopic(n),r?(t.topic="",t.properties={...t.properties,topicAlias:r},y("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",n,r)):(r=e.topicAliasSend.getLruAlias(),e.topicAliasSend.put(n,r),t.properties={...t.properties,topicAlias:r},y("applyTopicAlias :: auto assign topic: %s - alias: %d",n,r))):e.options.autoUseTopicAlias&&(r=e.topicAliasSend.getAliasByTopic(n),r&&(t.topic="",t.properties={...t.properties,topicAlias:r},y("applyTopicAlias :: auto use topic: %s - alias: %d",n,r))));else if(r)return y("applyTopicAlias :: error out of range. topic: %s - alias: %d",n,r),new Error("Sending Topic Alias out of range")}}(this,e);if(n)t(n);else{if(!this.connected)return"auth"===e.cmd?(this._shiftPingInterval(),void S(this,e,t)):(y("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));switch(this._shiftPingInterval(),e.cmd){case"publish":break;case"pubrel":return void E(this,e,t,r);default:return void S(this,e,t)}switch(e.qos){case 2:case 1:E(this,e,t,r);break;default:S(this,e,t)}y("_sendPacket :: (%s) :: end",this.options.clientId)}},I.prototype._storePacket=function(e,t,r){y("_storePacket :: packet: %o",e),y("_storePacket :: cb? %s",!!t),r=r||k;let n=e;if("publish"===n.cmd){n=p(e);const r=w(this,n);if(r)return t&&t(r)}0===(n.qos||0)&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):n.qos>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(new Error("No connection to broker"))},I.prototype._setupPingTimer=function(){y("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);const e=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=f(function(){e._checkPing()},1e3*this.options.keepalive))},I.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},I.prototype._checkPing=function(){y("_checkPing :: checking ping..."),this.pingResp?(y("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(y("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},I.prototype._handlePingresp=function(){this.pingResp=!0},I.prototype._handleConnack=function(e){y("_handleConnack");const t=this.options,r=5===t.protocolVersion?e.reasonCode:e.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,e.properties){if(e.properties.topicAliasMaximum){if(e.properties.topicAliasMaximum>65535)return void this.emit("error",new Error("topicAliasMaximum from broker is out of range"));e.properties.topicAliasMaximum>0&&(this.topicAliasSend=new a(e.properties.topicAliasMaximum))}e.properties.serverKeepAlive&&t.keepalive&&(t.keepalive=e.properties.serverKeepAlive,this._shiftPingInterval()),e.properties.maximumPacketSize&&(t.properties||(t.properties={}),t.properties.maximumPacketSize=e.properties.maximumPacketSize)}if(0===r)this.reconnecting=!1,this._onConnect(e);else if(r>0){const e=new Error("Connection refused: "+v[r]);e.code=r,this.emit("error",e)}},I.prototype._handleAuth=function(e){const t=this.options.protocolVersion,r=5===t?e.reasonCode:e.returnCode;if(5!==t){const e=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+t);return e.code=r,void this.emit("error",e)}const n=this;this.handleAuth(e,function(e,t){if(e)n.emit("error",e);else if(24===r)n.reconnecting=!1,n._sendPacket(t);else{const t=new Error("Connection refused: "+v[r]);e.code=r,n.emit("error",t)}})},I.prototype.handleAuth=function(e,t){t()},I.prototype._handlePublish=function(e,t){y("_handlePublish: packet %o",e),t=void 0!==t?t:k;let r=e.topic.toString();const n=e.payload,i=e.qos,o=e.messageId,s=this,a=this.options,c=[0,16,128,131,135,144,145,151,153];if(5===this.options.protocolVersion){let t;if(e.properties&&(t=e.properties.topicAlias),void 0!==t)if(0===r.length){if(!(t>0&&t<=65535))return y("_handlePublish :: topic alias out of range. alias: %d",t),void this.emit("error",new Error("Received Topic Alias is out of range"));{const e=this.topicAliasRecv.getTopicByAlias(t);if(!e)return y("_handlePublish :: unregistered topic alias. alias: %d",t),void this.emit("error",new Error("Received unregistered Topic Alias"));r=e,y("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",r,t)}}else{if(!this.topicAliasRecv.put(r,t))return y("_handlePublish :: topic alias out of range. alias: %d",t),void this.emit("error",new Error("Received Topic Alias is out of range"));y("_handlePublish :: registered topic: %s - alias: %d",r,t)}}switch(y("_handlePublish: qos %d",i),i){case 2:a.customHandleAcks(r,n,e,function(r,n){return r instanceof Error||(n=r,r=null),r?s.emit("error",r):-1===c.indexOf(n)?s.emit("error",new Error("Wrong reason code for pubrec")):void(n?s._sendPacket({cmd:"pubrec",messageId:o,reasonCode:n},t):s.incomingStore.put(e,function(){s._sendPacket({cmd:"pubrec",messageId:o},t)}))});break;case 1:a.customHandleAcks(r,n,e,function(i,a){return i instanceof Error||(a=i,i=null),i?s.emit("error",i):-1===c.indexOf(a)?s.emit("error",new Error("Wrong reason code for puback")):(a||s.emit("message",r,n,e),void s.handleMessage(e,function(e){if(e)return t&&t(e);s._sendPacket({cmd:"puback",messageId:o,reasonCode:a},t)}))});break;case 0:this.emit("message",r,n,e),this.handleMessage(e,t);break;default:y("_handlePublish: unknown QoS. Doing nothing.")}},I.prototype.handleMessage=function(e,t){t()},I.prototype._handleAck=function(e){const t=e.messageId,r=e.cmd;let n=null;const i=this.outgoing[t]?this.outgoing[t].cb:null,o=this;let s;if(i){switch(y("_handleAck :: packet type",r),r){case"pubcomp":case"puback":{const r=e.reasonCode;r&&r>0&&16!==r&&(s=new Error("Publish error: "+v[r]),s.code=r,i(s,e)),delete this.outgoing[t],this.outgoingStore.del(e,i),this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue();break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:t};const r=e.reasonCode;r&&r>0&&16!==r?(s=new Error("Publish error: "+v[r]),s.code=r,i(s,e)):this._sendPacket(n);break}case"suback":delete this.outgoing[t],this.messageIdProvider.deallocate(t);for(let r=0;r<e.granted.length;r++)if(128&e.granted[r]){const e=this.messageIdToTopic[t];e&&e.forEach(function(e){delete o._resubscribeTopics[e]})}this._invokeStoreProcessingQueue(),i(null,e);break;case"unsuback":delete this.outgoing[t],this.messageIdProvider.deallocate(t),this._invokeStoreProcessingQueue(),i(null);break;default:o.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}else y("_handleAck :: Server sent an ack in error. Ignoring.")},I.prototype._handlePubrel=function(e,t){y("handling pubrel packet"),t=void 0!==t?t:k;const r=e.messageId,n=this,i={cmd:"pubcomp",messageId:r};n.incomingStore.get(e,function(e,r){e?n._sendPacket(i,t):(n.emit("message",r.topic,r.payload,r),n.handleMessage(r,function(e){if(e)return t(e);n.incomingStore.del(r,k),n._sendPacket(i,t)}))})},I.prototype._handleDisconnect=function(e){this.emit("disconnect",e)},I.prototype._nextId=function(){return this.messageIdProvider.allocate()},I.prototype.getLastMessageId=function(){return this.messageIdProvider.getLastAllocated()},I.prototype._resubscribe=function(){y("_resubscribe");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||5===this.options.protocolVersion&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){y("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){const 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},I.prototype._onConnect=function(e){if(this.disconnected)return void this.emit("connect",e);const t=this;this.connackPacket=e,this.messageIdProvider.clear(),this._setupPingTimer(),this.connected=!0,function r(){let n=t.outgoingStore.createStream();function i(){t._storeProcessing=!1,t._packetIdsDuringStoreProcessing={}}function o(){n.destroy(),n=null,t._flushStoreProcessingQueue(),i()}t.once("close",o),n.on("error",function(e){i(),t._flushStoreProcessingQueue(),t.removeListener("close",o),t.emit("error",e)}),n.on("end",function(){let n=!0;for(const e in t._packetIdsDuringStoreProcessing)if(!t._packetIdsDuringStoreProcessing[e]){n=!1;break}n?(i(),t.removeListener("close",o),t._invokeAllStoreProcessingQueue(),t.emit("connect",e)):r()}),function e(){if(!n)return;t._storeProcessing=!0;const r=n.read(1);let i;r?t._packetIdsDuringStoreProcessing[r.messageId]?e():t.disconnecting||t.reconnectTimer?n.destroy&&n.destroy():(i=t.outgoing[r.messageId]?t.outgoing[r.messageId].cb:null,t.outgoing[r.messageId]={volatile:!1,cb:function(t,r){i&&i(t,r),e()}},t._packetIdsDuringStoreProcessing[r.messageId]=!0,t.messageIdProvider.register(r.messageId)?t._sendPacket(r):y("messageId: %d has already used.",r.messageId)):n.once("readable",e)}()}()},I.prototype._invokeStoreProcessingQueue=function(){if(this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1},I.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},I.prototype._flushStoreProcessingQueue=function(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},e.exports=I},4643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},4707:e=>{"use strict";function t(e){const t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}e.exports={validateTopics:function(e){if(0===e.length)return"empty_topic_list";for(let r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}}},4737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:i,$data:o,schema:s,schemaCode:a,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:h,self:f}=c;l.validateFormats&&(o?function(){const o=r.scopeValue("formats",{ref:f.formats,code:l.code.formats}),s=r.const("fDef",n._`${o}[${a}]`),c=r.let("fType"),u=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>r.assign(c,n._`${s}.type || "string"`).assign(u,n._`${s}.validate`),()=>r.assign(c,n._`"string"`).assign(u,s)),e.fail$data((0,n.or)(!1===l.strictSchema?n.nil:n._`${a} && !${u}`,function(){const e=h.$async?n._`(${s}.async ? await ${u}(${i}) : ${u}(${i}))`:n._`${u}(${i})`,r=n._`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return n._`${u} && ${u} !== true && ${c} === ${t} && !${r}`}()))}():function(){const o=f.formats[s];if(!o)return void function(){if(!1!==l.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}f.logger.warn(e())}();if(!0===o)return;const[a,c,p]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):l.code.formats?n._`${l.code.formats}${(0,n.getProperty)(s)}`:void 0,i=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,i]:[e.type||"string",e.validate,n._`${i}.validate`]}(o);a===t&&e.pass(function(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!h.$async)throw new Error("async format in sync schema");return n._`await ${p}(${i})`}return"function"==typeof c?n._`${p}(${i})`:n._`${p}.test(${i})`}())}())}};t.default=i},4765:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},4803:(e,t,r)=>{"use strict";var n=r(8859),i=r(9675),o=function(e,t,r){for(var n,i=e;null!=(n=i.next);i=n)if(n.key===t)return i.next=n.next,r||(n.next=e.next,e.next=n),n};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new i("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=function(e,t){if(e)return o(e,t,!0)}(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return function(e,t){if(e){var r=o(e,t);return r&&r.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!o(e,t)}(e,t)},set:function(t,r){e||(e={next:void 0}),function(e,t,r){var n=o(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(e,t,r)}};return t}},4829:(e,t,r)=>{"use strict";const n=r(6881).Duplex,i=r(6698),o=r(7813);function s(e){if(!(this instanceof s))return new s(e);if("function"==typeof e){this._callback=e;const 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}o._init.call(this,e),n.call(this)}i(s,n),Object.assign(s.prototype,o.prototype),s.prototype._new=function(e){return new s(e)},s.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},s.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)},s.prototype.end=function(e){n.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},s.prototype._isBufferList=function(e){return e instanceof s||e instanceof o||s.isBufferList(e)},s.isBufferList=o.isBufferList,e.exports=s,e.exports.BufferListStream=s,e.exports.BufferList=o},4834:e=>{"use strict";const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),48!==r){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}const i=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(e){return e.length=0,!0}function s(e,t,r){if(e.length){const i=n(e);if(""===i)return r.error=!0,!1;t.push(i),e.length=0}return!0}function a(e){if(function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(e)<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},i=[],a=[];let c=!1,l=!1,u=s;for(let n=0;n<e.length;n++){const s=e[n];if("["!==s&&"]"!==s)if(":"!==s)if("%"===s){if(!u(a,i,r))break;u=o}else a.push(s);else{if(!0===c&&(l=!0),!u(a,i,r))break;if(++t>7){r.error=!0;break}n>0&&":"===e[n-1]&&(c=!0),i.push(":")}}return a.length&&(u===o?r.zone=a.join(""):l?i.push(a.join("")):i.push(n(a))),r.address=i.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}e.exports={nonSimpleDomain:i,recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!r(n)){const t=a(n);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e;const r=[];let n=-1,i=0;for(;i=t.length;){if(1===i){if("."===t)break;if("/"===t){r.push("/");break}r.push(t);break}if(2===i){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===i&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(n=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")},isIPv4:r,isUUID:t,normalizeIPv6:a,stringArrayToHexStripped:n}},5003:(e,t,r)=>{var n=r(8287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},5076:(e,t,r)=>{"use strict";var n=r(9046).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||u()},l=t._writableState&&t._writableState.finished,u=function(){a=!1,l=!0,s||o.call(t)},h=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,h=!0,a||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return s&&!h?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",d),t.req?m():t.on("request",m)):a&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",f),t.on("finish",u),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",u),t.removeListener("abort",d),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",u),t.removeListener("end",f),t.removeListener("error",p),t.removeListener("close",d)}}},5240:(e,t,r)=>{"use strict";var n=r(5606),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var o=r(1438),s=r(626);r(6698)(u,o);for(var a=i(s.prototype),c=0;c<a.length;c++){var l=a[c];u.prototype[l]||(u.prototype[l]=s.prototype[l])}function u(e){if(!(this instanceof u))return new u(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},5332:e=>{e.exports=function(e){var t=e._readableState;return t?t.objectMode||"number"==typeof e._duplexState?e.read():e.read(function(e){if(e.buffer.length){var t=e.bufferIndex||0;if(e.buffer.head)return e.buffer.head.data.length;if(e.buffer.length-t>0&&e.buffer[t])return e.buffer[t].length}return e.length}(t)):null}},5333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),i=r(9029),o=r(4227),s=r(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:c,it:l}=e,{opts:u}=l,h=(0,n.allSchemaProperties)(r),f=h.filter(e=>(0,o.alwaysValidSchema)(l,r[e]));if(0===h.length||f.length===h.length&&(!l.opts.unevaluated||!0===l.props))return;const p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,d=t.name("valid");!0===l.props||l.props instanceof i.Name||(l.props=(0,s.evaluatedPropsToName)(t,l.props));const{props:m}=l;function y(e){for(const t in p)new RegExp(e).test(t)&&(0,o.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function g(r){t.forIn("key",a,o=>{t.if(i._`${(0,n.usePattern)(e,r)}.test(${o})`,()=>{const n=f.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:o,dataPropType:s.Type.Str},d),l.opts.unevaluated&&!0!==m?t.assign(i._`${m}[${o}]`,!0):n||l.allErrors||t.if((0,i.not)(d),()=>t.break())})})}!function(){for(const e of h)p&&y(e),l.allErrors?g(e):(t.var(d,!0),g(e),t.if(d))}()}};t.default=a},5345:e=>{"use strict";e.exports=URIError},5354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),i={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=i},5373:(e,t,r)=>{"use strict";var n=r(8636),i=r(2642),o=r(4765);e.exports={formats:o,parse:i,stringify:n}},5399:(e,t,r)=>{var n=r(8287).Buffer;const i=e.exports;i.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"},i.codes={};for(const e in i.types){const t=i.types[e];i.codes[t]=e}i.CMD_SHIFT=4,i.CMD_MASK=240,i.DUP_MASK=8,i.QOS_MASK=3,i.QOS_SHIFT=1,i.RETAIN_MASK=1,i.VARBYTEINT_MASK=127,i.VARBYTEINT_FIN_MASK=128,i.VARBYTEINT_MAX=268435455,i.SESSIONPRESENT_MASK=1,i.SESSIONPRESENT_HEADER=n.from([i.SESSIONPRESENT_MASK]),i.CONNACK_HEADER=n.from([i.codes.connack<<i.CMD_SHIFT]),i.USERNAME_MASK=128,i.PASSWORD_MASK=64,i.WILL_RETAIN_MASK=32,i.WILL_QOS_MASK=24,i.WILL_QOS_SHIFT=3,i.WILL_FLAG_MASK=4,i.CLEAN_SESSION_MASK=2,i.CONNECT_HEADER=n.from([i.codes.connect<<i.CMD_SHIFT]),i.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},i.propertiesCodes={};for(const e in i.properties){const t=i.properties[e];i.propertiesCodes[t]=e}function o(e){return[0,1,2].map(t=>[0,1].map(r=>[0,1].map(o=>{const s=n.alloc(1);return s.writeUInt8(i.codes[e]<<i.CMD_SHIFT|(r?i.DUP_MASK:0)|t<<i.QOS_SHIFT|o,0,!0),s})))}i.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"},i.PUBLISH_HEADER=o("publish"),i.SUBSCRIBE_HEADER=o("subscribe"),i.SUBSCRIBE_OPTIONS_QOS_MASK=3,i.SUBSCRIBE_OPTIONS_NL_MASK=1,i.SUBSCRIBE_OPTIONS_NL_SHIFT=2,i.SUBSCRIBE_OPTIONS_RAP_MASK=1,i.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,i.SUBSCRIBE_OPTIONS_RH_MASK=3,i.SUBSCRIBE_OPTIONS_RH_SHIFT=4,i.SUBSCRIBE_OPTIONS_RH=[0,16,32],i.SUBSCRIBE_OPTIONS_NL=4,i.SUBSCRIBE_OPTIONS_RAP=8,i.SUBSCRIBE_OPTIONS_QOS=[0,1,2],i.UNSUBSCRIBE_HEADER=o("unsubscribe"),i.ACKS={unsuback:o("unsuback"),puback:o("puback"),pubcomp:o("pubcomp"),pubrel:o("pubrel"),pubrec:o("pubrec")},i.SUBACK_HEADER=n.from([i.codes.suback<<i.CMD_SHIFT]),i.VERSION3=n.from([3]),i.VERSION4=n.from([4]),i.VERSION5=n.from([5]),i.VERSION131=n.from([131]),i.VERSION132=n.from([132]),i.QOS=[0,1,2].map(e=>n.from([e])),i.EMPTY={pingreq:n.from([i.codes.pingreq<<4,0]),pingresp:n.from([i.codes.pingresp<<4,0]),disconnect:n.from([i.codes.disconnect<<4,0])}},5457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9029),i=r(4227),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,i.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:o,data:s,keyword:a,it:c}=e;c.items=!0;const l=r.const("len",n._`${s}.length`);if(!1===o)e.setParams({len:t.length}),e.pass(n._`${l} <= ${t.length}`);else if("object"==typeof o&&!(0,i.alwaysValidSchema)(c,o)){const o=r.var("valid",n._`${l} <= ${t.length}`);r.if((0,n.not)(o),()=>function(o){r.forRange("i",t.length,l,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:i.Type.Num},o),c.allErrors||r.if((0,n.not)(o),()=>r.break())})}(o)),e.ok(o)}}t.validateAdditionalItems=s,t.default=o},5542:(e,t,r)=>{"use strict";var n=r(5606);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},5606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,c=[],l=!1,u=-1;function h(){l&&a&&(l=!1,a.length?c=a.concat(c):u=-1,c.length&&f())}function f(){if(!l){var e=s(h);l=!0;for(var t=c.length;t;){for(a=c,c=[];++u<t;)a&&a[u].run();u=-1,t=c.length}a=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function d(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||l||s(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=d,n.addListener=d,n.once=d,n.off=d,n.removeListener=d,n.removeAllListeners=d,n.emit=d,n.prependListener=d,n.prependOnceListener=d,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9029),i=r(4227),o=r(2023),s=r(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function c(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function l(e,t,r,i){const o=n._`${t}${(0,n.getProperty)(r)} === undefined`;return i?(0,n.or)(o,(0,n.not)(c(e,t,r))):o}function u(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:i,it:o}=e;r.if(l(r,i,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},i,o){return(0,n.or)(...i.map(i=>(0,n.and)(l(e,t,i,r.ownProperties),n._`${o} = ${i}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=c,t.propertyInData=function(e,t,r,i){const o=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return i?n._`${o} && ${c(e,t,r)}`:o},t.noPropertyInData=l,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter(r=>!(0,i.alwaysValidSchema)(e,t[r]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:s,errorPath:a},it:c},l,u,h){const f=h?n._`${e}, ${t}, ${i}${s}`:t,p=[[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,a)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&p.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);const d=n._`${f}, ${r.object(...p)}`;return u!==n.nil?n._`${l}.call(${u}, ${d})`:n._`${l}(${d})`};const h=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const i=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(r,i);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===o.code?h:(0,s.useFunc)(e,o)}(${r}, ${i})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:o,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return c(()=>t.assign(e,!1)),e}return t.var(a,!0),c(()=>t.break()),a;function c(s){const c=t.const("len",n._`${r}.length`);t.forRange("i",0,c,r=>{e.subschema({keyword:o,dataProp:r,dataPropType:i.Type.Num},a),t.if((0,n.not)(a),s)})}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:o,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(e=>(0,i.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((r,i)=>{const s=e.subschema({keyword:o,schemaProp:i,compositeRule:!0},c);t.assign(a,n._`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}},5795:(e,t,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},5844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),i={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const o=t.name("valid");r.forEach((t,r)=>{if((0,n.alwaysValidSchema)(i,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},o);e.ok(o),e.mergeEvaluated(s)})}};t.default=i},5880:e=>{"use strict";e.exports=Math.pow},5882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=n.operators,o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${o[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:i}=e;e.fail$data(n._`${r} ${o[t].fail} ${i} || isNaN(${r})`)}};t.default=a},5944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8343);n.code='require("ajv/dist/runtime/uri").default',t.default=n},6144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2128),i=r(7060),o=r(6378),s=r(7532),a=r(9857),c=[n.default,i.default,(0,o.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(4227),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:o,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&o.discriminator)return;const a=r,c=t.let("valid",!1),l=t.let("passing",null),u=t.name("_valid");e.setParams({passing:l}),t.block(function(){a.forEach((r,o)=>{let a;(0,i.alwaysValidSchema)(s,r)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},u),o>0&&t.if(n._`${u} && ${c}`).assign(c,!1).assign(l,n._`[${l}, ${o}]`).else(),t.if(u,()=>{t.assign(c,!0),t.assign(l,o),a&&e.mergeEvaluated(a,n.Name)})})}),e.result(c,()=>e.reset(),()=>e.error(!0))}};t.default=o},6171:(e,t,r)=>{const n=r(1072),i=r(510),o=r(8665),s=r(7007),{nanoid:a}=r(3561);class c extends s{constructor({username:e,password:t,token:r,domain:n="vrpc",agent:i=a(8),broker:s="mqtts://broker.hivemq.com:8883",log:l="console",bestEffort:u=!1,version:h="",mqttClientId:f=null}={}){super(),this._validateDomain(n),this._validateAgent(i),this._username=e,this._password=t,this._token=r,this._agent=i,this._domain=n,this._broker=s,this._qos=u?0:1,this._version=h,this._mqttClientId=f||`va3${c._createHash(this._domain+this._agent)}`,"console"===l?(this._log=console,this._log.debug=()=>{}):this._log=l,this._baseTopic=`${this._domain}/${this._agent}`,o.onCallback(this._handleVrpcCallback.bind(this)),this._isolatedInstances=new Map,this._sharedInstances=new Map,this.on("error",e=>{this._log.debug(`Encountered an error: ${e.message}`)})}async serve(){let e=this._username,t=this._password;return this._token?(e=`${this._domain}/${this._agent}`,t=this._token):this._password||(e=`${this._domain}/${this._agent}`,t=a()),this._options={username:e,password:t,keepalive:30,connectTimeout:1e4,clientId:this._mqttClientId,rejectUnauthorized:!1,will:{topic:`${this._baseTopic}/__agentInfo__`,payload:this._createAgentInfoPayload({status:"offline"}),qos:this._qos,retain:!0}},this._log.info(`Domain : ${this._domain}`),this._log.info(`Agent : ${this._agent}`),this._log.info(`Broker : ${this._broker}`),this._log.info("Connecting to MQTT server..."),this._client=i.connect(this._broker,this._options),this._client.on("connect",this._handleConnect.bind(this)),this._client.on("reconnect",this._handleReconnect.bind(this)),this._client.on("error",this._handleError.bind(this)),this._client.on("message",this._handleMessage.bind(this)),this._client.on("close",this._handleClose.bind(this)),this._client.on("offline",this._handleOffline.bind(this)),this._client.on("end",this._handleEnd.bind(this)),this._ensureConnected()}async end({unregister:e=!1}={}){try{if(!this._client||!this._client.connected)return void this.emit("end");const t=`${this._baseTopic}/__agentInfo__`;if(this._mqttPublish(t,this._createAgentInfoPayload({status:"offline"}),{retain:!0}),e){this._mqttPublish(t,null,{retain:!0});const e=this._getClasses();for(const t of e){const e=`${this._baseTopic}/${t}/__classInfo__`;this._mqttPublish(e,null,{retain:!0})}}await new Promise(e=>this._client.end(!1,{},e))}catch(e){this._log.error(e,`Problem during disconnecting agent: ${e.message}`)}}static _createHash(e,t=20){let r=5381,n=52711;for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);r=33*r^i,n=33*n^i}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_validateDomain(e){if(!e)throw new Error("The domain must be specified");if(e.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"')}_validateAgent(e){if(!e)throw new Error("The agent must be specified");if(e.match(/[+/#*]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#", "*"')}_createAgentInfoPayload({status:e}){return JSON.stringify({status:e,hostname:n.hostname(),version:this._version,v:3})}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&this._log.warn(`Could not publish MQTT message because: ${e.message}`)})}_mqttSubscribe(e,t){this._client.subscribe(e,{qos:this._qos,...t},(r,n)=>{if(r)this._log.warn(`Could not subscribe to topic(s) '${e}', because: ${r.message}`);else{const i=Array.isArray(e)?e:[e],o=n.filter(e=>128===e.qos).map(e=>e.topic);o.length>0&&((r=new Error(`Could not subscribe all ${i.length} topic(s) but got error qos=128 on following ${o.length} topic(s): ${o}`)).code="SUBSCRIBE_FAILED",r.subscribeOptions=t,this._log.error(r),this.emit("error",r));const s=n.filter(e=>e.qos<this._qos);s.length>0&&((r=new Error(`Could not subscribe all ${i.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${s.length} topic(s): ${JSON.stringify(s)}`)).code="SUBSCRIBE_REDUCED_QOS",r.subscribeOptions=t,this._log.warn(r),this.emit("error",r)),0===n.length&&this._log.debug(`Already subscribed to topic '${e}'`)}})}_mqttUnsubscribe(e,t){this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`)})}_getClasses(){return o._getClassesArray()}_getInstances(e){return o._getInstancesArray(e)}_getMemberFunctions(e){return o._getMemberFunctionsArray(e)}_getStaticFunctions(e){return o._getStaticFunctionsArray(e)}_getMetaData(e){return o._getMetaData(e)}async _ensureConnected(){return new Promise(e=>{this._client.connected?e():(this._client.once("connect",e),this.once("end",e))})}_handleVrpcCallback(e){const{s:t,i:r,r:n,e:i,a:o}=e,s=r.startsWith("__e__")?r.slice(5):t;try{this._log.debug(`Forwarding callback to: ${s} with payload:`,e),this._mqttPublish(s,c._stringifySafely({a:o,r:n,e:i,i:r,v:3}))}catch(e){this._log.warn(e,`Problem publishing vrpc callback to ${s} because of: ${e.message}`)}}static _stringifySafely(e){let t;const{c:r,f:n}=e;try{t=JSON.stringify(e)}catch(i){this._log.debug(`Failed serialization of return value for: ${r}::${n}, because: ${i.message}`),e.r="__vrpc::not-serializable__",t=JSON.stringify(e)}return t}_handleConnect(){this._log.info("[OK]");try{const e=this._generateTopics();e.length>0&&this._mqttSubscribe(e)}catch(e){this._log.error(e,`Problem during initial topic subscription: ${e.message}`)}this._publishAgentInfoMessage(),this._getClasses().forEach(e=>{this._publishClassInfoMessage(e)});for(const[e,{className:t}]of o._instances.entries())this._subscribeToMethodsOfNewInstance(t,e);this.emit("connect")}_publishAgentInfoMessage(){this._mqttPublish(`${this._baseTopic}/__agentInfo__`,this._createAgentInfoPayload({status:"online"}),{retain:!0})}_publishClassInfoMessage(e){const t={className:e,instances:this._getInstances(e),memberFunctions:this._getMemberFunctions(e),staticFunctions:this._getStaticFunctions(e),meta:this._getMetaData(e),v:3};try{this._mqttPublish(`${this._baseTopic}/${e}/__classInfo__`,JSON.stringify(t),{retain:!0})}catch(e){this._log.error(e,`Problem during publishing class info: ${e.message}`)}}_generateTopics(){const e=[],t=this._getClasses();return t.length>0?this._log.info(`Registering classes: ${t.join(", ")}`):this._log.warn("No classes are registered"),t.forEach(t=>{this._getStaticFunctions(t).forEach(r=>{e.push(`${this._baseTopic}/${t}/__static__/${r}`)})}),e}_handleMessage(e,t){try{const r=JSON.parse(t.toString());this._log.debug(`Message arrived with topic: ${e} and payload:`,r);const n=e.split("/"),[,,i,s,a]=n;if(4===n.length&&"__clientInfo__"===n[3])return void this._handleClientInfoMessage(e,r);if(5!==n.length)return void this._log.warn(`Ignoring message with invalid topic: ${e}`);switch(r.c="__static__"===s?i:s,r.f=a,o._call(r)&&this._mqttSubscribe(`${r.s}/__clientInfo__`),a){case"__createIsolated__":{const e=r.r;this._subscribeToMethodsOfNewInstance(i,e),this._registerIsolatedInstance(e,r.s);break}case"__createShared__":{const e=r.r;this._hasSharedInstance(e)||(this._subscribeToMethodsOfNewInstance(i,e),this._publishClassInfoMessage(i)),this._registerSharedInstance(e,r.s);break}case"__delete__":this._unsubscribeMethodsOfDeletedInstance(i,s),this._unregisterInstance(r.a[0],r.s)&&this._publishClassInfoMessage(i)}const{a:l,r:u,e:h,i:f,v:p}=r,d=h?{a:l,r:u,e:h,i:f,v:p}:{a:l,r:u,i:f,v:p};this._mqttPublish(r.s,c._stringifySafely(d))}catch(e){this._log.error(e,`Problem while handling incoming message: ${e.message}`)}}_handleClientInfoMessage(e,t){const r=e.slice(0,-15);if("offline"===t.status){o._unregisterClient(r);const e=this._isolatedInstances.get(r);e&&e.forEach(e=>{const t={f:"__delete__",a:[e],r:null,s:o.LOCAL_SENDER};o._call(t),t.r&&this._log.debug(`Auto-deleted isolated instance: ${e}`)}),this._mqttUnsubscribe(`${r}/__clientInfo__`),this.emit("clientGone",r,{clientId:t.clientId})}}_registerIsolatedInstance(e,t){const r=this._isolatedInstances.get(t);r?r.add(e):(this._isolatedInstances.set(t,new Set([e])),this._sharedInstances.has(t)||this._mqttSubscribe(`${t}/__clientInfo__`),this._log.info(`Tracking lifetime of client: ${t}`))}_registerSharedInstance(e,t){const r=this._sharedInstances.get(t);r?r.add(e):(this._sharedInstances.set(t,new Set([e])),this._isolatedInstances.has(t)||this._mqttSubscribe(`${t}/__clientInfo__`),this._log.debug(`Tracking lifetime of client: ${t}`))}_hasSharedInstance(e){for(const[,t]of this._sharedInstances)if(t.has(e))return!0;return!1}_unregisterInstance(e,t){const r=this._isolatedInstances.get(t);if(r&&r.has(e))return r.delete(e),0===r.size&&(this._isolatedInstances.delete(t),this._mqttUnsubscribe(`${t}/__clientInfo__`),this._log.debug(`Stopped tracking lifetime of client: ${t}`)),!1;let n=!1;return this._sharedInstances.forEach(async r=>{r.has(e)&&(n=!0,r.delete(e),0===r.size&&(this._sharedInstances.delete(t),this._mqttUnsubscribe(`${t}/__clientInfo__`),this._log.debug(`Stopped tracking lifetime of client: ${t}`)))}),!!n||(this._log.warn(`Failed un-registering not registered instance: ${e}`),!1)}_subscribeToMethodsOfNewInstance(e,t){const r=`${this._baseTopic}/${e}/${t}/+`;this._mqttSubscribe(r),this._log.debug(`Subscribed to new topic after instantiation: ${r}`)}_unsubscribeMethodsOfDeletedInstance(e,t){const r=`${this._baseTopic}/${e}/${t}/+`;this._mqttUnsubscribe(r),this._log.debug(`Unsubscribed from topic after deletion: ${r}`)}_handleReconnect(){this._log.warn(`Reconnecting to ${this._broker}`),this.emit("reconnect")}_handleError(e){this.emit("error",e)}_handleClose(){this.emit("close")}_handleOffline(){this.emit("offline")}_handleEnd(){this.emit("end")}}e.exports=c},6172:(e,t,r)=>{var n=r(8287).Buffer;const i={},o=n.isBuffer(n.from([1,2]).subarray(0,1));function s(e){const t=n.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}e.exports={cache:i,generateCache:function(){for(let e=0;e<65536;e++)i[e]=s(e)},generateNumber:s,genBufVariableByteInt:function(e){let t=0,r=0;const 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){const t=n.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}},6188:e=>{"use strict";e.exports=Math.max},6250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2017);n.code='require("ajv/dist/runtime/equal").default',t.default=n},6364:(e,t,r)=>{"use strict";var n=r(9470).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||u()},l=t._writableState&&t._writableState.finished,u=function(){a=!1,l=!0,s||o.call(t)},h=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,h=!0,a||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return s&&!h?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",d),t.req?m():t.on("request",m)):a&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",f),t.on("finish",u),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",u),t.removeListener("abort",d),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",u),t.removeListener("end",f),t.removeListener("error",p),t.removeListener("close",d)}}},6378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5457),i=r(5354),o=r(494),s=r(3966),a=r(2661),c=r(3025),l=r(9713),u=r(8660),h=r(117),f=r(5333),p=r(7923),d=r(6505),m=r(6163),y=r(5844),g=r(1239),b=r(4426);t.default=function(e=!1){const t=[p.default,d.default,m.default,y.default,g.default,b.default,l.default,u.default,c.default,h.default,f.default];return e?t.push(i.default,s.default):t.push(n.default,o.default),t.push(a.default),t}},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,r)=>{"use strict";var n=r(453),i=r(3126),o=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i([r]):r}},6585:e=>{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i;function s(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,a){a=a||{};var c,l,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\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(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(c=e,(l=Math.abs(c))>=i?s(c,l,i,"day"):l>=n?s(c,l,n,"hour"):l>=r?s(c,l,r,"minute"):l>=t?s(c,l,t,"second"):c+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6587:e=>{e.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach(function(e){n[e]=i[e]}),n}}},6608:(e,t,r)=>{"use strict";e.exports=u;var n=r(9046).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(7920);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);c.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush(function(t,r){f(e,t,r)})}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(6698)(u,c),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new i("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},6611:(e,t,r)=>{var n=r(5606),i=r(3519),o=function(){},s=r.g.Bare?queueMicrotask:n.nextTick.bind(n),a=function(e,t,r){if("function"==typeof t)return a(e,null,t);t||(t={}),r=i(r||o);var n=e._writableState,c=e._readableState,l=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,h=!1,f=function(){e.writable||p()},p=function(){u=!1,l||r.call(e)},d=function(){l=!1,u||r.call(e)},m=function(t){r.call(e,t?new Error("exited with error code: "+t):null)},y=function(t){r.call(e,t)},g=function(){s(b)},b=function(){if(!h)return(!l||c&&c.ended&&!c.destroyed)&&(!u||n&&n.ended&&!n.destroyed)?void 0:r.call(e,new Error("premature close"))},_=function(){e.req.on("finish",p)};return function(e){return e.setHeader&&"function"==typeof e.abort}(e)?(e.on("complete",p),e.on("abort",g),e.req?_():e.on("request",_)):u&&!n&&(e.on("end",f),e.on("close",f)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",m),e.on("end",d),e.on("finish",p),!1!==t.error&&e.on("error",y),e.on("close",g),function(){h=!0,e.removeListener("complete",p),e.removeListener("abort",g),e.removeListener("request",_),e.req&&e.req.removeListener("finish",p),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("exit",m),e.removeListener("end",d),e.removeListener("error",y),e.removeListener("close",g)}};e.exports=a},6653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(7652),o=r(3835),s=r(4551),a=r(4227),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:c,parentSchema:l,it:u}=e,{oneOf:h}=l;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const f=c.propertyName;if("string"!=typeof f)throw new Error("discriminator: requires propertyName");if(c.mapping)throw new Error("discriminator: mapping is not supported");if(!h)throw new Error("discriminator: requires oneOf keyword");const p=t.let("valid",!1),d=t.const("tag",n._`${r}${(0,n.getProperty)(f)}`);function m(r){const i=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:r},i);return e.mergeEvaluated(o,n.Name),i}t.if(n._`typeof ${d} == "string"`,()=>function(){const r=function(){var e;const t={},r=i(l);let n=!0;for(let t=0;t<h.length;t++){let l=h[t];if((null==l?void 0:l.$ref)&&!(0,a.schemaHasRulesButRef)(l,u.self.RULES)){const e=l.$ref;if(l=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),l instanceof o.SchemaEnv&&(l=l.schema),void 0===l)throw new s.default(u.opts.uriResolver,u.baseId,e)}const p=null===(e=null==l?void 0:l.properties)||void 0===e?void 0:e[f];if("object"!=typeof p)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n=n&&(r||i(l)),c(p,t)}if(!n)throw new Error(`discriminator: "${f}" must be required`);return t;function i({required:e}){return Array.isArray(e)&&e.includes(f)}function c(e,t){if(e.const)p(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${f}" must have "const" or "enum"`);for(const r of e.enum)p(r,t)}}function p(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${f}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${d} === ${e}`),t.assign(p,m(r[e]));t.else(),e.error(!1,{discrError:i.DiscrError.Mapping,tag:d,tagName:f}),t.endIf()}(),()=>e.error(!1,{discrError:i.DiscrError.Tag,tag:d,tagName:f})),e.ok(p)}};t.default=c},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6743:(e,t,r)=>{"use strict";var n=r(9353);e.exports=Function.prototype.bind||n},6881:(e,t,r)=>{(t=e.exports=r(1438)).Stream=t,t.Readable=t,t.Writable=r(626),t.Duplex=r(5240),t.Transform=r(9816),t.PassThrough=r(186),t.finished=r(7452),t.pipeline=r(80)},6888:(e,t,r)=>{"use strict";var n=r(5606),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var o=r(4254),s=r(9026);r(6698)(u,o);for(var a=i(s.prototype),c=0;c<a.length;c++){var l=a[c];u.prototype[l]||(u.prototype[l]=s.prototype[l])}function u(e){if(!(this instanceof u))return new u(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},6909:e=>{"use strict";e.exports=RangeError},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(4227),i=r(2017),o=r(7106),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!c(e):!!t&&l(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function c(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(c))return!0;if("object"==typeof r&&c(r))return!0}return!1}function l(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],e=>t+=l(e)),t===1/0))return 1/0}return t}function u(e,t="",r){!1!==r&&(t=p(t));const n=e.parse(t);return h(e,n)}function h(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=h;const f=/#\/?$/;function p(e){return e?e.replace(f,""):""}t.normalizeId=p,t.resolveUrl=function(e,t,r){return r=p(r),e.resolve(t,r)};const d=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=p(e[r]||t),a={"":s},c=u(n,s,!1),l={},h=new Set;return o(e,{allKeys:!0},(e,t,n,i)=>{if(void 0===i)return;const o=c+t;let s=a[i];function u(t){const r=this.opts.uriResolver.resolve;if(t=p(s?r(s,t):t),h.has(t))throw m(t);h.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?f(e,n.schema,t):t!==p(o)&&("#"===t[0]?(f(e,l[t],t),l[t]=e):this.refs[t]=o),t}function y(e){if("string"==typeof e){if(!d.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=u.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s}),l;function f(e,t,r){if(void 0!==t&&!i(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var i,o,s,l;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,l=u,console&&console.warn&&console.warn(l)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function f(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):d(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.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},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(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},o.prototype.getMaxListeners=function(){return c(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var l=c.length,u=d(c,l);for(r=0;r<l;++r)n(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,h(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,h(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.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},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7041:(e,t,r)=>{(t=e.exports=r(4254)).Stream=t,t.Readable=t,t.Writable=r(9026),t.Duplex=r(6888),t.Transform=r(3080),t.PassThrough=r(9290),t.finished=r(6364),t.pipeline=r(3616)},7060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5882),i=r(3439),o=r(7307),s=r(422),a=r(4486),c=r(4003),l=r(1163),u=r(617),h=r(7935),f=r(8643),p=[n.default,i.default,o.default,s.default,a.default,c.default,l.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},h.default,f.default];t.default=p},7106:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,i,o,s,a,c,l,u,h,f){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var p in i(s,a,c,l,u,h,f),s){var d=s[p];if(Array.isArray(d)){if(p in t.arrayKeywords)for(var m=0;m<d.length;m++)r(e,i,o,d[m],a+"/"+p+"/"+m,c,a,p,s,m)}else if(p in t.propsKeywords){if(d&&"object"==typeof d)for(var y in d)r(e,i,o,d[y],a+"/"+p+"/"+n(y),c,a,p,s,y)}else(p in t.keywords||e.allKeys&&!(p in t.skipKeywords))&&r(e,i,o,d,a+"/"+p,c,a,p,s)}o(s,a,c,l,u,h,f)}}function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(e,t,r)=>{"use strict";var n,i=r(3126),o=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&o&&o(Object.prototype,"__proto__"),a=Object,c=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?i([s.get]):"function"==typeof c&&function(e){return c(null==e?e:a(e))}},7302:(e,t,r)=>{"use strict";var n=r(5606);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(4227),o=r(3853),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,l=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,i.useFunc)(e.gen,o.default)}(${r})`;e.fail$data(n._`${l} ${c} ${s}`)}};t.default=s},7354:e=>{"use strict";function t(e){if(!(this instanceof t))return new t(e);this.aliasToTopic={},this.max=e}t.prototype.put=function(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))},t.prototype.getTopicByAlias=function(e){return this.aliasToTopic[e]},t.prototype.clear=function(){this.aliasToTopic={}},e.exports=t},7452:(e,t,r)=>{"use strict";var n=r(2014).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,c=function(){t.writable||u()},l=t._writableState&&t._writableState.finished,u=function(){a=!1,l=!0,s||o.call(t)},h=t._readableState&&t._readableState.endEmitted,f=function(){s=!1,h=!0,a||o.call(t)},p=function(e){o.call(t,e)},d=function(){var e;return s&&!h?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!l?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},m=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",d),t.req?m():t.on("request",m)):a&&!t._writableState&&(t.on("end",c),t.on("close",c)),t.on("end",f),t.on("finish",u),!1!==r.error&&t.on("error",p),t.on("close",d),function(){t.removeListener("complete",u),t.removeListener("abort",d),t.removeListener("request",m),t.req&&t.req.removeListener("finish",u),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",u),t.removeListener("end",f),t.removeListener("error",p),t.removeListener("close",d)}}},7471:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},7510:e=>{e.exports=function(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)t.call(n,i)&&(e[i]=n[i])}return e};var t=Object.prototype.hasOwnProperty},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],c=o[1],l=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,c)),u=0,h=c>0?s-4:s;for(r=0;r<h;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],l[u++]=t>>16&255,l[u++]=t>>8&255,l[u++]=255&t;return 2===c&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,l[u++]=255&t),1===c&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,l[u++]=t>>8&255,l[u++]=255&t),l},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(l(e,a,a+s>c?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function c(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function l(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(c(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(4737).default];t.default=n},7538:()=>{},7652:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},7720:(e,t,r)=>{"use strict";var n=r(4765),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},c=1024;e.exports={arrayToObject:a,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"}],r=[],n=0;n<t.length;++n)for(var i=t[n],s=i.obj[i.prop],a=Object.keys(s),c=0;c<a.length;++c){var l=a[c],u=s[l];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:s,prop:l}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(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(e,t,r,i,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var l="",u=0;u<a.length;u+=c){for(var h=a.length>=c?a.slice(u,u+c):a,f=[],p=0;p<h.length;++p){var d=h.charCodeAt(p);45===d||46===d||95===d||126===d||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===n.RFC1738&&(40===d||41===d)?f[f.length]=h.charAt(p):d<128?f[f.length]=s[d]:d<2048?f[f.length]=s[192|d>>6]+s[128|63&d]:d<55296||d>=57344?f[f.length]=s[224|d>>12]+s[128|d>>6&63]+s[128|63&d]:(p+=1,d=65536+((1023&d)<<10|1023&h.charCodeAt(p)),f[f.length]=s[240|d>>18]+s[128|d>>12&63]+s[128|d>>6&63]+s[128|63&d])}l+=f.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]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return o(t)&&!o(r)&&(s=a(t,n)),o(t)&&o(r)?(r.forEach(function(r,o){if(i.call(t,o)){var s=t[o];s&&"object"==typeof s&&r&&"object"==typeof r?t[o]=e(s,r,n):t.push(r)}else t[o]=r}),t):Object.keys(r).reduce(function(t,o){var s=r[o];return i.call(t,o)?t[o]=e(t[o],s,n):t[o]=s,t},s)}}},7813:(e,t,r)=>{"use strict";const{Buffer:n}=r(8109),i=Symbol.for("BufferList");function o(e){if(!(this instanceof o))return new o(e);o._init.call(this,e)}o._init=function(e){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},o.prototype._new=function(e){return new o(e)},o.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){const n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},o.prototype._reverseOffset=function(e){const t=e[0];let r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},o.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},o.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)},o.prototype.copy=function(e,t,r,i){if(("number"!=typeof r||r<0)&&(r=0),("number"!=typeof i||i>this.length)&&(i=this.length),r>=this.length)return e||n.alloc(0);if(i<=0)return e||n.alloc(0);const o=!!e,s=this._offset(r),a=i-r;let c=a,l=o&&t||0,u=s[1];if(0===r&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,l),l+=this._bufs[t].length;return e}if(c<=this._bufs[s[0]].length-u)return o?this._bufs[s[0]].copy(e,t,u,u+c):this._bufs[s[0]].slice(u,u+c);o||(e=n.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){const r=this._bufs[t].length-u;if(!(c>r)){this._bufs[t].copy(e,l,u,u+c),l+=r;break}this._bufs[t].copy(e,l,u),l+=r,c-=r,u&&(u=0)}return e.length>l?e.slice(0,l):e},o.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();const 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)},o.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},o.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},o.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},o.prototype.append=function(e){if(null==e)return this;if(e.buffer)this._appendBuffer(n.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e))for(let t=0;t<e.length;t++)this.append(e[t]);else if(this._isBufferList(e))for(let t=0;t<e._bufs.length;t++)this.append(e._bufs[t]);else"number"==typeof e&&(e=e.toString()),this._appendBuffer(n.from(e));return this},o.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},o.prototype.indexOf=function(e,t,r){if(void 0===r&&"string"==typeof t&&(r=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=n.from([e]):"string"==typeof e?e=n.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=n.from(e.buffer,e.byteOffset,e.byteLength):n.isBuffer(e)||(e=n.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const i=this._offset(t);let o=i[0],s=i[1];for(;o<this._bufs.length;o++){const t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){const r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{const t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},o.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,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(const t in e)(function(t){o.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}})(t)}(),o.prototype._isBufferList=function(e){return e instanceof o||o.isBufferList(e)},o.isBufferList=function(e){return null!=e&&e[i]},e.exports=o},7833:(e,t,r)=>{var n=r(5606);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=r(736)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class i extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var o;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(o||(t.UsedValueState=o={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=a;const c=n._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:i}=n,o=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[i];if(s){const e=s.get(o);if(e)return e}else s=this._values[i]=new Map;s.set(o,n);const a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},a){let c=n.nil;for(const l in e){const u=e[l];if(!u)continue;const h=s[l]=s[l]||new Map;u.forEach(e=>{if(h.has(e))return;h.set(e,o.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=n._`${c}${r} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new i(e);c=n._`${c}${s}${this.opts._n}`}h.set(e,o.Completed)})}return c}}},7870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9029),i=r(4227);function o(e,t,r){const{gen:o,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;const l=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,i.checkStrictMode)(e,`default is ignored for: ${l}`);let u=n._`${l} === undefined`;"empty"===c.useDefaults&&(u=n._`${u} || ${l} === null || ${l} === ""`),o.if(u,n._`${l} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)o(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,r)=>o(e,r,t.default))}},7881:e=>{"use strict";function t(e,t,r){var n=this;this._callback=e,this._args=r,this._interval=setInterval(e,t,this._args),this.reschedule=function(e){e||(e=n._interval),n._interval&&clearInterval(n._interval),n._interval=setInterval(n._callback,e,n._args)},this.clear=function(){n._interval&&(clearInterval(n._interval),n._interval=void 0)},this.destroy=function(){n._interval&&clearInterval(n._interval),n._callback=void 0,n._interval=void 0,n._args=void 0}}e.exports=function(){if("function"!=typeof arguments[0])throw new Error("callback needed");if("number"!=typeof arguments[1])throw new Error("interval needed");var e;if(arguments.length>0){e=new Array(arguments.length-2);for(var r=0;r<e.length;r++)e[r]=arguments[r+2]}return new t(arguments[0],arguments[1],e)}},7887:(e,t)=>{"use strict";function r(e,t){return t.rules.some(t=>n(e,t))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const i=t.RULES.types[n];return i&&!0!==i&&r(e,i)},t.shouldUseGroup=r,t.shouldUseRule=n},7920:(e,t,r)=>{"use strict";var n=r(5606),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var o=r(9158),s=r(8522);r(6698)(u,o);for(var a=i(s.prototype),c=0;c<a.length;c++){var l=a[c];u.prototype[l]||(u.prototype[l]=s.prototype[l])}function u(e){if(!(this instanceof u))return new u(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",h)))}function h(){this._writableState.ended||n.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},7923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),i={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:i}=e;if((0,n.alwaysValidSchema)(i,r))return void e.fail();const o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t.default=i},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(4227),o=r(6250),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data(n._`!${(0,i.useFunc)(t,o.default)}(${r}, ${a})`):e.fail(n._`${c} !== ${r}`)}};t.default=s},8002:e=>{"use strict";e.exports=Math.min},8068:e=>{"use strict";e.exports=SyntaxError},8109:(e,t,r)=>{"use strict";var n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;var s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|m(e,t),n=a(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(F(e,Uint8Array)){var t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(F(e,ArrayBuffer)||e&&F(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(F(e,SharedArrayBuffer)||e&&F(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);var i=function(e){if(c.isBuffer(e)){var t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||q(e.length)?a(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return u(e),a(e<0?0:0|d(e))}function f(e){for(var t=e.length<0?0:0|d(e.length),r=a(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return U(e).length;default:if(i)return n?-1:B(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return $(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),q(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,i){var o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var u=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===u?0:o-u)){if(-1===u&&(u=o),o-u+1===c)return u*s}else-1!==u&&(o-=o-u),u=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){for(var h=!0,f=0;f<c;f++)if(l(e,o+f)!==l(t,f)){h=!1;break}if(h)return o}return-1}function v(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(q(a))return s;e[r+s]=a}return s}function w(e,t,r,n){return D(B(t,e.length-r),e,r,n)}function S(e,t,r,n){return D(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return D(U(t),e,r,n)}function k(e,t,r,n){return D(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,c,l=e[i],u=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(u=l);break;case 2:128==(192&(o=e[i+1]))&&(c=(31&l)<<6|63&o)>127&&(u=c);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(c=(15&l)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(u=c);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(u=c)}null===u?(u=65533,h=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=h}return function(e){var t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}t.kMaxLength=s,c.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}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(F(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),F(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=c.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(F(o,Uint8Array))i+o.length>n.length?c.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!c.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},c.byteLength=m,c.prototype._isBuffer=!0,c.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)g(this,t,t+1);return this},c.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)g(this,t,t+3),g(this,t+1,t+2);return this},c.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)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(F(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r),h=0;h<a;++h)if(l[h]!==u[h]){o=l[h],s=u[h];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var 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 v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var A=4096;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}function R(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}function O(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+=V[e[o]];return i}function T(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}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function M(e,t,r,n,o){return t=+t,r>>>=0,o||N(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(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},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(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},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||x(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},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||x(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},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(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},c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);x(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(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},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(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},c.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return M(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return M(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=c.isBuffer(e)?e:c.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var L=/[^+/0-9A-Za-z-_]/g;function B(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function U(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function q(e){return e!=e}var V=function(){for(var e="0123456789abcdef",t=new 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}()},8194:(e,t,r)=>{"use strict";r.d(t,{CD:()=>v});var n,i=(n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=function(){function e(e,t){this.ee=1,this.u=void 0,this.p=void 0,this.K=void 0,this.N=void 0,this.rr=void 0,this.u=e,this.p=t}return e.prototype.L=function(){var e=this;if(1===e.ee&&e.rr.rr===e)e=e.N;else if(e.K)for(e=e.K;e.N;)e=e.N;else{for(var t=e.rr;t.K===e;)t=(e=t).rr;e=t}return e},e.prototype.m=function(){var e=this;if(e.N){for(e=e.N;e.K;)e=e.K;return e}for(var t=e.rr;t.N===e;)t=(e=t).rr;return e.N!==t?t:e},e.prototype.ne=function(){var e=this.rr,t=this.N,r=t.K;return e.rr===this?e.rr=t:e.K===this?e.K=t:e.N=t,t.rr=e,t.K=this,this.rr=t,this.N=r,r&&(r.rr=this),t},e.prototype.te=function(){var e=this.rr,t=this.K,r=t.N;return e.rr===this?e.rr=t:e.K===this?e.K=t:e.N=t,t.rr=e,t.N=this,this.rr=t,this.K=r,r&&(r.rr=this),t},e}(),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.tr=1,t}return i(t,e),t.prototype.ne=function(){var t=e.prototype.ne.call(this);return this.ie(),t.ie(),t},t.prototype.te=function(){var t=e.prototype.te.call(this);return this.ie(),t.ie(),t},t.prototype.ie=function(){this.tr=1,this.K&&(this.tr+=this.K.tr),this.N&&(this.tr+=this.N.tr)},t}(o),a=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),c=function(){function e(e){void 0===e&&(e=0),this.iteratorType=e}return e.prototype.equals=function(e){return this.o===e.o},e}(),l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t}(function(){function e(){this.M=0}return Object.defineProperty(e.prototype,"length",{get:function(){return this.M},enumerable:!1,configurable:!0}),e.prototype.size=function(){return this.M},e.prototype.empty=function(){return 0===this.M},e}());function u(){throw new RangeError("Iterator access denied!")}var h=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),f=function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s},p=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")};const d=function(e){function t(t,r){void 0===t&&(t=function(e,t){return e<t?-1:e>t?1:0}),void 0===r&&(r=!1);var n=e.call(this)||this;return n.W=void 0,n.$=t,r?(n.re=s,n.v=function(e,t,r){var n=this.se(e,t,r);if(n){for(var i=n.rr;i!==this.h;)i.tr+=1,i=i.rr;var o=this.fe(n);if(o){var s=o,a=s.parentNode,c=s.grandParent,l=s.curNode;a.ie(),c.ie(),l.ie()}}return this.M},n.G=function(e){for(var t=this.he(e);t!==this.h;)t.tr-=1,t=t.rr}):(n.re=o,n.v=function(e,t,r){var n=this.se(e,t,r);return n&&this.fe(n),this.M},n.G=n.he),n.h=new n.re,n}return h(t,e),t.prototype.U=function(e,t){for(var r=this.h;e;){var n=this.$(e.u,t);if(n<0)e=e.N;else{if(!(n>0))return e;r=e,e=e.K}}return r},t.prototype.X=function(e,t){for(var r=this.h;e;)this.$(e.u,t)<=0?e=e.N:(r=e,e=e.K);return r},t.prototype.Y=function(e,t){for(var r=this.h;e;){var n=this.$(e.u,t);if(n<0)r=e,e=e.N;else{if(!(n>0))return e;e=e.K}}return r},t.prototype.Z=function(e,t){for(var r=this.h;e;)this.$(e.u,t)<0?(r=e,e=e.N):e=e.K;return r},t.prototype.ue=function(e){for(;;){var t,r=e.rr;if(r===this.h)return;if(1===e.ee)return void(e.ee=0);if(e===r.K)if(1===(t=r.N).ee)t.ee=0,r.ee=1,r===this.W?this.W=r.ne():r.ne();else{if(t.N&&1===t.N.ee)return t.ee=r.ee,r.ee=0,t.N.ee=0,void(r===this.W?this.W=r.ne():r.ne());t.K&&1===t.K.ee?(t.ee=1,t.K.ee=0,t.te()):(t.ee=1,e=r)}else if(1===(t=r.K).ee)t.ee=0,r.ee=1,r===this.W?this.W=r.te():r.te();else{if(t.K&&1===t.K.ee)return t.ee=r.ee,r.ee=0,t.K.ee=0,void(r===this.W?this.W=r.te():r.te());t.N&&1===t.N.ee?(t.ee=1,t.N.ee=0,t.ne()):(t.ee=1,e=r)}}},t.prototype.he=function(e){var t,r;if(1===this.M)return this.clear(),this.h;for(var n=e;n.K||n.N;){if(n.N)for(n=n.N;n.K;)n=n.K;else n=n.K;t=f([n.u,e.u],2),e.u=t[0],n.u=t[1],r=f([n.p,e.p],2),e.p=r[0],n.p=r[1],e=n}this.h.K===n?this.h.K=n.rr:this.h.N===n&&(this.h.N=n.rr),this.ue(n);var i=n.rr;return n===i.K?i.K=void 0:i.N=void 0,this.M-=1,this.W.ee=0,i},t.prototype.ae=function(e,t){return void 0!==e&&(!!this.ae(e.K,t)||!!t(e)||this.ae(e.N,t))},t.prototype.fe=function(e){for(;;){var t=e.rr;if(0===t.ee)return;var r=t.rr;if(t===r.K){if((n=r.N)&&1===n.ee){if(n.ee=t.ee=0,r===this.W)return;r.ee=1,e=r;continue}if(e===t.N)return e.ee=0,e.K&&(e.K.rr=t),e.N&&(e.N.rr=r),t.N=e.K,r.K=e.N,e.K=t,e.N=r,r===this.W?(this.W=e,this.h.rr=e):(i=r.rr).K===r?i.K=e:i.N=e,e.rr=r.rr,t.rr=e,r.rr=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e};t.ee=0,r===this.W?this.W=r.te():r.te(),r.ee=1}else{var n,i;if((n=r.K)&&1===n.ee){if(n.ee=t.ee=0,r===this.W)return;r.ee=1,e=r;continue}if(e===t.K)return e.ee=0,e.K&&(e.K.rr=r),e.N&&(e.N.rr=t),r.N=e.K,t.K=e.N,e.K=r,e.N=t,r===this.W?(this.W=e,this.h.rr=e):(i=r.rr).K===r?i.K=e:i.N=e,e.rr=r.rr,t.rr=e,r.rr=e,r.ee=1,{parentNode:t,grandParent:r,curNode:e};t.ee=0,r===this.W?this.W=r.ne():r.ne(),r.ee=1}return}},t.prototype.se=function(e,t,r){if(void 0===this.W)return this.M+=1,this.W=new this.re(e,t),this.W.ee=0,this.W.rr=this.h,this.h.rr=this.W,this.h.K=this.W,void(this.h.N=this.W);var n,i=this.h.K,o=this.$(i.u,e);if(0!==o){if(o>0)i.K=new this.re(e,t),i.K.rr=i,n=i.K,this.h.K=n;else{var s=this.h.N,a=this.$(s.u,e);if(0===a)return void(s.p=t);if(a<0)s.N=new this.re(e,t),s.N.rr=s,n=s.N,this.h.N=n;else{if(void 0!==r){var c=r.o;if(c!==this.h){var l=this.$(c.u,e);if(0===l)return void(c.p=t);if(l>0){var u=c.L(),h=this.$(u.u,e);if(0===h)return void(u.p=t);h<0&&(n=new this.re(e,t),void 0===u.N?(u.N=n,n.rr=u):(c.K=n,n.rr=c))}}}if(void 0===n)for(n=this.W;;){var f=this.$(n.u,e);if(f>0){if(void 0===n.K){n.K=new this.re(e,t),n.K.rr=n,n=n.K;break}n=n.K}else{if(!(f<0))return void(n.p=t);if(void 0===n.N){n.N=new this.re(e,t),n.N.rr=n,n=n.N;break}n=n.N}}}}return this.M+=1,n}i.p=t},t.prototype.g=function(e,t){for(;e;){var r=this.$(e.u,t);if(r<0)e=e.N;else{if(!(r>0))return e;e=e.K}}return e||this.h},t.prototype.clear=function(){this.M=0,this.W=void 0,this.h.rr=void 0,this.h.K=this.h.N=void 0},t.prototype.updateKeyByIterator=function(e,t){var r=e.o;if(r===this.h&&u(),1===this.M)return r.u=t,!0;if(r===this.h.K)return this.$(r.m().u,t)>0&&(r.u=t,!0);if(r===this.h.N)return this.$(r.L().u,t)<0&&(r.u=t,!0);var n=r.L().u;if(this.$(n,t)>=0)return!1;var i=r.m().u;return!(this.$(i,t)<=0||(r.u=t,0))},t.prototype.eraseElementByPos=function(e){if(e<0||e>this.M-1)throw new RangeError;var t=0,r=this;return this.ae(this.W,function(n){return e===t?(r.G(n),!0):(t+=1,!1)}),this.M},t.prototype.eraseElementByKey=function(e){if(0===this.M)return!1;var t=this.g(this.W,e);return t!==this.h&&(this.G(t),!0)},t.prototype.eraseElementByIterator=function(e){var t=e.o;t===this.h&&u();var r=void 0===t.N;return 0===e.iteratorType?r&&e.next():r&&void 0!==t.K||e.next(),this.G(t),e},t.prototype.forEach=function(e){var t,r,n=0;try{for(var i=p(this),o=i.next();!o.done;o=i.next())e(o.value,n++,this)}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.prototype.getElementByPos=function(e){var t,r,n;if(e<0||e>this.M-1)throw new RangeError;var i=0;try{for(var o=p(this),s=o.next();!s.done;s=o.next()){var a=s.value;if(i===e){n=a;break}i+=1}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return n},t.prototype.getHeight=function(){if(0===this.M)return 0;var e=function(t){return t?Math.max(e(t.K),e(t.N))+1:0};return e(this.W)},t}(l);var m=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();const y=function(e){function t(t,r,n){var i=e.call(this,n)||this;return i.o=t,i.h=r,0===i.iteratorType?(i.pre=function(){return this.o===this.h.K&&u(),this.o=this.o.L(),this},i.next=function(){return this.o===this.h&&u(),this.o=this.o.m(),this}):(i.pre=function(){return this.o===this.h.N&&u(),this.o=this.o.m(),this},i.next=function(){return this.o===this.h&&u(),this.o=this.o.L(),this}),i}return m(t,e),Object.defineProperty(t.prototype,"index",{get:function(){var e=this.o,t=this.h.rr;if(e===this.h)return t?t.tr-1:0;var r=0;for(e.K&&(r+=e.K.tr);e!==t;){var n=e.rr;e===n.N&&(r+=1,n.K&&(r+=n.K.tr)),e=n}return r},enumerable:!1,configurable:!0}),t}(c);var g=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),b=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},_=function(e){function t(t,r,n,i){var o=e.call(this,t,r,i)||this;return o.container=n,o}return g(t,e),Object.defineProperty(t.prototype,"pointer",{get:function(){return this.o===this.h&&u(),this.o.u},enumerable:!1,configurable:!0}),t.prototype.copy=function(){return new t(this.o,this.h,this.container,this.iteratorType)},t}(y);const v=function(e){function t(t,r,n){void 0===t&&(t=[]);var i=e.call(this,r,n)||this,o=i;return t.forEach(function(e){o.insert(e)}),i}return g(t,e),t.prototype.P=function(e){return function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}(this,function(t){switch(t.label){case 0:return void 0===e?[2]:[5,b(this.P(e.K))];case 1:return t.sent(),[4,e.u];case 2:return t.sent(),[5,b(this.P(e.N))];case 3:return t.sent(),[2]}})},t.prototype.begin=function(){return new _(this.h.K||this.h,this.h,this)},t.prototype.end=function(){return new _(this.h,this.h,this)},t.prototype.rBegin=function(){return new _(this.h.N||this.h,this.h,this,1)},t.prototype.rEnd=function(){return new _(this.h,this.h,this,1)},t.prototype.front=function(){return this.h.K?this.h.K.u:void 0},t.prototype.back=function(){return this.h.N?this.h.N.u:void 0},t.prototype.insert=function(e,t){return this.v(e,void 0,t)},t.prototype.find=function(e){var t=this.g(this.W,e);return new _(t,this.h,this)},t.prototype.lowerBound=function(e){var t=this.U(this.W,e);return new _(t,this.h,this)},t.prototype.upperBound=function(e){var t=this.X(this.W,e);return new _(t,this.h,this)},t.prototype.reverseLowerBound=function(e){var t=this.Y(this.W,e);return new _(t,this.h,this)},t.prototype.reverseUpperBound=function(e){var t=this.Z(this.W,e);return new _(t,this.h,this)},t.prototype.union=function(e){var t=this;return e.forEach(function(e){t.insert(e)}),this.M},t.prototype[Symbol.iterator]=function(){return this.P(this.W)},t}(d)},8241:(e,t,r)=>{"use strict";var n=r(9046).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},8287:(e,t,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=function(e){return+e!=e&&(e=0),c.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,c.prototype),t}function c(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return f(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);const i=function(e){if(c.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):f(e):"Buffer"===e.type&&Array.isArray(e.data)?f(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function h(e){return u(e),a(e<0?0:0|d(e))}function f(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function p(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,c.prototype),n}function d(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function m(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return z(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function y(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return P(this,t,r);case"ascii":return $(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return I(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function g(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function b(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:_(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):_(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function _(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(l(e,o+n)!==l(t,n)){r=!1;break}if(r)return o}return-1}function v(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function w(e,t,r,n){return G(H(t,e.length-r),e,r,n)}function S(e,t,r,n){return G(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return G(z(t),e,r,n)}function k(e,t,r,n){return G(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function I(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function P(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(c=(31&t)<<6|63&r,c>127&&(o=c));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(c=(15&t)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=A)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=A));return r}(n)}t.kMaxLength=s,c.TYPED_ARRAY_SUPPORT=function(){try{const 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}}(),c.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"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(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),c.poolSize=8192,c.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array),c.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},c.allocUnsafe=function(e){return h(e)},c.allocUnsafeSlow=function(e){return h(e)},c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=c.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))i+t.length>n.length?(c.isBuffer(t)||(t=c.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!c.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},c.byteLength=m,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)g(this,t,t+1);return this},c.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)g(this,t,t+3),g(this,t+1,t+2);return this},c.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)g(this,t,t+7),g(this,t+1,t+6),g(this,t+2,t+5),g(this,t+3,t+4);return this},c.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?P(this,0,e):y.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(e,t,r,n,i){if(Q(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),l=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<a;++e)if(l[e]!==u[e]){o=l[e],s=u[e];break}return o<s?-1:s<o?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return b(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return b(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const A=4096;function $(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function O(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function T(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function C(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,i,o){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function N(e,t,r,n,i){q(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function j(e,t,r,n,i){q(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function M(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(e,t,r,n,o){return t=+t,r>>>=0,o||M(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function B(e,t,r,n,o){return t=+t,r>>>=0,o||M(e,0,r,8),i.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,c.prototype),n},c.prototype.readUintLE=c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},c.prototype.readUintBE=c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),this[e]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||C(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readBigUInt64LE=X(function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),c.prototype.readBigUInt64BE=X(function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||C(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},c.prototype.readInt8=function(e,t){return e>>>=0,t||C(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(e,t){e>>>=0,t||C(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||C(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readBigInt64LE=X(function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),c.prototype.readBigInt64BE=X(function(e){V(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),c.prototype.readFloatLE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||C(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||C(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||x(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||x(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(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},c.prototype.writeBigUInt64LE=X(function(e,t=0){return N(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=X(function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(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},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(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},c.prototype.writeBigInt64LE=X(function(e,t=0){return N(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=X(function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeFloatLE=function(e,t,r){return L(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return L(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return B(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return B(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const U={};function D(e,t,r){U[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function F(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function q(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new U.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||K(t,e.length-(r+1))}(n,i,o)}function V(e,t){if("number"!=typeof e)throw new U.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new U.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new U.ERR_BUFFER_OUT_OF_BOUNDS;throw new U.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}D("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),D("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=F(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=F(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function z(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},8290:(e,t,r)=>{"use strict";e.exports=i;var n=r(6608);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},8343:(e,t,r)=>{"use strict";const{normalizeIPv6:n,removeDotSegments:i,recomposeAuthority:o,normalizeComponentEncoding:s,isIPv4:a,nonSimpleDomain:c}=r(4834),{SCHEMES:l,getSchemeHandler:u}=r(343);function h(e,t,r,n){const o={};return n||(e=d(f(e,r),r),t=d(f(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(t.path?("/"===t.path[0]?o.path=i(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=i(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function f(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],a=u(n.scheme||r.scheme);a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&s.push(r.scheme,":");const c=o(r);if(void 0!==c&&("suffix"!==n.reference&&s.push("//"),s.push(c),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=i(e)),void 0===c&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}const p=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function d(e,t){const r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let o=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);const s=e.match(p);if(s){if(i.scheme=s[1],i.userinfo=s[3],i.host=s[4],i.port=parseInt(s[5],10),i.path=s[6]||"",i.query=s[7],i.fragment=s[8],isNaN(i.port)&&(i.port=s[5]),i.host)if(!1===a(i.host)){const e=n(i.host);i.host=e.host.toLowerCase(),o=e.isIPV6}else o=!0;void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");const t=u(r.scheme||i.scheme);if(!(r.unicodeSupport||t&&t.unicodeSupport)&&i.host&&(r.domainHost||t&&t.domainHost)&&!1===o&&c(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),void 0!==i.host&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),t&&t.parse&&t.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}const m={SCHEMES:l,normalize:function(e,t){return"string"==typeof e?e=f(d(e,t),t):"object"==typeof e&&(e=d(f(e,t),t)),e},resolve:function(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=h(d(e,n),d(t,n),n,!0);return n.skipEscape=!0,f(i,n)},resolveComponent:h,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=f(s(d(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=f(s(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=f(s(d(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=f(s(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:f,parse:d};e.exports=m,e.exports.default=m,e.exports.fastUri=m},8490:(e,t,r)=>{"use strict";var n=r(5606);const{Buffer:i}=r(8287),o=r(1591),s=r(7833)("mqttjs:ws"),a=r(2623),c=r(7041).Transform,l=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],u=void 0!==n&&"browser"===n.title||"function"==typeof r;function h(e,t){let r=e.protocol+"://"+e.hostname+":"+e.port+e.path;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function f(e){const t=e;return e.hostname||(t.hostname="localhost"),e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),u||"wss"!==e.protocol||l.forEach(function(r){Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])}),t}e.exports=u?function(e,t){let r;s("browserStreamBuilder");const n=function(e){const t=f(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=e.port)}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t).browserBufferSize||524288,o=t.browserBufferTimeout||1e3,l=!t.objectMode,u=function(e,t){const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",n=h(t,e),i=new WebSocket(n,[r]);return i.binaryType="arraybuffer",i}(e,t),p=function(e){const t=new c({objectModeMode:e.objectMode});return t._write=function e(t,r,s){u.bufferedAmount>n&&setTimeout(e,o,t,r,s),l&&"string"==typeof t&&(t=i.from(t,"utf8"));try{u.send(t)}catch(e){return s(e)}s()},t._flush=function(e){u.close(),e()},t}(t);t.objectMode||(p._writev=_),p.on("close",()=>{u.close()});const d=void 0!==u.addEventListener;function m(){r.setReadable(p),r.setWritable(p),r.emit("connect")}function y(){r.end(),r.destroy()}function g(e){r.destroy(e)}function b(e){let t=e.data;t=t instanceof ArrayBuffer?i.from(t):i.from(t,"utf8"),p.push(t)}function _(e,t){const r=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?r[t]=i.from(e[t],"utf8"):r[t]=e[t].chunk;this._write(i.concat(r),"binary",t)}return u.readyState===u.OPEN?r=p:(r=r=a(void 0,void 0,t),t.objectMode||(r._writev=_),d?u.addEventListener("open",m):u.onopen=m),r.socket=u,d?(u.addEventListener("close",y),u.addEventListener("error",g),u.addEventListener("message",b)):(u.onclose=y,u.onerror=g,u.onmessage=b),r}:function(e,t){s("streamBuilder");const r=f(t),n=h(r,e),i=function(e,t,r){s("createWebSocket"),s("protocol: "+r.protocolId+" "+r.protocolVersion);const n="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return s("creating new Websocket for url: "+t+" and protocol: "+n),new o(t,[n],r.wsOptions)}(0,n,r),a=o.createWebSocketStream(i,r.wsOptions);return a.url=n,i.on("close",()=>{a.destroy()}),a}},8522:(e,t,r)=>{"use strict";var n,i=r(5606);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=I,I.WritableState=k;var s,a={deprecate:r(4643)},c=r(9239),l=r(8287).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},h=r(2110),f=r(8241).getHighWaterMark,p=r(9046).F,d=p.ERR_INVALID_ARG_TYPE,m=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,b=p.ERR_STREAM_DESTROYED,_=p.ERR_STREAM_NULL_VALUES,v=p.ERR_STREAM_WRITE_AFTER_END,w=p.ERR_UNKNOWN_ENCODING,S=h.errorOrDestroy;function E(){}function k(e,t,s){n=n||r(7920),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(T,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),T(e,t))}(e,r,n,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||$(e,r),n?i.nextTick(A,e,r,s,o):A(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function I(e){var t=this instanceof(n=n||r(7920));if(!t&&!s.call(I,this))return new I(e);this._writableState=new k(e,this,t),this.writable=!0,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)),c.call(this)}function P(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function $(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,P(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,h=r.callback;if(P(e,t,!1,t.objectMode?1:l.length,l,u,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(I,c),k.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(k.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===I&&e&&e._writableState instanceof k}})):s=function(e){return e instanceof this},I.prototype.pipe=function(){S(this,new g)},I.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,l.isBuffer(n)||n instanceof u);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new v;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new _:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else P(e,t,!1,a,n,i,o);return c}(this,o,a,e,t,r)),s},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||$(this,e))},I.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,t,r){r(new m("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=h.destroy,I.prototype._undestroy=h.undestroy,I.prototype._destroy=function(e,t){t(e)}},8577:(e,t,r)=>{var n=r(5606);const i=r(1072),{nanoid:o}=r(3561),s=r(510),a=r(7007),c=r(3530);class l extends a{constructor({token:e,password:t,username:r,domain:n,agent:i="*",broker:s="mqtts://broker.hivemq.com:8883",timeout:l=12e3,log:u="console",bestEffort:h=!0,mqttClientId:f=null,identity:p=null,keepalive:d=30,requiresSchema:m=!1}={}){if(super(),!n)throw new Error("The domain must be specified");if(n.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"');if(i.match(/[+/#]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#"');if(p&&p.match(/[+/#$]/))throw new Error('The identity must NOT contain any of those characters: "+", "/", "#", "$"');if(null!=f){if("string"!=typeof f||0===f.length)throw new Error("The mqttClientId must be a non-empty string");if(f.match(/[+/#]/))throw new Error('The mqttClientId must NOT contain any of those characters: "+", "/", "#"')}this._token=e,this._username=r,this._password=t,this._agent=i,this._domain=n,this._broker=s,this._timeout=l,this._identity=p,this._keepalive=d,this._qos=this._qos=h?0:1,this._requiresSchema=m,this._instance=o(8),this._mqttClientId=f||this._createMqttClientId(),this._vrpcClientId=this._createVrpcClientId(),this._connectionSecret=o(16),this._vrpcConnectionId=this._createVrpcConnectionId(),this._agents={},this._eventEmitter=new a,this._invokeId=0,this._proxyId=0,this._client=null,this._cachedSubscriptions={},this._proxies={},this._subscribeRetrier=new c({subscribe:(e,t)=>this._mqttSubscribe(e,t).catch(()=>{}),log:this._log}),this._callbackIds=new WeakMap,this._emitterListener=new WeakMap,this._pendingSubscriptions=new Map,this._pendingUnsubscriptions=new Map,"console"===u?(this._log=console,this._log.debug=()=>{}):this._log=u}getClientId(){return this._vrpcClientId}getConnectionId(){return this._vrpcConnectionId}async connect(){if(this._client&&this._client.connected)return;let e=this._username,t=this._password;this._token&&(e=e||this._generateUserName(),t=this._token);const r={username:e,password:t,clean:!0,keepalive:this._keepalive,clientId:this._mqttClientId,rejectUnauthorized:!1,connectTimeout:this._timeout,will:{topic:`${this._vrpcConnectionId}/__clientInfo__`,payload:JSON.stringify({status:"offline",clientId:this._vrpcClientId})}};return void 0===e&&delete r.username,void 0===t&&delete r.password,this.on("error",e=>{this._log.debug(`Encountered MQTT error: ${e.message}`)}),this._client=s.connect(this._broker,r),this._client.on("offline",()=>{this._log.warn("MQTT client went offline."),this._agents={},this._proxies={},this.emit("offline")}),this._client.on("reconnect",()=>{this._log.info("MQTT client is attempting to reconnect..."),this.emit("reconnect")}),this._client.on("error",e=>{this.emit("error",e)}),this._client.stream.on("error",e=>{this.emit("error",e)}),this._client.on("connect",async()=>{this.emit("connect"),this._subscribeRetrier.cancel();try{const e="*"===this._agent?"+":this._agent;await this._mqttSubscribe(`${this._domain}/${e}/__agentInfo__`),this._requiresSchema?await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfo__`):await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfoConcise__`),await this._mqttSubscribe(`${this._vrpcConnectionId}/#`),this._log.debug("Restoring event subscriptions after reconnect...");const t=[];for(const e of Object.keys(this._cachedSubscriptions))t.push(this._mqttSubscribe(e));await Promise.allSettled(t)}catch(e){this._log.error(`Encountered issue while setting up subscriptions after connect: ${e.message}`)}}),this._client.on("message",(e,t)=>{if(0!==t.length)try{const r=e.split("/"),[n,i,o,s]=r;if(n!==this._domain)return void this._log.warn(`Received message from foreign domain: ${n}`);if("__agentInfo__"===o){const{status:e,hostname:r,version:o}=JSON.parse(t.toString());this._createIfNotExist(i),this._agents[i].status=e,this._agents[i].hostname=r,this._agents[i].version=o,"offline"===e&&this._clearCachedSubscriptions({lostAgent:i}),this.emit("agent",{domain:n,agent:i,status:e,hostname:r,version:o})}else if("__classInfo__"===s||"__classInfoConcise__"===s){const e=JSON.parse(t.toString());this._createIfNotExist(i);const r=this._agents[i].classes[o],s=e.instances||[],a=r?r.instances:[],c=a.filter(e=>!s.includes(e)),l=s.filter(e=>!a.includes(e));this._agents[i].classes[o]=e;const{className:u,instances:h,memberFunctions:f,staticFunctions:p,meta:d}=e;0!==c.length&&(this.emit("instanceGone",c,{domain:n,agent:i,className:u}),c.forEach(e=>this._clearCachedSubscriptions({lostInstance:e,agent:i,className:u}))),0!==l.length&&this.emit("instanceNew",l,{domain:n,agent:i,className:u}),this.emit("class",{domain:n,agent:i,className:u,instances:h,memberFunctions:f,staticFunctions:p,meta:d||{}})}else{const{i:e,a:r,e:n,r:i}=JSON.parse(t.toString());this._eventEmitter.emit(e,{a:r,e:n,r:i})}}catch(t){this._log.error(`Could not parse MQTT message on topic "${e}": ${t.message}`)}}),new Promise((e,t)=>{const r=setTimeout(()=>{this._client.end(!0,()=>{t(new Error(`Connection trial timed out (> ${this._timeout} ms)`))})},this._timeout);this._client.once("connect",()=>{clearTimeout(r),e()})})}async create({className:e,instance:t=o(8),args:r=[],agent:n=this._agent,cacheProxy:i=!1,isIsolated:s=!1}={}){if(!this._isConnected())throw new Error("Client is not connected");if("*"===n)throw new Error("Agent must be specified");const a={c:e,f:s?"__createIsolated__":"__createShared__",a:[t,...r],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},c=await this._getProxy(n,e,a);return t&&i&&(this._proxies[`${n}/${e}/${t}`]={agent:n,className:e,instance:t,proxy:c}),c}async getInstance(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const r=this._cachedProxy(e,t);if(r)return r;const{agent:n,className:i}=await this._getInstanceData(e,t);return this._createProxy(n,i,e)}async delete(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const{agent:r,className:n}=await this._getInstanceData(e,t),i={c:n,f:"__delete__",a:[e],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},o=`${this._domain}/${r}/${n}/__static__/__delete__`;return this._mqttPublish(o,JSON.stringify(i)),delete this._proxies[`${r}/${n}/${e}`],this._handleAgentAnswer(i,r)}async callStatic({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const i=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(!i)return;const o={c:e,f:t,a:i,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},s=`${this._domain}/${n}/${e}/__static__/${t}`;return await this._waitUntilClassIsOnline(n,e),this._mqttPublish(s,JSON.stringify(o)),this._handleAgentAnswer(o,n)}async callAll({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const i={c:e,f:t,a:[],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};if("*"===n){const n=[],o=this.getAvailableAgents();for(const s of o){const o=`${this._domain}/${s}/${e}/__static__/__callAll__`,a=await this._wrapArguments({agent:s,className:e,functionName:t,args:r});if(!a)continue;i.a=[t,...a],await this._waitUntilClassIsOnline(s,e),this._mqttPublish(o,JSON.stringify(i));const c=await this._handleAgentAnswer(i,s);n.push(...c)}return n}const o=`${this._domain}/${n}/${e}/__static__/__callAll__`,s=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(s)return i.a=[t,...s],await this._waitUntilClassIsOnline(n,e),this._mqttPublish(o,JSON.stringify(i)),this._handleAgentAnswer(i,n)}getSystemInformation(){return this._agents}getAvailableAgents({mustBeOnline:e=!0}={}){const t=[];if(e){for(const e in this._agents){const{status:r}=this._agents[e];"online"===r&&t.push(e)}return t}return Object.keys(this._agents)}getAvailableClasses({agent:e=this._agent,mustBeOnline:t=!0}={}){if("*"===e)throw new Error("Agent must be specified");if(!this._agents[e])return[];const{classes:r,status:n}=this._agents[e];return t&&"online"!==n?[]:Object.keys(r)}getAvailableInstances({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].instances:[]}getAvailableMemberFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].memberFunctions.map(e=>this._stripSignature(e)):[]}getAvailableStaticFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].staticFunctions.map(e=>this._stripSignature(e)):[]}async reconnectWithToken(e,{agent:t=this._agent}={}){return this._token=e,this._agent=t,this._client&&await new Promise(e=>this._client.end(!1,{},e)),this.connect()}async unregisterAgent(e){if(this._agents[e]&&"offline"===this._agents[e].status){const t=`${this._domain}/${e}/__agentInfo__`;this._mqttPublish(t,null,{retain:!0});const r=this.getAvailableClasses({agent:e,mustBeOnline:!1});for(const t of r){const r=`${this._domain}/${e}/${t}/__classInfo__`;this._mqttPublish(r,null,{retain:!0})}return delete this._agents[e],!0}return!1}async end(){if(this._subscribeRetrier.cancel(),!this._client)return;this._mqttPublish(`${this._vrpcConnectionId}/__clientInfo__`,JSON.stringify({status:"offline",clientId:this._vrpcClientId,v:3})),this._eventEmitter.removeAllListeners(),this.removeAllListeners();const e=this._client;return this._client=null,new Promise(t=>e.end(!1,{},t))}static _createHash(e,t=16){let r=5381,n=52711;for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);r=33*r^i,n=33*n^i}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_isConnected(){return this._client&&this._client.connected}_getCallbackId(e,{readOnly:t=!1}={}){if(!this._callbackIds.has(e)){if(t)return null;this._callbackIds.set(e,o(8))}return this._callbackIds.get(e)}_generateUserName(){return`${this._domain}:client@${i.hostname()}-${i.platform()}-js`}_createMqttClientId(){const e=i.arch()+i.homedir()+i.hostname()+JSON.stringify(i.networkInterfaces())+i.platform()+i.release()+i.totalmem()+i.type(),t=l._createHash(e,12);return`vc3${this._instance}${t}`}_createVrpcClientId(){const e=this._identity||this._instance;return`${this._domain}/${i.hostname()}/${e}`}_createVrpcConnectionId(){return`${this._domain}/${this._mqttClientId}/${this._connectionSecret}`}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&(this._log.warn(`Could not publish MQTT message because: ${e.message}`),"client disconnecting"===e.message&&(this._log.error(`Failed to publish, because: ${e.message}`),this.emit("error",e),this._log.info("Forcing reconnect now..."),this._client.disconnecting=!1,this._client.reconnect()))})}async _mqttSubscribe(e,t){return new Promise((r,n)=>{this._client.subscribe(e,{qos:this._qos,...t},(i,o)=>{if(i){if(this._log.warn(`Could not subscribe to topic(s): '${e}', because: ${i.message}`),"client disconnecting"===i.message){const e=`Failed to subscribe, because: ${i.message}`;this._log.error(e),this.emit("error",i),this._log.info("Forcing reconnect now..."),this._client.disconnecting=!1,this._client.reconnect(),n(new Error(e))}}else{const n=Array.isArray(e)?e:[e],s=o.filter(e=>128===e.qos).map(e=>e.topic);s.length>0&&((i=new Error(`Could not subscribe all ${n.length} topic(s) but got error qos=128 on following ${s.length} topic(s): ${s}`)).code="SUBSCRIBE_FAILED",i.subscribeOptions=t,this._log.error(i.message),this.emit("error",i),this._subscribeRetrier.schedule(s,t)),this._subscribeRetrier.granted(o.filter(e=>128!==e.qos).map(e=>e.topic));const a=o.filter(e=>e.qos<this._qos);a.length>0&&((i=new Error(`Could not subscribe all ${n.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${a.length} topic(s): ${JSON.stringify(a)}`)).code="SUBSCRIBE_REDUCED_QOS",i.subscribeOptions=t,this._log.warn(i.message),this.emit("error",i)),0===o.length&&this._log.debug(`Already subscribed to: ${e}`),r()}})})}async _mqttUnsubscribe(e,t){return new Promise((r,n)=>{this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`),r()})})}_createIfNotExist(e){this._agents[e]||(this._agents[e]={classes:{}})}async _getProxy(e,t,r){const{f:n,i}=r,o=`${this._domain}/${e}/${t}/__static__/${n}`;return await this._waitUntilClassIsOnline(e,t),this._mqttPublish(o,JSON.stringify(r)),new Promise((r,n)=>{const o=`Proxy creation for class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`,s=setTimeout(()=>{this._eventEmitter.removeAllListeners(i),n(new Error(o))},this._timeout);this._eventEmitter.once(i,({e:i,r:o})=>{if(clearTimeout(s),i)n(new Error(i));else{const n=this._createProxy(e,t,o);r(n)}})})}async _waitUntilClassIsOnline(e,t){if(!this._hasClassOnline(e,t))return new Promise((r,n)=>{let i=null;const o=()=>{this._hasClassOnline(e,t)&&(i&&clearTimeout(i),this.removeListener("class",o),r())};i=setTimeout(()=>{this.removeListener("class",o),n(new Error(`Connection to class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`))},this._timeout),this.on("class",o)})}_hasClassOnline(e,t){return this._agents[e]&&"online"===this._agents[e].status&&this._agents[e].classes[t]}_createProxy(e,t,r){const n=`${this._domain}/${e}/${t}/${r}`,i=`${this._instance}-${this._proxyId++}`,o={vrpcClientId:this._vrpcClientId,vrpcConnectionId:this._vrpcConnectionId,vrpcInstanceId:r,vrpcProxyId:i};let s=this._agents[e].classes[t].memberFunctions;s=s.map(e=>{const t=e.indexOf("-");return t>0?e.substring(0,t):e});const a=new Set(s);return a.forEach(s=>{o[s]="removeAllListeners"!==s?async(...o)=>{const a=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:i,functionName:s,args:o});if(!a)return!0;try{const t={c:r,f:s,a,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${s}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}:async t=>{if(!t)throw new Error("VRPC does not support removing all listeners");Object.keys(this._cachedSubscriptions).filter(e=>{const n=this._cachedSubscriptions[e];return n.instance===r&&n.event===t}).forEach(e=>{const t=`__e__${e}`;this._cachedSubscriptions[e].listeners.forEach(({handler:e})=>{this._eventEmitter.removeListener(t,e)}),delete this._cachedSubscriptions[e]});try{const i={c:r,f:s,a:[t],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${s}`,JSON.stringify(i)),this._handleAgentAnswer(i,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}}),a.has("vrpcOn")||a.has("vrpcOff")||(o.vrpcOn=async(o,...s)=>{if(!a.has(o))throw new Error("Bad magic");const c=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:i,functionName:"vrpcOn",args:[o,...s]});if(c)try{const t={c:r,f:o,a:c.slice(1),i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${o}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${o}" because: ${e.message}`)}},o.vrpcOff=n=>{const i=`__e__${this._domain}/${e}/${t}/${r}-${n}`;this._eventEmitter.removeAllListeners(i)}),o}async _handleAgentAnswer({i:e,c:t,f:r},n){return new Promise((i,o)=>{const s=`Function call "${t}::${r}()" on agent "${n}" timed out (> ${this._timeout} ms)`,a=setTimeout(()=>{this._eventEmitter.removeAllListeners(e),o(new Error(s))},this._timeout);this._eventEmitter.once(e,e=>{if(clearTimeout(a),e.e){const{message:i,cause:s}=l._prepareError(e.e);o(new Error(`[vrpc ${n}-${t}-${r}]: ${i}`,{cause:s}))}else{const s=e.r;"string"==typeof s&&"__p__"===s.substring(0,5)?this._eventEmitter.once(s,e=>{if(e.e){const{message:i,cause:s}=l._prepareError(e.e);o(new Error(`[vrpc ${n}-${t}-${r}]: ${i}`,{cause:s}))}else i(e.r)}):i(s)}})})}static _prepareError(e){return"object"==typeof e?{message:e.message,cause:e.cause}:{message:e,cause:void 0}}async _waitForInstance(e,t={}){return new Promise((r,n)=>{const i=n=>(o,{agent:s,className:a})=>{if(o.includes(e)){if(t.agent&&s!==t.agent)return;if(t.className&&a!==t.className)return;clearTimeout(n),this.removeListener("instanceNew",i),r({agent:s,className:a,instance:e})}},o=setTimeout(()=>{this.removeListener("instanceNew",i(o));const t=`Could not find instance: ${e} (> ${this._timeout} ms)`;n(new Error(t))},this._timeout);this.on("instanceNew",i(o))})}async _wrapArguments({agent:e,className:t,instance:r,proxyId:n,functionName:i,args:o}){const s=[],a=/^(on|notify|monitor|signal)/.test(i),c=/^(off|remove|unmonitor|unsignal)/.test(i);for(const[l,u]of o.entries()){if(this._isFunction(u)){const h=u;if("vrpcOn"===i||"on"===i&&1===l&&"string"==typeof o[0]||a){const n="string"==typeof o[0]?o[0]:i,a=await this._onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:h});s.push(a);continue}if(("off"===i||"removeListener"===i)&&1===l&&"string"==typeof o[0]||c){const e=await this._offRemoteEvent({callback:h});if(!e&&("off"===i||"removeListener"===i))return null;s.push(e||null);continue}{const r=`__f__${n||`${e}-${t}`}-${i}-${l}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`;s.push(r),this._eventEmitter.once(r,({a:e})=>u.apply(null,e));continue}}if(this._isEmitter(u)){const{emitter:n,event:i}=u;let o=(...e)=>n.emit(i,...e);if(this._emitterListener.has(n)){const e=this._emitterListener.get(n);e.has(i)?o=e.get(i):e.set(i,o)}else this._emitterListener.set(n,new Map([[i,o]]));const a=await this._onRemoteEvent({agent:e,className:t,instance:r,event:i,callback:o});s.push(a);continue}s.push(u)}return s}async _onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:i}){const o=`${e}-${t}-${r||"__static__"}-${n}-${this._getCallbackId(i)}`,s=l._createHash(o,12),a=`${this._vrpcConnectionId}/${s}`,c=`__e__${a}`,u=({a:e})=>i.apply(null,e);return 0===this._eventEmitter.listenerCount(c)&&this._eventEmitter.on(c,u),this._cachedSubscriptions[a]?this._cachedSubscriptions[a].listeners.push({callback:i,handler:u}):this._cachedSubscriptions[a]={agent:e,className:t,instance:r,event:n,listeners:[{callback:i,handler:u}]},c}async _offRemoteEvent({callback:e}){if(!this._getCallbackId(e,{readOnly:!0}))return null;let t=null;return Object.keys(this._cachedSubscriptions).forEach(r=>{const n=`__e__${r}`,i=this._cachedSubscriptions[r],o=i.listeners.findIndex(t=>t.callback===e);-1!==o&&(i.listeners.splice(o,1),0===i.listeners.length&&(delete this._cachedSubscriptions[r],this._eventEmitter.removeAllListeners(n)),t=n)}),t}_clearCachedSubscriptions({lostAgent:e,lostInstance:t,agent:r,className:n}){Object.keys(this._cachedSubscriptions).filter(i=>{const o=this._cachedSubscriptions[i];return void 0!==e?o.agent===e:o.instance===t&&o.agent===r&&o.className===n}).forEach(e=>{const t=`__e__${e}`;this._log.debug(`Clearing subscriptions for obsolete topic: ${e}`),this._cachedSubscriptions[e].listeners.forEach(({handler:e})=>{this._eventEmitter.removeListener(t,e)}),delete this._cachedSubscriptions[e]})}_stripSignature(e){const t=e.indexOf("-");return t>0?e.substring(0,t):e}_isFunction(e){const t={}.toString.call(e);return e&&("[object Function]"===t||"[object AsyncFunction]"===t)}_isEmitter(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"emitter")&&Object.prototype.hasOwnProperty.call(e,"event")&&"object"==typeof e.emitter&&"function"==typeof e.emitter.emit}async _getInstanceData(e,t){const r=this._getInstanceFromCache(e,t);if(!r){if(t.noWait)throw new Error(`Could not find instance: ${e}`);return this._waitForInstance(e,t)}return r}_cachedProxy(e,{agent:t,className:r}={}){const n=Object.values(this._proxies).filter(n=>!(n.instance!==e||t&&n.agent!==t||r&&n.className!==r));return 1===n.length?n[0].proxy:null}_getInstanceFromCache(e,t={}){if(!t.agent&&"*"!==this._agent){const{classes:r,status:n}=this._agents[this._agent]||{};if(r&&"offline"!==n)for(const n in r){if(t.className&&n!==t.className)continue;const{instances:i}=r[n];if(i&&i.includes(e))return{agent:this._agent,className:n,instance:e}}}for(const r in this._agents){if(t.agent&&r!==t.agent)continue;const{classes:n,status:i}=this._agents[r];if(n&&"offline"!==i)for(const i in n){if(t.className&&i!==t.className)continue;const{instances:o}=n[i];if(o&&o.includes(e))return{agent:r,className:i,instance:e}}}}_indicateDeprecation(e){n&&n.emitWarning?n.emitWarning(e,"DeprecationWarning"):this._log.warn("DEPRECATED ",e)}}e.exports=l},8636:(e,t,r)=>{"use strict";var n=r(920),i=r(7720),o=r(4765),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},c=Array.isArray,l=Array.prototype.push,u=function(e,t){l.apply(e,c(t)?t:[t])},h=Date.prototype.toISOString,f=o.default,p={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:i.encode,encodeValuesOnly:!1,filter:void 0,format:f,formatter:o.formatters[f],indices:!1,serializeDate:function(e){return h.call(e)},skipNulls:!1,strictNullHandling:!1},d={},m=function e(t,r,o,s,a,l,h,f,m,y,g,b,_,v,w,S,E,k){for(var I,P=t,A=k,$=0,R=!1;void 0!==(A=A.get(d))&&!R;){var O=A.get(t);if($+=1,void 0!==O){if(O===$)throw new RangeError("Cyclic object value");R=!0}void 0===A.get(d)&&($=0)}if("function"==typeof y?P=y(r,P):P instanceof Date?P=_(P):"comma"===o&&c(P)&&(P=i.maybeMap(P,function(e){return e instanceof Date?_(e):e})),null===P){if(l)return m&&!S?m(r,p.encoder,E,"key",v):r;P=""}if("string"==typeof(I=P)||"number"==typeof I||"boolean"==typeof I||"symbol"==typeof I||"bigint"==typeof I||i.isBuffer(P))return m?[w(S?r:m(r,p.encoder,E,"key",v))+"="+w(m(P,p.encoder,E,"value",v))]:[w(r)+"="+w(String(P))];var T,C=[];if(void 0===P)return C;if("comma"===o&&c(P))S&&m&&(P=i.maybeMap(P,m)),T=[{value:P.length>0?P.join(",")||null:void 0}];else if(c(y))T=y;else{var x=Object.keys(P);T=g?x.sort(g):x}var N=f?String(r).replace(/\./g,"%2E"):String(r),j=s&&c(P)&&1===P.length?N+"[]":N;if(a&&c(P)&&0===P.length)return j+"[]";for(var M=0;M<T.length;++M){var L=T[M],B="object"==typeof L&&L&&void 0!==L.value?L.value:P[L];if(!h||null!==B){var U=b&&f?String(L).replace(/\./g,"%2E"):String(L),D=c(P)?"function"==typeof o?o(j,U):j:j+(b?"."+U:"["+U+"]");k.set(t,$);var F=n();F.set(d,k),u(C,e(B,D,o,s,a,l,h,f,"comma"===o&&S&&c(P)?null:m,y,g,b,_,v,w,S,E,F))}}return C};e.exports=function(e,t){var r,i=e,l=function(e){if(!e)return p;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||p.charset;if(void 0!==e.charset&&"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 r=o.default;if(void 0!==e.format){if(!s.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n,i=o.formatters[r],l=p.filter;if(("function"==typeof e.filter||c(e.filter))&&(l=e.filter),n=e.arrayFormat in a?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":p.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||p.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:p.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:p.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:p.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?p.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:p.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:p.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:p.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:p.encodeValuesOnly,filter:l,format:r,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:p.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:p.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:p.strictNullHandling}}(t);"function"==typeof l.filter?i=(0,l.filter)("",i):c(l.filter)&&(r=l.filter);var h=[];if("object"!=typeof i||null===i)return"";var f=a[l.arrayFormat],d="comma"===f&&l.commaRoundTrip;r||(r=Object.keys(i)),l.sort&&r.sort(l.sort);for(var y=n(),g=0;g<r.length;++g){var b=r[g],_=i[b];l.skipNulls&&null===_||u(h,m(_,b,f,d,l.allowEmptyArrays,l.strictNullHandling,l.skipNulls,l.encodeDotInKeys,l.encode?l.encoder:null,l.filter,l.sort,l.allowDots,l.serializeDate,l.format,l.formatter,l.encodeValuesOnly,l.charset,y))}var v=h.join(l.delimiter),w=!0===l.addQueryPrefix?"?":"";return l.charsetSentinel&&("iso-8859-1"===l.charset?w+="utf8=%26%2310003%3B&":w+="utf8=%E2%9C%93&"),v.length>0?w+v:""}},8643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(4227),o=r(6250),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:c,it:l}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=l.opts.loopEnum;let h;const f=()=>null!=h?h:h=(0,i.useFunc)(t,o.default);let p;if(u||s)p=t.let("valid"),e.block$data(p,function(){t.assign(p,!1),t.forOf("v",c,e=>t.if(n._`${f()}(${r}, ${e})`,()=>t.assign(p,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",c);p=(0,n.or)(...a.map((t,i)=>function(e,t){const i=a[t];return"object"==typeof i&&null!==i?n._`${f()}(${r}, ${e}[${t}])`:n._`${r} === ${i}`}(e,i)))}e.pass(p)}};t.default=s},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),i=r(9029),o=r(2023),s=r(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>i._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:c,errsCount:l,it:u}=e;if(!l)throw new Error("ajv implementation error");const{allErrors:h,opts:f}=u;if(u.props=!0,"all"!==f.removeAdditional&&(0,s.alwaysValidSchema)(u,r))return;const p=(0,n.allSchemaProperties)(a.properties),d=(0,n.allSchemaProperties)(a.patternProperties);function m(e){t.code(i._`delete ${c}[${e}]`)}function y(n){if("all"===f.removeAdditional||f.removeAdditional&&!1===r)m(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(h||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(u,r)){const r=t.name("valid");"failing"===f.removeAdditional?(g(n,r,!1),t.if((0,i.not)(r),()=>{e.reset(),m(n)})):(g(n,r),h||t.if((0,i.not)(r),()=>t.break()))}}}function g(t,r,n){const i={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}t.forIn("key",c,r=>{p.length||d.length?t.if(function(r){let o;if(p.length>8){const e=(0,s.schemaRefOrVal)(u,a.properties,"properties");o=(0,n.isOwnProperty)(t,e,r)}else o=p.length?(0,i.or)(...p.map(e=>i._`${r} === ${e}`)):i.nil;return d.length&&(o=(0,i.or)(o,...d.map(t=>i._`${(0,n.usePattern)(e,t)}.test(${r})`))),(0,i.not)(o)}(r),()=>y(r)):y(r)}),e.ok(i._`${l} === ${o.default.errors}`)}};t.default=a},8665:(e,t,r)=>{const n=r(3282),i=r(7007),{nanoid:o}=r(3561),s="__global__",a="vrpc";class c{static registerClass(e,{onlyPublic:t=!0,withNew:r=!0,schema:n=null}={}){let i=c._extractStaticFunctions(e);t&&(i=i.filter(e=>!e.startsWith("_"))),i.push("__createIsolated__"),i.push("__createShared__"),i.push("__callAll__"),i.push("__delete__");let o=c._extractMemberFunctions(e);t&&(o=o.filter(e=>!e.startsWith("_"))),c._functionRegistry.set(e.name,{Klass:e,withNew:r,staticFunctions:i,memberFunctions:o,schema:n,meta:{}})}static registerFunction(e,t){if("function"!=typeof e)throw new Error("Provided argument must be a function object");console.log("registering function",t),window[a]||(window[a]={}),window[a][t]=e;const r=c._functionRegistry.get(s),n=r?[...r.staticFunctions,t]:[t];c._functionRegistry.set(s,{staticFunctions:n,memberFunctions:[],meta:{},Klass:{},withNew:!1,schema:null})}static registerInstance(e,{className:t,instance:r,onlyPublic:n=!0}={}){let i=c._extractMemberFunctions(e);n&&(i=i.filter(e=>!e.startsWith("_"))),c._functionRegistry.has(t)||c._functionRegistry.set(t,{memberFunctions:i,meta:{},Klass:{},withNew:!1,staticFunctions:[],schema:null}),c._instances.set(r,{className:t,instance:e,isIsolated:!1})}static create({className:e,instance:t=o(8),args:r=[],isIsolated:n=!1}={}){const i={c:e,a:[t,...r]},s=n?c._handleCreateIsolated(i):c._handleCreateShared(i);if(i.e)throw new Error(i.e);return s}static delete(e){if("string"==typeof e)return c._delete(e);if("object"==typeof e){for(const[t,r]of c._instances)if(r.instance===e)return c._instances.delete(t),!0;return!1}}static getInstance(e){const t=c._instances.get(e);if(t)return t.instance;throw new Error(`Could not find instance: ${e}`)}static getAvailableClasses(){return c._getClassesArray()}static getAvailableInstances(e){return c._getInstancesArray(e)}static call(e){const t=JSON.parse(e);return c._call(t),JSON.stringify(t)}static onCallback(e){c._callback=e}static on(e,t){c._emitter.on(e,t)}static once(e,t){c._emitter.once(e,t)}static off(e,t){c._emitter.off(e,t)}static removeAllListeners(e){c._emitter.removeAllListeners(e)}static _call(e){switch(c._mustTrackClient=!1,e.f){case"__createIsolated__":c._handleCreateIsolated(e);break;case"__createShared__":c._handleCreateShared(e);break;case"__callAll__":c._handleCallAll(e);break;case"__delete__":c._handleDelete(e);break;default:c._handleCall(e)}return c._mustTrackClient}static _assertOwner(e,t,r){if(e&&e.isIsolated&&void 0!==e.owner&&t.s!==c.LOCAL_SENDER&&t.s!==e.owner)throw new Error(`Instance '${r}' is isolated to another connection`)}static _handleCreateIsolated(e){let t;try{const r=e.c,[n,...i]=e.a,o=c._instances.get(n);if(o){if(!o.isIsolated)throw new Error(`Instance '${n}' exists as a shared instance`);return c._assertOwner(o,e,n),e.r=n,o.instance}t=c._create(r,n,...i),c._instances.set(n,{instance:t,className:r,isIsolated:!0,owner:"string"==typeof e.s?e.s:void 0}),c._emitter.emit("create",{args:i,className:r,isIsolated:!0,instance:n}),e.r=n}catch(t){e.e=t.message}return t}static _handleCreateShared(e){let t;try{const r=e.c,[n,...i]=e.a,o=c._instances.get(n);if(o&&o.isIsolated)throw new Error(`Instance '${n}' exists as an isolated instance`);t=c._create(r,n,...i),c._instances.set(n,{instance:t,className:r,isIsolated:!1}),e.r=n,c._emitter.emit("create",{args:i,className:r,isIsolated:!1,instance:n})}catch(t){e.e=t.message}return t}static _handleCallAll(e){try{const t=[];for(const[r,{className:n,instance:i,isIsolated:o}]of c._instances){if(n!==e.c||o)continue;let s=!0,a=null;try{const t=c._unwrapArguments(e,r);t&&(s=i[t[0]].apply(i,t.slice(1)),s=c.sanitizeEventListenerReturnValues(s))}catch(e){a=e.message}c._isPromise(s)?t.push(s.then(e=>({id:r,val:e,err:null})).catch(e=>({id:r,err:e,val:null}))):t.push({id:r,val:s,err:a})}this._handlePromise(e,Promise.allSettled(t).then(e=>e.filter(e=>"fulfilled"===e.status).map(e=>e.value)))}catch(t){e.e=t.message}}static sanitizeEventListenerReturnValues(e){return!(!e||"object"!=typeof e||void 0===e._events||void 0===e._eventsCount)||e}static _handleDelete(e){try{const t=e.a[0];c._assertOwner(c._instances.get(t),e,t),c._emitter.emit("beforeDelete",{instance:t,className:e.c}),e.r=c._delete(t),c._emitter.emit("delete",{instance:t,className:e.c})}catch(t){e.e=t.message}}static _handleCall(e){try{c._assertOwner(c._instances.get(e.c),e,e.c)}catch(t){const{message:r,cause:n}=t;return void(e.e={message:r,cause:n})}if("removeAllListeners"===e.f)return c._removeAllListeners(e.a[0],e.s,e.c),void(e.r=!0);const t=c._unwrapArguments(e);if(!t)return void(e.r=!0);if(e.c===s){try{const r=window[a][e.f].apply(null,t);c._isPromise(r)?c._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}return}const r=c._functionRegistry.get(e.c);if(void 0!==r){const{Klass:n}=r;if(!c._isFunction(n[e.f]))throw new Error(`Could not find static function: ${e.f}`);try{const r=n[e.f].apply(null,t);c._isPromise(r)?c._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}}else{const r=c._instances.get(e.c);if(void 0===r)throw new Error(`Could not find context: ${e.c}`);const{instance:n}=r;if(!c._isFunction(n[e.f]))throw new Error(`Could not find member function: ${e.f}`);try{let r=n[e.f].apply(n,t);r=c.sanitizeEventListenerReturnValues(r),c._isPromise(r)?c._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}}}static _create(e,t,...r){const n=c._instances.get(t);if(n)return n.instance;const{Klass:i,withNew:o,schema:s}=c._getClassEntry(e);return null!==s&&c._validate(s,...r),o?new i(...r):i(...r)}static _delete(e){const t=c._instances.get(e);return!!t&&(c._isFunction(t.removeAllListeners)&&t.removeAllListeners(),delete c._listeners[e],c._instances.delete(e),!0)}static _unregisterClient(e){Object.entries(c._listeners).forEach(([t,r])=>{Object.entries(r).forEach(([r,n])=>{const{clients:i,listener:o,event:s}=n,a=i.indexOf(e);if(-1!==a&&(i.splice(a,1),0===i.length)){const e=c.getInstance(t);e&&e.removeListener&&e.removeListener(s,o),delete c._listeners[t][r]}})})}static _validate(e,t){if(c._ajv||(c._ajv=new n({useDefaults:!0})),!c._ajv.validate(e,t))throw new Error(c._ajv.errorsText())}static _unwrapArguments(e,t){const r=e.s,n=void 0!==t,i=n?t:e.c,o=n?e.a.slice(1):e.a,s=n?e.a[0]:e.f,a=n?[s]:[];for(const e of o)if("string"==typeof e)if(e.startsWith("__f__"))a.push(c._generateCallback({clientId:r,isCallAll:n,instanceId:i,eventId:e}));else if(e.startsWith("__e__"))if("on"===s||"addListener"===s){c._mustTrackClient=!0;const t=c._registerListener({clientId:r,isCallAll:n,instanceId:i,eventId:e,event:o[0]});if(!t)return null;a.push(t)}else if("off"===s||"removeListener"===s){const t=c._unregisterListener({clientId:r,instanceId:i,eventId:e});if(!t)return null;a.push(t)}else{c._mustTrackClient=!0;const t=c._registerListener({clientId:r,isCallAll:n,instanceId:i,eventId:e,event:null});a.push(t)}else a.push(e);else a.push(e);return a}static _generateCallback({eventId:e,clientId:t,instanceId:r,isCallAll:n}){return(...i)=>{const o=n?[r,...i]:[...i];c._callback({a:o,s:t,i:e})}}static _registerListener({eventId:e,clientId:t,instanceId:r,event:n,isCallAll:i}){return c._listeners[r]?c._listeners[r][e]?(c._listeners[r][e].clients.push(t),null):(c._listeners[r][e]={event:n,clients:[t],listener:c._generateListener({eventId:e,instanceId:r,isCallAll:i})},c._listeners[r][e].listener):(c._listeners[r]={[e]:{event:n,clients:[t],listener:c._generateListener({eventId:e,instanceId:r,isCallAll:i})}},c._listeners[r][e].listener)}static _generateListener({eventId:e,instanceId:t,isCallAll:r}){return(...n)=>{const i=r?[t,...n]:[...n];c._callback({a:i,i:e})}}static _unregisterListener({eventId:e,clientId:t,instanceId:r}){if(c._listeners[r]&&c._listeners[r][e]){const{listener:n,clients:i}=c._listeners[r][e],o=i.indexOf(t);if(-1!==o&&i.splice(o,1),0===i.length)return delete c._listeners[r][e],0===Object.keys(c._listeners[r]).length&&delete c._listeners[r],n}}static _removeAllListeners(e,t,r){const n=c._listeners[r];n&&Object.entries(n).forEach(([n,i])=>{i.event===e&&i.clients.includes(t)&&(i.clients=i.clients.filter(e=>e!==t),0===i.clients.length&&(c.getInstance(r).removeListener(i.event,i.listener),delete c._listeners[r][n]))})}static _handlePromise(e,t){try{const r=c._correlationId++%Number.MAX_SAFE_INTEGER,n=`__p__${e.f}-${r}`;e.r=n,t.then(t=>c._callback({...e,r:t,i:n})).catch(t=>c._callback({...e,e:t.message,i:n}))}catch(t){e.data.e=t.message}}static _getClassEntry(e){const t=c._functionRegistry.get(e);if(!t)throw new Error(`"${e}" is not a registered class`);return t}static _isFunction(e){if(e){const t={}.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}return!1}static _isClass(e){return!!e&&"function"==typeof e&&/^\s*class\s+/.test(e.toString())}static _isPromise(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}static _extractMemberFunctions(e){let t=e,r=[];do{if(t.prototype){const e=Object.getOwnPropertyNames(t.prototype).filter(e=>!c._blackList.has(e)&&c._isFunction(t.prototype[e]));r=[...r,...e]}else{const e=Object.getOwnPropertyNames(t).filter(e=>!c._blackList.has(e)&&c._isFunction(t[e]));r=[...r,...e]}t=Object.getPrototypeOf(t)}while(t);return Array.from(new Set(r))}static _extractStaticFunctions(e){let t=e,r=[];do{r=[...r,...Object.getOwnPropertyNames(t).filter(e=>{const r=Object.getOwnPropertyDescriptor(t,e);return!!r&&"function"==typeof r.value})],t=Object.getPrototypeOf(t)}while(t&&t.name);return Array.from(new Set(r))}static _getClassesArray(){return Array.from(c._functionRegistry.keys())}static _getInstancesArray(e){const t=[];return c._instances.forEach((r,n)=>{r.className!==e||r.isIsolated||t.push(n)}),t}static _getMemberFunctionsArray(e){const t=c._functionRegistry.get(e);return t?t.memberFunctions:[]}static _getStaticFunctionsArray(e){const t=c._functionRegistry.get(e);return t?t.staticFunctions:[]}static _getMetaData(e){const t=c._functionRegistry.get(e);return t&&t.meta?t.meta:{}}}c._functionRegistry=new Map,c._instances=new Map,c._emitter=new i,c._correlationId=0,c._listeners={},c._blackList=new Set(["caller","callee","arguments","apply","bind","call","toString","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),c.LOCAL_SENDER=Symbol("vrpc.local-sender"),e.exports=c},8708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(9029),i=r(4227),o=r(2023);function s(e,t){const r=e.const("err",t);e.if(n._`${o.default.vErrors} === null`,()=>e.assign(o.default.vErrors,n._`[${r}]`),n._`${o.default.vErrors}.push(${r})`),e.code(n._`${o.default.errors}++`)}function a(e,t){const{gen:r,validateName:i,schemaEnv:o}=e;o.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${i}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,i,o){const{it:c}=e,{gen:u,compositeRule:h,allErrors:f}=c,p=l(e,r,i);(null!=o?o:h||f)?s(u,p):a(c,n._`[${p}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:i}=e,{gen:c,compositeRule:u,allErrors:h}=i;s(c,l(e,r,n)),u||h||a(i,o.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(o.default.errors,t),e.if(n._`${o.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(n._`${o.default.vErrors}.length`,t),()=>e.assign(o.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:i,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const c=e.name("err");e.forRange("i",s,o.default.errors,s=>{e.const(c,n._`${o.default.vErrors}[${s}]`),e.if(n._`${c}.instancePath === undefined`,()=>e.assign(n._`${c}.instancePath`,(0,n.strConcat)(o.default.instancePath,a.errorPath))),e.assign(n._`${c}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${c}.schema`,r),e.assign(n._`${c}.data`,i))})};const c={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function l(e,t,r){const{createErrors:i}=e.it;return!1===i?n._`{}`:function(e,t,r={}){const{gen:i,it:s}=e,a=[u(s,r),h(e,r)];return function(e,{params:t,message:r},i){const{keyword:s,data:a,schemaValue:l,it:u}=e,{opts:h,propertyName:f,topSchemaRef:p,schemaPath:d}=u;i.push([c.keyword,s],[c.params,"function"==typeof t?t(e):t||n._`{}`]),h.messages&&i.push([c.message,"function"==typeof r?r(e):r]),h.verbose&&i.push([c.schema,l],[c.parentSchema,n._`${p}${d}`],[o.default.data,a]),f&&i.push([c.propertyName,f])}(e,t,a),i.object(...a)}(e,t,r)}function u({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,r)]}function h({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let s=o?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,i.getErrorPath)(r,i.Type.Str)}`),[c.schemaPath,s]}},8727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(8708),i=r(9029),o=r(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:i}=e,o={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(o,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(o.default.data):(t.assign(i._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},8752:()=>{},8799:(e,t,r)=>{"use strict";function n(e){var t=this;if(t instanceof n||(t=new n),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach(function(e){t.push(e)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)t.push(arguments[r]);return t}function i(e,t,r){var n=t===e.head?new a(r,null,t,e):new a(r,t,t.next,e);return null===n.next&&(e.tail=n),null===n.prev&&(e.head=n),e.length++,n}function o(e,t){e.tail=new a(t,e.tail,null,e),e.head||(e.head=e.tail),e.length++}function s(e,t){e.head=new a(t,null,e.head,e),e.tail||(e.tail=e.head),e.length++}function a(e,t,r,n){if(!(this instanceof a))return new a(e,t,r,n);this.list=n,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}e.exports=n,n.Node=a,n.create=n,n.prototype.removeNode=function(e){if(e.list!==this)throw new Error("removing node which does not belong to this list");var t=e.next,r=e.prev;return t&&(t.prev=r),r&&(r.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=r),e.list.length--,e.next=null,e.prev=null,e.list=null,t},n.prototype.unshiftNode=function(e){if(e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},n.prototype.pushNode=function(e){if(e!==this.tail){e.list&&e.list.removeNode(e);var t=this.tail;e.list=this,e.prev=t,t&&(t.next=e),this.tail=e,this.head||(this.head=e),this.length++}},n.prototype.push=function(){for(var e=0,t=arguments.length;e<t;e++)o(this,arguments[e]);return this.length},n.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)s(this,arguments[e]);return this.length},n.prototype.pop=function(){if(this.tail){var e=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,e}},n.prototype.shift=function(){if(this.head){var e=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,e}},n.prototype.forEach=function(e,t){t=t||this;for(var r=this.head,n=0;null!==r;n++)e.call(t,r.value,n,this),r=r.next},n.prototype.forEachReverse=function(e,t){t=t||this;for(var r=this.tail,n=this.length-1;null!==r;n--)e.call(t,r.value,n,this),r=r.prev},n.prototype.get=function(e){for(var t=0,r=this.head;null!==r&&t<e;t++)r=r.next;if(t===e&&null!==r)return r.value},n.prototype.getReverse=function(e){for(var t=0,r=this.tail;null!==r&&t<e;t++)r=r.prev;if(t===e&&null!==r)return r.value},n.prototype.map=function(e,t){t=t||this;for(var r=new n,i=this.head;null!==i;)r.push(e.call(t,i.value,this)),i=i.next;return r},n.prototype.mapReverse=function(e,t){t=t||this;for(var r=new n,i=this.tail;null!==i;)r.push(e.call(t,i.value,this)),i=i.prev;return r},n.prototype.reduce=function(e,t){var r,n=this.head;if(arguments.length>1)r=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=e(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(e,t){var r,n=this.tail;if(arguments.length>1)r=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=e(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var e=new Array(this.length),t=0,r=this.head;null!==r;t++)e[t]=r.value,r=r.next;return e},n.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,r=this.tail;null!==r;t++)e[t]=r.value,r=r.prev;return e},n.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=0,o=this.head;null!==o&&i<e;i++)o=o.next;for(;null!==o&&i<t;i++,o=o.next)r.push(o.value);return r},n.prototype.sliceReverse=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var r=new n;if(t<e||t<0)return r;e<0&&(e=0),t>this.length&&(t=this.length);for(var i=this.length,o=this.tail;null!==o&&i>t;i--)o=o.prev;for(;null!==o&&i>e;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(e,t,...r){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var n=0,o=this.head;null!==o&&n<e;n++)o=o.next;var s=[];for(n=0;o&&n<t;n++)s.push(o.value),o=this.removeNode(o);for(null===o&&(o=this.tail),o!==this.head&&o!==this.tail&&(o=o.prev),n=0;n<r.length;n++)o=i(this,o,r[n]);return s},n.prototype.reverse=function(){for(var e=this.head,t=this.tail,r=e;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=t,this.tail=e,this};try{r(259)(n)}catch(e){}},8803:(e,t,r)=>{"use strict";const n=r(4599),i=r(9413),o=r(7833)("mqttjs:tls");e.exports=function(e,t){t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===i.isIP(t.host)&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,o("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const r=n.connect(t);function s(n){t.rejectUnauthorized&&e.emit("error",n),r.end()}return r.on("secureConnect",function(){t.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",s)}),r.on("error",s),r}},8835:(e,t,r)=>{"use strict";var n=r(9655);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),l=["'"].concat(c),u=["%","/","?",";","#"].concat(l),h=["/","?","#"],f=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,d={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},g=r(5373);function b(e,t,r){if(e&&"object"==typeof e&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var b=e=c.join(s);if(b=b.trim(),!r&&1===e.split("#").length){var _=a.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=t?g.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var v=o.exec(b);if(v){var w=(v=v[0]).toLowerCase();this.protocol=w,b=b.substr(v.length)}if(r||v||b.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===b.substr(0,2);!S||v&&m[v]||(b=b.substr(2),this.slashes=!0)}if(!m[v]&&(S||v&&!y[v])){for(var E,k,I=-1,P=0;P<h.length;P++)-1!==(A=b.indexOf(h[P]))&&(-1===I||A<I)&&(I=A);for(-1!==(k=-1===I?b.lastIndexOf("@"):b.lastIndexOf("@",I))&&(E=b.slice(0,k),b=b.slice(k+1),this.auth=decodeURIComponent(E)),I=-1,P=0;P<u.length;P++){var A;-1!==(A=b.indexOf(u[P]))&&(-1===I||A<I)&&(I=A)}-1===I&&(I=b.length),this.host=b.slice(0,I),b=b.slice(I),this.parseHost(),this.hostname=this.hostname||"";var $="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!$)for(var R=this.hostname.split(/\./),O=(P=0,R.length);P<O;P++){var T=R[P];if(T&&!T.match(f)){for(var C="",x=0,N=T.length;x<N;x++)T.charCodeAt(x)>127?C+="x":C+=T[x];if(!C.match(f)){var j=R.slice(0,P),M=R.slice(P+1),L=T.match(p);L&&(j.push(L[1]),M.unshift(L[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),$||(this.hostname=n.toASCII(this.hostname));var B=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+B,this.href+=this.host,$&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!d[w])for(P=0,O=l.length;P<O;P++){var D=l[P];if(-1!==b.indexOf(D)){var F=encodeURIComponent(D);F===D&&(F=escape(D)),b=b.split(D).join(F)}}var q=b.indexOf("#");-1!==q&&(this.hash=b.substr(q),b=b.slice(0,q));var V=b.indexOf("?");if(-1!==V?(this.search=b.substr(V),this.query=b.substr(V+1),t&&(this.query=g.parse(this.query)),b=b.slice(0,V)):t&&(this.search="",this.query={}),b&&(this.pathname=b),y[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){B=this.pathname||"";var K=this.search||"";this.path=B+K}return this.href=this.format(),this},i.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=g.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||y[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(b(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if("string"==typeof e){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),c=0;c<a.length;c++){var l=a[c];"protocol"!==l&&(r[l]=e[l])}return y[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!y[e.protocol]){for(var u=Object.keys(e),h=0;h<u.length;h++){var f=u[h];r[f]=e[f]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var d=r.pathname||"",g=r.search||"";r.path=d+g}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),v=_||b||r.host&&e.pathname,w=v,S=r.pathname&&r.pathname.split("/")||[],E=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!y[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),v=v&&(""===p[0]||""===S[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=p;else if(p.length)S||(S=[]),S.pop(),S=S.concat(p),r.search=e.search,r.query=e.query;else if(null!=e.search)return E&&(r.host=S.shift(),r.hostname=r.host,($=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=$.shift(),r.hostname=$.shift(),r.host=r.hostname)),r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=S.slice(-1)[0],I=(r.host||e.host||S.length>1)&&("."===k||".."===k)||""===k,P=0,A=S.length;A>=0;A--)"."===(k=S[A])?S.splice(A,1):".."===k?(S.splice(A,1),P++):P&&(S.splice(A,1),P--);if(!v&&!w)for(;P--;P)S.unshift("..");!v||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),I&&"/"!==S.join("/").substr(-1)&&S.push("");var $,R=""===S[0]||S[0]&&"/"===S[0].charAt(0);return E&&(r.hostname=R?"":S.length?S.shift():"",r.host=r.hostname,($=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=$.shift(),r.hostname=$.shift(),r.host=r.hostname)),(v=v||r.host&&S.length)&&!R&&S.unshift(""),S.length>0?r.pathname=S.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=b,t.resolve=function(e,t){return b(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?b(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=b(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i},8840:e=>{"use strict";function t(){if(!(this instanceof t))return new t;this.nextId=Math.max(1,Math.floor(65535*Math.random()))}t.prototype.allocate=function(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e},t.prototype.getLastAllocated=function(){return 1===this.nextId?65535:this.nextId-1},t.prototype.register=function(e){return!0},t.prototype.deallocate=function(e){},t.prototype.clear=function(){},e.exports=t},8859:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,l=a&&c&&"function"==typeof c.get?c.get:null,u=a&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,m=Object.prototype.toString,y=Function.prototype.toString,g=String.prototype.match,b=String.prototype.slice,_=String.prototype.replace,v=String.prototype.toUpperCase,w=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,k=Array.prototype.join,I=Array.prototype.slice,P=Math.floor,A="function"==typeof BigInt?BigInt.prototype.valueOf:null,$=Object.getOwnPropertySymbols,R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,O="function"==typeof Symbol&&"object"==typeof Symbol.iterator,T="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,x=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-P(-e):P(e);if(n!==e){var i=String(n),o=b.call(t,i.length+1);return _.call(i,r,"$&_")+"."+_.call(_.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(t,r,"$&_")}var j=r(2634),M=j.custom,L=W(M)?M:null,B={__proto__:null,double:'"',single:"'"},U={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function D(e,t,r){var n=r.quoteStyle||t,i=B[n];return i+e+i}function F(e){return _.call(String(e),/"/g,""")}function q(e){return!T||!("object"==typeof e&&(T in e||void 0!==e[T]))}function V(e){return"[object Array]"===G(e)&&q(e)}function K(e){return"[object RegExp]"===G(e)&&q(e)}function W(e){if(O)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!R)return!1;try{return R.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,i,a){var c=n||{};if(z(c,"quoteStyle")&&!z(B,c.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!z(c,"customInspect")||c.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var v=c.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return J(t,c);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return v?N(t,S):S}if("bigint"==typeof t){var P=String(t)+"n";return v?N(t,P):P}var $=void 0===c.depth?5:c.depth;if(void 0===i&&(i=0),i>=$&&$>0&&"object"==typeof t)return V(t)?"[Array]":"[Object]";var M,U=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=k.call(Array(e.indent+1)," ")}return{base:r,prev:k.call(Array(t+1),r)}}(c,i);if(void 0===a)a=[];else if(Q(a,t)>=0)return"[Circular]";function H(t,r,n){if(r&&(a=I.call(a)).push(r),n){var o={depth:c.depth};return z(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),e(t,o,i+1,a)}return e(t,c,i+1,a)}if("function"==typeof t&&!K(t)){var Y=function(e){if(e.name)return e.name;var t=g.call(y.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ne=re(t,H);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(ne.length>0?" { "+k.call(ne,", ")+" }":"")}if(W(t)){var ie=O?_.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):R.call(t);return"object"!=typeof t||O?ie:X(ie)}if((M=t)&&"object"==typeof M&&("undefined"!=typeof HTMLElement&&M instanceof HTMLElement||"string"==typeof M.nodeName&&"function"==typeof M.getAttribute)){for(var oe="<"+w.call(String(t.nodeName)),se=t.attributes||[],ae=0;ae<se.length;ae++)oe+=" "+se[ae].name+"="+D(F(se[ae].value),"double",c);return oe+=">",t.childNodes&&t.childNodes.length&&(oe+="..."),oe+"</"+w.call(String(t.nodeName))+">"}if(V(t)){if(0===t.length)return"[]";var ce=re(t,H);return U&&!function(e){for(var t=0;t<e.length;t++)if(Q(e[t],"\n")>=0)return!1;return!0}(ce)?"["+te(ce,U)+"]":"[ "+k.call(ce,", ")+" ]"}if(function(e){return"[object Error]"===G(e)&&q(e)}(t)){var le=re(t,H);return"cause"in Error.prototype||!("cause"in t)||C.call(t,"cause")?0===le.length?"["+String(t)+"]":"{ ["+String(t)+"] "+k.call(le,", ")+" }":"{ ["+String(t)+"] "+k.call(E.call("[cause]: "+H(t.cause),le),", ")+" }"}if("object"==typeof t&&m){if(L&&"function"==typeof t[L]&&j)return j(t,{depth:$-i});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!=typeof e)return!1;try{o.call(e);try{l.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ue=[];return s&&s.call(t,function(e,r){ue.push(H(r,t,!0)+" => "+H(e,t))}),ee("Map",o.call(t),ue,U)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e);try{o.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var he=[];return u&&u.call(t,function(e){he.push(H(e,t))}),ee("Set",l.call(t),he,U)}if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{h.call(e,h);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Z("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{h.call(e,h)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Z("WeakSet");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{return p.call(e),!0}catch(e){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===G(e)&&q(e)}(t))return X(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!A)return!1;try{return A.call(e),!0}catch(e){}return!1}(t))return X(H(A.call(t)));if(function(e){return"[object Boolean]"===G(e)&&q(e)}(t))return X(d.call(t));if(function(e){return"[object String]"===G(e)&&q(e)}(t))return X(H(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===G(e)&&q(e)}(t)&&!K(t)){var fe=re(t,H),pe=x?x(t)===Object.prototype:t instanceof Object||t.constructor===Object,de=t instanceof Object?"":"null prototype",me=!pe&&T&&Object(t)===t&&T in t?b.call(G(t),8,-1):de?"Object":"",ye=(pe||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(me||de?"["+k.call(E.call([],me||[],de||[]),": ")+"] ":"");return 0===fe.length?ye+"{}":U?ye+"{"+te(fe,U)+"}":ye+"{ "+k.call(fe,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function z(e,t){return H.call(e,t)}function G(e){return m.call(e)}function Q(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function J(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return J(b.call(e,0,t.maxStringLength),t)+n}var i=U[t.quoteStyle||"single"];return i.lastIndex=0,D(_.call(_.call(e,i,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(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":"")+v.call(t.toString(16))}function X(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):k.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+k.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=V(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=z(e,i)?t(e[i],e):""}var o,s="function"==typeof $?$(e):[];if(O){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var c in e)z(e,c)&&(r&&String(Number(c))===c&&c<e.length||O&&o["$"+c]instanceof Symbol||(S.call(/[^\w$]/,c)?n.push(t(c,e)+": "+t(e[c],e)):n.push(c+": "+t(e[c],e))));if("function"==typeof $)for(var l=0;l<s.length;l++)C.call(e,s[l])&&n.push("["+t(s[l])+"]: "+t(e[s[l]],e));return n}},8968:e=>{"use strict";e.exports=Math.floor},9026:(e,t,r)=>{"use strict";var n,i=r(5606);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=I,I.WritableState=k;var s,a={deprecate:r(4643)},c=r(4415),l=r(8287).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},h=r(7302),f=r(3513).getHighWaterMark,p=r(9470).F,d=p.ERR_INVALID_ARG_TYPE,m=p.ERR_METHOD_NOT_IMPLEMENTED,y=p.ERR_MULTIPLE_CALLBACK,g=p.ERR_STREAM_CANNOT_PIPE,b=p.ERR_STREAM_DESTROYED,_=p.ERR_STREAM_NULL_VALUES,v=p.ERR_STREAM_WRITE_AFTER_END,w=p.ERR_UNKNOWN_ENCODING,S=h.errorOrDestroy;function E(){}function k(e,t,s){n=n||r(6888),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=f(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new y;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(T,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),T(e,t))}(e,r,n,t,o);else{var s=R(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||$(e,r),n?i.nextTick(A,e,r,s,o):A(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function I(e){var t=this instanceof(n=n||r(6888));if(!t&&!s.call(I,this))return new I(e);this._writableState=new k(e,this,t),this.writable=!0,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)),c.call(this)}function P(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new b("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function A(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),T(e,t)}function $(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,c=!0;r;)i[a]=r,r.isBuf||(c=!1),r=r.next,a+=1;i.allBuffers=c,P(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,u=r.encoding,h=r.callback;if(P(e,t,!1,t.objectMode?1:l.length,l,u,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function R(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),T(e,t)})}function T(e,t){var r=R(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(I,c),k.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(k.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===I&&e&&e._writableState instanceof k}})):s=function(e){return e instanceof this},I.prototype.pipe=function(){S(this,new g)},I.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,l.isBuffer(n)||n instanceof u);return a&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new v;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new _:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else P(e,t,!1,a,n,i,o);return c}(this,o,a,e,t,r)),s},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||$(this,e))},I.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,t,r){r(new m("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,T(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=h.destroy,I.prototype._undestroy=h.undestroy,I.prototype._destroy=function(e,t){t(e)}},9029:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1520),i=r(7845);var o=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?i.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class l extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=T(this.rhs,e,t),this}get names(){return O(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class u extends l{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class p extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class d extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=T(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const i=r[n];i.optimizeNames(e,t)||(C(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>R(e,t.names),{})}}class y extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class g extends m{}class b extends y{}b.kind="else";class _ extends y{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(x(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=T(this.condition,e,t),this}get names(){const e=super.names;return O(e,this.condition),this.else&&R(e,this.else.names),e}}_.kind="if";class v extends y{}v.kind="for";class w extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=T(this.iteration,e,t),this}get names(){return R(super.names,this.iteration.names)}}class S extends v{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?i.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){const e=O(super.names,this.from);return O(e,this.to)}}class E extends v{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=T(this.iterable,e,t),this}get names(){return R(super.names,this.iterable.names)}}class k extends y{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}k.kind="func";class I extends m{render(e){return"return "+super.render(e)}}I.kind="return";class P extends y{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&R(e,this.catch.names),this.finally&&R(e,this.finally.names),e}}class A extends y{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}A.kind="catch";class $ extends y{render(e){return"finally"+super.render(e)}}function R(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function O(e,t){return t instanceof n._CodeOrName?R(e,t.names):e}function T(e,t,r){return e instanceof n.Name?o(e):(i=e)instanceof n._Code&&i._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])?new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=o(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[])):e;var i;function o(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function C(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function x(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${L(e)}`}$.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new g]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new c(e,i,r)),i}const(e,t,r){return this._def(i.varKinds.const,e,t,r)}let(e,t,r){return this._def(i.varKinds.let,e,t,r)}var(e,t,r){return this._def(i.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new l(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new d(e)),this}object(...e){const t=["{"];for(const[r,i]of e)t.length>1&&t.push(","),t.push(r),(r!==i||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,i));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,n,o=(this.opts.es5?i.varKinds.var:i.varKinds.let)){const s=this._scope.toName(e);return this._for(new S(o,s,t,r),()=>n(s))}forOf(e,t,r,o=i.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,t=>{this.var(s,n._`${e}[${t}]`),r(s)})}return this._for(new E("of",o,s,t),()=>r(s))}forIn(e,t,r,o=(this.opts.es5?i.varKinds.var:i.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new E("in",o,s,t),()=>r(s))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new h(e))}break(e){return this._leafNode(new f(e))}return(e){const t=new I;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new P;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new A(e),t(e)}return r&&(this._currNode=n.finally=new $,this.code(r)),this._endBlockNode(A,$)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,i){return this._blockNode(new k(e,t,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=x;const N=M(t.operators.AND);t.and=function(...e){return e.reduce(N)};const j=M(t.operators.OR);function M(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${L(t)} ${e} ${L(r)}`}function L(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(j)}},9046:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,o,s,a,c;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=("number"!=typeof c&&(c=0),c+1>(a=e).length||-1===a.indexOf(".",c)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},9075:(e,t,r)=>{"use strict";function n(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 i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var c=r(8287).Buffer,l=r(554).inspect,u=l&&l.custom||"inspect";function h(e,t,r){c.prototype.copy.call(e,t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{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;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),r=this.head,n=0;r;)h(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9158:(e,t,r)=>{"use strict";var n,i=r(5606);e.exports=I,I.ReadableState=k,r(7007).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(9239),c=r(8287).Buffer,l=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(8752);o=u&&u.debuglog?u.debuglog("stream"):function(){};var h,f,p,d=r(9595),m=r(2110),y=r(8241).getHighWaterMark,g=r(9046).F,b=g.ERR_INVALID_ARG_TYPE,_=g.ERR_STREAM_PUSH_AFTER_EOF,v=g.ERR_METHOD_NOT_IMPLEMENTED,w=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(I,a);var S=m.errorOrDestroy,E=["error","close","destroy","pause","resume"];function k(e,t,i){n=n||r(7920),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=y(this,e,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=r(3141).I),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function I(e){if(n=n||r(7920),!(this instanceof I))return new I(e);var t=this instanceof n;this._readableState=new k(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function P(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("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?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,T(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,c.isBuffer(n)||n instanceof l||"string"==typeof t||void 0===t||e.objectMode||(r=new b("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n)a.endEmitted?S(e,new w):A(e,a,t,!0);else if(a.ended)S(e,new _);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?A(e,a,t,!1):C(e,a)):A(e,a,t,!1)}else n||(a.reading=!1,C(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function A(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&O(e)),C(e,t)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),I.prototype.destroy=m.destroy,I.prototype._undestroy=m.undestroy,I.prototype._destroy=function(e,t){t(e)},I.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),P(this,e,t,!1,r)},I.prototype.unshift=function(e){return P(this,e,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(e){h||(h=r(3141).I);var t=new h(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var $=1073741824;function R(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=$?e=$:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(T,e))}function T(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function C(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(x,e,t))}function x(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function N(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function j(e){o("readable nexttick read 0"),e.read(0)}function M(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function B(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}function U(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(D,t,e))}function D(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}I.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?U(this):O(this),null;if(0===(e=R(e,t))&&t.ended)return 0===t.length&&U(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=R(r,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&U(this)),null!==n&&this.emit("data",n),n},I.prototype._read=function(e){S(this,new v("_read()"))},I.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?m:c;function c(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",h),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l())});var l=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(r);e.on("drain",l);var u=!1;function h(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==F(n.pipes,e))&&!u&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function f(t){o("onerror",t),m(),e.removeListener("error",f),0===s(e,"error")&&S(e,t)}function p(){e.removeListener("finish",d),m()}function d(){o("onfinish"),e.removeListener("close",p),m()}function m(){o("unpipe"),r.unpipe(e)}return r.on("data",h),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",f),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},I.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=F(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},I.prototype.on=function(e,t){var r=a.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,o("on readable",n.length,n.reading),n.length?O(this):n.reading||i.nextTick(j,this))),r},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(N,this),r},I.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(N,this),t},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(M,e,t))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(I.prototype[Symbol.asyncIterator]=function(){return void 0===f&&(f=r(2493)),f(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),I._fromList=B,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(I.from=function(e,t){return void 0===p&&(p=r(2855)),p(I,e,t)})},9239:(e,t,r)=>{e.exports=r(7007).EventEmitter},9290:(e,t,r)=>{"use strict";e.exports=i;var n=r(3080);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},9291:(e,t,r)=>{"use strict";const n=r(8194).CD,i=r(7833)("number-allocator:trace"),o=r(7833)("number-allocator:error");function s(e,t){this.low=e,this.high=t}function a(e,t){if(!(this instanceof a))return new a(e,t);this.min=e,this.max=t,this.ss=new n([],(e,t)=>e.compare(t)),i("Create"),this.clear()}s.prototype.equals=function(e){return this.low===e.low&&this.high===e.high},s.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;const e=this.ss.begin(),t=e.pointer.low,r=e.pointer.high,n=t;return n+1<=r?this.ss.updateKeyByIterator(e,new s(t+1,r)):this.ss.eraseElementByPos(0),i("alloc():"+n),n},a.prototype.use=function(e){const t=new s(e,e),r=this.ss.lowerBound(t);if(!r.equals(this.ss.end())){const n=r.pointer.low,o=r.pointer.high;return r.pointer.equals(t)?(this.ss.eraseElementByIterator(r),i("use():"+e),!0):!(n>e||(n===e?(this.ss.updateKeyByIterator(r,new s(n+1,o)),i("use():"+e),0):o===e?(this.ss.updateKeyByIterator(r,new s(n,o-1)),i("use():"+e),0):(this.ss.updateKeyByIterator(r,new s(e+1,o)),this.ss.insert(new s(n,e-1)),i("use():"+e),0)))}return i("use():failed"),!1},a.prototype.free=function(e){if(e<this.min||e>this.max)return void o("free():"+e+" is out of range");const t=new s(e,e),r=this.ss.upperBound(t);if(r.equals(this.ss.end())){if(r.equals(this.ss.begin()))return void this.ss.insert(t);r.pre();const n=r.pointer.high;r.pointer.high+1===e?this.ss.updateKeyByIterator(r,new s(n,e)):this.ss.insert(t)}else if(r.equals(this.ss.begin()))if(e+1===r.pointer.low){const t=r.pointer.high;this.ss.updateKeyByIterator(r,new s(e,t))}else this.ss.insert(t);else{const n=r.pointer.low,i=r.pointer.high;r.pre();const o=r.pointer.low;r.pointer.high+1===e?e+1===n?(this.ss.eraseElementByIterator(r),this.ss.updateKeyByIterator(r,new s(o,i))):this.ss.updateKeyByIterator(r,new s(o,e)):e+1===n?(this.ss.eraseElementByIterator(r.next()),this.ss.insert(new s(e,i))):this.ss.insert(t)}i("free():"+e)},a.prototype.clear=function(){i("clear()"),this.ss.clear(),this.ss.insert(new s(this.min,this.max))},a.prototype.intervalCount=function(){return this.ss.size()},a.prototype.dump=function(){console.log("length:"+this.ss.size());for(const e of this.ss)console.log(e)},e.exports=a},9353:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=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};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,s=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),a=r(0,i.length-s.length),c=[],l=0;l<a;l++)c[l]="$"+l;if(o=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(c)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var t=i.apply(this,n(s,arguments));return Object(t)===t?t:this}return i.apply(e,n(s,arguments))}),i.prototype){var u=function(){};u.prototype=i.prototype,o.prototype=new u,u.prototype=null}return o}},9383:e=>{"use strict";e.exports=Error},9413:()=>{},9455:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),i=r(7041).Transform,o=r(2623);let s,a,c;e.exports=function(e,t){if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const l=function(e,t){const r="wxs"===e.protocol?"wss":"ws";let n=r+"://"+e.hostname+e.path;return e.port&&80!==e.port&&443!==e.port&&(n=r+"://"+e.hostname+":"+e.port+e.path),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);s=wx.connectSocket({url:l,protocols:[r]}),a=function(){const e=new i;return e._write=function(e,t,r){s.send({data:e.buffer,success:function(){r()},fail:function(e){r(new Error(e))}})},e._flush=function(e){s.close({success:function(){e()}})},e}(),c=o.obj(),c._destroy=function(e,t){s.close({success:function(){t&&t(e)}})};const u=c.destroy;return c.destroy=function(){c.destroy=u;const e=this;setTimeout(function(){s.close({fail:function(){e._destroy(new Error)}})},0)}.bind(c),s.onOpen(function(){c.setReadable(a),c.setWritable(a),c.emit("connect")}),s.onMessage(function(e){let t=e.data;t=t instanceof ArrayBuffer?n.from(t):n.from(t,"utf8"),a.push(t)}),s.onClose(function(){c.end(),c.destroy()}),s.onError(function(e){c.destroy(new Error(e.errMsg))}),c}},9470:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,o,s,a,c;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var l=("number"!=typeof c&&(c=0),c+1>(a=e).length||-1===a.indexOf(".",c)?"argument":"property");s='The "'.concat(e,'" ').concat(l," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},9538:e=>{"use strict";e.exports=ReferenceError},9595:(e,t,r)=>{"use strict";function n(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 i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var c=r(8287).Buffer,l=r(7538).inspect,u=l&&l.custom||"inspect";function h(e,t,r){c.prototype.copy.call(e,t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{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;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t=c.allocUnsafe(e>>>0),r=this.head,n=0;r;)h(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return l(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},9612:e=>{"use strict";e.exports=Object},9655:function(e,t,r){var n;e=r.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r.g&&r.g;i.global!==i&&i.window!==i&&i.self;var o,s=2147483647,a=36,c=/^xn--/,l=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,h={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},f=Math.floor,p=String.fromCharCode;function d(e){throw new RangeError(h[e])}function m(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function y(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+m((e=e.replace(u,".")).split("."),t).join(".")}function g(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function b(e){return m(e,function(e){var t="";return e>65535&&(t+=p((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+p(e)}).join("")}function _(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:a}function v(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function w(e,t,r){var n=0;for(e=r?f(e/700):e>>1,e+=f(e/t);e>455;n+=a)e=f(e/35);return f(n+36*e/(e+38))}function S(e){var t,r,n,i,o,c,l,u,h,p,m=[],y=e.length,g=0,v=128,S=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&d("not-basic"),m.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<y;){for(o=g,c=1,l=a;i>=y&&d("invalid-input"),((u=_(e.charCodeAt(i++)))>=a||u>f((s-g)/c))&&d("overflow"),g+=u*c,!(u<(h=l<=S?1:l>=S+26?26:l-S));l+=a)c>f(s/(p=a-h))&&d("overflow"),c*=p;S=w(g-o,t=m.length+1,0==o),f(g/t)>s-v&&d("overflow"),v+=f(g/t),g%=t,m.splice(g++,0,v)}return b(m)}function E(e){var t,r,n,i,o,c,l,u,h,m,y,b,_,S,E,k=[];for(b=(e=g(e)).length,t=128,r=0,o=72,c=0;c<b;++c)(y=e[c])<128&&k.push(p(y));for(n=i=k.length,i&&k.push("-");n<b;){for(l=s,c=0;c<b;++c)(y=e[c])>=t&&y<l&&(l=y);for(l-t>f((s-r)/(_=n+1))&&d("overflow"),r+=(l-t)*_,t=l,c=0;c<b;++c)if((y=e[c])<t&&++r>s&&d("overflow"),y==t){for(u=r,h=a;!(u<(m=h<=o?1:h>=o+26?26:h-o));h+=a)E=u-m,S=a-m,k.push(p(v(m+E%S,0))),u=f(E/S);k.push(p(v(u,0))),o=w(r,_,n==i),r=0,++n}++r,++t}return k.join("")}o={version:"1.4.1",ucs2:{decode:g,encode:b},decode:S,encode:E,toASCII:function(e){return y(e,function(e){return l.test(e)?"xn--"+E(e):e})},toUnicode:function(e){return y(e,function(e){return c.test(e)?S(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},9675:e=>{"use strict";e.exports=TypeError},9713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),i=r(4227),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:o,it:s}=e;if((0,i.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",o,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(a)}};t.default=o},9749:(e,t,r)=>{"use strict";const n=r(8799),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),c=Symbol("maxAge"),l=Symbol("dispose"),u=Symbol("noDisposeOnSet"),h=Symbol("lruList"),f=Symbol("cache"),p=Symbol("updateAgeOnGet"),d=()=>1,m=(e,t,r)=>{const n=e[f].get(t);if(n){const t=n.value;if(y(e,t)){if(b(e,n),!e[a])return}else r&&(e[p]&&(n.value.now=Date.now()),e[h].unshiftNode(n));return t.value}},y=(e,t)=>{if(!t||!t.maxAge&&!e[c])return!1;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[c]&&r>e[c]},g=e=>{if(e[o]>e[i])for(let t=e[h].tail;e[o]>e[i]&&null!==t;){const r=t.prev;b(e,t),t=r}},b=(e,t)=>{if(t){const r=t.value;e[l]&&e[l](r.key,r.value),e[o]-=r.length,e[f].delete(r.key),e[h].removeNode(t)}};class _{constructor(e,t,r,n,i){this.key=e,this.value=t,this.length=r,this.now=n,this.maxAge=i||0}}const v=(e,t,r,n)=>{let i=r.value;y(e,i)&&(b(e,r),e[a]||(i=void 0)),i&&t.call(n,i.value,i.key,e)};e.exports=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[i]=e.max||1/0;const t=e.length||d;if(this[s]="function"!=typeof t?d:t,this[a]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[c]=e.maxAge||0,this[l]=e.dispose,this[u]=e.noDisposeOnSet||!1,this[p]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[i]=e||1/0,g(this)}get max(){return this[i]}set allowStale(e){this[a]=!!e}get allowStale(){return this[a]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[c]=e,g(this)}get maxAge(){return this[c]}set lengthCalculator(e){"function"!=typeof e&&(e=d),e!==this[s]&&(this[s]=e,this[o]=0,this[h].forEach(e=>{e.length=this[s](e.value,e.key),this[o]+=e.length})),g(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[h].length}rforEach(e,t){t=t||this;for(let r=this[h].tail;null!==r;){const n=r.prev;v(this,e,r,t),r=n}}forEach(e,t){t=t||this;for(let r=this[h].head;null!==r;){const n=r.next;v(this,e,r,t),r=n}}keys(){return this[h].toArray().map(e=>e.key)}values(){return this[h].toArray().map(e=>e.value)}reset(){this[l]&&this[h]&&this[h].length&&this[h].forEach(e=>this[l](e.key,e.value)),this[f]=new Map,this[h]=new n,this[o]=0}dump(){return this[h].map(e=>!y(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[h]}set(e,t,r){if((r=r||this[c])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](t,e);if(this[f].has(e)){if(a>this[i])return b(this,this[f].get(e)),!1;const s=this[f].get(e).value;return this[l]&&(this[u]||this[l](e,s.value)),s.now=n,s.maxAge=r,s.value=t,this[o]+=a-s.length,s.length=a,this.get(e),g(this),!0}const p=new _(e,t,a,n,r);return p.length>this[i]?(this[l]&&this[l](e,t),!1):(this[o]+=p.length,this[h].unshift(p),this[f].set(e,this[h].head),g(this),!0)}has(e){if(!this[f].has(e))return!1;const t=this[f].get(e).value;return!y(this,t)}get(e){return m(this,e,!0)}peek(e){return m(this,e,!1)}pop(){const e=this[h].tail;return e?(b(this,e),e.value):null}del(e){b(this,this[f].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const n=e[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const e=i-t;e>0&&this.set(n.k,n.v,e)}}}prune(){this[f].forEach((e,t)=>m(this,t,!1))}}},9816:(e,t,r)=>{"use strict";e.exports=u;var n=r(2014).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(5240);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);c.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush(function(t,r){f(e,t,r)})}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(6698)(u,c),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new i("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},9844:(e,t,r)=>{"use strict";var n=r(8287).Buffer;function i(e){return e instanceof n?n.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){if((e=e||{}).circles)return function(e){const t=[],r=[],n=new Map;if(n.set(Date,e=>new Date(e)),n.set(Map,(e,t)=>new Map(s(Array.from(e),t))),n.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(const t of e.constructorHandlers)n.set(t[0],t[1]);let o=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(o=n.get(a.constructor)))return o(a,e);const c={};t.push(a),r.push(c);for(const s in a){const l=a[s];if("object"!=typeof l||null===l)c[s]=l;else if(l.constructor!==Object&&(o=n.get(l.constructor)))c[s]=o(l,e);else if(ArrayBuffer.isView(l))c[s]=i(l);else{const n=t.indexOf(l);c[s]=-1!==n?r[n]:e(l)}}return t.pop(),r.pop(),c}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(o=n.get(a.constructor)))return o(a,e);const c={};t.push(a),r.push(c);for(const s in a){if(!1===Object.hasOwnProperty.call(a,s))continue;const l=a[s];if("object"!=typeof l||null===l)c[s]=l;else if(l.constructor!==Object&&(o=n.get(l.constructor)))c[s]=o(l,e);else if(ArrayBuffer.isView(l))c[s]=i(l);else{const n=t.indexOf(l);c[s]=-1!==n?r[n]:e(l)}}return t.pop(),r.pop(),c};function s(e,s){const a=Object.keys(e),c=new Array(a.length);for(let l=0;l<a.length;l++){const u=a[l],h=e[u];if("object"!=typeof h||null===h)c[u]=h;else if(h.constructor!==Object&&(o=n.get(h.constructor)))c[u]=o(h,s);else if(ArrayBuffer.isView(h))c[u]=i(h);else{const e=t.indexOf(h);c[u]=-1!==e?r[e]:s(h)}}return c}}(e);const t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(n(Array.from(e),t))),t.set(Set,(e,t)=>new Set(n(Array.from(e),t))),e.constructorHandlers)for(const r of e.constructorHandlers)t.set(r[0],r[1]);let r=null;return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return n(o,e);if(o.constructor!==Object&&(r=t.get(o.constructor)))return r(o,e);const s={};for(const n in o){const a=o[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=i(a):s[n]=e(a)}return s}:function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return n(o,e);if(o.constructor!==Object&&(r=t.get(o.constructor)))return r(o,e);const s={};for(const n in o){if(!1===Object.hasOwnProperty.call(o,n))continue;const a=o[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=i(a):s[n]=e(a)}return s};function n(e,n){const o=Object.keys(e),s=new Array(o.length);for(let a=0;a<o.length;a++){const c=o[a],l=e[c];"object"!=typeof l||null===l?s[c]=l:l.constructor!==Object&&(r=t.get(l.constructor))?s[c]=r(l,n):ArrayBuffer.isView(l)?s[c]=i(l):s[c]=n(l)}return s}}},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},9957:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);e.exports=o.call(n,i)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return 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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(1860)})());
|
|
8
|
+
deps: ${r}}`};const s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){const[t,r]=function({schema:e}){const t={},r={};for(const n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);a(e,t),l(e,r)}};function a(e,t=e.schema){const{gen:r,data:o,it:s}=e;if(0===Object.keys(t).length)return;const a=r.let("missing");for(const l in t){const c=t[l];if(0===c.length)continue;const u=(0,i.propertyInData)(r,o,l,s.opts.ownProperties);e.setParams({property:l,depsCount:c.length,deps:c.join(", ")}),s.allErrors?r.if(u,()=>{for(const t of c)(0,i.checkReportMissingProp)(e,t)}):(r.if(n._`${u} && (${(0,i.checkMissingProp)(e,c,a)})`),(0,i.reportMissingProp)(e,a),r.else())}}function l(e,t=e.schema){const{gen:r,data:n,keyword:s,it:a}=e,l=r.name("valid");for(const c in t)(0,o.alwaysValidSchema)(a,t[c])||(r.if((0,i.propertyInData)(r,n,c,a.opts.ownProperties),()=>{const t=e.subschema({keyword:s,schemaProp:c},l);e.mergeValidEvaluated(t,l)},()=>r.var(l,!0)),e.ok(l))}t.validatePropertyDeps=a,t.validateSchemaDeps=l,t.default=s},3030:(e,t,r)=>{"use strict";const n=r(3061);e.exports=n.default||n},3061:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>_s});var n=Object.defineProperty,o=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,s=Object.prototype.hasOwnProperty,a=(e,t)=>()=>(e&&(t=e(e=0)),t),l=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),c=(e,t)=>{for(var r in t)n(e,r,{get:t[r],enumerable:!0})},u=e=>((e,t,r,a)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of i(t))!s.call(e,r)&&undefined!==r&&n(e,r,{get:()=>t[r],enumerable:!(a=o(t,r))||a.enumerable});return e})(n({},"__esModule",{value:!0}),e),f=a(()=>{}),h={};function d(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function p(){!x||!T||(x=!1,T.length?O=T.concat(O):C=-1,O.length&&m())}function m(){if(!x){var e=setTimeout(p,0);x=!0;for(var t=O.length;t;){for(T=O,O=[];++C<t;)T&&T[C].run();C=-1,t=O.length}T=null,x=!1,clearTimeout(e)}}function g(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];O.push(new y(e,t)),1===O.length&&!x&&setTimeout(m,0)}function y(e,t){this.fun=e,this.array=t}function b(){}function _(e){d("_linkedBinding")}function v(e){d("dlopen")}function w(){return[]}function S(){return[]}function E(e,t){if(!e)throw new Error(t||"assertion error")}function k(){return!1}function I(){return Pe.now()/1e3}function A(e){var t=Math.floor(.001*(Date.now()-Pe.now())),r=.001*Pe.now(),n=Math.floor(r)+t,o=Math.floor(r%1*1e9);return e&&(n-=e[0],(o-=e[1])<0&&(n--,o+=Oe)),[n,o]}function P(){return Fe}function $(e){return[]}c(h,{_debugEnd:()=>de,_debugProcess:()=>he,_events:()=>Te,_eventsCount:()=>Ce,_exiting:()=>Y,_fatalExceptions:()=>ce,_getActiveHandles:()=>S,_getActiveRequests:()=>w,_kill:()=>ee,_linkedBinding:()=>_,_maxListeners:()=>xe,_preload_modules:()=>Ie,_rawDebug:()=>G,_startProfilerIdleNotifier:()=>pe,_stopProfilerIdleNotifier:()=>me,_tickCallback:()=>fe,abort:()=>_e,addListener:()=>Re,allowedNodeEnvironmentFlags:()=>ae,arch:()=>N,argv:()=>L,argv0:()=>ke,assert:()=>E,binding:()=>q,browser:()=>H,chdir:()=>z,config:()=>X,cpuUsage:()=>te,cwd:()=>V,debugPort:()=>Ee,default:()=>Fe,dlopen:()=>v,domain:()=>J,emit:()=>De,emitWarning:()=>F,env:()=>M,execArgv:()=>D,execPath:()=>Se,exit:()=>ie,features:()=>le,hasUncaughtExceptionCaptureCallback:()=>k,hrtime:()=>A,kill:()=>oe,listeners:()=>$,memoryUsage:()=>ne,moduleLoadList:()=>Q,nextTick:()=>g,off:()=>je,on:()=>P,once:()=>Ne,openStdin:()=>se,pid:()=>ve,platform:()=>j,ppid:()=>we,prependListener:()=>Ue,prependOnceListener:()=>Be,reallyExit:()=>Z,release:()=>K,removeAllListeners:()=>Le,removeListener:()=>Me,resourceUsage:()=>re,setSourceMapsEnabled:()=>Ae,setUncaughtExceptionCaptureCallback:()=>ue,stderr:()=>ye,stdin:()=>be,stdout:()=>ge,title:()=>R,umask:()=>W,uptime:()=>I,version:()=>U,versions:()=>B});var O,x,T,C,R,N,j,M,L,D,U,B,F,q,W,V,z,K,H,G,Q,J,Y,X,Z,ee,te,re,ne,oe,ie,se,ae,le,ce,ue,fe,he,de,pe,me,ge,ye,be,_e,ve,we,Se,Ee,ke,Ie,Ae,Pe,$e,Oe,xe,Te,Ce,Re,Ne,je,Me,Le,De,Ue,Be,Fe,qe=a(()=>{f(),ot(),We(),O=[],x=!1,C=-1,y.prototype.run=function(){this.fun.apply(null,this.array)},R="browser",N="x64",j="browser",M={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},L=["/usr/bin/node"],D=[],U="v16.8.0",B={},F=function(e,t){console.warn((t?t+": ":"")+e)},q=function(e){d("binding")},W=function(e){return 0},V=function(){return"/"},z=function(e){},K={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},H=!0,G=b,Q=[],J={},Y=!1,X={},Z=b,ee=b,re=te=function(){return{}},ne=te,oe=b,ie=b,se=b,ae={},le={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ce=b,ue=b,fe=b,he=b,de=b,pe=b,me=b,ge=void 0,ye=void 0,be=void 0,_e=b,ve=2,we=1,Se="/bin/usr/node",Ee=9229,ke="node",Ie=[],Ae=b,void 0===(Pe={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0}).now&&($e=Date.now(),Pe.timing&&Pe.timing.navigationStart&&($e=Pe.timing.navigationStart),Pe.now=()=>Date.now()-$e),Oe=1e9,A.bigint=function(e){var t=A(e);return typeof BigInt>"u"?t[0]*Oe+t[1]:BigInt(t[0]*Oe)+BigInt(t[1])},Fe={version:U,versions:B,arch:N,platform:j,browser:H,release:K,_rawDebug:G,moduleLoadList:Q,binding:q,_linkedBinding:_,_events:Te={},_eventsCount:Ce=0,_maxListeners:xe=10,on:P,addListener:Re=P,once:Ne=P,off:je=P,removeListener:Me=P,removeAllListeners:Le=P,emit:De=b,prependListener:Ue=P,prependOnceListener:Be=P,listeners:$,domain:J,_exiting:Y,config:X,dlopen:v,uptime:I,_getActiveRequests:w,_getActiveHandles:S,reallyExit:Z,_kill:ee,cpuUsage:te,resourceUsage:re,memoryUsage:ne,kill:oe,exit:ie,openStdin:se,allowedNodeEnvironmentFlags:ae,assert:E,features:le,_fatalExceptions:ce,setUncaughtExceptionCaptureCallback:ue,hasUncaughtExceptionCaptureCallback:k,emitWarning:F,nextTick:g,_tickCallback:fe,_debugProcess:he,_debugEnd:de,_startProfilerIdleNotifier:pe,_stopProfilerIdleNotifier:me,stdout:ge,stdin:be,stderr:ye,abort:_e,umask:W,chdir:z,cwd:V,env:M,title:R,argv:L,execArgv:D,pid:ve,ppid:we,execPath:Se,debugPort:Ee,hrtime:A,argv0:ke,_preload_modules:Ie,setSourceMapsEnabled:Ae}}),We=a(()=>{qe()});function Ve(){if(Je)return Qe;Je=!0;let e=function(){if(Ke)return ze;Ke=!0,ze.byteLength=function(e){var t=i(e),r=t[0],n=t[1];return 3*(r+n)/4-n},ze.toByteArray=function(e){var n,o,s=i(e),a=s[0],l=s[1],c=new r(function(e,t,r){return 3*(t+r)/4-r}(0,a,l)),u=0,f=l>0?a-4:a;for(o=0;o<f;o+=4)n=t[e.charCodeAt(o)]<<18|t[e.charCodeAt(o+1)]<<12|t[e.charCodeAt(o+2)]<<6|t[e.charCodeAt(o+3)],c[u++]=n>>16&255,c[u++]=n>>8&255,c[u++]=255&n;return 2===l&&(n=t[e.charCodeAt(o)]<<2|t[e.charCodeAt(o+1)]>>4,c[u++]=255&n),1===l&&(n=t[e.charCodeAt(o)]<<10|t[e.charCodeAt(o+1)]<<4|t[e.charCodeAt(o+2)]>>2,c[u++]=n>>8&255,c[u++]=255&n),c},ze.fromByteArray=function(t){for(var r,n=t.length,o=n%3,i=[],s=16383,l=0,c=n-o;l<c;l+=s)i.push(a(t,l,l+s>c?c:l+s));return 1===o?(r=t[n-1],i.push(e[r>>2]+e[r<<4&63]+"==")):2===o&&(r=(t[n-2]<<8)+t[n-1],i.push(e[r>>10]+e[r>>4&63]+e[r<<2&63]+"=")),i.join("")};for(var e=[],t=[],r=typeof Uint8Array<"u"?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)e[o]=n[o],t[n.charCodeAt(o)]=o;function i(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(t){return e[t>>18&63]+e[t>>12&63]+e[t>>6&63]+e[63&t]}function a(e,t,r){for(var n,o=[],i=t;i<r;i+=3)n=(e[i]<<16&16711680)+(e[i+1]<<8&65280)+(255&e[i+2]),o.push(s(n));return o.join("")}return t[45]=62,t[95]=63,ze}(),t=(Ge||(Ge=!0,He.read=function(e,t,r,n,o){var i,s,a=8*o-n-1,l=(1<<a)-1,c=l>>1,u=-7,f=r?o-1:0,h=r?-1:1,d=e[t+f];for(f+=h,i=d&(1<<-u)-1,d>>=-u,u+=a;u>0;i=256*i+e[t+f],f+=h,u-=8);for(s=i&(1<<-u)-1,i>>=-u,u+=n;u>0;s=256*s+e[t+f],f+=h,u-=8);if(0===i)i=1-c;else{if(i===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),i-=c}return(d?-1:1)*s*Math.pow(2,i-n)},He.write=function(e,t,r,n,o,i){var s,a,l,c=8*i-o-1,u=(1<<c)-1,f=u>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:i-1,p=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(s++,l/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(t*l-1)*Math.pow(2,o),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;e[r+d]=255&a,d+=p,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*m}),He),r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;Qe.Buffer=i,Qe.SlowBuffer=function(e){return+e!=e&&(e=0),i.alloc(+e)},Qe.INSPECT_MAX_BYTES=50;let n=2147483647;function o(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,i.prototype),t}function i(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let r=0|h(e,t),n=o(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(K(e,Uint8Array)){let t=new Uint8Array(e);return u(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(K(e,ArrayBuffer)||e&&K(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(K(e,SharedArrayBuffer)||e&&K(e.buffer,SharedArrayBuffer)))return u(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return i.from(n,t,r);let s=function(e){if(i.isBuffer(e)){let t=0|f(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||H(e.length)?o(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(s)return s;if(typeof Symbol<"u"&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return a(e),o(e<0?0:0|f(e))}function c(e){let t=e.length<0?0:0|f(e.length),r=o(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function u(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,i.prototype),n}function f(e){if(e>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function h(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||K(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(o)return n?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function d(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0)||(r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,r);case"utf8":case"utf-8":return E(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return A(this,t,r);case"base64":return S(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function p(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function m(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),H(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,o){let i,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){let n=-1;for(i=r;i<a;i++)if(c(e,i)===c(t,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===l)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+l>a&&(r=a-l),i=r;i>=0;i--){let r=!0;for(let n=0;n<l;n++)if(c(e,i+n)!==c(t,n)){r=!1;break}if(r)return i}return-1}function y(e,t,r,n){r=Number(r)||0;let o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;let i,s=t.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(H(n))return i;e[r+i]=n}return i}function b(e,t,r,n){return z(W(t,e.length-r),e,r,n)}function _(e,t,r,n){return z(function(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function v(e,t,r,n){return z(V(t),e,r,n)}function w(e,t,r,n){return z(function(e,t){let r,n,o,i=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function S(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function E(e,t,r){r=Math.min(e.length,r);let n=[],o=t;for(;o<r;){let t=e[o],i=null,s=t>239?4:t>223?3:t>191?2:1;if(o+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(i=l));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(i=l));break;case 4:r=e[o+1],n=e[o+2],a=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(i=l))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(e){let t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=k));return r}(n)}Qe.kMaxLength=n,i.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch{return!1}}(),!i.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),i.poolSize=8192,i.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(i.prototype,Uint8Array.prototype),Object.setPrototypeOf(i,Uint8Array),i.alloc=function(e,t,r){return function(e,t,r){return a(e),e<=0?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)}(e,t,r)},i.allocUnsafe=function(e){return l(e)},i.allocUnsafeSlow=function(e){return l(e)},i.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==i.prototype},i.compare=function(e,t){if(K(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),K(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(e[o]!==t[o]){r=e[o],n=t[o];break}return r<n?-1:n<r?1:0},i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;let n=i.allocUnsafe(t),o=0;for(r=0;r<e.length;++r){let t=e[r];if(K(t,Uint8Array))o+t.length>n.length?(i.isBuffer(t)||(t=i.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!i.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},i.byteLength=h,i.prototype._isBuffer=!0,i.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)p(this,t,t+1);return this},i.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},i.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},i.prototype.toString=function(){let e=this.length;return 0===e?"":0===arguments.length?E(this,0,e):d.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){let e="",t=Qe.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},r&&(i.prototype[r]=i.prototype.inspect),i.prototype.compare=function(e,t,r,n,o){if(K(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let s=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),l=Math.min(s,a),c=this.slice(n,o),u=e.slice(t,r);for(let e=0;e<l;++e)if(c[e]!==u[e]){s=c[e],a=u[e];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},i.prototype.indexOf=function(e,t,r){return m(this,e,t,r,!0)},i.prototype.lastIndexOf=function(e,t,r){return m(this,e,t,r,!1)},i.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}let o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return y(this,e,t,r);case"utf8":case"utf-8":return b(this,e,t,r);case"ascii":case"latin1":case"binary":return _(this,e,t,r);case"base64":return v(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let k=4096;function I(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(127&e[o]);return n}function A(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;o<r;++o)n+=String.fromCharCode(e[o]);return n}function P(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let o="";for(let n=t;n<r;++n)o+=G[e[n]];return o}function $(e,t,r){let n=e.slice(t,r),o="";for(let e=0;e<n.length-1;e+=2)o+=String.fromCharCode(n[e]+256*n[e+1]);return o}function O(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,o,s){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function T(e,t,r,n,o){U(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function C(e,t,r,n,o){U(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function R(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,r,n,o,i){return r=+r,n>>>=0,i||R(e,0,n,4),t.write(e,r,n,o,23,4),n+4}function j(e,r,n,o,i){return r=+r,n>>>=0,i||R(e,0,n,8),t.write(e,r,n,o,52,8),n+8}i.prototype.slice=function(e,t){let r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,i.prototype),n},i.prototype.readUintLE=i.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return n},i.prototype.readUintBE=i.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},i.prototype.readUint8=i.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=Q(function(e){B(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&F(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),i.prototype.readBigUInt64BE=Q(function(e){B(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&F(e,this.length-8);let n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),i.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],o=1,i=0;for(;++i<t&&(o*=256);)n+=this[e+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},i.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=Q(function(e){B(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&F(e,this.length-8);let n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),i.prototype.readBigInt64BE=Q(function(e){B(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&F(e,this.length-8);let n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),i.prototype.readFloatLE=function(e,r){return e>>>=0,r||O(e,4,this.length),t.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,r){return e>>>=0,r||O(e,4,this.length),t.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,r){return e>>>=0,r||O(e,8,this.length),t.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,r){return e>>>=0,r||O(e,8,this.length),t.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||x(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i<r&&(o*=256);)this[t+i]=e/o&255;return t+r},i.prototype.writeUintBE=i.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||x(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(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},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(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},i.prototype.writeBigUInt64LE=Q(function(e,t=0){return T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeBigUInt64BE=Q(function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),i.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let o=0,i=1,s=0;for(this[t]=255&e;++o<r&&(i*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},i.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);x(this,e,t,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/i|0)-s&255;return t+r},i.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||x(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},i.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||x(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},i.prototype.writeBigInt64LE=Q(function(e,t=0){return T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeBigInt64BE=Q(function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),i.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},i.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},i.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},i.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},i.prototype.copy=function(e,t,r,n){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),!n&&0!==n&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let o=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),o},i.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!i.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{let s=i.isBuffer(e)?e:i.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};let M={};function L(e,t,r){M[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function D(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function U(e,t,r,n,o,i){if(e>r||e<t){let r,n="bigint"==typeof t?"n":"";throw r=0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`,new M.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,r){B(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&F(t,e.length-(r+1))}(n,o,i)}function B(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function F(e,t,r){throw Math.floor(e)!==e?(B(e,r),new M.ERR_OUT_OF_RANGE("offset","an integer",e)):t<0?new M.ERR_BUFFER_OUT_OF_BOUNDS:new M.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${t}`,e)}L("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),L("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),L("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=D(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=D(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n},RangeError);let q=/[^+/0-9A-Za-z-_]/g;function W(e,t){t=t||1/0;let r,n=e.length,o=null,i=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(t){return e.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(t))}function z(e,t,r,n){let o;for(o=0;o<n&&!(o+r>=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function K(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function H(e){return e!=e}let G=function(){let e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){let n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function Q(e){return typeof BigInt>"u"?J:e}function J(){throw new Error("BigInt not supported")}return Qe}var ze,Ke,He,Ge,Qe,Je,Ye=a(()=>{f(),ot(),We(),ze={},Ke=!1,He={},Ge=!1,Qe={},Je=!1}),Xe={};c(Xe,{Buffer:()=>et,INSPECT_MAX_BYTES:()=>tt,default:()=>Ze,kMaxLength:()=>rt});var Ze,et,tt,rt,nt=a(()=>{f(),ot(),We(),Ye(),(Ze=Ve()).Buffer,Ze.SlowBuffer,Ze.INSPECT_MAX_BYTES,Ze.kMaxLength,et=Ze.Buffer,tt=Ze.INSPECT_MAX_BYTES,rt=Ze.kMaxLength}),ot=a(()=>{nt()}),it=l((e,t)=>{f(),ot(),We();var r=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}};t.exports={AggregateError:r,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}}),st=l((e,t)=>{f(),ot(),We(),t.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){let n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}}),at=l((e,t)=>{f(),ot(),We();var{format:r,inspect:n}=st(),{AggregateError:o}=it(),i=globalThis.AggregateError||o,s=Symbol("kIsNodeError"),a=["string","function","number","object","Function","Object","boolean","bigint","symbol"],l=/^([A-Z][a-z0-9]*)+$/,c={};function u(e,t){if(!e)throw new c.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function d(e,t,n){n||(n=Error);class o extends n{constructor(...n){super(function(e,t,n){if("function"==typeof t)return u(t.length<=n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${t.length}).`),t(...n);let o=(t.match(/%[dfijoOs]/g)||[]).length;return u(o===n.length,`Code: ${e}; The provided arguments length (${n.length}) does not match the required ones (${o}).`),0===n.length?t:r(t,...n)}(e,t,n))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(o.prototype,{name:{value:n.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),o.prototype.code=e,o.prototype[s]=!0,c[e]=o}function p(e){let t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}var m=class extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new c.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}};d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(e,t,r)=>{u("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let o="The ";e.endsWith(" argument")?o+=`${e} `:o+=`"${e}" ${e.includes(".")?"property":"argument"} `,o+="must be ";let i=[],s=[],c=[];for(let e of t)u("string"==typeof e,"All expected entries have to be of type string"),a.includes(e)?i.push(e.toLowerCase()):l.test(e)?s.push(e):(u("object"!==e,'The value "object" should be written as "Object"'),c.push(e));if(s.length>0){let e=i.indexOf("object");-1!==e&&(i.splice(i,e,1),s.push("Object"))}if(i.length>0){switch(i.length){case 1:o+=`of type ${i[0]}`;break;case 2:o+=`one of type ${i[0]} or ${i[1]}`;break;default:{let e=i.pop();o+=`one of type ${i.join(", ")}, or ${e}`}}(s.length>0||c.length>0)&&(o+=" or ")}if(s.length>0){switch(s.length){case 1:o+=`an instance of ${s[0]}`;break;case 2:o+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let e=s.pop();o+=`an instance of ${s.join(", ")}, or ${e}`}}c.length>0&&(o+=" or ")}switch(c.length){case 0:break;case 1:c[0].toLowerCase()!==c[0]&&(o+="an "),o+=`${c[0]}`;break;case 2:o+=`one of ${c[0]} or ${c[1]}`;break;default:{let e=c.pop();o+=`one of ${c.join(", ")}, or ${e}`}}if(null==r)o+=`. Received ${r}`;else if("function"==typeof r&&r.name)o+=`. Received function ${r.name}`;else if("object"==typeof r){var f;null!==(f=r.constructor)&&void 0!==f&&f.name?o+=`. Received an instance of ${r.constructor.name}`:o+=`. Received ${n(r,{depth:-1})}`}else{let e=n(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),o+=`. Received type ${typeof r} (${e})`}return o},TypeError),d("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let o=n(t);return o.length>128&&(o=o.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${o}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`},TypeError),d("ERR_MISSING_ARGS",(...e)=>{u(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(e,t,r)=>{let o;if(u(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)o=h(String(r));else if("bigint"==typeof r){o=String(r);let e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(o=h(o)),o+="n"}else o=n(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${o}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:m,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new i([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:c}}),lt=l((e,t)=>{f(),ot(),We();var{AbortController:r,AbortSignal:n}=typeof self<"u"?self:typeof window<"u"?window:void 0;t.exports=r,t.exports.AbortSignal=n,t.exports.default=r}),ct={};c(ct,{EventEmitter:()=>dt,default:()=>ht,defaultMaxListeners:()=>pt,init:()=>mt,listenerCount:()=>gt,on:()=>yt,once:()=>bt});var ut,ft,ht,dt,pt,mt,gt,yt,bt,_t,vt,wt,St=a(()=>{f(),ot(),We(),ut={},ft=!1,(ht=function(){if(ft)return ut;ft=!0;var e,t="object"==typeof Reflect?Reflect:null,r=t&&"function"==typeof t.apply?t.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};e=t&&"function"==typeof t.ownKeys?t.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var n=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}(ut=o).once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}p(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&p(e,"error",t,{once:!0})}(e,o)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){var o,i,l;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),l=i[t]),void 0===l)l=i[t]=r,++e._eventsCount;else if("function"==typeof l?l=i[t]=n?[r,l]:[l,r]:n?l.unshift(r):l.push(r),(o=a(e))>0&&l.length>o&&!l.warned){l.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=l.length,function(e){console&&console.warn&&console.warn(e)}(c)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=c.bind(n);return o.listener=r,n.wrapFn=o,o}function f(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):d(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function d(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function p(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(i){n.once&&e.removeEventListener(t,o),r(i)})}}return Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return i},set:function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");i=e}}),o.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},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||n(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return a(this)},o.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)r(l,this,t);else{var c=l.length,u=d(l,c);for(n=0;n<c;++n)r(u[n],this,t)}return!0},o.prototype.addListener=function(e,t){return l(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return l(this,e,t,!0)},o.prototype.once=function(e,t){return s(t),this.on(e,u(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,u(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,o,i,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},o.prototype.off=o.prototype.removeListener,o.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 o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);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},o.prototype.listeners=function(e){return f(this,e,!0)},o.prototype.rawListeners=function(e){return f(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},o.prototype.listenerCount=h,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]},ut}()).once,ht.once=function(e,t){return new Promise((r,n)=>{function o(...t){void 0!==i&&e.removeListener("error",i),r(t)}let i;"error"!==t&&(i=t=>{e.removeListener(name,o),n(t)},e.once("error",i)),e.once(t,o)})},ht.on=function(e,t){let r=[],n=[],o=null,i=!1,s={async next(){let e=r.shift();if(e)return createIterResult(e,!1);if(o){let e=Promise.reject(o);return o=null,e}return i?createIterResult(void 0,!0):new Promise((e,t)=>n.push({resolve:e,reject:t}))},async return(){e.removeListener(t,a),e.removeListener("error",l),i=!0;for(let e of n)e.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(r){o=r,e.removeListener(t,a),e.removeListener("error",l)},[Symbol.asyncIterator](){return this}};return e.on(t,a),e.on("error",l),s;function a(...e){let t=n.shift();t?t.resolve(createIterResult(e,!1)):r.push(e)}function l(e){i=!0;let t=n.shift();t?t.reject(e):o=e,s.return()}},({EventEmitter:dt,defaultMaxListeners:pt,init:mt,listenerCount:gt,on:yt,once:bt}=ht)}),Et=l((e,t)=>{f(),ot(),We();var r=(nt(),u(Xe)),{format:n,inspect:o}=st(),{codes:{ERR_INVALID_ARG_TYPE:i}}=at(),{kResistStopPropagation:s,AggregateError:a,SymbolDispose:l}=it(),c=globalThis.AbortSignal||lt().AbortSignal,h=globalThis.AbortController||lt().AbortController,d=Object.getPrototypeOf(async function(){}).constructor,p=globalThis.Blob||r.Blob,m=typeof p<"u"?function(e){return e instanceof p}:function(e){return!1},g=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new i(t,"AbortSignal",e)};t.exports={AggregateError:a,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...n)=>e?r(e):t(...n))}),debuglog:()=>function(){},format:n,inspect:o,types:{isAsyncFunction:e=>e instanceof d,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:m,deprecate:(e,t)=>e,addAbortListener:(St(),u(ct)).addAbortListener||function(e,t){if(void 0===e)throw new i("signal","AbortSignal",e);let r;return g(e,"signal"),(e=>{if("function"!=typeof e)throw new i("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[s]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[l](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:c.any||function(e){if(1===e.length)return e[0];let t=new h,r=()=>t.abort();return e.forEach(e=>{g(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),kt=l((e,t)=>{f(),ot(),We();var{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:o,ArrayPrototypeMap:i,NumberIsInteger:s,NumberIsNaN:a,NumberMAX_SAFE_INTEGER:l,NumberMIN_SAFE_INTEGER:c,NumberParseInt:u,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:p,StringPrototypeToUpperCase:m,StringPrototypeTrim:g}=it(),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:b,ERR_INVALID_ARG_TYPE:_,ERR_INVALID_ARG_VALUE:v,ERR_OUT_OF_RANGE:w,ERR_UNKNOWN_SIGNAL:S}}=at(),{normalizeEncoding:E}=Et(),{isAsyncFunction:k,isArrayBufferView:I}=Et().types,A={},P=/^[0-7]+$/,$=y((e,t,r=c,n=l)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!s(e))throw new w(t,"an integer",e);if(e<r||e>n)throw new w(t,`>= ${r} && <= ${n}`,e)}),O=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!s(e))throw new w(t,"an integer",e);if(e<r||e>n)throw new w(t,`>= ${r} && <= ${n}`,e)}),x=y((e,t,r=!1)=>{if("number"!=typeof e)throw new _(t,"number",e);if(!s(e))throw new w(t,"an integer",e);let n=r?1:0,o=4294967295;if(e<n||e>o)throw new w(t,`>= ${n} && <= ${o}`,e)});function T(e,t){if("string"!=typeof e)throw new _(t,"string",e)}var C=y((e,t,r)=>{if(!n(r,e)){let n="must be one of: "+o(i(r,e=>"string"==typeof e?`'${e}'`:p(e)),", ");throw new v(t,e,n)}});function R(e,t){if("boolean"!=typeof e)throw new _(t,"boolean",e)}function N(e,t,r){return null!=e&&h(e,t)?e[t]:r}var j=y((e,t,n=null)=>{let o=N(n,"allowArray",!1),i=N(n,"allowFunction",!1);if(!N(n,"nullable",!1)&&null===e||!o&&r(e)||"object"!=typeof e&&(!i||"function"!=typeof e))throw new _(t,"Object",e)}),M=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new _(t,"a dictionary",e)}),L=y((e,t,n=0)=>{if(!r(e))throw new _(t,"Array",e);if(e.length<n)throw new v(t,e,`must be longer than ${n}`)}),D=y((e,t="buffer")=>{if(!I(e))throw new _(t,["Buffer","TypedArray","DataView"],e)}),U=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new _(t,"AbortSignal",e)}),B=y((e,t)=>{if("function"!=typeof e)throw new _(t,"Function",e)}),F=y((e,t)=>{if("function"!=typeof e||k(e))throw new _(t,"Function",e)}),q=y((e,t)=>{if(void 0!==e)throw new _(t,"undefined",e)}),W=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(typeof e>"u"||!d(W,e))throw new v(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}t.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(typeof e>"u"&&(e=r),"string"==typeof e){if(null===d(P,e))throw new v(t,e,"must be a 32-bit unsigned integer or an octal string");e=u(e,8)}return x(e,t),e},validateArray:L,validateStringArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++)T(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++)R(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){L(e,t);for(let r=0;r<e.length;r++){let n=e[r],o=`${t}[${r}]`;if(null==n)throw new _(o,"AbortSignal",n);U(n,o)}},validateBoolean:R,validateBuffer:D,validateDictionary:M,validateEncoding:function(e,t){let r=E(t),n=e.length;if("hex"===r&&n%2!=0)throw new v("encoding",t,`is invalid for data of length ${n}`)},validateFunction:B,validateInt32:O,validateInteger:$,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new _(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&a(e))throw new w(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:j,validateOneOf:C,validatePlainFunction:F,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===g(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new b(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(T(e,t),void 0===A[e])throw void 0!==A[m(e)]?new S(e+" (signals must use all capital letters)"):new S(e)},validateString:T,validateUint32:x,validateUndefined:q,validateUnion:function(e,t,r){if(!n(r,e))throw new _(t,`('${o(r,"|")}')`,e)},validateAbortSignal:U,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(r(e)){let t=e.length,r="";if(0===t)return r;for(let n=0;n<t;n++){let o=e[n];V(o,"hints"),r+=o,n!==t-1&&(r+=", ")}return r}throw new v("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}}),It=l((e,t)=>{f(),ot(),We();var r,n,o=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch{try{return r.call(null,e,0)}catch{return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:i}catch{r=i}try{n="function"==typeof clearTimeout?clearTimeout:s}catch{n=s}}();var l,c=[],u=!1,h=-1;function d(){!u||!l||(u=!1,l.length?c=l.concat(c):h=-1,c.length&&p())}function p(){if(!u){var e=a(d);u=!0;for(var t=c.length;t;){for(l=c,c=[];++h<t;)l&&l[h].run();h=-1,t=c.length}l=null,u=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===s||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{return n(e)}catch{try{return n.call(null,e)}catch{return n.call(this,e)}}}(e)}}function m(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new m(e,t)),1===c.length&&!u&&a(p)},m.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}}),At=l((e,t)=>{f(),ot(),We();var{SymbolAsyncIterator:r,SymbolIterator:n,SymbolFor:o}=it(),i=o("nodejs.stream.destroyed"),s=o("nodejs.stream.errored"),a=o("nodejs.stream.readable"),l=o("nodejs.stream.writable"),c=o("nodejs.stream.disturbed"),u=o("nodejs.webstream.isClosedPromise"),h=o("nodejs.webstream.controllerErrorFunction");function d(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function m(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function g(e){return!(!e||m(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||m(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function b(e){return!(!e||m(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function _(e){if(!m(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[i]||null!=n&&n.destroyed)}function v(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;let t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)}function w(e,t){if(!d(e))return null;let r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.endEmitted?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[a]?e[a]:"boolean"!=typeof e?.readable?null:!_(e)&&d(e)&&e.readable&&!w(e)}function E(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof e?.writable?null:!_(e)&&p(e)&&e.writable&&!v(e)}function k(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function I(e){return"boolean"==typeof e._sent100&&k(e)}t.exports={isDestroyed:_,kIsDestroyed:i,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[c])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:c,isErrored:function(e){var t,r,n,o,i,a,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(o=null!==(i=null!==(a=e[s])&&void 0!==a?a:e.readableErrored)&&void 0!==i?i:e.writableErrored)&&void 0!==o?o:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null!==(f=e._writableState)&&void 0!==f&&f.errored))},kIsErrored:s,isReadable:S,kIsReadable:a,kIsClosedPromise:u,kControllerErrorFunction:h,kIsWritable:l,isClosed:function(e){if(!m(e))return null;if("boolean"==typeof e.closed)return e.closed;let t=e._writableState,r=e._readableState;return"boolean"==typeof t?.closed||"boolean"==typeof r?.closed?t?.closed||r?.closed:"boolean"==typeof e._closed&&k(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 m(e)?!!_(e)||!(!1!==t?.readable&&S(e)||!1!==t?.writable&&E(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[r]:!1===t?"function"==typeof e[n]:"function"==typeof e[r]||"function"==typeof e[n])},isReadableNodeStream:d,isReadableStream:g,isReadableEnded:function(e){if(!d(e))return null;if(!0===e.readableEnded)return!0;let t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof t?.ended?null:t.ended)},isReadableFinished:w,isReadableErrored:function(e){var t,r;return m(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:m,isWebStream:function(e){return g(e)||y(e)||b(e)},isWritable:E,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:v,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;let r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof r?.finished?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return m(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:I,willEmitClose:function(e){if(!m(e))return null;let t=e._writableState,r=e._readableState,n=t||r;return!n&&I(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:b}}),Pt=l((e,t)=>{f(),ot(),We();var r,n=It(),{AbortError:o,codes:i}=at(),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=i,{kEmptyObject:l,once:c}=Et(),{validateAbortSignal:u,validateFunction:h,validateObject:d,validateBoolean:p}=kt(),{Promise:m,PromisePrototypeThen:g,SymbolDispose:y}=it(),{isClosed:b,isReadable:_,isReadableNodeStream:v,isReadableStream:w,isReadableFinished:S,isReadableErrored:E,isWritable:k,isWritableNodeStream:I,isWritableStream:A,isWritableFinished:P,isWritableErrored:$,isNodeStream:O,willEmitClose:x,kIsClosedPromise:T}=At(),C=()=>{};function R(e,t,i){var f,p;if(2===arguments.length?(i=t,t=l):null==t?t=l:d(t,"options"),h(i,"callback"),u(t.signal,"options.signal"),i=c(i),w(e)||A(e))return function(e,t,i){let s=!1,a=C;if(t.signal)if(a=()=>{s=!0,i.call(e,new o(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{let n=(r=r||Et().addAbortListener)(t.signal,a),o=i;i=c((...t)=>{n[y](),o.apply(e,t)})}let l=(...t)=>{s||n.nextTick(()=>i.apply(e,t))};return g(e[T].promise,l,l),C}(e,t,i);if(!O(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);let m=null!==(f=t.readable)&&void 0!==f?f:v(e),R=null!==(p=t.writable)&&void 0!==p?p:I(e),N=e._writableState,j=e._readableState,M=()=>{e.writable||U()},L=x(e)&&v(e)===m&&I(e)===R,D=P(e,!1),U=()=>{D=!0,e.destroyed&&(L=!1),(!L||e.readable&&!m)&&(!m||B)&&i.call(e)},B=S(e,!1),F=()=>{B=!0,e.destroyed&&(L=!1),(!L||e.writable&&!R)&&(!R||D)&&i.call(e)},q=t=>{i.call(e,t)},W=b(e),V=()=>{W=!0;let t=$(e)||E(e);return t&&"boolean"!=typeof t?i.call(e,t):m&&!B&&v(e,!0)&&!S(e,!1)?i.call(e,new a):!R||D||P(e,!1)?void i.call(e):i.call(e,new a)},z=()=>{W=!0;let t=$(e)||E(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},K=()=>{e.req.on("finish",U)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?R&&!N&&(e.on("end",M),e.on("close",M)):(e.on("complete",U),L||e.on("abort",V),e.req?K():e.on("request",K)),!L&&"boolean"==typeof e.aborted&&e.on("aborted",V),e.on("end",F),e.on("finish",U),!1!==t.error&&e.on("error",q),e.on("close",V),W?n.nextTick(V):null!=N&&N.errorEmitted||null!=j&&j.errorEmitted?L||n.nextTick(z):(!m&&(!L||_(e))&&(D||!1===k(e))||!R&&(!L||k(e))&&(B||!1===_(e))||j&&e.req&&e.aborted)&&n.nextTick(z);let H=()=>{i=C,e.removeListener("aborted",V),e.removeListener("complete",U),e.removeListener("abort",V),e.removeListener("request",K),e.req&&e.req.removeListener("finish",U),e.removeListener("end",M),e.removeListener("close",M),e.removeListener("finish",U),e.removeListener("end",F),e.removeListener("error",q),e.removeListener("close",V)};if(t.signal&&!W){let s=()=>{let r=i;H(),r.call(e,new o(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{let n=(r=r||Et().addAbortListener)(t.signal,s),o=i;i=c((...t)=>{n[y](),o.apply(e,t)})}}return H}t.exports=R,t.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(p(t.cleanup,"cleanup"),n=t.cleanup),new m((r,o)=>{let i=R(e,t,e=>{n&&i(),e?o(e):r()})})}}),$t=l((e,t)=>{f(),ot(),We();var r=It(),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:i}=at(),{Symbol:s}=it(),{kIsDestroyed:a,isDestroyed:l,isFinished:c,isServerRequest:u}=At(),h=s("kDestroy"),d=s("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function m(e,t,n){let o=!1;function i(t){if(o)return;o=!0;let i=e._readableState,s=e._writableState;p(t,s,i),s&&(s.closed=!0),i&&(i.closed=!0),"function"==typeof n&&n(t),t?r.nextTick(g,e,t):r.nextTick(y,e)}try{e._destroy(t||null,i)}catch(e){i(e)}}function g(e,t){b(e,t),y(e)}function y(e){let t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function b(e,t){let r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function _(e,t,n){let o=e._readableState,i=e._writableState;if(null!=i&&i.destroyed||null!=o&&o.destroyed)return this;null!=o&&o.autoDestroy||null!=i&&i.autoDestroy?e.destroy(t):t&&(t.stack,i&&!i.errored&&(i.errored=t),o&&!o.errored&&(o.errored=t),n?r.nextTick(b,e,t):b(e,t))}function v(e){let t=!1;function n(n){if(t)return void _(e,n??new o);t=!0;let i=e._readableState,s=e._writableState,a=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,n):n?_(e,n,!0):r.nextTick(w,e)}try{e._construct(e=>{r.nextTick(n,e)})}catch(e){r.nextTick(n,e)}}function w(e){e.emit(d)}function S(e){return e?.setHeader&&"function"==typeof e.abort}function E(e){e.emit("close")}function k(e,t){e.emit("error",t),r.nextTick(E,e)}t.exports={construct:function(e,t){if("function"!=typeof e._construct)return;let n=e._readableState,o=e._writableState;n&&(n.constructed=!1),o&&(o.constructed=!1),e.once(d,t),!(e.listenerCount(d)>1)&&r.nextTick(v,e)},destroyer:function(e,t){!e||l(e)||(!t&&!c(e)&&(t=new i),u(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(k,e,t):r.nextTick(E,e),e.destroyed||(e[a]=!0))},destroy:function(e,t){let r=this._readableState,o=this._writableState,i=o||r;return null!=o&&o.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,o,r),o&&(o.destroyed=!0),r&&(r.destroyed=!0),i.constructed?m(this,e,t):this.once(h,function(r){m(this,n(r,e),t)}),this)},undestroy:function(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:_}}),Ot=l((e,t)=>{f(),ot(),We();var{ArrayIsArray:r,ObjectSetPrototypeOf:n}=it(),{EventEmitter:o}=(St(),u(ct));function i(e){o.call(this,e)}function s(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}n(i.prototype,o.prototype),n(i,o),i.prototype.pipe=function(e,t){let r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),!e._isStdio&&(!t||!1!==t.end)&&(r.on("end",l),r.on("close",c));let a=!1;function l(){a||(a=!0,e.end())}function c(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return s(r,"error",u),s(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},t.exports={Stream:i,prependListener:s}}),xt=l((e,t)=>{f(),ot(),We();var r,{SymbolDispose:n}=it(),{AbortError:o,codes:i}=at(),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=At(),c=Pt(),{ERR_INVALID_ARG_TYPE:u}=i;t.exports.addAbortSignal=function(e,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(e),!s(r)&&!a(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return t.exports.addAbortSignalNoValidate(e,r)},t.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;let i=s(t)?()=>{t.destroy(new o(void 0,{cause:e.reason}))}:()=>{t[l](new o(void 0,{cause:e.reason}))};if(e.aborted)i();else{let o=(r=r||Et().addAbortListener)(e,i);c(t,o[n])}return t}}),Tt=l((e,t)=>{f(),ot(),We();var{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:o,Uint8Array:i}=it(),{Buffer:s}=(nt(),u(Xe)),{inspect:a}=Et();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;let e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return s.alloc(0);let t=s.allocUnsafe(e>>>0),r=this.head,n=0;for(;r;)o(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){let r=this.head.data;if(e<r.length){let t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[n](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",n=this.head,o=0;do{let i=n.data;if(!(e>i.length)){e===i.length?(t+=i,++o,n.next?this.head=n.next:this.head=this.tail=null):(t+=r(i,0,e),this.head=n,n.data=r(i,e));break}t+=i,e-=i.length,++o}while(null!==(n=n.next));return this.length-=o,t}_getBuffer(e){let t=s.allocUnsafe(e),r=e,n=this.head,a=0;do{let s=n.data;if(!(e>s.length)){e===s.length?(o(t,s,r-e),++a,n.next?this.head=n.next:this.head=this.tail=null):(o(t,new i(s.buffer,s.byteOffset,e),r-e),this.head=n,n.data=s.slice(e));break}o(t,s,r-e),e-=s.length,++a}while(null!==(n=n.next));return this.length-=a,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return a(this,{...t,depth:0,customInspect:!1})}}}),Ct=l((e,t)=>{f(),ot(),We();var{MathFloor:r,NumberIsInteger:n}=it(),{validateInteger:o}=kt(),{ERR_INVALID_ARG_VALUE:i}=at().codes,s=16384,a=16;function l(e){return e?a:s}t.exports={getHighWaterMark:function(e,t,o,s){let a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,s,o);if(null!=a){if(!n(a)||a<0)throw new i(s?`options.${o}`:"options.highWaterMark",a);return r(a)}return l(e.objectMode)},getDefaultHighWaterMark:l,setDefaultHighWaterMark:function(e,t){o(t,"value",0),e?a=t:s=t}}}),Rt=l((e,t)=>{f(),ot(),We();var r=(nt(),u(Xe)),n=r.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function i(e,t,r){return n(e,t,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=r:(o(r,e),e.Buffer=i),i.prototype=Object.create(n.prototype),o(n,i),i.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return n(e,t,r)},i.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var o=n(e);return void 0!==t?"string"==typeof r?o.fill(t,r):o.fill(t):o.fill(0),o},i.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n(e)},i.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}}),Nt=l(e=>{f(),ot(),We();var t=Rt().Buffer,r=t.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function n(e){var n;switch(this.encoding=function(e){var n=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof n&&(t.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return n||e}(e),this.encoding){case"utf16le":this.text=s,this.end=a,n=4;break;case"utf8":this.fillLast=i,n=4;break;case"base64":this.text=l,this.end=c,n=3;break;default:return this.write=u,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(n)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function i(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function a(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function l(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}e.StringDecoder=n,n.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},n.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},n.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=o(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=o(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=o(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},n.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}}),jt=l((e,t)=>{f(),ot(),We();var r=It(),{PromisePrototypeThen:n,SymbolAsyncIterator:o,SymbolIterator:i}=it(),{Buffer:s}=(nt(),u(Xe)),{ERR_INVALID_ARG_TYPE:a,ERR_STREAM_NULL_VALUES:l}=at().codes;t.exports=function(e,t,c){let u,f;if("string"==typeof t||t instanceof s)return new e({objectMode:!0,...c,read(){this.push(t),this.push(null)}});if(t&&t[o])f=!0,u=t[o]();else{if(!t||!t[i])throw new a("iterable",["Iterable"],t);f=!1,u=t[i]()}let h=new e({objectMode:!0,highWaterMark:1,...c}),d=!1;return h._read=function(){d||(d=!0,async function(){for(;;){try{let{value:e,done:t}=f?await u.next():u.next();if(t)h.push(null);else{let t=e&&"function"==typeof e.then?await e:e;if(null===t)throw d=!1,new l;if(h.push(t))continue;d=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){n(async function(e){let t=null!=e,r="function"==typeof u.throw;if(t&&r){let{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){let{value:e}=await u.return();await e}}(e),()=>r.nextTick(t,e),n=>r.nextTick(t,n||e))},h}}),Mt=l((e,t)=>{f(),ot(),We();var r=It(),{ArrayPrototypeIndexOf:n,NumberIsInteger:o,NumberIsNaN:i,NumberParseInt:s,ObjectDefineProperties:a,ObjectKeys:l,ObjectSetPrototypeOf:c,Promise:h,SafeSet:d,SymbolAsyncDispose:p,SymbolAsyncIterator:m,Symbol:g}=it();t.exports=Q,Q.ReadableState=G;var{EventEmitter:y}=(St(),u(ct)),{Stream:b,prependListener:_}=Ot(),{Buffer:v}=(nt(),u(Xe)),{addAbortSignal:w}=xt(),S=Pt(),E=Et().debuglog("stream",e=>{E=e}),k=Tt(),I=$t(),{getHighWaterMark:A,getDefaultHighWaterMark:P}=Ct(),{aggregateTwoErrors:$,codes:{ERR_INVALID_ARG_TYPE:O,ERR_METHOD_NOT_IMPLEMENTED:x,ERR_OUT_OF_RANGE:T,ERR_STREAM_PUSH_AFTER_EOF:C,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:R},AbortError:N}=at(),{validateObject:j}=kt(),M=g("kPaused"),{StringDecoder:L}=Nt(),D=jt();c(Q.prototype,b.prototype),c(Q,b);var U,B=()=>{},{errorOrDestroy:F}=I,q=1,W=16,V=32,z=2048,K=4096;function H(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function G(e,t,r){"boolean"!=typeof r&&(r=t instanceof Ut()),this.state=z|K|W|V,e&&e.objectMode&&(this.state|=q),r&&e&&e.readableObjectMode&&(this.state|=q),this.highWaterMark=e?A(this,e,"readableHighWaterMark",r):P(!1),this.buffer=new k,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,e&&!1===e.emitClose&&(this.state&=~z),e&&!1===e.autoDestroy&&(this.state&=~K),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function Q(e){if(!(this instanceof Q))return new Q(e);let t=this instanceof Ut();this._readableState=new G(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),b.call(this,e),I.construct(this,()=>{this._readableState.needReadable&&te(this,this._readableState)})}function J(e,t,r,n){E("readableAddChunk",t);let o,i=e._readableState;if(0===(i.state&q)&&("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=v.from(t,r).toString(i.encoding):(t=v.from(t,r),r=""))):t instanceof v?r="":b._isUint8Array(t)?(t=b._uint8ArrayToBuffer(t),r=""):null!=t&&(o=new O("chunk",["string","Buffer","Uint8Array"],t))),o)F(e,o);else if(null===t)i.state&=-9,function(e,t){if(E("onEofChunk"),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Z(e):(t.needReadable=!1,t.emittedReadable=!0,ee(e))}}(e,i);else if(0!==(i.state&q)||t&&t.length>0)if(n)if(4&i.state)F(e,new R);else{if(i.destroyed||i.errored)return!1;Y(e,i,t,!0)}else if(i.ended)F(e,new C);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?Y(e,i,t,!1):te(e,i)):Y(e,i,t,!1)}else n||(i.state&=-9,te(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Y(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),!!(64&t.state)&&Z(e)),te(e,t)}function X(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&q)?1:i(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Z(e){let t=e._readableState;E("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(E("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(ee,e))}function ee(e){let t=e._readableState;E("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,se(e)}function te(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,r.nextTick(re,e,t))}function re(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){let r=t.length;if(E("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function ne(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[M]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function oe(e){E("readable nexttick read 0"),e.read(0)}function ie(e,t){E("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),se(e),t.flowing&&!t.reading&&e.read(0)}function se(e){let t=e._readableState;for(E("flow",t.flowing);t.flowing&&null!==e.read(););}function ae(e,t){"function"!=typeof e.read&&(e=Q.wrap(e,{objectMode:!0}));let r=async function*(e,t){let r=B;function n(t){this===e?(r(),r=B):r=t}e.on("readable",n);let o,i=S(e,{writable:!1},e=>{o=e?$(o,e):null,r(),r=B});try{for(;;){let t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(o)throw o;if(null===o)return;await new h(n)}}}catch(e){throw o=$(o,e),o}finally{!o&&!1===t?.destroyOnReturn||void 0!==o&&!e._readableState.autoDestroy?(e.off("readable",n),i()):I.destroyer(e,null)}}(e,t);return r.stream=e,r}function le(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ce(e){let t=e._readableState;E("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(ue,t,e))}function ue(e,t){if(E("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)r.nextTick(fe,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function fe(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}function he(){return void 0===U&&(U={}),U}a(G.prototype,{objectMode:H(q),ended:H(2),endEmitted:H(4),reading:H(8),constructed:H(W),sync:H(V),needReadable:H(64),emittedReadable:H(128),readableListening:H(256),resumeScheduled:H(512),errorEmitted:H(1024),emitClose:H(z),autoDestroy:H(K),destroyed:H(8192),closed:H(16384),closeEmitted:H(32768),multiAwaitDrain:H(65536),readingMore:H(1<<17),dataEmitted:H(1<<18)}),Q.prototype.destroy=I.destroy,Q.prototype._undestroy=I.undestroy,Q.prototype._destroy=function(e,t){t(e)},Q.prototype[y.captureRejectionSymbol]=function(e){this.destroy(e)},Q.prototype[p]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new N,this.destroy(e)),new h((t,r)=>S(this,n=>n&&n!==e?r(n):t(null)))},Q.prototype.push=function(e,t){return J(this,e,t,!1)},Q.prototype.unshift=function(e,t){return J(this,e,t,!0)},Q.prototype.isPaused=function(){let e=this._readableState;return!0===e[M]||!1===e.flowing},Q.prototype.setEncoding=function(e){let t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},Q.prototype.read=function(e){E("read",e),void 0===e?e=NaN:o(e)||(e=s(e,10));let t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new T("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return E("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ce(this):Z(this),null;if(0===(e=X(e,t))&&t.ended)return 0===t.length&&ce(this),null;let n,i=!!(64&t.state);if(E("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,E("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,E("reading, ended or constructing",i);else if(i){E("do read"),t.state|=8|V,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){F(this,e)}t.state&=~V,t.reading||(e=X(r,t))}return n=e>0?le(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ce(this)),null!==n&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",n)),n},Q.prototype._read=function(e){throw new x("_read()")},Q.prototype.pipe=function(e,t){let n=this,o=this._readableState;1===o.pipes.length&&(o.multiAwaitDrain||(o.multiAwaitDrain=!0,o.awaitDrainWriters=new d(o.awaitDrainWriters?[o.awaitDrainWriters]:[]))),o.pipes.push(e),E("pipe count=%d opts=%j",o.pipes.length,t);let i=t&&!1===t.end||e===r.stdout||e===r.stderr?m:s;function s(){E("onend"),e.end()}o.endEmitted?r.nextTick(i):n.once("end",i),e.on("unpipe",function t(r,i){E("onunpipe"),r===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,E("cleanup"),e.removeListener("close",h),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",m),n.removeListener("data",u),l=!0,a&&o.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let a,l=!1;function c(){l||(1===o.pipes.length&&o.pipes[0]===e?(E("false write response, pause",0),o.awaitDrainWriters=e,o.multiAwaitDrain=!1):o.pipes.length>1&&o.pipes.includes(e)&&(E("false write response, pause",o.awaitDrainWriters.size),o.awaitDrainWriters.add(e)),n.pause()),a||(a=function(e,t){return function(){let r=e._readableState;r.awaitDrainWriters===t?(E("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(E("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),(!r.awaitDrainWriters||0===r.awaitDrainWriters.size)&&e.listenerCount("data")&&e.resume()}}(n,e),e.on("drain",a))}function u(t){E("ondata");let r=e.write(t);E("dest.write",r),!1===r&&c()}function f(t){if(E("onerror",t),m(),e.removeListener("error",f),0===e.listenerCount("error")){let r=e._writableState||e._readableState;r&&!r.errorEmitted?F(e,t):e.emit("error",t)}}function h(){e.removeListener("finish",p),m()}function p(){E("onfinish"),e.removeListener("close",h),m()}function m(){E("unpipe"),n.unpipe(e)}return n.on("data",u),_(e,"error",f),e.once("close",h),e.once("finish",p),e.emit("pipe",n),!0===e.writableNeedDrain?c():o.flowing||(E("pipe resume"),n.resume()),e},Q.prototype.unpipe=function(e){let t=this._readableState;if(0===t.pipes.length)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}let r=n(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},Q.prototype.on=function(e,t){let n=b.prototype.on.call(this,e,t),o=this._readableState;return"data"===e?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===e&&!o.endEmitted&&!o.readableListening&&(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,E("on readable",o.length,o.reading),o.length?Z(this):o.reading||r.nextTick(oe,this)),n},Q.prototype.addListener=Q.prototype.on,Q.prototype.removeListener=function(e,t){let n=b.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(ne,this),n},Q.prototype.off=Q.prototype.removeListener,Q.prototype.removeAllListeners=function(e){let t=b.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&r.nextTick(ne,this),t},Q.prototype.resume=function(){let e=this._readableState;return e.flowing||(E("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(ie,e,t))}(this,e)),e[M]=!1,this},Q.prototype.pause=function(){return E("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(E("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[M]=!0,this},Q.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{F(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=l(e);for(let t=1;t<r.length;t++){let n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},Q.prototype[m]=function(){return ae(this)},Q.prototype.iterator=function(e){return void 0!==e&&j(e,"options"),ae(this,e)},a(Q.prototype,{readable:{__proto__:null,get(){let e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),a(G.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[M]},set(e){this[M]=!!e}}}),Q._fromList=le,Q.from=function(e,t){return D(Q,e,t)},Q.fromWeb=function(e,t){return he().newStreamReadableFromReadableStream(e,t)},Q.toWeb=function(e,t){return he().newReadableStreamFromStreamReadable(e,t)},Q.wrap=function(e,t){var r,n;return new Q({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){I.destroyer(e,t),r(t)}}).wrap(e)}}),Lt=l((e,t)=>{f(),ot(),We();var r=It(),{ArrayPrototypeSlice:n,Error:o,FunctionPrototypeSymbolHasInstance:i,ObjectDefineProperty:s,ObjectDefineProperties:a,ObjectSetPrototypeOf:l,StringPrototypeToLowerCase:c,Symbol:h,SymbolHasInstance:d}=it();t.exports=j,j.WritableState=R;var{EventEmitter:p}=(St(),u(ct)),m=Ot().Stream,{Buffer:g}=(nt(),u(Xe)),y=$t(),{addAbortSignal:b}=xt(),{getHighWaterMark:_,getDefaultHighWaterMark:v}=Ct(),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:S,ERR_MULTIPLE_CALLBACK:E,ERR_STREAM_CANNOT_PIPE:k,ERR_STREAM_DESTROYED:I,ERR_STREAM_ALREADY_FINISHED:A,ERR_STREAM_NULL_VALUES:P,ERR_STREAM_WRITE_AFTER_END:$,ERR_UNKNOWN_ENCODING:O}=at().codes,{errorOrDestroy:x}=y;function T(){}l(j.prototype,m.prototype),l(j,m);var C=h("kOnFinished");function R(e,t,r){"boolean"!=typeof r&&(r=t instanceof Ut()),this.objectMode=!(!e||!e.objectMode),r&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?_(this,e,"writableHighWaterMark",r):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!(!e||!1!==e.decodeStrings);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=U.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,N(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[C]=[]}function N(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function j(e){let t=this instanceof Ut();if(!t&&!i(j,this))return new j(e);this._writableState=new R(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&b(e.signal,this)),m.call(this,e),y.construct(this,()=>{let e=this._writableState;e.writing||W(this,e),z(this,e)})}function M(e,t,n,o){let i,s=e._writableState;if("function"==typeof n)o=n,n=s.defaultEncoding;else{if(n){if("buffer"!==n&&!g.isEncoding(n))throw new O(n)}else n=s.defaultEncoding;"function"!=typeof o&&(o=T)}if(null===t)throw new P;if(!s.objectMode)if("string"==typeof t)!1!==s.decodeStrings&&(t=g.from(t,n),n="buffer");else if(t instanceof g)n="buffer";else{if(!m._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=m._uint8ArrayToBuffer(t),n="buffer"}return s.ending?i=new $:s.destroyed&&(i=new I("write")),i?(r.nextTick(o,i),x(e,i,!0),i):(s.pendingcb++,function(e,t,r,n,o){let i=t.objectMode?1:r.length;t.length+=i;let s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:o}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&o!==T&&(t.allNoop=!1)):(t.writelen=i,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,s,t,n,o))}function L(e,t,r,n,o,i,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new I("write")):r?e._writev(o,t.onwrite):e._write(o,i,t.onwrite),t.sync=!1}function D(e,t,r,n){--t.pendingcb,n(r),q(t),x(e,r)}function U(e,t){let n=e._writableState,o=n.sync,i=n.writecb;"function"==typeof i?(n.writing=!1,n.writecb=null,n.length-=n.writelen,n.writelen=0,t?(t.stack,n.errored||(n.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),o?r.nextTick(D,e,n,t,i):D(e,n,t,i)):(n.buffered.length>n.bufferedIndex&&W(e,n),o?null!==n.afterWriteTickInfo&&n.afterWriteTickInfo.cb===i?n.afterWriteTickInfo.count++:(n.afterWriteTickInfo={count:1,cb:i,stream:e,state:n},r.nextTick(B,n.afterWriteTickInfo)):F(e,n,1,i))):x(e,new E)}function B({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,F(e,t,r,n)}function F(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&q(t),z(e,t)}function q(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:n,callback:o}=e.buffered[r],i=e.objectMode?1:n.length;e.length-=i,o(null!==(t=e.errored)&&void 0!==t?t:new I("write"))}let r=e[C].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new I("end"))}N(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:r,bufferedIndex:o,objectMode:i}=t,s=r.length-o;if(!s)return;let a=o;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;let o=t.allNoop?T:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},i=t.allNoop&&0===a?r:n(r,a);i.allBuffers=t.allBuffers,L(e,t,!0,t.length,i,"",o),N(t)}else{do{let{chunk:n,encoding:o,callback:s}=r[a];r[a++]=null,L(e,t,!1,i?1:n.length,n,o,s)}while(a<r.length&&!t.writing);a===r.length?N(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function V(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function z(e,t,n){V(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){let n=!1;function o(o){if(n)x(e,o??E());else if(n=!0,t.pendingcb--,o){let r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e](o);x(e,o,t.sync)}else V(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,r.nextTick(K,e,t))}t.sync=!0,t.pendingcb++;try{e._final(o)}catch(e){o(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(n?(t.pendingcb++,r.nextTick((e,t)=>{V(t)?K(e,t):t.pendingcb--},e,t)):V(t)&&(t.pendingcb++,K(e,t))))}function K(e,t){t.pendingcb--,t.finished=!0;let r=t[C].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){let t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}R.prototype.getBuffer=function(){return n(this.buffered,this.bufferedIndex)},s(R.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),s(j,d,{__proto__:null,value:function(e){return!!i(this,e)||this===j&&e&&e._writableState instanceof R}}),j.prototype.pipe=function(){x(this,new k)},j.prototype.write=function(e,t,r){return!0===M(this,e,t,r)},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},j.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=c(e)),!g.isEncoding(e))throw new O(e);return this._writableState.defaultEncoding=e,this},j.prototype._write=function(e,t,r){if(!this._writev)throw new S("_write()");this._writev([{chunk:e,encoding:t}],r)},j.prototype._writev=null,j.prototype.end=function(e,t,n){let i,s=this._writableState;if("function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e){let r=M(this,e,t);r instanceof o&&(i=r)}return s.corked&&(s.corked=1,this.uncork()),i||(s.errored||s.ending?s.finished?i=new A("end"):s.destroyed&&(i=new I("end")):(s.ending=!0,z(this,s,!0),s.ended=!0)),"function"==typeof n&&(i||s.finished?r.nextTick(n,i):s[C].push(n)),this},a(j.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){let e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){let e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});var H,G=y.destroy;function Q(){return void 0===H&&(H={}),H}j.prototype.destroy=function(e,t){let n=this._writableState;return!n.destroyed&&(n.bufferedIndex<n.buffered.length||n[C].length)&&r.nextTick(q,n),G.call(this,e,t),this},j.prototype._undestroy=y.undestroy,j.prototype._destroy=function(e,t){t(e)},j.prototype[p.captureRejectionSymbol]=function(e){this.destroy(e)},j.fromWeb=function(e,t){return Q().newStreamWritableFromWritableStream(e,t)},j.toWeb=function(e){return Q().newWritableStreamFromStreamWritable(e)}}),Dt=l((e,t)=>{f(),ot(),We();var r=It(),n=(nt(),u(Xe)),{isReadable:o,isWritable:i,isIterable:s,isNodeStream:a,isReadableNodeStream:l,isWritableNodeStream:c,isDuplexNodeStream:h,isReadableStream:d,isWritableStream:p}=At(),m=Pt(),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:y,ERR_INVALID_RETURN_VALUE:b}}=at(),{destroyer:_}=$t(),v=Ut(),w=Mt(),S=Lt(),{createDeferredPromise:E}=Et(),k=jt(),I=globalThis.Blob||n.Blob,A=typeof I<"u"?function(e){return e instanceof I}:function(e){return!1},P=globalThis.AbortController||lt().AbortController,{FunctionPrototypeCall:$}=it(),O=class extends v{constructor(e){super(e),!1===e?.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e?.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};function x(e){let t,r,n,s,a,l=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,c=e.writable,u=!!o(l),f=!!i(c);function h(e){let t=s;s=null,t?t(e):e&&a.destroy(e)}return a=new O({readableObjectMode:!(null==l||!l.readableObjectMode),writableObjectMode:!(null==c||!c.writableObjectMode),readable:u,writable:f}),f&&(m(c,e=>{f=!1,e&&_(l,e),h(e)}),a._write=function(e,r,n){c.write(e,r)?n():t=n},a._final=function(e){c.end(),r=e},c.on("drain",function(){if(t){let e=t;t=null,e()}}),c.on("finish",function(){if(r){let e=r;r=null,e()}})),u&&(m(l,e=>{u=!1,e&&_(l,e),h(e)}),l.on("readable",function(){if(n){let e=n;n=null,e()}}),l.on("end",function(){a.push(null)}),a._read=function(){for(;;){let e=l.read();if(null===e)return void(n=a._read);if(!a.push(e))return}}),a._destroy=function(e,o){!e&&null!==s&&(e=new g),n=null,t=null,r=null,null===s?o(e):(s=o,_(c,e),_(l,e))},a}t.exports=function e(t,n){if(h(t))return t;if(l(t))return x({readable:t});if(c(t))return x({writable:t});if(a(t))return x({writable:!1,readable:!1});if(d(t))return x({readable:w.fromWeb(t)});if(p(t))return x({writable:S.fromWeb(t)});if("function"==typeof t){let{value:e,write:o,final:i,destroy:a}=function(e){let{promise:t,resolve:n}=E(),o=new P,i=o.signal;return{value:e(async function*(){for(;;){let e=t;t=null;let{chunk:o,done:s,cb:a}=await e;if(r.nextTick(a),s)return;if(i.aborted)throw new g(void 0,{cause:i.reason});({promise:t,resolve:n}=E()),yield o}}(),{signal:i}),write(e,t,r){let o=n;n=null,o({chunk:e,done:!1,cb:r})},final(e){let t=n;n=null,t({done:!0,cb:e})},destroy(e,t){o.abort(),t(e)}}}(t);if(s(e))return k(O,e,{objectMode:!0,write:o,final:i,destroy:a});let l=e?.then;if("function"==typeof l){let t,n=$(l,e,e=>{if(null!=e)throw new b("nully","body",e)},e=>{_(t,e)});return t=new O({objectMode:!0,readable:!1,write:o,final(e){i(async()=>{try{await n,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}})},destroy:a})}throw new b("Iterable, AsyncIterable or AsyncFunction",n,e)}if(A(t))return e(t.arrayBuffer());if(s(t))return k(O,t,{objectMode:!0,writable:!1});if(d(t?.readable)&&p(t?.writable))return O.fromWeb(t);if("object"==typeof t?.writable||"object"==typeof t?.readable)return x({readable:null!=t&&t.readable?l(t?.readable)?t?.readable:e(t.readable):void 0,writable:null!=t&&t.writable?c(t?.writable)?t?.writable:e(t.writable):void 0});let o=t?.then;if("function"==typeof o){let e;return $(o,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{_(e,t)}),e=new O({objectMode:!0,writable:!1,read(){}})}throw new y(n,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}}),Ut=l((e,t)=>{f(),ot(),We();var{ObjectDefineProperties:r,ObjectGetOwnPropertyDescriptor:n,ObjectKeys:o,ObjectSetPrototypeOf:i}=it();t.exports=u;var s,a,l=Mt(),c=Lt();i(u.prototype,l.prototype),i(u,l);{let e=o(c.prototype);for(let t=0;t<e.length;t++){let r=e[t];u.prototype[r]||(u.prototype[r]=c.prototype[r])}}function u(e){if(!(this instanceof u))return new u(e);l.call(this,e),c.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}function h(){return void 0===s&&(s={}),s}r(u.prototype,{writable:{__proto__:null,...n(c.prototype,"writable")},writableHighWaterMark:{__proto__:null,...n(c.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...n(c.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...n(c.prototype,"writableBuffer")},writableLength:{__proto__:null,...n(c.prototype,"writableLength")},writableFinished:{__proto__:null,...n(c.prototype,"writableFinished")},writableCorked:{__proto__:null,...n(c.prototype,"writableCorked")},writableEnded:{__proto__:null,...n(c.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...n(c.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),u.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},u.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},u.from=function(e){return a||(a=Dt()),a(e,"body")}}),Bt=l((e,t)=>{f(),ot(),We();var{ObjectSetPrototypeOf:r,Symbol:n}=it();t.exports=l;var{ERR_METHOD_NOT_IMPLEMENTED:o}=at().codes,i=Ut(),{getHighWaterMark:s}=Ct();r(l.prototype,i.prototype),r(l,i);var a=n("kCallback");function l(e){if(!(this instanceof l))return new l(e);let t=e?s(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),i.call(this,e),this._readableState.sync=!1,this[a]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function c(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())})}function u(){this._final!==c&&c.call(this)}l.prototype._final=c,l.prototype._transform=function(e,t,r){throw new o("_transform()")},l.prototype._write=function(e,t,r){let n=this._readableState,o=this._writableState,i=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),o.ended||i===n.length||n.length<n.highWaterMark?r():this[a]=r)})},l.prototype._read=function(){if(this[a]){let e=this[a];this[a]=null,e()}}}),Ft=l((e,t)=>{f(),ot(),We();var{ObjectSetPrototypeOf:r}=it();t.exports=o;var n=Bt();function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}r(o.prototype,n.prototype),r(o,n),o.prototype._transform=function(e,t,r){r(null,e)}}),qt=l((e,t)=>{f(),ot(),We();var r,n,o,i=It(),{ArrayIsArray:s,Promise:a,SymbolAsyncIterator:l,SymbolDispose:c}=it(),u=Pt(),{once:h}=Et(),d=$t(),p=Ut(),{aggregateTwoErrors:m,codes:{ERR_INVALID_ARG_TYPE:g,ERR_INVALID_RETURN_VALUE:y,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:_,ERR_STREAM_PREMATURE_CLOSE:v},AbortError:w}=at(),{validateFunction:S,validateAbortSignal:E}=kt(),{isIterable:k,isReadable:I,isReadableNodeStream:A,isNodeStream:P,isTransformStream:$,isWebStream:O,isReadableStream:x,isReadableFinished:T}=At(),C=globalThis.AbortController||lt().AbortController;function R(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,d.destroyer(e,t||new _("pipe")))},cleanup:u(e,{readable:t,writable:r},e=>{n=!e})}}function N(e){if(k(e))return e;if(A(e))return async function*(e){n||(n=Mt()),yield*n.prototype[l].call(e)}(e);throw new g("val",["Readable","Iterable","AsyncIterable"],e)}async function j(e,t,r,{end:n}){let o,i=null,s=e=>{if(e&&(o=e),i){let e=i;i=null,e()}},l=()=>new a((e,t)=>{o?t(o):i=()=>{o?t(o):e()}});t.on("drain",s);let c=u(t,{readable:!1},s);try{t.writableNeedDrain&&await l();for await(let r of e)t.write(r)||await l();n&&(t.end(),await l()),r()}catch(e){r(o!==e?m(o,e):e)}finally{c(),t.off("drain",s)}}async function M(e,t,r,{end:n}){$(t)&&(t=t.writable);let o=t.getWriter();try{for await(let t of e)await o.ready,o.write(t).catch(()=>{});await o.ready,n&&await o.close(),r()}catch(e){try{await o.abort(e),r(e)}catch(e){r(e)}}}function L(e,t,n){if(1===e.length&&s(e[0])&&(e=e[0]),e.length<2)throw new b("streams");let a,l=new C,u=l.signal,f=n?.signal,h=[];function d(){U(new w)}E(f,"options.signal"),o=o||Et().addAbortListener,f&&(a=o(f,d));let m,_,v,S=[],T=0;function L(e){U(e,0===--T)}function U(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=a)||void 0===n||n[c](),l.abort(),r&&(m||h.forEach(e=>e()),i.nextTick(t,m,_))}}for(let t=0;t<e.length;t++){let o=e[t],s=t<e.length-1,a=t>0,l=s||!1!==n?.end,c=t===e.length-1;if(P(o)){let e=function(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&L(e)};if(l){let{destroy:e,cleanup:t}=R(o,s,a);S.push(e),I(o)&&c&&h.push(t)}o.on("error",e),I(o)&&c&&h.push(()=>{o.removeListener("error",e)})}if(0===t)if("function"==typeof o){if(v=o({signal:u}),!k(v))throw new y("Iterable, AsyncIterable or Stream","source",v)}else v=k(o)||A(o)||$(o)?o:p.from(o);else if("function"==typeof o){var B;if(v=$(v)?N(null===(B=v)||void 0===B?void 0:B.readable):N(v),v=o(v,{signal:u}),s){if(!k(v,!0))throw new y("AsyncIterable",`transform[${t-1}]`,v)}else{var F;r||(r=Ft());let e=new r({objectMode:!0}),t=null===(F=v)||void 0===F?void 0:F.then;if("function"==typeof t)T++,t.call(v,t=>{_=t,null!=t&&e.write(t),l&&e.end(),i.nextTick(L)},t=>{e.destroy(t),i.nextTick(L,t)});else if(k(v,!0))T++,j(v,e,L,{end:l});else{if(!x(v)&&!$(v))throw new y("AsyncIterable or Promise","destination",v);{let t=v.readable||v;T++,j(t,e,L,{end:l})}}v=e;let{destroy:n,cleanup:o}=R(v,!1,!0);S.push(n),c&&h.push(o)}}else if(P(o)){if(A(v)){T+=2;let e=D(v,o,L,{end:l});I(o)&&c&&h.push(e)}else if($(v)||x(v)){let e=v.readable||v;T++,j(e,o,L,{end:l})}else{if(!k(v))throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);T++,j(v,o,L,{end:l})}v=o}else if(O(o)){if(A(v))T++,M(N(v),o,L,{end:l});else if(x(v)||k(v))T++,M(v,o,L,{end:l});else{if(!$(v))throw new g("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],v);T++,M(v.readable,o,L,{end:l})}v=o}else v=p.from(o)}return(null!=u&&u.aborted||null!=f&&f.aborted)&&i.nextTick(d),v}function D(e,t,r,{end:n}){let o=!1;if(t.on("close",()=>{o||r(new v)}),e.pipe(t,{end:!1}),n){let r=function(){o=!0,t.end()};T(e)?i.nextTick(r):e.once("end",r)}else r();return u(e,{readable:!0,writable:!1},t=>{let n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)}),u(t,{readable:!1,writable:!0},r)}t.exports={pipelineImpl:L,pipeline:function(...e){return L(e,h(function(e){return S(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}}),Wt=l((e,t)=>{f(),ot(),We();var{pipeline:r}=qt(),n=Ut(),{destroyer:o}=$t(),{isNodeStream:i,isReadable:s,isWritable:a,isWebStream:l,isTransformStream:c,isWritableStream:u,isReadableStream:h}=At(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:m}}=at(),g=Pt();t.exports=function(...e){if(0===e.length)throw new m("streams");if(1===e.length)return n.from(e[0]);let t,f,y,b,_,v=[...e];if("function"==typeof e[0]&&(e[0]=n.from(e[0])),"function"==typeof e[e.length-1]){let t=e.length-1;e[t]=n.from(e[t])}for(let t=0;t<e.length;++t)if(i(e[t])||l(e[t])){if(t<e.length-1&&!(s(e[t])||h(e[t])||c(e[t])))throw new p(`streams[${t}]`,v[t],"must be readable");if(t>0&&!(a(e[t])||u(e[t])||c(e[t])))throw new p(`streams[${t}]`,v[t],"must be writable")}let w=e[0],S=r(e,function(e){let t=b;b=null,t?t(e):e?_.destroy(e):!k&&!E&&_.destroy()}),E=!!(a(w)||u(w)||c(w)),k=!!(s(S)||h(S)||c(S));if(_=new n({writableObjectMode:!(null==w||!w.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:k}),E){if(i(w))_._write=function(e,r,n){w.write(e,r)?n():t=n},_._final=function(e){w.end(),f=e},w.on("drain",function(){if(t){let e=t;t=null,e()}});else if(l(w)){let e=(c(w)?w.writable:w).getWriter();_._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},_._final=async function(t){try{await e.ready,e.close().catch(()=>{}),f=t}catch(e){t(e)}}}let e=c(S)?S.readable:S;g(e,()=>{if(f){let e=f;f=null,e()}})}if(k)if(i(S))S.on("readable",function(){if(y){let e=y;y=null,e()}}),S.on("end",function(){_.push(null)}),_._read=function(){for(;;){let e=S.read();if(null===e)return void(y=_._read);if(!_.push(e))return}};else if(l(S)){let e=(c(S)?S.readable:S).getReader();_._read=async function(){for(;;)try{let{value:t,done:r}=await e.read();if(!_.push(t))return;if(r)return void _.push(null)}catch{return}}}return _._destroy=function(e,r){!e&&null!==b&&(e=new d),y=null,t=null,f=null,null===b?r(e):(b=r,i(S)&&o(S,e))},_}}),Vt=l((e,t)=>{f(),ot(),We();var r=globalThis.AbortController||lt().AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:i,ERR_OUT_OF_RANGE:s},AbortError:a}=at(),{validateAbortSignal:l,validateInteger:c,validateObject:u}=kt(),h=it().Symbol("kWeak"),d=it().Symbol("kResistStopPropagation"),{finished:p}=Pt(),m=Wt(),{addAbortSignalNoValidate:g}=xt(),{isWritable:y,isNodeStream:b}=At(),{deprecate:_}=Et(),{ArrayPrototypePush:v,Boolean:w,MathFloor:S,Number:E,NumberIsNaN:k,Promise:I,PromiseReject:A,PromiseResolve:P,PromisePrototypeThen:$,Symbol:O}=it(),x=O("kEmpty"),T=O("kEof");function C(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&u(t,"options"),null!=t?.signal&&l(t.signal,"options.signal");let r=1;null!=t?.concurrency&&(r=S(t.concurrency));let n=r-1;return null!=t?.highWaterMark&&(n=S(t.highWaterMark)),c(r,"options.concurrency",1),c(n,"options.highWaterMark",0),n+=r,async function*(){let o,i,s=Et().AbortSignalAny([t?.signal].filter(w)),l=this,c=[],u={signal:s},f=!1,h=0;function d(){f=!0,p()}function p(){h-=1,m()}function m(){i&&!f&&h<r&&c.length<n&&(i(),i=null)}!async function(){try{for await(let t of l){if(f)return;if(s.aborted)throw new a;try{if(t=e(t,u),t===x)continue;t=P(t)}catch(e){t=A(e)}h+=1,$(t,p,d),c.push(t),o&&(o(),o=null),!f&&(c.length>=n||h>=r)&&await new I(e=>{i=e})}c.push(T)}catch(e){let t=A(e);$(t,p,d),c.push(t)}finally{f=!0,o&&(o(),o=null)}}();try{for(;;){for(;c.length>0;){let e=await c[0];if(e===T)return;if(s.aborted)throw new a;e!==x&&(yield e),c.shift(),m()}await new I(e=>{o=e})}}finally{f=!0,i&&(i(),i=null)}}.call(this)}async function R(e,t=void 0){for await(let r of N.call(this,e,t))return!0;return!1}function N(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return C.call(this,async function(t,r){return await e(t,r)?t:x},t)}var j=class extends i{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};function M(e){if(e=E(e),k(e))return 0;if(e<0)throw new s("number",">= 0",e);return e}t.exports.streamReturningOperators={asIndexedPairs:_(function(e=void 0){return null!=e&&u(e,"options"),null!=e?.signal&&l(e.signal,"options.signal"),async function*(){let t=0;for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a({cause:e.signal.reason});yield[t++,n]}}.call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&u(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;e--<=0&&(yield r)}}.call(this)},filter:N,flatMap:function(e,t){let r=C.call(this,e,t);return async function*(){for await(let e of r)yield*e}.call(this)},map:C,take:function(e,t=void 0){return null!=t&&u(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),e=M(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new a;for await(let r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new a;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&u(t,"options"),null!=t?.signal&&l(t.signal,"options.signal"),b(e)&&!y(e))throw new n("stream",e,"must be writable");let r=m(this,e);return null!=t&&t.signal&&g(t.signal,r),r}},t.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await R.call(this,async(...t)=>!await e(...t),t)},forEach:async function(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(let r of C.call(this,async function(t,r){return await e(t,r),x},t));},reduce:async function(e,t,n){var i;if("function"!=typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=n&&u(n,"options"),null!=n?.signal&&l(n.signal,"options.signal");let s=arguments.length>1;if(null!=n&&null!==(i=n.signal)&&void 0!==i&&i.aborted){let e=new a(void 0,{cause:n.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}let c=new r,f=c.signal;if(null!=n&&n.signal){let e={once:!0,[h]:this,[d]:!0};n.signal.addEventListener("abort",()=>c.abort(),e)}let m=!1;try{for await(let r of this){var g;if(m=!0,null!=n&&null!==(g=n.signal)&&void 0!==g&&g.aborted)throw new a;s?t=await e(t,r,{signal:f}):(t=r,s=!0)}if(!m&&!s)throw new j}finally{c.abort()}return t},toArray:async function(e){null!=e&&u(e,"options"),null!=e?.signal&&l(e.signal,"options.signal");let t=[];for await(let n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new a(void 0,{cause:e.signal.reason});v(t,n)}return t},some:R,find:async function(e,t){for await(let r of N.call(this,e,t))return r}}}),zt=l((e,t)=>{f(),ot(),We();var{ArrayPrototypePop:r,Promise:n}=it(),{isIterable:o,isNodeStream:i,isWebStream:s}=At(),{pipelineImpl:a}=qt(),{finished:l}=Pt();Kt(),t.exports={finished:l,pipeline:function(...e){return new n((t,n)=>{let l,c,u=e[e.length-1];if(u&&"object"==typeof u&&!i(u)&&!o(u)&&!s(u)){let t=r(e);l=t.signal,c=t.end}a(e,(e,r)=>{e?n(e):t(r)},{signal:l,end:c})})}}}),Kt=l((e,t)=>{f(),ot(),We();var{Buffer:r}=(nt(),u(Xe)),{ObjectDefineProperty:n,ObjectKeys:o,ReflectApply:i}=it(),{promisify:{custom:s}}=Et(),{streamReturningOperators:a,promiseReturningOperators:l}=Vt(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:c}}=at(),h=Wt(),{setDefaultHighWaterMark:d,getDefaultHighWaterMark:p}=Ct(),{pipeline:m}=qt(),{destroyer:g}=$t(),y=Pt(),b=zt(),_=At(),v=t.exports=Ot().Stream;v.isDestroyed=_.isDestroyed,v.isDisturbed=_.isDisturbed,v.isErrored=_.isErrored,v.isReadable=_.isReadable,v.isWritable=_.isWritable,v.Readable=Mt();for(let e of o(a)){let t=function(...e){if(new.target)throw c();return v.Readable.from(i(r,this,e))},r=a[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}for(let e of o(l)){let t=function(...e){if(new.target)throw c();return i(r,this,e)},r=l[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(v.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}v.Writable=Lt(),v.Duplex=Ut(),v.Transform=Bt(),v.PassThrough=Ft(),v.pipeline=m;var{addAbortSignal:w}=xt();v.addAbortSignal=w,v.finished=y,v.destroy=g,v.compose=h,v.setDefaultHighWaterMark=d,v.getDefaultHighWaterMark=p,n(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>b}),n(m,s,{__proto__:null,enumerable:!0,get:()=>b.pipeline}),n(y,s,{__proto__:null,enumerable:!0,get:()=>b.finished}),v.Stream=v,v._isUint8Array=function(e){return e instanceof Uint8Array},v._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}}),Ht=l((e,t)=>{f(),ot(),We();var r=Kt(),n=zt(),o=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=o,t.exports.pipeline=r.pipeline,t.exports.compose=r.compose,Object.defineProperty(r,"promises",{configurable:!0,enumerable:!0,get:()=>n}),t.exports.Stream=r.Stream,t.exports.default=t.exports}),Gt=l((e,t)=>{f(),ot(),We(),"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}),Qt=l((e,t)=>{f(),ot(),We();var{Buffer:r}=(nt(),u(Xe)),n=Symbol.for("BufferList");function o(e){if(!(this instanceof o))return new o(e);o._init.call(this,e)}o._init=function(e){Object.defineProperty(this,n,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},o.prototype._new=function(e){return new o(e)},o.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){let n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},o.prototype._reverseOffset=function(e){let t=e[0],r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},o.prototype.getBuffers=function(){return this._bufs},o.prototype.get=function(e){if(e>this.length||e<0)return;let t=this._offset(e);return this._bufs[t[0]][t[1]]},o.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)},o.prototype.copy=function(e,t,n,o){if(("number"!=typeof n||n<0)&&(n=0),("number"!=typeof o||o>this.length)&&(o=this.length),n>=this.length||o<=0)return e||r.alloc(0);let i=!!e,s=this._offset(n),a=o-n,l=a,c=i&&t||0,u=s[1];if(0===n&&o===this.length){if(!i)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,c),c+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-u)return i?this._bufs[s[0]].copy(e,t,u,u+l):this._bufs[s[0]].slice(u,u+l);i||(e=r.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){let r=this._bufs[t].length-u;if(!(l>r)){this._bufs[t].copy(e,c,u,u+l),c+=r;break}this._bufs[t].copy(e,c,u),c+=r,l-=r,u&&(u=0)}return e.length>c?e.slice(0,c):e},o.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();let r=this._offset(e),n=this._offset(t),o=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),0!==r[1]&&(o[0]=o[0].slice(r[1])),this._new(o)},o.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},o.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},o.prototype.duplicate=function(){let e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},o.prototype.append=function(e){return this._attach(e,o.prototype._appendBuffer)},o.prototype.prepend=function(e){return this._attach(e,o.prototype._prependBuffer,!0)},o.prototype._attach=function(e,t,n){if(null==e)return this;if(e.buffer)t.call(this,r.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){let[r,o]=n?[e.length-1,-1]:[0,1];for(let i=r;i>=0&&i<e.length;i+=o)this._attach(e[i],t,n)}else if(this._isBufferList(e)){let[r,o]=n?[e._bufs.length-1,-1]:[0,1];for(let i=r;i>=0&&i<e._bufs.length;i+=o)this._attach(e._bufs[i],t,n)}else"number"==typeof e&&(e=e.toString()),t.call(this,r.from(e));return this},o.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},o.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length},o.prototype.indexOf=function(e,t,n){if(void 0===n&&"string"==typeof t&&(n=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=r.from([e]):"string"==typeof e?e=r.from(e,n):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=r.from(e.buffer,e.byteOffset,e.byteLength):r.isBuffer(e)||(e=r.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;let o=this._offset(t),i=o[0],s=o[1];for(;i<this._bufs.length;i++){let t=this._bufs[i];for(;s<t.length;)if(t.length-s>=e.length){let r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([i,r]);s=t.length-e.length+1}else{let t=this._reverseOffset([i,s]);if(this._match(t,e))return t;s++}s=0}return-1},o.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){let e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(let t in e)(function(t){o.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}})(t)}(),o.prototype._isBufferList=function(e){return e instanceof o||o.isBufferList(e)},o.isBufferList=function(e){return null!=e&&e[n]},t.exports=o}),Jt=l((e,t)=>{f(),ot(),We();var r=Ht().Duplex,n=Gt(),o=Qt();function i(e){if(!(this instanceof i))return new i(e);if("function"==typeof e){this._callback=e;let t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",function(e){e.on("error",t)}),this.on("unpipe",function(e){e.removeListener("error",t)}),e=null}o._init.call(this,e),r.call(this)}n(i,r),Object.assign(i.prototype,o.prototype),i.prototype._new=function(e){return new i(e)},i.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},i.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)},i.prototype.end=function(e){r.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},i.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},i.prototype._isBufferList=function(e){return e instanceof i||e instanceof o||i.isBufferList(e)},i.isBufferList=o.isBufferList,t.exports=i,t.exports.BufferListStream=i,t.exports.BufferList=o}),Yt=l((e,t)=>{f(),ot(),We(),t.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}}),Xt=l((e,t)=>{f(),ot(),We();var r=t.exports,{Buffer:n}=(nt(),u(Xe));r.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},r.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},r.requiredHeaderFlagsErrors={};for(let e in r.requiredHeaderFlags){let t=r.requiredHeaderFlags[e];r.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+r.types[e]+" packet"}r.codes={};for(let e in r.types){let t=r.types[e];r.codes[t]=e}r.CMD_SHIFT=4,r.CMD_MASK=240,r.DUP_MASK=8,r.QOS_MASK=3,r.QOS_SHIFT=1,r.RETAIN_MASK=1,r.VARBYTEINT_MASK=127,r.VARBYTEINT_FIN_MASK=128,r.VARBYTEINT_MAX=268435455,r.SESSIONPRESENT_MASK=1,r.SESSIONPRESENT_HEADER=n.from([r.SESSIONPRESENT_MASK]),r.CONNACK_HEADER=n.from([r.codes.connack<<r.CMD_SHIFT]),r.USERNAME_MASK=128,r.PASSWORD_MASK=64,r.WILL_RETAIN_MASK=32,r.WILL_QOS_MASK=24,r.WILL_QOS_SHIFT=3,r.WILL_FLAG_MASK=4,r.CLEAN_SESSION_MASK=2,r.CONNECT_HEADER=n.from([r.codes.connect<<r.CMD_SHIFT]),r.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},r.propertiesCodes={};for(let e in r.properties){let t=r.properties[e];r.propertiesCodes[t]=e}function o(e){return[0,1,2].map(t=>[0,1].map(o=>[0,1].map(i=>{let s=n.alloc(1);return s.writeUInt8(r.codes[e]<<r.CMD_SHIFT|(o?r.DUP_MASK:0)|t<<r.QOS_SHIFT|i,0,!0),s})))}r.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},r.PUBLISH_HEADER=o("publish"),r.SUBSCRIBE_HEADER=o("subscribe"),r.SUBSCRIBE_OPTIONS_QOS_MASK=3,r.SUBSCRIBE_OPTIONS_NL_MASK=1,r.SUBSCRIBE_OPTIONS_NL_SHIFT=2,r.SUBSCRIBE_OPTIONS_RAP_MASK=1,r.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,r.SUBSCRIBE_OPTIONS_RH_MASK=3,r.SUBSCRIBE_OPTIONS_RH_SHIFT=4,r.SUBSCRIBE_OPTIONS_RH=[0,16,32],r.SUBSCRIBE_OPTIONS_NL=4,r.SUBSCRIBE_OPTIONS_RAP=8,r.SUBSCRIBE_OPTIONS_QOS=[0,1,2],r.UNSUBSCRIBE_HEADER=o("unsubscribe"),r.ACKS={unsuback:o("unsuback"),puback:o("puback"),pubcomp:o("pubcomp"),pubrel:o("pubrel"),pubrec:o("pubrec")},r.SUBACK_HEADER=n.from([r.codes.suback<<r.CMD_SHIFT]),r.VERSION3=n.from([3]),r.VERSION4=n.from([4]),r.VERSION5=n.from([5]),r.VERSION131=n.from([131]),r.VERSION132=n.from([132]),r.QOS=[0,1,2].map(e=>n.from([e])),r.EMPTY={pingreq:n.from([r.codes.pingreq<<4,0]),pingresp:n.from([r.codes.pingresp<<4,0]),disconnect:n.from([r.codes.disconnect<<4,0])},r.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},r.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},r.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},r.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},r.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),Zt=l((e,t)=>{f(),ot(),We();var r=1e3,n=6e4,o=60*n,i=24*o,s=7*i;function a(e,t,r,n){var o=t>=1.5*r;return Math.round(e/r)+" "+n+(o?"s":"")}t.exports=function(e,t){t=t||{};var l=typeof e;if("string"===l&&e.length>0)return function(e){if(!((e=String(e)).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 a=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*s;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*o;case"minutes":case"minute":case"mins":case"min":case"m":return a*n;case"seconds":case"second":case"secs":case"sec":case"s":return a*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===l&&isFinite(e))return t.long?function(e){var t=Math.abs(e);return t>=i?a(e,t,i,"day"):t>=o?a(e,t,o,"hour"):t>=n?a(e,t,n,"minute"):t>=r?a(e,t,r,"second"):e+" ms"}(e):function(e){var t=Math.abs(e);return t>=i?Math.round(e/i)+"d":t>=o?Math.round(e/o)+"h":t>=n?Math.round(e/n)+"m":t>=r?Math.round(e/r)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}}),er=l((e,t)=>{f(),ot(),We(),t.exports=function(e){function t(e){let n,o,i,s=null;function a(...e){if(!a.enabled)return;let r=a,o=Number(new Date),i=o-(n||o);r.diff=i,r.prev=n,r.curr=o,n=o,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(n,o)=>{if("%%"===n)return"%";s++;let i=t.formatters[o];if("function"==typeof i){let t=e[s];n=i.call(r,t),e.splice(s,1),s--}return n}),t.formatArgs.call(r,e),(r.log||t.log).apply(r,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=r,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(o!==t.namespaces&&(o=t.namespaces,i=t.enabled(e)),i),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function r(e,r){let n=t(this.namespace+(typeof r>"u"?":":r)+e);return n.log=this.log,n}function n(e,t){let r=0,n=0,o=-1,i=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(o=n,i=r,n++):(r++,n++);else{if(-1===o)return!1;n=o+1,i++,r=i}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){let e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];let r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(let r of t.skips)if(n(e,r))return!1;for(let r of t.names)if(n(e,r))return!0;return!1},t.humanize=Zt(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}}),tr=l((e,t)=>{f(),ot(),We(),e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;let r="color: "+this.color;e.splice(1,0,r,"color: inherit");let n=0,o=0;e[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(o=n))}),e.splice(o,0,r)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch{}},e.load=function(){let t;try{t=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!t&&typeof h<"u"&&"env"in h&&(t=h.env.DEBUG),t},e.useColors=function(){if(typeof window<"u"&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch{}}(),e.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=er()(e);var{formatters:r}=t.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}),rr=l((e,t)=>{f(),ot(),We();var r=Jt(),{EventEmitter:n}=(St(),u(ct)),o=Yt(),i=Xt(),s=tr()("mqtt-packet:parser");t.exports=class e extends n{constructor(){super(),this.parser=this.constructor.parser}static parser(t){return this instanceof e?(this.settings=t||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new e).parser(t)}_resetState(){s("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new o,this.error=null,this._list=r(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),s("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,s("parse: state complete. _stateCounter is now: %d",this._stateCounter),s("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return s("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0),t=e>>i.CMD_SHIFT;this.packet.cmd=i.types[t];let r=15&e,n=i.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(i.requiredHeaderFlagsErrors[t])):(this.packet.retain=0!==(e&i.RETAIN_MASK),this.packet.qos=e>>i.QOS_SHIFT&i.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=0!==(e&i.DUP_MASK),s("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),s("_parseLength %d",e.value),!!e}_parsePayload(){s("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return s("_parsePayload complete result: %s",e),e}_parseConnect(){s("_parseConnect");let e,t,r,n,o={},a=this.packet,l=this._parseString();if(null===l)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(new Error("Invalid protocolId"));if(a.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(a.protocolVersion=this._list.readUInt8(this._pos),a.protocolVersion>=128&&(a.bridgeMode=!0,a.protocolVersion=a.protocolVersion-128),3!==a.protocolVersion&&4!==a.protocolVersion&&5!==a.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));o.username=this._list.readUInt8(this._pos)&i.USERNAME_MASK,o.password=this._list.readUInt8(this._pos)&i.PASSWORD_MASK,o.will=this._list.readUInt8(this._pos)&i.WILL_FLAG_MASK;let c=!!(this._list.readUInt8(this._pos)&i.WILL_RETAIN_MASK),u=(this._list.readUInt8(this._pos)&i.WILL_QOS_MASK)>>i.WILL_QOS_SHIFT;if(o.will)a.will={},a.will.retain=c,a.will.qos=u;else{if(c)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(u)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(a.clean=0!==(this._list.readUInt8(this._pos)&i.CLEAN_SESSION_MASK),this._pos++,a.keepalive=this._parseNum(),-1===a.keepalive)return this._emitError(new Error("Packet too short"));if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.properties=e)}let f=this._parseString();if(null===f)return this._emitError(new Error("Packet too short"));if(a.clientId=f,s("_parseConnect: packet.clientId: %s",a.clientId),o.will){if(5===a.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(a.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(a.will.topic=e,s("_parseConnect: packet.will.topic: %s",a.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));a.will.payload=t,s("_parseConnect: packet.will.paylaod: %s",a.will.payload)}if(o.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));a.username=n,s("_parseConnect: packet.username: %s",a.username)}if(o.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));a.password=r}return this.settings=a,s("_parseConnect: complete"),a}_parseConnack(){s("_parseConnack");let e=this.packet;if(this._list.length<1)return null;let t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(t&i.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}s("_parseConnack: complete")}_parsePublish(){s("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),s("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){s("_parseSubscribe");let e,t,r,n,o,a,l,c=this.packet;if(c.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(c.properties=e)}if(c.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<c.length;){if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=c.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(t=this._parseByte(),5===this.settings.protocolVersion){if(192&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&t)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(r=t&i.SUBSCRIBE_OPTIONS_QOS_MASK,r>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(a=0!==(t>>i.SUBSCRIBE_OPTIONS_NL_SHIFT&i.SUBSCRIBE_OPTIONS_NL_MASK),o=0!==(t>>i.SUBSCRIBE_OPTIONS_RAP_SHIFT&i.SUBSCRIBE_OPTIONS_RAP_MASK),n=t>>i.SUBSCRIBE_OPTIONS_RH_SHIFT&i.SUBSCRIBE_OPTIONS_RH_MASK,n>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));l={topic:e,qos:r},5===this.settings.protocolVersion?(l.nl=a,l.rap=o,l.rh=n):this.settings.bridgeMode&&(l.rh=0,l.rap=!0,l.nl=!0),s("_parseSubscribe: push subscription `%s` to subscription",l),c.subscriptions.push(l)}}}_parseSuback(){s("_parseSuback");let e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!i.MQTT5_SUBACK_CODES[e])return this._emitError(new Error("Invalid suback code"))}else if(e>2&&128!==e)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(e)}}}_parseUnsubscribe(){s("_parseUnsubscribe");let e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){let t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));s("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){s("_parseUnsuback");let e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){let t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){let e=this._list.readUInt8(this._pos++);if(!i.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){s("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!i.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!i.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}s("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){let e=this.packet;if(s("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),i.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return s("_parseDisconnect result: true"),!0}_parseAuth(){s("_parseAuth");let e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!i.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),s("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(s("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;let n=this._list.toString("utf8",this._pos,r);return this._pos+=t,s("_parseString: result: %s",n),n}_parseStringPair(){return s("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;let r=this._list.slice(this._pos,t);return this._pos+=e,s("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,s("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,s("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){s("_parseVarByteNum");let t,r=0,n=1,o=0,a=!1,l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),o+=n*(t&i.VARBYTEINT_MASK),n*=128,0===(t&i.VARBYTEINT_FIN_MASK)){a=!0;break}if(this._list.length<=r)break}return!a&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),a=!!a&&(e?{bytes:r,value:o}:o),s("_parseVarByteNum: result: %o",a),a}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),s("_parseByte: result: %o",e),e}_parseByType(e){switch(s("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){s("_parseProperties");let e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){let e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;let t=i.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));let e=this._parseByType(i.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{let n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value;continue}r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(i.propertiesTypes[t]))):r[t]=this._parseByType(i.propertiesTypes[t])}return r}_newPacket(){return s("_newPacket"),this.packet&&(this._list.consume(this.packet.length),s("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),s("_newPacket: new packet"),this.packet=new o,this._pos=0,!0}_emitError(e){s("_emitError",e),this.error=e,this.emit("error",e)}}}),nr=l((e,t)=>{f(),ot(),We();var{Buffer:r}=(nt(),u(Xe)),n={},o=r.isBuffer(r.from([1,2]).subarray(0,1));function i(e){let t=r.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}t.exports={cache:n,generateCache:function(){for(let e=0;e<65536;e++)n[e]=i(e)},generateNumber:i,genBufVariableByteInt:function(e){let t=0,n=0,i=r.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),i.writeUInt8(t,n++)}while(e>0&&n<4);return e>0&&(n=0),o?i.subarray(0,n):i.slice(0,n)},generate4ByteBuffer:function(e){let t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}}),or=l((e,t)=>{f(),ot(),We(),typeof h>"u"||!h.version||0===h.version.indexOf("v0.")||0===h.version.indexOf("v1.")&&0!==h.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 o,i,s=arguments.length;switch(s){case 0:case 1:return h.nextTick(e);case 2:return h.nextTick(function(){e.call(null,t)});case 3:return h.nextTick(function(){e.call(null,t,r)});case 4:return h.nextTick(function(){e.call(null,t,r,n)});default:for(o=new Array(s-1),i=0;i<o.length;)o[i++]=arguments[i];return h.nextTick(function(){e.apply(null,o)})}}}:t.exports=h}),ir=l((e,t)=>{f(),ot(),We();var r=Xt(),{Buffer:n}=(nt(),u(Xe)),o=n.allocUnsafe(0),i=n.from([0]),s=nr(),a=or().nextTick,l=tr()("mqtt-packet:writeToStream"),c=s.cache,h=s.generateNumber,d=s.generateCache,p=s.genBufVariableByteInt,m=s.generate4ByteBuffer,g=k,y=!0;function b(e,t,s){switch(l("generate called"),t.cork&&(t.cork(),a(_,t)),y&&(y=!1,d()),l("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){let o=e||{},i=o.protocolId||"MQTT",s=o.protocolVersion||4,a=o.will,l=o.clean,c=o.keepalive||0,u=o.clientId||"",f=o.username,h=o.password,d=o.properties;void 0===l&&(l=!0);let p,m,y=0;if(!i||"string"!=typeof i&&!n.isBuffer(i))return t.destroy(new Error("Invalid protocolId")),!1;if(y+=i.length+2,3!==s&&4!==s&&5!==s)return t.destroy(new Error("Invalid protocol version")),!1;if(y+=1,("string"==typeof u||n.isBuffer(u))&&(u||s>=4)&&(u||l))y+=n.byteLength(u)+2;else{if(s<4)return t.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return t.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof c||c<0||c>65535||c%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(y+=2,y+=1,5===s){if(p=P(t,d),!p)return!1;y+=p.length}if(a){if("object"!=typeof a)return t.destroy(new Error("Invalid will")),!1;if(!a.topic||"string"!=typeof a.topic)return t.destroy(new Error("Invalid will topic")),!1;if(y+=n.byteLength(a.topic)+2,y+=2,a.payload){if(!(a.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof a.payload?y+=n.byteLength(a.payload):y+=a.payload.length}if(m={},5===s){if(m=P(t,a.properties),!m)return!1;y+=m.length}}let b=!1;if(null!=f){if(!C(f))return t.destroy(new Error("Invalid username")),!1;b=!0,y+=n.byteLength(f)+2}if(null!=h){if(!b)return t.destroy(new Error("Username is required to use password")),!1;if(!C(h))return t.destroy(new Error("Invalid password")),!1;y+=T(h)+2}t.write(r.CONNECT_HEADER),w(t,y),A(t,i),o.bridgeMode&&(s+=128),t.write(131===s?r.VERSION131:132===s?r.VERSION132:4===s?r.VERSION4:5===s?r.VERSION5:r.VERSION3);let _=0;return _|=null!=f?r.USERNAME_MASK:0,_|=null!=h?r.PASSWORD_MASK:0,_|=a&&a.retain?r.WILL_RETAIN_MASK:0,_|=a&&a.qos?a.qos<<r.WILL_QOS_SHIFT:0,_|=a?r.WILL_FLAG_MASK:0,_|=l?r.CLEAN_SESSION_MASK:0,t.write(n.from([_])),g(t,c),5===s&&p.write(),A(t,u),a&&(5===s&&m.write(),S(t,a.topic),A(t,a.payload)),null!=f&&A(t,f),null!=h&&A(t,h),!0}(e,t);case"connack":return function(e,t,o){let s=o?o.protocolVersion:4,a=e||{},l=5===s?a.reasonCode:a.returnCode,c=a.properties,u=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let f=null;if(5===s){if(f=P(t,c),!f)return!1;u+=f.length}return t.write(r.CONNACK_HEADER),w(t,u),t.write(a.sessionPresent?r.SESSIONPRESENT_HEADER:i),t.write(n.from([l])),f?.write(),!0}(e,t,s);case"publish":return function(e,t,i){l("publish: packet: %o",e);let s=i?i.protocolVersion:4,a=e||{},c=a.qos||0,u=a.retain?r.RETAIN_MASK:0,f=a.topic,h=a.payload||o,d=a.messageId,p=a.properties,m=0;if("string"==typeof f)m+=n.byteLength(f)+2;else{if(!n.isBuffer(f))return t.destroy(new Error("Invalid topic")),!1;m+=f.length+2}if(n.isBuffer(h)?m+=h.length:m+=n.byteLength(h),c&&"number"!=typeof d)return t.destroy(new Error("Invalid messageId")),!1;c&&(m+=2);let y=null;if(5===s){if(y=P(t,p),!y)return!1;m+=y.length}return t.write(r.PUBLISH_HEADER[c][a.dup?1:0][u?1:0]),w(t,m),g(t,T(f)),t.write(f),c>0&&g(t,d),y?.write(),l("publish: payload: %o",h),t.write(h)}(e,t,s);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,o){let i=o?o.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,c=s.dup&&"pubrel"===a?r.DUP_MASK:0,u=0,f=s.reasonCode,h=s.properties,d=5===i?3:2;if("pubrel"===a&&(u=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let p=null;if(5===i&&"object"==typeof h){if(p=$(t,h,o,d),!p)return!1;d+=p.length}return t.write(r.ACKS[a][u][c][0]),3===d&&(d+=0!==f?1:-1),w(t,d),g(t,l),5===i&&2!==d&&t.write(n.from([f])),null!==p?p.write():4===d&&t.write(n.from([0])),!0}(e,t,s);case"subscribe":return function(e,t,o){l("subscribe: packet: ");let i=o?o.protocolVersion:4,s=e||{},a=s.dup?r.DUP_MASK:0,c=s.messageId,u=s.subscriptions,f=s.properties,h=0;if("number"!=typeof c)return t.destroy(new Error("Invalid messageId")),!1;h+=2;let d=null;if(5===i){if(d=P(t,f),!d)return!1;h+=d.length}if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){let r=u[e].topic,o=u[e].qos;if("string"!=typeof r)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof o)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===i){if("boolean"!=typeof(u[e].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let r=u[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}h+=n.byteLength(r)+2+1}l("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),t.write(r.SUBSCRIBE_HEADER[1][a?1:0][0]),w(t,h),g(t,c),null!==d&&d.write();let p=!0;for(let e of u){let o,s=e.topic,a=e.qos,l=+e.nl,c=+e.rap,u=e.rh;S(t,s),o=r.SUBSCRIBE_OPTIONS_QOS[a],5===i&&(o|=l?r.SUBSCRIBE_OPTIONS_NL:0,o|=c?r.SUBSCRIBE_OPTIONS_RAP:0,o|=u?r.SUBSCRIBE_OPTIONS_RH[u]:0),p=t.write(n.from([o]))}return p}(e,t,s);case"suback":return function(e,t,o){let i=o?o.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,c=s.properties,u=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(u+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(new Error("Invalid qos vector")),!1;u+=1}let f=null;if(5===i){if(f=$(t,c,o,u),!f)return!1;u+=f.length}return t.write(r.SUBACK_HEADER),w(t,u),g(t,a),null!==f&&f.write(),t.write(n.from(l))}(e,t,s);case"unsubscribe":return function(e,t,o){let i=o?o.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,c=s.unsubscriptions,u=s.properties,f=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(f+=2,"object"!=typeof c||!c.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let e=0;e<c.length;e+=1){if("string"!=typeof c[e])return t.destroy(new Error("Invalid unsubscriptions")),!1;f+=n.byteLength(c[e])+2}let h=null;if(5===i){if(h=P(t,u),!h)return!1;f+=h.length}t.write(r.UNSUBSCRIBE_HEADER[1][l?1:0][0]),w(t,f),g(t,a),null!==h&&h.write();let d=!0;for(let e=0;e<c.length;e++)d=S(t,c[e]);return d}(e,t,s);case"unsuback":return function(e,t,o){let i=o?o.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?r.DUP_MASK:0,c=s.granted,u=s.properties,f=s.cmd,h=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===i){if("object"!=typeof c||!c.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<c.length;e+=1){if("number"!=typeof c[e])return t.destroy(new Error("Invalid qos vector")),!1;h+=1}}let d=null;if(5===i){if(d=$(t,u,o,h),!d)return!1;h+=d.length}return t.write(r.ACKS[f][0][l][0]),w(t,h),g(t,a),null!==d&&d.write(),5===i&&t.write(n.from(c)),!0}(e,t,s);case"pingreq":case"pingresp":return function(e,t){return t.write(r.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,o){let i=o?o.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,c=5===i?1:0,u=null;if(5===i){if(u=$(t,l,o,c),!u)return!1;c+=u.length}return t.write(n.from([r.codes.disconnect<<4])),w(t,c),5===i&&t.write(n.from([a])),null!==u&&u.write(),!0}(e,t,s);case"auth":return function(e,t,o){let i=o?o.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties,c=5===i?1:0;5!==i&&t.destroy(new Error("Invalid mqtt version for auth packet"));let u=$(t,l,o,c);return!!u&&(c+=u.length,t.write(n.from([r.codes.auth<<4])),w(t,c),t.write(n.from([a])),null!==u&&u.write(),!0)}(e,t,s);default:return t.destroy(new Error("Unknown command")),!1}}function _(e){e.uncork()}Object.defineProperty(b,"cacheNumbers",{get:()=>g===k,set(e){e?((!c||0===Object.keys(c).length)&&(y=!0),g=k):(y=!1,g=I)}});var v={};function w(e,t){if(t>r.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let n=v[t];return n||(n=p(t),t<16384&&(v[t]=n)),l("writeVarByteInt: writing to stream: %o",n),e.write(n)}function S(e,t){let r=n.byteLength(t);return g(e,r),l("writeString: %s",t),e.write(t,"utf8")}function E(e,t,r){S(e,t),S(e,r)}function k(e,t){return l("writeNumberCached: number: %d",t),l("writeNumberCached: %o",c[t]),e.write(c[t])}function I(e,t){let r=h(t);return l("writeNumberGenerated: %o",r),e.write(r)}function A(e,t){"string"==typeof t?S(e,t):t?(g(e,t.length),e.write(t)):g(e,0)}function P(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){x(e,{},0)}};let o=0;function i(t,o){let i=0;switch(r.propertiesTypes[t]){case"byte":if("boolean"!=typeof o)return e.destroy(new Error(`Invalid ${t}: ${o}`)),!1;i+=2;break;case"int8":if("number"!=typeof o||o<0||o>255)return e.destroy(new Error(`Invalid ${t}: ${o}`)),!1;i+=2;break;case"binary":if(o&&null===o)return e.destroy(new Error(`Invalid ${t}: ${o}`)),!1;i+=1+n.byteLength(o)+2;break;case"int16":if("number"!=typeof o||o<0||o>65535)return e.destroy(new Error(`Invalid ${t}: ${o}`)),!1;i+=3;break;case"int32":if("number"!=typeof o||o<0||o>4294967295)return e.destroy(new Error(`Invalid ${t}: ${o}`)),!1;i+=5;break;case"var":if("number"!=typeof o||o<0||o>268435455)return e.destroy(new Error(`Invalid ${t}: ${o}`)),!1;i+=1+n.byteLength(p(o));break;case"string":if("string"!=typeof o)return e.destroy(new Error(`Invalid ${t}: ${o}`)),!1;i+=3+n.byteLength(o.toString());break;case"pair":if("object"!=typeof o)return e.destroy(new Error(`Invalid ${t}: ${o}`)),!1;i+=Object.getOwnPropertyNames(o).reduce((e,t)=>{let r=o[t];return Array.isArray(r)?e+=r.reduce((e,r)=>e+(3+n.byteLength(t.toString())+2+n.byteLength(r.toString())),0):e+=3+n.byteLength(t.toString())+2+n.byteLength(o[t].toString()),e},0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${o}`)),!1}return i}if(t)for(let e in t){let r=0,n=0,s=t[e];if(void 0!==s){if(Array.isArray(s))for(let t=0;t<s.length;t++){if(n=i(e,s[t]),!n)return!1;r+=n}else{if(n=i(e,s),!n)return!1;r=n}if(!r)return!1;o+=r}}return{length:n.byteLength(p(o))+o,write(){x(e,t,o)}}}function $(e,t,r,n){let o=["reasonString","userProperties"],i=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0,s=P(e,t);if(i)for(;n+s.length>i;){let r=o.shift();if(!r||!t[r])return!1;delete t[r],s=P(e,t)}return s}function O(e,t,o){switch(r.propertiesTypes[t]){case"byte":e.write(n.from([r.properties[t]])),e.write(n.from([+o]));break;case"int8":e.write(n.from([r.properties[t]])),e.write(n.from([o]));break;case"binary":e.write(n.from([r.properties[t]])),A(e,o);break;case"int16":e.write(n.from([r.properties[t]])),g(e,o);break;case"int32":e.write(n.from([r.properties[t]])),function(e,t){let r=m(t);l("write4ByteNumber: %o",r),e.write(r)}(e,o);break;case"var":e.write(n.from([r.properties[t]])),w(e,o);break;case"string":e.write(n.from([r.properties[t]])),S(e,o);break;case"pair":Object.getOwnPropertyNames(o).forEach(i=>{let s=o[i];Array.isArray(s)?s.forEach(o=>{e.write(n.from([r.properties[t]])),E(e,i.toString(),o.toString())}):(e.write(n.from([r.properties[t]])),E(e,i.toString(),s.toString()))});break;default:return e.destroy(new Error(`Invalid property ${t} value: ${o}`)),!1}}function x(e,t,r){w(e,r);for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!=t[r]){let n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)O(e,r,n[t]);else O(e,r,n)}}function T(e){return e?e instanceof n?e.length:n.byteLength(e):0}function C(e){return"string"==typeof e||e instanceof n}t.exports=b}),sr=l((e,t)=>{f(),ot(),We();var r=ir(),{EventEmitter:n}=(St(),u(ct)),{Buffer:o}=(nt(),u(Xe)),i=class extends n{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e,t=0,r=new Array(this._array.length),n=this._array,i=0;for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?r[e]=n[e].length:r[e]=o.byteLength(n[e]),t+=r[e];let s=o.allocUnsafe(t);for(e=0;e<n.length&&void 0!==n[e];e++)"string"!=typeof n[e]?(n[e].copy(s,i),i+=r[e]):(s.write(n[e],i),i+=r[e]);return s}destroy(e){e&&this.emit("error",e)}};t.exports=function(e,t){let n=new i;return r(e,n,t),n.concat()}}),ar=l(e=>{f(),ot(),We(),e.parser=rr().parser,e.generate=sr(),e.writeToStream=ir()}),lr=l((e,t)=>{function r(e){return e instanceof et?et.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}f(),ot(),We(),t.exports=function(e){if((e=e||{}).circles)return function(e){let t=[],n=[],o=new Map;if(o.set(Date,e=>new Date(e)),o.set(Map,(e,t)=>new Map(s(Array.from(e),t))),o.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(let t of e.constructorHandlers)o.set(t[0],t[1]);let i=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(i=o.get(a.constructor)))return i(a,e);let l={};t.push(a),n.push(l);for(let s in a){let c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(i=o.get(c.constructor)))l[s]=i(c,e);else if(ArrayBuffer.isView(c))l[s]=r(c);else{let r=t.indexOf(c);l[s]=-1!==r?n[r]:e(c)}}return t.pop(),n.pop(),l}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(i=o.get(a.constructor)))return i(a,e);let l={};t.push(a),n.push(l);for(let s in a){if(!1===Object.hasOwnProperty.call(a,s))continue;let c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(i=o.get(c.constructor)))l[s]=i(c,e);else if(ArrayBuffer.isView(c))l[s]=r(c);else{let r=t.indexOf(c);l[s]=-1!==r?n[r]:e(c)}}return t.pop(),n.pop(),l};function s(e,s){let a=Object.keys(e),l=new Array(a.length);for(let c=0;c<a.length;c++){let u=a[c],f=e[u];if("object"!=typeof f||null===f)l[u]=f;else if(f.constructor!==Object&&(i=o.get(f.constructor)))l[u]=i(f,s);else if(ArrayBuffer.isView(f))l[u]=r(f);else{let e=t.indexOf(f);l[u]=-1!==e?n[e]:s(f)}}return l}}(e);let t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(o(Array.from(e),t))),t.set(Set,(e,t)=>new Set(o(Array.from(e),t))),e.constructorHandlers)for(let r of e.constructorHandlers)t.set(r[0],r[1]);let n=null;return e.proto?function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return o(i,e);if(i.constructor!==Object&&(n=t.get(i.constructor)))return n(i,e);let s={};for(let o in i){let a=i[o];"object"!=typeof a||null===a?s[o]=a:a.constructor!==Object&&(n=t.get(a.constructor))?s[o]=n(a,e):ArrayBuffer.isView(a)?s[o]=r(a):s[o]=e(a)}return s}:function e(i){if("object"!=typeof i||null===i)return i;if(Array.isArray(i))return o(i,e);if(i.constructor!==Object&&(n=t.get(i.constructor)))return n(i,e);let s={};for(let o in i){if(!1===Object.hasOwnProperty.call(i,o))continue;let a=i[o];"object"!=typeof a||null===a?s[o]=a:a.constructor!==Object&&(n=t.get(a.constructor))?s[o]=n(a,e):ArrayBuffer.isView(a)?s[o]=r(a):s[o]=e(a)}return s};function o(e,o){let i=Object.keys(e),s=new Array(i.length);for(let a=0;a<i.length;a++){let l=i[a],c=e[l];"object"!=typeof c||null===c?s[l]=c:c.constructor!==Object&&(n=t.get(c.constructor))?s[l]=n(c,o):ArrayBuffer.isView(c)?s[l]=r(c):s[l]=o(c)}return s}}}),cr=l((e,t)=>{f(),ot(),We(),t.exports=lr()()}),ur=l(e=>{function t(e){let t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.validateTopic=t,e.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let r=0;r<e.length;r++)if(!t(e[r]))return e[r];return null}}),fr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0});var t=Ht(),r={objectMode:!0},n={clean:!0};e.default=class{options;_inflights;constructor(e){this.options=e||{},this.options={...n,...e},this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){let e=new t.Readable(r),n=[],o=!1,i=0;return this._inflights.forEach((e,t)=>{n.push(e)}),e._read=()=>{!o&&i<n.length?e.push(n[i++]):e.push(null)},e.destroy=t=>{if(!o)return o=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,t){let r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){let r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}}),hr=l((e,t)=>{t.exports={version:"5.16.0"}}),dr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.MQTTJS_VERSION=e.nextTick=e.ErrorWithSubackPacket=e.ErrorWithReasonCode=void 0,e.applyMixin=function(e,t,r=!1){let n=[t];for(;;){let e=n[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;n.unshift(t)}for(let t of n)for(let n of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==n)&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n)??Object.create(null))};var t=class e extends Error{code;constructor(t,r){super(t),this.code=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};e.ErrorWithReasonCode=t;var r=class e extends Error{packet;constructor(t,r){super(t),this.packet=r,Object.setPrototypeOf(this,e.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};e.ErrorWithSubackPacket=r,e.nextTick="function"==typeof h?.nextTick?h.nextTick:e=>{setTimeout(e,0)},e.MQTTJS_VERSION=hr().version}),pr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0});var t=dr(),r=[0,16,128,131,135,144,145,151,153],n=(e,r,n,o,i=148)=>{o?.discardParsedPackets(),(!o||o.isCurrent())&&e._cleanUp(!0),n(),e.emit("error",new t.ErrorWithReasonCode(r,i))},o=(e,t,r)=>{r(),e.emit("error",t)};e.default=(e,t,i,s)=>{e.log("handlePublish: packet %o",t),i=typeof i<"u"?i:e.noop;let a=t.topic.toString(),l=t.payload,{qos:c}=t,{messageId:u}=t,{options:f}=e;if(5===e.options.protocolVersion){let r;if(t.properties&&(r=t.properties.topicAlias),typeof r<"u"){let t=e.topicAliasRecv;if(!t)return e.log("handlePublish :: received unexpected topic alias. alias: %d",r),void n(e,"Received a PUBLISH Topic Alias but no Topic Alias Maximum was advertised",i,s);if(0===a.length){if(!(r>0&&r<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",r),void n(e,`Received Topic Alias ${r} is outside the valid range 1-65535`,i,s);{let o=t.getTopicByAlias(r);if(!o)return e.log("handlePublish :: unregistered topic alias. alias: %d",r),void n(e,"Received unregistered Topic Alias",i,s,130);a=o,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",a,r)}}else{if(!t.put(a,r))return e.log("handlePublish :: topic alias outside the advertised maximum. alias: %d - max: %d",r,t.max),void n(e,`Received Topic Alias ${r} is outside the advertised Topic Alias Maximum range 1-${t.max}`,i,s);e.log("handlePublish :: registered topic: %s - alias: %d",a,r)}}}switch(e.log("handlePublish: qos %d",c),c){case 2:f.customHandleAcks(a,l,t,(n,a)=>{if("number"==typeof n&&(a=n,n=null),n)return o(e,n,i);if(-1===r.indexOf(a))return o(e,new Error("Wrong reason code for pubrec"),i);if(a)e._sendPacket({cmd:"pubrec",messageId:u,reasonCode:a},i);else{if(!e._trackIncomingQoS2Publish(u,i,s))return;e.incomingStore.put(t,()=>{e._sendPacket({cmd:"pubrec",messageId:u},i)})}});break;case 1:f.customHandleAcks(a,l,t,(n,s)=>("number"==typeof n&&(s=n,n=null),n?o(e,n,i):-1===r.indexOf(s)?o(e,new Error("Wrong reason code for puback"),i):(s||e.emit("message",a,l,t),void e.handleMessage(t,t=>{if(t)return i&&i(t);e._sendPacket({cmd:"puback",messageId:u,reasonCode:s},i)}))));break;case 0:e.emit("message",a,l,t),e.handleMessage(t,i);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}}),mr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0});var t=dr(),r=130,n=(e,t,r)=>{e.log("handleAuth :: %s",t.message),r?.discardParsedPackets(),(!r||r.isCurrent())&&e._cleanUp(!0),e.emit("error",t)};e.default=(e,o,i)=>{let{options:s}=e,a=s.protocolVersion,l=5===a?o.reasonCode:o.returnCode;if(5!==a)return void n(e,new t.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${a}`,r),i);let c=e._authenticationMethod;c?o.properties?.authenticationMethod===c?e.handleAuth(o,(o,s)=>{if(o)n(e,o,i);else{if(0!==l)return 24===l?s?(e.reconnecting=!1,void e._sendPacket(s)):void n(e,new t.ErrorWithReasonCode("Protocol error: No auth packet to continue the authentication exchange",r),i):void n(e,new t.ErrorWithReasonCode(`Protocol error: Auth packet reason code ${l} is not one a broker may send`,r),i);e.log("handleAuth :: authentication exchange completed successfully")}}):n(e,new t.ErrorWithReasonCode(`Protocol error: Auth packet Authentication Method does not match the "${c}" sent in CONNECT`,r),i):n(e,new t.ErrorWithReasonCode("Protocol error: Auth packet received but enhanced authentication was not requested",r),i)}}),gr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=void 0;var t=dr();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"};var r={publish:["puback","pubrec","pubcomp"],pubrel:["pubcomp"],subscribe:["suback"],unsubscribe:["unsuback"]};e.default=(n,o)=>{let{messageId:i}=o,s=o.cmd,a=null,l=n.outgoing[i],c=l?l.cb:null,u=null;if(c){if(!r[l.cmd]?.includes(s))return n.log("_handleAck :: %s does not answer the pending %s on message id %d. Ignoring.",s,l.cmd,i),void n.emit("error",new Error(`Protocol error: ${s} does not answer the ${l.cmd} pending on message id ${i}`));switch(n.log("_handleAck :: packet type",s),s){case"pubcomp":case"puback":{let r=o.reasonCode;r&&r>0&&16!==r?(u=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[r]}`,r),n._removeOutgoingAndStoreMessage(i,()=>{c(u,o)})):n._removeOutgoingAndStoreMessage(i,c);break}case"pubrec":{a={cmd:"pubrel",qos:2,messageId:i};let r=o.reasonCode;r&&r>0&&16!==r?(u=new t.ErrorWithReasonCode(`Publish error: ${e.ReasonCodes[r]}`,r),n._removeOutgoingAndStoreMessage(i,()=>{c(u,o)})):n._sendPacket(a);break}case"suback":{delete n.outgoing[i],n.messageIdProvider.deallocate(i);let t=o.granted;for(let r=0;r<t.length;r++){let o=t[r];if(128&o){u=new Error(`Subscribe error: ${e.ReasonCodes[o]}`),u.code=o;let t=n.messageIdToTopic[i];t&&t.forEach(e=>{delete n._resubscribeTopics[e]})}}delete n.messageIdToTopic[i],n._invokeStoreProcessingQueue(),c(u,o);break}case"unsuback":delete n.outgoing[i],n.messageIdProvider.deallocate(i),n._invokeStoreProcessingQueue(),c(null,o);break;default:n.emit("error",new Error("unrecognized packet type"))}n.disconnecting&&0===Object.keys(n.outgoing).length&&n.emit("outgoingEmpty")}else n.log("_handleAck :: Server sent an ack in error. Ignoring.")}}),yr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.LRUCache=void 0;var t="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,r=new Set,n="object"==typeof h&&h?h:{},o=(e,t,r,o)=>{"function"==typeof n.emitWarning?n.emitWarning(e,t,r,o):console.error(`[${r}] ${t}: ${e}`)},i=globalThis.AbortController,s=globalThis.AbortSignal;if(typeof i>"u"){s=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},i=class{constructor(){t()}signal=new s;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(let t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==n.env?.LRU_CACHE_IGNORE_AC_WARNING,t=()=>{e&&(e=!1,o("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");var a=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),l=e=>a(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?c:null:null,c=class extends Array{constructor(e){super(e),this.fill(0)}},u=class e{heap;length;static#e=!1;static create(t){let r=l(t);if(!r)return[];e.#e=!0;let n=new e(t,r);return e.#e=!1,n}constructor(t,r){if(!e.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(t),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},d=class e{#e;#t;#r;#n;#o;#i;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#s;#a;#l;#c;#u;#f;#h;#d;#p;#m;#g;#y;#b;#_;#v;#w;#S;static unsafeExposeInternals(e){return{starts:e.#b,ttls:e.#_,sizes:e.#y,keyMap:e.#l,keyList:e.#c,valList:e.#u,next:e.#f,prev:e.#h,get head(){return e.#d},get tail(){return e.#p},free:e.#m,isBackgroundFetch:t=>e.#E(t),backgroundFetch:(t,r,n,o)=>e.#k(t,r,n,o),moveToTail:t=>e.#I(t),indexes:t=>e.#A(t),rindexes:t=>e.#P(t),isStale:t=>e.#$(t)}}get max(){return this.#e}get maxSize(){return this.#t}get calculatedSize(){return this.#a}get size(){return this.#s}get fetchMethod(){return this.#o}get memoMethod(){return this.#i}get dispose(){return this.#r}get disposeAfter(){return this.#n}constructor(t){let{max:n=0,ttl:i,ttlResolution:s=1,ttlAutopurge:c,updateAgeOnGet:f,updateAgeOnHas:h,allowStale:d,dispose:p,disposeAfter:m,noDisposeOnSet:g,noUpdateTTL:y,maxSize:b=0,maxEntrySize:_=0,sizeCalculation:v,fetchMethod:w,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:I,allowStaleOnFetchAbort:A,ignoreFetchAbort:P}=t;if(0!==n&&!a(n))throw new TypeError("max option must be a nonnegative integer");let $=n?l(n):Array;if(!$)throw new Error("invalid max value: "+n);if(this.#e=n,this.#t=b,this.maxEntrySize=_||this.#t,this.sizeCalculation=v,this.sizeCalculation){if(!this.#t&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==S&&"function"!=typeof S)throw new TypeError("memoMethod must be a function if defined");if(this.#i=S,void 0!==w&&"function"!=typeof w)throw new TypeError("fetchMethod must be a function if specified");if(this.#o=w,this.#w=!!w,this.#l=new Map,this.#c=new Array(n).fill(void 0),this.#u=new Array(n).fill(void 0),this.#f=new $(n),this.#h=new $(n),this.#d=0,this.#p=0,this.#m=u.create(n),this.#s=0,this.#a=0,"function"==typeof p&&(this.#r=p),"function"==typeof m?(this.#n=m,this.#g=[]):(this.#n=void 0,this.#g=void 0),this.#v=!!this.#r,this.#S=!!this.#n,this.noDisposeOnSet=!!g,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!I,this.allowStaleOnFetchAbort=!!A,this.ignoreFetchAbort=!!P,0!==this.maxEntrySize){if(0!==this.#t&&!a(this.#t))throw new TypeError("maxSize must be a positive integer if specified");if(!a(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#O()}if(this.allowStale=!!d,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!f,this.updateAgeOnHas=!!h,this.ttlResolution=a(s)||0===s?s:1,this.ttlAutopurge=!!c,this.ttl=i||0,this.ttl){if(!a(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#x()}if(0===this.#e&&0===this.ttl&&0===this.#t)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#e&&!this.#t){let t="LRU_CACHE_UNBOUNDED";(e=>!r.has(e))(t)&&(r.add(t),o("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,e))}}getRemainingTTL(e){return this.#l.has(e)?1/0:0}#x(){let e=new c(this.#e),r=new c(this.#e);this.#_=e,this.#b=r,this.#T=(n,o,i=t.now())=>{if(r[n]=0!==o?i:0,e[n]=o,0!==o&&this.ttlAutopurge){let e=setTimeout(()=>{this.#$(n)&&this.#C(this.#c[n],"expire")},o+1);e.unref&&e.unref()}},this.#R=n=>{r[n]=0!==e[n]?t.now():0},this.#N=(t,i)=>{if(e[i]){let s=e[i],a=r[i];if(!s||!a)return;t.ttl=s,t.start=a,t.now=n||o();let l=t.now-a;t.remainingTTL=s-l}};let n=0,o=()=>{let e=t.now();if(this.ttlResolution>0){n=e;let t=setTimeout(()=>n=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=t=>{let i=this.#l.get(t);if(void 0===i)return 0;let s=e[i],a=r[i];return s&&a?s-((n||o())-a):1/0},this.#$=t=>{let i=r[t],s=e[t];return!!s&&!!i&&(n||o())-i>s}}#R=()=>{};#N=()=>{};#T=()=>{};#$=()=>!1;#O(){let e=new c(this.#e);this.#a=0,this.#y=e,this.#j=t=>{this.#a-=e[t],e[t]=0},this.#M=(e,t,r,n)=>{if(this.#E(t))return 0;if(!a(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!a(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#L=(t,r,n)=>{if(e[t]=r,this.#t){let r=this.#t-e[t];for(;this.#a>r;)this.#D(!0)}this.#a+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#a)}}#j=e=>{};#L=(e,t,r)=>{};#M=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#A({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#p;this.#U(t)&&((e||!this.#$(t))&&(yield t),t!==this.#d);)t=this.#h[t]}*#P({allowStale:e=this.allowStale}={}){if(this.#s)for(let t=this.#d;this.#U(t)&&((e||!this.#$(t))&&(yield t),t!==this.#p);)t=this.#f[t]}#U(e){return void 0!==e&&this.#l.get(this.#c[e])===e}*entries(){for(let e of this.#A())void 0!==this.#u[e]&&void 0!==this.#c[e]&&!this.#E(this.#u[e])&&(yield[this.#c[e],this.#u[e]])}*rentries(){for(let e of this.#P())void 0!==this.#u[e]&&void 0!==this.#c[e]&&!this.#E(this.#u[e])&&(yield[this.#c[e],this.#u[e]])}*keys(){for(let e of this.#A()){let t=this.#c[e];void 0!==t&&!this.#E(this.#u[e])&&(yield t)}}*rkeys(){for(let e of this.#P()){let t=this.#c[e];void 0!==t&&!this.#E(this.#u[e])&&(yield t)}}*values(){for(let e of this.#A())void 0!==this.#u[e]&&!this.#E(this.#u[e])&&(yield this.#u[e])}*rvalues(){for(let e of this.#P())void 0!==this.#u[e]&&!this.#E(this.#u[e])&&(yield this.#u[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let r of this.#A()){let n=this.#u[r],o=this.#E(n)?n.__staleWhileFetching:n;if(void 0!==o&&e(o,this.#c[r],this))return this.get(this.#c[r],t)}}forEach(e,t=this){for(let r of this.#A()){let n=this.#u[r],o=this.#E(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#c[r],this)}}rforEach(e,t=this){for(let r of this.#P()){let n=this.#u[r],o=this.#E(n)?n.__staleWhileFetching:n;void 0!==o&&e.call(t,o,this.#c[r],this)}}purgeStale(){let e=!1;for(let t of this.#P({allowStale:!0}))this.#$(t)&&(this.#C(this.#c[t],"expire"),e=!0);return e}info(e){let r=this.#l.get(e);if(void 0===r)return;let n=this.#u[r],o=this.#E(n)?n.__staleWhileFetching:n;if(void 0===o)return;let i={value:o};if(this.#_&&this.#b){let e=this.#_[r],n=this.#b[r];if(e&&n){let r=e-(t.now()-n);i.ttl=r,i.start=Date.now()}}return this.#y&&(i.size=this.#y[r]),i}dump(){let e=[];for(let r of this.#A({allowStale:!0})){let n=this.#c[r],o=this.#u[r],i=this.#E(o)?o.__staleWhileFetching:o;if(void 0===i||void 0===n)continue;let s={value:i};if(this.#_&&this.#b){s.ttl=this.#_[r];let e=t.now()-this.#b[r];s.start=Math.floor(Date.now()-e)}this.#y&&(s.size=this.#y[r]),e.unshift([n,s])}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let e=Date.now()-n.start;n.start=t.now()-e}this.set(r,n.value,n)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;let{ttl:n=this.ttl,start:o,noDisposeOnSet:i=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r,{noUpdateTTL:l=this.noUpdateTTL}=r,c=this.#M(e,t,r.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#C(e,"set"),this;let u=0===this.#s?void 0:this.#l.get(e);if(void 0===u)u=0===this.#s?this.#p:0!==this.#m.length?this.#m.pop():this.#s===this.#e?this.#D(!1):this.#s,this.#c[u]=e,this.#u[u]=t,this.#l.set(e,u),this.#f[this.#p]=u,this.#h[u]=this.#p,this.#p=u,this.#s++,this.#L(u,c,a),a&&(a.set="add"),l=!1;else{this.#I(u);let r=this.#u[u];if(t!==r){if(this.#w&&this.#E(r)){r.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:t}=r;void 0!==t&&!i&&(this.#v&&this.#r?.(t,e,"set"),this.#S&&this.#g?.push([t,e,"set"]))}else i||(this.#v&&this.#r?.(r,e,"set"),this.#S&&this.#g?.push([r,e,"set"]));if(this.#j(u),this.#L(u,c,a),this.#u[u]=t,a){a.set="replace";let e=r&&this.#E(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0!==n&&!this.#_&&this.#x(),this.#_&&(l||this.#T(u,n,o),a&&this.#N(a,u)),!i&&this.#S&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}return this}pop(){try{for(;this.#s;){let e=this.#u[this.#d];if(this.#D(!0),this.#E(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#S&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}}}#D(e){let t=this.#d,r=this.#c[t],n=this.#u[t];return this.#w&&this.#E(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#S)&&(this.#v&&this.#r?.(n,r,"evict"),this.#S&&this.#g?.push([n,r,"evict"])),this.#j(t),e&&(this.#c[t]=void 0,this.#u[t]=void 0,this.#m.push(t)),1===this.#s?(this.#d=this.#p=0,this.#m.length=0):this.#d=this.#f[t],this.#l.delete(r),this.#s--,t}has(e,t={}){let{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,o=this.#l.get(e);if(void 0!==o){let e=this.#u[o];if(this.#E(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#$(o))return r&&this.#R(o),n&&(n.has="hit",this.#N(n,o)),!0;n&&(n.has="stale",this.#N(n,o))}else n&&(n.has="miss");return!1}peek(e,t={}){let{allowStale:r=this.allowStale}=t,n=this.#l.get(e);if(void 0===n||!r&&this.#$(n))return;let o=this.#u[n];return this.#E(o)?o.__staleWhileFetching:o}#k(e,t,r,n){let o=void 0===t?void 0:this.#u[t];if(this.#E(o))return o;let s=new i,{signal:a}=r;a?.addEventListener("abort",()=>s.abort(a.reason),{signal:s.signal});let l={signal:s.signal,options:r,context:n},c=(n,o=!1)=>{let{aborted:i}=s.signal,a=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(i&&!o?(r.status.fetchAborted=!0,r.status.fetchError=s.signal.reason,a&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),i&&!a&&!o)return u(s.signal.reason);let c=f;return this.#u[t]===f&&(void 0===n?c.__staleWhileFetching?this.#u[t]=c.__staleWhileFetching:this.#C(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,l.options))),n},u=n=>{let{aborted:o}=s.signal,i=o&&r.allowStaleOnFetchAbort,a=i||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,c=f;if(this.#u[t]===f&&(l&&void 0!==c.__staleWhileFetching?i||(this.#u[t]=c.__staleWhileFetching):this.#C(e,"fetch")),a)return r.status&&void 0!==c.__staleWhileFetching&&(r.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw n};r.status&&(r.status.fetchDispatched=!0);let f=new Promise((t,n)=>{let i=this.#o?.(e,o,l);i&&i instanceof Promise&&i.then(e=>t(void 0===e?void 0:e),n),s.signal.addEventListener("abort",()=>{(!r.ignoreFetchAbort||r.allowStaleOnFetchAbort)&&(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})}).then(c,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e))),h=Object.assign(f,{__abortController:s,__staleWhileFetching:o,__returned:void 0});return void 0===t?(this.set(e,h,{...l.options,status:void 0}),t=this.#l.get(e)):this.#u[t]=h,h}#E(e){if(!this.#w)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof i}async fetch(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,ttl:i=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:m=!1,status:g,signal:y}=t;if(!this.#w)return g&&(g.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,status:g});let b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:o,ttl:i,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:d,ignoreFetchAbort:h,status:g,signal:y},_=this.#l.get(e);if(void 0===_){g&&(g.fetch="miss");let t=this.#k(e,_,b,p);return t.__returned=t}{let t=this.#u[_];if(this.#E(t)){let e=r&&void 0!==t.__staleWhileFetching;return g&&(g.fetch="inflight",e&&(g.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}let o=this.#$(_);if(!m&&!o)return g&&(g.fetch="hit"),this.#I(_),n&&this.#R(_),g&&this.#N(g,_),t;let i=this.#k(e,_,b,p),s=void 0!==i.__staleWhileFetching&&r;return g&&(g.fetch=o?"stale":"refresh",s&&o&&(g.returnedStale=!0)),s?i.__staleWhileFetching:i.__returned=i}}async forceFetch(e,t={}){let r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){let r=this.#i;if(!r)throw new Error("no memoMethod provided to constructor");let{context:n,forceRefresh:o,...i}=t,s=this.get(e,i);if(!o&&void 0!==s)return s;let a=r(e,s,{options:i,context:n});return this.set(e,a,i),a}get(e,t={}){let{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:o=this.noDeleteOnStaleGet,status:i}=t,s=this.#l.get(e);if(void 0!==s){let t=this.#u[s],a=this.#E(t);return i&&this.#N(i,s),this.#$(s)?(i&&(i.get="stale"),a?(i&&r&&void 0!==t.__staleWhileFetching&&(i.returnedStale=!0),r?t.__staleWhileFetching:void 0):(o||this.#C(e,"expire"),i&&r&&(i.returnedStale=!0),r?t:void 0)):(i&&(i.get="hit"),a?t.__staleWhileFetching:(this.#I(s),n&&this.#R(s),t))}i&&(i.get="miss")}#B(e,t){this.#h[t]=e,this.#f[e]=t}#I(e){e!==this.#p&&(e===this.#d?this.#d=this.#f[e]:this.#B(this.#h[e],this.#f[e]),this.#B(this.#p,e),this.#p=e)}delete(e){return this.#C(e,"delete")}#C(e,t){let r=!1;if(0!==this.#s){let n=this.#l.get(e);if(void 0!==n)if(r=!0,1===this.#s)this.#F(t);else{this.#j(n);let r=this.#u[n];if(this.#E(r)?r.__abortController.abort(new Error("deleted")):(this.#v||this.#S)&&(this.#v&&this.#r?.(r,e,t),this.#S&&this.#g?.push([r,e,t])),this.#l.delete(e),this.#c[n]=void 0,this.#u[n]=void 0,n===this.#p)this.#p=this.#h[n];else if(n===this.#d)this.#d=this.#f[n];else{let e=this.#h[n];this.#f[e]=this.#f[n];let t=this.#f[n];this.#h[t]=this.#h[n]}this.#s--,this.#m.push(n)}}if(this.#S&&this.#g?.length){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}return r}clear(){return this.#F("delete")}#F(e){for(let t of this.#P({allowStale:!0})){let r=this.#u[t];if(this.#E(r))r.__abortController.abort(new Error("deleted"));else{let n=this.#c[t];this.#v&&this.#r?.(r,n,e),this.#S&&this.#g?.push([r,n,e])}}if(this.#l.clear(),this.#u.fill(void 0),this.#c.fill(void 0),this.#_&&this.#b&&(this.#_.fill(0),this.#b.fill(0)),this.#y&&this.#y.fill(0),this.#d=0,this.#p=0,this.#m.length=0,this.#a=0,this.#s=0,this.#S&&this.#g){let e,t=this.#g;for(;e=t?.shift();)this.#n?.(...e)}}};e.LRUCache=d}),br=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.NumberAllocator=void 0,e.NumberAllocator=class{used;min;max;lowWaterMark;constructor(e,t){this.min=e,this.max=t,this.used=new Set,this.lowWaterMark=e}firstVacant(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return e;return null}alloc(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return this.used.add(e),this.lowWaterMark=e+1,e;return null}use(e){return!(e<this.min||e>this.max||this.used.has(e)||(this.used.add(e),0))}free(e){e<this.min||e>this.max||(this.used.delete(e),e<this.lowWaterMark&&(this.lowWaterMark=e))}clear(){this.used.clear(),this.lowWaterMark=this.min}}}),_r=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0});var t=yr(),r=br();e.default=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new t.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new r.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){let t=this.topicToAlias[e];return typeof t<"u"&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}}),vr=l(e=>{f(),ot(),We();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=gr(),n=t(_r()),o=dr();e.default=(e,t,i)=>{e.log("_handleConnack");let{options:s}=e,a=5===s.protocolVersion?t.reasonCode:t.returnCode;if(e.connackReceived){let t=new o.ErrorWithReasonCode("Protocol error: duplicate CONNACK on the same network connection",130);return i?.discardParsedPackets(),e._cleanUp(!0),void e.emit("error",t)}if(e.connackReceived=!0,clearTimeout(e.connackTimer),delete e.topicAliasSend,e._serverProperties=t.properties,t.properties&&t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return i?.discardParsedPackets(),e._cleanUp(!0),void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new n.default(t.properties.topicAliasMaximum))}if(0===a)e.reconnecting=!1,e._onConnect(t);else if(a>0){e.log("_handleConnack :: connection refused with reason code %d",a);let t=new o.ErrorWithReasonCode(`Connection refused: ${r.ReasonCodes[a]}`,a);i?.discardParsedPackets(),e.reconnectSuppressed=!0,e._cleanUp(!0);try{e.emit("error",t)}finally{s.reconnectOnConnackError&&(e.reconnectSuppressed=!1,e._setupReconnect())}}}}),wr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=(e,t,r)=>{e.log("handling pubrel packet");let n=typeof r<"u"?r:e.noop,{messageId:o}=t,i={cmd:"pubcomp",messageId:o};e.incomingStore.get(t,(t,r)=>{t?e._sendPacket(i,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._releaseIncomingQoS2Publish(o),e._sendPacket(i,n)}))})}}),Sr=l(e=>{f(),ot(),We();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(pr()),n=t(mr()),o=t(vr()),i=t(gr()),s=t(wr()),a=dr();e.default=(e,t,l,c)=>{let{options:u}=e,f=u.properties?.maximumPacketSize,h=(e=>1+(e=>e<128?1:e<16384?2:e<2097152?3:4)(e)+e)(t.length);if(5===u.protocolVersion&&f&&f<h)return e.log("_handlePacket :: %s packet of %d bytes exceeds the advertised maximumPacketSize %d",t.cmd,h,f),c?.discardParsedPackets(),e._cleanUp(!0),l(),e.emit("error",new a.ErrorWithReasonCode(`exceeding packets size ${t.cmd}: ${h} bytes, maximumPacketSize is ${f}`,149)),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,r.default)(e,t,l,c);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing();try{(0,i.default)(e,t)}finally{l()}break;case"pubrel":e.reschedulePing(),(0,s.default)(e,t,l);break;case"connack":try{(0,o.default)(e,t,c)}finally{l()}break;case"auth":e.reschedulePing();try{(0,n.default)(e,t,c)}finally{l()}break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),l();break;case"disconnect":e.emit("disconnect",t),l();break;default:e.log("_handlePacket :: unknown command"),l()}}}),Er=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){let e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}}),kr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.default=class{aliasToTopic;max;length;constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}}),Ir=l(e=>{f(),ot(),We();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((St(),u(ct))),n=dr(),o=class{};e.TypedEventEmitter=o,(0,n.applyMixin)(o,r.default)}),Ar=l((e,t)=>{var n,o;f(),ot(),We(),n=e,o=function(e){var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,o=2*n,i=new WeakMap,s=function(e,t){return function(i){var s=t.get(i),a=void 0===s?i.size:s<o?s+1:0;if(!i.has(a))return e(i,a);if(i.size<n){for(;i.has(a);)a=Math.floor(Math.random()*o);return e(i,a)}if(i.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;i.has(a);)a=Math.floor(Math.random()*r);return e(i,a)}}((t=i,function(e,r){return t.set(e,r),r}),i),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(s);e.addUniqueNumber=a,e.generateUniqueNumber=s},"object"==typeof e&&typeof t<"u"?o(e):"function"==typeof define&&r.amdO?define(["exports"],o):o((n=typeof globalThis<"u"?globalThis:n||self).fastUniqueNumbers={})}),Pr=l((e,t)=>{function r(e){return t.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.__esModule=!0,t.exports.default=t.exports,r(e)}f(),ot(),We(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),$r=l((e,t)=>{f(),ot(),We();var r=Pr().default;t.exports=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},t.exports.__esModule=!0,t.exports.default=t.exports}),Or=l((e,t)=>{f(),ot(),We();var r=Pr().default,n=$r();t.exports=function(e){var t=n(e,"string");return"symbol"==r(t)?t:t+""},t.exports.__esModule=!0,t.exports.default=t.exports}),xr=l((e,t)=>{f(),ot(),We();var r=Or();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}),Tr=l((e,t)=>{f(),ot(),We(),t.exports=function(e){if(Array.isArray(e))return e},t.exports.__esModule=!0,t.exports.default=t.exports}),Cr=l((e,t)=>{f(),ot(),We(),t.exports=function(e,t){var r=null==e?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,s,a=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}},t.exports.__esModule=!0,t.exports.default=t.exports}),Rr=l((e,t)=>{f(),ot(),We(),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}),Nr=l((e,t)=>{f(),ot(),We();var r=Rr();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}),jr=l((e,t)=>{f(),ot(),We(),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}),Mr=l((e,t)=>{f(),ot(),We();var r=Tr(),n=Cr(),o=Nr(),i=jr();t.exports=function(e,t){return r(e)||n(e,t)||o(e,t)||i()},t.exports.__esModule=!0,t.exports.default=t.exports}),Lr=l((e,t)=>{function r(e,t,r,n,o,i,s){try{var a=e[i](s),l=a.value}catch(e){return void r(e)}a.done?t(l):Promise.resolve(l).then(n,o)}f(),ot(),We(),t.exports=function(e){return function(){var t=this,n=arguments;return new Promise(function(o,i){var s=e.apply(t,n);function a(e){r(s,o,i,a,l,"next",e)}function l(e){r(s,o,i,a,l,"throw",e)}a(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports}),Dr=l((e,t)=>{f(),ot(),We(),t.exports=function(e,t){this.v=e,this.k=t},t.exports.__esModule=!0,t.exports.default=t.exports}),Ur=l((e,t)=>{function r(e,n,o,i){var s=Object.defineProperty;try{s({},"",{})}catch{s=0}t.exports=r=function(e,t,n,o){function i(t,n){r(e,t,function(e){return this._invoke(t,n,e)})}t?s?s(e,t,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[t]=n:(i("next",0),i("throw",1),i("return",2))},t.exports.__esModule=!0,t.exports.default=t.exports,r(e,n,o,i)}f(),ot(),We(),t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}),Br=l((e,t)=>{f(),ot(),We();var r=Ur();function n(){var e,o,i="function"==typeof Symbol?Symbol:{},s=i.iterator||"@@iterator",a=i.toStringTag||"@@toStringTag";function l(t,n,i,s){var a=n&&n.prototype instanceof u?n:u,l=Object.create(a.prototype);return r(l,"_invoke",function(t,r,n){var i,s,a,l=0,u=n||[],f=!1,h={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,s=0,a=e,h.n=r,c}};function d(t,r){for(s=t,a=r,o=0;!f&&l&&!n&&o<u.length;o++){var n,i=u[o],d=h.p,p=i[2];t>3?(n=p===r)&&(a=i[(s=i[4])?5:(s=3,3)],i[4]=i[5]=e):i[0]<=d&&((n=t<2&&d<i[1])?(s=0,h.v=r,h.n=i[1]):d<p&&(n=t<3||i[0]>r||r>p)&&(i[4]=t,i[5]=r,h.n=p,s=0))}if(n||t>1)return c;throw f=!0,r}return function(n,u,p){if(l>1)throw TypeError("Generator is already running");for(f&&1===u&&d(u,p),s=u,a=p;(o=s<2?e:a)||!f;){i||(s?s<3?(s>1&&(h.n=-1),d(s,a)):h.n=a:h.v=a);try{if(l=2,i){if(s||(n="next"),o=i[n]){if(!(o=o.call(i,a)))throw TypeError("iterator result is not an object");if(!o.done)return o;a=o.value,s<2&&(s=0)}else 1===s&&(o=i.return)&&o.call(i),s<2&&(a=TypeError("The iterator does not provide a '"+n+"' method"),s=1);i=e}else if((o=(f=h.n<0)?a:t.call(r,h))!==c)break}catch(t){i=e,s=1,a=t}finally{l=1}}return{value:o,done:f}}}(t,i,s),!0),l}var c={};function u(){}function f(){}function h(){}o=Object.getPrototypeOf;var d=[][s]?o(o([][s]())):(r(o={},s,function(){return this}),o),p=h.prototype=u.prototype=Object.create(d);function m(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,r(e,a,"GeneratorFunction")),e.prototype=Object.create(p),e}return f.prototype=h,r(p,"constructor",h),r(h,"constructor",f),f.displayName="GeneratorFunction",r(h,a,"GeneratorFunction"),r(p),r(p,a,"Generator"),r(p,s,function(){return this}),r(p,"toString",function(){return"[object Generator]"}),(t.exports=n=function(){return{w:l,m}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=n,t.exports.__esModule=!0,t.exports.default=t.exports}),Fr=l((e,t)=>{f(),ot(),We();var r=Dr(),n=Ur();t.exports=function e(t,o){function i(e,n,s,a){try{var l=t[e](n),c=l.value;return c instanceof r?o.resolve(c.v).then(function(e){i("next",e,s,a)},function(e){i("throw",e,s,a)}):o.resolve(c).then(function(e){l.value=e,s(l)},function(e){return i("throw",e,s,a)})}catch(e){a(e)}}var s;this.next||(n(e.prototype),n(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),n(this,"_invoke",function(e,t,r){function n(){return new o(function(t,n){i(e,r,t,n)})}return s=s?s.then(n,n):n()},!0)},t.exports.__esModule=!0,t.exports.default=t.exports}),qr=l((e,t)=>{f(),ot(),We();var r=Br(),n=Fr();t.exports=function(e,t,o,i,s){return new n(r().w(e,t,o,i),s||Promise)},t.exports.__esModule=!0,t.exports.default=t.exports}),Wr=l((e,t)=>{f(),ot(),We();var r=qr();t.exports=function(e,t,n,o,i){var s=r(e,t,n,o,i);return s.next().then(function(e){return e.done?e.value:s.next()})},t.exports.__esModule=!0,t.exports.default=t.exports}),Vr=l((e,t)=>{f(),ot(),We(),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}),zr=l((e,t)=>{f(),ot(),We();var r=Pr().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}),Kr=l((e,t)=>{f(),ot(),We();var r=Dr(),n=Br(),o=Wr(),i=qr(),s=Fr(),a=Vr(),l=zr();function c(){var e=n(),u=e.m(c),f=(Object.getPrototypeOf?Object.getPrototypeOf(u):u.__proto__).constructor;function h(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))}var d={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,d[e],t)},delegateYield:function(e,o,i){return t.resultName=o,r(n.d,l(e),i)},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(t.exports=c=function(){return{wrap:function(t,r,n,o){return e.w(p(t),r,n,o&&o.reverse())},isGeneratorFunction:h,mark:e.m,awrap:function(e,t){return new r(e,t)},AsyncIterator:s,async:function(e,t,r,n,s){return(h(t)?i:o)(p(e),t,r,n,s)},keys:a,values:l}},t.exports.__esModule=!0,t.exports.default=t.exports)()}t.exports=c,t.exports.__esModule=!0,t.exports.default=t.exports}),Hr=l((e,t)=>{f(),ot(),We();var r=Kr()();t.exports=r;try{regeneratorRuntime=r}catch{"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}),Gr=l((e,t)=>{var n,o;f(),ot(),We(),n=e,o=function(e,t,r,n,o,i){function s(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function l(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach(function(t){r(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var u,f=function(e,t,o){return function(i){var s=t(i);return function(t){var i=e(t);t.addEventListener("message",function(e){var t=e.data,r=t.id;if(null!==r&&i.has(r)){var n=i.get(r),o=n.reject,s=n.resolve;i.delete(r),void 0===t.error?s(t.result):o(new Error(t.error.message))}}),function(e){return"function"==typeof e.start}(t)&&t.start();for(var l=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return new Promise(function(s,a){var l=o(i);i.set(l,{reject:a,resolve:s}),null===r?t.postMessage({id:l,method:e},n):t.postMessage({id:l,method:e,params:r},n)})},c=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];t.postMessage({id:null,method:e,params:r},n)},u={},f=0,h=Object.entries(s);f<h.length;f++){var d=n(h[f],2),p=d[0],m=d[1];u=a(a({},u),{},r({},p,m({call:l,notify:c})))}return a({},u)}}}((u=new WeakMap,function(e){if(u.has(e))return u.get(e);var t=new Map;return u.set(e,t),t}),function(e){return function(t){return c(c({},t),{},{connect:function(t){var r=t.call;return o(i.mark(function t(){var n,o,s,a;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=new MessageChannel,o=n.port1,s=n.port2,t.next=1,r("connect",{port:o},[o]);case 1:return a=t.sent,e.set(s,a),t.abrupt("return",s);case 2:case"end":return t.stop()}},t)}))},disconnect:function(t){var r,n=t.call;return r=o(i.mark(function t(r){var o;return i.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(void 0!==(o=e.get(r))){t.next=1;break}throw new Error("The given port is not connected.");case 1:return t.next=2,n("disconnect",{portId:o});case 2:case"end":return t.stop()}},t)})),function(e){return r.apply(this,arguments)}},isSupported:function(e){var t=e.call;return function(){return t("isSupported")}}})}}(new WeakMap),t.generateUniqueNumber);e.createBroker=f},"object"==typeof e&&typeof t<"u"?o(e,Ar(),xr(),Mr(),Lr(),Hr()):"function"==typeof define&&r.amdO?define(["exports","fast-unique-numbers","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],o):o((n=typeof globalThis<"u"?globalThis:n||self).brokerFactory={},n.fastUniqueNumbers,n._defineProperty,n._slicedToArray,n._asyncToGenerator,n._regeneratorRuntime)}),Qr=l((e,t)=>{var n,o;f(),ot(),We(),n=e,o=function(e,t,r,n){var o,i=new Map([[0,null]]),s=new Map([[0,null]]),a=(o=i,function(e){return function(t){"symbol"===n(o.get(t))&&(o.set(t,null),e(t).then(function(){o.delete(t)}))}}),l=function(e){return function(t){return function(r){"symbol"===n(e.get(r))&&(e.set(r,null),t(r).then(function(){e.delete(r)}))}}}(s),c=function(e,t){return function(r){return function(n){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length,s=new Array(i>2?i-2:0),a=2;a<i;a++)s[a-2]=arguments[a];var l=Symbol(),c=e(t);t.set(c,l);var u=function(){return r(o,c).then(function(){var e=t.get(c);if(void 0===e)throw new Error("The timer is in an undefined state.");e===l&&(n.apply(void 0,s),t.get(c)===l&&u())})};return u(),c}}}(r.generateUniqueNumber,i),u=function(e,t){return function(r){return function(n){for(var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length,s=new Array(i>2?i-2:0),a=2;a<i;a++)s[a-2]=arguments[a];var l=Symbol(),c=e(t);return t.set(c,l),r(o,c).then(function(){var e=t.get(c);if(void 0===e)throw new Error("The timer is in an undefined state.");e===l&&(t.delete(c),n.apply(void 0,s))}),c}}}(r.generateUniqueNumber,s),f=t.createBroker({clearInterval:function(e){var t=e.call;return a(function(e){return t("clear",{timerId:e,timerType:"interval"})})},clearTimeout:function(e){var t=e.call;return l(function(e){return t("clear",{timerId:e,timerType:"timeout"})})},setInterval:function(e){var t=e.call;return c(function(e,r){return t("set",{delay:e,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"interval"})})},setTimeout:function(e){var t=e.call;return u(function(e,r){return t("set",{delay:e,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"timeout"})})}});e.load=function(e){var t=new Worker(e);return f(t)},e.wrap=f},"object"==typeof e&&typeof t<"u"?o(e,Gr(),Ar(),Pr()):"function"==typeof define&&r.amdO?define(["exports","broker-factory","fast-unique-numbers","@babel/runtime/helpers/typeof"],o):o((n=typeof globalThis<"u"?globalThis:n||self).workerTimersBroker={},n.brokerFactory,n.fastUniqueNumbers,n._typeof)}),Jr=l((e,t)=>{var n,o;f(),ot(),We(),n=e,o=function(e,t){var r,n,o=(r=t.load,n=null,function(){if(null!==n)return n;var e=new Blob(['(()=>{var e={389(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)},623(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))},472(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))},172(e){e.exports=function(e,t){this.v=e,this.k=t},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},987(e){e.exports=function(e){if(Array.isArray(e))return e},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},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},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},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},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},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},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},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){function u(r,n){t(e,r,function(e){return this._invoke(r,n,e)})}r?a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n:(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},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},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},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},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},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},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},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},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)}}},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 o().clearInterval(e)},e.clearTimeout=function(e){return o().clearTimeout(e)},e.setInterval=function(){var e;return(e=o()).setInterval.apply(e,arguments)},e.setTimeout=function(){var e;return(e=o()).setTimeout.apply(e,arguments)}},"object"==typeof e&&typeof t<"u"?o(e,Qr()):"function"==typeof define&&r.amdO?define(["exports","worker-timers-broker"],o):o((n=typeof globalThis<"u"?globalThis:n||self).workerTimers={},n.workerTimersBroker)}),Yr=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.isReactNativeBrowser=e.isWebWorker=void 0;var t=()=>!!("object"==typeof self&&self?.constructor?.name?.includes("WorkerGlobalScope")&&typeof Deno>"u"),r=()=>typeof navigator<"u"&&"ReactNative"===navigator.product,n=typeof window<"u"&&(typeof navigator<"u"&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&h?.versions?!Object.prototype.hasOwnProperty.call(h.versions,"electron"):typeof window.document<"u")||t()||r();e.isWebWorker=t(),e.isReactNativeBrowser=r(),e.default=n}),Xr=l(e=>{f(),ot(),We();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}: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}),o=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var i=t(e),s=0;s<i.length;s++)"default"!==i[s]&&r(o,e,i[s]);return n(o,e),o});Object.defineProperty(e,"__esModule",{value:!0});var i=Jr(),s=o(Yr()),a={set:i.setInterval,clear:i.clearInterval},l={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};e.default=e=>{switch(e){case"native":return l;case"worker":return a;default:return!s.default||s.isWebWorker||s.isReactNativeBrowser?l:a}}}),Zr=l(e=>{f(),ot(),We();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t(Xr());e.default=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,t){this.client=e,this.timer="object"==typeof t&&"set"in t&&"clear"in t?t:(0,r.default)(t),this.setKeepalive(e.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let e=Math.ceil(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,2===this.counter?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}}}),en=l(e=>{f(),ot(),We();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}: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}),o=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var i=t(e),s=0;s<i.length;s++)"default"!==i[s]&&r(o,e,i[s]);return n(o,e),o}),i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var s=i(ar()),a=Ht(),l=i(cr()),c=i(tr()),u=o(ur()),h=i(fr()),d=i(Sr()),p=gr(),m=i(Er()),g=i(kr()),y=dr(),b=Ir(),_=i(Zr()),v=o(Yr()),w=globalThis.setImmediate||((...e)=>{let t=e.shift();(0,y.nextTick)(()=>{t(...e)})}),S=65535,E={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},k=class e extends b.TypedEventEmitter{static VERSION=y.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_incomingQoS2Ids;_receiveMaximum;_deferredReconnect;_currentPump;connackReceived;reconnectSuppressed;_authenticationMethod;connackPacket;_serverProperties;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(t,r){super(),this.options=r||{};for(let e in E)typeof this.options[e]>"u"?this.options[e]=E[e]:this.options[e]=r[e];this.log=this.options.log||(0,c.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",e.VERSION),v.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",v.default?"browser":"node"),this.log("MqttClient :: options.protocol",r.protocol),this.log("MqttClient :: options.protocolVersion",r.protocolVersion),this.log("MqttClient :: options.username",r.username),this.log("MqttClient :: options.keepalive",r.keepalive),this.log("MqttClient :: options.reconnectPeriod",r.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",r.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",r.properties?r.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof r.clientId?r.clientId:e.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===r.protocolVersion&&r.customHandleAcks?r.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(s.default.writeToStream.cacheNumbers=!1),this.streamBuilder=t,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new m.default:this.options.messageIdProvider,this.outgoingStore=r.outgoingStore||new h.default,this.incomingStore=r.incomingStore||new h.default,this._incomingQoS2Ids=new Set,this._receiveMaximum=S;let n=r.properties?.receiveMaximum;void 0!==n&&(Number.isInteger(n)&&n>=1&&n<=S?this._receiveMaximum=n:this.log("MqttClient :: options.properties.receiveMaximum %o is not an integer between 1 and %d, enforcing and advertising %d instead",n,S,S)),this.queueQoSZero=void 0===r.queueQoSZero||r.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.connackReceived=!1,this.reconnectSuppressed=!1,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,r.properties&&r.properties.topicAliasMaximum>0&&(r.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new g.default(r.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:e}=this,t=()=>{let r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let o=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(o=!1)),o?this._sendPacket(n,e=>{r.cb&&r.cb(e),t()}):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this._serverProperties=void 0,this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}_trackIncomingQoS2Publish(e,t,r){return!!this._incomingQoS2Ids.has(e)||(5===this.options.protocolVersion&&this._incomingQoS2Ids.size>=this._receiveMaximum?(this.log("_trackIncomingQoS2Publish :: inbound QoS 2 messages exceeded receiveMaximum %d",this._receiveMaximum),r?.discardParsedPackets(),(!r||r.isCurrent())&&this._cleanUp(!0),t(),this.emit("error",new y.ErrorWithReasonCode(`${p.ReasonCodes[147]}: ${this._incomingQoS2Ids.size+1} inbound QoS 2 messages in flight, receiveMaximum is ${this._receiveMaximum}`,147)),!1):(this._incomingQoS2Ids.add(e),!0))}_releaseIncomingQoS2Publish(e){this._incomingQoS2Ids.delete(e)}_discardIncomingQoS2State(){if(0!==this._incomingQoS2Ids.size){this.log("_discardIncomingQoS2State :: session not resumed, dropping %d inbound QoS 2 message(s)",this._incomingQoS2Ids.size);for(let e of this._incomingQoS2Ids)this.incomingStore.del({messageId:e},this.noop);this._incomingQoS2Ids.clear()}}connect(){let e=new a.Writable,t=s.default.parser(this.options),r=null,n=[],o={discardParsedPackets:()=>{n.length=0},isCurrent:()=>this._currentPump===o};this._currentPump=o,this.connackReceived=!1,this.reconnectSuppressed=!1,this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this._serverProperties=void 0,this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new h.default,this.outgoingStore=this.options.outgoingStore||new h.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),t.on("packet",e=>{this.log("parser :: on packet push to packets array."),n.push(e)});let i=()=>{this.log("work :: getting next packet in queue"),this._currentPump!==o&&(this.log("work :: pump superseded, dropping %d queued packets",n.length),n.length=0);let e=n.shift();if(e)this.log("work :: packet pulled from queue"),(0,d.default)(this,e,l,o);else{this.log("work :: no packets in queue");let e=r;r=null,this.log("work :: done flag is %s",!!e),e&&e()}},l=()=>{if(n.length)(0,y.nextTick)(i);else{let e=r;r=null,e&&e()}};e._write=(e,n,o)=>{r=o,this.log("writable stream :: parsing buffer"),t.parse(e),i()},this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",e=>{this.log("streamErrorHandler :: error",e.message),e.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)}),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");let 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?{...this.options.properties}:void 0};if(void 0!==c.properties?.receiveMaximum&&(c.properties.receiveMaximum=this._receiveMaximum),this.options.will&&(c.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(c.properties||(c.properties={}),this.topicAliasRecv&&(c.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._authenticationMethod=c.properties?.authenticationMethod,this._writePacket(c),t.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){let e={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>this._onConnackTimeout(),this.options.connectTimeout),this}_onConnackTimeout(){this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0),this.emit("error",new Error("connack timeout"))}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);let{options:o}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r={qos:0,retain:!1,dup:!1,...r};let{qos:i,retain:s,dup:a,properties:l,cbStorePut:c}=r;if(this._checkDisconnecting(n))return this;let u=()=>{let r=0;if((1===i||2===i)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;let u={cmd:"publish",topic:e,payload:t,qos:i,retain:s,messageId:r,dup:a};switch(5===o.protocolVersion&&(u.properties=l),this.log("publish :: qos",i),i){case 1:case 2:this.outgoing[u.messageId]={volatile:!1,cmd:"publish",cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,void 0,c);break;default:this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,n,c)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!u())&&this._storeProcessingQueue.push({invoke:u,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise((n,o)=>{this.publish(e,t,r,(e,t)=>{e?o(e):n(t)})})}subscribe(e,t,r){let n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let o=!1,i=[];"string"==typeof e?i=e=[e]:Array.isArray(e)?i=e:"object"==typeof e&&(o=e.resubscribe,delete e.resubscribe,i=Object.keys(e));let s=u.validateTopics(i);if(null!==s)return w(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;let a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0),t={...a,...t};let{properties:l}=t,c=[],f=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||o){let t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),c.push(t)}};if(Array.isArray(e)?e.forEach(e=>{this.log("subscribe: array topic %s",e),f(e)}):Object.keys(e).forEach(t=>{this.log("subscribe: object topic %s, %o",t,e[t]),f(t,e[t])}),!c.length)return r(null,[]),this;let h=(e,t)=>{let r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");let t=[];e.forEach(e=>{if(this.options.reconnectPeriod>0){let r={qos:e.qos};5===n&&(r.nl=e.nl||!1,r.rap=e.rap||!1,r.rh=e.rh||0,r.properties=e.properties),this._resubscribeTopics[e.topic]=r,t.push(e.topic)}}),this.messageIdToTopic[r.messageId]=t}let o=new Promise((t,n)=>{this.outgoing[r.messageId]={volatile:!0,cmd:"subscribe",cb:(r,o)=>{if(r)return void n(new y.ErrorWithSubackPacket(r.message,o));let{granted:i}=o;if(i.length!==e.length)return n(new y.ErrorWithSubackPacket(`Protocol error: suback granted ${i.length} reason code(s) for ${e.length} subscription(s)`,o)),void this._cleanUp(!0);for(let t=0;t<i.length;t+=1)e[t].qos=i[t];t(o)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(r),o},d=()=>{let e=this.options.subscribeBatchSize??c.length,t=[];for(let r=0;r<c.length;r+=e){let n=c.slice(r,r+e),o=this._nextId();if(null===o)return this.log("No messageId left"),!1;t.push(h(n,o))}return Promise.all(t).then(e=>{r(null,c,e.at(-1))}).catch(e=>{r(e,c,e.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!d())&&this._storeProcessingQueue.push({invoke:d,callback:r}),this}subscribeAsync(e,t){return new Promise((r,n)=>{this.subscribe(e,t,(e,t)=>{e?n(e):r(t)})})}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;let n=u.validateTopics(e);if(null!==n)return w(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;let o=()=>{let n=this._nextId();if(null===n)return this.log("No messageId left"),!1;let o={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?o.unsubscriptions=[e]:Array.isArray(e)&&(o.unsubscriptions=e),this.options.resubscribe&&o.unsubscriptions.forEach(e=>{delete this._resubscribeTopics[e]}),"object"==typeof t&&t.properties&&(o.properties=t.properties),this.outgoing[o.messageId]={volatile:!0,cmd:"unsubscribe",cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(o),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!o())&&this._storeProcessingQueue.push({invoke:o,callback:r}),this}unsubscribeAsync(e,t){return new Promise((r,n)=>{this.unsubscribe(e,t,(e,t)=>{e?n(e):r(t)})})}end(e,t,r){this.log("end :: (%s)",this.options.clientId),(null==e||"boolean"!=typeof e)&&(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),(!r||"function"!=typeof r)&&(r=this.noop);let n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this._incomingQoS2Ids.clear(),this.incomingStore.close(e=>{this.outgoingStore.close(t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){let n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}})}),this._deferredReconnect?this._deferredReconnect():(0===this.options.reconnectPeriod||this.options.manualConnect)&&(this.disconnecting=!1)},o=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,y.nextTick)(n)},t)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,o,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),o()),this)}endAsync(e,t){return new Promise((r,n)=>{this.end(e,t,e=>{e?n(e):r()})})}removeOutgoingMessage(e){if(this.outgoing[e]){let{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{t(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");let t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new h.default,this.outgoingStore=this.options.outgoingStore||new h.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(typeof t>"u")return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),typeof r>"u")return new Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectSuppressed&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let e={cmd:"disconnect",...r};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),w(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}!this.disconnecting&&!this.reconnecting&&(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,o=e;if("publish"===o.cmd&&(o=(0,l.default)(e),n=this._removeTopicAliasAndRecoverTopicName(o),n))return t&&t(n);this.outgoingStore.put(o,n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)})}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");let r=s.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;let o=this._applyTopicAlias(e);if(o)t(o);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,l.default)(e);let r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}let 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,e=>{if(e)return t&&t(e);r()})):t&&t(new Error("No connection to broker"))}get serverProperties(){return this._serverProperties}get keepalive(){let e=this.connected?this._serverProperties?.serverKeepAlive:void 0;return e&&this.options.keepalive?e:this.options.keepalive}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.keepalive),!this.keepaliveManager&&this.keepalive&&(this.keepaliveManager=new _.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(e=!1){this.keepaliveManager&&this.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0),this.emit("error",new Error("Keepalive timeout"))}_resubscribe(){this.log("_resubscribe");let e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){let r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,!this.options.clean&&(this.options.protocolVersion<4||!0===e.sessionPresent)||this._discardIncomingQoS2State(),this.messageIdProvider.clear(),this.connected=!0,this._setupKeepaliveManager();let t=()=>{let r=this.outgoingStore.createStream(),n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),o()},o=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",e=>{o(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)});let i=()=>{if(!r)return;let e,t=r.read(1);t?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[t.messageId]?i():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(e=this.outgoing[t.messageId]?this.outgoing[t.messageId].cb:null,this.outgoing[t.messageId]={volatile:!1,cmd:t.cmd,cb(t,r){e&&e(t,r),i()}},this._packetIdsDuringStoreProcessing[t.messageId]=!0,this.messageIdProvider.register(t.messageId)?this._sendPacket(t,void 0,void 0,!0):this.log("messageId: %d has already used.",t.messageId))):r.once("readable",i)};r.on("end",()=>{let r=!0;for(let e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(o(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()}),i()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}};e.default=k}),tn=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0});var t=br();e.default=class{numberAllocator;lastId;constructor(){this.numberAllocator=new t.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e)}clear(){this.numberAllocator.clear()}}}),rn=a(()=>{f(),ot(),We(),_t={},vt=!1,(wt=function(){if(vt)return _t;vt=!0;let e=2147483647,t=36,r=/^xn--/,n=/[^\0-\x7F]/,o=/[\x2E\u3002\uFF0E\uFF61]/g,i={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},s=Math.floor,a=String.fromCharCode;function l(e){throw new RangeError(i[e])}function c(e,t){let r=e.split("@"),n="";r.length>1&&(n=r[0]+"@",e=r[1]);let i=function(e,t){let r=[],n=e.length;for(;n--;)r[n]=t(e[n]);return r}((e=e.replace(o,".")).split("."),t).join(".");return n+i}function u(e){let t=[],r=0,n=e.length;for(;r<n;){let o=e.charCodeAt(r++);if(o>=55296&&o<=56319&&r<n){let n=e.charCodeAt(r++);56320==(64512&n)?t.push(((1023&o)<<10)+(1023&n)+65536):(t.push(o),r--)}else t.push(o)}return t}let f=function(e){return e>=48&&e<58?e-48+26:e>=65&&e<91?e-65:e>=97&&e<123?e-97:t},h=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},d=function(e,r,n){let o=0;for(e=n?s(e/700):e>>1,e+=s(e/r);e>455;o+=t)e=s(e/35);return s(o+36*e/(e+38))},p=function(r){let n=[],o=r.length,i=0,a=128,c=72,u=r.lastIndexOf("-");u<0&&(u=0);for(let e=0;e<u;++e)r.charCodeAt(e)>=128&&l("not-basic"),n.push(r.charCodeAt(e));for(let h=u>0?u+1:0;h<o;){let u=i;for(let n=1,a=t;;a+=t){h>=o&&l("invalid-input");let u=f(r.charCodeAt(h++));u>=t&&l("invalid-input"),u>s((e-i)/n)&&l("overflow"),i+=u*n;let d=a<=c?1:a>=c+26?26:a-c;if(u<d)break;let p=t-d;n>s(e/p)&&l("overflow"),n*=p}let p=n.length+1;c=d(i-u,p,0==u),s(i/p)>e-a&&l("overflow"),a+=s(i/p),i%=p,n.splice(i++,0,a)}return String.fromCodePoint(...n)},m=function(r){let n=[],o=(r=u(r)).length,i=128,c=0,f=72;for(let e of r)e<128&&n.push(a(e));let p=n.length,m=p;for(p&&n.push("-");m<o;){let o=e;for(let e of r)e>=i&&e<o&&(o=e);let u=m+1;o-i>s((e-c)/u)&&l("overflow"),c+=(o-i)*u,i=o;for(let o of r)if(o<i&&++c>e&&l("overflow"),o===i){let e=c;for(let r=t;;r+=t){let o=r<=f?1:r>=f+26?26:r-f;if(e<o)break;let i=e-o,l=t-o;n.push(a(h(o+i%l,0))),e=s(i/l)}n.push(a(h(e,0))),f=d(c,u,m===p),c=0,++m}++c,++i}return n.join("")};return _t={version:"2.3.1",ucs2:{decode:u,encode:e=>String.fromCodePoint(...e)},decode:p,encode:m,toASCII:function(e){return c(e,function(e){return n.test(e)?"xn--"+m(e):e})},toUnicode:function(e){return c(e,function(e){return r.test(e)?p(e.slice(4).toLowerCase()):e})}}}()).decode,wt.encode,wt.toASCII,wt.toUnicode,wt.ucs2,wt.version});function nn(){return Sn||(Sn=!0,wn=SyntaxError),wn}function on(){return kn||(kn=!0,En=TypeError),En}function sn(){if(Nn)return Rn;Nn=!0;var e=function(){if(Cn)return Tn;Cn=!0;var e=Object.prototype.toString,t=Math.max,r=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var o=0;o<t.length;o+=1)r[o+e.length]=t[o];return r};return Tn=function(n){var o=this;if("function"!=typeof o||"[object Function]"!==e.apply(o))throw new TypeError("Function.prototype.bind called on incompatible "+o);for(var i,s=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),a=t(0,o.length-s.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof i){var e=o.apply(this,r(s,arguments));return Object(e)===e?e:this}return o.apply(n,r(s,arguments))}),o.prototype){var u=function(){};u.prototype=o.prototype,i.prototype=new u,u.prototype=null}return i},Tn}();return Rn=Function.prototype.bind||e}function an(){if(Dn)return Ln;Dn=!0;var e,t=(pn||(pn=!0,dn=Error),dn),r=(gn||(gn=!0,mn=EvalError),mn),n=(bn||(bn=!0,yn=RangeError),yn),o=(vn||(vn=!0,_n=ReferenceError),_n),i=nn(),s=on(),a=(An||(An=!0,In=URIError),In),l=Function,c=function(e){try{return l('"use strict"; return ('+e+").constructor;")()}catch{}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch{u=null}var f=function(){throw new s},h=u?function(){try{return f}catch{try{return u(arguments,"callee").get}catch{return f}}}():f,d=function(){if($n)return Pn;$n=!0;var e=typeof Symbol<"u"&&Symbol,t=(hn||(hn=!0,fn=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}),fn);return Pn=function(){return"function"==typeof e&&"function"==typeof Symbol&&"symbol"==typeof e("foo")&&"symbol"==typeof Symbol("bar")&&t()}}()(),p=function(){if(xn)return On;xn=!0;var e={__proto__:null,foo:{}},t=Object;return On=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof t)}}()(),m=Object.getPrototypeOf||(p?function(e){return e.__proto__}:null),g={},y=typeof Uint8Array>"u"||!m?e:m(Uint8Array),b={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?e:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?e:ArrayBuffer,"%ArrayIteratorPrototype%":d&&m?m([][Symbol.iterator]()):e,"%AsyncFromSyncIteratorPrototype%":e,"%AsyncFunction%":g,"%AsyncGenerator%":g,"%AsyncGeneratorFunction%":g,"%AsyncIteratorPrototype%":g,"%Atomics%":typeof Atomics>"u"?e:Atomics,"%BigInt%":typeof BigInt>"u"?e:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?e:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?e:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?e:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":t,"%eval%":eval,"%EvalError%":r,"%Float32Array%":typeof Float32Array>"u"?e:Float32Array,"%Float64Array%":typeof Float64Array>"u"?e:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?e:FinalizationRegistry,"%Function%":l,"%GeneratorFunction%":g,"%Int8Array%":typeof Int8Array>"u"?e:Int8Array,"%Int16Array%":typeof Int16Array>"u"?e:Int16Array,"%Int32Array%":typeof Int32Array>"u"?e:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":d&&m?m(m([][Symbol.iterator]())):e,"%JSON%":"object"==typeof JSON?JSON:e,"%Map%":typeof Map>"u"?e:Map,"%MapIteratorPrototype%":typeof Map>"u"||!d||!m?e:m((new Map)[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?e:Promise,"%Proxy%":typeof Proxy>"u"?e:Proxy,"%RangeError%":n,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?e:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?e:Set,"%SetIteratorPrototype%":typeof Set>"u"||!d||!m?e:m((new Set)[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?e:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":d&&m?m(""[Symbol.iterator]()):e,"%Symbol%":d?Symbol:e,"%SyntaxError%":i,"%ThrowTypeError%":h,"%TypedArray%":y,"%TypeError%":s,"%Uint8Array%":typeof Uint8Array>"u"?e:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?e:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?e:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?e:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?e:WeakMap,"%WeakRef%":typeof WeakRef>"u"?e:WeakRef,"%WeakSet%":typeof WeakSet>"u"?e:WeakSet};if(m)try{null.error}catch(e){var _=m(m(e));b["%Error.prototype%"]=_}var v=function e(t){var r;if("%AsyncFunction%"===t)r=c("async function () {}");else if("%GeneratorFunction%"===t)r=c("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=c("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&m&&(r=m(o.prototype))}return b[t]=r,r},w={__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=sn(),E=function(){if(Mn)return jn;Mn=!0;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,r=sn();return jn=r.call(e,t)}(),k=S.call(Function.call,Array.prototype.concat),I=S.call(Function.apply,Array.prototype.splice),A=S.call(Function.call,String.prototype.replace),P=S.call(Function.call,String.prototype.slice),$=S.call(Function.call,RegExp.prototype.exec),O=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,x=/\\(\\)?/g,T=function(e,t){var r,n=e;if(E(w,n)&&(n="%"+(r=w[n])[0]+"%"),E(b,n)){var o=b[n];if(o===g&&(o=v(n)),typeof o>"u"&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+e+" does not exist!")};return Ln=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===$(/^%?[^%]*%?$/,e))throw new i("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=P(e,0,1),r=P(e,-1);if("%"===t&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return A(e,O,function(e,t,r,o){n[n.length]=r?A(o,x,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",o=T("%"+n+"%",t),a=o.name,l=o.value,c=!1,f=o.alias;f&&(n=f[0],I(r,k([0,1],f)));for(var h=1,d=!0;h<r.length;h+=1){var p=r[h],m=P(p,0,1),g=P(p,-1);if(('"'===m||"'"===m||"`"===m||'"'===g||"'"===g||"`"===g)&&m!==g)throw new i("property names with quotes must have matching quotes");if(("constructor"===p||!d)&&(c=!0),E(b,a="%"+(n+="."+p)+"%"))l=b[a];else if(null!=l){if(!(p in l)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(u&&h+1>=r.length){var y=u(l,p);l=(d=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:l[p]}else d=E(l,p),l=l[p];d&&!c&&(b[a]=l)}}return l},Ln}function ln(){if(Bn)return Un;Bn=!0;var e=an()("%Object.defineProperty%",!0)||!1;if(e)try{e({},"a",{value:1})}catch{e=!1}return Un=e}function cn(){if(qn)return Fn;qn=!0;var e=an()("%Object.getOwnPropertyDescriptor%",!0);if(e)try{e([],"length")}catch{e=null}return Fn=e}function un(){if(Xn)return Yn;Xn=!0;var e=an(),t=function(){if(Jn)return Qn;Jn=!0;var e=sn(),t=an(),r=function(){if(Gn)return Hn;Gn=!0;var e=an(),t=function(){if(Vn)return Wn;Vn=!0;var e=ln(),t=nn(),r=on(),n=cn();return Wn=function(o,i,s){if(!o||"object"!=typeof o&&"function"!=typeof o)throw new r("`obj` must be an object or a function`");if("string"!=typeof i&&"symbol"!=typeof i)throw new r("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new r("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new r("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new r("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new r("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],f=!!n&&n(o,i);if(e)e(o,i,{configurable:null===c&&f?f.configurable:!c,enumerable:null===a&&f?f.enumerable:!a,value:s,writable:null===l&&f?f.writable:!l});else{if(!u&&(a||l||c))throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");o[i]=s}},Wn}(),r=function(){if(Kn)return zn;Kn=!0;var e=ln(),t=function(){return!!e};return t.hasArrayLengthDefineBug=function(){if(!e)return null;try{return 1!==e([],"length",{value:1}).length}catch{return!0}},zn=t}()(),n=cn(),o=on(),i=e("%Math.floor%");return Hn=function(e,s){if("function"!=typeof e)throw new o("`fn` is not a function");if("number"!=typeof s||s<0||s>4294967295||i(s)!==s)throw new o("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],l=!0,c=!0;if("length"in e&&n){var u=n(e,"length");u&&!u.configurable&&(l=!1),u&&!u.writable&&(c=!1)}return(l||c||!a)&&(r?t(e,"length",s,!0,!0):t(e,"length",s)),e},Hn}(),n=on(),o=t("%Function.prototype.apply%"),i=t("%Function.prototype.call%"),s=t("%Reflect.apply%",!0)||e.call(i,o),a=ln(),l=t("%Math.max%");Qn=function(t){if("function"!=typeof t)throw new n("a function is required");var o=s(e,i,arguments);return r(o,1+l(0,t.length-(arguments.length-1)),!0)};var c=function(){return s(e,o,arguments)};return a?a(Qn,"apply",{value:c}):Qn.apply=c,Qn}(),r=t(e("String.prototype.indexOf"));return Yn=function(n,o){var i=e(n,!!o);return"function"==typeof i&&r(n,".prototype.")>-1?t(i):i}}var fn,hn,dn,pn,mn,gn,yn,bn,_n,vn,wn,Sn,En,kn,In,An,Pn,$n,On,xn,Tn,Cn,Rn,Nn,jn,Mn,Ln,Dn,Un,Bn,Fn,qn,Wn,Vn,zn,Kn,Hn,Gn,Qn,Jn,Yn,Xn,Zn=a(()=>{f(),ot(),We(),fn={},hn=!1,dn={},pn=!1,mn={},gn=!1,yn={},bn=!1,_n={},vn=!1,wn={},Sn=!1,En={},kn=!1,In={},An=!1,Pn={},$n=!1,On={},xn=!1,Tn={},Cn=!1,Rn={},Nn=!1,jn={},Mn=!1,Ln={},Dn=!1,Un={},Bn=!1,Fn={},qn=!1,Wn={},Vn=!1,zn={},Kn=!1,Hn={},Gn=!1,Qn={},Jn=!1,Yn={},Xn=!1});function eo(e){throw new Error("Node.js process "+e+" is not supported by JSPM core outside of Node.js")}function to(){!bo||!_o||(bo=!1,_o.length?yo=_o.concat(yo):vo=-1,yo.length&&ro())}function ro(){if(!bo){var e=setTimeout(to,0);bo=!0;for(var t=yo.length;t;){for(_o=yo,yo=[];++vo<t;)_o&&_o[vo].run();vo=-1,t=yo.length}_o=null,bo=!1,clearTimeout(e)}}function no(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];yo.push(new oo(e,t)),1===yo.length&&!bo&&setTimeout(ro,0)}function oo(e,t){this.fun=e,this.array=t}function io(){}function so(e){eo("_linkedBinding")}function ao(e){eo("dlopen")}function lo(){return[]}function co(){return[]}function uo(e,t){if(!e)throw new Error(t||"assertion error")}function fo(){return!1}function ho(){return ti.now()/1e3}function po(e){var t=Math.floor(.001*(Date.now()-ti.now())),r=.001*ti.now(),n=Math.floor(r)+t,o=Math.floor(r%1*1e9);return e&&(n-=e[0],(o-=e[1])<0&&(n--,o+=ni)),[n,o]}function mo(){return oi}function go(e){return[]}var yo,bo,_o,vo,wo,So,Eo,ko,Io,Ao,Po,$o,Oo,xo,To,Co,Ro,No,jo,Mo,Lo,Do,Uo,Bo,Fo,qo,Wo,Vo,zo,Ko,Ho,Go,Qo,Jo,Yo,Xo,Zo,ei,ti,ri,ni,oi,ii,si,ai,li=a(()=>{f(),ot(),We(),yo=[],bo=!1,vo=-1,oo.prototype.run=function(){this.fun.apply(null,this.array)},wo={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},So=["/usr/bin/node"],Eo=[],ko={},Io=function(e,t){console.warn((t?t+": ":"")+e)},Ao=function(e){eo("binding")},Po=function(e){return 0},$o=function(){return"/"},Oo=function(e){},xo={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},To=io,Co=[],Ro={},No={},jo=io,Mo=io,Do=Lo=function(){return{}},Uo=Lo,Bo=io,Fo=io,qo=io,Wo={},Vo={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},zo=io,Ko=io,Ho=io,Go=io,Qo=io,Jo=io,Yo=io,Xo=io,Zo=[],ei=io,void 0===(ti={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0}).now&&(ri=Date.now(),ti.timing&&ti.timing.navigationStart&&(ri=ti.timing.navigationStart),ti.now=()=>Date.now()-ri),ni=1e9,po.bigint=function(e){var t=po(e);return typeof BigInt>"u"?t[0]*ni+t[1]:BigInt(t[0]*ni)+BigInt(t[1])},oi={version:"v16.8.0",versions:ko,arch:"x64",platform:"browser",release:xo,_rawDebug:To,moduleLoadList:Co,binding:Ao,_linkedBinding:so,_events:{},_eventsCount:0,_maxListeners:10,on:mo,addListener:mo,once:mo,off:mo,removeListener:mo,removeAllListeners:mo,emit:io,prependListener:mo,prependOnceListener:mo,listeners:go,domain:Ro,_exiting:!1,config:No,dlopen:ao,uptime:ho,_getActiveRequests:lo,_getActiveHandles:co,reallyExit:jo,_kill:Mo,cpuUsage:Lo,resourceUsage:Do,memoryUsage:Uo,kill:Bo,exit:Fo,openStdin:qo,allowedNodeEnvironmentFlags:Wo,assert:uo,features:Vo,_fatalExceptions:zo,setUncaughtExceptionCaptureCallback:Ko,hasUncaughtExceptionCaptureCallback:fo,emitWarning:Io,nextTick:no,_tickCallback:Ho,_debugProcess:Go,_debugEnd:Qo,_startProfilerIdleNotifier:Jo,_stopProfilerIdleNotifier:Yo,stdout:void 0,stdin:void 0,stderr:void 0,abort:Xo,umask:Po,chdir:Oo,cwd:$o,env:wo,title:"browser",argv:So,execArgv:Eo,pid:2,ppid:1,execPath:"/bin/usr/node",debugPort:9229,hrtime:po,argv0:"node",_preload_modules:Zo,setSourceMapsEnabled:ei}}),ci=a(()=>{f(),ot(),We(),li(),ii={},si=!1,ai=function(){if(si)return ii;si=!0;var e=oi;function t(e){if("string"!=typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function r(e,t){for(var r,n="",o=0,i=-1,s=0,a=0;a<=e.length;++a){if(a<e.length)r=e.charCodeAt(a);else{if(47===r)break;r=47}if(47===r){if(i!==a-1&&1!==s)if(i!==a-1&&2===s){if(n.length<2||2!==o||46!==n.charCodeAt(n.length-1)||46!==n.charCodeAt(n.length-2))if(n.length>2){var l=n.lastIndexOf("/");if(l!==n.length-1){-1===l?(n="",o=0):o=(n=n.slice(0,l)).length-1-n.lastIndexOf("/"),i=a,s=0;continue}}else if(2===n.length||1===n.length){n="",o=0,i=a,s=0;continue}t&&(n.length>0?n+="/..":n="..",o=2)}else n.length>0?n+="/"+e.slice(i+1,a):n=e.slice(i+1,a),o=a-i-1;i=a,s=0}else 46===r&&-1!==s?++s:s=-1}return n}var n={resolve:function(){for(var n,o="",i=!1,s=arguments.length-1;s>=-1&&!i;s--){var a;s>=0?a=arguments[s]:(void 0===n&&(n=e.cwd()),a=n),t(a),0!==a.length&&(o=a+"/"+o,i=47===a.charCodeAt(0))}return o=r(o,!i),i?o.length>0?"/"+o:"/":o.length>0?o:"."},normalize:function(e){if(t(e),0===e.length)return".";var n=47===e.charCodeAt(0),o=47===e.charCodeAt(e.length-1);return 0===(e=r(e,!n)).length&&!n&&(e="."),e.length>0&&o&&(e+="/"),n?"/"+e:e},isAbsolute:function(e){return t(e),e.length>0&&47===e.charCodeAt(0)},join:function(){if(0===arguments.length)return".";for(var e,r=0;r<arguments.length;++r){var o=arguments[r];t(o),o.length>0&&(void 0===e?e=o:e+="/"+o)}return void 0===e?".":n.normalize(e)},relative:function(e,r){if(t(e),t(r),e===r||(e=n.resolve(e))===(r=n.resolve(r)))return"";for(var o=1;o<e.length&&47===e.charCodeAt(o);++o);for(var i=e.length,s=i-o,a=1;a<r.length&&47===r.charCodeAt(a);++a);for(var l=r.length-a,c=s<l?s:l,u=-1,f=0;f<=c;++f){if(f===c){if(l>c){if(47===r.charCodeAt(a+f))return r.slice(a+f+1);if(0===f)return r.slice(a+f)}else s>c&&(47===e.charCodeAt(o+f)?u=f:0===f&&(u=0));break}var h=e.charCodeAt(o+f);if(h!==r.charCodeAt(a+f))break;47===h&&(u=f)}var d="";for(f=o+u+1;f<=i;++f)(f===i||47===e.charCodeAt(f))&&(0===d.length?d+="..":d+="/..");return d.length>0?d+r.slice(a+u):(a+=u,47===r.charCodeAt(a)&&++a,r.slice(a))},_makeLong:function(e){return e},dirname:function(e){if(t(e),0===e.length)return".";for(var r=e.charCodeAt(0),n=47===r,o=-1,i=!0,s=e.length-1;s>=1;--s)if(47===(r=e.charCodeAt(s))){if(!i){o=s;break}}else i=!1;return-1===o?n?"/":".":n&&1===o?"//":e.slice(0,o)},basename:function(e,r){if(void 0!==r&&"string"!=typeof r)throw new TypeError('"ext" argument must be a string');t(e);var n,o=0,i=-1,s=!0;if(void 0!==r&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var a=r.length-1,l=-1;for(n=e.length-1;n>=0;--n){var c=e.charCodeAt(n);if(47===c){if(!s){o=n+1;break}}else-1===l&&(s=!1,l=n+1),a>=0&&(c===r.charCodeAt(a)?-1===--a&&(i=n):(a=-1,i=l))}return o===i?i=l:-1===i&&(i=e.length),e.slice(o,i)}for(n=e.length-1;n>=0;--n)if(47===e.charCodeAt(n)){if(!s){o=n+1;break}}else-1===i&&(s=!1,i=n+1);return-1===i?"":e.slice(o,i)},extname:function(e){t(e);for(var r=-1,n=0,o=-1,i=!0,s=0,a=e.length-1;a>=0;--a){var l=e.charCodeAt(a);if(47!==l)-1===o&&(i=!1,o=a+1),46===l?-1===r?r=a:1!==s&&(s=1):-1!==r&&(s=-1);else if(!i){n=a+1;break}}return-1===r||-1===o||0===s||1===s&&r===o-1&&r===n+1?"":e.slice(r,o)},format:function(e){if(null===e||"object"!=typeof e)throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return function(e,t){var r=t.dir||t.root,n=t.base||(t.name||"")+(t.ext||"");return r?r===t.root?r+n:r+"/"+n:n}(0,e)},parse:function(e){t(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return r;var n,o=e.charCodeAt(0),i=47===o;i?(r.root="/",n=1):n=0;for(var s=-1,a=0,l=-1,c=!0,u=e.length-1,f=0;u>=n;--u)if(47!==(o=e.charCodeAt(u)))-1===l&&(c=!1,l=u+1),46===o?-1===s?s=u:1!==f&&(f=1):-1!==s&&(f=-1);else if(!c){a=u+1;break}return-1===s||-1===l||0===f||1===f&&s===l-1&&s===a+1?-1!==l&&(r.base=r.name=0===a&&i?e.slice(1,l):e.slice(a,l)):(0===a&&i?(r.name=e.slice(1,s),r.base=e.slice(1,l)):(r.name=e.slice(a,s),r.base=e.slice(a,l)),r.ext=e.slice(s,l)),a>0?r.dir=e.slice(0,a-1):i&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return n.posix=n,ii=n}()}),ui={};function fi(){if(vi)return _i;vi=!0;var e="function"==typeof Map&&Map.prototype,t=Object.getOwnPropertyDescriptor&&e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,r=e&&t&&"function"==typeof t.get?t.get:null,n=e&&Map.prototype.forEach,o="function"==typeof Set&&Set.prototype,i=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,s=o&&i&&"function"==typeof i.get?i.get:null,a=o&&Set.prototype.forEach,l="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,c="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,u="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,f=Boolean.prototype.valueOf,h=Object.prototype.toString,d=Function.prototype.toString,p=String.prototype.match,m=String.prototype.slice,g=String.prototype.replace,y=String.prototype.toUpperCase,b=String.prototype.toLowerCase,_=RegExp.prototype.test,v=Array.prototype.concat,w=Array.prototype.join,S=Array.prototype.slice,E=Math.floor,k="function"==typeof BigInt?BigInt.prototype.valueOf:null,I=Object.getOwnPropertySymbols,A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,P="function"==typeof Symbol&&"object"==typeof Symbol.iterator,$="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,O=Object.prototype.propertyIsEnumerable,x=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function T(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||_.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-E(-e):E(e);if(n!==e){var o=String(n),i=m.call(t,o.length+1);return g.call(o,r,"$&_")+"."+g.call(g.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return g.call(t,r,"$&_")}var C=bi,R=C.custom,N=U(R)?R:null;function j(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function M(e){return g.call(String(e),/"/g,""")}function L(e){return!("[object Array]"!==q(e)||$&&"object"==typeof e&&$ in e)}function D(e){return!("[object RegExp]"!==q(e)||$&&"object"==typeof e&&$ in e)}function U(e){if(P)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!A)return!1;try{return A.call(e),!0}catch{}return!1}_i=function e(t,o,i,h){var y=o||{};if(F(y,"quoteStyle")&&"single"!==y.quoteStyle&&"double"!==y.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(F(y,"maxStringLength")&&("number"==typeof y.maxStringLength?y.maxStringLength<0&&y.maxStringLength!==1/0:null!==y.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var _=!F(y,"customInspect")||y.customInspect;if("boolean"!=typeof _&&"symbol"!==_)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(F(y,"indent")&&null!==y.indent&&"\t"!==y.indent&&!(parseInt(y.indent,10)===y.indent&&y.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(F(y,"numericSeparator")&&"boolean"!=typeof y.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=y.numericSeparator;if(typeof t>"u")return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return V(t,y);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var I=String(t);return E?T(t,I):I}if("bigint"==typeof t){var R=String(t)+"n";return E?T(t,R):R}var B=typeof y.depth>"u"?5:y.depth;if(typeof i>"u"&&(i=0),i>=B&&B>0&&"object"==typeof t)return L(t)?"[Array]":"[Object]";var z=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=w.call(Array(e.indent+1)," ")}return{base:r,prev:w.call(Array(t+1),r)}}(y,i);if(typeof h>"u")h=[];else if(W(h,t)>=0)return"[Circular]";function Y(t,r,n){if(r&&(h=S.call(h)).push(r),n){var o={depth:y.depth};return F(y,"quoteStyle")&&(o.quoteStyle=y.quoteStyle),e(t,o,i+1,h)}return e(t,y,i+1,h)}if("function"==typeof t&&!D(t)){var X=function(e){if(e.name)return e.name;var t=p.call(d.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),Z=J(t,Y);return"[Function"+(X?": "+X:" (anonymous)")+"]"+(Z.length>0?" { "+w.call(Z,", ")+" }":"")}if(U(t)){var ee=P?g.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):A.call(t);return"object"!=typeof t||P?ee:K(ee)}if(function(e){return!(!e||"object"!=typeof e)&&(typeof HTMLElement<"u"&&e instanceof HTMLElement||"string"==typeof e.nodeName&&"function"==typeof e.getAttribute)}(t)){for(var te="<"+b.call(String(t.nodeName)),re=t.attributes||[],ne=0;ne<re.length;ne++)te+=" "+re[ne].name+"="+j(M(re[ne].value),"double",y);return te+=">",t.childNodes&&t.childNodes.length&&(te+="..."),te+"</"+b.call(String(t.nodeName))+">"}if(L(t)){if(0===t.length)return"[]";var oe=J(t,Y);return z&&!function(e){for(var t=0;t<e.length;t++)if(W(e[t],"\n")>=0)return!1;return!0}(oe)?"["+Q(oe,z)+"]":"[ "+w.call(oe,", ")+" ]"}if(function(e){return!("[object Error]"!==q(e)||$&&"object"==typeof e&&$ in e)}(t)){var ie=J(t,Y);return"cause"in Error.prototype||!("cause"in t)||O.call(t,"cause")?0===ie.length?"["+String(t)+"]":"{ ["+String(t)+"] "+w.call(ie,", ")+" }":"{ ["+String(t)+"] "+w.call(v.call("[cause]: "+Y(t.cause),ie),", ")+" }"}if("object"==typeof t&&_){if(N&&"function"==typeof t[N]&&C)return C(t,{depth:B-i});if("symbol"!==_&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!r||!e||"object"!=typeof e)return!1;try{r.call(e);try{s.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}(t)){var se=[];return n&&n.call(t,function(e,r){se.push(Y(r,t,!0)+" => "+Y(e,t))}),G("Map",r.call(t),se,z)}if(function(e){if(!s||!e||"object"!=typeof e)return!1;try{s.call(e);try{r.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}(t)){var ae=[];return a&&a.call(t,function(e){ae.push(Y(e,t))}),G("Set",s.call(t),ae,z)}if(function(e){if(!l||!e||"object"!=typeof e)return!1;try{l.call(e,l);try{c.call(e,c)}catch{return!0}return e instanceof WeakMap}catch{}return!1}(t))return H("WeakMap");if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e,c);try{l.call(e,l)}catch{return!0}return e instanceof WeakSet}catch{}return!1}(t))return H("WeakSet");if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{return u.call(e),!0}catch{}return!1}(t))return H("WeakRef");if(function(e){return!("[object Number]"!==q(e)||$&&"object"==typeof e&&$ in e)}(t))return K(Y(Number(t)));if(function(e){if(!e||"object"!=typeof e||!k)return!1;try{return k.call(e),!0}catch{}return!1}(t))return K(Y(k.call(t)));if(function(e){return!("[object Boolean]"!==q(e)||$&&"object"==typeof e&&$ in e)}(t))return K(f.call(t));if(function(e){return!("[object String]"!==q(e)||$&&"object"==typeof e&&$ in e)}(t))return K(Y(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof wi<"u"&&t===wi)return"{ [object globalThis] }";if(!function(e){return!("[object Date]"!==q(e)||$&&"object"==typeof e&&$ in e)}(t)&&!D(t)){var le=J(t,Y),ce=x?x(t)===Object.prototype:t instanceof Object||t.constructor===Object,ue=t instanceof Object?"":"null prototype",fe=!ce&&$&&Object(t)===t&&$ in t?m.call(q(t),8,-1):ue?"Object":"",he=(ce||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(fe||ue?"["+w.call(v.call([],fe||[],ue||[]),": ")+"] ":"");return 0===le.length?he+"{}":z?he+"{"+Q(le,z)+"}":he+"{ "+w.call(le,", ")+" }"}return String(t)};var B=Object.prototype.hasOwnProperty||function(e){return e in(this||wi)};function F(e,t){return B.call(e,t)}function q(e){return h.call(e)}function W(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function V(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return V(m.call(e,0,t.maxStringLength),t)+n}return j(g.call(g.call(e,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,z),"single",t)}function z(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":"")+y.call(t.toString(16))}function K(e){return"Object("+e+")"}function H(e){return e+" { ? }"}function G(e,t,r,n){return e+" ("+t+") {"+(n?Q(r,n):w.call(r,", "))+"}"}function Q(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+w.call(e,","+r)+"\n"+t.prev}function J(e,t){var r=L(e),n=[];if(r){n.length=e.length;for(var o=0;o<e.length;o++)n[o]=F(e,o)?t(e[o],e):""}var i,s="function"==typeof I?I(e):[];if(P){i={};for(var a=0;a<s.length;a++)i["$"+s[a]]=s[a]}for(var l in e)F(e,l)&&(r&&String(Number(l))===l&&l<e.length||P&&i["$"+l]instanceof Symbol||(_.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof I)for(var c=0;c<s.length;c++)O.call(e,s[c])&&n.push("["+t(s[c])+"]: "+t(e[s[c]],e));return n}return _i}function hi(){if(Ii)return ki;Ii=!0;var e=String.prototype.replace,t=/%20/g,r="RFC3986";return ki={default:r,formatters:{RFC1738:function(r){return e.call(r,t,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:r}}function di(){if(Pi)return Ai;Pi=!0;var e=hi(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),o=function(e,t){for(var r=t&&t.plainObjects?Object.create(null):{},n=0;n<e.length;++n)typeof e[n]<"u"&&(r[n]=e[n]);return r},i=1024;return Ai={arrayToObject:o,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=[],o=0;o<t.length;++o)for(var i=t[o],s=i.obj[i.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];"object"==typeof u&&null!==u&&-1===n.indexOf(u)&&(t.push({obj:s,prop:c}),n.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(r(n)){for(var o=[],i=0;i<n.length;++i)typeof n[i]<"u"&&o.push(n[i]);t.obj[t.prop]=o}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},encode:function(t,r,o,s,a){if(0===t.length)return t;var l=t;if("symbol"==typeof t?l=Symbol.prototype.toString.call(t):"string"!=typeof t&&(l=String(t)),"iso-8859-1"===o)return escape(l).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",u=0;u<l.length;u+=i){for(var f=l.length>=i?l.slice(u,u+i):l,h=[],d=0;d<f.length;++d){var p=f.charCodeAt(d);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||a===e.RFC1738&&(40===p||41===p)?h[h.length]=f.charAt(d):p<128?h[h.length]=n[p]:p<2048?h[h.length]=n[192|p>>6]+n[128|63&p]:p<55296||p>=57344?h[h.length]=n[224|p>>12]+n[128|p>>6&63]+n[128|63&p]:(d+=1,p=65536+((1023&p)<<10|1023&f.charCodeAt(d)),h[h.length]=n[240|p>>18]+n[128|p>>12&63]+n[128|p>>6&63]+n[128|63&p])}c+=h.join("")}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(r(e)){for(var n=[],o=0;o<e.length;o+=1)n.push(t(e[o]));return n}return t(e)},merge:function e(n,i,s){if(!i)return n;if("object"!=typeof i){if(r(n))n.push(i);else{if(!n||"object"!=typeof n)return[n,i];(s&&(s.plainObjects||s.allowPrototypes)||!t.call(Object.prototype,i))&&(n[i]=!0)}return n}if(!n||"object"!=typeof n)return[n].concat(i);var a=n;return r(n)&&!r(i)&&(a=o(n,s)),r(n)&&r(i)?(i.forEach(function(r,o){if(t.call(n,o)){var i=n[o];i&&"object"==typeof i&&r&&"object"==typeof r?n[o]=e(i,r,s):n.push(r)}else n[o]=r}),n):Object.keys(i).reduce(function(r,n){var o=i[n];return t.call(r,n)?r[n]=e(r[n],o,s):r[n]=o,r},a)}}}function pi(){if(Oi)return $i;Oi=!0;var e=function(){if(Ei)return Si;Ei=!0;var e=an(),t=un(),r=fi(),n=on(),o=e("%WeakMap%",!0),i=e("%Map%",!0),s=t("WeakMap.prototype.get",!0),a=t("WeakMap.prototype.set",!0),l=t("WeakMap.prototype.has",!0),c=t("Map.prototype.get",!0),u=t("Map.prototype.set",!0),f=t("Map.prototype.has",!0),h=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 Si=function(){var e,t,d,p={assert:function(e){if(!p.has(e))throw new n("Side channel does not contain "+r(e))},get:function(r){if(o&&r&&("object"==typeof r||"function"==typeof r)){if(e)return s(e,r)}else if(i){if(t)return c(t,r)}else if(d)return function(e,t){var r=h(e,t);return r&&r.value}(d,r)},has:function(r){if(o&&r&&("object"==typeof r||"function"==typeof r)){if(e)return l(e,r)}else if(i){if(t)return f(t,r)}else if(d)return function(e,t){return!!h(e,t)}(d,r);return!1},set:function(r,n){o&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new o),a(e,r,n)):i?(t||(t=new i),u(t,r,n)):(d||(d={key:{},next:null}),function(e,t,r){var n=h(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(d,r,n))}};return p}}(),t=di(),r=hi(),n=Object.prototype.hasOwnProperty,o={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},i=Array.isArray,s=Array.prototype.push,a=function(e,t){s.apply(e,i(t)?t:[t])},l=Date.prototype.toISOString,c=r.default,u={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:t.encode,encodeValuesOnly:!1,format:c,formatter:r.formatters[c],indices:!1,serializeDate:function(e){return l.call(e)},skipNulls:!1,strictNullHandling:!1},f={},h=function r(n,o,s,l,c,h,d,p,m,g,y,b,_,v,w,S,E,k){for(var I=n,A=k,P=0,$=!1;void 0!==(A=A.get(f))&&!$;){var O=A.get(n);if(P+=1,typeof O<"u"){if(O===P)throw new RangeError("Cyclic object value");$=!0}typeof A.get(f)>"u"&&(P=0)}if("function"==typeof g?I=g(o,I):I instanceof Date?I=_(I):"comma"===s&&i(I)&&(I=t.maybeMap(I,function(e){return e instanceof Date?_(e):e})),null===I){if(h)return m&&!S?m(o,u.encoder,E,"key",v):o;I=""}if(function(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||"symbol"==typeof e||"bigint"==typeof e}(I)||t.isBuffer(I))return m?[w(S?o:m(o,u.encoder,E,"key",v))+"="+w(m(I,u.encoder,E,"value",v))]:[w(o)+"="+w(String(I))];var x,T=[];if(typeof I>"u")return T;if("comma"===s&&i(I))S&&m&&(I=t.maybeMap(I,m)),x=[{value:I.length>0?I.join(",")||null:void 0}];else if(i(g))x=g;else{var C=Object.keys(I);x=y?C.sort(y):C}var R=p?o.replace(/\./g,"%2E"):o,N=l&&i(I)&&1===I.length?R+"[]":R;if(c&&i(I)&&0===I.length)return N+"[]";for(var j=0;j<x.length;++j){var M=x[j],L="object"==typeof M&&typeof M.value<"u"?M.value:I[M];if(!d||null!==L){var D=b&&p?M.replace(/\./g,"%2E"):M,U=i(I)?"function"==typeof s?s(N,D):N:N+(b?"."+D:"["+D+"]");k.set(n,P);var B=e();B.set(f,k),a(T,r(L,U,s,l,c,h,d,p,"comma"===s&&S&&i(I)?null:m,g,y,b,_,v,w,S,E,B))}}return T};return $i=function(t,s){var l,c=t,f=function(e){if(!e)return u;if(typeof e.allowEmptyArrays<"u"&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&typeof e.encoder<"u"&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||u.charset;if(typeof e.charset<"u"&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var s=r.default;if(typeof e.format<"u"){if(!n.call(r.formatters,e.format))throw new TypeError("Unknown format option provided.");s=e.format}var a,l=r.formatters[s],c=u.filter;if(("function"==typeof e.filter||i(e.filter))&&(c=e.filter),a=e.arrayFormat in o?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":u.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var f=typeof e.allowDots>"u"?!0===e.encodeDotInKeys||u.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:u.addQueryPrefix,allowDots:f,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:u.allowEmptyArrays,arrayFormat:a,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:u.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?u.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:u.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:u.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:u.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:u.encodeValuesOnly,filter:c,format:s,formatter:l,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:u.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:u.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:u.strictNullHandling}}(s);"function"==typeof f.filter?c=(0,f.filter)("",c):i(f.filter)&&(l=f.filter);var d=[];if("object"!=typeof c||null===c)return"";var p=o[f.arrayFormat],m="comma"===p&&f.commaRoundTrip;l||(l=Object.keys(c)),f.sort&&l.sort(f.sort);for(var g=e(),y=0;y<l.length;++y){var b=l[y];f.skipNulls&&null===c[b]||a(d,h(c[b],b,p,m,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,g))}var _=d.join(f.delimiter),v=!0===f.addQueryPrefix?"?":"";return f.charsetSentinel&&("iso-8859-1"===f.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),_.length>0?v+_:""}}function mi(){if(ji)return Ni;ji=!0;var e=wt;function t(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var r=/^([a-z0-9.+-]+:)/i,n=/:[0-9]*$/,o=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,i=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),s=["'"].concat(i),a=["%","/","?",";","#"].concat(s),l=["/","?","#"],c=/^[+a-z0-9A-Z_-]{0,63}$/,u=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,f={javascript:!0,"javascript:":!0},h={javascript:!0,"javascript:":!0},d={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},p=function(){if(Ri)return Ci;Ri=!0;var e=pi(),t=function(){if(Ti)return xi;Ti=!0;var e=di(),t=Object.prototype.hasOwnProperty,r=Array.isArray,n={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:e.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},o=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},i=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},s=function(e,r,n,o){if(e){var s=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,l=n.depth>0&&/(\[[^[\]]*])/.exec(s),c=l?s.slice(0,l.index):s,u=[];if(c){if(!n.plainObjects&&t.call(Object.prototype,c)&&!n.allowPrototypes)return;u.push(c)}for(var f=0;n.depth>0&&null!==(l=a.exec(s))&&f<n.depth;){if(f+=1,!n.plainObjects&&t.call(Object.prototype,l[1].slice(1,-1))&&!n.allowPrototypes)return;u.push(l[1])}if(l){if(!0===n.strictDepth)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");u.push("["+s.slice(l.index)+"]")}return function(e,t,r,n){for(var o=n?t:i(t,r),s=e.length-1;s>=0;--s){var a,l=e[s];if("[]"===l&&r.parseArrays)a=r.allowEmptyArrays&&(""===o||r.strictNullHandling&&null===o)?[]:[].concat(o);else{a=r.plainObjects?Object.create(null):{};var c="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,u=r.decodeDotInKeys?c.replace(/%2E/g,"."):c,f=parseInt(u,10);r.parseArrays||""!==u?!isNaN(f)&&l!==u&&String(f)===u&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(a=[])[f]=o:"__proto__"!==u&&(a[u]=o):a={0:o}}o=a}return o}(u,r,n,o)}};return xi=function(a,l){var c=function(t){if(!t)return n;if(typeof t.allowEmptyArrays<"u"&&"boolean"!=typeof t.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&"boolean"!=typeof t.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==t.decoder&&typeof t.decoder<"u"&&"function"!=typeof t.decoder)throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&"utf-8"!==t.charset&&"iso-8859-1"!==t.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?n.charset:t.charset,o=typeof t.duplicates>"u"?n.duplicates:t.duplicates;if("combine"!==o&&"first"!==o&&"last"!==o)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:typeof t.allowDots>"u"?!0===t.decodeDotInKeys||n.allowDots:!!t.allowDots,allowEmptyArrays:"boolean"==typeof t.allowEmptyArrays?!!t.allowEmptyArrays:n.allowEmptyArrays,allowPrototypes:"boolean"==typeof t.allowPrototypes?t.allowPrototypes:n.allowPrototypes,allowSparse:"boolean"==typeof t.allowSparse?t.allowSparse:n.allowSparse,arrayLimit:"number"==typeof t.arrayLimit?t.arrayLimit:n.arrayLimit,charset:r,charsetSentinel:"boolean"==typeof t.charsetSentinel?t.charsetSentinel:n.charsetSentinel,comma:"boolean"==typeof t.comma?t.comma:n.comma,decodeDotInKeys:"boolean"==typeof t.decodeDotInKeys?t.decodeDotInKeys:n.decodeDotInKeys,decoder:"function"==typeof t.decoder?t.decoder:n.decoder,delimiter:"string"==typeof t.delimiter||e.isRegExp(t.delimiter)?t.delimiter:n.delimiter,depth:"number"==typeof t.depth||!1===t.depth?+t.depth:n.depth,duplicates:o,ignoreQueryPrefix:!0===t.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof t.interpretNumericEntities?t.interpretNumericEntities:n.interpretNumericEntities,parameterLimit:"number"==typeof t.parameterLimit?t.parameterLimit:n.parameterLimit,parseArrays:!1!==t.parseArrays,plainObjects:"boolean"==typeof t.plainObjects?t.plainObjects:n.plainObjects,strictDepth:"boolean"==typeof t.strictDepth?!!t.strictDepth:n.strictDepth,strictNullHandling:"boolean"==typeof t.strictNullHandling?t.strictNullHandling:n.strictNullHandling}}(l);if(""===a||null===a||typeof a>"u")return c.plainObjects?Object.create(null):{};for(var u="string"==typeof a?function(s,a){var l={__proto__:null},c=a.ignoreQueryPrefix?s.replace(/^\?/,""):s;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u,f=a.parameterLimit===1/0?void 0:a.parameterLimit,h=c.split(a.delimiter,f),d=-1,p=a.charset;if(a.charsetSentinel)for(u=0;u<h.length;++u)0===h[u].indexOf("utf8=")&&("utf8=%E2%9C%93"===h[u]?p="utf-8":"utf8=%26%2310003%3B"===h[u]&&(p="iso-8859-1"),d=u,u=h.length);for(u=0;u<h.length;++u)if(u!==d){var m,g,y=h[u],b=y.indexOf("]="),_=-1===b?y.indexOf("="):b+1;-1===_?(m=a.decoder(y,n.decoder,p,"key"),g=a.strictNullHandling?null:""):(m=a.decoder(y.slice(0,_),n.decoder,p,"key"),g=e.maybeMap(i(y.slice(_+1),a),function(e){return a.decoder(e,n.decoder,p,"value")})),g&&a.interpretNumericEntities&&"iso-8859-1"===p&&(g=o(g)),y.indexOf("[]=")>-1&&(g=r(g)?[g]:g);var v=t.call(l,m);v&&"combine"===a.duplicates?l[m]=e.combine(l[m],g):(!v||"last"===a.duplicates)&&(l[m]=g)}return l}(a,c):a,f=c.plainObjects?Object.create(null):{},h=Object.keys(u),d=0;d<h.length;++d){var p=h[d],m=s(p,u[p],c,"string"==typeof a);f=e.merge(f,m,c)}return!0===c.allowSparse?f:e.compact(f)}}(),r=hi();return Ci={formats:r,parse:t,stringify:e}}();function m(e,r,n){if(e&&"object"==typeof e&&e instanceof t)return e;var o=new t;return o.parse(e,r,n),o}return t.prototype.parse=function(t,n,i){if("string"!=typeof t)throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var m=t.indexOf("?"),g=-1!==m&&m<t.indexOf("#")?"?":"#",y=t.split(g);y[0]=y[0].replace(/\\/g,"/");var b=t=y.join(g);if(b=b.trim(),!i&&1===t.split("#").length){var _=o.exec(b);if(_)return this.path=b,this.href=b,this.pathname=_[1],_[2]?(this.search=_[2],this.query=n?p.parse(this.search.substr(1)):this.search.substr(1)):n&&(this.search="",this.query={}),this}var v=r.exec(b);if(v){var w=(v=v[0]).toLowerCase();this.protocol=w,b=b.substr(v.length)}if(i||v||b.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===b.substr(0,2);S&&(!v||!h[v])&&(b=b.substr(2),this.slashes=!0)}if(!h[v]&&(S||v&&!d[v])){for(var E=-1,k=0;k<l.length;k++)-1!==(P=b.indexOf(l[k]))&&(-1===E||P<E)&&(E=P);var I,A;for(-1!==(A=-1===E?b.lastIndexOf("@"):b.lastIndexOf("@",E))&&(I=b.slice(0,A),b=b.slice(A+1),this.auth=decodeURIComponent(I)),E=-1,k=0;k<a.length;k++){var P;-1!==(P=b.indexOf(a[k]))&&(-1===E||P<E)&&(E=P)}-1===E&&(E=b.length),this.host=b.slice(0,E),b=b.slice(E),this.parseHost(),this.hostname=this.hostname||"";var $="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!$)for(var O=this.hostname.split(/\./),x=(k=0,O.length);k<x;k++){var T=O[k];if(T&&!T.match(c)){for(var C="",R=0,N=T.length;R<N;R++)T.charCodeAt(R)>127?C+="x":C+=T[R];if(!C.match(c)){var j=O.slice(0,k),M=O.slice(k+1),L=T.match(u);L&&(j.push(L[1]),M.unshift(L[2])),M.length&&(b="/"+M.join(".")+b),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),$||(this.hostname=e.toASCII(this.hostname));var D=this.port?":"+this.port:"",U=this.hostname||"";this.host=U+D,this.href+=this.host,$&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!f[w])for(k=0,x=s.length;k<x;k++){var B=s[k];if(-1!==b.indexOf(B)){var F=encodeURIComponent(B);F===B&&(F=escape(B)),b=b.split(B).join(F)}}var q=b.indexOf("#");-1!==q&&(this.hash=b.substr(q),b=b.slice(0,q));var W=b.indexOf("?");if(-1!==W?(this.search=b.substr(W),this.query=b.substr(W+1),n&&(this.query=p.parse(this.query)),b=b.slice(0,W)):n&&(this.search="",this.query={}),b&&(this.pathname=b),d[w]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){D=this.pathname||"";var V=this.search||"";this.path=D+V}return this.href=this.format(),this},t.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,i="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(i=p.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||i&&"?"+i||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||d[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},t.prototype.resolve=function(e){return this.resolveObject(m(e,!1,!0)).format()},t.prototype.resolveObject=function(e){if("string"==typeof e){var r=new t;r.parse(e,!1,!0),e=r}for(var n=new t,o=Object.keys(this),i=0;i<o.length;i++){var s=o[i];n[s]=this[s]}if(n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(n[c]=e[c])}return d[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!d[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var p=u[f];n[p]=e[p]}return n.href=n.format(),n}if(n.protocol=e.protocol,e.host||h[e.protocol])n.pathname=e.pathname;else{for(var m=(e.pathname||"").split("/");m.length&&!(e.host=m.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==m[0]&&m.unshift(""),m.length<2&&m.unshift(""),n.pathname=m.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var g=n.pathname||"",y=n.search||"";n.path=g+y}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var b=n.pathname&&"/"===n.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),v=_||b||n.host&&e.pathname,w=v,S=n.pathname&&n.pathname.split("/")||[],E=(m=e.pathname&&e.pathname.split("/")||[],n.protocol&&!d[n.protocol]);if(E&&(n.hostname="",n.port=null,n.host&&(""===S[0]?S[0]=n.host:S.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===m[0]?m[0]=e.host:m.unshift(e.host)),e.host=null),v=v&&(""===m[0]||""===S[0])),_)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,S=m;else if(m.length)S||(S=[]),S.pop(),S=S.concat(m),n.search=e.search,n.query=e.query;else if(null!=e.search)return E&&(n.host=S.shift(),n.hostname=n.host,($=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=$.shift(),n.hostname=$.shift(),n.host=n.hostname)),n.search=e.search,n.query=e.query,(null!==n.pathname||null!==n.search)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n;if(!S.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var k=S.slice(-1)[0],I=(n.host||e.host||S.length>1)&&("."===k||".."===k)||""===k,A=0,P=S.length;P>=0;P--)"."===(k=S[P])?S.splice(P,1):".."===k?(S.splice(P,1),A++):A&&(S.splice(P,1),A--);if(!v&&!w)for(;A--;A)S.unshift("..");v&&""!==S[0]&&(!S[0]||"/"!==S[0].charAt(0))&&S.unshift(""),I&&"/"!==S.join("/").substr(-1)&&S.push("");var $,O=""===S[0]||S[0]&&"/"===S[0].charAt(0);return E&&(n.hostname=O?"":S.length?S.shift():"",n.host=n.hostname,($=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@"))&&(n.auth=$.shift(),n.hostname=$.shift(),n.host=n.hostname)),(v=v||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=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},t.prototype.parseHost=function(){var e=this.host,t=n.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},Ni.parse=m,Ni.resolve=function(e,t){return m(e,!1,!0).resolve(t)},Ni.resolveObject=function(e,t){return e?m(e,!1,!0).resolveObject(t):t},Ni.format=function(e){return"string"==typeof e&&(e=m(e)),e instanceof t?e.format():t.prototype.format.call(e)},Ni.Url=t,Ni}function gi(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 Gi?function(e){let t=e.hostname,r=e.pathname;for(let e=0;e<r.length;e++)if("%"===r[e]){let t=r.codePointAt(e+2)||32;if("2"===r[e+1]&&102===t||"5"===r[e+1]&&99===t)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(Qi,"\\"),r=decodeURIComponent(r),""!==t)return`\\\\${t}${r}`;{let e=32|r.codePointAt(1),t=r[2];if(e<Ki||e>Hi||":"!==t)throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}(e):function(e){if(""!==e.hostname)throw new Deno.errors.InvalidData("invalid file url hostname");let t=e.pathname;for(let e=0;e<t.length;e++)if("%"===t[e]){let r=t.codePointAt(e+2)||32;if("2"===t[e+1]&&102===r)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(t)}(e)}function yi(e){let t=ai.resolve(e),r=e.charCodeAt(e.length-1);(r===zi||Gi&&r===Vi)&&t[t.length-1]!==ai.sep&&(t+="/");let n=new URL("file://");return t.includes("%")&&(t=t.replace(Ji,"%25")),!Gi&&t.includes("\\")&&(t=t.replace(Yi,"%5C")),t.includes("\n")&&(t=t.replace(Xi,"%0A")),t.includes("\r")&&(t=t.replace(Zi,"%0D")),t.includes("\t")&&(t=t.replace(es,"%09")),n.pathname=t,n}c(ui,{URL:()=>Wi,Url:()=>Di,default:()=>Mi,fileURLToPath:()=>gi,format:()=>Ui,parse:()=>qi,pathToFileURL:()=>yi,resolve:()=>Bi,resolveObject:()=>Fi});var bi,_i,vi,wi,Si,Ei,ki,Ii,Ai,Pi,$i,Oi,xi,Ti,Ci,Ri,Ni,ji,Mi,Li,Di,Ui,Bi,Fi,qi,Wi,Vi,zi,Ki,Hi,Gi,Qi,Ji,Yi,Xi,Zi,es,ts=a(()=>{f(),ot(),We(),rn(),Zn(),ci(),li(),bi=Object.freeze(Object.create(null)),_i={},vi=!1,wi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:r.g,Si={},Ei=!1,ki={},Ii=!1,Ai={},Pi=!1,$i={},Oi=!1,xi={},Ti=!1,Ci={},Ri=!1,Ni={},ji=!1,(Mi=mi()).parse,Mi.resolve,Mi.resolveObject,Mi.format,Mi.Url,Li=typeof Deno<"u"?"windows"===Deno.build.os?"win32":Deno.build.os:void 0,Mi.URL=typeof URL<"u"?URL:null,Mi.pathToFileURL=yi,Mi.fileURLToPath=gi,Di=Mi.Url,Ui=Mi.format,Bi=Mi.resolve,Fi=Mi.resolveObject,qi=Mi.parse,Wi=Mi.URL,Vi=92,zi=47,Ki=97,Hi=122,Gi="win32"===Li,Qi=/\//g,Ji=/%/g,Yi=/\\/g,Xi=/\n/g,Zi=/\r/g,es=/\t/g}),rs=l((e,t)=>{f(),ot(),We(),t.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),ns=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0}),e.BufferedDuplex=void 0,e.writev=n;var t=Ht(),r=(nt(),u(Xe));function n(e,t){let n=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?n[t]=r.Buffer.from(e[t].chunk,"utf8"):n[t]=e[t].chunk;this._write(r.Buffer.concat(n),"binary",t)}var o=class extends t.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=n.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",e=>{!this.destroyed&&this.readable&&this.push(e)})}_read(e){this.proxy.read(e)}_write(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}};e.BufferedDuplex=o}),os=l(e=>{f(),ot(),We();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.streamBuilder=e.browserStreamBuilder=void 0;var r=(nt(),u(Xe)),n=t(rs()),o=t(tr()),i=Ht(),s=t(Yr()),a=ns(),l=(0,o.default)("mqttjs:ws"),c=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function h(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function d(e){let t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),!s.default&&!e.forceNativeWebSocket&&"wss"===e.protocol&&c.forEach(r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])}),t}e.streamBuilder=(e,t)=>{l("streamBuilder");let r=d(t);r.hostname=r.hostname||r.host||"localhost";let o=h(r,e),i=function(e,t,r){l("createWebSocket"),l(`protocol: ${r.protocolId} ${r.protocolVersion}`);let o,i="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";return l(`creating new Websocket for url: ${t} and protocol: ${i}`),o=r.createWebsocket?r.createWebsocket(t,[i],r):new n.default(t,[i],r.wsOptions),o}(0,o,r),s=n.default.createWebSocketStream(i,r.wsOptions);return s.url=o,i.on("close",()=>{s.destroy()}),s},e.browserStreamBuilder=(e,t)=>{l("browserStreamBuilder");let n,o=function(e){let t=d(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t).browserBufferSize||524288,s=t.browserBufferTimeout||1e3,c=!t.objectMode,u=function(e,t){let r,n="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",o=h(t,e);return r=t.createWebsocket?t.createWebsocket(o,[n],t):new WebSocket(o,[n]),r.binaryType="arraybuffer",r}(e,t),f=function(e){let t=new i.Transform({objectMode:e.objectMode});return t._write=function e(t,n,i){if(u.bufferedAmount>o)return void setTimeout(e,s,t,n,i);c&&"string"==typeof t&&(t=r.Buffer.from(t,"utf8"));try{u.send(t)}catch(e){return i(e)}i()},t._flush=function(e){u.close(),e()},t}(t);t.objectMode||(f._writev=a.writev.bind(f)),f.on("close",()=>{u.close()});let p=typeof u.addEventListener<"u";function m(){l("WebSocket onOpen"),n instanceof a.BufferedDuplex&&n.socketReady()}function g(e){l("WebSocket onClose",e),n.end(),n.destroy()}function y(e){l("WebSocket onError",e);let t=new Error("WebSocket error");t.event=e,n.destroy(t)}async function b(e){if(!f||!f.readable||!f.writable)return;let{data:t}=e;t=t instanceof ArrayBuffer?r.Buffer.from(t):t instanceof Blob?r.Buffer.from(await new Response(t).arrayBuffer()):r.Buffer.from(t,"utf8"),f.push(t)}return u.readyState===u.OPEN?(n=f,n.socket=u):(n=new a.BufferedDuplex(t,f,u),p?u.addEventListener("open",m):u.onopen=m),p?(u.addEventListener("close",g),u.addEventListener("error",y),u.addEventListener("message",b)):(u.onclose=g,u.onerror=y,u.onmessage=b),n}}),is={};function ss(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}c(is,{Server:()=>ss,Socket:()=>ss,Stream:()=>ss,_createServerHandle:()=>ss,_normalizeArgs:()=>ss,_setSimultaneousAccepts:()=>ss,connect:()=>ss,createConnection:()=>ss,createServer:()=>ss,default:()=>as,isIP:()=>ss,isIPv4:()=>ss,isIPv6:()=>ss});var as,ls=a(()=>{f(),ot(),We(),as={_createServerHandle:ss,_normalizeArgs:ss,_setSimultaneousAccepts:ss,connect:ss,createConnection:ss,createServer:ss,isIP:ss,isIPv4:ss,isIPv6:ss,Server:ss,Socket:ss,Stream:ss}}),cs=l((e,t)=>{f(),ot(),We(),t.exports={}}),us=l(e=>{f(),ot(),We();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=t((ls(),u(is))),n=t(tr()),o=t(cs()),i=(0,n.default)("mqttjs:tcp");e.default=(e,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,o.default)(t.hostname,t.port,t.socksProxy,{timeout:t.socksTimeout});let{port:n,path:s}=t,a=t.hostname;return i("port %d and host %s",n,a),r.default.createConnection({port:n,host:a,path:s})}}),fs={};c(fs,{default:()=>hs});var hs,ds=a(()=>{f(),ot(),We(),hs={}}),ps=l(e=>{f(),ot(),We();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var r=(ds(),u(fs)),n=t((ls(),u(is))),o=t(tr()),i=t(cs()),s=(0,o.default)("mqttjs:tls");e.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0===n.default.isIP(t.host)&&!t.servername&&(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,s("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);let o=function(e){let{host:t,port:n,socksProxy:o,...s}=e;if(void 0!==o){let a=(0,i.default)(t,n,o,{timeout:e.socksTimeout});return(0,r.connect)({...s,socket:a})}return(0,r.connect)(e)}(t);function a(r){t.rejectUnauthorized&&e.emit("error",r),o.end()}return o.on("secureConnect",()=>{t.rejectUnauthorized&&!o.authorized?o.emit("error",new Error("TLS not authorized")):o.removeListener("error",a)}),o.on("error",a),o}}),ms=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,o=(nt(),u(Xe)),i=Ht(),s=ns();e.default=(e,a)=>{if(a.hostname=a.hostname||a.host,!a.hostname)throw new Error("Could not determine host. Specify host manually.");let l="MQIsdp"===a.protocolId&&3===a.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(a);let c=function(e,t){let r="wxs"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(a,e);t=wx.connectSocket({url:c,protocols:[l]}),r=function(){let e=new i.Transform;return e._write=(e,r,n)=>{t.send({data:e.buffer,success(){n()},fail(e){n(new Error(e))}})},e._flush=e=>{t.close({success(){e()}})},e}(),(n=new s.BufferedDuplex(a,r,t))._destroy=(e,r)=>{t.close({success(){r&&r(e)}})};let u=n.destroy;return n.destroy=(e,r)=>(n.destroy=u,setTimeout(()=>{t.close({fail(){n._destroy(e,r)}})},0),n),t.onOpen(()=>{n.socketReady()}),t.onMessage(e=>{let{data:t}=e;t=t instanceof ArrayBuffer?o.Buffer.from(t):o.Buffer.from(t,"utf8"),r.push(t)}),t.onClose(()=>{n.emit("close"),n.end(),n.destroy()}),t.onError(e=>{let t=new Error(e.errMsg);n.destroy(t)}),n}}),gs=l(e=>{f(),ot(),We(),Object.defineProperty(e,"__esModule",{value:!0});var t,r,n,o=(nt(),u(Xe)),i=Ht(),s=ns(),a=!1;e.default=(e,l)=>{if(l.hostname=l.hostname||l.host,!l.hostname)throw new Error("Could not determine host. Specify host manually.");let c="MQIsdp"===l.protocolId&&3===l.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(l);let u=function(e,t){let r="alis"===e.protocol?"wss":"ws",n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(l,e);return(t=l.my).connectSocket({url:u,protocols:c}),r=function(){let e=new i.Transform;return e._write=(e,r,n)=>{t.sendSocketMessage({data:e.buffer,success(){n()},fail(){n(new Error)}})},e._flush=e=>{t.closeSocket({success(){e()}})},e}(),n=new s.BufferedDuplex(l,r,t),a||(a=!0,t.onSocketOpen(()=>{n.socketReady()}),t.onSocketMessage(e=>{if("string"==typeof e.data){let t=o.Buffer.from(e.data,"base64");r.push(t)}else{let t=new FileReader;t.addEventListener("load",()=>{t.result instanceof ArrayBuffer?r.push(o.Buffer.from(t.result)):r.push(o.Buffer.from(t.result,"utf-8"))}),t.readAsArrayBuffer(e.data)}}),t.onSocketClose(()=>{n.end(),n.destroy()}),t.onSocketError(e=>{n.destroy(e)})),n}}),ys=l(e=>{f(),ot(),We();var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.connectAsync=function(e,t,r=!0){return new Promise((n,o)=>{let i=l(e,t),s={connect:e=>{a(),n(i)},end:()=>{a(),n(i)},error:e=>{a(),i.end(),o(e)}};function a(){Object.keys(s).forEach(e=>{i.off(e,s[e])})}!1===r&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))}),Object.keys(s).forEach(e=>{i.on(e,s[e])})})};var r=t(tr()),n=t((ts(),u(ui))),o=t(en()),i=t(Yr());"function"!=typeof h?.nextTick&&(h.nextTick=setImmediate);var s=(0,r.default)("mqttjs"),a=null;function l(e,t){if(s("connecting to an MQTT broker..."),"object"==typeof e&&!t&&(t=e,e=""),t=t||{},e&&"string"==typeof e){let r=n.default.parse(e,!0),o={},s=!r.protocol&&!r.hostname&&r.path?.startsWith("/")&&(i.default||t.forceNativeWebSocket);if(null!=r.port&&(o.port=Number(r.port)),o.host=r.hostname,o.query=r.query,o.auth=r.auth,o.protocol=r.protocol,o.path=r.path,!(t={...o,...t}).protocol&&!s)throw new Error("Missing protocol");t.protocol=(t.protocol||(typeof location<"u"?"https:"===location.protocol?"wss":"ws":typeof document<"u"&&"https:"===new URL(document.URL).protocol?"wss":"ws")).replace(/:$/,"")}if(t.unixSocket=t.unixSocket||t.protocol?.includes("+unix"),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):!t.protocol?.startsWith("ws")&&!t.protocol?.startsWith("wx")&&delete t.path,function(e){let t;if(e.auth)if(t=e.auth.match(/^(.+):(.+)$/),t){let[,r,n]=t;e.username=r,e.password=n}else e.username=e.auth}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),i.default||t.unixSocket?t.socksProxy=void 0:void 0===t.socksProxy&&typeof h<"u"&&(t.socksProxy=h.env.MQTTJS_SOCKS_PROXY),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(a||(a={},i.default||t.forceNativeWebSocket?(a.ws=os().browserStreamBuilder,a.wss=os().browserStreamBuilder,a.wx=ms().default,a.wxs=ms().default,a.ali=gs().default,a.alis=gs().default):(a.ws=os().streamBuilder,a.wss=os().streamBuilder,a.mqtt=us().default,a.tcp=us().default,a.ssl=ps().default,a.tls=a.ssl,a.mqtts=ps().default)),!a[t.protocol]){let e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((t,r)=>(!e||r%2!=0)&&"function"==typeof a[t])[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);let r=new 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),a[t.protocol](e,t)},t);return r.on("error",()=>{}),r}e.default=l}),bs=l(e=>{f(),ot(),We();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}: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}),o=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var i=t(e),s=0;s<i.length;s++)"default"!==i[s]&&r(o,e,i[s]);return n(o,e),o}),i=e&&e.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)},s=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.ReasonCodes=e.KeepaliveManager=e.UniqueMessageIdProvider=e.DefaultMessageIdProvider=e.Store=e.MqttClient=e.connectAsync=e.connect=e.Client=void 0;var a=s(en());e.MqttClient=a.default;var l=s(Er());e.DefaultMessageIdProvider=l.default;var c=s(tn());e.UniqueMessageIdProvider=c.default;var u=s(fr());e.Store=u.default;var h=o(ys());e.connect=h.default,Object.defineProperty(e,"connectAsync",{enumerable:!0,get:function(){return h.connectAsync}});var d=s(Zr());e.KeepaliveManager=d.default,e.Client=a.default,i(en(),e),i(dr(),e),i(ur(),e);var p=gr();Object.defineProperty(e,"ReasonCodes",{enumerable:!0,get:function(){return p.ReasonCodes}})});const _s=l(e=>{f(),ot(),We();var t,r=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,o)}: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}),o=e&&e.__importStar||(t=function(e){return(t=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t})(e)},function(e){if(e&&e.__esModule)return e;var o={};if(null!=e)for(var i=t(e),s=0;s<i.length;s++)"default"!==i[s]&&r(o,e,i[s]);return n(o,e),o}),i=e&&e.__exportStar||function(e,t){for(var n in e)"default"!==n&&!Object.prototype.hasOwnProperty.call(t,n)&&r(t,e,n)};Object.defineProperty(e,"__esModule",{value:!0});var s=o(bs());e.default=s,i(bs(),e)})()},3282:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;const n=r(4042),o=r(6144),i=r(6653),s=r(2079),a=["/properties"],l="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),o.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(i.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;const e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,l,!1),this.refs["http://json-schema.org/schema"]=l}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(l)?l:void 0)}}t.Ajv=c,e.exports=t=c,e.exports.Ajv=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c;var u=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var f=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return f._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return f.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return f.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return f.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return f.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return f.CodeGen}});var h=r(3558);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return h.default}});var d=r(4551);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return d.default}})},3439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>n.str`must be multiple of ${e}`,params:({schemaCode:e})=>n._`{multipleOf: ${e}}`},code(e){const{gen:t,data:r,schemaCode:o,it:i}=e,s=i.opts.multipleOfPrecision,a=t.let("res"),l=s?n._`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:n._`${a} !== parseInt(${a})`;e.fail$data(n._`(${o} === 0 || (${a} = ${r}/${o}, ${l}))`)}};t.default=o},3463:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const r={keyword:"id",code(){throw new Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},3530:e=>{e.exports=class{constructor({subscribe:e,log:t,initialDelayMs:r=1e3,maxDelayMs:n=3e4}){this._subscribe=e,this._log=t,this._initialDelayMs=r,this._maxDelayMs=n,this._pending=new Map,this._inFlight=new Set,this._timer=null,this._attempt=0}get pending(){const e=[];for(const t of this._pending.values())e.push(...t.topics);return e}get nextDelayMs(){return Math.min(this._initialDelayMs*2**this._attempt,this._maxDelayMs)}schedule(e,t={}){if(!e||0===e.length)return;for(const t of e)this._inFlight.delete(t);const r=JSON.stringify(t),n=this._pending.get(r)||{options:t,topics:new Set};for(const t of e)n.topics.add(t);if(this._pending.set(r,n),this._timer)return;const o=this.nextDelayMs;this._log&&this._log.warn(`Retrying ${this.pending.length} refused subscription(s) in ${o} ms: ${this.pending}`),this._timer=setTimeout(()=>this._fire(),o)}granted(e){for(const t of e)this._inFlight.delete(t);for(const t of this._pending.values())for(const r of e)t.topics.delete(r);for(const[e,t]of this._pending)0===t.topics.size&&this._pending.delete(e);0!==this._pending.size||0!==this._inFlight.size||this._timer||(this._attempt=0)}cancel(){clearTimeout(this._timer),this._timer=null,this._pending.clear(),this._inFlight.clear(),this._attempt=0}_fire(){this._timer=null,this._attempt+=1;const e=Array.from(this._pending.values());this._pending.clear();for(const{topics:t}of e)for(const e of t)this._inFlight.add(e);for(const{options:t,topics:r}of e)try{this._subscribe(Array.from(r),t)}catch(e){this._log&&this._log.warn(`Retrying subscription failed: ${e.message}`),this.schedule(Array.from(r),t)}}}},3558:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},3561:(e,t,r)=>{"use strict";r.r(t),r.d(t,{customAlphabet:()=>s,customRandom:()=>i,nanoid:()=>a,random:()=>o,urlAlphabet:()=>n});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",o=e=>crypto.getRandomValues(new Uint8Array(e)),i=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,o=-~(1.6*n*t/e.length);return(i=t)=>{let s="";for(;;){let t=r(o),a=0|o;for(;a--;)if(s+=e[t[a]&n]||"",s.length===i)return s}}},s=(e,t=21)=>i(e,t,o),a=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")},3673:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;const n=r(9029),o=r(2023),i=r(5765),s=r(8708);function a(e){const{gen:t,data:r,it:o}=e;t.if(o.parentData,()=>t.assign(r,n._`${o.parentData}[${o.parentDataProperty}]`))}function l(e,t,r){if(void 0===r)throw new Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}t.macroKeywordCode=function(e,t){const{gen:r,keyword:o,schema:i,parentSchema:s,it:a}=e,c=t.macro.call(a.self,i,s,a),u=l(r,o,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);const f=r.name("valid");e.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${o}`,topSchemaRef:u,compositeRule:!0},f),e.pass(f,()=>e.error(!0))},t.funcKeywordCode=function(e,t){var r;const{gen:c,keyword:u,schema:f,parentSchema:h,$data:d,it:p}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw new Error("async keyword in sync schema")}(p,t);const m=!d&&t.compile?t.compile.call(p.self,f,h,p):t.validate,g=l(c,u,m),y=c.let("valid");function b(r=(t.async?n._`await `:n.nil)){const s=p.opts.passContext?o.default.this:o.default.self,a=!("compile"in t&&!d||!1===t.schema);c.assign(y,n._`${r}${(0,i.callValidateCode)(e,g,s,a)}`,t.modifying)}function _(e){var r;c.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:y),e)}e.block$data(y,function(){if(!1===t.errors)b(),t.modifying&&a(e),_(()=>e.error());else{const r=t.async?function(){const e=c.let("ruleErrs",null);return c.try(()=>b(n._`await `),t=>c.assign(y,!1).if(n._`${t} instanceof ${p.ValidationError}`,()=>c.assign(e,n._`${t}.errors`),()=>c.throw(t))),e}():function(){const e=n._`${g}.errors`;return c.assign(e,null),b(n.nil),e}();t.modifying&&a(e),_(()=>function(e,t){const{gen:r}=e;r.if(n._`Array.isArray(${t})`,()=>{r.assign(o.default.vErrors,n._`${o.default.vErrors} === null ? ${t} : ${o.default.vErrors}.concat(${t})`).assign(o.default.errors,n._`${o.default.vErrors}.length`),(0,s.extendErrors)(e)},()=>e.error())}(e,r))}}),e.ok(null!==(r=t.valid)&&void 0!==r?r:y)},t.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},t.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},o,i){if(Array.isArray(o.keyword)?!o.keyword.includes(i):o.keyword!==i)throw new Error("ajv implementation error");const s=o.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw new Error(`parent schema must have dependencies of ${i}: ${s.join(",")}`);if(o.validateSchema&&!o.validateSchema(e[i])){const e=`keyword "${i}" value is invalid at path "${n}": `+r.errorsText(o.validateSchema.errors);if("log"!==t.validateSchema)throw new Error(e);r.logger.error(e)}}},3693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;const n=r(4551),o=r(5765),i=r(9029),s=r(2023),a=r(3835),l=r(4227),c={keyword:"$ref",schemaType:"string",code(e){const{gen:t,schema:r,it:o}=e,{baseId:s,schemaEnv:l,validateName:c,opts:h,self:d}=o,{root:p}=l;if(("#"===r||"#/"===r)&&s===p.baseId)return function(){if(l===p)return f(e,c,l,l.$async);const r=t.scopeValue("root",{ref:p});return f(e,i._`${r}.validate`,p,p.$async)}();const m=a.resolveRef.call(d,p,s,r);if(void 0===m)throw new n.default(o.opts.uriResolver,s,r);return m instanceof a.SchemaEnv?function(t){const r=u(e,t);f(e,r,t,t.$async)}(m):function(n){const o=t.scopeValue("schema",!0===h.code.source?{ref:n,code:(0,i.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:i.nil,topSchemaRef:o,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}(m)}};function u(e,t){const{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):i._`${r.scopeValue("wrapper",{ref:t})}.validate`}function f(e,t,r,n){const{gen:a,it:c}=e,{allErrors:u,schemaEnv:f,opts:h}=c,d=h.passContext?s.default.this:i.nil;function p(e){const t=i._`${e}.errors`;a.assign(s.default.vErrors,i._`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,i._`${s.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;const n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==c.props)if(n&&!n.dynamicProps)void 0!==n.props&&(c.props=l.mergeEvaluated.props(a,n.props,c.props));else{const t=a.var("props",i._`${e}.evaluated.props`);c.props=l.mergeEvaluated.props(a,t,c.props,i.Name)}if(!0!==c.items)if(n&&!n.dynamicItems)void 0!==n.items&&(c.items=l.mergeEvaluated.items(a,n.items,c.items));else{const t=a.var("items",i._`${e}.evaluated.items`);c.items=l.mergeEvaluated.items(a,t,c.items,i.Name)}}n?function(){if(!f.$async)throw new Error("async schema referenced by sync schema");const r=a.let("valid");a.try(()=>{a.code(i._`await ${(0,o.callValidateCode)(e,t,d)}`),m(t),u||a.assign(r,!0)},e=>{a.if(i._`!(${e} instanceof ${c.ValidationError})`,()=>a.throw(e)),p(e),u||a.assign(r,!1)}),e.ok(r)}():e.result((0,o.callValidateCode)(e,t,d),()=>m(t),()=>p(t))}t.getValidate=u,t.callRef=f,t.default=c},3835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;const n=r(9029),o=r(3558),i=r(2023),s=r(6939),a=r(4227),l=r(2586);class c{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){const t=h.call(this,e);if(t)return t;const r=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:a,lines:c}=this.opts.code,{ownProperties:u}=this.opts,f=new n.CodeGen(this.scope,{es5:a,lines:c,ownProperties:u});let d;e.$async&&(d=f.scopeValue("Error",{ref:o.default,code:n._`require("ajv/dist/runtime/validation_error").default`}));const p=f.scopeName("validate");e.validateName=p;const m={gen:f,allErrors:this.opts.allErrors,data:i.default.data,parentData:i.default.parentData,parentDataProperty:i.default.parentDataProperty,dataNames:[i.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:p,ValidationError:d,schema:e.schema,schemaEnv:e,rootId:r,baseId:e.baseId||r,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:n._`""`,opts:this.opts,self:this};let g;try{this._compilations.add(e),(0,l.validateFunctionCode)(m),f.optimize(this.opts.code.optimize);const t=f.toString();g=`${f.scopeRefs(i.default.scope)}return ${t}`,this.opts.code.process&&(g=this.opts.code.process(g,e));const r=new Function(`${i.default.self}`,`${i.default.scope}`,g)(this,this.scope.get());if(this.scope.value(p,{ref:r}),r.errors=null,r.schema=e.schema,r.schemaEnv=e,e.$async&&(r.$async=!0),!0===this.opts.code.source&&(r.source={validateName:p,validateCode:t,scopeValues:f._values}),this.opts.unevaluated){const{props:e,items:t}=m;r.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},r.source&&(r.source.evaluated=(0,n.stringify)(r.evaluated))}return e.validate=r,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error("Error compiling schema, function code:",g),t}finally{this._compilations.delete(e)}}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function h(e){for(const t of this._compilations)if(d(t,e))return t}function d(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||m.call(this,e,t)}function m(e,t){const r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r);let o=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===o)return y.call(this,r,e);const i=(0,s.normalizeId)(n),a=this.refs[i]||this.schemas[i];if("string"==typeof a){const t=m.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return y.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||u.call(this,a),i===(0,s.normalizeId)(t)){const{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(o=(0,s.resolveUrl)(this.opts.uriResolver,o,n)),new c({schema:t,schemaId:r,root:e,baseId:o})}return y.call(this,r,a)}}t.SchemaEnv=c,t.compileSchema=u,t.resolveRef=function(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);const o=e.refs[r];if(o)return o;let i=p.call(this,e,r);if(void 0===i){const o=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;o&&(i=new c({schema:o,schemaId:s,root:e,baseId:t}))}return void 0!==i?e.refs[r]=f.call(this,i):void 0},t.getCompilingSchema=h,t.resolveSchema=m;const g=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function y(e,{baseId:t,schema:r,root:n}){var o;if("/"!==(null===(o=e.fragment)||void 0===o?void 0:o[0]))return;for(const n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;const e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;const o="object"==typeof(r=e)&&r[this.opts.schemaId];!g.has(n)&&o&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,o))}let i;if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){const e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);i=m.call(this,n,e)}const{schemaId:l}=this.opts;return i=i||new c({schema:r,schemaId:l,root:n,baseId:t}),i.schema!==i.root.schema?i:void 0}},3837:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},3853:(e,t)=>{"use strict";function r(e){const t=e.length;let r,n=0,o=0;for(;o<t;)n++,r=e.charCodeAt(o++),r>=55296&&r<=56319&&o<t&&(r=e.charCodeAt(o),56320==(64512&r)&&o++);return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},3966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(5765),s=r(5457),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,o.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,i.validateArray)(e)))}};t.default=a},4003:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>o.str`must have required property '${e}'`,params:({params:{missingProperty:e}})=>o._`{missingProperty: ${e}}`},code(e){const{gen:t,schema:r,schemaCode:s,data:a,$data:l,it:c}=e,{opts:u}=c;if(!l&&0===r.length)return;const f=r.length>=u.loopRequired;if(c.allErrors?function(){if(f||l)e.block$data(o.nil,h);else for(const t of r)(0,n.checkReportMissingProp)(e,t)}():function(){const i=t.let("missing");if(f||l){const r=t.let("valid",!0);e.block$data(r,()=>function(r,i){e.setParams({missingProperty:r}),t.forOf(r,s,()=>{t.assign(i,(0,n.propertyInData)(t,a,r,u.ownProperties)),t.if((0,o.not)(i),()=>{e.error(),t.break()})},o.nil)}(i,r)),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}(),u.strictRequired){const t=e.parentSchema.properties,{definedProperties:n}=e.it;for(const e of r)if(void 0===(null==t?void 0:t[e])&&!n.has(e)){const t=`required property "${e}" is not defined at "${c.schemaEnv.baseId+c.errSchemaPath}" (strictRequired)`;(0,i.checkStrictMode)(c,t,c.opts.strictRequired)}}function h(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,u.ownProperties),()=>e.error())})}}};t.default=s},4042:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(2586);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var o=r(9029);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return o.CodeGen}});const i=r(3558),s=r(4551),a=r(396),l=r(3835),c=r(9029),u=r(6939),f=r(208),h=r(4227),d=r(3837),p=r(5944),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";const g=["removeAdditional","useDefaults","coerceTypes"],y=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},_={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};function v(e){var t,r,n,o,i,s,a,l,c,u,f,h,d,g,y,b,_,v,w,S,E,k,I,A,P;const $=e.strict,O=null===(t=e.code)||void 0===t?void 0:t.optimize,x=!0===O||void 0===O?1:O||0,T=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:m,C=null!==(o=e.uriResolver)&&void 0!==o?o:p.default;return{strictSchema:null===(s=null!==(i=e.strictSchema)&&void 0!==i?i:$)||void 0===s||s,strictNumbers:null===(l=null!==(a=e.strictNumbers)&&void 0!==a?a:$)||void 0===l||l,strictTypes:null!==(u=null!==(c=e.strictTypes)&&void 0!==c?c:$)&&void 0!==u?u:"log",strictTuples:null!==(h=null!==(f=e.strictTuples)&&void 0!==f?f:$)&&void 0!==h?h:"log",strictRequired:null!==(g=null!==(d=e.strictRequired)&&void 0!==d?d:$)&&void 0!==g&&g,code:e.code?{...e.code,optimize:x,regExp:T}:{optimize:x,regExp:T},loopRequired:null!==(y=e.loopRequired)&&void 0!==y?y:200,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:200,meta:null===(_=e.meta)||void 0===_||_,messages:null===(v=e.messages)||void 0===v||v,inlineRefs:null===(w=e.inlineRefs)||void 0===w||w,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(E=e.addUsedSchema)||void 0===E||E,validateSchema:null===(k=e.validateSchema)||void 0===k||k,validateFormats:null===(I=e.validateFormats)||void 0===I||I,unicodeRegExp:null===(A=e.unicodeRegExp)||void 0===A||A,int32range:null===(P=e.int32range)||void 0===P||P,uriResolver:C}}class w{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...v(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:y,es5:t,lines:r}),this.logger=function(e){if(!1===e)return $;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw new Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,b,e,"NOT SUPPORTED"),S.call(this,_,e,"DEPRECATED","warn"),this._metaOpts=P.call(this),e.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&A.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),k.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){const{$data:e,meta:t,schemaId:r}=this.opts;let n=d;"id"===r&&(n={...d},n.id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){const{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(r=this.getSchema(e),!r)throw new Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);const n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){const r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw new Error("options.loadSchema should be a function");const{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await o.call(this,e.$schema);const r=this._addSchema(e,t);return r.validate||i.call(this,r)}async function o(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function i(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await l.call(this,t.missingSchema),i.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw new Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function l(e){const r=await c.call(this,e);this.refs[e]||await o.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){const t=this._loading[e];if(t)return t;try{return await(this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){if(Array.isArray(e)){for(const t of e)this.addSchema(t,void 0,r,n);return this}let o;if("object"==typeof e){const{schemaId:t}=this.opts;if(o=e[t],void 0!==o&&"string"!=typeof o)throw new Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||o),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){if("boolean"==typeof e)return!0;let r;if(r=e.$schema,void 0!==r&&"string"!=typeof r)throw new Error("$schema must be a string");if(r=r||this.opts.defaultMeta||this.defaultMeta(),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;const n=this.validate(r,e);if(!n&&t){const e="schema is invalid: "+this.errorsText();if("log"!==this.opts.validateSchema)throw new Error(e);this.logger.error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=E.call(this,e));)e=t;if(void 0===t){const{schemaId:r}=this.opts,n=new l.SchemaEnv({schema:{},schemaId:r});if(t=l.resolveSchema.call(this,n,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{const t=E.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{const t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,u.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw new Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(const t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else{if("object"!=typeof e||void 0!==t)throw new Error("invalid addKeywords parameters");if(r=(t=e).keyword,Array.isArray(r)&&!r.length)throw new Error("addKeywords: keyword must be string or non-empty array")}if(x.call(this,r,t),!t)return(0,h.eachItem)(r,e=>T.call(this,e)),this;R.call(this,t);const n={...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)};return(0,h.eachItem)(r,0===n.type.length?e=>T.call(this,e,n):e=>n.type.forEach(t=>T.call(this,e,n,t))),this}getKeyword(e){const t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){const{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(const r of t.rules){const t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){const r=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(const n of t){const t=n.split("/").slice(1);let o=e;for(const e of t)o=o[e];for(const e in r){const t=r[e];if("object"!=typeof t)continue;const{$data:n}=t.definition,i=o[e];n&&i&&(o[e]=j(i))}}return e}_removeAllSchemas(e,t){for(const r in e){const n=e[r];t&&!t.test(r)||("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,o=this.opts.addUsedSchema){let i;const{schemaId:s}=this.opts;if("object"==typeof e)i=e[s];else{if(this.opts.jtd)throw new Error("schema must be object");if("boolean"!=typeof e)throw new Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,u.normalizeId)(i||r);const c=u.getSchemaRefs.call(this,e,r);return a=new l.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:c}),this._cache.set(a.schema,a),o&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw new Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):l.compileSchema.call(this,e),!e.validate)throw new Error("ajv implementation error");return e.validate}_compileMetaSchema(e){const t=this.opts;this.opts=this._metaOpts;try{l.compileSchema.call(this,e)}finally{this.opts=t}}}function S(e,t,r,n="error"){for(const o in e){const i=o;i in t&&this.logger[n](`${r}: option ${o}. ${e[i]}`)}}function E(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function k(){const e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(const t in e)this.addSchema(e[t],t)}function I(){for(const e in this.opts.formats){const t=this.opts.formats[e];t&&this.addFormat(e,t)}}function A(e){if(Array.isArray(e))this.addVocabulary(e);else{this.logger.warn("keywords option as map is deprecated, pass array");for(const t in e){const r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}}function P(){const e={...this.opts};for(const t of g)delete e[t];return e}w.ValidationError=i.default,w.MissingRefError=s.default,t.default=w;const $={log(){},warn(){},error(){}},O=/^[a-z_$][a-z0-9_$:-]*$/i;function x(e,t){const{RULES:r}=this;if((0,h.eachItem)(e,e=>{if(r.keywords[e])throw new Error(`Keyword ${e} is already defined`);if(!O.test(e))throw new Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!("code"in t)&&!("validate"in t))throw new Error('$data keyword must have "code" or "validate" function')}function T(e,t,r){var n;const o=null==t?void 0:t.post;if(r&&o)throw new Error('keyword with "post" flag cannot have "type"');const{RULES:i}=this;let s=o?i.post:i.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},i.rules.push(s)),i.keywords[e]=!0,!t)return;const a={keyword:e,definition:{...t,type:(0,f.getJSONTypes)(t.type),schemaType:(0,f.getJSONTypes)(t.schemaType)}};t.before?C.call(this,s,a,t.before):s.rules.push(a),i.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach(e=>this.addKeyword(e))}function C(e,t,r){const n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function R(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=j(t)),e.validateSchema=this.compile(t,!0))}const N={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function j(e){return{anyOf:[e,N]}}},4227:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;const n=r(9029),o=r(1520);function i(e,t=e.schema){const{opts:r,self:n}=e;if(!r.strictSchema)return;if("boolean"==typeof t)return;const o=n.RULES.keywords;for(const r in t)o[r]||p(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(const r in e)if(t[r])return!0;return!1}function a(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function l(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function c({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:o}){return(i,s,a,l)=>{const c=void 0===a?s:a instanceof n.Name?(s instanceof n.Name?e(i,s,a):t(i,s,a),a):s instanceof n.Name?(t(i,a,s),s):r(s,a);return l!==n.Name||c instanceof n.Name?c:o(i,c)}}function u(e,t){if(!0===t)return e.var("props",!0);const r=e.var("props",n._`{}`);return void 0!==t&&f(e,r,t),r}function f(e,t,r){Object.keys(r).forEach(r=>e.assign(n._`${t}${(0,n.getProperty)(r)}`,!0))}t.toHash=function(e){const t={};for(const r of e)t[r]=!0;return t},t.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(i(e,t),!s(t,e.self.RULES.all))},t.checkUnknownRules=i,t.schemaHasRules=s,t.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(const r in e)if("$ref"!==r&&t.all[r])return!0;return!1},t.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,o,i){if(!i){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return n._`${r}`}return n._`${e}${t}${(0,n.getProperty)(o)}`},t.unescapeFragment=function(e){return l(decodeURIComponent(e))},t.escapeFragment=function(e){return encodeURIComponent(a(e))},t.escapeJsonPointer=a,t.unescapeJsonPointer=l,t.eachItem=function(e,t){if(Array.isArray(e))for(const r of e)t(r);else t(e)},t.mergeEvaluated={props:c({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,()=>{e.if(n._`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,n._`${r} || {}`).code(n._`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,n._`${r} || {}`),f(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:u}),items:c({mergeNames:(e,t,r)=>e.if(n._`${r} !== true && ${t} !== undefined`,()=>e.assign(r,n._`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if(n._`${r} !== true`,()=>e.assign(r,!0===t||n._`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})},t.evaluatedPropsToName=u,t.setEvaluated=f;const h={};var d;function p(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw new Error(t);e.self.logger.warn(t)}}t.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new o._Code(t.code))})},function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(d||(t.Type=d={})),t.getErrorPath=function(e,t,r){if(e instanceof n.Name){const o=t===d.Num;return r?o?n._`"[" + ${e} + "]"`:n._`"['" + ${e} + "']"`:o?n._`"/" + ${e}`:n._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,n.getProperty)(e).toString():"/"+a(e)},t.checkStrictMode=p},4426:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=o},4486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxProperties"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:o}=e,i="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data(n._`Object.keys(${r}).length ${i} ${o}`)}};t.default=o},4495:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;const n=r(9029),o=r(4227);t.getSubschema=function(e,{keyword:t,schemaProp:r,schema:i,schemaPath:s,errSchemaPath:a,topSchemaRef:l}){if(void 0!==t&&void 0!==i)throw new Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){const i=e.schema[t];return void 0===r?{schema:i,schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:i[r],schemaPath:n._`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,o.escapeFragment)(r)}`}}if(void 0!==i){if(void 0===s||void 0===a||void 0===l)throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:i,schemaPath:s,topSchemaRef:l,errSchemaPath:a}}throw new Error('either "keyword" or "schema" must be passed')},t.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:i,data:s,dataTypes:a,propertyName:l}){if(void 0!==s&&void 0!==r)throw new Error('both "data" and "dataProp" passed, only one allowed');const{gen:c}=t;if(void 0!==r){const{errorPath:s,dataPathArr:a,opts:l}=t;u(c.let("data",n._`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=n.str`${s}${(0,o.getErrorPath)(r,i,l.jsPropertySyntax)}`,e.parentDataProperty=n._`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(u(s instanceof n.Name?s:c.let("data",s,!0)),void 0!==l&&(e.propertyName=l)),a&&(e.dataTypes=a)},t.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:o,allErrors:i}){void 0!==n&&(e.compositeRule=n),void 0!==o&&(e.createErrors=o),void 0!==i&&(e.allErrors=i),e.jtdDiscriminator=t,e.jtdMetadata=r}},4551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(6939);class o extends Error{constructor(e,t,r,o){super(o||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=o},4737:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>n.str`must match format "${e}"`,params:({schemaCode:e})=>n._`{format: ${e}}`},code(e,t){const{gen:r,data:o,$data:i,schema:s,schemaCode:a,it:l}=e,{opts:c,errSchemaPath:u,schemaEnv:f,self:h}=l;c.validateFormats&&(i?function(){const i=r.scopeValue("formats",{ref:h.formats,code:c.code.formats}),s=r.const("fDef",n._`${i}[${a}]`),l=r.let("fType"),u=r.let("format");r.if(n._`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>r.assign(l,n._`${s}.type || "string"`).assign(u,n._`${s}.validate`),()=>r.assign(l,n._`"string"`).assign(u,s)),e.fail$data((0,n.or)(!1===c.strictSchema?n.nil:n._`${a} && !${u}`,function(){const e=f.$async?n._`(${s}.async ? await ${u}(${o}) : ${u}(${o}))`:n._`${u}(${o})`,r=n._`(typeof ${u} == "function" ? ${e} : ${u}.test(${o}))`;return n._`${u} && ${u} !== true && ${l} === ${t} && !${r}`}()))}():function(){const i=h.formats[s];if(!i)return void function(){if(!1!==c.strictSchema)throw new Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${u}"`}h.logger.warn(e())}();if(!0===i)return;const[a,l,d]=function(e){const t=e instanceof RegExp?(0,n.regexpCode)(e):c.code.formats?n._`${c.code.formats}${(0,n.getProperty)(s)}`:void 0,o=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,o]:[e.type||"string",e.validate,n._`${o}.validate`]}(i);a===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!f.$async)throw new Error("async format in sync schema");return n._`await ${d}(${o})`}return"function"==typeof l?n._`${d}(${o})`:n._`${d}.test(${o})`}())}())}};t.default=o},4834:e=>{"use strict";const t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(r=e[n].charCodeAt(0),48!==r){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(r=e[n].charCodeAt(0),!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}const o=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function i(e){return e.length=0,!0}function s(e,t,r){if(e.length){const o=n(e);if(""===o)return r.error=!0,!1;t.push(o),e.length=0}return!0}function a(e){if(function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(e)<2)return{host:e,isIPV6:!1};const t=function(e){let t=0;const r={error:!1,address:"",zone:""},o=[],a=[];let l=!1,c=!1,u=s;for(let n=0;n<e.length;n++){const s=e[n];if("["!==s&&"]"!==s)if(":"!==s)if("%"===s){if(!u(a,o,r))break;u=i}else a.push(s);else{if(!0===l&&(c=!0),!u(a,o,r))break;if(++t>7){r.error=!0;break}n>0&&":"===e[n-1]&&(l=!0),o.push(":")}}return a.length&&(u===i?r.zone=a.join(""):c?o.push(a.join("")):o.push(n(a))),r.address=o.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}e.exports={nonSimpleDomain:o,recomposeAuthority:function(e){const t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!r(n)){const t=a(n);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){const r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e;const r=[];let n=-1,o=0;for(;o=t.length;){if(1===o){if("."===t)break;if("/"===t){r.push("/");break}r.push(t);break}if(2===o){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===o&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(n=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")},isIPv4:r,isUUID:t,normalizeIPv6:a,stringArrayToHexStripped:n}},5333:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(4227),s=r(4227),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){const{gen:t,schema:r,data:a,parentSchema:l,it:c}=e,{opts:u}=c,f=(0,n.allSchemaProperties)(r),h=f.filter(e=>(0,i.alwaysValidSchema)(c,r[e]));if(0===f.length||h.length===f.length&&(!c.opts.unevaluated||!0===c.props))return;const d=u.strictSchema&&!u.allowMatchingProperties&&l.properties,p=t.name("valid");!0===c.props||c.props instanceof o.Name||(c.props=(0,s.evaluatedPropsToName)(t,c.props));const{props:m}=c;function g(e){for(const t in d)new RegExp(e).test(t)&&(0,i.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function y(r){t.forIn("key",a,i=>{t.if(o._`${(0,n.usePattern)(e,r)}.test(${i})`,()=>{const n=h.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:i,dataPropType:s.Type.Str},p),c.opts.unevaluated&&!0!==m?t.assign(o._`${m}[${i}]`,!0):n||c.allErrors||t.if((0,o.not)(p),()=>t.break())})})}!function(){for(const e of f)d&&g(e),c.allErrors?y(e):(t.var(p,!0),y(e),t.if(p))}()}};t.default=a},5354:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(494),o={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=o},5457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;const n=r(9029),o=r(4227),i={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>n.str`must NOT have more than ${e} items`,params:({params:{len:e}})=>n._`{limit: ${e}}`},code(e){const{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?s(e,n):(0,o.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}};function s(e,t){const{gen:r,schema:i,data:s,keyword:a,it:l}=e;l.items=!0;const c=r.const("len",n._`${s}.length`);if(!1===i)e.setParams({len:t.length}),e.pass(n._`${c} <= ${t.length}`);else if("object"==typeof i&&!(0,o.alwaysValidSchema)(l,i)){const i=r.var("valid",n._`${c} <= ${t.length}`);r.if((0,n.not)(i),()=>function(i){r.forRange("i",t.length,c,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:o.Type.Num},i),l.allErrors||r.if((0,n.not)(i),()=>r.break())})}(i)),e.ok(i)}}t.validateAdditionalItems=s,t.default=i},5606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var a,l=[],c=!1,u=-1;function f(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new d(e,t)),1!==l.length||c||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5765:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;const n=r(9029),o=r(4227),i=r(2023),s=r(4227);function a(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:n._`Object.prototype.hasOwnProperty`})}function l(e,t,r){return n._`${a(e)}.call(${t}, ${r})`}function c(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} === undefined`;return o?(0,n.or)(i,(0,n.not)(l(e,t,r))):i}function u(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}t.checkReportMissingProp=function(e,t){const{gen:r,data:o,it:i}=e;r.if(c(r,o,t,i.opts.ownProperties),()=>{e.setParams({missingProperty:n._`${t}`},!0),e.error()})},t.checkMissingProp=function({gen:e,data:t,it:{opts:r}},o,i){return(0,n.or)(...o.map(o=>(0,n.and)(c(e,t,o,r.ownProperties),n._`${i} = ${o}`)))},t.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},t.hasPropFunc=a,t.isOwnProperty=l,t.propertyInData=function(e,t,r,o){const i=n._`${t}${(0,n.getProperty)(r)} !== undefined`;return o?n._`${i} && ${l(e,t,r)}`:i},t.noPropertyInData=c,t.allSchemaProperties=u,t.schemaProperties=function(e,t){return u(t).filter(r=>!(0,o.alwaysValidSchema)(e,t[r]))},t.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:o,schemaPath:s,errorPath:a},it:l},c,u,f){const h=f?n._`${e}, ${t}, ${o}${s}`:t,d=[[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,a)],[i.default.parentData,l.parentData],[i.default.parentDataProperty,l.parentDataProperty],[i.default.rootData,i.default.rootData]];l.opts.dynamicRef&&d.push([i.default.dynamicAnchors,i.default.dynamicAnchors]);const p=n._`${h}, ${r.object(...d)}`;return u!==n.nil?n._`${c}.call(${u}, ${p})`:n._`${c}(${p})`};const f=n._`new RegExp`;t.usePattern=function({gen:e,it:{opts:t}},r){const o=t.unicodeRegExp?"u":"",{regExp:i}=t.code,a=i(r,o);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:n._`${"new RegExp"===i.code?f:(0,s.useFunc)(e,i)}(${r}, ${o})`})},t.validateArray=function(e){const{gen:t,data:r,keyword:i,it:s}=e,a=t.name("valid");if(s.allErrors){const e=t.let("valid",!0);return l(()=>t.assign(e,!1)),e}return t.var(a,!0),l(()=>t.break()),a;function l(s){const l=t.const("len",n._`${r}.length`);t.forRange("i",0,l,r=>{e.subschema({keyword:i,dataProp:r,dataPropType:o.Type.Num},a),t.if((0,n.not)(a),s)})}},t.validateUnion=function(e){const{gen:t,schema:r,keyword:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(r.some(e=>(0,o.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;const a=t.let("valid",!1),l=t.name("_valid");t.block(()=>r.forEach((r,o)=>{const s=e.subschema({keyword:i,schemaProp:o,compositeRule:!0},l);t.assign(a,n._`${a} || ${l}`),e.mergeValidEvaluated(s,l)||t.if((0,n.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}},5844:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"allOf",schemaType:"array",code(e){const{gen:t,schema:r,it:o}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");const i=t.name("valid");r.forEach((t,r)=>{if((0,n.alwaysValidSchema)(o,t))return;const s=e.subschema({keyword:"allOf",schemaProp:r},i);e.ok(i),e.mergeEvaluated(s)})}};t.default=o},5882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=n.operators,i={maximum:{okStr:"<=",ok:o.LTE,fail:o.GT},minimum:{okStr:">=",ok:o.GTE,fail:o.LT},exclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},exclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},s={message:({keyword:e,schemaCode:t})=>n.str`must be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>n._`{comparison: ${i[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(i),type:"number",schemaType:"number",$data:!0,error:s,code(e){const{keyword:t,data:r,schemaCode:o}=e;e.fail$data(n._`${r} ${i[t].fail} ${o} || isNaN(${r})`)}};t.default=a},5944:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(8343);n.code='require("ajv/dist/runtime/uri").default',t.default=n},6144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2128),o=r(7060),i=r(6378),s=r(7532),a=r(9857),l=[n.default,o.default,(0,i.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=l},6163:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>n._`{passingSchemas: ${e.passing}}`},code(e){const{gen:t,schema:r,parentSchema:i,it:s}=e;if(!Array.isArray(r))throw new Error("ajv implementation error");if(s.opts.discriminator&&i.discriminator)return;const a=r,l=t.let("valid",!1),c=t.let("passing",null),u=t.name("_valid");e.setParams({passing:c}),t.block(function(){a.forEach((r,i)=>{let a;(0,o.alwaysValidSchema)(s,r)?t.var(u,!0):a=e.subschema({keyword:"oneOf",schemaProp:i,compositeRule:!0},u),i>0&&t.if(n._`${u} && ${l}`).assign(l,!1).assign(c,n._`[${c}, ${i}]`).else(),t.if(u,()=>{t.assign(l,!0),t.assign(c,i),a&&e.mergeEvaluated(a,n.Name)})})}),e.result(l,()=>e.reset(),()=>e.error(!0))}};t.default=i},6171:(e,t,r)=>{const n=r(1072),o=r(3030),i=r(8665),s=r(7007),{nanoid:a}=r(3561);class l extends s{constructor({username:e,password:t,token:r,domain:n="vrpc",agent:o=a(8),broker:s="mqtts://broker.hivemq.com:8883",log:c="console",bestEffort:u=!1,version:f="",mqttClientId:h=null}={}){super(),this._validateDomain(n),this._validateAgent(o),this._username=e,this._password=t,this._token=r,this._agent=o,this._domain=n,this._broker=s,this._qos=u?0:1,this._version=f,this._mqttClientId=h||`va3${l._createHash(this._domain+this._agent)}`,"console"===c?(this._log=console,this._log.debug=()=>{}):this._log=c,this._baseTopic=`${this._domain}/${this._agent}`,i.onCallback(this._handleVrpcCallback.bind(this)),this._isolatedInstances=new Map,this._sharedInstances=new Map,this.on("error",e=>{this._log.debug(`Encountered an error: ${e.message}`)})}async serve(){let e=this._username,t=this._password;return this._token?(e=`${this._domain}/${this._agent}`,t=this._token):this._password||(e=`${this._domain}/${this._agent}`,t=a()),this._options={username:e,password:t,keepalive:30,connectTimeout:1e4,clientId:this._mqttClientId,rejectUnauthorized:!1,will:{topic:`${this._baseTopic}/__agentInfo__`,payload:this._createAgentInfoPayload({status:"offline"}),qos:this._qos,retain:!0}},this._log.info(`Domain : ${this._domain}`),this._log.info(`Agent : ${this._agent}`),this._log.info(`Broker : ${this._broker}`),this._log.info("Connecting to MQTT server..."),this._client=o.connect(this._broker,this._options),this._client.on("connect",this._handleConnect.bind(this)),this._client.on("reconnect",this._handleReconnect.bind(this)),this._client.on("error",this._handleError.bind(this)),this._client.on("message",this._handleMessage.bind(this)),this._client.on("close",this._handleClose.bind(this)),this._client.on("offline",this._handleOffline.bind(this)),this._client.on("end",this._handleEnd.bind(this)),this._ensureConnected()}async end({unregister:e=!1}={}){try{if(!this._client||!this._client.connected)return void this.emit("end");const t=`${this._baseTopic}/__agentInfo__`;if(this._mqttPublish(t,this._createAgentInfoPayload({status:"offline"}),{retain:!0}),e){this._mqttPublish(t,null,{retain:!0});const e=this._getClasses();for(const t of e){const e=`${this._baseTopic}/${t}/__classInfo__`;this._mqttPublish(e,null,{retain:!0})}}await new Promise(e=>this._client.end(!1,{},e))}catch(e){this._log.error(e,`Problem during disconnecting agent: ${e.message}`)}}static _createHash(e,t=20){let r=5381,n=52711;for(let t=0;t<e.length;t++){const o=e.charCodeAt(t);r=33*r^o,n=33*n^o}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_validateDomain(e){if(!e)throw new Error("The domain must be specified");if(e.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"')}_validateAgent(e){if(!e)throw new Error("The agent must be specified");if(e.match(/[+/#*]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#", "*"')}_createAgentInfoPayload({status:e}){return JSON.stringify({status:e,hostname:n.hostname(),version:this._version,v:3})}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&this._log.warn(`Could not publish MQTT message because: ${e.message}`)})}_mqttSubscribe(e,t){this._client.subscribe(e,{qos:this._qos,...t},(r,n)=>{if(r)this._log.warn(`Could not subscribe to topic(s) '${e}', because: ${r.message}`);else{const o=Array.isArray(e)?e:[e],i=n.filter(e=>128===e.qos).map(e=>e.topic);i.length>0&&((r=new Error(`Could not subscribe all ${o.length} topic(s) but got error qos=128 on following ${i.length} topic(s): ${i}`)).code="SUBSCRIBE_FAILED",r.subscribeOptions=t,this._log.error(r),this.emit("error",r));const s=n.filter(e=>e.qos<this._qos);s.length>0&&((r=new Error(`Could not subscribe all ${o.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${s.length} topic(s): ${JSON.stringify(s)}`)).code="SUBSCRIBE_REDUCED_QOS",r.subscribeOptions=t,this._log.warn(r),this.emit("error",r)),0===n.length&&this._log.debug(`Already subscribed to topic '${e}'`)}})}_mqttUnsubscribe(e,t){this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`)})}_getClasses(){return i._getClassesArray()}_getInstances(e){return i._getInstancesArray(e)}_getMemberFunctions(e){return i._getMemberFunctionsArray(e)}_getStaticFunctions(e){return i._getStaticFunctionsArray(e)}_getMetaData(e){return i._getMetaData(e)}async _ensureConnected(){return new Promise(e=>{this._client.connected?e():(this._client.once("connect",e),this.once("end",e))})}_handleVrpcCallback(e){const{s:t,i:r,r:n,e:o,a:i}=e,s=r.startsWith("__e__")?r.slice(5):t;try{this._log.debug(`Forwarding callback to: ${s} with payload:`,e),this._mqttPublish(s,l._stringifySafely({a:i,r:n,e:o,i:r,v:3}))}catch(e){this._log.warn(e,`Problem publishing vrpc callback to ${s} because of: ${e.message}`)}}static _stringifySafely(e){let t;const{c:r,f:n}=e;try{t=JSON.stringify(e)}catch(o){this._log.debug(`Failed serialization of return value for: ${r}::${n}, because: ${o.message}`),e.r="__vrpc::not-serializable__",t=JSON.stringify(e)}return t}_handleConnect(){this._log.info("[OK]");try{const e=this._generateTopics();e.length>0&&this._mqttSubscribe(e)}catch(e){this._log.error(e,`Problem during initial topic subscription: ${e.message}`)}this._publishAgentInfoMessage(),this._getClasses().forEach(e=>{this._publishClassInfoMessage(e)});for(const[e,{className:t}]of i._instances.entries())this._subscribeToMethodsOfNewInstance(t,e);this.emit("connect")}_publishAgentInfoMessage(){this._mqttPublish(`${this._baseTopic}/__agentInfo__`,this._createAgentInfoPayload({status:"online"}),{retain:!0})}_publishClassInfoMessage(e){const t={className:e,instances:this._getInstances(e),memberFunctions:this._getMemberFunctions(e),staticFunctions:this._getStaticFunctions(e),meta:this._getMetaData(e),v:3};try{this._mqttPublish(`${this._baseTopic}/${e}/__classInfo__`,JSON.stringify(t),{retain:!0})}catch(e){this._log.error(e,`Problem during publishing class info: ${e.message}`)}}_generateTopics(){const e=[],t=this._getClasses();return t.length>0?this._log.info(`Registering classes: ${t.join(", ")}`):this._log.warn("No classes are registered"),t.forEach(t=>{this._getStaticFunctions(t).forEach(r=>{e.push(`${this._baseTopic}/${t}/__static__/${r}`)})}),e}_handleMessage(e,t){try{const r=JSON.parse(t.toString());this._log.debug(`Message arrived with topic: ${e} and payload:`,r);const n=e.split("/"),[,,o,s,a]=n;if(4===n.length&&"__clientInfo__"===n[3])return void this._handleClientInfoMessage(e,r);if(5!==n.length)return void this._log.warn(`Ignoring message with invalid topic: ${e}`);switch(r.c="__static__"===s?o:s,r.f=a,i._call(r)&&this._mqttSubscribe(`${r.s}/__clientInfo__`),a){case"__createIsolated__":{const e=r.r;this._subscribeToMethodsOfNewInstance(o,e),this._registerIsolatedInstance(e,r.s);break}case"__createShared__":{const e=r.r;this._hasSharedInstance(e)||(this._subscribeToMethodsOfNewInstance(o,e),this._publishClassInfoMessage(o)),this._registerSharedInstance(e,r.s);break}case"__delete__":this._unsubscribeMethodsOfDeletedInstance(o,s),this._unregisterInstance(r.a[0],r.s)&&this._publishClassInfoMessage(o)}const{a:c,r:u,e:f,i:h,v:d}=r,p=f?{a:c,r:u,e:f,i:h,v:d}:{a:c,r:u,i:h,v:d};this._mqttPublish(r.s,l._stringifySafely(p))}catch(e){this._log.error(e,`Problem while handling incoming message: ${e.message}`)}}_handleClientInfoMessage(e,t){const r=e.slice(0,-15);if("offline"===t.status){i._unregisterClient(r);const e=this._isolatedInstances.get(r);e&&e.forEach(e=>{const t={f:"__delete__",a:[e],r:null,s:i.LOCAL_SENDER};i._call(t),t.r&&this._log.debug(`Auto-deleted isolated instance: ${e}`)}),this._mqttUnsubscribe(`${r}/__clientInfo__`),this.emit("clientGone",r,{clientId:t.clientId})}}_registerIsolatedInstance(e,t){const r=this._isolatedInstances.get(t);r?r.add(e):(this._isolatedInstances.set(t,new Set([e])),this._sharedInstances.has(t)||this._mqttSubscribe(`${t}/__clientInfo__`),this._log.info(`Tracking lifetime of client: ${t}`))}_registerSharedInstance(e,t){const r=this._sharedInstances.get(t);r?r.add(e):(this._sharedInstances.set(t,new Set([e])),this._isolatedInstances.has(t)||this._mqttSubscribe(`${t}/__clientInfo__`),this._log.debug(`Tracking lifetime of client: ${t}`))}_hasSharedInstance(e){for(const[,t]of this._sharedInstances)if(t.has(e))return!0;return!1}_unregisterInstance(e,t){const r=this._isolatedInstances.get(t);if(r&&r.has(e))return r.delete(e),0===r.size&&(this._isolatedInstances.delete(t),this._mqttUnsubscribe(`${t}/__clientInfo__`),this._log.debug(`Stopped tracking lifetime of client: ${t}`)),!1;let n=!1;return this._sharedInstances.forEach(async r=>{r.has(e)&&(n=!0,r.delete(e),0===r.size&&(this._sharedInstances.delete(t),this._mqttUnsubscribe(`${t}/__clientInfo__`),this._log.debug(`Stopped tracking lifetime of client: ${t}`)))}),!!n||(this._log.warn(`Failed un-registering not registered instance: ${e}`),!1)}_subscribeToMethodsOfNewInstance(e,t){const r=`${this._baseTopic}/${e}/${t}/+`;this._mqttSubscribe(r),this._log.debug(`Subscribed to new topic after instantiation: ${r}`)}_unsubscribeMethodsOfDeletedInstance(e,t){const r=`${this._baseTopic}/${e}/${t}/+`;this._mqttUnsubscribe(r),this._log.debug(`Unsubscribed from topic after deletion: ${r}`)}_handleReconnect(){this._log.warn(`Reconnecting to ${this._broker}`),this.emit("reconnect")}_handleError(e){this.emit("error",e)}_handleClose(){this.emit("close")}_handleOffline(){this.emit("offline")}_handleEnd(){this.emit("end")}}e.exports=l},6250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2017);n.code='require("ajv/dist/runtime/equal").default',t.default=n},6378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5457),o=r(5354),i=r(494),s=r(3966),a=r(2661),l=r(3025),c=r(9713),u=r(8660),f=r(117),h=r(5333),d=r(7923),p=r(6505),m=r(6163),g=r(5844),y=r(1239),b=r(4426);t.default=function(e=!1){const t=[d.default,p.default,m.default,g.default,y.default,b.default,c.default,u.default,l.default,f.default,h.default];return e?t.push(o.default,s.default):t.push(n.default,i.default),t.push(a.default),t}},6505:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(5765).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},6653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(7652),i=r(3835),s=r(4551),a=r(4227),l={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===o.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>n._`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){const{gen:t,data:r,schema:l,parentSchema:c,it:u}=e,{oneOf:f}=c;if(!u.opts.discriminator)throw new Error("discriminator: requires discriminator option");const h=l.propertyName;if("string"!=typeof h)throw new Error("discriminator: requires propertyName");if(l.mapping)throw new Error("discriminator: mapping is not supported");if(!f)throw new Error("discriminator: requires oneOf keyword");const d=t.let("valid",!1),p=t.const("tag",n._`${r}${(0,n.getProperty)(h)}`);function m(r){const o=t.name("valid"),i=e.subschema({keyword:"oneOf",schemaProp:r},o);return e.mergeEvaluated(i,n.Name),o}t.if(n._`typeof ${p} == "string"`,()=>function(){const r=function(){var e;const t={},r=o(c);let n=!0;for(let t=0;t<f.length;t++){let c=f[t];if((null==c?void 0:c.$ref)&&!(0,a.schemaHasRulesButRef)(c,u.self.RULES)){const e=c.$ref;if(c=i.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e),c instanceof i.SchemaEnv&&(c=c.schema),void 0===c)throw new s.default(u.opts.uriResolver,u.baseId,e)}const d=null===(e=null==c?void 0:c.properties)||void 0===e?void 0:e[h];if("object"!=typeof d)throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${h}"`);n=n&&(r||o(c)),l(d,t)}if(!n)throw new Error(`discriminator: "${h}" must be required`);return t;function o({required:e}){return Array.isArray(e)&&e.includes(h)}function l(e,t){if(e.const)d(e.const,t);else{if(!e.enum)throw new Error(`discriminator: "properties/${h}" must have "const" or "enum"`);for(const r of e.enum)d(r,t)}}function d(e,r){if("string"!=typeof e||e in t)throw new Error(`discriminator: "${h}" values must be unique strings`);t[e]=r}}();t.if(!1);for(const e in r)t.elseIf(n._`${p} === ${e}`),t.assign(d,m(r[e]));t.else(),e.error(!1,{discrError:o.DiscrError.Mapping,tag:p,tagName:h}),t.endIf()}(),()=>e.error(!1,{discrError:o.DiscrError.Tag,tag:p,tagName:h})),e.ok(d)}};t.default=l},6939:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;const n=r(4227),o=r(2017),i=r(7106),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);t.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!l(e):!!t&&c(e)<=t)};const a=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function l(e){for(const t in e){if(a.has(t))return!0;const r=e[t];if(Array.isArray(r)&&r.some(l))return!0;if("object"==typeof r&&l(r))return!0}return!1}function c(e){let t=0;for(const r in e){if("$ref"===r)return 1/0;if(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],e=>t+=c(e)),t===1/0))return 1/0}return t}function u(e,t="",r){!1!==r&&(t=d(t));const n=e.parse(t);return f(e,n)}function f(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=u,t._getFullPath=f;const h=/#\/?$/;function d(e){return e?e.replace(h,""):""}t.normalizeId=d,t.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};const p=/^[a-z_][-a-z0-9._]*$/i;t.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};const{schemaId:r,uriResolver:n}=this.opts,s=d(e[r]||t),a={"":s},l=u(n,s,!1),c={},f=new Set;return i(e,{allKeys:!0},(e,t,n,o)=>{if(void 0===o)return;const i=l+t;let s=a[o];function u(t){const r=this.opts.uriResolver.resolve;if(t=d(s?r(s,t):t),f.has(t))throw m(t);f.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?h(e,n.schema,t):t!==d(i)&&("#"===t[0]?(h(e,c[t],t),c[t]=e):this.refs[t]=i),t}function g(e){if("string"==typeof e){if(!p.test(e))throw new Error(`invalid anchor "${e}"`);u.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=u.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),a[t]=s}),c;function h(e,t,r){if(void 0!==t&&!o(e,t))throw m(r)}function m(e){return new Error(`reference "${e}" resolves to more than one schema`)}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise(function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}m(e,t,i,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&m(e,"error",t,{once:!0})}(e,o)})},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var o,i,s,c;if(a(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),s=i[t]),void 0===s)s=i[t]=r,++e._eventsCount;else if("function"==typeof s?s=i[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=l(e))>0&&s.length>o&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=u.bind(n);return o.listener=r,n.wrapFn=o,o}function h(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):p(o,o.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function m(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function o(i){n.once&&e.removeEventListener(t,o),r(i)})}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return l(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=i[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},i.prototype.addListener=function(e,t){return c(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return c(this,e,t,!0)},i.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},i.prototype.listenerCount=d,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5882),o=r(3439),i=r(7307),s=r(422),a=r(4486),l=r(4003),c=r(1163),u=r(617),f=r(7935),h=r(8643),d=[n.default,o.default,i.default,s.default,a.default,l.default,c.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},f.default,h.default];t.default=d},7106:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={}),r(t,"function"==typeof(n=t.cb||n)?n:n.pre||function(){},n.post||function(){},e,"",e)};function r(e,o,i,s,a,l,c,u,f,h){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var d in o(s,a,l,c,u,f,h),s){var p=s[d];if(Array.isArray(p)){if(d in t.arrayKeywords)for(var m=0;m<p.length;m++)r(e,o,i,p[m],a+"/"+d+"/"+m,l,a,d,s,m)}else if(d in t.propsKeywords){if(p&&"object"==typeof p)for(var g in p)r(e,o,i,p[g],a+"/"+d+"/"+n(g),l,a,d,s,g)}else(d in t.keywords||e.allKeys&&!(d in t.skipKeywords))&&r(e,o,i,p,a+"/"+d,l,a,d,s)}i(s,a,l,c,u,f,h)}}function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},7307:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(3853),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){const r="maxLength"===e?"more":"fewer";return n.str`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>n._`{limit: ${e}}`},code(e){const{keyword:t,data:r,schemaCode:s,it:a}=e,l="maxLength"===t?n.operators.GT:n.operators.LT,c=!1===a.opts.unicode?n._`${r}.length`:n._`${(0,o.useFunc)(e.gen,i.default)}(${r})`;e.fail$data(n._`${c} ${l} ${s}`)}};t.default=s},7532:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=[r(4737).default];t.default=n},7652:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},7845:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;const n=r(1520);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}var i;!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(i||(t.UsedValueState=i={})),t.varKinds={const:new n.Name("const"),let:new n.Name("let"),var:new n.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof n.Name?e:this.name(e)}name(e){return new n.Name(this._newName(e))}_newName(e){return`${e}${(this._names[e]||this._nameGroup(e)).index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends n.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=n._`.${new n.Name(t)}[${r}]`}}t.ValueScopeName=a;const l=n._`\n`;t.ValueScope=class extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?l:n.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw new Error("CodeGen: ref must be passed in value");const n=this.toName(e),{prefix:o}=n,i=null!==(r=t.key)&&void 0!==r?r:t.ref;let s=this._values[o];if(s){const e=s.get(i);if(e)return e}else s=this._values[o]=new Map;s.set(i,n);const a=this._scope[o]||(this._scope[o]=[]),l=a.length;return a[l]=t.ref,n.setValue(t,{property:o,itemIndex:l}),n}getValue(e,t){const r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw new Error(`CodeGen: name "${t}" has no value`);return n._`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw new Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},a){let l=n.nil;for(const c in e){const u=e[c];if(!u)continue;const f=s[c]=s[c]||new Map;u.forEach(e=>{if(f.has(e))return;f.set(e,i.Started);let s=r(e);if(s){const r=this.opts.es5?t.varKinds.var:t.varKinds.const;l=n._`${l}${r} ${e} = ${s};${this.opts._n}`}else{if(!(s=null==a?void 0:a(e)))throw new o(e);l=n._`${l}${s}${this.opts._n}`}f.set(e,i.Completed)})}return l}}},7870:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;const n=r(9029),o=r(4227);function i(e,t,r){const{gen:i,compositeRule:s,data:a,opts:l}=e;if(void 0===r)return;const c=n._`${a}${(0,n.getProperty)(t)}`;if(s)return void(0,o.checkStrictMode)(e,`default is ignored for: ${c}`);let u=n._`${c} === undefined`;"empty"===l.useDefaults&&(u=n._`${u} || ${c} === null || ${c} === ""`),i.if(u,n._`${c} = ${(0,n.stringify)(r)}`)}t.assignDefaults=function(e,t){const{properties:r,items:n}=e.schema;if("object"===t&&r)for(const t in r)i(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,r)=>i(e,r,t.default))}},7887:(e,t)=>{"use strict";function r(e,t){return t.rules.some(t=>n(e,t))}function n(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=function({schema:e,self:t},n){const o=t.RULES.types[n];return o&&!0!==o&&r(e,o)},t.shouldUseGroup=r,t.shouldUseRule=n},7923:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4227),o={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){const{gen:t,schema:r,it:o}=e;if((0,n.alwaysValidSchema)(o,r))return void e.fail();const i=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},i),e.failResult(i,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t.default=o},7935:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>n._`{allowedValue: ${e}}`},code(e){const{gen:t,data:r,$data:s,schemaCode:a,schema:l}=e;s||l&&"object"==typeof l?e.fail$data(n._`!${(0,o.useFunc)(t,i.default)}(${r}, ${a})`):e.fail(n._`${l} !== ${r}`)}};t.default=s},8343:(e,t,r)=>{"use strict";const{normalizeIPv6:n,removeDotSegments:o,recomposeAuthority:i,normalizeComponentEncoding:s,isIPv4:a,nonSimpleDomain:l}=r(4834),{SCHEMES:c,getSchemeHandler:u}=r(343);function f(e,t,r,n){const i={};return n||(e=p(h(e,r),r),t=p(h(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=o(t.path||""),i.query=t.query):(t.path?("/"===t.path[0]?i.path=o(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=o(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function h(e,t){const r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],a=u(n.scheme||r.scheme);a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&s.push(r.scheme,":");const l=i(r);if(void 0!==l&&("suffix"!==n.reference&&s.push("//"),s.push(l),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=o(e)),void 0===l&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}const d=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(e,t){const r=Object.assign({},t),o={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0};let i=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);const s=e.match(d);if(s){if(o.scheme=s[1],o.userinfo=s[3],o.host=s[4],o.port=parseInt(s[5],10),o.path=s[6]||"",o.query=s[7],o.fragment=s[8],isNaN(o.port)&&(o.port=s[5]),o.host)if(!1===a(o.host)){const e=n(o.host);o.host=e.host.toLowerCase(),i=e.isIPV6}else i=!0;void 0!==o.scheme||void 0!==o.userinfo||void 0!==o.host||void 0!==o.port||void 0!==o.query||o.path?void 0===o.scheme?o.reference="relative":void 0===o.fragment?o.reference="absolute":o.reference="uri":o.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==o.reference&&(o.error=o.error||"URI is not a "+r.reference+" reference.");const t=u(r.scheme||o.scheme);if(!(r.unicodeSupport||t&&t.unicodeSupport)&&o.host&&(r.domainHost||t&&t.domainHost)&&!1===i&&l(o.host))try{o.host=URL.domainToASCII(o.host.toLowerCase())}catch(e){o.error=o.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==o.scheme&&(o.scheme=unescape(o.scheme)),void 0!==o.host&&(o.host=unescape(o.host))),o.path&&(o.path=escape(unescape(o.path))),o.fragment&&(o.fragment=encodeURI(decodeURIComponent(o.fragment)))),t&&t.parse&&t.parse(o,r)}else o.error=o.error||"URI can not be parsed.";return o}const m={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=h(p(e,t),t):"object"==typeof e&&(e=p(h(e,t),t)),e},resolve:function(e,t,r){const n=r?Object.assign({scheme:"null"},r):{scheme:"null"},o=f(p(e,n),p(t,n),n,!0);return n.skipEscape=!0,h(o,n)},resolveComponent:f,equal:function(e,t,r){return"string"==typeof e?(e=unescape(e),e=h(s(p(e,r),!0),{...r,skipEscape:!0})):"object"==typeof e&&(e=h(s(e,!0),{...r,skipEscape:!0})),"string"==typeof t?(t=unescape(t),t=h(s(p(t,r),!0),{...r,skipEscape:!0})):"object"==typeof t&&(t=h(s(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:h,parse:p};e.exports=m,e.exports.default=m,e.exports.fastUri=m},8577:(e,t,r)=>{var n=r(5606);const o=r(1072),{nanoid:i}=r(3561),s=r(3030),a=r(7007),l=r(3530);class c extends a{constructor({token:e,password:t,username:r,domain:n,agent:o="*",broker:s="mqtts://broker.hivemq.com:8883",timeout:c=12e3,log:u="console",bestEffort:f=!0,mqttClientId:h=null,identity:d=null,keepalive:p=30,requiresSchema:m=!1}={}){if(super(),!n)throw new Error("The domain must be specified");if(n.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"');if(o.match(/[+/#]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#"');if(d&&d.match(/[+/#$]/))throw new Error('The identity must NOT contain any of those characters: "+", "/", "#", "$"');if(null!=h){if("string"!=typeof h||0===h.length)throw new Error("The mqttClientId must be a non-empty string");if(h.match(/[+/#]/))throw new Error('The mqttClientId must NOT contain any of those characters: "+", "/", "#"')}this._token=e,this._username=r,this._password=t,this._agent=o,this._domain=n,this._broker=s,this._timeout=c,this._identity=d,this._keepalive=p,this._qos=this._qos=f?0:1,this._requiresSchema=m,this._instance=i(8),this._mqttClientId=h||this._createMqttClientId(),this._vrpcClientId=this._createVrpcClientId(),this._connectionSecret=i(16),this._vrpcConnectionId=this._createVrpcConnectionId(),this._agents={},this._eventEmitter=new a,this._invokeId=0,this._proxyId=0,this._client=null,this._cachedSubscriptions={},this._proxies={},this._subscribeRetrier=new l({subscribe:(e,t)=>this._mqttSubscribe(e,t).catch(()=>{}),log:this._log}),this._callbackIds=new WeakMap,this._emitterListener=new WeakMap,this._pendingSubscriptions=new Map,this._pendingUnsubscriptions=new Map,"console"===u?(this._log=console,this._log.debug=()=>{}):this._log=u}getClientId(){return this._vrpcClientId}getConnectionId(){return this._vrpcConnectionId}async connect(){if(this._client&&this._client.connected)return;let e=this._username,t=this._password;this._token&&(e=e||this._generateUserName(),t=this._token);const r={username:e,password:t,clean:!0,keepalive:this._keepalive,clientId:this._mqttClientId,rejectUnauthorized:!1,connectTimeout:this._timeout,reconnectOnConnackError:!0,will:{topic:`${this._vrpcConnectionId}/__clientInfo__`,payload:JSON.stringify({status:"offline",clientId:this._vrpcClientId})}};return void 0===e&&delete r.username,void 0===t&&delete r.password,this.on("error",e=>{this._log.debug(`Encountered MQTT error: ${e.message}`)}),this._client=s.connect(this._broker,r),this._client.on("offline",()=>{this._log.warn("MQTT client went offline."),this._agents={},this._proxies={},this.emit("offline")}),this._client.on("reconnect",()=>{this._log.info("MQTT client is attempting to reconnect..."),this.emit("reconnect")}),this._client.on("error",e=>{this.emit("error",e)}),this._client.stream.on("error",e=>{this.emit("error",e)}),this._client.on("connect",async()=>{this.emit("connect"),this._subscribeRetrier.cancel();try{const e="*"===this._agent?"+":this._agent;await this._mqttSubscribe(`${this._domain}/${e}/__agentInfo__`),this._requiresSchema?await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfo__`):await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfoConcise__`),await this._mqttSubscribe(`${this._vrpcConnectionId}/#`),this._log.debug("Restoring event subscriptions after reconnect...");const t=[];for(const e of Object.keys(this._cachedSubscriptions))t.push(this._mqttSubscribe(e));await Promise.allSettled(t)}catch(e){this._log.error(`Encountered issue while setting up subscriptions after connect: ${e.message}`)}}),this._client.on("message",(e,t)=>{if(0!==t.length)try{const r=e.split("/"),[n,o,i,s]=r;if(n!==this._domain)return void this._log.warn(`Received message from foreign domain: ${n}`);if("__agentInfo__"===i){const{status:e,hostname:r,version:i}=JSON.parse(t.toString());this._createIfNotExist(o),this._agents[o].status=e,this._agents[o].hostname=r,this._agents[o].version=i,"offline"===e&&this._clearCachedSubscriptions({lostAgent:o}),this.emit("agent",{domain:n,agent:o,status:e,hostname:r,version:i})}else if("__classInfo__"===s||"__classInfoConcise__"===s){const e=JSON.parse(t.toString());this._createIfNotExist(o);const r=this._agents[o].classes[i],s=e.instances||[],a=r?r.instances:[],l=a.filter(e=>!s.includes(e)),c=s.filter(e=>!a.includes(e));this._agents[o].classes[i]=e;const{className:u,instances:f,memberFunctions:h,staticFunctions:d,meta:p}=e;0!==l.length&&(this.emit("instanceGone",l,{domain:n,agent:o,className:u}),l.forEach(e=>this._clearCachedSubscriptions({lostInstance:e,agent:o,className:u}))),0!==c.length&&this.emit("instanceNew",c,{domain:n,agent:o,className:u}),this.emit("class",{domain:n,agent:o,className:u,instances:f,memberFunctions:h,staticFunctions:d,meta:p||{}})}else{const{i:e,a:r,e:n,r:o}=JSON.parse(t.toString());this._eventEmitter.emit(e,{a:r,e:n,r:o})}}catch(t){this._log.error(`Could not parse MQTT message on topic "${e}": ${t.message}`)}}),new Promise((e,t)=>{const r=setTimeout(()=>{this._client.end(!0,()=>{t(new Error(`Connection trial timed out (> ${this._timeout} ms)`))})},this._timeout);this._client.once("connect",()=>{clearTimeout(r),e()})})}async create({className:e,instance:t=i(8),args:r=[],agent:n=this._agent,cacheProxy:o=!1,isIsolated:s=!1}={}){if(!this._isConnected())throw new Error("Client is not connected");if("*"===n)throw new Error("Agent must be specified");const a={c:e,f:s?"__createIsolated__":"__createShared__",a:[t,...r],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},l=await this._getProxy(n,e,a);return t&&o&&(this._proxies[`${n}/${e}/${t}`]={agent:n,className:e,instance:t,proxy:l}),l}async getInstance(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const r=this._cachedProxy(e,t);if(r)return r;const{agent:n,className:o}=await this._getInstanceData(e,t);return this._createProxy(n,o,e)}async delete(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const{agent:r,className:n}=await this._getInstanceData(e,t),o={c:n,f:"__delete__",a:[e],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},i=`${this._domain}/${r}/${n}/__static__/__delete__`;return this._mqttPublish(i,JSON.stringify(o)),delete this._proxies[`${r}/${n}/${e}`],this._handleAgentAnswer(o,r)}async callStatic({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const o=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(!o)return;const i={c:e,f:t,a:o,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3},s=`${this._domain}/${n}/${e}/__static__/${t}`;return await this._waitUntilClassIsOnline(n,e),this._mqttPublish(s,JSON.stringify(i)),this._handleAgentAnswer(i,n)}async callAll({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const o={c:e,f:t,a:[],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};if("*"===n){const n=[],i=this.getAvailableAgents();for(const s of i){const i=`${this._domain}/${s}/${e}/__static__/__callAll__`,a=await this._wrapArguments({agent:s,className:e,functionName:t,args:r});if(!a)continue;o.a=[t,...a],await this._waitUntilClassIsOnline(s,e),this._mqttPublish(i,JSON.stringify(o));const l=await this._handleAgentAnswer(o,s);n.push(...l)}return n}const i=`${this._domain}/${n}/${e}/__static__/__callAll__`,s=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(s)return o.a=[t,...s],await this._waitUntilClassIsOnline(n,e),this._mqttPublish(i,JSON.stringify(o)),this._handleAgentAnswer(o,n)}getSystemInformation(){return this._agents}getAvailableAgents({mustBeOnline:e=!0}={}){const t=[];if(e){for(const e in this._agents){const{status:r}=this._agents[e];"online"===r&&t.push(e)}return t}return Object.keys(this._agents)}getAvailableClasses({agent:e=this._agent,mustBeOnline:t=!0}={}){if("*"===e)throw new Error("Agent must be specified");if(!this._agents[e])return[];const{classes:r,status:n}=this._agents[e];return t&&"online"!==n?[]:Object.keys(r)}getAvailableInstances({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].instances:[]}getAvailableMemberFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].memberFunctions.map(e=>this._stripSignature(e)):[]}getAvailableStaticFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:o}=this._agents[t];return r&&"online"!==o?[]:n[e]?n[e].staticFunctions.map(e=>this._stripSignature(e)):[]}async reconnectWithToken(e,{agent:t=this._agent}={}){return this._token=e,this._agent=t,this._client&&await new Promise(e=>this._client.end(!1,{},e)),this.connect()}async unregisterAgent(e){if(this._agents[e]&&"offline"===this._agents[e].status){const t=`${this._domain}/${e}/__agentInfo__`;this._mqttPublish(t,null,{retain:!0});const r=this.getAvailableClasses({agent:e,mustBeOnline:!1});for(const t of r){const r=`${this._domain}/${e}/${t}/__classInfo__`;this._mqttPublish(r,null,{retain:!0})}return delete this._agents[e],!0}return!1}async end(){if(this._subscribeRetrier.cancel(),!this._client)return;this._mqttPublish(`${this._vrpcConnectionId}/__clientInfo__`,JSON.stringify({status:"offline",clientId:this._vrpcClientId,v:3})),this._eventEmitter.removeAllListeners(),this.removeAllListeners();const e=this._client;return this._client=null,new Promise(t=>e.end(!1,{},t))}static _createHash(e,t=16){let r=5381,n=52711;for(let t=0;t<e.length;t++){const o=e.charCodeAt(t);r=33*r^o,n=33*n^o}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_isConnected(){return this._client&&this._client.connected}_getCallbackId(e,{readOnly:t=!1}={}){if(!this._callbackIds.has(e)){if(t)return null;this._callbackIds.set(e,i(8))}return this._callbackIds.get(e)}_generateUserName(){return`${this._domain}:client@${o.hostname()}-${o.platform()}-js`}_createMqttClientId(){const e=o.arch()+o.homedir()+o.hostname()+JSON.stringify(o.networkInterfaces())+o.platform()+o.release()+o.totalmem()+o.type(),t=c._createHash(e,12);return`vc3${this._instance}${t}`}_createVrpcClientId(){const e=this._identity||this._instance;return`${this._domain}/${o.hostname()}/${e}`}_createVrpcConnectionId(){return`${this._domain}/${this._mqttClientId}/${this._connectionSecret}`}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&(this._log.warn(`Could not publish MQTT message because: ${e.message}`),"client disconnecting"===e.message&&(this._log.error(`Failed to publish, because: ${e.message}`),this.emit("error",e),this._log.info("Forcing reconnect now..."),this._client.disconnecting=!1,this._client.reconnect()))})}async _mqttSubscribe(e,t){return new Promise((r,n)=>{this._client.subscribe(e,{qos:this._qos,...t},(o,i)=>{if(o){if(this._log.warn(`Could not subscribe to topic(s): '${e}', because: ${o.message}`),"client disconnecting"===o.message){const e=`Failed to subscribe, because: ${o.message}`;this._log.error(e),this.emit("error",o),this._log.info("Forcing reconnect now..."),this._client.disconnecting=!1,this._client.reconnect(),n(new Error(e))}}else{const n=Array.isArray(e)?e:[e],s=i.filter(e=>128===e.qos).map(e=>e.topic);s.length>0&&((o=new Error(`Could not subscribe all ${n.length} topic(s) but got error qos=128 on following ${s.length} topic(s): ${s}`)).code="SUBSCRIBE_FAILED",o.subscribeOptions=t,this._log.error(o.message),this.emit("error",o),this._subscribeRetrier.schedule(s,t)),this._subscribeRetrier.granted(i.filter(e=>128!==e.qos).map(e=>e.topic));const a=i.filter(e=>e.qos<this._qos);a.length>0&&((o=new Error(`Could not subscribe all ${n.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${a.length} topic(s): ${JSON.stringify(a)}`)).code="SUBSCRIBE_REDUCED_QOS",o.subscribeOptions=t,this._log.warn(o.message),this.emit("error",o)),0===i.length&&this._log.debug(`Already subscribed to: ${e}`),r()}})})}async _mqttUnsubscribe(e,t){return new Promise((r,n)=>{this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`),r()})})}_createIfNotExist(e){this._agents[e]||(this._agents[e]={classes:{}})}async _getProxy(e,t,r){const{f:n,i:o}=r,i=`${this._domain}/${e}/${t}/__static__/${n}`;return await this._waitUntilClassIsOnline(e,t),this._mqttPublish(i,JSON.stringify(r)),new Promise((r,i)=>{const s=`Proxy creation for class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`,a=setTimeout(()=>{this._eventEmitter.removeAllListeners(o),i(new Error(s))},this._timeout);this._eventEmitter.once(o,({e:o,r:s})=>{if(clearTimeout(a),o){const{message:r,cause:s}=c._prepareError(o);i(new Error(`[vrpc ${e}-${t}-${n}]: ${r}`,{cause:s}))}else{const n=this._createProxy(e,t,s);r(n)}})})}async _waitUntilClassIsOnline(e,t){if(!this._hasClassOnline(e,t))return new Promise((r,n)=>{let o=null;const i=()=>{this._hasClassOnline(e,t)&&(o&&clearTimeout(o),this.removeListener("class",i),r())};o=setTimeout(()=>{this.removeListener("class",i),n(new Error(`Connection to class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`))},this._timeout),this.on("class",i)})}_hasClassOnline(e,t){return this._agents[e]&&"online"===this._agents[e].status&&this._agents[e].classes[t]}_createProxy(e,t,r){const n=`${this._domain}/${e}/${t}/${r}`,o=`${this._instance}-${this._proxyId++}`,i={vrpcClientId:this._vrpcClientId,vrpcConnectionId:this._vrpcConnectionId,vrpcInstanceId:r,vrpcProxyId:o};let s=this._agents[e].classes[t].memberFunctions;s=s.map(e=>{const t=e.indexOf("-");return t>0?e.substring(0,t):e});const a=new Set(s);return a.forEach(s=>{i[s]="removeAllListeners"!==s?async(...i)=>{const a=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:o,functionName:s,args:i});if(!a)return!0;try{const t={c:r,f:s,a,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${s}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}:async t=>{if(!t)throw new Error("VRPC does not support removing all listeners");Object.keys(this._cachedSubscriptions).filter(e=>{const n=this._cachedSubscriptions[e];return n.instance===r&&n.event===t}).forEach(e=>{const t=`__e__${e}`;this._cachedSubscriptions[e].listeners.forEach(({handler:e})=>{this._eventEmitter.removeListener(t,e)}),delete this._cachedSubscriptions[e]});try{const o={c:r,f:s,a:[t],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${s}`,JSON.stringify(o)),this._handleAgentAnswer(o,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}}),a.has("vrpcOn")||a.has("vrpcOff")||(i.vrpcOn=async(i,...s)=>{if(!a.has(i))throw new Error("Bad magic");const l=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:o,functionName:"vrpcOn",args:[i,...s]});if(l)try{const t={c:r,f:i,a:l.slice(1),i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:3};return this._mqttPublish(`${n}/${i}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${i}" because: ${e.message}`)}},i.vrpcOff=n=>{const o=`__e__${this._domain}/${e}/${t}/${r}-${n}`;this._eventEmitter.removeAllListeners(o)}),i}async _handleAgentAnswer({i:e,c:t,f:r},n){return new Promise((o,i)=>{const s=`Function call "${t}::${r}()" on agent "${n}" timed out (> ${this._timeout} ms)`,a=setTimeout(()=>{this._eventEmitter.removeAllListeners(e),i(new Error(s))},this._timeout);this._eventEmitter.once(e,e=>{if(clearTimeout(a),e.e){const{message:o,cause:s}=c._prepareError(e.e);i(new Error(`[vrpc ${n}-${t}-${r}]: ${o}`,{cause:s}))}else{const s=e.r;"string"==typeof s&&"__p__"===s.substring(0,5)?this._eventEmitter.once(s,e=>{if(e.e){const{message:o,cause:s}=c._prepareError(e.e);i(new Error(`[vrpc ${n}-${t}-${r}]: ${o}`,{cause:s}))}else o(e.r)}):o(s)}})})}static _prepareError(e){return"object"==typeof e?{message:e.message,cause:e.cause}:{message:e,cause:void 0}}async _waitForInstance(e,t={}){return new Promise((r,n)=>{const o=n=>(i,{agent:s,className:a})=>{if(i.includes(e)){if(t.agent&&s!==t.agent)return;if(t.className&&a!==t.className)return;clearTimeout(n),this.removeListener("instanceNew",o),r({agent:s,className:a,instance:e})}},i=setTimeout(()=>{this.removeListener("instanceNew",o(i));const t=`Could not find instance: ${e} (> ${this._timeout} ms)`;n(new Error(t))},this._timeout);this.on("instanceNew",o(i))})}async _wrapArguments({agent:e,className:t,instance:r,proxyId:n,functionName:o,args:i}){const s=[],a=/^(on|notify|monitor|signal)/.test(o),l=/^(off|remove|unmonitor|unsignal)/.test(o);for(const[c,u]of i.entries()){if(this._isFunction(u)){const f=u;if("vrpcOn"===o||"on"===o&&1===c&&"string"==typeof i[0]||a){const n="string"==typeof i[0]?i[0]:o,a=await this._onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:f});s.push(a);continue}if(("off"===o||"removeListener"===o)&&1===c&&"string"==typeof i[0]||l){const e=await this._offRemoteEvent({callback:f});if(!e&&("off"===o||"removeListener"===o))return null;s.push(e||null);continue}{const r=`__f__${n||`${e}-${t}`}-${o}-${c}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`;s.push(r),this._eventEmitter.once(r,({a:e})=>u.apply(null,e));continue}}if(this._isEmitter(u)){const{emitter:n,event:o}=u;let i=(...e)=>n.emit(o,...e);if(this._emitterListener.has(n)){const e=this._emitterListener.get(n);e.has(o)?i=e.get(o):e.set(o,i)}else this._emitterListener.set(n,new Map([[o,i]]));const a=await this._onRemoteEvent({agent:e,className:t,instance:r,event:o,callback:i});s.push(a);continue}s.push(u)}return s}async _onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:o}){const i=`${e}-${t}-${r||"__static__"}-${n}-${this._getCallbackId(o)}`,s=c._createHash(i,12),a=`${this._vrpcConnectionId}/${s}`,l=`__e__${a}`,u=({a:e})=>o.apply(null,e);return 0===this._eventEmitter.listenerCount(l)&&this._eventEmitter.on(l,u),this._cachedSubscriptions[a]?this._cachedSubscriptions[a].listeners.push({callback:o,handler:u}):this._cachedSubscriptions[a]={agent:e,className:t,instance:r,event:n,listeners:[{callback:o,handler:u}]},l}async _offRemoteEvent({callback:e}){if(!this._getCallbackId(e,{readOnly:!0}))return null;let t=null;return Object.keys(this._cachedSubscriptions).forEach(r=>{const n=`__e__${r}`,o=this._cachedSubscriptions[r],i=o.listeners.findIndex(t=>t.callback===e);-1!==i&&(o.listeners.splice(i,1),0===o.listeners.length&&(delete this._cachedSubscriptions[r],this._eventEmitter.removeAllListeners(n)),t=n)}),t}_clearCachedSubscriptions({lostAgent:e,lostInstance:t,agent:r,className:n}){Object.keys(this._cachedSubscriptions).filter(o=>{const i=this._cachedSubscriptions[o];return void 0!==e?i.agent===e:i.instance===t&&i.agent===r&&i.className===n}).forEach(e=>{const t=`__e__${e}`;this._log.debug(`Clearing subscriptions for obsolete topic: ${e}`),this._cachedSubscriptions[e].listeners.forEach(({handler:e})=>{this._eventEmitter.removeListener(t,e)}),delete this._cachedSubscriptions[e]})}_stripSignature(e){const t=e.indexOf("-");return t>0?e.substring(0,t):e}_isFunction(e){const t={}.toString.call(e);return e&&("[object Function]"===t||"[object AsyncFunction]"===t)}_isEmitter(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"emitter")&&Object.prototype.hasOwnProperty.call(e,"event")&&"object"==typeof e.emitter&&"function"==typeof e.emitter.emit}async _getInstanceData(e,t){const r=this._getInstanceFromCache(e,t);if(!r){if(t.noWait)throw new Error(`Could not find instance: ${e}`);return this._waitForInstance(e,t)}return r}_cachedProxy(e,{agent:t,className:r}={}){const n=Object.values(this._proxies).filter(n=>!(n.instance!==e||t&&n.agent!==t||r&&n.className!==r));return 1===n.length?n[0].proxy:null}_getInstanceFromCache(e,t={}){if(!t.agent&&"*"!==this._agent){const{classes:r,status:n}=this._agents[this._agent]||{};if(r&&"offline"!==n)for(const n in r){if(t.className&&n!==t.className)continue;const{instances:o}=r[n];if(o&&o.includes(e))return{agent:this._agent,className:n,instance:e}}}for(const r in this._agents){if(t.agent&&r!==t.agent)continue;const{classes:n,status:o}=this._agents[r];if(n&&"offline"!==o)for(const o in n){if(t.className&&o!==t.className)continue;const{instances:i}=n[o];if(i&&i.includes(e))return{agent:r,className:o,instance:e}}}}_indicateDeprecation(e){n&&n.emitWarning?n.emitWarning(e,"DeprecationWarning"):this._log.warn("DEPRECATED ",e)}}e.exports=c},8643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i=r(6250),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>n._`{allowedValues: ${e}}`},code(e){const{gen:t,data:r,$data:s,schema:a,schemaCode:l,it:c}=e;if(!s&&0===a.length)throw new Error("enum must have non-empty array");const u=a.length>=c.opts.loopEnum;let f;const h=()=>null!=f?f:f=(0,o.useFunc)(t,i.default);let d;if(u||s)d=t.let("valid"),e.block$data(d,function(){t.assign(d,!1),t.forOf("v",l,e=>t.if(n._`${h()}(${r}, ${e})`,()=>t.assign(d,!0).break()))});else{if(!Array.isArray(a))throw new Error("ajv implementation error");const e=t.const("vSchema",l);d=(0,n.or)(...a.map((t,o)=>function(e,t){const o=a[t];return"object"==typeof o&&null!==o?n._`${h()}(${r}, ${e}[${t}])`:n._`${r} === ${o}`}(e,o)))}e.pass(d)}};t.default=s},8660:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(5765),o=r(9029),i=r(2023),s=r(4227),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>o._`{additionalProperty: ${e.additionalProperty}}`},code(e){const{gen:t,schema:r,parentSchema:a,data:l,errsCount:c,it:u}=e;if(!c)throw new Error("ajv implementation error");const{allErrors:f,opts:h}=u;if(u.props=!0,"all"!==h.removeAdditional&&(0,s.alwaysValidSchema)(u,r))return;const d=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function m(e){t.code(o._`delete ${l}[${e}]`)}function g(n){if("all"===h.removeAdditional||h.removeAdditional&&!1===r)m(n);else{if(!1===r)return e.setParams({additionalProperty:n}),e.error(),void(f||t.break());if("object"==typeof r&&!(0,s.alwaysValidSchema)(u,r)){const r=t.name("valid");"failing"===h.removeAdditional?(y(n,r,!1),t.if((0,o.not)(r),()=>{e.reset(),m(n)})):(y(n,r),f||t.if((0,o.not)(r),()=>t.break()))}}}function y(t,r,n){const o={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(o,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(o,r)}t.forIn("key",l,r=>{d.length||p.length?t.if(function(r){let i;if(d.length>8){const e=(0,s.schemaRefOrVal)(u,a.properties,"properties");i=(0,n.isOwnProperty)(t,e,r)}else i=d.length?(0,o.or)(...d.map(e=>o._`${r} === ${e}`)):o.nil;return p.length&&(i=(0,o.or)(i,...p.map(t=>o._`${(0,n.usePattern)(e,t)}.test(${r})`))),(0,o.not)(i)}(r),()=>g(r)):g(r)}),e.ok(o._`${c} === ${i.default.errors}`)}};t.default=a},8665:(e,t,r)=>{const n=r(3282),o=r(7007),{nanoid:i}=r(3561),s="__global__",a="vrpc";class l{static registerClass(e,{onlyPublic:t=!0,withNew:r=!0,schema:n=null}={}){let o=l._extractStaticFunctions(e);t&&(o=o.filter(e=>!e.startsWith("_"))),o.push("__createIsolated__"),o.push("__createShared__"),o.push("__callAll__"),o.push("__delete__");let i=l._extractMemberFunctions(e);t&&(i=i.filter(e=>!e.startsWith("_"))),l._functionRegistry.set(e.name,{Klass:e,withNew:r,staticFunctions:o,memberFunctions:i,schema:n,meta:{}})}static registerFunction(e,t){if("function"!=typeof e)throw new Error("Provided argument must be a function object");console.log("registering function",t),window[a]||(window[a]={}),window[a][t]=e;const r=l._functionRegistry.get(s),n=r?[...r.staticFunctions,t]:[t];l._functionRegistry.set(s,{staticFunctions:n,memberFunctions:[],meta:{},Klass:{},withNew:!1,schema:null})}static registerInstance(e,{className:t,instance:r,onlyPublic:n=!0}={}){let o=l._extractMemberFunctions(e);n&&(o=o.filter(e=>!e.startsWith("_"))),l._functionRegistry.has(t)||l._functionRegistry.set(t,{memberFunctions:o,meta:{},Klass:{},withNew:!1,staticFunctions:[],schema:null}),l._instances.set(r,{className:t,instance:e,isIsolated:!1})}static create({className:e,instance:t=i(8),args:r=[],isIsolated:n=!1}={}){const o={c:e,a:[t,...r]},s=n?l._handleCreateIsolated(o):l._handleCreateShared(o);if(o.e)throw new Error(o.e);return s}static delete(e){if("string"==typeof e)return l._delete(e);if("object"==typeof e){for(const[t,r]of l._instances)if(r.instance===e)return l._instances.delete(t),!0;return!1}}static getInstance(e){const t=l._instances.get(e);if(t)return t.instance;throw new Error(`Could not find instance: ${e}`)}static getAvailableClasses(){return l._getClassesArray()}static getAvailableInstances(e){return l._getInstancesArray(e)}static call(e){const t=JSON.parse(e);return l._call(t),JSON.stringify(t)}static onCallback(e){l._callback=e}static on(e,t){l._emitter.on(e,t)}static once(e,t){l._emitter.once(e,t)}static off(e,t){l._emitter.off(e,t)}static removeAllListeners(e){l._emitter.removeAllListeners(e)}static _call(e){switch(l._mustTrackClient=!1,e.f){case"__createIsolated__":l._handleCreateIsolated(e);break;case"__createShared__":l._handleCreateShared(e);break;case"__callAll__":l._handleCallAll(e);break;case"__delete__":l._handleDelete(e);break;default:l._handleCall(e)}return l._mustTrackClient}static _assertOwner(e,t,r){if(e&&e.isIsolated&&void 0!==e.owner&&t.s!==l.LOCAL_SENDER&&t.s!==e.owner)throw new Error(`Instance '${r}' is isolated to another connection`)}static _handleCreateIsolated(e){let t;try{const r=e.c,[n,...o]=e.a,i=l._instances.get(n);if(i){if(!i.isIsolated)throw new Error(`Instance '${n}' exists as a shared instance`);return l._assertOwner(i,e,n),e.r=n,i.instance}t=l._create(r,n,...o),l._instances.set(n,{instance:t,className:r,isIsolated:!0,owner:"string"==typeof e.s?e.s:void 0}),l._emitter.emit("create",{args:o,className:r,isIsolated:!0,instance:n}),e.r=n}catch(t){e.e=t.message}return t}static _handleCreateShared(e){let t;try{const r=e.c,[n,...o]=e.a,i=l._instances.get(n);if(i&&i.isIsolated)throw new Error(`Instance '${n}' exists as an isolated instance`);t=l._create(r,n,...o),l._instances.set(n,{instance:t,className:r,isIsolated:!1}),e.r=n,l._emitter.emit("create",{args:o,className:r,isIsolated:!1,instance:n})}catch(t){e.e=t.message}return t}static _handleCallAll(e){try{const t=[];for(const[r,{className:n,instance:o,isIsolated:i}]of l._instances){if(n!==e.c||i)continue;let s=!0,a=null;try{const t=l._unwrapArguments(e,r);t&&(s=o[t[0]].apply(o,t.slice(1)),s=l.sanitizeEventListenerReturnValues(s))}catch(e){a=e.message}l._isPromise(s)?t.push(s.then(e=>({id:r,val:e,err:null})).catch(e=>({id:r,err:e,val:null}))):t.push({id:r,val:s,err:a})}this._handlePromise(e,Promise.allSettled(t).then(e=>e.filter(e=>"fulfilled"===e.status).map(e=>e.value)))}catch(t){e.e=t.message}}static sanitizeEventListenerReturnValues(e){return!(!e||"object"!=typeof e||void 0===e._events||void 0===e._eventsCount)||e}static _handleDelete(e){try{const t=e.a[0];l._assertOwner(l._instances.get(t),e,t),l._emitter.emit("beforeDelete",{instance:t,className:e.c}),e.r=l._delete(t),l._emitter.emit("delete",{instance:t,className:e.c})}catch(t){e.e=t.message}}static _handleCall(e){try{l._assertOwner(l._instances.get(e.c),e,e.c)}catch(t){const{message:r,cause:n}=t;return void(e.e={message:r,cause:n})}if("removeAllListeners"===e.f)return l._removeAllListeners(e.a[0],e.s,e.c),void(e.r=!0);const t=l._unwrapArguments(e);if(!t)return void(e.r=!0);if(e.c===s){try{const r=window[a][e.f].apply(null,t);l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}return}const r=l._functionRegistry.get(e.c);if(void 0!==r){const{Klass:n}=r;if(!l._isFunction(n[e.f]))throw new Error(`Could not find static function: ${e.f}`);try{const r=n[e.f].apply(null,t);l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}}else{const r=l._instances.get(e.c);if(void 0===r)throw new Error(`Could not find context: ${e.c}`);const{instance:n}=r;if(!l._isFunction(n[e.f]))throw new Error(`Could not find member function: ${e.f}`);try{let r=n[e.f].apply(n,t);r=l.sanitizeEventListenerReturnValues(r),l._isPromise(r)?l._handlePromise(e,r):e.r=r}catch(t){e.e=t.message}}}static _create(e,t,...r){const n=l._instances.get(t);if(n)return n.instance;const{Klass:o,withNew:i,schema:s}=l._getClassEntry(e);return null!==s&&l._validate(s,...r),i?new o(...r):o(...r)}static _delete(e){const t=l._instances.get(e);return!!t&&(l._isFunction(t.removeAllListeners)&&t.removeAllListeners(),delete l._listeners[e],l._instances.delete(e),!0)}static _unregisterClient(e){Object.entries(l._listeners).forEach(([t,r])=>{Object.entries(r).forEach(([r,n])=>{const{clients:o,listener:i,event:s}=n,a=o.indexOf(e);if(-1!==a&&(o.splice(a,1),0===o.length)){const e=l.getInstance(t);e&&e.removeListener&&e.removeListener(s,i),delete l._listeners[t][r]}})})}static _validate(e,t){if(l._ajv||(l._ajv=new n({useDefaults:!0})),!l._ajv.validate(e,t))throw new Error(l._ajv.errorsText())}static _unwrapArguments(e,t){const r=e.s,n=void 0!==t,o=n?t:e.c,i=n?e.a.slice(1):e.a,s=n?e.a[0]:e.f,a=n?[s]:[];for(const e of i)if("string"==typeof e)if(e.startsWith("__f__"))a.push(l._generateCallback({clientId:r,isCallAll:n,instanceId:o,eventId:e}));else if(e.startsWith("__e__"))if("on"===s||"addListener"===s){l._mustTrackClient=!0;const t=l._registerListener({clientId:r,isCallAll:n,instanceId:o,eventId:e,event:i[0]});if(!t)return null;a.push(t)}else if("off"===s||"removeListener"===s){const t=l._unregisterListener({clientId:r,instanceId:o,eventId:e});if(!t)return null;a.push(t)}else{l._mustTrackClient=!0;const t=l._registerListener({clientId:r,isCallAll:n,instanceId:o,eventId:e,event:null});a.push(t)}else a.push(e);else a.push(e);return a}static _generateCallback({eventId:e,clientId:t,instanceId:r,isCallAll:n}){return(...o)=>{const i=n?[r,...o]:[...o];l._callback({a:i,s:t,i:e})}}static _registerListener({eventId:e,clientId:t,instanceId:r,event:n,isCallAll:o}){return l._listeners[r]?l._listeners[r][e]?(l._listeners[r][e].clients.push(t),null):(l._listeners[r][e]={event:n,clients:[t],listener:l._generateListener({eventId:e,instanceId:r,isCallAll:o})},l._listeners[r][e].listener):(l._listeners[r]={[e]:{event:n,clients:[t],listener:l._generateListener({eventId:e,instanceId:r,isCallAll:o})}},l._listeners[r][e].listener)}static _generateListener({eventId:e,instanceId:t,isCallAll:r}){return(...n)=>{const o=r?[t,...n]:[...n];l._callback({a:o,i:e})}}static _unregisterListener({eventId:e,clientId:t,instanceId:r}){if(l._listeners[r]&&l._listeners[r][e]){const{listener:n,clients:o}=l._listeners[r][e],i=o.indexOf(t);if(-1!==i&&o.splice(i,1),0===o.length)return delete l._listeners[r][e],0===Object.keys(l._listeners[r]).length&&delete l._listeners[r],n}}static _removeAllListeners(e,t,r){const n=l._listeners[r];n&&Object.entries(n).forEach(([n,o])=>{o.event===e&&o.clients.includes(t)&&(o.clients=o.clients.filter(e=>e!==t),0===o.clients.length&&(l.getInstance(r).removeListener(o.event,o.listener),delete l._listeners[r][n]))})}static _handlePromise(e,t){try{const r=l._correlationId++%Number.MAX_SAFE_INTEGER,n=`__p__${e.f}-${r}`;e.r=n,t.then(t=>l._callback({...e,r:t,i:n})).catch(t=>l._callback({...e,e:t.message,i:n}))}catch(t){e.data.e=t.message}}static _getClassEntry(e){const t=l._functionRegistry.get(e);if(!t)throw new Error(`"${e}" is not a registered class`);return t}static _isFunction(e){if(e){const t={}.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}return!1}static _isClass(e){return!!e&&"function"==typeof e&&/^\s*class\s+/.test(e.toString())}static _isPromise(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}static _extractMemberFunctions(e){let t=e,r=[];do{if(t.prototype){const e=Object.getOwnPropertyNames(t.prototype).filter(e=>!l._blackList.has(e)&&l._isFunction(t.prototype[e]));r=[...r,...e]}else{const e=Object.getOwnPropertyNames(t).filter(e=>!l._blackList.has(e)&&l._isFunction(t[e]));r=[...r,...e]}t=Object.getPrototypeOf(t)}while(t);return Array.from(new Set(r))}static _extractStaticFunctions(e){let t=e,r=[];do{r=[...r,...Object.getOwnPropertyNames(t).filter(e=>{const r=Object.getOwnPropertyDescriptor(t,e);return!!r&&"function"==typeof r.value})],t=Object.getPrototypeOf(t)}while(t&&t.name);return Array.from(new Set(r))}static _getClassesArray(){return Array.from(l._functionRegistry.keys())}static _getInstancesArray(e){const t=[];return l._instances.forEach((r,n)=>{r.className!==e||r.isIsolated||t.push(n)}),t}static _getMemberFunctionsArray(e){const t=l._functionRegistry.get(e);return t?t.memberFunctions:[]}static _getStaticFunctionsArray(e){const t=l._functionRegistry.get(e);return t?t.staticFunctions:[]}static _getMetaData(e){const t=l._functionRegistry.get(e);return t&&t.meta?t.meta:{}}}l._functionRegistry=new Map,l._instances=new Map,l._emitter=new o,l._correlationId=0,l._listeners={},l._blackList=new Set(["caller","callee","arguments","apply","bind","call","toString","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),l.LOCAL_SENDER=Symbol("vrpc.local-sender"),e.exports=l},8708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;const n=r(9029),o=r(4227),i=r(2023);function s(e,t){const r=e.const("err",t);e.if(n._`${i.default.vErrors} === null`,()=>e.assign(i.default.vErrors,n._`[${r}]`),n._`${i.default.vErrors}.push(${r})`),e.code(n._`${i.default.errors}++`)}function a(e,t){const{gen:r,validateName:o,schemaEnv:i}=e;i.$async?r.throw(n._`new ${e.ValidationError}(${t})`):(r.assign(n._`${o}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>n.str`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?n.str`"${e}" keyword must be ${t} ($data)`:n.str`"${e}" keyword is invalid ($data)`},t.reportError=function(e,r=t.keywordError,o,i){const{it:l}=e,{gen:u,compositeRule:f,allErrors:h}=l,d=c(e,r,o);(null!=i?i:f||h)?s(u,d):a(l,n._`[${d}]`)},t.reportExtraError=function(e,r=t.keywordError,n){const{it:o}=e,{gen:l,compositeRule:u,allErrors:f}=o;s(l,c(e,r,n)),u||f||a(o,i.default.vErrors)},t.resetErrorsCount=function(e,t){e.assign(i.default.errors,t),e.if(n._`${i.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(n._`${i.default.vErrors}.length`,t),()=>e.assign(i.default.vErrors,null)))},t.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:o,errsCount:s,it:a}){if(void 0===s)throw new Error("ajv implementation error");const l=e.name("err");e.forRange("i",s,i.default.errors,s=>{e.const(l,n._`${i.default.vErrors}[${s}]`),e.if(n._`${l}.instancePath === undefined`,()=>e.assign(n._`${l}.instancePath`,(0,n.strConcat)(i.default.instancePath,a.errorPath))),e.assign(n._`${l}.schemaPath`,n.str`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign(n._`${l}.schema`,r),e.assign(n._`${l}.data`,o))})};const l={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function c(e,t,r){const{createErrors:o}=e.it;return!1===o?n._`{}`:function(e,t,r={}){const{gen:o,it:s}=e,a=[u(s,r),f(e,r)];return function(e,{params:t,message:r},o){const{keyword:s,data:a,schemaValue:c,it:u}=e,{opts:f,propertyName:h,topSchemaRef:d,schemaPath:p}=u;o.push([l.keyword,s],[l.params,"function"==typeof t?t(e):t||n._`{}`]),f.messages&&o.push([l.message,"function"==typeof r?r(e):r]),f.verbose&&o.push([l.schema,c],[l.parentSchema,n._`${d}${p}`],[i.default.data,a]),h&&o.push([l.propertyName,h])}(e,t,a),o.object(...a)}(e,t,r)}function u({errorPath:e},{instancePath:t}){const r=t?n.str`${e}${(0,o.getErrorPath)(t,o.Type.Str)}`:e;return[i.default.instancePath,(0,n.strConcat)(i.default.instancePath,r)]}function f({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:i}){let s=i?t:n.str`${t}/${e}`;return r&&(s=n.str`${s}${(0,o.getErrorPath)(r,o.Type.Str)}`),[l.schemaPath,s]}},8727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;const n=r(8708),o=r(9029),i=r(2023),s={message:"boolean schema is false"};function a(e,t){const{gen:r,data:o}=e,i={gen:r,keyword:"false schema",data:o,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(i,s,void 0,t)}t.topBoolOrEmptySchema=function(e){const{gen:t,schema:r,validateName:n}=e;!1===r?a(e,!1):"object"==typeof r&&!0===r.$async?t.return(i.default.data):(t.assign(o._`${n}.errors`,null),t.return(!0))},t.boolOrEmptySchema=function(e,t){const{gen:r,schema:n}=e;!1===n?(r.var(t,!1),a(e)):r.var(t,!0)}},9029:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;const n=r(1520),o=r(7845);var i=r(1520);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return i.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return i.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return i.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}});var s=r(7845);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class l extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){const r=e?o.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=T(this.rhs,e,t),this}get names(){return x(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class h extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class d extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=T(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){const{nodes:e}=this;let t=e.length;for(;t--;){const r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){const{nodes:r}=this;let n=r.length;for(;n--;){const o=r[n];o.optimizeNames(e,t)||(C(e,o.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>O(e,t.names),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class y extends m{}class b extends g{}b.kind="else";class _ extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();const e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){const e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof _?t:t.nodes:this.nodes.length?this:new _(R(e),t instanceof _?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=T(this.condition,e,t),this}get names(){const e=super.names;return x(e,this.condition),this.else&&O(e,this.else.names),e}}_.kind="if";class v extends g{}v.kind="for";class w extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=T(this.iteration,e,t),this}get names(){return O(super.names,this.iteration.names)}}class S extends v{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){const t=e.es5?o.varKinds.var:this.varKind,{name:r,from:n,to:i}=this;return`for(${t} ${r}=${n}; ${r}<${i}; ${r}++)`+super.render(e)}get names(){const e=x(super.names,this.from);return x(e,this.to)}}class E extends v{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=T(this.iterable,e,t),this}get names(){return O(super.names,this.iterable.names)}}class k extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}k.kind="func";class I extends m{render(e){return"return "+super.render(e)}}I.kind="return";class A extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){const e=super.names;return this.catch&&O(e,this.catch.names),this.finally&&O(e,this.finally.names),e}}class P extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}P.kind="catch";class $ extends g{render(e){return"finally"+super.render(e)}}function O(e,t){for(const r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function x(e,t){return t instanceof n._CodeOrName?O(e,t.names):e}function T(e,t,r){return e instanceof n.Name?i(e):(o=e)instanceof n._Code&&o._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])?new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[])):e;var o;function i(e){const n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function C(e,t){for(const r in t)e[r]=(e[r]||0)-(t[r]||0)}function R(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:n._`!${L(e)}`}$.kind="finally",t.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new o.Scope({parent:e}),this._nodes=[new y]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){const r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){const o=this._scope.toName(t);return void 0!==r&&n&&(this._constants[o.str]=r),this._leafNode(new l(e,o,r)),o}const(e,t,r){return this._def(o.varKinds.const,e,t,r)}let(e,t,r){return this._def(o.varKinds.let,e,t,r)}var(e,t,r){return this._def(o.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new c(e,t,r))}add(e,r){return this._leafNode(new u(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new p(e)),this}object(...e){const t=["{"];for(const[r,o]of e)t.length>1&&t.push(","),t.push(r),(r!==o||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,o));return t.push("}"),new n._Code(t)}if(e,t,r){if(this._blockNode(new _(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(_,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,n,i=(this.opts.es5?o.varKinds.var:o.varKinds.let)){const s=this._scope.toName(e);return this._for(new S(i,s,t,r),()=>n(s))}forOf(e,t,r,i=o.varKinds.const){const s=this._scope.toName(e);if(this.opts.es5){const e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,n._`${e}.length`,t=>{this.var(s,n._`${e}[${t}]`),r(s)})}return this._for(new E("of",i,s,t),()=>r(s))}forIn(e,t,r,i=(this.opts.es5?o.varKinds.var:o.varKinds.const)){if(this.opts.ownProperties)return this.forOf(e,n._`Object.keys(${t})`,r);const s=this._scope.toName(e);return this._for(new E("in",i,s,t),()=>r(s))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new f(e))}break(e){return this._leafNode(new h(e))}return(e){const t=new I;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(I)}try(e,t,r){if(!t&&!r)throw new Error('CodeGen: "try" without "catch" and "finally"');const n=new A;if(this._blockNode(n),this.code(e),t){const e=this.name("e");this._currNode=n.catch=new P(e),t(e)}return r&&(this._currNode=n.finally=new $,this.code(r)),this._endBlockNode(P,$)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){const t=this._blockStarts.pop();if(void 0===t)throw new Error("CodeGen: not in self-balancing block");const r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw new Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,o){return this._blockNode(new k(e,t,r)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(k)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){const r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){const t=this._currNode;if(!(t instanceof _))throw new Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){const e=this._nodes;return e[e.length-1]}set _currNode(e){const t=this._nodes;t[t.length-1]=e}},t.not=R;const N=M(t.operators.AND);t.and=function(...e){return e.reduce(N)};const j=M(t.operators.OR);function M(e){return(t,r)=>t===n.nil?r:r===n.nil?t:n._`${L(t)} ${e} ${L(r)}`}function L(e){return e instanceof n.Name?e:n._`(${e})`}t.or=function(...e){return e.reduce(j)}},9713:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9029),o=r(4227),i={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>n._`{propertyName: ${e.propertyName}}`},code(e){const{gen:t,schema:r,data:i,it:s}=e;if((0,o.alwaysValidSchema)(s,r))return;const a=t.name("valid");t.forIn("key",i,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(a)}};t.default=i},9857:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}return r.amdO={},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.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r(1860)})());
|