@ramme-io/kernel 1.3.9 → 1.3.10
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/dist/index.es.js +370 -370
- package/dist/index.umd.js +38 -38
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(Ne,Oe){typeof exports=="object"&&typeof module<"u"?Oe(exports,require("react"),require("@ramme-io/ui"),require("zod")):typeof define=="function"&&define.amd?define(["exports","react","@ramme-io/ui","zod"],Oe):(Ne=typeof globalThis<"u"?globalThis:Ne||self,Oe(Ne.RammeKernel={},Ne.React,Ne.ui,Ne.Zod))})(this,function(Ne,Oe,qe,Se){"use strict";var Th=Object.defineProperty;var iu=Ne=>{throw TypeError(Ne)};var Ph=(Ne,Oe,qe)=>Oe in Ne?Th(Ne,Oe,{enumerable:!0,configurable:!0,writable:!0,value:qe}):Ne[Oe]=qe;var Pe=(Ne,Oe,qe)=>Ph(Ne,typeof Oe!="symbol"?Oe+"":Oe,qe),Fo=(Ne,Oe,qe)=>Oe.has(Ne)||iu("Cannot "+qe);var F=(Ne,Oe,qe)=>(Fo(Ne,Oe,"read from private field"),qe?qe.call(Ne):Oe.get(Ne)),Qe=(Ne,Oe,qe)=>Oe.has(Ne)?iu("Cannot add the same private member more than once"):Oe instanceof WeakSet?Oe.add(Ne):Oe.set(Ne,qe),$e=(Ne,Oe,qe,Se)=>(Fo(Ne,Oe,"write to private field"),Se?Se.call(Ne,qe):Oe.set(Ne,qe),qe),Le=(Ne,Oe,qe)=>(Fo(Ne,Oe,"access private method"),qe);var ln=(Ne,Oe,qe,Se)=>({set _(fn){$e(Ne,Oe,fn,qe)},get _(){return F(Ne,Oe,Se)}});function fn(o){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const a=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(l,s,a.get?a:{enumerable:!0,get:()=>o[s]})}}return l.default=o,Object.freeze(l)}const st=fn(Oe);var hn={exports:{}},fr={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ko;function gu(){if(Ko)return fr;Ko=1;var o=Oe,l=Symbol.for("react.element"),
|
|
9
|
+
*/var Ko;function gu(){if(Ko)return fr;Ko=1;var o=Oe,l=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,u=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,t={key:!0,ref:!0,__self:!0,__source:!0};function r(n,e,i){var c,h={},d=null,y=null;i!==void 0&&(d=""+i),e.key!==void 0&&(d=""+e.key),e.ref!==void 0&&(y=e.ref);for(c in e)a.call(e,c)&&!t.hasOwnProperty(c)&&(h[c]=e[c]);if(n&&n.defaultProps)for(c in e=n.defaultProps,e)h[c]===void 0&&(h[c]=e[c]);return{$$typeof:l,type:n,key:d,ref:y,props:h,_owner:u.current}}return fr.Fragment=s,fr.jsx=r,fr.jsxs=r,fr}var hr={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,27 +14,27 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ho;function yu(){return Ho||(Ho=1,process.env.NODE_ENV!=="production"&&function(){var o=Oe,l=Symbol.for("react.element"),
|
|
17
|
+
*/var Ho;function yu(){return Ho||(Ho=1,process.env.NODE_ENV!=="production"&&function(){var o=Oe,l=Symbol.for("react.element"),s=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),t=Symbol.for("react.profiler"),r=Symbol.for("react.provider"),n=Symbol.for("react.context"),e=Symbol.for("react.forward_ref"),i=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),b=Symbol.iterator,S="@@iterator";function w(K){if(K===null||typeof K!="object")return null;var xe=b&&K[b]||K[S];return typeof xe=="function"?xe:null}var x=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function g(K){{for(var xe=arguments.length,je=new Array(xe>1?xe-1:0),We=1;We<xe;We++)je[We-1]=arguments[We];_("error",K,je)}}function _(K,xe,je){{var We=x.ReactDebugCurrentFrame,He=We.getStackAddendum();He!==""&&(xe+="%s",je=je.concat([He]));var Ge=je.map(function(Ve){return String(Ve)});Ge.unshift("Warning: "+xe),Function.prototype.apply.call(console[K],console,Ge)}}var E=!1,v=!1,C=!1,P=!1,I=!1,T;T=Symbol.for("react.module.reference");function k(K){return!!(typeof K=="string"||typeof K=="function"||K===a||K===t||I||K===u||K===i||K===c||P||K===y||E||v||C||typeof K=="object"&&K!==null&&(K.$$typeof===d||K.$$typeof===h||K.$$typeof===r||K.$$typeof===n||K.$$typeof===e||K.$$typeof===T||K.getModuleId!==void 0))}function W(K,xe,je){var We=K.displayName;if(We)return We;var He=xe.displayName||xe.name||"";return He!==""?je+"("+He+")":je}function A(K){return K.displayName||"Context"}function M(K){if(K==null)return null;if(typeof K.tag=="number"&&g("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof K=="function")return K.displayName||K.name||null;if(typeof K=="string")return K;switch(K){case a:return"Fragment";case s:return"Portal";case t:return"Profiler";case u:return"StrictMode";case i:return"Suspense";case c:return"SuspenseList"}if(typeof K=="object")switch(K.$$typeof){case n:var xe=K;return A(xe)+".Consumer";case r:var je=K;return A(je._context)+".Provider";case e:return W(K,K.render,"ForwardRef");case h:var We=K.displayName||null;return We!==null?We:M(K.type)||"Memo";case d:{var He=K,Ge=He._payload,Ve=He._init;try{return M(Ve(Ge))}catch{return null}}}return null}var q=Object.assign,N=0,le,re,ee,ue,G,oe,R;function Q(){}Q.__reactDisabledLog=!0;function he(){{if(N===0){le=console.log,re=console.info,ee=console.warn,ue=console.error,G=console.group,oe=console.groupCollapsed,R=console.groupEnd;var K={configurable:!0,enumerable:!0,value:Q,writable:!0};Object.defineProperties(console,{info:K,log:K,warn:K,error:K,group:K,groupCollapsed:K,groupEnd:K})}N++}}function z(){{if(N--,N===0){var K={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q({},K,{value:le}),info:q({},K,{value:re}),warn:q({},K,{value:ee}),error:q({},K,{value:ue}),group:q({},K,{value:G}),groupCollapsed:q({},K,{value:oe}),groupEnd:q({},K,{value:R})})}N<0&&g("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Ee=x.ReactCurrentDispatcher,X;function D(K,xe,je){{if(X===void 0)try{throw Error()}catch(He){var We=He.stack.trim().match(/\n( *(at )?)/);X=We&&We[1]||""}return`
|
|
18
18
|
`+X+K}}var ae=!1,H;{var te=typeof WeakMap=="function"?WeakMap:Map;H=new te}function ne(K,xe){if(!K||ae)return"";{var je=H.get(K);if(je!==void 0)return je}var We;ae=!0;var He=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var Ge;Ge=Ee.current,Ee.current=null,he();try{if(xe){var Ve=function(){throw Error()};if(Object.defineProperty(Ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ve,[])}catch(xt){We=xt}Reflect.construct(K,[],Ve)}else{try{Ve.call()}catch(xt){We=xt}K.call(Ve.prototype)}}else{try{throw Error()}catch(xt){We=xt}K()}}catch(xt){if(xt&&We&&typeof xt.stack=="string"){for(var ze=xt.stack.split(`
|
|
19
19
|
`),it=We.stack.split(`
|
|
20
20
|
`),et=ze.length-1,ht=it.length-1;et>=1&&ht>=0&&ze[et]!==it[ht];)ht--;for(;et>=1&&ht>=0;et--,ht--)if(ze[et]!==it[ht]){if(et!==1||ht!==1)do if(et--,ht--,ht<0||ze[et]!==it[ht]){var It=`
|
|
21
|
-
`+ze[et].replace(" at new "," at ");return K.displayName&&It.includes("<anonymous>")&&(It=It.replace("<anonymous>",K.displayName)),typeof K=="function"&&H.set(K,It),It}while(et>=1&&ht>=0);break}}}finally{ae=!1,Ee.current=Ge,z(),Error.prepareStackTrace=He}var cr=K?K.displayName||K.name:"",rr=cr?D(cr):"";return typeof K=="function"&&H.set(K,rr),rr}function be(K,xe,je){return ne(K,!1)}function ce(K){var xe=K.prototype;return!!(xe&&xe.isReactComponent)}function L(K,xe,je){if(K==null)return"";if(typeof K=="function")return ne(K,ce(K));if(typeof K=="string")return D(K);switch(K){case i:return D("Suspense");case c:return D("SuspenseList")}if(typeof K=="object")switch(K.$$typeof){case e:return be(K.render);case h:return L(K.type,xe,je);case d:{var We=K,He=We._payload,Ge=We._init;try{return L(Ge(He),xe,je)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,se={},me=x.ReactDebugCurrentFrame;function pe(K){if(K){var xe=K._owner,je=L(K.type,K._source,xe?xe.type:null);me.setExtraStackFrame(je)}else me.setExtraStackFrame(null)}function _e(K,xe,je,We,He){{var Ge=Function.call.bind(Y);for(var Ve in K)if(Ge(K,Ve)){var ze=void 0;try{if(typeof K[Ve]!="function"){var it=Error((We||"React class")+": "+je+" type `"+Ve+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof K[Ve]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw it.name="Invariant Violation",it}ze=K[Ve](xe,Ve,We,je,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){ze=et}ze&&!(ze instanceof Error)&&(pe(He),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",We||"React class",je,Ve,typeof ze),pe(null)),ze instanceof Error&&!(ze.message in se)&&(se[ze.message]=!0,pe(He),g("Failed %s type: %s",je,ze.message),pe(null))}}}var Z=Array.isArray;function ve(K){return Z(K)}function Ie(K){{var xe=typeof Symbol=="function"&&Symbol.toStringTag,je=xe&&K[Symbol.toStringTag]||K.constructor.name||"Object";return je}}function fe(K){try{return De(K),!1}catch{return!0}}function De(K){return""+K}function f(K){if(fe(K))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ie(K)),De(K)}var p=x.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0},O,B;function V(K){if(Y.call(K,"ref")){var xe=Object.getOwnPropertyDescriptor(K,"ref").get;if(xe&&xe.isReactWarning)return!1}return K.ref!==void 0}function ie(K){if(Y.call(K,"key")){var xe=Object.getOwnPropertyDescriptor(K,"key").get;if(xe&&xe.isReactWarning)return!1}return K.key!==void 0}function $(K,xe){typeof K.ref=="string"&&p.current}function J(K,xe){{var je=function(){O||(O=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",xe))};je.isReactWarning=!0,Object.defineProperty(K,"key",{get:je,configurable:!0})}}function Te(K,xe){{var je=function(){B||(B=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",xe))};je.isReactWarning=!0,Object.defineProperty(K,"ref",{get:je,configurable:!0})}}var Re=function(K,xe,je,We,He,Ge,Ve){var ze={$$typeof:l,type:K,key:xe,ref:je,props:Ve,_owner:Ge};return ze._store={},Object.defineProperty(ze._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ze,"_self",{configurable:!1,enumerable:!1,writable:!1,value:We}),Object.defineProperty(ze,"_source",{configurable:!1,enumerable:!1,writable:!1,value:He}),Object.freeze&&(Object.freeze(ze.props),Object.freeze(ze)),ze};function
|
|
21
|
+
`+ze[et].replace(" at new "," at ");return K.displayName&&It.includes("<anonymous>")&&(It=It.replace("<anonymous>",K.displayName)),typeof K=="function"&&H.set(K,It),It}while(et>=1&&ht>=0);break}}}finally{ae=!1,Ee.current=Ge,z(),Error.prepareStackTrace=He}var cr=K?K.displayName||K.name:"",rr=cr?D(cr):"";return typeof K=="function"&&H.set(K,rr),rr}function be(K,xe,je){return ne(K,!1)}function ce(K){var xe=K.prototype;return!!(xe&&xe.isReactComponent)}function L(K,xe,je){if(K==null)return"";if(typeof K=="function")return ne(K,ce(K));if(typeof K=="string")return D(K);switch(K){case i:return D("Suspense");case c:return D("SuspenseList")}if(typeof K=="object")switch(K.$$typeof){case e:return be(K.render);case h:return L(K.type,xe,je);case d:{var We=K,He=We._payload,Ge=We._init;try{return L(Ge(He),xe,je)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,se={},me=x.ReactDebugCurrentFrame;function pe(K){if(K){var xe=K._owner,je=L(K.type,K._source,xe?xe.type:null);me.setExtraStackFrame(je)}else me.setExtraStackFrame(null)}function _e(K,xe,je,We,He){{var Ge=Function.call.bind(Y);for(var Ve in K)if(Ge(K,Ve)){var ze=void 0;try{if(typeof K[Ve]!="function"){var it=Error((We||"React class")+": "+je+" type `"+Ve+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof K[Ve]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw it.name="Invariant Violation",it}ze=K[Ve](xe,Ve,We,je,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(et){ze=et}ze&&!(ze instanceof Error)&&(pe(He),g("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",We||"React class",je,Ve,typeof ze),pe(null)),ze instanceof Error&&!(ze.message in se)&&(se[ze.message]=!0,pe(He),g("Failed %s type: %s",je,ze.message),pe(null))}}}var Z=Array.isArray;function ve(K){return Z(K)}function Ie(K){{var xe=typeof Symbol=="function"&&Symbol.toStringTag,je=xe&&K[Symbol.toStringTag]||K.constructor.name||"Object";return je}}function fe(K){try{return De(K),!1}catch{return!0}}function De(K){return""+K}function f(K){if(fe(K))return g("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ie(K)),De(K)}var p=x.ReactCurrentOwner,m={key:!0,ref:!0,__self:!0,__source:!0},O,B;function V(K){if(Y.call(K,"ref")){var xe=Object.getOwnPropertyDescriptor(K,"ref").get;if(xe&&xe.isReactWarning)return!1}return K.ref!==void 0}function ie(K){if(Y.call(K,"key")){var xe=Object.getOwnPropertyDescriptor(K,"key").get;if(xe&&xe.isReactWarning)return!1}return K.key!==void 0}function $(K,xe){typeof K.ref=="string"&&p.current}function J(K,xe){{var je=function(){O||(O=!0,g("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",xe))};je.isReactWarning=!0,Object.defineProperty(K,"key",{get:je,configurable:!0})}}function Te(K,xe){{var je=function(){B||(B=!0,g("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",xe))};je.isReactWarning=!0,Object.defineProperty(K,"ref",{get:je,configurable:!0})}}var Re=function(K,xe,je,We,He,Ge,Ve){var ze={$$typeof:l,type:K,key:xe,ref:je,props:Ve,_owner:Ge};return ze._store={},Object.defineProperty(ze._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(ze,"_self",{configurable:!1,enumerable:!1,writable:!1,value:We}),Object.defineProperty(ze,"_source",{configurable:!1,enumerable:!1,writable:!1,value:He}),Object.freeze&&(Object.freeze(ze.props),Object.freeze(ze)),ze};function Me(K,xe,je,We,He){{var Ge,Ve={},ze=null,it=null;je!==void 0&&(f(je),ze=""+je),ie(xe)&&(f(xe.key),ze=""+xe.key),V(xe)&&(it=xe.ref,$(xe,He));for(Ge in xe)Y.call(xe,Ge)&&!m.hasOwnProperty(Ge)&&(Ve[Ge]=xe[Ge]);if(K&&K.defaultProps){var et=K.defaultProps;for(Ge in et)Ve[Ge]===void 0&&(Ve[Ge]=et[Ge])}if(ze||it){var ht=typeof K=="function"?K.displayName||K.name||"Unknown":K;ze&&J(Ve,ht),it&&Te(Ve,ht)}return Re(K,ze,it,He,We,p.current,Ve)}}var Fe=x.ReactCurrentOwner,nt=x.ReactDebugCurrentFrame;function rt(K){if(K){var xe=K._owner,je=L(K.type,K._source,xe?xe.type:null);nt.setExtraStackFrame(je)}else nt.setExtraStackFrame(null)}var Ke;Ke=!1;function Xe(K){return typeof K=="object"&&K!==null&&K.$$typeof===l}function Ue(){{if(Fe.current){var K=M(Fe.current.type);if(K)return`
|
|
22
22
|
|
|
23
23
|
Check the render method of \``+K+"`."}return""}}function Ye(K){return""}var Ze={};function lt(K){{var xe=Ue();if(!xe){var je=typeof K=="string"?K:K.displayName||K.name;je&&(xe=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+je+">.")}return xe}}function ct(K,xe){{if(!K._store||K._store.validated||K.key!=null)return;K._store.validated=!0;var je=lt(xe);if(Ze[je])return;Ze[je]=!0;var We="";K&&K._owner&&K._owner!==Fe.current&&(We=" It was passed a child from "+
|
|
25
|
+
Check the top-level render call using <`+je+">.")}return xe}}function ct(K,xe){{if(!K._store||K._store.validated||K.key!=null)return;K._store.validated=!0;var je=lt(xe);if(Ze[je])return;Ze[je]=!0;var We="";K&&K._owner&&K._owner!==Fe.current&&(We=" It was passed a child from "+M(K._owner.type)+"."),rt(K),g('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',je,We),rt(null)}}function Et(K,xe){{if(typeof K!="object")return;if(ve(K))for(var je=0;je<K.length;je++){var We=K[je];Xe(We)&&ct(We,xe)}else if(Xe(K))K._store&&(K._store.validated=!0);else if(K){var He=w(K);if(typeof He=="function"&&He!==K.entries)for(var Ge=He.call(K),Ve;!(Ve=Ge.next()).done;)Xe(Ve.value)&&ct(Ve.value,xe)}}}function j(K){{var xe=K.type;if(xe==null||typeof xe=="string")return;var je;if(typeof xe=="function")je=xe.propTypes;else if(typeof xe=="object"&&(xe.$$typeof===e||xe.$$typeof===h))je=xe.propTypes;else return;if(je){var We=M(xe);_e(je,K.props,"prop",We,K)}else if(xe.PropTypes!==void 0&&!Ke){Ke=!0;var He=M(xe);g("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",He||"Unknown")}typeof xe.getDefaultProps=="function"&&!xe.getDefaultProps.isReactClassApproved&&g("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function U(K){{for(var xe=Object.keys(K.props),je=0;je<xe.length;je++){var We=xe[je];if(We!=="children"&&We!=="key"){rt(K),g("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",We),rt(null);break}}K.ref!==null&&(rt(K),g("Invalid attribute `ref` supplied to `React.Fragment`."),rt(null))}}var Ae={};function Ce(K,xe,je,We,He,Ge){{var Ve=k(K);if(!Ve){var ze="";(K===void 0||typeof K=="object"&&K!==null&&Object.keys(K).length===0)&&(ze+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var it=Ye();it?ze+=it:ze+=Ue();var et;K===null?et="null":ve(K)?et="array":K!==void 0&&K.$$typeof===l?(et="<"+(M(K.type)||"Unknown")+" />",ze=" Did you accidentally export a JSX literal instead of a component?"):et=typeof K,g("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",et,ze)}var ht=Me(K,xe,je,He,Ge);if(ht==null)return ht;if(Ve){var It=xe.children;if(It!==void 0)if(We)if(ve(It)){for(var cr=0;cr<It.length;cr++)Et(It[cr],K);Object.freeze&&Object.freeze(It)}else g("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Et(It,K)}if(Y.call(xe,"key")){var rr=M(K),xt=Object.keys(xe).filter(function(Oh){return Oh!=="key"}),Do=xt.length>0?"{key: someKey, "+xt.join(": ..., ")+": ...}":"{key: someKey}";if(!Ae[rr+Do]){var kh=xt.length>0?"{"+xt.join(": ..., ")+": ...}":"{}";g(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,Do,rr,Oh,rr),Ae[rr+Do]=!0}}return K===s?U(ht):j(ht),ht}}function Be(K,xe,je){return Ce(K,xe,je,!0)}function ft(K,xe,je){return Ce(K,xe,je,!1)}var yt=ft,At=Be;hr.Fragment=s,hr.jsx=yt,hr.jsxs=At}()),hr}process.env.NODE_ENV==="production"?fn.exports=gu():fn.exports=yu();var ke=fn.exports;const hn=Oe.createContext(null),mu=({children:o,manifest:l})=>{const[a,s]=Oe.useState(l),[u,t]=Oe.useState(!1),r=Oe.useRef(!1);return Oe.useEffect(()=>{if(r.current)return;r.current=!0;const n=e=>{var i;if(((i=e.data)==null?void 0:i.type)==="RAMME_SYNC_MANIFEST"){const c=e.data.payload;s(c),t(!0)}};return window.addEventListener("message",n),window.parent!==window&&!window.__RAMME_HANDSHAKE_SENT&&(console.log("🔌 [Context] Handshake Sent 🤝"),window.parent.postMessage({type:"RAMME_CLIENT_READY"},"*"),window.__RAMME_HANDSHAKE_SENT=!0),()=>{window.removeEventListener("message",n),r.current=!1}},[]),ke.jsx(hn.Provider,{value:{manifest:a,isLive:u},children:o})},Ut=()=>{const o=Oe.useContext(hn);if(!o)throw new Error("useManifest must be used within a ManifestProvider");return o.manifest},pn=()=>{const o=Oe.useContext(hn);return o!=null&&o.isLive?"live":"static"};var dn=Object.defineProperty,bu=Object.getOwnPropertyDescriptor,vu=Object.getOwnPropertyNames,wu=Object.prototype.hasOwnProperty,_t=(o,l)=>()=>(o&&(l=o(o=0)),l),we=(o,l)=>()=>(l||o((l={exports:{}}).exports,l),l.exports),nr=(o,l)=>{for(var a in l)dn(o,a,{get:l[a],enumerable:!0})},_u=(o,l,a,s)=>{if(l&&typeof l=="object"||typeof l=="function")for(let u of vu(l))!wu.call(o,u)&&u!==a&&dn(o,u,{get:()=>l[u],enumerable:!(s=bu(l,u))||s.enumerable});return o},tt=o=>_u(dn({},"__esModule",{value:!0}),o),de=_t(()=>{}),Je={};nr(Je,{_debugEnd:()=>Yn,_debugProcess:()=>Gn,_events:()=>fi,_eventsCount:()=>hi,_exiting:()=>Nn,_fatalExceptions:()=>Vn,_getActiveHandles:()=>es,_getActiveRequests:()=>Zo,_kill:()=>Ln,_linkedBinding:()=>Jo,_maxListeners:()=>ci,_preload_modules:()=>ai,_rawDebug:()=>Cn,_startProfilerIdleNotifier:()=>Qn,_stopProfilerIdleNotifier:()=>Jn,_tickCallback:()=>Hn,abort:()=>ti,addListener:()=>pi,allowedNodeEnvironmentFlags:()=>qn,arch:()=>mn,argv:()=>wn,argv0:()=>si,assert:()=>ts,binding:()=>An,browser:()=>Pn,chdir:()=>On,config:()=>Mn,cpuUsage:()=>dr,cwd:()=>kn,debugPort:()=>oi,default:()=>_i,dlopen:()=>Xo,domain:()=>Rn,emit:()=>bi,emitWarning:()=>xn,env:()=>vn,execArgv:()=>_n,execPath:()=>ii,exit:()=>Wn,features:()=>zn,hasUncaughtExceptionCaptureCallback:()=>rs,hrtime:()=>Er,kill:()=>Fn,listeners:()=>is,memoryUsage:()=>Dn,moduleLoadList:()=>jn,nextTick:()=>Yo,off:()=>gi,on:()=>Tt,once:()=>di,openStdin:()=>$n,pid:()=>ri,platform:()=>bn,ppid:()=>ni,prependListener:()=>vi,prependOnceListener:()=>wi,reallyExit:()=>Bn,release:()=>Tn,removeAllListeners:()=>mi,removeListener:()=>yi,resourceUsage:()=>Un,setSourceMapsEnabled:()=>li,setUncaughtExceptionCaptureCallback:()=>Kn,stderr:()=>Zn,stdin:()=>ei,stdout:()=>Xn,title:()=>yn,umask:()=>In,uptime:()=>ns,version:()=>Sn,versions:()=>En});function gn(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function Su(){!Gt||!Yt||(Gt=!1,Yt.length?kt=Yt.concat(kt):pr=-1,kt.length&&Go())}function Go(){if(!Gt){var o=setTimeout(Su,0);Gt=!0;for(var l=kt.length;l;){for(Yt=kt,kt=[];++pr<l;)Yt&&Yt[pr].run();pr=-1,l=kt.length}Yt=null,Gt=!1,clearTimeout(o)}}function Yo(o){var l=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)l[a-1]=arguments[a];kt.push(new Qo(o,l)),kt.length===1&&!Gt&&setTimeout(Go,0)}function Qo(o,l){this.fun=o,this.array=l}function mt(){}function Jo(o){gn("_linkedBinding")}function Xo(o){gn("dlopen")}function Zo(){return[]}function es(){return[]}function ts(o,l){if(!o)throw new Error(l||"assertion error")}function rs(){return!1}function ns(){return Pt.now()/1e3}function Er(o){var l=Math.floor((Date.now()-Pt.now())*.001),a=Pt.now()*.001,s=Math.floor(a)+l,u=Math.floor(a%1*1e9);return o&&(s=s-o[0],u=u-o[1],u<0&&(s--,u+=xr)),[s,u]}function Tt(){return _i}function is(o){return[]}var kt,Gt,Yt,pr,yn,mn,bn,vn,wn,_n,Sn,En,xn,An,In,kn,On,Tn,Pn,Cn,jn,Rn,Nn,Mn,Bn,Ln,dr,Un,Dn,Fn,Wn,$n,qn,zn,Vn,Kn,Hn,Gn,Yn,Qn,Jn,Xn,Zn,ei,ti,ri,ni,ii,oi,si,ai,li,Pt,ui,xr,ci,fi,hi,pi,di,gi,yi,mi,bi,vi,wi,_i,Eu=_t(()=>{de(),ye(),ge(),kt=[],Gt=!1,pr=-1,Qo.prototype.run=function(){this.fun.apply(null,this.array)},yn="browser",mn="x64",bn="browser",vn={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},wn=["/usr/bin/node"],_n=[],Sn="v16.8.0",En={},xn=function(o,l){console.warn((l?l+": ":"")+o)},An=function(o){gn("binding")},In=function(o){return 0},kn=function(){return"/"},On=function(o){},Tn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},Pn=!0,Cn=mt,jn=[],Rn={},Nn=!1,Mn={},Bn=mt,Ln=mt,dr=function(){return{}},Un=dr,Dn=dr,Fn=mt,Wn=mt,$n=mt,qn={},zn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Vn=mt,Kn=mt,Hn=mt,Gn=mt,Yn=mt,Qn=mt,Jn=mt,Xn=void 0,Zn=void 0,ei=void 0,ti=mt,ri=2,ni=1,ii="/bin/usr/node",oi=9229,si="node",ai=[],li=mt,Pt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Pt.now===void 0&&(ui=Date.now(),Pt.timing&&Pt.timing.navigationStart&&(ui=Pt.timing.navigationStart),Pt.now=()=>Date.now()-ui),xr=1e9,Er.bigint=function(o){var l=Er(o);return typeof BigInt>"u"?l[0]*xr+l[1]:BigInt(l[0]*xr)+BigInt(l[1])},ci=10,fi={},hi=0,pi=Tt,di=Tt,gi=Tt,yi=Tt,mi=Tt,bi=mt,vi=Tt,wi=Tt,_i={version:Sn,versions:En,arch:mn,platform:bn,browser:Pn,release:Tn,_rawDebug:Cn,moduleLoadList:jn,binding:An,_linkedBinding:Jo,_events:fi,_eventsCount:hi,_maxListeners:ci,on:Tt,addListener:pi,once:di,off:gi,removeListener:yi,removeAllListeners:mi,emit:bi,prependListener:vi,prependOnceListener:wi,listeners:is,domain:Rn,_exiting:Nn,config:Mn,dlopen:Xo,uptime:ns,_getActiveRequests:Zo,_getActiveHandles:es,reallyExit:Bn,_kill:Ln,cpuUsage:dr,resourceUsage:Un,memoryUsage:Dn,kill:Fn,exit:Wn,openStdin:$n,allowedNodeEnvironmentFlags:qn,assert:ts,features:zn,_fatalExceptions:Vn,setUncaughtExceptionCaptureCallback:Kn,hasUncaughtExceptionCaptureCallback:rs,emitWarning:xn,nextTick:Yo,_tickCallback:Hn,_debugProcess:Gn,_debugEnd:Yn,_startProfilerIdleNotifier:Qn,_stopProfilerIdleNotifier:Jn,stdout:Xn,stdin:ei,stderr:Zn,abort:ti,umask:In,chdir:On,cwd:kn,env:vn,title:yn,argv:wn,execArgv:_n,pid:ri,ppid:ni,execPath:ii,debugPort:oi,hrtime:Er,argv0:si,_preload_modules:ai,setSourceMapsEnabled:li}}),ge=_t(()=>{Eu()});function xu(){if(Si)return ir;Si=!0,ir.byteLength=n,ir.toByteArray=i,ir.fromByteArray=d;for(var o=[],l=[],a=typeof Uint8Array<"u"?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,t=s.length;u<t;++u)o[u]=s[u],l[s.charCodeAt(u)]=u;l[45]=62,l[95]=63;function r(y){var b=y.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=y.indexOf("=");S===-1&&(S=b);var w=S===b?0:4-S%4;return[S,w]}function n(y){var b=r(y),S=b[0],w=b[1];return(S+w)*3/4-w}function e(y,b,S){return(b+S)*3/4-S}function i(y){var b,S=r(y),w=S[0],x=S[1],g=new a(e(y,w,x)),_=0,E=x>0?w-4:w,v;for(v=0;v<E;v+=4)b=l[y.charCodeAt(v)]<<18|l[y.charCodeAt(v+1)]<<12|l[y.charCodeAt(v+2)]<<6|l[y.charCodeAt(v+3)],g[_++]=b>>16&255,g[_++]=b>>8&255,g[_++]=b&255;return x===2&&(b=l[y.charCodeAt(v)]<<2|l[y.charCodeAt(v+1)]>>4,g[_++]=b&255),x===1&&(b=l[y.charCodeAt(v)]<<10|l[y.charCodeAt(v+1)]<<4|l[y.charCodeAt(v+2)]>>2,g[_++]=b>>8&255,g[_++]=b&255),g}function c(y){return o[y>>18&63]+o[y>>12&63]+o[y>>6&63]+o[y&63]}function h(y,b,S){for(var w,x=[],g=b;g<S;g+=3)w=(y[g]<<16&16711680)+(y[g+1]<<8&65280)+(y[g+2]&255),x.push(c(w));return x.join("")}function d(y){for(var b,S=y.length,w=S%3,x=[],g=16383,_=0,E=S-w;_<E;_+=g)x.push(h(y,_,_+g>E?E:_+g));return w===1?(b=y[S-1],x.push(o[b>>2]+o[b<<4&63]+"==")):w===2&&(b=(y[S-2]<<8)+y[S-1],x.push(o[b>>10]+o[b>>4&63]+o[b<<2&63]+"=")),x.join("")}return ir}function Au(){return Ei?gr:(Ei=!0,gr.read=function(o,l,a,s,u){var t,r,n=u*8-s-1,e=(1<<n)-1,i=e>>1,c=-7,h=a?u-1:0,d=a?-1:1,y=o[l+h];for(h+=d,t=y&(1<<-c)-1,y>>=-c,c+=n;c>0;t=t*256+o[l+h],h+=d,c-=8);for(r=t&(1<<-c)-1,t>>=-c,c+=s;c>0;r=r*256+o[l+h],h+=d,c-=8);if(t===0)t=1-i;else{if(t===e)return r?NaN:(y?-1:1)*(1/0);r=r+Math.pow(2,s),t=t-i}return(y?-1:1)*r*Math.pow(2,t-s)},gr.write=function(o,l,a,s,u,t){var r,n,e,i=t*8-u-1,c=(1<<i)-1,h=c>>1,d=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=s?0:t-1,b=s?1:-1,S=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(n=isNaN(l)?1:0,r=c):(r=Math.floor(Math.log(l)/Math.LN2),l*(e=Math.pow(2,-r))<1&&(r--,e*=2),r+h>=1?l+=d/e:l+=d*Math.pow(2,1-h),l*e>=2&&(r++,e/=2),r+h>=c?(n=0,r=c):r+h>=1?(n=(l*e-1)*Math.pow(2,u),r=r+h):(n=l*Math.pow(2,h-1)*Math.pow(2,u),r=0));u>=8;o[a+y]=n&255,y+=b,n/=256,u-=8);for(r=r<<u|n,i+=u;i>0;o[a+y]=r&255,y+=b,r/=256,i-=8);o[a+y-b]|=S*128},gr)}function Iu(){if(xi)return Dt;xi=!0;let o=xu(),l=Au(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Dt.Buffer=r,Dt.SlowBuffer=x,Dt.INSPECT_MAX_BYTES=50;let s=2147483647;Dt.kMaxLength=s,r.TYPED_ARRAY_SUPPORT=u(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function u(){try{let f=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(f,p),f.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function t(f){if(f>s)throw new RangeError('The value "'+f+'" is invalid for option "size"');let p=new Uint8Array(f);return Object.setPrototypeOf(p,r.prototype),p}function r(f,p,m){if(typeof f=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(f)}return n(f,p,m)}r.poolSize=8192;function n(f,p,m){if(typeof f=="string")return h(f,p);if(ArrayBuffer.isView(f))return y(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(Z(f,ArrayBuffer)||f&&Z(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(f,SharedArrayBuffer)||f&&Z(f.buffer,SharedArrayBuffer)))return b(f,p,m);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let O=f.valueOf&&f.valueOf();if(O!=null&&O!==f)return r.from(O,p,m);let B=S(f);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return r.from(f[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}r.from=function(f,p,m){return n(f,p,m)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function e(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function i(f,p,m){return e(f),f<=0?t(f):p!==void 0?typeof m=="string"?t(f).fill(p,m):t(f).fill(p):t(f)}r.alloc=function(f,p,m){return i(f,p,m)};function c(f){return e(f),t(f<0?0:w(f)|0)}r.allocUnsafe=function(f){return c(f)},r.allocUnsafeSlow=function(f){return c(f)};function h(f,p){if((typeof p!="string"||p==="")&&(p="utf8"),!r.isEncoding(p))throw new TypeError("Unknown encoding: "+p);let m=g(f,p)|0,O=t(m),B=O.write(f,p);return B!==m&&(O=O.slice(0,B)),O}function d(f){let p=f.length<0?0:w(f.length)|0,m=t(p);for(let O=0;O<p;O+=1)m[O]=f[O]&255;return m}function y(f){if(Z(f,Uint8Array)){let p=new Uint8Array(f);return b(p.buffer,p.byteOffset,p.byteLength)}return d(f)}function b(f,p,m){if(p<0||f.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let O;return p===void 0&&m===void 0?O=new Uint8Array(f):m===void 0?O=new Uint8Array(f,p):O=new Uint8Array(f,p,m),Object.setPrototypeOf(O,r.prototype),O}function S(f){if(r.isBuffer(f)){let p=w(f.length)|0,m=t(p);return m.length===0||f.copy(m,0,0,p),m}if(f.length!==void 0)return typeof f.length!="number"||ve(f.length)?t(0):d(f);if(f.type==="Buffer"&&Array.isArray(f.data))return d(f.data)}function w(f){if(f>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return f|0}function x(f){return+f!=f&&(f=0),r.alloc(+f)}r.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==r.prototype},r.compare=function(f,p){if(Z(f,Uint8Array)&&(f=r.from(f,f.offset,f.byteLength)),Z(p,Uint8Array)&&(p=r.from(p,p.offset,p.byteLength)),!r.isBuffer(f)||!r.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===p)return 0;let m=f.length,O=p.length;for(let B=0,V=Math.min(m,O);B<V;++B)if(f[B]!==p[B]){m=f[B],O=p[B];break}return m<O?-1:O<m?1:0},r.isEncoding=function(f){switch(String(f).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}},r.concat=function(f,p){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return r.alloc(0);let m;if(p===void 0)for(p=0,m=0;m<f.length;++m)p+=f[m].length;let O=r.allocUnsafe(p),B=0;for(m=0;m<f.length;++m){let V=f[m];if(Z(V,Uint8Array))B+V.length>O.length?(r.isBuffer(V)||(V=r.from(V)),V.copy(O,B)):Uint8Array.prototype.set.call(O,V,B);else if(r.isBuffer(V))V.copy(O,B);else throw new TypeError('"list" argument must be an Array of Buffers');B+=V.length}return O};function g(f,p){if(r.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||Z(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);let m=f.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&m===0)return 0;let B=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Y(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return pe(f).length;default:if(B)return O?-1:Y(f).length;p=(""+p).toLowerCase(),B=!0}}r.byteLength=g;function _(f,p,m){let O=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(f||(f="utf8");;)switch(f){case"hex":return ee(this,p,m);case"utf8":case"utf-8":return N(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return A(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,p,m);default:if(O)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),O=!0}}r.prototype._isBuffer=!0;function E(f,p,m){let O=f[p];f[p]=f[m],f[m]=O}r.prototype.swap16=function(){let f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<f;p+=2)E(this,p,p+1);return this},r.prototype.swap32=function(){let f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<f;p+=4)E(this,p,p+3),E(this,p+1,p+2);return this},r.prototype.swap64=function(){let f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<f;p+=8)E(this,p,p+7),E(this,p+1,p+6),E(this,p+2,p+5),E(this,p+3,p+4);return this},r.prototype.toString=function(){let f=this.length;return f===0?"":arguments.length===0?N(this,0,f):_.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(f){if(!r.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:r.compare(this,f)===0},r.prototype.inspect=function(){let f="",p=Dt.INSPECT_MAX_BYTES;return f=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(f+=" ... "),"<Buffer "+f+">"},a&&(r.prototype[a]=r.prototype.inspect),r.prototype.compare=function(f,p,m,O,B){if(Z(f,Uint8Array)&&(f=r.from(f,f.offset,f.byteLength)),!r.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(p===void 0&&(p=0),m===void 0&&(m=f?f.length:0),O===void 0&&(O=0),B===void 0&&(B=this.length),p<0||m>f.length||O<0||B>this.length)throw new RangeError("out of range index");if(O>=B&&p>=m)return 0;if(O>=B)return-1;if(p>=m)return 1;if(p>>>=0,m>>>=0,O>>>=0,B>>>=0,this===f)return 0;let V=B-O,ie=m-p,$=Math.min(V,ie),J=this.slice(O,B),Te=f.slice(p,m);for(let Re=0;Re<$;++Re)if(J[Re]!==Te[Re]){V=J[Re],ie=Te[Re];break}return V<ie?-1:ie<V?1:0};function v(f,p,m,O,B){if(f.length===0)return-1;if(typeof m=="string"?(O=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,ve(m)&&(m=B?0:f.length-1),m<0&&(m=f.length+m),m>=f.length){if(B)return-1;m=f.length-1}else if(m<0)if(B)m=0;else return-1;if(typeof p=="string"&&(p=r.from(p,O)),r.isBuffer(p))return p.length===0?-1:C(f,p,m,O,B);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(f,p,m):Uint8Array.prototype.lastIndexOf.call(f,p,m):C(f,[p],m,O,B);throw new TypeError("val must be string, number or Buffer")}function C(f,p,m,O,B){let V=1,ie=f.length,$=p.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(f.length<2||p.length<2)return-1;V=2,ie/=2,$/=2,m/=2}function J(Re,Ne){return V===1?Re[Ne]:Re.readUInt16BE(Ne*V)}let Te;if(B){let Re=-1;for(Te=m;Te<ie;Te++)if(J(f,Te)===J(p,Re===-1?0:Te-Re)){if(Re===-1&&(Re=Te),Te-Re+1===$)return Re*V}else Re!==-1&&(Te-=Te-Re),Re=-1}else for(m+$>ie&&(m=ie-$),Te=m;Te>=0;Te--){let Re=!0;for(let Ne=0;Ne<$;Ne++)if(J(f,Te+Ne)!==J(p,Ne)){Re=!1;break}if(Re)return Te}return-1}r.prototype.includes=function(f,p,m){return this.indexOf(f,p,m)!==-1},r.prototype.indexOf=function(f,p,m){return v(this,f,p,m,!0)},r.prototype.lastIndexOf=function(f,p,m){return v(this,f,p,m,!1)};function P(f,p,m,O){m=Number(m)||0;let B=f.length-m;O?(O=Number(O),O>B&&(O=B)):O=B;let V=p.length;O>V/2&&(O=V/2);let ie;for(ie=0;ie<O;++ie){let $=parseInt(p.substr(ie*2,2),16);if(ve($))return ie;f[m+ie]=$}return ie}function I(f,p,m,O){return _e(Y(p,f.length-m),f,m,O)}function T(f,p,m,O){return _e(se(p),f,m,O)}function k(f,p,m,O){return _e(pe(p),f,m,O)}function W(f,p,m,O){return _e(me(p,f.length-m),f,m,O)}r.prototype.write=function(f,p,m,O){if(p===void 0)O="utf8",m=this.length,p=0;else if(m===void 0&&typeof p=="string")O=p,m=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(m)?(m=m>>>0,O===void 0&&(O="utf8")):(O=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let B=this.length-p;if((m===void 0||m>B)&&(m=B),f.length>0&&(m<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");O||(O="utf8");let V=!1;for(;;)switch(O){case"hex":return P(this,f,p,m);case"utf8":case"utf-8":return I(this,f,p,m);case"ascii":case"latin1":case"binary":return T(this,f,p,m);case"base64":return k(this,f,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,f,p,m);default:if(V)throw new TypeError("Unknown encoding: "+O);O=(""+O).toLowerCase(),V=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(f,p,m){return p===0&&m===f.length?o.fromByteArray(f):o.fromByteArray(f.slice(p,m))}function N(f,p,m){m=Math.min(f.length,m);let O=[],B=p;for(;B<m;){let V=f[B],ie=null,$=V>239?4:V>223?3:V>191?2:1;if(B+$<=m){let J,Te,Re,Ne;switch($){case 1:V<128&&(ie=V);break;case 2:J=f[B+1],(J&192)===128&&(Ne=(V&31)<<6|J&63,Ne>127&&(ie=Ne));break;case 3:J=f[B+1],Te=f[B+2],(J&192)===128&&(Te&192)===128&&(Ne=(V&15)<<12|(J&63)<<6|Te&63,Ne>2047&&(Ne<55296||Ne>57343)&&(ie=Ne));break;case 4:J=f[B+1],Te=f[B+2],Re=f[B+3],(J&192)===128&&(Te&192)===128&&(Re&192)===128&&(Ne=(V&15)<<18|(J&63)<<12|(Te&63)<<6|Re&63,Ne>65535&&Ne<1114112&&(ie=Ne))}}ie===null?(ie=65533,$=1):ie>65535&&(ie-=65536,O.push(ie>>>10&1023|55296),ie=56320|ie&1023),O.push(ie),B+=$}return M(O)}let q=4096;function M(f){let p=f.length;if(p<=q)return String.fromCharCode.apply(String,f);let m="",O=0;for(;O<p;)m+=String.fromCharCode.apply(String,f.slice(O,O+=q));return m}function le(f,p,m){let O="";m=Math.min(f.length,m);for(let B=p;B<m;++B)O+=String.fromCharCode(f[B]&127);return O}function re(f,p,m){let O="";m=Math.min(f.length,m);for(let B=p;B<m;++B)O+=String.fromCharCode(f[B]);return O}function ee(f,p,m){let O=f.length;(!p||p<0)&&(p=0),(!m||m<0||m>O)&&(m=O);let B="";for(let V=p;V<m;++V)B+=Ie[f[V]];return B}function ue(f,p,m){let O=f.slice(p,m),B="";for(let V=0;V<O.length-1;V+=2)B+=String.fromCharCode(O[V]+O[V+1]*256);return B}r.prototype.slice=function(f,p){let m=this.length;f=~~f,p=p===void 0?m:~~p,f<0?(f+=m,f<0&&(f=0)):f>m&&(f=m),p<0?(p+=m,p<0&&(p=0)):p>m&&(p=m),p<f&&(p=f);let O=this.subarray(f,p);return Object.setPrototypeOf(O,r.prototype),O};function G(f,p,m){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+p>m)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let O=this[f],B=1,V=0;for(;++V<p&&(B*=256);)O+=this[f+V]*B;return O},r.prototype.readUintBE=r.prototype.readUIntBE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let O=this[f+--p],B=1;for(;p>0&&(B*=256);)O+=this[f+--p]*B;return O},r.prototype.readUint8=r.prototype.readUInt8=function(f,p){return f=f>>>0,p||G(f,1,this.length),this[f]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(f,p){return f=f>>>0,p||G(f,2,this.length),this[f]|this[f+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(f,p){return f=f>>>0,p||G(f,2,this.length),this[f]<<8|this[f+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(f,p){return f=f>>>0,p||G(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},r.prototype.readBigUInt64LE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let O=p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,B=this[++f]+this[++f]*2**8+this[++f]*2**16+m*2**24;return BigInt(O)+(BigInt(B)<<BigInt(32))}),r.prototype.readBigUInt64BE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let O=p*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],B=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+m;return(BigInt(O)<<BigInt(32))+BigInt(B)}),r.prototype.readIntLE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let O=this[f],B=1,V=0;for(;++V<p&&(B*=256);)O+=this[f+V]*B;return B*=128,O>=B&&(O-=Math.pow(2,8*p)),O},r.prototype.readIntBE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let O=p,B=1,V=this[f+--O];for(;O>0&&(B*=256);)V+=this[f+--O]*B;return B*=128,V>=B&&(V-=Math.pow(2,8*p)),V},r.prototype.readInt8=function(f,p){return f=f>>>0,p||G(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},r.prototype.readInt16LE=function(f,p){f=f>>>0,p||G(f,2,this.length);let m=this[f]|this[f+1]<<8;return m&32768?m|4294901760:m},r.prototype.readInt16BE=function(f,p){f=f>>>0,p||G(f,2,this.length);let m=this[f+1]|this[f]<<8;return m&32768?m|4294901760:m},r.prototype.readInt32LE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},r.prototype.readInt32BE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},r.prototype.readBigInt64LE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let O=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(m<<24);return(BigInt(O)<<BigInt(32))+BigInt(p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),r.prototype.readBigInt64BE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let O=(p<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(O)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+m)}),r.prototype.readFloatLE=function(f,p){return f=f>>>0,p||G(f,4,this.length),l.read(this,f,!0,23,4)},r.prototype.readFloatBE=function(f,p){return f=f>>>0,p||G(f,4,this.length),l.read(this,f,!1,23,4)},r.prototype.readDoubleLE=function(f,p){return f=f>>>0,p||G(f,8,this.length),l.read(this,f,!0,52,8)},r.prototype.readDoubleBE=function(f,p){return f=f>>>0,p||G(f,8,this.length),l.read(this,f,!1,52,8)};function oe(f,p,m,O,B,V){if(!r.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>B||p<V)throw new RangeError('"value" argument is out of bounds');if(m+O>f.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(f,p,m,O){if(f=+f,p=p>>>0,m=m>>>0,!O){let ie=Math.pow(2,8*m)-1;oe(this,f,p,m,ie,0)}let B=1,V=0;for(this[p]=f&255;++V<m&&(B*=256);)this[p+V]=f/B&255;return p+m},r.prototype.writeUintBE=r.prototype.writeUIntBE=function(f,p,m,O){if(f=+f,p=p>>>0,m=m>>>0,!O){let ie=Math.pow(2,8*m)-1;oe(this,f,p,m,ie,0)}let B=m-1,V=1;for(this[p+B]=f&255;--B>=0&&(V*=256);)this[p+B]=f/V&255;return p+m},r.prototype.writeUint8=r.prototype.writeUInt8=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,1,255,0),this[p]=f&255,p+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,65535,0),this[p]=f&255,this[p+1]=f>>>8,p+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,65535,0),this[p]=f>>>8,this[p+1]=f&255,p+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,4294967295,0),this[p+3]=f>>>24,this[p+2]=f>>>16,this[p+1]=f>>>8,this[p]=f&255,p+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,4294967295,0),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4};function R(f,p,m,O,B){te(p,O,B,f,m,7);let V=Number(p&BigInt(4294967295));f[m++]=V,V=V>>8,f[m++]=V,V=V>>8,f[m++]=V,V=V>>8,f[m++]=V;let ie=Number(p>>BigInt(32)&BigInt(4294967295));return f[m++]=ie,ie=ie>>8,f[m++]=ie,ie=ie>>8,f[m++]=ie,ie=ie>>8,f[m++]=ie,m}function Q(f,p,m,O,B){te(p,O,B,f,m,7);let V=Number(p&BigInt(4294967295));f[m+7]=V,V=V>>8,f[m+6]=V,V=V>>8,f[m+5]=V,V=V>>8,f[m+4]=V;let ie=Number(p>>BigInt(32)&BigInt(4294967295));return f[m+3]=ie,ie=ie>>8,f[m+2]=ie,ie=ie>>8,f[m+1]=ie,ie=ie>>8,f[m]=ie,m+8}r.prototype.writeBigUInt64LE=fe(function(f,p=0){return R(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeBigUInt64BE=fe(function(f,p=0){return Q(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeIntLE=function(f,p,m,O){if(f=+f,p=p>>>0,!O){let $=Math.pow(2,8*m-1);oe(this,f,p,m,$-1,-$)}let B=0,V=1,ie=0;for(this[p]=f&255;++B<m&&(V*=256);)f<0&&ie===0&&this[p+B-1]!==0&&(ie=1),this[p+B]=(f/V>>0)-ie&255;return p+m},r.prototype.writeIntBE=function(f,p,m,O){if(f=+f,p=p>>>0,!O){let $=Math.pow(2,8*m-1);oe(this,f,p,m,$-1,-$)}let B=m-1,V=1,ie=0;for(this[p+B]=f&255;--B>=0&&(V*=256);)f<0&&ie===0&&this[p+B+1]!==0&&(ie=1),this[p+B]=(f/V>>0)-ie&255;return p+m},r.prototype.writeInt8=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,1,127,-128),f<0&&(f=255+f+1),this[p]=f&255,p+1},r.prototype.writeInt16LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,32767,-32768),this[p]=f&255,this[p+1]=f>>>8,p+2},r.prototype.writeInt16BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,32767,-32768),this[p]=f>>>8,this[p+1]=f&255,p+2},r.prototype.writeInt32LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,2147483647,-2147483648),this[p]=f&255,this[p+1]=f>>>8,this[p+2]=f>>>16,this[p+3]=f>>>24,p+4},r.prototype.writeInt32BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4},r.prototype.writeBigInt64LE=fe(function(f,p=0){return R(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),r.prototype.writeBigInt64BE=fe(function(f,p=0){return Q(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function he(f,p,m,O,B,V){if(m+O>f.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function z(f,p,m,O,B){return p=+p,m=m>>>0,B||he(f,p,m,4),l.write(f,p,m,O,23,4),m+4}r.prototype.writeFloatLE=function(f,p,m){return z(this,f,p,!0,m)},r.prototype.writeFloatBE=function(f,p,m){return z(this,f,p,!1,m)};function Ee(f,p,m,O,B){return p=+p,m=m>>>0,B||he(f,p,m,8),l.write(f,p,m,O,52,8),m+8}r.prototype.writeDoubleLE=function(f,p,m){return Ee(this,f,p,!0,m)},r.prototype.writeDoubleBE=function(f,p,m){return Ee(this,f,p,!1,m)},r.prototype.copy=function(f,p,m,O){if(!r.isBuffer(f))throw new TypeError("argument should be a Buffer");if(m||(m=0),!O&&O!==0&&(O=this.length),p>=f.length&&(p=f.length),p||(p=0),O>0&&O<m&&(O=m),O===m||f.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("sourceEnd out of bounds");O>this.length&&(O=this.length),f.length-p<O-m&&(O=f.length-p+m);let B=O-m;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,m,O):Uint8Array.prototype.set.call(f,this.subarray(m,O),p),B},r.prototype.fill=function(f,p,m,O){if(typeof f=="string"){if(typeof p=="string"?(O=p,p=0,m=this.length):typeof m=="string"&&(O=m,m=this.length),O!==void 0&&typeof O!="string")throw new TypeError("encoding must be a string");if(typeof O=="string"&&!r.isEncoding(O))throw new TypeError("Unknown encoding: "+O);if(f.length===1){let V=f.charCodeAt(0);(O==="utf8"&&V<128||O==="latin1")&&(f=V)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(p<0||this.length<p||this.length<m)throw new RangeError("Out of range index");if(m<=p)return this;p=p>>>0,m=m===void 0?this.length:m>>>0,f||(f=0);let B;if(typeof f=="number")for(B=p;B<m;++B)this[B]=f;else{let V=r.isBuffer(f)?f:r.from(f,O),ie=V.length;if(ie===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(B=0;B<m-p;++B)this[B+p]=V[B%ie]}return this};let X={};function D(f,p,m){X[f]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(O){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:O,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}D("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(f,p){return`The "${f}" argument must be of type number. Received type ${typeof p}`},TypeError),D("ERR_OUT_OF_RANGE",function(f,p,m){let O=`The value of "${f}" is out of range.`,B=m;return Number.isInteger(m)&&Math.abs(m)>2**32?B=ae(String(m)):typeof m=="bigint"&&(B=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(B=ae(B)),B+="n"),O+=` It must be ${p}. Received ${B}`,O},RangeError);function ae(f){let p="",m=f.length,O=f[0]==="-"?1:0;for(;m>=O+4;m-=3)p=`_${f.slice(m-3,m)}${p}`;return`${f.slice(0,m)}${p}`}function H(f,p,m){ne(p,"offset"),(f[p]===void 0||f[p+m]===void 0)&&be(p,f.length-(m+1))}function te(f,p,m,O,B,V){if(f>m||f<p){let ie=typeof p=="bigint"?"n":"",$;throw p===0||p===BigInt(0)?$=`>= 0${ie} and < 2${ie} ** ${(V+1)*8}${ie}`:$=`>= -(2${ie} ** ${(V+1)*8-1}${ie}) and < 2 ** ${(V+1)*8-1}${ie}`,new X.ERR_OUT_OF_RANGE("value",$,f)}H(O,B,V)}function ne(f,p){if(typeof f!="number")throw new X.ERR_INVALID_ARG_TYPE(p,"number",f)}function be(f,p,m){throw Math.floor(f)!==f?(ne(f,m),new X.ERR_OUT_OF_RANGE("offset","an integer",f)):p<0?new X.ERR_BUFFER_OUT_OF_BOUNDS:new X.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,f)}let ce=/[^+/0-9A-Za-z-_]/g;function L(f){if(f=f.split("=")[0],f=f.trim().replace(ce,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function Y(f,p){p=p||1/0;let m,O=f.length,B=null,V=[];for(let ie=0;ie<O;++ie){if(m=f.charCodeAt(ie),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&V.push(239,191,189);continue}else if(ie+1===O){(p-=3)>-1&&V.push(239,191,189);continue}B=m;continue}if(m<56320){(p-=3)>-1&&V.push(239,191,189),B=m;continue}m=(B-55296<<10|m-56320)+65536}else B&&(p-=3)>-1&&V.push(239,191,189);if(B=null,m<128){if((p-=1)<0)break;V.push(m)}else if(m<2048){if((p-=2)<0)break;V.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;V.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;V.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return V}function se(f){let p=[];for(let m=0;m<f.length;++m)p.push(f.charCodeAt(m)&255);return p}function me(f,p){let m,O,B,V=[];for(let ie=0;ie<f.length&&!((p-=2)<0);++ie)m=f.charCodeAt(ie),O=m>>8,B=m%256,V.push(B),V.push(O);return V}function pe(f){return o.toByteArray(L(f))}function _e(f,p,m,O){let B;for(B=0;B<O&&!(B+m>=p.length||B>=f.length);++B)p[B+m]=f[B];return B}function Z(f,p){return f instanceof p||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===p.name}function ve(f){return f!==f}let Ie=function(){let f="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){let O=m*16;for(let B=0;B<16;++B)p[O+B]=f[m]+f[B]}return p}();function fe(f){return typeof BigInt>"u"?De:f}function De(){throw new Error("BigInt not supported")}return Dt}var ir,Si,gr,Ei,Dt,xi,ku=_t(()=>{de(),ye(),ge(),ir={},Si=!1,gr={},Ei=!1,Dt={},xi=!1}),pt={};nr(pt,{Buffer:()=>Ar,INSPECT_MAX_BYTES:()=>os,default:()=>Ct,kMaxLength:()=>ss});var Ct,Ar,os,ss,dt=_t(()=>{de(),ye(),ge(),ku(),Ct=Iu(),Ct.Buffer,Ct.SlowBuffer,Ct.INSPECT_MAX_BYTES,Ct.kMaxLength,Ar=Ct.Buffer,os=Ct.INSPECT_MAX_BYTES,ss=Ct.kMaxLength}),ye=_t(()=>{dt()}),ut=we((o,l)=>{de(),ye(),ge();var a=class extends Error{constructor(s){if(!Array.isArray(s))throw new TypeError(`Expected input to be an Array, got ${typeof s}`);let u="";for(let t=0;t<s.length;t++)u+=` ${s[t].stack}
|
|
31
|
-
`;super(u),this.name="AggregateError",this.errors=s}};l.exports={AggregateError:a,ArrayIsArray(s){return Array.isArray(s)},ArrayPrototypeIncludes(s,u){return s.includes(u)},ArrayPrototypeIndexOf(s,u){return s.indexOf(u)},ArrayPrototypeJoin(s,u){return s.join(u)},ArrayPrototypeMap(s,u){return s.map(u)},ArrayPrototypePop(s,u){return s.pop(u)},ArrayPrototypePush(s,u){return s.push(u)},ArrayPrototypeSlice(s,u,t){return s.slice(u,t)},Error,FunctionPrototypeCall(s,u,...t){return s.call(u,...t)},FunctionPrototypeSymbolHasInstance(s,u){return Function.prototype[Symbol.hasInstance].call(s,u)},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(s,u){return Object.defineProperties(s,u)},ObjectDefineProperty(s,u,t){return Object.defineProperty(s,u,t)},ObjectGetOwnPropertyDescriptor(s,u){return Object.getOwnPropertyDescriptor(s,u)},ObjectKeys(s){return Object.keys(s)},ObjectSetPrototypeOf(s,u){return Object.setPrototypeOf(s,u)},Promise,PromisePrototypeCatch(s,u){return s.catch(u)},PromisePrototypeThen(s,u,t){return s.then(u,t)},PromiseReject(s){return Promise.reject(s)},PromiseResolve(s){return Promise.resolve(s)},ReflectApply:Reflect.apply,RegExpPrototypeTest(s,u){return s.test(u)},SafeSet:Set,String,StringPrototypeSlice(s,u,t){return s.slice(u,t)},StringPrototypeToLowerCase(s){return s.toLowerCase()},StringPrototypeToUpperCase(s){return s.toUpperCase()},StringPrototypeTrim(s){return s.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(s,u,t){return s.set(u,t)},Boolean,Uint8Array}}),as=we((o,l)=>{de(),ye(),ge(),l.exports={format(a,...s){return a.replace(/%([sdifj])/g,function(...[u,t]){let r=s.shift();return t==="f"?r.toFixed(6):t==="j"?JSON.stringify(r):t==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},inspect(a){switch(typeof a){case"string":if(a.includes("'"))if(a.includes('"')){if(!a.includes("`")&&!a.includes("${"))return`\`${a}\``}else return`"${a}"`;return`'${a}'`;case"number":return isNaN(a)?"NaN":Object.is(a,-0)?String(a):a;case"bigint":return`${String(a)}n`;case"boolean":case"undefined":return String(a);case"object":return"{}"}}}}),wt=we((o,l)=>{de(),ye(),ge();var{format:a,inspect:s}=as(),{AggregateError:u}=ut(),t=globalThis.AggregateError||u,r=Symbol("kIsNodeError"),n=["string","function","number","object","Function","Object","boolean","bigint","symbol"],e=/^([A-Z][a-z0-9]*)+$/,i="__node_internal_",c={};function h(g,_){if(!g)throw new c.ERR_INTERNAL_ASSERTION(_)}function d(g){let _="",E=g.length,v=g[0]==="-"?1:0;for(;E>=v+4;E-=3)_=`_${g.slice(E-3,E)}${_}`;return`${g.slice(0,E)}${_}`}function y(g,_,E){if(typeof _=="function")return h(_.length<=E.length,`Code: ${g}; The provided arguments length (${E.length}) does not match the required ones (${_.length}).`),_(...E);let v=(_.match(/%[dfijoOs]/g)||[]).length;return h(v===E.length,`Code: ${g}; The provided arguments length (${E.length}) does not match the required ones (${v}).`),E.length===0?_:a(_,...E)}function b(g,_,E){E||(E=Error);class v extends E{constructor(...P){super(y(g,_,P))}toString(){return`${this.name} [${g}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${g}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=g,v.prototype[r]=!0,c[g]=v}function S(g){let _=i+g.name;return Object.defineProperty(g,"name",{value:_}),g}function w(g,_){if(g&&_&&g!==_){if(Array.isArray(_.errors))return _.errors.push(g),_;let E=new t([_,g],_.message);return E.code=_.code,E}return g||_}var x=class extends Error{constructor(g="The operation was aborted",_=void 0){if(_!==void 0&&typeof _!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",_);super(g,_),this.code="ABORT_ERR",this.name="AbortError"}};b("ERR_ASSERTION","%s",Error),b("ERR_INVALID_ARG_TYPE",(g,_,E)=>{h(typeof g=="string","'name' must be a string"),Array.isArray(_)||(_=[_]);let v="The ";g.endsWith(" argument")?v+=`${g} `:v+=`"${g}" ${g.includes(".")?"property":"argument"} `,v+="must be ";let C=[],P=[],I=[];for(let k of _)h(typeof k=="string","All expected entries have to be of type string"),n.includes(k)?C.push(k.toLowerCase()):e.test(k)?P.push(k):(h(k!=="object",'The value "object" should be written as "Object"'),I.push(k));if(P.length>0){let k=C.indexOf("object");k!==-1&&(C.splice(C,k,1),P.push("Object"))}if(C.length>0){switch(C.length){case 1:v+=`of type ${C[0]}`;break;case 2:v+=`one of type ${C[0]} or ${C[1]}`;break;default:{let k=C.pop();v+=`one of type ${C.join(", ")}, or ${k}`}}(P.length>0||I.length>0)&&(v+=" or ")}if(P.length>0){switch(P.length){case 1:v+=`an instance of ${P[0]}`;break;case 2:v+=`an instance of ${P[0]} or ${P[1]}`;break;default:{let k=P.pop();v+=`an instance of ${P.join(", ")}, or ${k}`}}I.length>0&&(v+=" or ")}switch(I.length){case 0:break;case 1:I[0].toLowerCase()!==I[0]&&(v+="an "),v+=`${I[0]}`;break;case 2:v+=`one of ${I[0]} or ${I[1]}`;break;default:{let k=I.pop();v+=`one of ${I.join(", ")}, or ${k}`}}if(E==null)v+=`. Received ${E}`;else if(typeof E=="function"&&E.name)v+=`. Received function ${E.name}`;else if(typeof E=="object"){var T;if((T=E.constructor)!==null&&T!==void 0&&T.name)v+=`. Received an instance of ${E.constructor.name}`;else{let k=s(E,{depth:-1});v+=`. Received ${k}`}}else{let k=s(E,{colors:!1});k.length>25&&(k=`${k.slice(0,25)}...`),v+=`. Received type ${typeof E} (${k})`}return v},TypeError),b("ERR_INVALID_ARG_VALUE",(g,_,E="is invalid")=>{let v=s(_);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${g.includes(".")?"property":"argument"} '${g}' ${E}. Received ${v}`},TypeError),b("ERR_INVALID_RETURN_VALUE",(g,_,E)=>{var v;let C=E!=null&&(v=E.constructor)!==null&&v!==void 0&&v.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${g} to be returned from the "${_}" function but got ${C}.`},TypeError),b("ERR_MISSING_ARGS",(...g)=>{h(g.length>0,"At least one arg needs to be specified");let _,E=g.length;switch(g=(Array.isArray(g)?g:[g]).map(v=>`"${v}"`).join(" or "),E){case 1:_+=`The ${g[0]} argument`;break;case 2:_+=`The ${g[0]} and ${g[1]} arguments`;break;default:{let v=g.pop();_+=`The ${g.join(", ")}, and ${v} arguments`}break}return`${_} must be specified`},TypeError),b("ERR_OUT_OF_RANGE",(g,_,E)=>{h(_,'Missing "range" argument');let v;if(Number.isInteger(E)&&Math.abs(E)>2**32)v=d(String(E));else if(typeof E=="bigint"){v=String(E);let C=BigInt(2)**BigInt(32);(E>C||E<-C)&&(v=d(v)),v+="n"}else v=s(E);return`The value of "${g}" is out of range. It must be ${_}. Received ${v}`},RangeError),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),b("ERR_STREAM_WRITE_AFTER_END","write after end",Error),b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),l.exports={AbortError:x,aggregateTwoErrors:S(w),hideStackFrames:S,codes:c}}),yr=we((o,l)=>{de(),ye(),ge();var{AbortController:a,AbortSignal:s}=typeof self<"u"?self:typeof window<"u"?window:void 0;l.exports=a,l.exports.AbortSignal=s,l.exports.default=a}),Ft={};nr(Ft,{EventEmitter:()=>ls,default:()=>or,defaultMaxListeners:()=>us,init:()=>cs,listenerCount:()=>fs,on:()=>hs,once:()=>ps});function Ou(){if(Ai)return mr;Ai=!0;var o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(E,v,C){return Function.prototype.apply.call(E,v,C)},a;o&&typeof o.ownKeys=="function"?a=o.ownKeys:Object.getOwnPropertySymbols?a=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:a=function(E){return Object.getOwnPropertyNames(E)};function s(E){console&&console.warn&&console.warn(E)}var u=Number.isNaN||function(E){return E!==E};function t(){t.init.call(this)}mr=t,mr.once=x,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function n(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(E){if(typeof E!="number"||E<0||u(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");r=E}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||u(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};function e(E){return E._maxListeners===void 0?t.defaultMaxListeners:E._maxListeners}t.prototype.getMaxListeners=function(){return e(this)},t.prototype.emit=function(E){for(var v=[],C=1;C<arguments.length;C++)v.push(arguments[C]);var P=E==="error",I=this._events;if(I!==void 0)P=P&&I.error===void 0;else if(!P)return!1;if(P){var T;if(v.length>0&&(T=v[0]),T instanceof Error)throw T;var k=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw k.context=T,k}var W=I[E];if(W===void 0)return!1;if(typeof W=="function")l(W,this,v);else for(var A=W.length,N=b(W,A),C=0;C<A;++C)l(N[C],this,v);return!0};function i(E,v,C,P){var I,T,k;if(n(C),T=E._events,T===void 0?(T=E._events=Object.create(null),E._eventsCount=0):(T.newListener!==void 0&&(E.emit("newListener",v,C.listener?C.listener:C),T=E._events),k=T[v]),k===void 0)k=T[v]=C,++E._eventsCount;else if(typeof k=="function"?k=T[v]=P?[C,k]:[k,C]:P?k.unshift(C):k.push(C),I=e(E),I>0&&k.length>I&&!k.warned){k.warned=!0;var W=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(v)+" listeners added. Use emitter.setMaxListeners() to increase limit");W.name="MaxListenersExceededWarning",W.emitter=E,W.type=v,W.count=k.length,s(W)}return E}t.prototype.addListener=function(E,v){return i(this,E,v,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(E,v){return i(this,E,v,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(E,v,C){var P={fired:!1,wrapFn:void 0,target:E,type:v,listener:C},I=c.bind(P);return I.listener=C,P.wrapFn=I,I}t.prototype.once=function(E,v){return n(v),this.on(E,h(this,E,v)),this},t.prototype.prependOnceListener=function(E,v){return n(v),this.prependListener(E,h(this,E,v)),this},t.prototype.removeListener=function(E,v){var C,P,I,T,k;if(n(v),P=this._events,P===void 0)return this;if(C=P[E],C===void 0)return this;if(C===v||C.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete P[E],P.removeListener&&this.emit("removeListener",E,C.listener||v));else if(typeof C!="function"){for(I=-1,T=C.length-1;T>=0;T--)if(C[T]===v||C[T].listener===v){k=C[T].listener,I=T;break}if(I<0)return this;I===0?C.shift():S(C,I),C.length===1&&(P[E]=C[0]),P.removeListener!==void 0&&this.emit("removeListener",E,k||v)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(E){var v,C,P;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[E]),this;if(arguments.length===0){var I=Object.keys(C),T;for(P=0;P<I.length;++P)T=I[P],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=C[E],typeof v=="function")this.removeListener(E,v);else if(v!==void 0)for(P=v.length-1;P>=0;P--)this.removeListener(E,v[P]);return this};function d(E,v,C){var P=E._events;if(P===void 0)return[];var I=P[v];return I===void 0?[]:typeof I=="function"?C?[I.listener||I]:[I]:C?w(I):b(I,I.length)}t.prototype.listeners=function(E){return d(this,E,!0)},t.prototype.rawListeners=function(E){return d(this,E,!1)},t.listenerCount=function(E,v){return typeof E.listenerCount=="function"?E.listenerCount(v):y.call(E,v)},t.prototype.listenerCount=y;function y(E){var v=this._events;if(v!==void 0){var C=v[E];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]};function b(E,v){for(var C=new Array(v),P=0;P<v;++P)C[P]=E[P];return C}function S(E,v){for(;v+1<E.length;v++)E[v]=E[v+1];E.pop()}function w(E){for(var v=new Array(E.length),C=0;C<v.length;++C)v[C]=E[C].listener||E[C];return v}function x(E,v){return new Promise(function(C,P){function I(k){E.removeListener(v,T),P(k)}function T(){typeof E.removeListener=="function"&&E.removeListener("error",I),C([].slice.call(arguments))}_(E,v,T,{once:!0}),v!=="error"&&g(E,I,{once:!0})})}function g(E,v,C){typeof E.on=="function"&&_(E,"error",v,C)}function _(E,v,C,P){if(typeof E.on=="function")P.once?E.once(v,C):E.on(v,C);else if(typeof E.addEventListener=="function")E.addEventListener(v,function I(T){P.once&&E.removeEventListener(v,I),C(T)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E)}return mr}var mr,Ai,or,ls,us,cs,fs,hs,ps,Qt=_t(()=>{de(),ye(),ge(),mr={},Ai=!1,or=Ou(),or.once,or.once=function(o,l){return new Promise((a,s)=>{function u(...r){t!==void 0&&o.removeListener("error",t),a(r)}let t;l!=="error"&&(t=r=>{o.removeListener(name,u),s(r)},o.once("error",t)),o.once(l,u)})},or.on=function(o,l){let a=[],s=[],u=null,t=!1,r={async next(){let i=a.shift();if(i)return createIterResult(i,!1);if(u){let c=Promise.reject(u);return u=null,c}return t?createIterResult(void 0,!0):new Promise((c,h)=>s.push({resolve:c,reject:h}))},async return(){o.removeListener(l,n),o.removeListener("error",e),t=!0;for(let i of s)i.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(i){u=i,o.removeListener(l,n),o.removeListener("error",e)},[Symbol.asyncIterator](){return this}};return o.on(l,n),o.on("error",e),r;function n(...i){let c=s.shift();c?c.resolve(createIterResult(i,!1)):a.push(i)}function e(i){t=!0;let c=s.shift();c?c.reject(i):u=i,r.return()}},{EventEmitter:ls,defaultMaxListeners:us,init:cs,listenerCount:fs,on:hs,once:ps}=or}),St=we((o,l)=>{de(),ye(),ge();var a=(dt(),tt(pt)),{format:s,inspect:u}=as(),{codes:{ERR_INVALID_ARG_TYPE:t}}=wt(),{kResistStopPropagation:r,AggregateError:n,SymbolDispose:e}=ut(),i=globalThis.AbortSignal||yr().AbortSignal,c=globalThis.AbortController||yr().AbortController,h=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||a.Blob,y=typeof d<"u"?function(w){return w instanceof d}:function(w){return!1},b=(w,x)=>{if(w!==void 0&&(w===null||typeof w!="object"||!("aborted"in w)))throw new t(x,"AbortSignal",w)},S=(w,x)=>{if(typeof w!="function")throw new t(x,"Function",w)};l.exports={AggregateError:n,kEmptyObject:Object.freeze({}),once(w){let x=!1;return function(...g){x||(x=!0,w.apply(this,g))}},createDeferredPromise:function(){let w,x;return{promise:new Promise((g,_)=>{w=g,x=_}),resolve:w,reject:x}},promisify(w){return new Promise((x,g)=>{w((_,...E)=>_?g(_):x(...E))})},debuglog(){return function(){}},format:s,inspect:u,types:{isAsyncFunction(w){return w instanceof h},isArrayBufferView(w){return ArrayBuffer.isView(w)}},isBlob:y,deprecate(w,x){return w},addAbortListener:(Qt(),tt(Ft)).addAbortListener||function(w,x){if(w===void 0)throw new t("signal","AbortSignal",w);b(w,"signal"),S(x,"listener");let g;return w.aborted?queueMicrotask(()=>x()):(w.addEventListener("abort",x,{__proto__:null,once:!0,[r]:!0}),g=()=>{w.removeEventListener("abort",x)}),{__proto__:null,[e](){var _;(_=g)===null||_===void 0||_()}}},AbortSignalAny:i.any||function(w){if(w.length===1)return w[0];let x=new c,g=()=>x.abort();return w.forEach(_=>{b(_,"signals"),_.addEventListener("abort",g,{once:!0})}),x.signal.addEventListener("abort",()=>{w.forEach(_=>_.removeEventListener("abort",g))},{once:!0}),x.signal}},l.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),br=we((o,l)=>{de(),ye(),ge();var{ArrayIsArray:a,ArrayPrototypeIncludes:s,ArrayPrototypeJoin:u,ArrayPrototypeMap:t,NumberIsInteger:r,NumberIsNaN:n,NumberMAX_SAFE_INTEGER:e,NumberMIN_SAFE_INTEGER:i,NumberParseInt:c,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:y,StringPrototypeToUpperCase:b,StringPrototypeTrim:S}=ut(),{hideStackFrames:w,codes:{ERR_SOCKET_BAD_PORT:x,ERR_INVALID_ARG_TYPE:g,ERR_INVALID_ARG_VALUE:_,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:v}}=wt(),{normalizeEncoding:C}=St(),{isAsyncFunction:P,isArrayBufferView:I}=St().types,T={};function k(Z){return Z===(Z|0)}function W(Z){return Z===Z>>>0}var A=/^[0-7]+$/,N="must be a 32-bit unsigned integer or an octal string";function q(Z,ve,Ie){if(typeof Z>"u"&&(Z=Ie),typeof Z=="string"){if(d(A,Z)===null)throw new _(ve,Z,N);Z=c(Z,8)}return re(Z,ve),Z}var M=w((Z,ve,Ie=i,fe=e)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);if(Z<Ie||Z>fe)throw new E(ve,`>= ${Ie} && <= ${fe}`,Z)}),le=w((Z,ve,Ie=-2147483648,fe=2147483647)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);if(Z<Ie||Z>fe)throw new E(ve,`>= ${Ie} && <= ${fe}`,Z)}),re=w((Z,ve,Ie=!1)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);let fe=Ie?1:0,De=4294967295;if(Z<fe||Z>De)throw new E(ve,`>= ${fe} && <= ${De}`,Z)});function ee(Z,ve){if(typeof Z!="string")throw new g(ve,"string",Z)}function ue(Z,ve,Ie=void 0,fe){if(typeof Z!="number")throw new g(ve,"number",Z);if(Ie!=null&&Z<Ie||fe!=null&&Z>fe||(Ie!=null||fe!=null)&&n(Z))throw new E(ve,`${Ie!=null?`>= ${Ie}`:""}${Ie!=null&&fe!=null?" && ":""}${fe!=null?`<= ${fe}`:""}`,Z)}var G=w((Z,ve,Ie)=>{if(!s(Ie,Z)){let fe="must be one of: "+u(t(Ie,De=>typeof De=="string"?`'${De}'`:y(De)),", ");throw new _(ve,Z,fe)}});function oe(Z,ve){if(typeof Z!="boolean")throw new g(ve,"boolean",Z)}function R(Z,ve,Ie){return Z==null||!h(Z,ve)?Ie:Z[ve]}var Q=w((Z,ve,Ie=null)=>{let fe=R(Ie,"allowArray",!1),De=R(Ie,"allowFunction",!1);if(!R(Ie,"nullable",!1)&&Z===null||!fe&&a(Z)||typeof Z!="object"&&(!De||typeof Z!="function"))throw new g(ve,"Object",Z)}),he=w((Z,ve)=>{if(Z!=null&&typeof Z!="object"&&typeof Z!="function")throw new g(ve,"a dictionary",Z)}),z=w((Z,ve,Ie=0)=>{if(!a(Z))throw new g(ve,"Array",Z);if(Z.length<Ie){let fe=`must be longer than ${Ie}`;throw new _(ve,Z,fe)}});function Ee(Z,ve){z(Z,ve);for(let Ie=0;Ie<Z.length;Ie++)ee(Z[Ie],`${ve}[${Ie}]`)}function X(Z,ve){z(Z,ve);for(let Ie=0;Ie<Z.length;Ie++)oe(Z[Ie],`${ve}[${Ie}]`)}function D(Z,ve){z(Z,ve);for(let Ie=0;Ie<Z.length;Ie++){let fe=Z[Ie],De=`${ve}[${Ie}]`;if(fe==null)throw new g(De,"AbortSignal",fe);be(fe,De)}}function ae(Z,ve="signal"){if(ee(Z,ve),T[Z]===void 0)throw T[b(Z)]!==void 0?new v(Z+" (signals must use all capital letters)"):new v(Z)}var H=w((Z,ve="buffer")=>{if(!I(Z))throw new g(ve,["Buffer","TypedArray","DataView"],Z)});function te(Z,ve){let Ie=C(ve),fe=Z.length;if(Ie==="hex"&&fe%2!==0)throw new _("encoding",ve,`is invalid for data of length ${fe}`)}function ne(Z,ve="Port",Ie=!0){if(typeof Z!="number"&&typeof Z!="string"||typeof Z=="string"&&S(Z).length===0||+Z!==+Z>>>0||Z>65535||Z===0&&!Ie)throw new x(ve,Z,Ie);return Z|0}var be=w((Z,ve)=>{if(Z!==void 0&&(Z===null||typeof Z!="object"||!("aborted"in Z)))throw new g(ve,"AbortSignal",Z)}),ce=w((Z,ve)=>{if(typeof Z!="function")throw new g(ve,"Function",Z)}),L=w((Z,ve)=>{if(typeof Z!="function"||P(Z))throw new g(ve,"Function",Z)}),Y=w((Z,ve)=>{if(Z!==void 0)throw new g(ve,"undefined",Z)});function se(Z,ve,Ie){if(!s(Ie,Z))throw new g(ve,`('${u(Ie,"|")}')`,Z)}var me=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function pe(Z,ve){if(typeof Z>"u"||!d(me,Z))throw new _(ve,Z,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function _e(Z){if(typeof Z=="string")return pe(Z,"hints"),Z;if(a(Z)){let ve=Z.length,Ie="";if(ve===0)return Ie;for(let fe=0;fe<ve;fe++){let De=Z[fe];pe(De,"hints"),Ie+=De,fe!==ve-1&&(Ie+=", ")}return Ie}throw new _("hints",Z,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}l.exports={isInt32:k,isUint32:W,parseFileMode:q,validateArray:z,validateStringArray:Ee,validateBooleanArray:X,validateAbortSignalArray:D,validateBoolean:oe,validateBuffer:H,validateDictionary:he,validateEncoding:te,validateFunction:ce,validateInt32:le,validateInteger:M,validateNumber:ue,validateObject:Q,validateOneOf:G,validatePlainFunction:L,validatePort:ne,validateSignalName:ae,validateString:ee,validateUint32:re,validateUndefined:Y,validateUnion:se,validateAbortSignal:be,validateLinkHeaderValue:_e}}),Jt=we((o,l)=>{de(),ye(),ge();var a=l.exports={},s,u;function t(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?s=setTimeout:s=t}catch{s=t}try{typeof clearTimeout=="function"?u=clearTimeout:u=r}catch{u=r}})();function n(x){if(s===setTimeout)return setTimeout(x,0);if((s===t||!s)&&setTimeout)return s=setTimeout,setTimeout(x,0);try{return s(x,0)}catch{try{return s.call(null,x,0)}catch{return s.call(this,x,0)}}}function e(x){if(u===clearTimeout)return clearTimeout(x);if((u===r||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(x);try{return u(x)}catch{try{return u.call(null,x)}catch{return u.call(this,x)}}}var i=[],c=!1,h,d=-1;function y(){!c||!h||(c=!1,h.length?i=h.concat(i):d=-1,i.length&&b())}function b(){if(!c){var x=n(y);c=!0;for(var g=i.length;g;){for(h=i,i=[];++d<g;)h&&h[d].run();d=-1,g=i.length}h=null,c=!1,e(x)}}a.nextTick=function(x){var g=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];i.push(new S(x,g)),i.length===1&&!c&&n(b)};function S(x,g){this.fun=x,this.array=g}S.prototype.run=function(){this.fun.apply(null,this.array)},a.title="browser",a.browser=!0,a.env={},a.argv=[],a.version="",a.versions={};function w(){}a.on=w,a.addListener=w,a.once=w,a.off=w,a.removeListener=w,a.removeAllListeners=w,a.emit=w,a.prependListener=w,a.prependOnceListener=w,a.listeners=function(x){return[]},a.binding=function(x){throw new Error("process.binding is not supported")},a.cwd=function(){return"/"},a.chdir=function(x){throw new Error("process.chdir is not supported")},a.umask=function(){return 0}}),jt=we((o,l)=>{de(),ye(),ge();var{SymbolAsyncIterator:a,SymbolIterator:s,SymbolFor:u}=ut(),t=u("nodejs.stream.destroyed"),r=u("nodejs.stream.errored"),n=u("nodejs.stream.readable"),e=u("nodejs.stream.writable"),i=u("nodejs.stream.disturbed"),c=u("nodejs.webstream.isClosedPromise"),h=u("nodejs.webstream.controllerErrorFunction");function d(R,Q=!1){var he;return!!(R&&typeof R.pipe=="function"&&typeof R.on=="function"&&(!Q||typeof R.pause=="function"&&typeof R.resume=="function")&&(!R._writableState||((he=R._readableState)===null||he===void 0?void 0:he.readable)!==!1)&&(!R._writableState||R._readableState))}function y(R){var Q;return!!(R&&typeof R.write=="function"&&typeof R.on=="function"&&(!R._readableState||((Q=R._writableState)===null||Q===void 0?void 0:Q.writable)!==!1))}function b(R){return!!(R&&typeof R.pipe=="function"&&R._readableState&&typeof R.on=="function"&&typeof R.write=="function")}function S(R){return R&&(R._readableState||R._writableState||typeof R.write=="function"&&typeof R.on=="function"||typeof R.pipe=="function"&&typeof R.on=="function")}function w(R){return!!(R&&!S(R)&&typeof R.pipeThrough=="function"&&typeof R.getReader=="function"&&typeof R.cancel=="function")}function x(R){return!!(R&&!S(R)&&typeof R.getWriter=="function"&&typeof R.abort=="function")}function g(R){return!!(R&&!S(R)&&typeof R.readable=="object"&&typeof R.writable=="object")}function _(R){return w(R)||x(R)||g(R)}function E(R,Q){return R==null?!1:Q===!0?typeof R[a]=="function":Q===!1?typeof R[s]=="function":typeof R[a]=="function"||typeof R[s]=="function"}function v(R){if(!S(R))return null;let Q=R._writableState,he=R._readableState,z=Q||he;return!!(R.destroyed||R[t]||z!=null&&z.destroyed)}function C(R){if(!y(R))return null;if(R.writableEnded===!0)return!0;let Q=R._writableState;return Q!=null&&Q.errored?!1:typeof(Q==null?void 0:Q.ended)!="boolean"?null:Q.ended}function P(R,Q){if(!y(R))return null;if(R.writableFinished===!0)return!0;let he=R._writableState;return he!=null&&he.errored?!1:typeof(he==null?void 0:he.finished)!="boolean"?null:!!(he.finished||Q===!1&&he.ended===!0&&he.length===0)}function I(R){if(!d(R))return null;if(R.readableEnded===!0)return!0;let Q=R._readableState;return!Q||Q.errored?!1:typeof(Q==null?void 0:Q.ended)!="boolean"?null:Q.ended}function T(R,Q){if(!d(R))return null;let he=R._readableState;return he!=null&&he.errored?!1:typeof(he==null?void 0:he.endEmitted)!="boolean"?null:!!(he.endEmitted||Q===!1&&he.ended===!0&&he.length===0)}function k(R){return R&&R[n]!=null?R[n]:typeof(R==null?void 0:R.readable)!="boolean"?null:v(R)?!1:d(R)&&R.readable&&!T(R)}function W(R){return R&&R[e]!=null?R[e]:typeof(R==null?void 0:R.writable)!="boolean"?null:v(R)?!1:y(R)&&R.writable&&!C(R)}function A(R,Q){return S(R)?v(R)?!0:!((Q==null?void 0:Q.readable)!==!1&&k(R)||(Q==null?void 0:Q.writable)!==!1&&W(R)):null}function N(R){var Q,he;return S(R)?R.writableErrored?R.writableErrored:(Q=(he=R._writableState)===null||he===void 0?void 0:he.errored)!==null&&Q!==void 0?Q:null:null}function q(R){var Q,he;return S(R)?R.readableErrored?R.readableErrored:(Q=(he=R._readableState)===null||he===void 0?void 0:he.errored)!==null&&Q!==void 0?Q:null:null}function M(R){if(!S(R))return null;if(typeof R.closed=="boolean")return R.closed;let Q=R._writableState,he=R._readableState;return typeof(Q==null?void 0:Q.closed)=="boolean"||typeof(he==null?void 0:he.closed)=="boolean"?(Q==null?void 0:Q.closed)||(he==null?void 0:he.closed):typeof R._closed=="boolean"&&le(R)?R._closed:null}function le(R){return typeof R._closed=="boolean"&&typeof R._defaultKeepAlive=="boolean"&&typeof R._removedConnection=="boolean"&&typeof R._removedContLen=="boolean"}function re(R){return typeof R._sent100=="boolean"&&le(R)}function ee(R){var Q;return typeof R._consuming=="boolean"&&typeof R._dumped=="boolean"&&((Q=R.req)===null||Q===void 0?void 0:Q.upgradeOrConnect)===void 0}function ue(R){if(!S(R))return null;let Q=R._writableState,he=R._readableState,z=Q||he;return!z&&re(R)||!!(z&&z.autoDestroy&&z.emitClose&&z.closed===!1)}function G(R){var Q;return!!(R&&((Q=R[i])!==null&&Q!==void 0?Q:R.readableDidRead||R.readableAborted))}function oe(R){var Q,he,z,Ee,X,D,ae,H,te,ne;return!!(R&&((Q=(he=(z=(Ee=(X=(D=R[r])!==null&&D!==void 0?D:R.readableErrored)!==null&&X!==void 0?X:R.writableErrored)!==null&&Ee!==void 0?Ee:(ae=R._readableState)===null||ae===void 0?void 0:ae.errorEmitted)!==null&&z!==void 0?z:(H=R._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&he!==void 0?he:(te=R._readableState)===null||te===void 0?void 0:te.errored)!==null&&Q!==void 0?Q:!((ne=R._writableState)===null||ne===void 0)&&ne.errored))}l.exports={isDestroyed:v,kIsDestroyed:t,isDisturbed:G,kIsDisturbed:i,isErrored:oe,kIsErrored:r,isReadable:k,kIsReadable:n,kIsClosedPromise:c,kControllerErrorFunction:h,kIsWritable:e,isClosed:M,isDuplexNodeStream:b,isFinished:A,isIterable:E,isReadableNodeStream:d,isReadableStream:w,isReadableEnded:I,isReadableFinished:T,isReadableErrored:q,isNodeStream:S,isWebStream:_,isWritable:W,isWritableNodeStream:y,isWritableStream:x,isWritableEnded:C,isWritableFinished:P,isWritableErrored:N,isServerRequest:ee,isServerResponse:re,willEmitClose:ue,isTransformStream:g}}),Wt=we((o,l)=>{de(),ye(),ge();var a=Jt(),{AbortError:s,codes:u}=wt(),{ERR_INVALID_ARG_TYPE:t,ERR_STREAM_PREMATURE_CLOSE:r}=u,{kEmptyObject:n,once:e}=St(),{validateAbortSignal:i,validateFunction:c,validateObject:h,validateBoolean:d}=br(),{Promise:y,PromisePrototypeThen:b,SymbolDispose:S}=ut(),{isClosed:w,isReadable:x,isReadableNodeStream:g,isReadableStream:_,isReadableFinished:E,isReadableErrored:v,isWritable:C,isWritableNodeStream:P,isWritableStream:I,isWritableFinished:T,isWritableErrored:k,isNodeStream:W,willEmitClose:A,kIsClosedPromise:N}=jt(),q;function M(G){return G.setHeader&&typeof G.abort=="function"}var le=()=>{};function re(G,oe,R){var Q,he;if(arguments.length===2?(R=oe,oe=n):oe==null?oe=n:h(oe,"options"),c(R,"callback"),i(oe.signal,"options.signal"),R=e(R),_(G)||I(G))return ee(G,oe,R);if(!W(G))throw new t("stream",["ReadableStream","WritableStream","Stream"],G);let z=(Q=oe.readable)!==null&&Q!==void 0?Q:g(G),Ee=(he=oe.writable)!==null&&he!==void 0?he:P(G),X=G._writableState,D=G._readableState,ae=()=>{G.writable||ne()},H=A(G)&&g(G)===z&&P(G)===Ee,te=T(G,!1),ne=()=>{te=!0,G.destroyed&&(H=!1),!(H&&(!G.readable||z))&&(!z||be)&&R.call(G)},be=E(G,!1),ce=()=>{be=!0,G.destroyed&&(H=!1),!(H&&(!G.writable||Ee))&&(!Ee||te)&&R.call(G)},L=Z=>{R.call(G,Z)},Y=w(G),se=()=>{Y=!0;let Z=k(G)||v(G);if(Z&&typeof Z!="boolean")return R.call(G,Z);if(z&&!be&&g(G,!0)&&!E(G,!1))return R.call(G,new r);if(Ee&&!te&&!T(G,!1))return R.call(G,new r);R.call(G)},me=()=>{Y=!0;let Z=k(G)||v(G);if(Z&&typeof Z!="boolean")return R.call(G,Z);R.call(G)},pe=()=>{G.req.on("finish",ne)};M(G)?(G.on("complete",ne),H||G.on("abort",se),G.req?pe():G.on("request",pe)):Ee&&!X&&(G.on("end",ae),G.on("close",ae)),!H&&typeof G.aborted=="boolean"&&G.on("aborted",se),G.on("end",ce),G.on("finish",ne),oe.error!==!1&&G.on("error",L),G.on("close",se),Y?a.nextTick(se):X!=null&&X.errorEmitted||D!=null&&D.errorEmitted?H||a.nextTick(me):(!z&&(!H||x(G))&&(te||C(G)===!1)||!Ee&&(!H||C(G))&&(be||x(G)===!1)||D&&G.req&&G.aborted)&&a.nextTick(me);let _e=()=>{R=le,G.removeListener("aborted",se),G.removeListener("complete",ne),G.removeListener("abort",se),G.removeListener("request",pe),G.req&&G.req.removeListener("finish",ne),G.removeListener("end",ae),G.removeListener("close",ae),G.removeListener("finish",ne),G.removeListener("end",ce),G.removeListener("error",L),G.removeListener("close",se)};if(oe.signal&&!Y){let Z=()=>{let ve=R;_e(),ve.call(G,new s(void 0,{cause:oe.signal.reason}))};if(oe.signal.aborted)a.nextTick(Z);else{q=q||St().addAbortListener;let ve=q(oe.signal,Z),Ie=R;R=e((...fe)=>{ve[S](),Ie.apply(G,fe)})}}return _e}function ee(G,oe,R){let Q=!1,he=le;if(oe.signal)if(he=()=>{Q=!0,R.call(G,new s(void 0,{cause:oe.signal.reason}))},oe.signal.aborted)a.nextTick(he);else{q=q||St().addAbortListener;let Ee=q(oe.signal,he),X=R;R=e((...D)=>{Ee[S](),X.apply(G,D)})}let z=(...Ee)=>{Q||a.nextTick(()=>R.apply(G,Ee))};return b(G[N].promise,z,z),le}function ue(G,oe){var R;let Q=!1;return oe===null&&(oe=n),(R=oe)!==null&&R!==void 0&&R.cleanup&&(d(oe.cleanup,"cleanup"),Q=oe.cleanup),new y((he,z)=>{let Ee=re(G,oe,X=>{Q&&Ee(),X?z(X):he()})})}l.exports=re,l.exports.finished=ue}),sr=we((o,l)=>{de(),ye(),ge();var a=Jt(),{aggregateTwoErrors:s,codes:{ERR_MULTIPLE_CALLBACK:u},AbortError:t}=wt(),{Symbol:r}=ut(),{kIsDestroyed:n,isDestroyed:e,isFinished:i,isServerRequest:c}=jt(),h=r("kDestroy"),d=r("kConstruct");function y(A,N,q){A&&(A.stack,N&&!N.errored&&(N.errored=A),q&&!q.errored&&(q.errored=A))}function b(A,N){let q=this._readableState,M=this._writableState,le=M||q;return M!=null&&M.destroyed||q!=null&&q.destroyed?(typeof N=="function"&&N(),this):(y(A,M,q),M&&(M.destroyed=!0),q&&(q.destroyed=!0),le.constructed?S(this,A,N):this.once(h,function(re){S(this,s(re,A),N)}),this)}function S(A,N,q){let M=!1;function le(re){if(M)return;M=!0;let ee=A._readableState,ue=A._writableState;y(re,ue,ee),ue&&(ue.closed=!0),ee&&(ee.closed=!0),typeof q=="function"&&q(re),re?a.nextTick(w,A,re):a.nextTick(x,A)}try{A._destroy(N||null,le)}catch(re){le(re)}}function w(A,N){g(A,N),x(A)}function x(A){let N=A._readableState,q=A._writableState;q&&(q.closeEmitted=!0),N&&(N.closeEmitted=!0),(q!=null&&q.emitClose||N!=null&&N.emitClose)&&A.emit("close")}function g(A,N){let q=A._readableState,M=A._writableState;M!=null&&M.errorEmitted||q!=null&&q.errorEmitted||(M&&(M.errorEmitted=!0),q&&(q.errorEmitted=!0),A.emit("error",N))}function _(){let A=this._readableState,N=this._writableState;A&&(A.constructed=!0,A.closed=!1,A.closeEmitted=!1,A.destroyed=!1,A.errored=null,A.errorEmitted=!1,A.reading=!1,A.ended=A.readable===!1,A.endEmitted=A.readable===!1),N&&(N.constructed=!0,N.destroyed=!1,N.closed=!1,N.closeEmitted=!1,N.errored=null,N.errorEmitted=!1,N.finalCalled=!1,N.prefinished=!1,N.ended=N.writable===!1,N.ending=N.writable===!1,N.finished=N.writable===!1)}function E(A,N,q){let M=A._readableState,le=A._writableState;if(le!=null&&le.destroyed||M!=null&&M.destroyed)return this;M!=null&&M.autoDestroy||le!=null&&le.autoDestroy?A.destroy(N):N&&(N.stack,le&&!le.errored&&(le.errored=N),M&&!M.errored&&(M.errored=N),q?a.nextTick(g,A,N):g(A,N))}function v(A,N){if(typeof A._construct!="function")return;let q=A._readableState,M=A._writableState;q&&(q.constructed=!1),M&&(M.constructed=!1),A.once(d,N),!(A.listenerCount(d)>1)&&a.nextTick(C,A)}function C(A){let N=!1;function q(M){if(N){E(A,M??new u);return}N=!0;let le=A._readableState,re=A._writableState,ee=re||le;le&&(le.constructed=!0),re&&(re.constructed=!0),ee.destroyed?A.emit(h,M):M?E(A,M,!0):a.nextTick(P,A)}try{A._construct(M=>{a.nextTick(q,M)})}catch(M){a.nextTick(q,M)}}function P(A){A.emit(d)}function I(A){return(A==null?void 0:A.setHeader)&&typeof A.abort=="function"}function T(A){A.emit("close")}function k(A,N){A.emit("error",N),a.nextTick(T,A)}function W(A,N){!A||e(A)||(!N&&!i(A)&&(N=new t),c(A)?(A.socket=null,A.destroy(N)):I(A)?A.abort():I(A.req)?A.req.abort():typeof A.destroy=="function"?A.destroy(N):typeof A.close=="function"?A.close():N?a.nextTick(k,A,N):a.nextTick(T,A),A.destroyed||(A[n]=!0))}l.exports={construct:v,destroyer:W,destroy:b,undestroy:_,errorOrDestroy:E}}),Ii=we((o,l)=>{de(),ye(),ge();var{ArrayIsArray:a,ObjectSetPrototypeOf:s}=ut(),{EventEmitter:u}=(Qt(),tt(Ft));function t(n){u.call(this,n)}s(t.prototype,u.prototype),s(t,u),t.prototype.pipe=function(n,e){let i=this;function c(x){n.writable&&n.write(x)===!1&&i.pause&&i.pause()}i.on("data",c);function h(){i.readable&&i.resume&&i.resume()}n.on("drain",h),!n._isStdio&&(!e||e.end!==!1)&&(i.on("end",y),i.on("close",b));let d=!1;function y(){d||(d=!0,n.end())}function b(){d||(d=!0,typeof n.destroy=="function"&&n.destroy())}function S(x){w(),u.listenerCount(this,"error")===0&&this.emit("error",x)}r(i,"error",S),r(n,"error",S);function w(){i.removeListener("data",c),n.removeListener("drain",h),i.removeListener("end",y),i.removeListener("close",b),i.removeListener("error",S),n.removeListener("error",S),i.removeListener("end",w),i.removeListener("close",w),n.removeListener("close",w)}return i.on("end",w),i.on("close",w),n.on("close",w),n.emit("pipe",i),n};function r(n,e,i){if(typeof n.prependListener=="function")return n.prependListener(e,i);!n._events||!n._events[e]?n.on(e,i):a(n._events[e])?n._events[e].unshift(i):n._events[e]=[i,n._events[e]]}l.exports={Stream:t,prependListener:r}}),Ir=we((o,l)=>{de(),ye(),ge();var{SymbolDispose:a}=ut(),{AbortError:s,codes:u}=wt(),{isNodeStream:t,isWebStream:r,kControllerErrorFunction:n}=jt(),e=Wt(),{ERR_INVALID_ARG_TYPE:i}=u,c,h=(d,y)=>{if(typeof d!="object"||!("aborted"in d))throw new i(y,"AbortSignal",d)};l.exports.addAbortSignal=function(d,y){if(h(d,"signal"),!t(y)&&!r(y))throw new i("stream",["ReadableStream","WritableStream","Stream"],y);return l.exports.addAbortSignalNoValidate(d,y)},l.exports.addAbortSignalNoValidate=function(d,y){if(typeof d!="object"||!("aborted"in d))return y;let b=t(y)?()=>{y.destroy(new s(void 0,{cause:d.reason}))}:()=>{y[n](new s(void 0,{cause:d.reason}))};if(d.aborted)b();else{c=c||St().addAbortListener;let S=c(d,b);e(y,S[a])}return y}}),Tu=we((o,l)=>{de(),ye(),ge();var{StringPrototypeSlice:a,SymbolIterator:s,TypedArrayPrototypeSet:u,Uint8Array:t}=ut(),{Buffer:r}=(dt(),tt(pt)),{inspect:n}=St();l.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?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(this.length===0)return"";let i=this.head,c=""+i.data;for(;(i=i.next)!==null;)c+=e+i.data;return c}concat(e){if(this.length===0)return r.alloc(0);let i=r.allocUnsafe(e>>>0),c=this.head,h=0;for(;c;)u(i,c.data,h),h+=c.data.length,c=c.next;return i}consume(e,i){let c=this.head.data;if(e<c.length){let h=c.slice(0,e);return this.head.data=c.slice(e),h}return e===c.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[s](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",c=this.head,h=0;do{let d=c.data;if(e>d.length)i+=d,e-=d.length;else{e===d.length?(i+=d,++h,c.next?this.head=c.next:this.head=this.tail=null):(i+=a(d,0,e),this.head=c,c.data=a(d,e));break}++h}while((c=c.next)!==null);return this.length-=h,i}_getBuffer(e){let i=r.allocUnsafe(e),c=e,h=this.head,d=0;do{let y=h.data;if(e>y.length)u(i,y,c-e),e-=y.length;else{e===y.length?(u(i,y,c-e),++d,h.next?this.head=h.next:this.head=this.tail=null):(u(i,new t(y.buffer,y.byteOffset,e),c-e),this.head=h,h.data=y.slice(e));break}++d}while((h=h.next)!==null);return this.length-=d,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return n(this,{...i,depth:0,customInspect:!1})}}}),kr=we((o,l)=>{de(),ye(),ge();var{MathFloor:a,NumberIsInteger:s}=ut(),{validateInteger:u}=br(),{ERR_INVALID_ARG_VALUE:t}=wt().codes,r=16*1024,n=16;function e(d,y,b){return d.highWaterMark!=null?d.highWaterMark:y?d[b]:null}function i(d){return d?n:r}function c(d,y){u(y,"value",0),d?n=y:r=y}function h(d,y,b,S){let w=e(y,S,b);if(w!=null){if(!s(w)||w<0){let x=S?`options.${b}`:"options.highWaterMark";throw new t(x,w)}return a(w)}return i(d.objectMode)}l.exports={getHighWaterMark:h,getDefaultHighWaterMark:i,setDefaultHighWaterMark:c}}),Pu=we((o,l)=>{de(),ye(),ge();var a=(dt(),tt(pt)),s=a.Buffer;function u(r,n){for(var e in r)n[e]=r[e]}s.from&&s.alloc&&s.allocUnsafe&&s.allocUnsafeSlow?l.exports=a:(u(a,o),o.Buffer=t);function t(r,n,e){return s(r,n,e)}t.prototype=Object.create(s.prototype),u(s,t),t.from=function(r,n,e){if(typeof r=="number")throw new TypeError("Argument must not be a number");return s(r,n,e)},t.alloc=function(r,n,e){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=s(r);return n!==void 0?typeof e=="string"?i.fill(n,e):i.fill(n):i.fill(0),i},t.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return s(r)},t.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return a.SlowBuffer(r)}}),Cu=we(o=>{de(),ye(),ge();var l=Pu().Buffer,a=l.isEncoding||function(g){switch(g=""+g,g&&g.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 s(g){if(!g)return"utf8";for(var _;;)switch(g){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 g;default:if(_)return;g=(""+g).toLowerCase(),_=!0}}function u(g){var _=s(g);if(typeof _!="string"&&(l.isEncoding===a||!a(g)))throw new Error("Unknown encoding: "+g);return _||g}o.StringDecoder=t;function t(g){this.encoding=u(g);var _;switch(this.encoding){case"utf16le":this.text=d,this.end=y,_=4;break;case"utf8":this.fillLast=i,_=4;break;case"base64":this.text=b,this.end=S,_=3;break;default:this.write=w,this.end=x;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=l.allocUnsafe(_)}t.prototype.write=function(g){if(g.length===0)return"";var _,E;if(this.lastNeed){if(_=this.fillLast(g),_===void 0)return"";E=this.lastNeed,this.lastNeed=0}else E=0;return E<g.length?_?_+this.text(g,E):this.text(g,E):_||""},t.prototype.end=h,t.prototype.text=c,t.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length};function r(g){return g<=127?0:g>>5===6?2:g>>4===14?3:g>>3===30?4:g>>6===2?-1:-2}function n(g,_,E){var v=_.length-1;if(v<E)return 0;var C=r(_[v]);return C>=0?(C>0&&(g.lastNeed=C-1),C):--v<E||C===-2?0:(C=r(_[v]),C>=0?(C>0&&(g.lastNeed=C-2),C):--v<E||C===-2?0:(C=r(_[v]),C>=0?(C>0&&(C===2?C=0:g.lastNeed=C-3),C):0))}function e(g,_,E){if((_[0]&192)!==128)return g.lastNeed=0,"�";if(g.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return g.lastNeed=1,"�";if(g.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return g.lastNeed=2,"�"}}function i(g){var _=this.lastTotal-this.lastNeed,E=e(this,g);if(E!==void 0)return E;if(this.lastNeed<=g.length)return g.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,_,0,g.length),this.lastNeed-=g.length}function c(g,_){var E=n(this,g,_);if(!this.lastNeed)return g.toString("utf8",_);this.lastTotal=E;var v=g.length-(E-this.lastNeed);return g.copy(this.lastChar,0,v),g.toString("utf8",_,v)}function h(g){var _=g&&g.length?this.write(g):"";return this.lastNeed?_+"�":_}function d(g,_){if((g.length-_)%2===0){var E=g.toString("utf16le",_);if(E){var v=E.charCodeAt(E.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",_,g.length-1)}function y(g){var _=g&&g.length?this.write(g):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,E)}return _}function b(g,_){var E=(g.length-_)%3;return E===0?g.toString("base64",_):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",_,g.length-E))}function S(g){var _=g&&g.length?this.write(g):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function w(g){return g.toString(this.encoding)}function x(g){return g&&g.length?this.write(g):""}}),ds=we((o,l)=>{de(),ye(),ge();var a=Jt(),{PromisePrototypeThen:s,SymbolAsyncIterator:u,SymbolIterator:t}=ut(),{Buffer:r}=(dt(),tt(pt)),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_NULL_VALUES:e}=wt().codes;function i(c,h,d){let y;if(typeof h=="string"||h instanceof r)return new c({objectMode:!0,...d,read(){this.push(h),this.push(null)}});let b;if(h&&h[u])b=!0,y=h[u]();else if(h&&h[t])b=!1,y=h[t]();else throw new n("iterable",["Iterable"],h);let S=new c({objectMode:!0,highWaterMark:1,...d}),w=!1;S._read=function(){w||(w=!0,g())},S._destroy=function(_,E){s(x(_),()=>a.nextTick(E,_),v=>a.nextTick(E,v||_))};async function x(_){let E=_!=null,v=typeof y.throw=="function";if(E&&v){let{value:C,done:P}=await y.throw(_);if(await C,P)return}if(typeof y.return=="function"){let{value:C}=await y.return();await C}}async function g(){for(;;){try{let{value:_,done:E}=b?await y.next():y.next();if(E)S.push(null);else{let v=_&&typeof _.then=="function"?await _:_;if(v===null)throw w=!1,new e;if(S.push(v))continue;w=!1}}catch(_){S.destroy(_)}break}}return S}l.exports=i}),Or=we((o,l)=>{de(),ye(),ge();var a=Jt(),{ArrayPrototypeIndexOf:s,NumberIsInteger:u,NumberIsNaN:t,NumberParseInt:r,ObjectDefineProperties:n,ObjectKeys:e,ObjectSetPrototypeOf:i,Promise:c,SafeSet:h,SymbolAsyncDispose:d,SymbolAsyncIterator:y,Symbol:b}=ut();l.exports=fe,fe.ReadableState=Ie;var{EventEmitter:S}=(Qt(),tt(Ft)),{Stream:w,prependListener:x}=Ii(),{Buffer:g}=(dt(),tt(pt)),{addAbortSignal:_}=Ir(),E=Wt(),v=St().debuglog("stream",j=>{v=j}),C=Tu(),P=sr(),{getHighWaterMark:I,getDefaultHighWaterMark:T}=kr(),{aggregateTwoErrors:k,codes:{ERR_INVALID_ARG_TYPE:W,ERR_METHOD_NOT_IMPLEMENTED:A,ERR_OUT_OF_RANGE:N,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:M},AbortError:le}=wt(),{validateObject:re}=br(),ee=b("kPaused"),{StringDecoder:ue}=Cu(),G=ds();i(fe.prototype,w.prototype),i(fe,w);var oe=()=>{},{errorOrDestroy:R}=P,Q=1,he=2,z=4,Ee=8,X=16,D=32,ae=64,H=128,te=256,ne=512,be=1024,ce=2048,L=4096,Y=8192,se=16384,me=32768,pe=65536,_e=1<<17,Z=1<<18;function ve(j){return{enumerable:!1,get(){return(this.state&j)!==0},set(U){U?this.state|=j:this.state&=~j}}}n(Ie.prototype,{objectMode:ve(Q),ended:ve(he),endEmitted:ve(z),reading:ve(Ee),constructed:ve(X),sync:ve(D),needReadable:ve(ae),emittedReadable:ve(H),readableListening:ve(te),resumeScheduled:ve(ne),errorEmitted:ve(be),emitClose:ve(ce),autoDestroy:ve(L),destroyed:ve(Y),closed:ve(se),closeEmitted:ve(me),multiAwaitDrain:ve(pe),readingMore:ve(_e),dataEmitted:ve(Z)});function Ie(j,U,Ae){typeof Ae!="boolean"&&(Ae=U instanceof Rt()),this.state=ce|L|X|D,j&&j.objectMode&&(this.state|=Q),Ae&&j&&j.readableObjectMode&&(this.state|=Q),this.highWaterMark=j?I(this,j,"readableHighWaterMark",Ae):T(!1),this.buffer=new C,this.length=0,this.pipes=[],this.flowing=null,this[ee]=null,j&&j.emitClose===!1&&(this.state&=~ce),j&&j.autoDestroy===!1&&(this.state&=~L),this.errored=null,this.defaultEncoding=j&&j.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,j&&j.encoding&&(this.decoder=new ue(j.encoding),this.encoding=j.encoding)}function fe(j){if(!(this instanceof fe))return new fe(j);let U=this instanceof Rt();this._readableState=new Ie(j,this,U),j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.construct=="function"&&(this._construct=j.construct),j.signal&&!U&&_(j.signal,this)),w.call(this,j),P.construct(this,()=>{this._readableState.needReadable&&$(this,this._readableState)})}fe.prototype.destroy=P.destroy,fe.prototype._undestroy=P.undestroy,fe.prototype._destroy=function(j,U){U(j)},fe.prototype[S.captureRejectionSymbol]=function(j){this.destroy(j)},fe.prototype[d]=function(){let j;return this.destroyed||(j=this.readableEnded?null:new le,this.destroy(j)),new c((U,Ae)=>E(this,Ce=>Ce&&Ce!==j?Ae(Ce):U(null)))},fe.prototype.push=function(j,U){return De(this,j,U,!1)},fe.prototype.unshift=function(j,U){return De(this,j,U,!0)};function De(j,U,Ae,Ce){v("readableAddChunk",U);let Be=j._readableState,ft;if(!(Be.state&Q)&&(typeof U=="string"?(Ae=Ae||Be.defaultEncoding,Be.encoding!==Ae&&(Ce&&Be.encoding?U=g.from(U,Ae).toString(Be.encoding):(U=g.from(U,Ae),Ae=""))):U instanceof g?Ae="":w._isUint8Array(U)?(U=w._uint8ArrayToBuffer(U),Ae=""):U!=null&&(ft=new W("chunk",["string","Buffer","Uint8Array"],U))),ft)R(j,ft);else if(U===null)Be.state&=~Ee,B(j,Be);else if(Be.state&Q||U&&U.length>0)if(Ce)if(Be.state&z)R(j,new M);else{if(Be.destroyed||Be.errored)return!1;f(j,Be,U,!0)}else if(Be.ended)R(j,new q);else{if(Be.destroyed||Be.errored)return!1;Be.state&=~Ee,Be.decoder&&!Ae?(U=Be.decoder.write(U),Be.objectMode||U.length!==0?f(j,Be,U,!1):$(j,Be)):f(j,Be,U,!1)}else Ce||(Be.state&=~Ee,$(j,Be));return!Be.ended&&(Be.length<Be.highWaterMark||Be.length===0)}function f(j,U,Ae,Ce){U.flowing&&U.length===0&&!U.sync&&j.listenerCount("data")>0?(U.state&pe?U.awaitDrainWriters.clear():U.awaitDrainWriters=null,U.dataEmitted=!0,j.emit("data",Ae)):(U.length+=U.objectMode?1:Ae.length,Ce?U.buffer.unshift(Ae):U.buffer.push(Ae),U.state&ae&&V(j)),$(j,U)}fe.prototype.isPaused=function(){let j=this._readableState;return j[ee]===!0||j.flowing===!1},fe.prototype.setEncoding=function(j){let U=new ue(j);this._readableState.decoder=U,this._readableState.encoding=this._readableState.decoder.encoding;let Ae=this._readableState.buffer,Ce="";for(let Be of Ae)Ce+=U.write(Be);return Ae.clear(),Ce!==""&&Ae.push(Ce),this._readableState.length=Ce.length,this};var p=1073741824;function m(j){if(j>p)throw new N("size","<= 1GiB",j);return j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++,j}function O(j,U){return j<=0||U.length===0&&U.ended?0:U.state&Q?1:t(j)?U.flowing&&U.length?U.buffer.first().length:U.length:j<=U.length?j:U.ended?U.length:0}fe.prototype.read=function(j){v("read",j),j===void 0?j=NaN:u(j)||(j=r(j,10));let U=this._readableState,Ae=j;if(j>U.highWaterMark&&(U.highWaterMark=m(j)),j!==0&&(U.state&=~H),j===0&&U.needReadable&&((U.highWaterMark!==0?U.length>=U.highWaterMark:U.length>0)||U.ended))return v("read: emitReadable",U.length,U.ended),U.length===0&&U.ended?Ye(this):V(this),null;if(j=O(j,U),j===0&&U.ended)return U.length===0&&Ye(this),null;let Ce=(U.state&ae)!==0;if(v("need readable",Ce),(U.length===0||U.length-j<U.highWaterMark)&&(Ce=!0,v("length less than watermark",Ce)),U.ended||U.reading||U.destroyed||U.errored||!U.constructed)Ce=!1,v("reading, ended or constructing",Ce);else if(Ce){v("do read"),U.state|=Ee|D,U.length===0&&(U.state|=ae);try{this._read(U.highWaterMark)}catch(ft){R(this,ft)}U.state&=~D,U.reading||(j=O(Ae,U))}let Be;return j>0?Be=Ue(j,U):Be=null,Be===null?(U.needReadable=U.length<=U.highWaterMark,j=0):(U.length-=j,U.multiAwaitDrain?U.awaitDrainWriters.clear():U.awaitDrainWriters=null),U.length===0&&(U.ended||(U.needReadable=!0),Ae!==j&&U.ended&&Ye(this)),Be!==null&&!U.errorEmitted&&!U.closeEmitted&&(U.dataEmitted=!0,this.emit("data",Be)),Be};function B(j,U){if(v("onEofChunk"),!U.ended){if(U.decoder){let Ae=U.decoder.end();Ae&&Ae.length&&(U.buffer.push(Ae),U.length+=U.objectMode?1:Ae.length)}U.ended=!0,U.sync?V(j):(U.needReadable=!1,U.emittedReadable=!0,ie(j))}}function V(j){let U=j._readableState;v("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,U.emittedReadable||(v("emitReadable",U.flowing),U.emittedReadable=!0,a.nextTick(ie,j))}function ie(j){let U=j._readableState;v("emitReadable_",U.destroyed,U.length,U.ended),!U.destroyed&&!U.errored&&(U.length||U.ended)&&(j.emit("readable"),U.emittedReadable=!1),U.needReadable=!U.flowing&&!U.ended&&U.length<=U.highWaterMark,rt(j)}function $(j,U){!U.readingMore&&U.constructed&&(U.readingMore=!0,a.nextTick(J,j,U))}function J(j,U){for(;!U.reading&&!U.ended&&(U.length<U.highWaterMark||U.flowing&&U.length===0);){let Ae=U.length;if(v("maybeReadMore read 0"),j.read(0),Ae===U.length)break}U.readingMore=!1}fe.prototype._read=function(j){throw new A("_read()")},fe.prototype.pipe=function(j,U){let Ae=this,Ce=this._readableState;Ce.pipes.length===1&&(Ce.multiAwaitDrain||(Ce.multiAwaitDrain=!0,Ce.awaitDrainWriters=new h(Ce.awaitDrainWriters?[Ce.awaitDrainWriters]:[]))),Ce.pipes.push(j),v("pipe count=%d opts=%j",Ce.pipes.length,U);let Be=(!U||U.end!==!1)&&j!==a.stdout&&j!==a.stderr?yt:ze;Ce.endEmitted?a.nextTick(Be):Ae.once("end",Be),j.on("unpipe",ft);function ft(it,et){v("onunpipe"),it===Ae&&et&&et.hasUnpiped===!1&&(et.hasUnpiped=!0,xe())}function yt(){v("onend"),j.end()}let At,K=!1;function xe(){v("cleanup"),j.removeListener("close",Ge),j.removeListener("finish",Ve),At&&j.removeListener("drain",At),j.removeListener("error",He),j.removeListener("unpipe",ft),Ae.removeListener("end",yt),Ae.removeListener("end",ze),Ae.removeListener("data",We),K=!0,At&&Ce.awaitDrainWriters&&(!j._writableState||j._writableState.needDrain)&&At()}function je(){K||(Ce.pipes.length===1&&Ce.pipes[0]===j?(v("false write response, pause",0),Ce.awaitDrainWriters=j,Ce.multiAwaitDrain=!1):Ce.pipes.length>1&&Ce.pipes.includes(j)&&(v("false write response, pause",Ce.awaitDrainWriters.size),Ce.awaitDrainWriters.add(j)),Ae.pause()),At||(At=Te(Ae,j),j.on("drain",At))}Ae.on("data",We);function We(it){v("ondata");let et=j.write(it);v("dest.write",et),et===!1&&je()}function He(it){if(v("onerror",it),ze(),j.removeListener("error",He),j.listenerCount("error")===0){let et=j._writableState||j._readableState;et&&!et.errorEmitted?R(j,it):j.emit("error",it)}}x(j,"error",He);function Ge(){j.removeListener("finish",Ve),ze()}j.once("close",Ge);function Ve(){v("onfinish"),j.removeListener("close",Ge),ze()}j.once("finish",Ve);function ze(){v("unpipe"),Ae.unpipe(j)}return j.emit("pipe",Ae),j.writableNeedDrain===!0?je():Ce.flowing||(v("pipe resume"),Ae.resume()),j};function Te(j,U){return function(){let Ae=j._readableState;Ae.awaitDrainWriters===U?(v("pipeOnDrain",1),Ae.awaitDrainWriters=null):Ae.multiAwaitDrain&&(v("pipeOnDrain",Ae.awaitDrainWriters.size),Ae.awaitDrainWriters.delete(U)),(!Ae.awaitDrainWriters||Ae.awaitDrainWriters.size===0)&&j.listenerCount("data")&&j.resume()}}fe.prototype.unpipe=function(j){let U=this._readableState,Ae={hasUnpiped:!1};if(U.pipes.length===0)return this;if(!j){let Be=U.pipes;U.pipes=[],this.pause();for(let ft=0;ft<Be.length;ft++)Be[ft].emit("unpipe",this,{hasUnpiped:!1});return this}let Ce=s(U.pipes,j);return Ce===-1?this:(U.pipes.splice(Ce,1),U.pipes.length===0&&this.pause(),j.emit("unpipe",this,Ae),this)},fe.prototype.on=function(j,U){let Ae=w.prototype.on.call(this,j,U),Ce=this._readableState;return j==="data"?(Ce.readableListening=this.listenerCount("readable")>0,Ce.flowing!==!1&&this.resume()):j==="readable"&&!Ce.endEmitted&&!Ce.readableListening&&(Ce.readableListening=Ce.needReadable=!0,Ce.flowing=!1,Ce.emittedReadable=!1,v("on readable",Ce.length,Ce.reading),Ce.length?V(this):Ce.reading||a.nextTick(Ne,this)),Ae},fe.prototype.addListener=fe.prototype.on,fe.prototype.removeListener=function(j,U){let Ae=w.prototype.removeListener.call(this,j,U);return j==="readable"&&a.nextTick(Re,this),Ae},fe.prototype.off=fe.prototype.removeListener,fe.prototype.removeAllListeners=function(j){let U=w.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&a.nextTick(Re,this),U};function Re(j){let U=j._readableState;U.readableListening=j.listenerCount("readable")>0,U.resumeScheduled&&U[ee]===!1?U.flowing=!0:j.listenerCount("data")>0?j.resume():U.readableListening||(U.flowing=null)}function Ne(j){v("readable nexttick read 0"),j.read(0)}fe.prototype.resume=function(){let j=this._readableState;return j.flowing||(v("resume"),j.flowing=!j.readableListening,Fe(this,j)),j[ee]=!1,this};function Fe(j,U){U.resumeScheduled||(U.resumeScheduled=!0,a.nextTick(nt,j,U))}function nt(j,U){v("resume",U.reading),U.reading||j.read(0),U.resumeScheduled=!1,j.emit("resume"),rt(j),U.flowing&&!U.reading&&j.read(0)}fe.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ee]=!0,this};function rt(j){let U=j._readableState;for(v("flow",U.flowing);U.flowing&&j.read()!==null;);}fe.prototype.wrap=function(j){let U=!1;j.on("data",Ce=>{!this.push(Ce)&&j.pause&&(U=!0,j.pause())}),j.on("end",()=>{this.push(null)}),j.on("error",Ce=>{R(this,Ce)}),j.on("close",()=>{this.destroy()}),j.on("destroy",()=>{this.destroy()}),this._read=()=>{U&&j.resume&&(U=!1,j.resume())};let Ae=e(j);for(let Ce=1;Ce<Ae.length;Ce++){let Be=Ae[Ce];this[Be]===void 0&&typeof j[Be]=="function"&&(this[Be]=j[Be].bind(j))}return this},fe.prototype[y]=function(){return Ke(this)},fe.prototype.iterator=function(j){return j!==void 0&&re(j,"options"),Ke(this,j)};function Ke(j,U){typeof j.read!="function"&&(j=fe.wrap(j,{objectMode:!0}));let Ae=Xe(j,U);return Ae.stream=j,Ae}async function*Xe(j,U){let Ae=oe;function Ce(yt){this===j?(Ae(),Ae=oe):Ae=yt}j.on("readable",Ce);let Be,ft=E(j,{writable:!1},yt=>{Be=yt?k(Be,yt):null,Ae(),Ae=oe});try{for(;;){let yt=j.destroyed?null:j.read();if(yt!==null)yield yt;else{if(Be)throw Be;if(Be===null)return;await new c(Ce)}}}catch(yt){throw Be=k(Be,yt),Be}finally{(Be||(U==null?void 0:U.destroyOnReturn)!==!1)&&(Be===void 0||j._readableState.autoDestroy)?P.destroyer(j,null):(j.off("readable",Ce),ft())}}n(fe.prototype,{readable:{__proto__:null,get(){let j=this._readableState;return!!j&&j.readable!==!1&&!j.destroyed&&!j.errorEmitted&&!j.endEmitted},set(j){this._readableState&&(this._readableState.readable=!!j)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(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(j){this._readableState&&(this._readableState.flowing=j)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},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:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(j){this._readableState&&(this._readableState.destroyed=j)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),n(Ie.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ee]!==!1},set(j){this[ee]=!!j}}}),fe._fromList=Ue;function Ue(j,U){if(U.length===0)return null;let Ae;return U.objectMode?Ae=U.buffer.shift():!j||j>=U.length?(U.decoder?Ae=U.buffer.join(""):U.buffer.length===1?Ae=U.buffer.first():Ae=U.buffer.concat(U.length),U.buffer.clear()):Ae=U.buffer.consume(j,U.decoder),Ae}function Ye(j){let U=j._readableState;v("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,a.nextTick(Ze,U,j))}function Ze(j,U){if(v("endReadableNT",j.endEmitted,j.length),!j.errored&&!j.closeEmitted&&!j.endEmitted&&j.length===0){if(j.endEmitted=!0,U.emit("end"),U.writable&&U.allowHalfOpen===!1)a.nextTick(lt,U);else if(j.autoDestroy){let Ae=U._writableState;(!Ae||Ae.autoDestroy&&(Ae.finished||Ae.writable===!1))&&U.destroy()}}}function lt(j){j.writable&&!j.writableEnded&&!j.destroyed&&j.end()}fe.from=function(j,U){return G(fe,j,U)};var ct;function Et(){return ct===void 0&&(ct={}),ct}fe.fromWeb=function(j,U){return Et().newStreamReadableFromReadableStream(j,U)},fe.toWeb=function(j,U){return Et().newReadableStreamFromStreamReadable(j,U)},fe.wrap=function(j,U){var Ae,Ce;return new fe({objectMode:(Ae=(Ce=j.readableObjectMode)!==null&&Ce!==void 0?Ce:j.objectMode)!==null&&Ae!==void 0?Ae:!0,...U,destroy(Be,ft){P.destroyer(j,Be),ft(Be)}}).wrap(j)}}),ki=we((o,l)=>{de(),ye(),ge();var a=Jt(),{ArrayPrototypeSlice:s,Error:u,FunctionPrototypeSymbolHasInstance:t,ObjectDefineProperty:r,ObjectDefineProperties:n,ObjectSetPrototypeOf:e,StringPrototypeToLowerCase:i,Symbol:c,SymbolHasInstance:h}=ut();l.exports=re,re.WritableState=M;var{EventEmitter:d}=(Qt(),tt(Ft)),y=Ii().Stream,{Buffer:b}=(dt(),tt(pt)),S=sr(),{addAbortSignal:w}=Ir(),{getHighWaterMark:x,getDefaultHighWaterMark:g}=kr(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:P,ERR_STREAM_ALREADY_FINISHED:I,ERR_STREAM_NULL_VALUES:T,ERR_STREAM_WRITE_AFTER_END:k,ERR_UNKNOWN_ENCODING:W}=wt().codes,{errorOrDestroy:A}=S;e(re.prototype,y.prototype),e(re,y);function N(){}var q=c("kOnFinished");function M(L,Y,se){typeof se!="boolean"&&(se=Y instanceof Rt()),this.objectMode=!!(L&&L.objectMode),se&&(this.objectMode=this.objectMode||!!(L&&L.writableObjectMode)),this.highWaterMark=L?x(this,L,"writableHighWaterMark",se):g(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let me=!!(L&&L.decodeStrings===!1);this.decodeStrings=!me,this.defaultEncoding=L&&L.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=R.bind(void 0,Y),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,le(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!L||L.emitClose!==!1,this.autoDestroy=!L||L.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[q]=[]}function le(L){L.buffered=[],L.bufferedIndex=0,L.allBuffers=!0,L.allNoop=!0}M.prototype.getBuffer=function(){return s(this.buffered,this.bufferedIndex)},r(M.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function re(L){let Y=this instanceof Rt();if(!Y&&!t(re,this))return new re(L);this._writableState=new M(L,this,Y),L&&(typeof L.write=="function"&&(this._write=L.write),typeof L.writev=="function"&&(this._writev=L.writev),typeof L.destroy=="function"&&(this._destroy=L.destroy),typeof L.final=="function"&&(this._final=L.final),typeof L.construct=="function"&&(this._construct=L.construct),L.signal&&w(L.signal,this)),y.call(this,L),S.construct(this,()=>{let se=this._writableState;se.writing||Ee(this,se),H(this,se)})}r(re,h,{__proto__:null,value:function(L){return t(this,L)?!0:this!==re?!1:L&&L._writableState instanceof M}}),re.prototype.pipe=function(){A(this,new C)};function ee(L,Y,se,me){let pe=L._writableState;if(typeof se=="function")me=se,se=pe.defaultEncoding;else{if(!se)se=pe.defaultEncoding;else if(se!=="buffer"&&!b.isEncoding(se))throw new W(se);typeof me!="function"&&(me=N)}if(Y===null)throw new T;if(!pe.objectMode)if(typeof Y=="string")pe.decodeStrings!==!1&&(Y=b.from(Y,se),se="buffer");else if(Y instanceof b)se="buffer";else if(y._isUint8Array(Y))Y=y._uint8ArrayToBuffer(Y),se="buffer";else throw new _("chunk",["string","Buffer","Uint8Array"],Y);let _e;return pe.ending?_e=new k:pe.destroyed&&(_e=new P("write")),_e?(a.nextTick(me,_e),A(L,_e,!0),_e):(pe.pendingcb++,ue(L,pe,Y,se,me))}re.prototype.write=function(L,Y,se){return ee(this,L,Y,se)===!0},re.prototype.cork=function(){this._writableState.corked++},re.prototype.uncork=function(){let L=this._writableState;L.corked&&(L.corked--,L.writing||Ee(this,L))},re.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=i(L)),!b.isEncoding(L))throw new W(L);return this._writableState.defaultEncoding=L,this};function ue(L,Y,se,me,pe){let _e=Y.objectMode?1:se.length;Y.length+=_e;let Z=Y.length<Y.highWaterMark;return Z||(Y.needDrain=!0),Y.writing||Y.corked||Y.errored||!Y.constructed?(Y.buffered.push({chunk:se,encoding:me,callback:pe}),Y.allBuffers&&me!=="buffer"&&(Y.allBuffers=!1),Y.allNoop&&pe!==N&&(Y.allNoop=!1)):(Y.writelen=_e,Y.writecb=pe,Y.writing=!0,Y.sync=!0,L._write(se,me,Y.onwrite),Y.sync=!1),Z&&!Y.errored&&!Y.destroyed}function G(L,Y,se,me,pe,_e,Z){Y.writelen=me,Y.writecb=Z,Y.writing=!0,Y.sync=!0,Y.destroyed?Y.onwrite(new P("write")):se?L._writev(pe,Y.onwrite):L._write(pe,_e,Y.onwrite),Y.sync=!1}function oe(L,Y,se,me){--Y.pendingcb,me(se),z(Y),A(L,se)}function R(L,Y){let se=L._writableState,me=se.sync,pe=se.writecb;if(typeof pe!="function"){A(L,new v);return}se.writing=!1,se.writecb=null,se.length-=se.writelen,se.writelen=0,Y?(Y.stack,se.errored||(se.errored=Y),L._readableState&&!L._readableState.errored&&(L._readableState.errored=Y),me?a.nextTick(oe,L,se,Y,pe):oe(L,se,Y,pe)):(se.buffered.length>se.bufferedIndex&&Ee(L,se),me?se.afterWriteTickInfo!==null&&se.afterWriteTickInfo.cb===pe?se.afterWriteTickInfo.count++:(se.afterWriteTickInfo={count:1,cb:pe,stream:L,state:se},a.nextTick(Q,se.afterWriteTickInfo)):he(L,se,1,pe))}function Q({stream:L,state:Y,count:se,cb:me}){return Y.afterWriteTickInfo=null,he(L,Y,se,me)}function he(L,Y,se,me){for(!Y.ending&&!L.destroyed&&Y.length===0&&Y.needDrain&&(Y.needDrain=!1,L.emit("drain"));se-- >0;)Y.pendingcb--,me();Y.destroyed&&z(Y),H(L,Y)}function z(L){if(L.writing)return;for(let pe=L.bufferedIndex;pe<L.buffered.length;++pe){var Y;let{chunk:_e,callback:Z}=L.buffered[pe],ve=L.objectMode?1:_e.length;L.length-=ve,Z((Y=L.errored)!==null&&Y!==void 0?Y:new P("write"))}let se=L[q].splice(0);for(let pe=0;pe<se.length;pe++){var me;se[pe]((me=L.errored)!==null&&me!==void 0?me:new P("end"))}le(L)}function Ee(L,Y){if(Y.corked||Y.bufferProcessing||Y.destroyed||!Y.constructed)return;let{buffered:se,bufferedIndex:me,objectMode:pe}=Y,_e=se.length-me;if(!_e)return;let Z=me;if(Y.bufferProcessing=!0,_e>1&&L._writev){Y.pendingcb-=_e-1;let ve=Y.allNoop?N:fe=>{for(let De=Z;De<se.length;++De)se[De].callback(fe)},Ie=Y.allNoop&&Z===0?se:s(se,Z);Ie.allBuffers=Y.allBuffers,G(L,Y,!0,Y.length,Ie,"",ve),le(Y)}else{do{let{chunk:ve,encoding:Ie,callback:fe}=se[Z];se[Z++]=null;let De=pe?1:ve.length;G(L,Y,!1,De,ve,Ie,fe)}while(Z<se.length&&!Y.writing);Z===se.length?le(Y):Z>256?(se.splice(0,Z),Y.bufferedIndex=0):Y.bufferedIndex=Z}Y.bufferProcessing=!1}re.prototype._write=function(L,Y,se){if(this._writev)this._writev([{chunk:L,encoding:Y}],se);else throw new E("_write()")},re.prototype._writev=null,re.prototype.end=function(L,Y,se){let me=this._writableState;typeof L=="function"?(se=L,L=null,Y=null):typeof Y=="function"&&(se=Y,Y=null);let pe;if(L!=null){let _e=ee(this,L,Y);_e instanceof u&&(pe=_e)}return me.corked&&(me.corked=1,this.uncork()),pe||(!me.errored&&!me.ending?(me.ending=!0,H(this,me,!0),me.ended=!0):me.finished?pe=new I("end"):me.destroyed&&(pe=new P("end"))),typeof se=="function"&&(pe||me.finished?a.nextTick(se,pe):me[q].push(se)),this};function X(L){return L.ending&&!L.destroyed&&L.constructed&&L.length===0&&!L.errored&&L.buffered.length===0&&!L.finished&&!L.writing&&!L.errorEmitted&&!L.closeEmitted}function D(L,Y){let se=!1;function me(pe){if(se){A(L,pe??v());return}if(se=!0,Y.pendingcb--,pe){let _e=Y[q].splice(0);for(let Z=0;Z<_e.length;Z++)_e[Z](pe);A(L,pe,Y.sync)}else X(Y)&&(Y.prefinished=!0,L.emit("prefinish"),Y.pendingcb++,a.nextTick(te,L,Y))}Y.sync=!0,Y.pendingcb++;try{L._final(me)}catch(pe){me(pe)}Y.sync=!1}function ae(L,Y){!Y.prefinished&&!Y.finalCalled&&(typeof L._final=="function"&&!Y.destroyed?(Y.finalCalled=!0,D(L,Y)):(Y.prefinished=!0,L.emit("prefinish")))}function H(L,Y,se){X(Y)&&(ae(L,Y),Y.pendingcb===0&&(se?(Y.pendingcb++,a.nextTick((me,pe)=>{X(pe)?te(me,pe):pe.pendingcb--},L,Y)):X(Y)&&(Y.pendingcb++,te(L,Y))))}function te(L,Y){Y.pendingcb--,Y.finished=!0;let se=Y[q].splice(0);for(let me=0;me<se.length;me++)se[me]();if(L.emit("finish"),Y.autoDestroy){let me=L._readableState;(!me||me.autoDestroy&&(me.endEmitted||me.readable===!1))&&L.destroy()}}n(re.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(L){this._writableState&&(this._writableState.destroyed=L)}},writable:{__proto__:null,get(){let L=this._writableState;return!!L&&L.writable!==!1&&!L.destroyed&&!L.errored&&!L.ending&&!L.ended},set(L){this._writableState&&(this._writableState.writable=!!L)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let L=this._writableState;return L?!L.destroyed&&!L.ending&&L.needDrain:!1}},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!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var ne=S.destroy;re.prototype.destroy=function(L,Y){let se=this._writableState;return!se.destroyed&&(se.bufferedIndex<se.buffered.length||se[q].length)&&a.nextTick(z,se),ne.call(this,L,Y),this},re.prototype._undestroy=S.undestroy,re.prototype._destroy=function(L,Y){Y(L)},re.prototype[d.captureRejectionSymbol]=function(L){this.destroy(L)};var be;function ce(){return be===void 0&&(be={}),be}re.fromWeb=function(L,Y){return ce().newStreamWritableFromWritableStream(L,Y)},re.toWeb=function(L){return ce().newWritableStreamFromStreamWritable(L)}}),ju=we((o,l)=>{de(),ye(),ge();var a=Jt(),s=(dt(),tt(pt)),{isReadable:u,isWritable:t,isIterable:r,isNodeStream:n,isReadableNodeStream:e,isWritableNodeStream:i,isDuplexNodeStream:c,isReadableStream:h,isWritableStream:d}=jt(),y=Wt(),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:S,ERR_INVALID_RETURN_VALUE:w}}=wt(),{destroyer:x}=sr(),g=Rt(),_=Or(),E=ki(),{createDeferredPromise:v}=St(),C=ds(),P=globalThis.Blob||s.Blob,I=typeof P<"u"?function(q){return q instanceof P}:function(q){return!1},T=globalThis.AbortController||yr().AbortController,{FunctionPrototypeCall:k}=ut(),W=class extends g{constructor(q){super(q),(q==null?void 0:q.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(q==null?void 0:q.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};l.exports=function q(M,le){if(c(M))return M;if(e(M))return N({readable:M});if(i(M))return N({writable:M});if(n(M))return N({writable:!1,readable:!1});if(h(M))return N({readable:_.fromWeb(M)});if(d(M))return N({writable:E.fromWeb(M)});if(typeof M=="function"){let{value:ee,write:ue,final:G,destroy:oe}=A(M);if(r(ee))return C(W,ee,{objectMode:!0,write:ue,final:G,destroy:oe});let R=ee==null?void 0:ee.then;if(typeof R=="function"){let Q,he=k(R,ee,z=>{if(z!=null)throw new w("nully","body",z)},z=>{x(Q,z)});return Q=new W({objectMode:!0,readable:!1,write:ue,final(z){G(async()=>{try{await he,a.nextTick(z,null)}catch(Ee){a.nextTick(z,Ee)}})},destroy:oe})}throw new w("Iterable, AsyncIterable or AsyncFunction",le,ee)}if(I(M))return q(M.arrayBuffer());if(r(M))return C(W,M,{objectMode:!0,writable:!1});if(h(M==null?void 0:M.readable)&&d(M==null?void 0:M.writable))return W.fromWeb(M);if(typeof(M==null?void 0:M.writable)=="object"||typeof(M==null?void 0:M.readable)=="object"){let ee=M!=null&&M.readable?e(M==null?void 0:M.readable)?M==null?void 0:M.readable:q(M.readable):void 0,ue=M!=null&&M.writable?i(M==null?void 0:M.writable)?M==null?void 0:M.writable:q(M.writable):void 0;return N({readable:ee,writable:ue})}let re=M==null?void 0:M.then;if(typeof re=="function"){let ee;return k(re,M,ue=>{ue!=null&&ee.push(ue),ee.push(null)},ue=>{x(ee,ue)}),ee=new W({objectMode:!0,writable:!1,read(){}})}throw new S(le,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],M)};function A(q){let{promise:M,resolve:le}=v(),re=new T,ee=re.signal;return{value:q(async function*(){for(;;){let ue=M;M=null;let{chunk:G,done:oe,cb:R}=await ue;if(a.nextTick(R),oe)return;if(ee.aborted)throw new b(void 0,{cause:ee.reason});({promise:M,resolve:le}=v()),yield G}}(),{signal:ee}),write(ue,G,oe){let R=le;le=null,R({chunk:ue,done:!1,cb:oe})},final(ue){let G=le;le=null,G({done:!0,cb:ue})},destroy(ue,G){re.abort(),G(ue)}}}function N(q){let M=q.readable&&typeof q.readable.read!="function"?_.wrap(q.readable):q.readable,le=q.writable,re=!!u(M),ee=!!t(le),ue,G,oe,R,Q;function he(z){let Ee=R;R=null,Ee?Ee(z):z&&Q.destroy(z)}return Q=new W({readableObjectMode:!!(M!=null&&M.readableObjectMode),writableObjectMode:!!(le!=null&&le.writableObjectMode),readable:re,writable:ee}),ee&&(y(le,z=>{ee=!1,z&&x(M,z),he(z)}),Q._write=function(z,Ee,X){le.write(z,Ee)?X():ue=X},Q._final=function(z){le.end(),G=z},le.on("drain",function(){if(ue){let z=ue;ue=null,z()}}),le.on("finish",function(){if(G){let z=G;G=null,z()}})),re&&(y(M,z=>{re=!1,z&&x(M,z),he(z)}),M.on("readable",function(){if(oe){let z=oe;oe=null,z()}}),M.on("end",function(){Q.push(null)}),Q._read=function(){for(;;){let z=M.read();if(z===null){oe=Q._read;return}if(!Q.push(z))return}}),Q._destroy=function(z,Ee){!z&&R!==null&&(z=new b),oe=null,ue=null,G=null,R===null?Ee(z):(R=Ee,x(le,z),x(M,z))},Q}}),Rt=we((o,l)=>{de(),ye(),ge();var{ObjectDefineProperties:a,ObjectGetOwnPropertyDescriptor:s,ObjectKeys:u,ObjectSetPrototypeOf:t}=ut();l.exports=e;var r=Or(),n=ki();t(e.prototype,r.prototype),t(e,r);{let d=u(n.prototype);for(let y=0;y<d.length;y++){let b=d[y];e.prototype[b]||(e.prototype[b]=n.prototype[b])}}function e(d){if(!(this instanceof e))return new e(d);r.call(this,d),n.call(this,d),d?(this.allowHalfOpen=d.allowHalfOpen!==!1,d.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),d.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}a(e.prototype,{writable:{__proto__:null,...s(n.prototype,"writable")},writableHighWaterMark:{__proto__:null,...s(n.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...s(n.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...s(n.prototype,"writableBuffer")},writableLength:{__proto__:null,...s(n.prototype,"writableLength")},writableFinished:{__proto__:null,...s(n.prototype,"writableFinished")},writableCorked:{__proto__:null,...s(n.prototype,"writableCorked")},writableEnded:{__proto__:null,...s(n.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...s(n.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(d){this._readableState&&this._writableState&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}});var i;function c(){return i===void 0&&(i={}),i}e.fromWeb=function(d,y){return c().newStreamDuplexFromReadableWritablePair(d,y)},e.toWeb=function(d){return c().newReadableWritablePairFromDuplex(d)};var h;e.from=function(d){return h||(h=ju()),h(d,"body")}}),gs=we((o,l)=>{de(),ye(),ge();var{ObjectSetPrototypeOf:a,Symbol:s}=ut();l.exports=e;var{ERR_METHOD_NOT_IMPLEMENTED:u}=wt().codes,t=Rt(),{getHighWaterMark:r}=kr();a(e.prototype,t.prototype),a(e,t);var n=s("kCallback");function e(h){if(!(this instanceof e))return new e(h);let d=h?r(this,h,"readableHighWaterMark",!0):null;d===0&&(h={...h,highWaterMark:null,readableHighWaterMark:d,writableHighWaterMark:h.writableHighWaterMark||0}),t.call(this,h),this._readableState.sync=!1,this[n]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",c)}function i(h){typeof this._flush=="function"&&!this.destroyed?this._flush((d,y)=>{if(d){h?h(d):this.destroy(d);return}y!=null&&this.push(y),this.push(null),h&&h()}):(this.push(null),h&&h())}function c(){this._final!==i&&i.call(this)}e.prototype._final=i,e.prototype._transform=function(h,d,y){throw new u("_transform()")},e.prototype._write=function(h,d,y){let b=this._readableState,S=this._writableState,w=b.length;this._transform(h,d,(x,g)=>{if(x){y(x);return}g!=null&&this.push(g),S.ended||w===b.length||b.length<b.highWaterMark?y():this[n]=y})},e.prototype._read=function(){if(this[n]){let h=this[n];this[n]=null,h()}}}),ys=we((o,l)=>{de(),ye(),ge();var{ObjectSetPrototypeOf:a}=ut();l.exports=u;var s=gs();a(u.prototype,s.prototype),a(u,s);function u(t){if(!(this instanceof u))return new u(t);s.call(this,t)}u.prototype._transform=function(t,r,n){n(null,t)}}),Oi=we((o,l)=>{de(),ye(),ge();var a=Jt(),{ArrayIsArray:s,Promise:u,SymbolAsyncIterator:t,SymbolDispose:r}=ut(),n=Wt(),{once:e}=St(),i=sr(),c=Rt(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:y,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:S,ERR_STREAM_PREMATURE_CLOSE:w},AbortError:x}=wt(),{validateFunction:g,validateAbortSignal:_}=br(),{isIterable:E,isReadable:v,isReadableNodeStream:C,isNodeStream:P,isTransformStream:I,isWebStream:T,isReadableStream:k,isReadableFinished:W}=jt(),A=globalThis.AbortController||yr().AbortController,N,q,M;function le(z,Ee,X){let D=!1;z.on("close",()=>{D=!0});let ae=n(z,{readable:Ee,writable:X},H=>{D=!H});return{destroy:H=>{D||(D=!0,i.destroyer(z,H||new S("pipe")))},cleanup:ae}}function re(z){return g(z[z.length-1],"streams[stream.length - 1]"),z.pop()}function ee(z){if(E(z))return z;if(C(z))return ue(z);throw new d("val",["Readable","Iterable","AsyncIterable"],z)}async function*ue(z){q||(q=Or()),yield*q.prototype[t].call(z)}async function G(z,Ee,X,{end:D}){let ae,H=null,te=ce=>{if(ce&&(ae=ce),H){let L=H;H=null,L()}},ne=()=>new u((ce,L)=>{ae?L(ae):H=()=>{ae?L(ae):ce()}});Ee.on("drain",te);let be=n(Ee,{readable:!1},te);try{Ee.writableNeedDrain&&await ne();for await(let ce of z)Ee.write(ce)||await ne();D&&(Ee.end(),await ne()),X()}catch(ce){X(ae!==ce?h(ae,ce):ce)}finally{be(),Ee.off("drain",te)}}async function oe(z,Ee,X,{end:D}){I(Ee)&&(Ee=Ee.writable);let ae=Ee.getWriter();try{for await(let H of z)await ae.ready,ae.write(H).catch(()=>{});await ae.ready,D&&await ae.close(),X()}catch(H){try{await ae.abort(H),X(H)}catch(te){X(te)}}}function R(...z){return Q(z,e(re(z)))}function Q(z,Ee,X){if(z.length===1&&s(z[0])&&(z=z[0]),z.length<2)throw new b("streams");let D=new A,ae=D.signal,H=X==null?void 0:X.signal,te=[];_(H,"options.signal");function ne(){pe(new x)}M=M||St().addAbortListener;let be;H&&(be=M(H,ne));let ce,L,Y=[],se=0;function me(Ie){pe(Ie,--se===0)}function pe(Ie,fe){var De;if(Ie&&(!ce||ce.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ce=Ie),!(!ce&&!fe)){for(;Y.length;)Y.shift()(ce);(De=be)===null||De===void 0||De[r](),D.abort(),fe&&(ce||te.forEach(f=>f()),a.nextTick(Ee,ce,L))}}let _e;for(let Ie=0;Ie<z.length;Ie++){let fe=z[Ie],De=Ie<z.length-1,f=Ie>0,p=De||(X==null?void 0:X.end)!==!1,m=Ie===z.length-1;if(P(fe)){let O=function(B){B&&B.name!=="AbortError"&&B.code!=="ERR_STREAM_PREMATURE_CLOSE"&&me(B)};if(p){let{destroy:B,cleanup:V}=le(fe,De,f);Y.push(B),v(fe)&&m&&te.push(V)}fe.on("error",O),v(fe)&&m&&te.push(()=>{fe.removeListener("error",O)})}if(Ie===0)if(typeof fe=="function"){if(_e=fe({signal:ae}),!E(_e))throw new y("Iterable, AsyncIterable or Stream","source",_e)}else E(fe)||C(fe)||I(fe)?_e=fe:_e=c.from(fe);else if(typeof fe=="function"){if(I(_e)){var Z;_e=ee((Z=_e)===null||Z===void 0?void 0:Z.readable)}else _e=ee(_e);if(_e=fe(_e,{signal:ae}),De){if(!E(_e,!0))throw new y("AsyncIterable",`transform[${Ie-1}]`,_e)}else{var ve;N||(N=ys());let O=new N({objectMode:!0}),B=(ve=_e)===null||ve===void 0?void 0:ve.then;if(typeof B=="function")se++,B.call(_e,$=>{L=$,$!=null&&O.write($),p&&O.end(),a.nextTick(me)},$=>{O.destroy($),a.nextTick(me,$)});else if(E(_e,!0))se++,G(_e,O,me,{end:p});else if(k(_e)||I(_e)){let $=_e.readable||_e;se++,G($,O,me,{end:p})}else throw new y("AsyncIterable or Promise","destination",_e);_e=O;let{destroy:V,cleanup:ie}=le(_e,!1,!0);Y.push(V),m&&te.push(ie)}}else if(P(fe)){if(C(_e)){se+=2;let O=he(_e,fe,me,{end:p});v(fe)&&m&&te.push(O)}else if(I(_e)||k(_e)){let O=_e.readable||_e;se++,G(O,fe,me,{end:p})}else if(E(_e))se++,G(_e,fe,me,{end:p});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_e);_e=fe}else if(T(fe)){if(C(_e))se++,oe(ee(_e),fe,me,{end:p});else if(k(_e)||E(_e))se++,oe(_e,fe,me,{end:p});else if(I(_e))se++,oe(_e.readable,fe,me,{end:p});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_e);_e=fe}else _e=c.from(fe)}return(ae!=null&&ae.aborted||H!=null&&H.aborted)&&a.nextTick(ne),_e}function he(z,Ee,X,{end:D}){let ae=!1;if(Ee.on("close",()=>{ae||X(new w)}),z.pipe(Ee,{end:!1}),D){let H=function(){ae=!0,Ee.end()};W(z)?a.nextTick(H):z.once("end",H)}else X();return n(z,{readable:!0,writable:!1},H=>{let te=z._readableState;H&&H.code==="ERR_STREAM_PREMATURE_CLOSE"&&te&&te.ended&&!te.errored&&!te.errorEmitted?z.once("end",X).once("error",X):X(H)}),n(Ee,{readable:!1,writable:!0},X)}l.exports={pipelineImpl:Q,pipeline:R}}),ms=we((o,l)=>{de(),ye(),ge();var{pipeline:a}=Oi(),s=Rt(),{destroyer:u}=sr(),{isNodeStream:t,isReadable:r,isWritable:n,isWebStream:e,isTransformStream:i,isWritableStream:c,isReadableStream:h}=jt(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:y,ERR_MISSING_ARGS:b}}=wt(),S=Wt();l.exports=function(...w){if(w.length===0)throw new b("streams");if(w.length===1)return s.from(w[0]);let x=[...w];if(typeof w[0]=="function"&&(w[0]=s.from(w[0])),typeof w[w.length-1]=="function"){let A=w.length-1;w[A]=s.from(w[A])}for(let A=0;A<w.length;++A)if(!(!t(w[A])&&!e(w[A]))){if(A<w.length-1&&!(r(w[A])||h(w[A])||i(w[A])))throw new y(`streams[${A}]`,x[A],"must be readable");if(A>0&&!(n(w[A])||c(w[A])||i(w[A])))throw new y(`streams[${A}]`,x[A],"must be writable")}let g,_,E,v,C;function P(A){let N=v;v=null,N?N(A):A?C.destroy(A):!W&&!k&&C.destroy()}let I=w[0],T=a(w,P),k=!!(n(I)||c(I)||i(I)),W=!!(r(T)||h(T)||i(T));if(C=new s({writableObjectMode:!!(I!=null&&I.writableObjectMode),readableObjectMode:!!(T!=null&&T.readableObjectMode),writable:k,readable:W}),k){if(t(I))C._write=function(N,q,M){I.write(N,q)?M():g=M},C._final=function(N){I.end(),_=N},I.on("drain",function(){if(g){let N=g;g=null,N()}});else if(e(I)){let N=(i(I)?I.writable:I).getWriter();C._write=async function(q,M,le){try{await N.ready,N.write(q).catch(()=>{}),le()}catch(re){le(re)}},C._final=async function(q){try{await N.ready,N.close().catch(()=>{}),_=q}catch(M){q(M)}}}let A=i(T)?T.readable:T;S(A,()=>{if(_){let N=_;_=null,N()}})}if(W){if(t(T))T.on("readable",function(){if(E){let A=E;E=null,A()}}),T.on("end",function(){C.push(null)}),C._read=function(){for(;;){let A=T.read();if(A===null){E=C._read;return}if(!C.push(A))return}};else if(e(T)){let A=(i(T)?T.readable:T).getReader();C._read=async function(){for(;;)try{let{value:N,done:q}=await A.read();if(!C.push(N))return;if(q){C.push(null);return}}catch{return}}}}return C._destroy=function(A,N){!A&&v!==null&&(A=new d),E=null,g=null,_=null,v===null?N(A):(v=N,t(T)&&u(T,A))},C}}),Ru=we((o,l)=>{de(),ye(),ge();var a=globalThis.AbortController||yr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:s,ERR_INVALID_ARG_TYPE:u,ERR_MISSING_ARGS:t,ERR_OUT_OF_RANGE:r},AbortError:n}=wt(),{validateAbortSignal:e,validateInteger:i,validateObject:c}=br(),h=ut().Symbol("kWeak"),d=ut().Symbol("kResistStopPropagation"),{finished:y}=Wt(),b=ms(),{addAbortSignalNoValidate:S}=Ir(),{isWritable:w,isNodeStream:x}=jt(),{deprecate:g}=St(),{ArrayPrototypePush:_,Boolean:E,MathFloor:v,Number:C,NumberIsNaN:P,Promise:I,PromiseReject:T,PromiseResolve:k,PromisePrototypeThen:W,Symbol:A}=ut(),N=A("kEmpty"),q=A("kEof");function M(H,te){if(te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),x(H)&&!w(H))throw new s("stream",H,"must be writable");let ne=b(this,H);return te!=null&&te.signal&&S(te.signal,ne),ne}function le(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal");let ne=1;(te==null?void 0:te.concurrency)!=null&&(ne=v(te.concurrency));let be=ne-1;return(te==null?void 0:te.highWaterMark)!=null&&(be=v(te.highWaterMark)),i(ne,"options.concurrency",1),i(be,"options.highWaterMark",0),be+=ne,(async function*(){let ce=St().AbortSignalAny([te==null?void 0:te.signal].filter(E)),L=this,Y=[],se={signal:ce},me,pe,_e=!1,Z=0;function ve(){_e=!0,Ie()}function Ie(){Z-=1,fe()}function fe(){pe&&!_e&&Z<ne&&Y.length<be&&(pe(),pe=null)}async function De(){try{for await(let f of L){if(_e)return;if(ce.aborted)throw new n;try{if(f=H(f,se),f===N)continue;f=k(f)}catch(p){f=T(p)}Z+=1,W(f,Ie,ve),Y.push(f),me&&(me(),me=null),!_e&&(Y.length>=be||Z>=ne)&&await new I(p=>{pe=p})}Y.push(q)}catch(f){let p=T(f);W(p,Ie,ve),Y.push(p)}finally{_e=!0,me&&(me(),me=null)}}De();try{for(;;){for(;Y.length>0;){let f=await Y[0];if(f===q)return;if(ce.aborted)throw new n;f!==N&&(yield f),Y.shift(),fe()}await new I(f=>{me=f})}}finally{_e=!0,pe&&(pe(),pe=null)}}).call(this)}function re(H=void 0){return H!=null&&c(H,"options"),(H==null?void 0:H.signal)!=null&&e(H.signal,"options.signal"),(async function*(){let te=0;for await(let be of this){var ne;if(H!=null&&(ne=H.signal)!==null&&ne!==void 0&&ne.aborted)throw new n({cause:H.signal.reason});yield[te++,be]}}).call(this)}async function ee(H,te=void 0){for await(let ne of R.call(this,H,te))return!0;return!1}async function ue(H,te=void 0){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);return!await ee.call(this,async(...ne)=>!await H(...ne),te)}async function G(H,te){for await(let ne of R.call(this,H,te))return ne}async function oe(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);async function ne(be,ce){return await H(be,ce),N}for await(let be of le.call(this,ne,te));}function R(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);async function ne(be,ce){return await H(be,ce)?be:N}return le.call(this,ne,te)}var Q=class extends t{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function he(H,te,ne){var be;if(typeof H!="function")throw new u("reducer",["Function","AsyncFunction"],H);ne!=null&&c(ne,"options"),(ne==null?void 0:ne.signal)!=null&&e(ne.signal,"options.signal");let ce=arguments.length>1;if(ne!=null&&(be=ne.signal)!==null&&be!==void 0&&be.aborted){let pe=new n(void 0,{cause:ne.signal.reason});throw this.once("error",()=>{}),await y(this.destroy(pe)),pe}let L=new a,Y=L.signal;if(ne!=null&&ne.signal){let pe={once:!0,[h]:this,[d]:!0};ne.signal.addEventListener("abort",()=>L.abort(),pe)}let se=!1;try{for await(let pe of this){var me;if(se=!0,ne!=null&&(me=ne.signal)!==null&&me!==void 0&&me.aborted)throw new n;ce?te=await H(te,pe,{signal:Y}):(te=pe,ce=!0)}if(!se&&!ce)throw new Q}finally{L.abort()}return te}async function z(H){H!=null&&c(H,"options"),(H==null?void 0:H.signal)!=null&&e(H.signal,"options.signal");let te=[];for await(let be of this){var ne;if(H!=null&&(ne=H.signal)!==null&&ne!==void 0&&ne.aborted)throw new n(void 0,{cause:H.signal.reason});_(te,be)}return te}function Ee(H,te){let ne=le.call(this,H,te);return(async function*(){for await(let be of ne)yield*be}).call(this)}function X(H){if(H=C(H),P(H))return 0;if(H<0)throw new r("number",">= 0",H);return H}function D(H,te=void 0){return te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),H=X(H),(async function*(){var ne;if(te!=null&&(ne=te.signal)!==null&&ne!==void 0&&ne.aborted)throw new n;for await(let ce of this){var be;if(te!=null&&(be=te.signal)!==null&&be!==void 0&&be.aborted)throw new n;H--<=0&&(yield ce)}}).call(this)}function ae(H,te=void 0){return te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),H=X(H),(async function*(){var ne;if(te!=null&&(ne=te.signal)!==null&&ne!==void 0&&ne.aborted)throw new n;for await(let ce of this){var be;if(te!=null&&(be=te.signal)!==null&&be!==void 0&&be.aborted)throw new n;if(H-- >0&&(yield ce),H<=0)return}}).call(this)}l.exports.streamReturningOperators={asIndexedPairs:g(re,"readable.asIndexedPairs will be removed in a future version."),drop:D,filter:R,flatMap:Ee,map:le,take:ae,compose:M},l.exports.promiseReturningOperators={every:ue,forEach:oe,reduce:he,toArray:z,some:ee,find:G}}),bs=we((o,l)=>{de(),ye(),ge();var{ArrayPrototypePop:a,Promise:s}=ut(),{isIterable:u,isNodeStream:t,isWebStream:r}=jt(),{pipelineImpl:n}=Oi(),{finished:e}=Wt();vs();function i(...c){return new s((h,d)=>{let y,b,S=c[c.length-1];if(S&&typeof S=="object"&&!t(S)&&!u(S)&&!r(S)){let w=a(c);y=w.signal,b=w.end}n(c,(w,x)=>{w?d(w):h(x)},{signal:y,end:b})})}l.exports={finished:e,pipeline:i}}),vs=we((o,l)=>{de(),ye(),ge();var{Buffer:a}=(dt(),tt(pt)),{ObjectDefineProperty:s,ObjectKeys:u,ReflectApply:t}=ut(),{promisify:{custom:r}}=St(),{streamReturningOperators:n,promiseReturningOperators:e}=Ru(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:i}}=wt(),c=ms(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:d}=kr(),{pipeline:y}=Oi(),{destroyer:b}=sr(),S=Wt(),w=bs(),x=jt(),g=l.exports=Ii().Stream;g.isDestroyed=x.isDestroyed,g.isDisturbed=x.isDisturbed,g.isErrored=x.isErrored,g.isReadable=x.isReadable,g.isWritable=x.isWritable,g.Readable=Or();for(let E of u(n)){let v=function(...P){if(new.target)throw i();return g.Readable.from(t(C,this,P))},C=n[E];s(v,"name",{__proto__:null,value:C.name}),s(v,"length",{__proto__:null,value:C.length}),s(g.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let E of u(e)){let v=function(...P){if(new.target)throw i();return t(C,this,P)},C=e[E];s(v,"name",{__proto__:null,value:C.name}),s(v,"length",{__proto__:null,value:C.length}),s(g.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}g.Writable=ki(),g.Duplex=Rt(),g.Transform=gs(),g.PassThrough=ys(),g.pipeline=y;var{addAbortSignal:_}=Ir();g.addAbortSignal=_,g.finished=S,g.destroy=b,g.compose=c,g.setDefaultHighWaterMark=h,g.getDefaultHighWaterMark=d,s(g,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return w}}),s(y,r,{__proto__:null,enumerable:!0,get(){return w.pipeline}}),s(S,r,{__proto__:null,enumerable:!0,get(){return w.finished}}),g.Stream=g,g._isUint8Array=function(E){return E instanceof Uint8Array},g._uint8ArrayToBuffer=function(E){return a.from(E.buffer,E.byteOffset,E.byteLength)}}),Xt=we((o,l)=>{de(),ye(),ge();var a=vs(),s=bs(),u=a.Readable.destroy;l.exports=a.Readable,l.exports._uint8ArrayToBuffer=a._uint8ArrayToBuffer,l.exports._isUint8Array=a._isUint8Array,l.exports.isDisturbed=a.isDisturbed,l.exports.isErrored=a.isErrored,l.exports.isReadable=a.isReadable,l.exports.Readable=a.Readable,l.exports.Writable=a.Writable,l.exports.Duplex=a.Duplex,l.exports.Transform=a.Transform,l.exports.PassThrough=a.PassThrough,l.exports.addAbortSignal=a.addAbortSignal,l.exports.finished=a.finished,l.exports.destroy=a.destroy,l.exports.destroy=u,l.exports.pipeline=a.pipeline,l.exports.compose=a.compose,Object.defineProperty(a,"promises",{configurable:!0,enumerable:!0,get(){return s}}),l.exports.Stream=a.Stream,l.exports.default=l.exports}),Nu=we((o,l)=>{de(),ye(),ge(),typeof Object.create=="function"?l.exports=function(a,s){s&&(a.super_=s,a.prototype=Object.create(s.prototype,{constructor:{value:a,enumerable:!1,writable:!0,configurable:!0}}))}:l.exports=function(a,s){if(s){a.super_=s;var u=function(){};u.prototype=s.prototype,a.prototype=new u,a.prototype.constructor=a}}}),Mu=we((o,l)=>{de(),ye(),ge();var{Buffer:a}=(dt(),tt(pt)),s=Symbol.for("BufferList");function u(t){if(!(this instanceof u))return new u(t);u._init.call(this,t)}u._init=function(t){Object.defineProperty(this,s,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},u.prototype._new=function(t){return new u(t)},u.prototype._offset=function(t){if(t===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let e=r+this._bufs[n].length;if(t<e||n===this._bufs.length-1)return[n,t-r];r=e}},u.prototype._reverseOffset=function(t){let r=t[0],n=t[1];for(let e=0;e<r;e++)n+=this._bufs[e].length;return n},u.prototype.getBuffers=function(){return this._bufs},u.prototype.get=function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},u.prototype.slice=function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)},u.prototype.copy=function(t,r,n,e){if((typeof n!="number"||n<0)&&(n=0),(typeof e!="number"||e>this.length)&&(e=this.length),n>=this.length||e<=0)return t||a.alloc(0);let i=!!t,c=this._offset(n),h=e-n,d=h,y=i&&r||0,b=c[1];if(n===0&&e===this.length){if(!i)return this._bufs.length===1?this._bufs[0]:a.concat(this._bufs,this.length);for(let S=0;S<this._bufs.length;S++)this._bufs[S].copy(t,y),y+=this._bufs[S].length;return t}if(d<=this._bufs[c[0]].length-b)return i?this._bufs[c[0]].copy(t,r,b,b+d):this._bufs[c[0]].slice(b,b+d);i||(t=a.allocUnsafe(h));for(let S=c[0];S<this._bufs.length;S++){let w=this._bufs[S].length-b;if(d>w)this._bufs[S].copy(t,y,b),y+=w;else{this._bufs[S].copy(t,y,b,b+d),y+=w;break}d-=w,b&&(b=0)}return t.length>y?t.slice(0,y):t},u.prototype.shallowSlice=function(t,r){if(t=t||0,r=typeof r!="number"?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let n=this._offset(t),e=this._offset(r),i=this._bufs.slice(n[0],e[0]+1);return e[1]===0?i.pop():i[i.length-1]=i[i.length-1].slice(0,e[1]),n[1]!==0&&(i[0]=i[0].slice(n[1])),this._new(i)},u.prototype.toString=function(t,r,n){return this.slice(r,n).toString(t)},u.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this},u.prototype.duplicate=function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},u.prototype.append=function(t){return this._attach(t,u.prototype._appendBuffer)},u.prototype.prepend=function(t){return this._attach(t,u.prototype._prependBuffer,!0)},u.prototype._attach=function(t,r,n){if(t==null)return this;if(t.buffer)r.call(this,a.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t)){let[e,i]=n?[t.length-1,-1]:[0,1];for(let c=e;c>=0&&c<t.length;c+=i)this._attach(t[c],r,n)}else if(this._isBufferList(t)){let[e,i]=n?[t._bufs.length-1,-1]:[0,1];for(let c=e;c>=0&&c<t._bufs.length;c+=i)this._attach(t._bufs[c],r,n)}else typeof t=="number"&&(t=t.toString()),r.call(this,a.from(t));return this},u.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length},u.prototype._prependBuffer=function(t){this._bufs.unshift(t),this.length+=t.length},u.prototype.indexOf=function(t,r,n){if(n===void 0&&typeof r=="string"&&(n=r,r=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=a.from([t]):typeof t=="string"?t=a.from(t,n):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=a.from(t.buffer,t.byteOffset,t.byteLength):a.isBuffer(t)||(t=a.from(t)),r=Number(r||0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),t.length===0)return r>this.length?this.length:r;let e=this._offset(r),i=e[0],c=e[1];for(;i<this._bufs.length;i++){let h=this._bufs[i];for(;c<h.length;)if(h.length-c>=t.length){let d=h.indexOf(t,c);if(d!==-1)return this._reverseOffset([i,d]);c=h.length-t.length+1}else{let d=this._reverseOffset([i,c]);if(this._match(d,t))return d;c++}c=0}return-1},u.prototype._match=function(t,r){if(this.length-t<r.length)return!1;for(let n=0;n<r.length;n++)if(this.get(t+n)!==r[n])return!1;return!0},function(){let t={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 r in t)(function(n){t[n]===null?u.prototype[n]=function(e,i){return this.slice(e,e+i)[n](0,i)}:u.prototype[n]=function(e=0){return this.slice(e,e+t[n])[n](0)}})(r)}(),u.prototype._isBufferList=function(t){return t instanceof u||u.isBufferList(t)},u.isBufferList=function(t){return t!=null&&t[s]},l.exports=u}),Bu=we((o,l)=>{de(),ye(),ge();var a=Xt().Duplex,s=Nu(),u=Mu();function t(r){if(!(this instanceof t))return new t(r);if(typeof r=="function"){this._callback=r;let n=(function(e){this._callback&&(this._callback(e),this._callback=null)}).bind(this);this.on("pipe",function(e){e.on("error",n)}),this.on("unpipe",function(e){e.removeListener("error",n)}),r=null}u._init.call(this,r),a.call(this)}s(t,a),Object.assign(t.prototype,u.prototype),t.prototype._new=function(r){return new t(r)},t.prototype._write=function(r,n,e){this._appendBuffer(r),typeof e=="function"&&e()},t.prototype._read=function(r){if(!this.length)return this.push(null);r=Math.min(r,this.length),this.push(this.slice(0,r)),this.consume(r)},t.prototype.end=function(r){a.prototype.end.call(this,r),this._callback&&(this._callback(null,this.slice()),this._callback=null)},t.prototype._destroy=function(r,n){this._bufs.length=0,this.length=0,n(r)},t.prototype._isBufferList=function(r){return r instanceof t||r instanceof u||t.isBufferList(r)},t.isBufferList=u.isBufferList,l.exports=t,l.exports.BufferListStream=t,l.exports.BufferList=u}),Lu=we((o,l)=>{de(),ye(),ge();var a=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};l.exports=a}),ws=we((o,l)=>{de(),ye(),ge();var a=l.exports,{Buffer:s}=(dt(),tt(pt));a.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"},a.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},a.requiredHeaderFlagsErrors={};for(let t in a.requiredHeaderFlags){let r=a.requiredHeaderFlags[t];a.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+r.toString(16)+" for "+a.types[t]+" packet"}a.codes={};for(let t in a.types){let r=a.types[t];a.codes[r]=t}a.CMD_SHIFT=4,a.CMD_MASK=240,a.DUP_MASK=8,a.QOS_MASK=3,a.QOS_SHIFT=1,a.RETAIN_MASK=1,a.VARBYTEINT_MASK=127,a.VARBYTEINT_FIN_MASK=128,a.VARBYTEINT_MAX=268435455,a.SESSIONPRESENT_MASK=1,a.SESSIONPRESENT_HEADER=s.from([a.SESSIONPRESENT_MASK]),a.CONNACK_HEADER=s.from([a.codes.connack<<a.CMD_SHIFT]),a.USERNAME_MASK=128,a.PASSWORD_MASK=64,a.WILL_RETAIN_MASK=32,a.WILL_QOS_MASK=24,a.WILL_QOS_SHIFT=3,a.WILL_FLAG_MASK=4,a.CLEAN_SESSION_MASK=2,a.CONNECT_HEADER=s.from([a.codes.connect<<a.CMD_SHIFT]),a.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},a.propertiesCodes={};for(let t in a.properties){let r=a.properties[t];a.propertiesCodes[r]=t}a.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"};function u(t){return[0,1,2].map(r=>[0,1].map(n=>[0,1].map(e=>{let i=s.alloc(1);return i.writeUInt8(a.codes[t]<<a.CMD_SHIFT|(n?a.DUP_MASK:0)|r<<a.QOS_SHIFT|e,0,!0),i})))}a.PUBLISH_HEADER=u("publish"),a.SUBSCRIBE_HEADER=u("subscribe"),a.SUBSCRIBE_OPTIONS_QOS_MASK=3,a.SUBSCRIBE_OPTIONS_NL_MASK=1,a.SUBSCRIBE_OPTIONS_NL_SHIFT=2,a.SUBSCRIBE_OPTIONS_RAP_MASK=1,a.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,a.SUBSCRIBE_OPTIONS_RH_MASK=3,a.SUBSCRIBE_OPTIONS_RH_SHIFT=4,a.SUBSCRIBE_OPTIONS_RH=[0,16,32],a.SUBSCRIBE_OPTIONS_NL=4,a.SUBSCRIBE_OPTIONS_RAP=8,a.SUBSCRIBE_OPTIONS_QOS=[0,1,2],a.UNSUBSCRIBE_HEADER=u("unsubscribe"),a.ACKS={unsuback:u("unsuback"),puback:u("puback"),pubcomp:u("pubcomp"),pubrel:u("pubrel"),pubrec:u("pubrec")},a.SUBACK_HEADER=s.from([a.codes.suback<<a.CMD_SHIFT]),a.VERSION3=s.from([3]),a.VERSION4=s.from([4]),a.VERSION5=s.from([5]),a.VERSION131=s.from([131]),a.VERSION132=s.from([132]),a.QOS=[0,1,2].map(t=>s.from([t])),a.EMPTY={pingreq:s.from([a.codes.pingreq<<4,0]),pingresp:s.from([a.codes.pingresp<<4,0]),disconnect:s.from([a.codes.disconnect<<4,0])},a.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"},a.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},a.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"},a.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"},a.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"},a.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),Uu=we((o,l)=>{de(),ye(),ge();var a=1e3,s=a*60,u=s*60,t=u*24,r=t*7,n=t*365.25;l.exports=function(d,y){y=y||{};var b=typeof d;if(b==="string"&&d.length>0)return e(d);if(b==="number"&&isFinite(d))return y.long?c(d):i(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function e(d){if(d=String(d),!(d.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(y){var b=parseFloat(y[1]),S=(y[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return b*n;case"weeks":case"week":case"w":return b*r;case"days":case"day":case"d":return b*t;case"hours":case"hour":case"hrs":case"hr":case"h":return b*u;case"minutes":case"minute":case"mins":case"min":case"m":return b*s;case"seconds":case"second":case"secs":case"sec":case"s":return b*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function i(d){var y=Math.abs(d);return y>=t?Math.round(d/t)+"d":y>=u?Math.round(d/u)+"h":y>=s?Math.round(d/s)+"m":y>=a?Math.round(d/a)+"s":d+"ms"}function c(d){var y=Math.abs(d);return y>=t?h(d,y,t,"day"):y>=u?h(d,y,u,"hour"):y>=s?h(d,y,s,"minute"):y>=a?h(d,y,a,"second"):d+" ms"}function h(d,y,b,S){var w=y>=b*1.5;return Math.round(d/b)+" "+S+(w?"s":"")}}),Du=we((o,l)=>{de(),ye(),ge();function a(s){t.debug=t,t.default=t,t.coerce=h,t.disable=i,t.enable=n,t.enabled=c,t.humanize=Uu(),t.destroy=d,Object.keys(s).forEach(y=>{t[y]=s[y]}),t.names=[],t.skips=[],t.formatters={};function u(y){let b=0;for(let S=0;S<y.length;S++)b=(b<<5)-b+y.charCodeAt(S),b|=0;return t.colors[Math.abs(b)%t.colors.length]}t.selectColor=u;function t(y){let b,S=null,w,x;function g(..._){if(!g.enabled)return;let E=g,v=Number(new Date),C=v-(b||v);E.diff=C,E.prev=b,E.curr=v,b=v,_[0]=t.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let P=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(I,T)=>{if(I==="%%")return"%";P++;let k=t.formatters[T];if(typeof k=="function"){let W=_[P];I=k.call(E,W),_.splice(P,1),P--}return I}),t.formatArgs.call(E,_),(E.log||t.log).apply(E,_)}return g.namespace=y,g.useColors=t.useColors(),g.color=t.selectColor(y),g.extend=r,g.destroy=t.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>S!==null?S:(w!==t.namespaces&&(w=t.namespaces,x=t.enabled(y)),x),set:_=>{S=_}}),typeof t.init=="function"&&t.init(g),g}function r(y,b){let S=t(this.namespace+(typeof b>"u"?":":b)+y);return S.log=this.log,S}function n(y){t.save(y),t.namespaces=y,t.names=[],t.skips=[];let b=(typeof y=="string"?y:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let S of b)S[0]==="-"?t.skips.push(S.slice(1)):t.names.push(S)}function e(y,b){let S=0,w=0,x=-1,g=0;for(;S<y.length;)if(w<b.length&&(b[w]===y[S]||b[w]==="*"))b[w]==="*"?(x=w,g=S,w++):(S++,w++);else if(x!==-1)w=x+1,g++,S=g;else return!1;for(;w<b.length&&b[w]==="*";)w++;return w===b.length}function i(){let y=[...t.names,...t.skips.map(b=>"-"+b)].join(",");return t.enable(""),y}function c(y){for(let b of t.skips)if(e(y,b))return!1;for(let b of t.names)if(e(y,b))return!0;return!1}function h(y){return y instanceof Error?y.stack||y.message:y}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}l.exports=a}),Nt=we((o,l)=>{de(),ye(),ge(),o.formatArgs=s,o.save=u,o.load=t,o.useColors=a,o.storage=r(),o.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`."))}})(),o.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"];function a(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||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+)/)}function s(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+l.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;e.splice(1,0,i,"color: inherit");let c=0,h=0;e[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(c++,d==="%c"&&(h=c))}),e.splice(h,0,i)}o.log=console.debug||console.log||(()=>{});function u(e){try{e?o.storage.setItem("debug",e):o.storage.removeItem("debug")}catch{}}function t(){let e;try{e=o.storage.getItem("debug")||o.storage.getItem("DEBUG")}catch{}return!e&&typeof Je<"u"&&"env"in Je&&(e=Je.env.DEBUG),e}function r(){try{return localStorage}catch{}}l.exports=Du()(o);var{formatters:n}=l.exports;n.j=function(e){try{return JSON.stringify(e)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}}),Fu=we((o,l)=>{de(),ye(),ge();var a=Bu(),{EventEmitter:s}=(Qt(),tt(Ft)),u=Lu(),t=ws(),r=Nt()("mqtt-packet:parser"),n=class Wo extends s{constructor(){super(),this.parser=this.constructor.parser}static parser(i){return this instanceof Wo?(this.settings=i||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Wo().parser(i)}_resetState(){r("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new u,this.error=null,this._list=a(),this._stateCounter=0}parse(i){for(this.error&&this._resetState(),this._list.append(i),r("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,r("parse: state complete. _stateCounter is now: %d",this._stateCounter),r("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return r("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let i=this._list.readUInt8(0),c=i>>t.CMD_SHIFT;this.packet.cmd=t.types[c];let h=i&15,d=t.requiredHeaderFlags[c];return d!=null&&h!==d?this._emitError(new Error(t.requiredHeaderFlagsErrors[c])):(this.packet.retain=(i&t.RETAIN_MASK)!==0,this.packet.qos=i>>t.QOS_SHIFT&t.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(i&t.DUP_MASK)!==0,r("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let i=this._parseVarByteNum(!0);return i&&(this.packet.length=i.value,this._list.consume(i.bytes)),r("_parseLength %d",i.value),!!i}_parsePayload(){r("_parsePayload: payload %O",this._list);let i=!1;if(this.packet.length===0||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"))}i=!0}return r("_parsePayload complete result: %s",i),i}_parseConnect(){r("_parseConnect");let i,c,h,d,y={},b=this.packet,S=this._parseString();if(S===null)return this._emitError(new Error("Cannot parse protocolId"));if(S!=="MQTT"&&S!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(b.protocolId=S,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(b.protocolVersion=this._list.readUInt8(this._pos),b.protocolVersion>=128&&(b.bridgeMode=!0,b.protocolVersion=b.protocolVersion-128),b.protocolVersion!==3&&b.protocolVersion!==4&&b.protocolVersion!==5)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(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));y.username=this._list.readUInt8(this._pos)&t.USERNAME_MASK,y.password=this._list.readUInt8(this._pos)&t.PASSWORD_MASK,y.will=this._list.readUInt8(this._pos)&t.WILL_FLAG_MASK;let w=!!(this._list.readUInt8(this._pos)&t.WILL_RETAIN_MASK),x=(this._list.readUInt8(this._pos)&t.WILL_QOS_MASK)>>t.WILL_QOS_SHIFT;if(y.will)b.will={},b.will.retain=w,b.will.qos=x;else{if(w)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(x)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(b.clean=(this._list.readUInt8(this._pos)&t.CLEAN_SESSION_MASK)!==0,this._pos++,b.keepalive=this._parseNum(),b.keepalive===-1)return this._emitError(new Error("Packet too short"));if(b.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(b.properties=_)}let g=this._parseString();if(g===null)return this._emitError(new Error("Packet too short"));if(b.clientId=g,r("_parseConnect: packet.clientId: %s",b.clientId),y.will){if(b.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(b.will.properties=_)}if(i=this._parseString(),i===null)return this._emitError(new Error("Cannot parse will topic"));if(b.will.topic=i,r("_parseConnect: packet.will.topic: %s",b.will.topic),c=this._parseBuffer(),c===null)return this._emitError(new Error("Cannot parse will payload"));b.will.payload=c,r("_parseConnect: packet.will.paylaod: %s",b.will.payload)}if(y.username){if(d=this._parseString(),d===null)return this._emitError(new Error("Cannot parse username"));b.username=d,r("_parseConnect: packet.username: %s",b.username)}if(y.password){if(h=this._parseBuffer(),h===null)return this._emitError(new Error("Cannot parse password"));b.password=h}return this.settings=b,r("_parseConnect: complete"),b}_parseConnack(){r("_parseConnack");let i=this.packet;if(this._list.length<1)return null;let c=this._list.readUInt8(this._pos++);if(c>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(i.sessionPresent=!!(c&t.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?i.reasonCode=this._list.readUInt8(this._pos++):i.reasonCode=0;else{if(this._list.length<2)return null;i.returnCode=this._list.readUInt8(this._pos++)}if(i.returnCode===-1||i.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(i.properties=h)}r("_parseConnack: complete")}_parsePublish(){r("_parsePublish");let i=this.packet;if(i.topic=this._parseString(),i.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(i.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}i.payload=this._list.slice(this._pos,i.length),r("_parsePublish: payload from buffer list: %o",i.payload)}}_parseSubscribe(){r("_parseSubscribe");let i=this.packet,c,h,d,y,b,S,w;if(i.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let x=this._parseProperties();Object.getOwnPropertyNames(x).length&&(i.properties=x)}if(i.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<i.length;){if(c=this._parseString(),c===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=i.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(h=this._parseByte(),this.settings.protocolVersion===5){if(h&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(h&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(d=h&t.SUBSCRIBE_OPTIONS_QOS_MASK,d>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(S=(h>>t.SUBSCRIBE_OPTIONS_NL_SHIFT&t.SUBSCRIBE_OPTIONS_NL_MASK)!==0,b=(h>>t.SUBSCRIBE_OPTIONS_RAP_SHIFT&t.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,y=h>>t.SUBSCRIBE_OPTIONS_RH_SHIFT&t.SUBSCRIBE_OPTIONS_RH_MASK,y>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));w={topic:c,qos:d},this.settings.protocolVersion===5?(w.nl=S,w.rap=b,w.rh=y):this.settings.bridgeMode&&(w.rh=0,w.rap=!0,w.nl=!0),r("_parseSubscribe: push subscription `%s` to subscription",w),i.subscriptions.push(w)}}}_parseSuback(){r("_parseSuback");let i=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}if(i.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let c=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!t.MQTT5_SUBACK_CODES[c])return this._emitError(new Error("Invalid suback code"))}else if(c>2&&c!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(c)}}}_parseUnsubscribe(){r("_parseUnsubscribe");let i=this.packet;if(i.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}if(i.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<i.length;){let c=this._parseString();if(c===null)return this._emitError(new Error("Cannot parse topic"));r("_parseUnsubscribe: push topic `%s` to unsubscriptions",c),i.unsubscriptions.push(c)}}}_parseUnsuback(){r("_parseUnsuback");let i=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&i.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(i.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let c=this._parseProperties();for(Object.getOwnPropertyNames(c).length&&(i.properties=c),i.granted=[];this._pos<this.packet.length;){let h=this._list.readUInt8(this._pos++);if(!t.MQTT5_UNSUBACK_CODES[h])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(h)}}}_parseConfirmation(){r("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let i=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(i.length>2){switch(i.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!t.MQTT5_PUBACK_PUBREC_CODES[i.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!t.MQTT5_PUBREL_PUBCOMP_CODES[i.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}r("_parseConfirmation: packet.reasonCode `%d`",i.reasonCode)}else i.reasonCode=0;if(i.length>3){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}}return!0}_parseDisconnect(){let i=this.packet;if(r("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(i.reasonCode=this._parseByte(),t.MQTT5_DISCONNECT_CODES[i.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):i.reasonCode=0;let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}return r("_parseDisconnect result: true"),!0}_parseAuth(){r("_parseAuth");let i=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(i.reasonCode=this._parseByte(),!t.MQTT5_AUTH_CODES[i.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let c=this._parseProperties();return Object.getOwnPropertyNames(c).length&&(i.properties=c),r("_parseAuth: result: true"),!0}_parseMessageId(){let i=this.packet;return i.messageId=this._parseNum(),i.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(r("_parseMessageId: packet.messageId %d",i.messageId),!0)}_parseString(i){let c=this._parseNum(),h=c+this._pos;if(c===-1||h>this._list.length||h>this.packet.length)return null;let d=this._list.toString("utf8",this._pos,h);return this._pos+=c,r("_parseString: result: %s",d),d}_parseStringPair(){return r("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let i=this._parseNum(),c=i+this._pos;if(i===-1||c>this._list.length||c>this.packet.length)return null;let h=this._list.slice(this._pos,c);return this._pos+=i,r("_parseBuffer: result: %o",h),h}_parseNum(){if(this._list.length-this._pos<2)return-1;let i=this._list.readUInt16BE(this._pos);return this._pos+=2,r("_parseNum: result: %s",i),i}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let i=this._list.readUInt32BE(this._pos);return this._pos+=4,r("_parse4ByteNum: result: %s",i),i}_parseVarByteNum(i){r("_parseVarByteNum");let c=4,h=0,d=1,y=0,b=!1,S,w=this._pos?this._pos:0;for(;h<c&&w+h<this._list.length;){if(S=this._list.readUInt8(w+h++),y+=d*(S&t.VARBYTEINT_MASK),d*=128,(S&t.VARBYTEINT_FIN_MASK)===0){b=!0;break}if(this._list.length<=h)break}return!b&&h===c&&this._list.length>=h&&this._emitError(new Error("Invalid variable byte integer")),w&&(this._pos+=h),b?i?b={bytes:h,value:y}:b=y:b=!1,r("_parseVarByteNum: result: %o",b),b}_parseByte(){let i;return this._pos<this._list.length&&(i=this._list.readUInt8(this._pos),this._pos++),r("_parseByte: result: %o",i),i}_parseByType(i){switch(r("_parseByType: type: %s",i),i){case"byte":return this._parseByte()!==0;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(){r("_parseProperties");let i=this._parseVarByteNum(),c=this._pos+i,h={};for(;this._pos<c;){let d=this._parseByte();if(!d)return this._emitError(new Error("Cannot parse property code type")),!1;let y=t.propertiesCodes[d];if(!y)return this._emitError(new Error("Unknown property")),!1;if(y==="userProperties"){h[y]||(h[y]=Object.create(null));let b=this._parseByType(t.propertiesTypes[y]);if(h[y][b.name])if(Array.isArray(h[y][b.name]))h[y][b.name].push(b.value);else{let S=h[y][b.name];h[y][b.name]=[S],h[y][b.name].push(b.value)}else h[y][b.name]=b.value;continue}h[y]?Array.isArray(h[y])?h[y].push(this._parseByType(t.propertiesTypes[y])):(h[y]=[h[y]],h[y].push(this._parseByType(t.propertiesTypes[y]))):h[y]=this._parseByType(t.propertiesTypes[y])}return h}_newPacket(){return r("_newPacket"),this.packet&&(this._list.consume(this.packet.length),r("_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)),r("_newPacket: new packet"),this.packet=new u,this._pos=0,!0}_emitError(i){r("_emitError",i),this.error=i,this.emit("error",i)}};l.exports=n}),Wu=we((o,l)=>{de(),ye(),ge();var{Buffer:a}=(dt(),tt(pt)),s=65536,u={},t=a.isBuffer(a.from([1,2]).subarray(0,1));function r(c){let h=a.allocUnsafe(2);return h.writeUInt8(c>>8,0),h.writeUInt8(c&255,1),h}function n(){for(let c=0;c<s;c++)u[c]=r(c)}function e(c){let h=0,d=0,y=a.allocUnsafe(4);do h=c%128|0,c=c/128|0,c>0&&(h=h|128),y.writeUInt8(h,d++);while(c>0&&d<4);return c>0&&(d=0),t?y.subarray(0,d):y.slice(0,d)}function i(c){let h=a.allocUnsafe(4);return h.writeUInt32BE(c,0),h}l.exports={cache:u,generateCache:n,generateNumber:r,genBufVariableByteInt:e,generate4ByteBuffer:i}}),$u=we((o,l)=>{de(),ye(),ge(),typeof Je>"u"||!Je.version||Je.version.indexOf("v0.")===0||Je.version.indexOf("v1.")===0&&Je.version.indexOf("v1.8.")!==0?l.exports={nextTick:a}:l.exports=Je;function a(s,u,t,r){if(typeof s!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,e,i;switch(n){case 0:case 1:return Je.nextTick(s);case 2:return Je.nextTick(function(){s.call(null,u)});case 3:return Je.nextTick(function(){s.call(null,u,t)});case 4:return Je.nextTick(function(){s.call(null,u,t,r)});default:for(e=new Array(n-1),i=0;i<e.length;)e[i++]=arguments[i];return Je.nextTick(function(){s.apply(null,e)})}}}),_s=we((o,l)=>{de(),ye(),ge();var a=ws(),{Buffer:s}=(dt(),tt(pt)),u=s.allocUnsafe(0),t=s.from([0]),r=Wu(),n=$u().nextTick,e=Nt()("mqtt-packet:writeToStream"),i=r.cache,c=r.generateNumber,h=r.generateCache,d=r.genBufVariableByteInt,y=r.generate4ByteBuffer,b=re,S=!0;function w(X,D,ae){switch(e("generate called"),D.cork&&(D.cork(),n(x,D)),S&&(S=!1,h()),e("generate: packet.cmd: %s",X.cmd),X.cmd){case"connect":return g(X,D);case"connack":return _(X,D,ae);case"publish":return E(X,D,ae);case"puback":case"pubrec":case"pubrel":case"pubcomp":return v(X,D,ae);case"subscribe":return C(X,D,ae);case"suback":return P(X,D,ae);case"unsubscribe":return I(X,D,ae);case"unsuback":return T(X,D,ae);case"pingreq":case"pingresp":return k(X,D);case"disconnect":return W(X,D,ae);case"auth":return A(X,D,ae);default:return D.destroy(new Error("Unknown command")),!1}}Object.defineProperty(w,"cacheNumbers",{get(){return b===re},set(X){X?((!i||Object.keys(i).length===0)&&(S=!0),b=re):(S=!1,b=ee)}});function x(X){X.uncork()}function g(X,D,ae){let H=X||{},te=H.protocolId||"MQTT",ne=H.protocolVersion||4,be=H.will,ce=H.clean,L=H.keepalive||0,Y=H.clientId||"",se=H.username,me=H.password,pe=H.properties;ce===void 0&&(ce=!0);let _e=0;if(typeof te!="string"&&!s.isBuffer(te))return D.destroy(new Error("Invalid protocolId")),!1;if(_e+=te.length+2,ne!==3&&ne!==4&&ne!==5)return D.destroy(new Error("Invalid protocol version")),!1;if(_e+=1,(typeof Y=="string"||s.isBuffer(Y))&&(Y||ne>=4)&&(Y||ce))_e+=s.byteLength(Y)+2;else{if(ne<4)return D.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ce*1===0)return D.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof L!="number"||L<0||L>65535||L%1!==0)return D.destroy(new Error("Invalid keepalive")),!1;_e+=2,_e+=1;let Z,ve;if(ne===5){if(Z=oe(D,pe),!Z)return!1;_e+=Z.length}if(be){if(typeof be!="object")return D.destroy(new Error("Invalid will")),!1;if(!be.topic||typeof be.topic!="string")return D.destroy(new Error("Invalid will topic")),!1;if(_e+=s.byteLength(be.topic)+2,_e+=2,be.payload)if(be.payload.length>=0)typeof be.payload=="string"?_e+=s.byteLength(be.payload):_e+=be.payload.length;else return D.destroy(new Error("Invalid will payload")),!1;if(ve={},ne===5){if(ve=oe(D,be.properties),!ve)return!1;_e+=ve.length}}let Ie=!1;if(se!=null)if(Ee(se))Ie=!0,_e+=s.byteLength(se)+2;else return D.destroy(new Error("Invalid username")),!1;if(me!=null){if(!Ie)return D.destroy(new Error("Username is required to use password")),!1;if(Ee(me))_e+=z(me)+2;else return D.destroy(new Error("Invalid password")),!1}D.write(a.CONNECT_HEADER),q(D,_e),G(D,te),H.bridgeMode&&(ne+=128),D.write(ne===131?a.VERSION131:ne===132?a.VERSION132:ne===4?a.VERSION4:ne===5?a.VERSION5:a.VERSION3);let fe=0;return fe|=se!=null?a.USERNAME_MASK:0,fe|=me!=null?a.PASSWORD_MASK:0,fe|=be&&be.retain?a.WILL_RETAIN_MASK:0,fe|=be&&be.qos?be.qos<<a.WILL_QOS_SHIFT:0,fe|=be?a.WILL_FLAG_MASK:0,fe|=ce?a.CLEAN_SESSION_MASK:0,D.write(s.from([fe])),b(D,L),ne===5&&Z.write(),G(D,Y),be&&(ne===5&&ve.write(),M(D,be.topic),G(D,be.payload)),se!=null&&G(D,se),me!=null&&G(D,me),!0}function _(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=H===5?te.reasonCode:te.returnCode,be=te.properties,ce=2;if(typeof ne!="number")return D.destroy(new Error("Invalid return code")),!1;let L=null;if(H===5){if(L=oe(D,be),!L)return!1;ce+=L.length}return D.write(a.CONNACK_HEADER),q(D,ce),D.write(te.sessionPresent?a.SESSIONPRESENT_HEADER:t),D.write(s.from([ne])),L==null||L.write(),!0}function E(X,D,ae){e("publish: packet: %o",X);let H=ae?ae.protocolVersion:4,te=X||{},ne=te.qos||0,be=te.retain?a.RETAIN_MASK:0,ce=te.topic,L=te.payload||u,Y=te.messageId,se=te.properties,me=0;if(typeof ce=="string")me+=s.byteLength(ce)+2;else if(s.isBuffer(ce))me+=ce.length+2;else return D.destroy(new Error("Invalid topic")),!1;if(s.isBuffer(L)?me+=L.length:me+=s.byteLength(L),ne&&typeof Y!="number")return D.destroy(new Error("Invalid messageId")),!1;ne&&(me+=2);let pe=null;if(H===5){if(pe=oe(D,se),!pe)return!1;me+=pe.length}return D.write(a.PUBLISH_HEADER[ne][te.dup?1:0][be?1:0]),q(D,me),b(D,z(ce)),D.write(ce),ne>0&&b(D,Y),pe==null||pe.write(),e("publish: payload: %o",L),D.write(L)}function v(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.cmd||"puback",be=te.messageId,ce=te.dup&&ne==="pubrel"?a.DUP_MASK:0,L=0,Y=te.reasonCode,se=te.properties,me=H===5?3:2;if(ne==="pubrel"&&(L=1),typeof be!="number")return D.destroy(new Error("Invalid messageId")),!1;let pe=null;if(H===5&&typeof se=="object"){if(pe=R(D,se,ae,me),!pe)return!1;me+=pe.length}return D.write(a.ACKS[ne][L][ce][0]),me===3&&(me+=Y!==0?1:-1),q(D,me),b(D,be),H===5&&me!==2&&D.write(s.from([Y])),pe!==null?pe.write():me===4&&D.write(s.from([0])),!0}function C(X,D,ae){e("subscribe: packet: ");let H=ae?ae.protocolVersion:4,te=X||{},ne=te.dup?a.DUP_MASK:0,be=te.messageId,ce=te.subscriptions,L=te.properties,Y=0;if(typeof be!="number")return D.destroy(new Error("Invalid messageId")),!1;Y+=2;let se=null;if(H===5){if(se=oe(D,L),!se)return!1;Y+=se.length}if(typeof ce=="object"&&ce.length)for(let pe=0;pe<ce.length;pe+=1){let _e=ce[pe].topic,Z=ce[pe].qos;if(typeof _e!="string")return D.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof Z!="number")return D.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(H===5){if(typeof(ce[pe].nl||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ce[pe].rap||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let ve=ce[pe].rh||0;if(typeof ve!="number"||ve>2)return D.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}Y+=s.byteLength(_e)+2+1}else return D.destroy(new Error("Invalid subscriptions")),!1;e("subscribe: writing to stream: %o",a.SUBSCRIBE_HEADER),D.write(a.SUBSCRIBE_HEADER[1][ne?1:0][0]),q(D,Y),b(D,be),se!==null&&se.write();let me=!0;for(let pe of ce){let _e=pe.topic,Z=pe.qos,ve=+pe.nl,Ie=+pe.rap,fe=pe.rh,De;M(D,_e),De=a.SUBSCRIBE_OPTIONS_QOS[Z],H===5&&(De|=ve?a.SUBSCRIBE_OPTIONS_NL:0,De|=Ie?a.SUBSCRIBE_OPTIONS_RAP:0,De|=fe?a.SUBSCRIBE_OPTIONS_RH[fe]:0),me=D.write(s.from([De]))}return me}function P(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.granted,ce=te.properties,L=0;if(typeof ne!="number")return D.destroy(new Error("Invalid messageId")),!1;if(L+=2,typeof be=="object"&&be.length)for(let se=0;se<be.length;se+=1){if(typeof be[se]!="number")return D.destroy(new Error("Invalid qos vector")),!1;L+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let Y=null;if(H===5){if(Y=R(D,ce,ae,L),!Y)return!1;L+=Y.length}return D.write(a.SUBACK_HEADER),q(D,L),b(D,ne),Y!==null&&Y.write(),D.write(s.from(be))}function I(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.dup?a.DUP_MASK:0,ce=te.unsubscriptions,L=te.properties,Y=0;if(typeof ne!="number")return D.destroy(new Error("Invalid messageId")),!1;if(Y+=2,typeof ce=="object"&&ce.length)for(let pe=0;pe<ce.length;pe+=1){if(typeof ce[pe]!="string")return D.destroy(new Error("Invalid unsubscriptions")),!1;Y+=s.byteLength(ce[pe])+2}else return D.destroy(new Error("Invalid unsubscriptions")),!1;let se=null;if(H===5){if(se=oe(D,L),!se)return!1;Y+=se.length}D.write(a.UNSUBSCRIBE_HEADER[1][be?1:0][0]),q(D,Y),b(D,ne),se!==null&&se.write();let me=!0;for(let pe=0;pe<ce.length;pe++)me=M(D,ce[pe]);return me}function T(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.dup?a.DUP_MASK:0,ce=te.granted,L=te.properties,Y=te.cmd,se=0,me=2;if(typeof ne!="number")return D.destroy(new Error("Invalid messageId")),!1;if(H===5)if(typeof ce=="object"&&ce.length)for(let _e=0;_e<ce.length;_e+=1){if(typeof ce[_e]!="number")return D.destroy(new Error("Invalid qos vector")),!1;me+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let pe=null;if(H===5){if(pe=R(D,L,ae,me),!pe)return!1;me+=pe.length}return D.write(a.ACKS[Y][se][be][0]),q(D,me),b(D,ne),pe!==null&&pe.write(),H===5&&D.write(s.from(ce)),!0}function k(X,D,ae){return D.write(a.EMPTY[X.cmd])}function W(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.reasonCode,be=te.properties,ce=H===5?1:0,L=null;if(H===5){if(L=R(D,be,ae,ce),!L)return!1;ce+=L.length}return D.write(s.from([a.codes.disconnect<<4])),q(D,ce),H===5&&D.write(s.from([ne])),L!==null&&L.write(),!0}function A(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.reasonCode,be=te.properties,ce=H===5?1:0;H!==5&&D.destroy(new Error("Invalid mqtt version for auth packet"));let L=R(D,be,ae,ce);return L?(ce+=L.length,D.write(s.from([a.codes.auth<<4])),q(D,ce),D.write(s.from([ne])),L!==null&&L.write(),!0):!1}var N={};function q(X,D){if(D>a.VARBYTEINT_MAX)return X.destroy(new Error(`Invalid variable byte integer: ${D}`)),!1;let ae=N[D];return ae||(ae=d(D),D<16384&&(N[D]=ae)),e("writeVarByteInt: writing to stream: %o",ae),X.write(ae)}function M(X,D){let ae=s.byteLength(D);return b(X,ae),e("writeString: %s",D),X.write(D,"utf8")}function le(X,D,ae){M(X,D),M(X,ae)}function re(X,D){return e("writeNumberCached: number: %d",D),e("writeNumberCached: %o",i[D]),X.write(i[D])}function ee(X,D){let ae=c(D);return e("writeNumberGenerated: %o",ae),X.write(ae)}function ue(X,D){let ae=y(D);return e("write4ByteNumber: %o",ae),X.write(ae)}function G(X,D){typeof D=="string"?M(X,D):D?(b(X,D.length),X.write(D)):b(X,0)}function oe(X,D){if(typeof D!="object"||D.length!=null)return{length:1,write(){he(X,{},0)}};let ae=0;function H(te,ne){let be=a.propertiesTypes[te],ce=0;switch(be){case"byte":{if(typeof ne!="boolean")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=2;break}case"int8":{if(typeof ne!="number"||ne<0||ne>255)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=2;break}case"binary":{if(ne&&ne===null)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=1+s.byteLength(ne)+2;break}case"int16":{if(typeof ne!="number"||ne<0||ne>65535)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=3;break}case"int32":{if(typeof ne!="number"||ne<0||ne>4294967295)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=5;break}case"var":{if(typeof ne!="number"||ne<0||ne>268435455)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=1+s.byteLength(d(ne));break}case"string":{if(typeof ne!="string")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=3+s.byteLength(ne.toString());break}case"pair":{if(typeof ne!="object")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=Object.getOwnPropertyNames(ne).reduce((L,Y)=>{let se=ne[Y];return Array.isArray(se)?L+=se.reduce((me,pe)=>(me+=3+s.byteLength(Y.toString())+2+s.byteLength(pe.toString()),me),0):L+=3+s.byteLength(Y.toString())+2+s.byteLength(ne[Y].toString()),L},0);break}default:return X.destroy(new Error(`Invalid property ${te}: ${ne}`)),!1}return ce}if(D)for(let te in D){let ne=0,be=0,ce=D[te];if(ce!==void 0){if(Array.isArray(ce))for(let L=0;L<ce.length;L++){if(be=H(te,ce[L]),!be)return!1;ne+=be}else{if(be=H(te,ce),!be)return!1;ne=be}if(!ne)return!1;ae+=ne}}return{length:s.byteLength(d(ae))+ae,write(){he(X,D,ae)}}}function R(X,D,ae,H){let te=["reasonString","userProperties"],ne=ae&&ae.properties&&ae.properties.maximumPacketSize?ae.properties.maximumPacketSize:0,be=oe(X,D);if(ne)for(;H+be.length>ne;){let ce=te.shift();if(ce&&D[ce])delete D[ce],be=oe(X,D);else return!1}return be}function Q(X,D,ae){switch(a.propertiesTypes[D]){case"byte":{X.write(s.from([a.properties[D]])),X.write(s.from([+ae]));break}case"int8":{X.write(s.from([a.properties[D]])),X.write(s.from([ae]));break}case"binary":{X.write(s.from([a.properties[D]])),G(X,ae);break}case"int16":{X.write(s.from([a.properties[D]])),b(X,ae);break}case"int32":{X.write(s.from([a.properties[D]])),ue(X,ae);break}case"var":{X.write(s.from([a.properties[D]])),q(X,ae);break}case"string":{X.write(s.from([a.properties[D]])),M(X,ae);break}case"pair":{Object.getOwnPropertyNames(ae).forEach(H=>{let te=ae[H];Array.isArray(te)?te.forEach(ne=>{X.write(s.from([a.properties[D]])),le(X,H.toString(),ne.toString())}):(X.write(s.from([a.properties[D]])),le(X,H.toString(),te.toString()))});break}default:return X.destroy(new Error(`Invalid property ${D} value: ${ae}`)),!1}}function he(X,D,ae){q(X,ae);for(let H in D)if(Object.prototype.hasOwnProperty.call(D,H)&&D[H]!=null){let te=D[H];if(Array.isArray(te))for(let ne=0;ne<te.length;ne++)Q(X,H,te[ne]);else Q(X,H,te)}}function z(X){return X?X instanceof s?X.length:s.byteLength(X):0}function Ee(X){return typeof X=="string"||X instanceof s}l.exports=w}),qu=we((o,l)=>{de(),ye(),ge();var a=_s(),{EventEmitter:s}=(Qt(),tt(Ft)),{Buffer:u}=(dt(),tt(pt));function t(n,e){let i=new r;return a(n,i,e),i.concat()}var r=class extends s{constructor(){super(),this._array=new Array(20),this._i=0}write(n){return this._array[this._i++]=n,!0}concat(){let n=0,e=new Array(this._array.length),i=this._array,c=0,h;for(h=0;h<i.length&&i[h]!==void 0;h++)typeof i[h]!="string"?e[h]=i[h].length:e[h]=u.byteLength(i[h]),n+=e[h];let d=u.allocUnsafe(n);for(h=0;h<i.length&&i[h]!==void 0;h++)typeof i[h]!="string"?(i[h].copy(d,c),c+=e[h]):(d.write(i[h],c),c+=e[h]);return d}destroy(n){n&&this.emit("error",n)}};l.exports=t}),zu=we(o=>{de(),ye(),ge(),o.parser=Fu().parser,o.generate=qu(),o.writeToStream=_s()}),Vu=we((o,l)=>{de(),ye(),ge(),l.exports=s;function a(t){return t instanceof Ar?Ar.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function s(t){if(t=t||{},t.circles)return u(t);let r=new Map;if(r.set(Date,h=>new Date(h)),r.set(Map,(h,d)=>new Map(e(Array.from(h),d))),r.set(Set,(h,d)=>new Set(e(Array.from(h),d))),t.constructorHandlers)for(let h of t.constructorHandlers)r.set(h[0],h[1]);let n=null;return t.proto?c:i;function e(h,d){let y=Object.keys(h),b=new Array(y.length);for(let S=0;S<y.length;S++){let w=y[S],x=h[w];typeof x!="object"||x===null?b[w]=x:x.constructor!==Object&&(n=r.get(x.constructor))?b[w]=n(x,d):ArrayBuffer.isView(x)?b[w]=a(x):b[w]=d(x)}return b}function i(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return e(h,i);if(h.constructor!==Object&&(n=r.get(h.constructor)))return n(h,i);let d={};for(let y in h){if(Object.hasOwnProperty.call(h,y)===!1)continue;let b=h[y];typeof b!="object"||b===null?d[y]=b:b.constructor!==Object&&(n=r.get(b.constructor))?d[y]=n(b,i):ArrayBuffer.isView(b)?d[y]=a(b):d[y]=i(b)}return d}function c(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return e(h,c);if(h.constructor!==Object&&(n=r.get(h.constructor)))return n(h,c);let d={};for(let y in h){let b=h[y];typeof b!="object"||b===null?d[y]=b:b.constructor!==Object&&(n=r.get(b.constructor))?d[y]=n(b,c):ArrayBuffer.isView(b)?d[y]=a(b):d[y]=c(b)}return d}}function u(t){let r=[],n=[],e=new Map;if(e.set(Date,y=>new Date(y)),e.set(Map,(y,b)=>new Map(c(Array.from(y),b))),e.set(Set,(y,b)=>new Set(c(Array.from(y),b))),t.constructorHandlers)for(let y of t.constructorHandlers)e.set(y[0],y[1]);let i=null;return t.proto?d:h;function c(y,b){let S=Object.keys(y),w=new Array(S.length);for(let x=0;x<S.length;x++){let g=S[x],_=y[g];if(typeof _!="object"||_===null)w[g]=_;else if(_.constructor!==Object&&(i=e.get(_.constructor)))w[g]=i(_,b);else if(ArrayBuffer.isView(_))w[g]=a(_);else{let E=r.indexOf(_);E!==-1?w[g]=n[E]:w[g]=b(_)}}return w}function h(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return c(y,h);if(y.constructor!==Object&&(i=e.get(y.constructor)))return i(y,h);let b={};r.push(y),n.push(b);for(let S in y){if(Object.hasOwnProperty.call(y,S)===!1)continue;let w=y[S];if(typeof w!="object"||w===null)b[S]=w;else if(w.constructor!==Object&&(i=e.get(w.constructor)))b[S]=i(w,h);else if(ArrayBuffer.isView(w))b[S]=a(w);else{let x=r.indexOf(w);x!==-1?b[S]=n[x]:b[S]=h(w)}}return r.pop(),n.pop(),b}function d(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return c(y,d);if(y.constructor!==Object&&(i=e.get(y.constructor)))return i(y,d);let b={};r.push(y),n.push(b);for(let S in y){let w=y[S];if(typeof w!="object"||w===null)b[S]=w;else if(w.constructor!==Object&&(i=e.get(w.constructor)))b[S]=i(w,d);else if(ArrayBuffer.isView(w))b[S]=a(w);else{let x=r.indexOf(w);x!==-1?b[S]=n[x]:b[S]=d(w)}}return r.pop(),n.pop(),b}}}),Ku=we((o,l)=>{de(),ye(),ge(),l.exports=Vu()()}),Hu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.validateTopic=l,o.validateTopics=a;function l(s){let u=s.split("/");for(let t=0;t<u.length;t++)if(u[t]!=="+"){if(u[t]==="#")return t===u.length-1;if(u[t].indexOf("+")!==-1||u[t].indexOf("#")!==-1)return!1}return!0}function a(s){if(s.length===0)return"empty_topic_list";for(let u=0;u<s.length;u++)if(!l(s[u]))return s[u];return null}}),Ss=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Xt(),a={objectMode:!0},s={clean:!0},u=class{constructor(t){Pe(this,"options");Pe(this,"_inflights");this.options=t||{},this.options={...s,...t},this._inflights=new Map}put(t,r){return this._inflights.set(t.messageId,t),r&&r(),this}createStream(){let t=new l.Readable(a),r=[],n=!1,e=0;return this._inflights.forEach((i,c)=>{r.push(i)}),t._read=()=>{!n&&e<r.length?t.push(r[e++]):t.push(null)},t.destroy=i=>{if(!n)return n=!0,setTimeout(()=>{t.emit("close")},0),t},t}del(t,r){let n=this._inflights.get(t.messageId);return n?(this._inflights.delete(t.messageId),r(null,n)):r&&r(new Error("missing packet")),this}get(t,r){let n=this._inflights.get(t.messageId);return n?r(null,n):r&&r(new Error("missing packet")),this}close(t){this.options.clean&&(this._inflights=null),t&&t()}};o.default=u}),Gu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=[0,16,128,131,135,144,145,151,153],a=(s,u,t)=>{s.log("handlePublish: packet %o",u),t=typeof t<"u"?t:s.noop;let r=u.topic.toString(),n=u.payload,{qos:e}=u,{messageId:i}=u,{options:c}=s;if(s.options.protocolVersion===5){let h;if(u.properties&&(h=u.properties.topicAlias),typeof h<"u")if(r.length===0)if(h>0&&h<=65535){let d=s.topicAliasRecv.getTopicByAlias(h);if(d)r=d,s.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",r,h);else{s.log("handlePublish :: unregistered topic alias. alias: %d",h),s.emit("error",new Error("Received unregistered Topic Alias"));return}}else{s.log("handlePublish :: topic alias out of range. alias: %d",h),s.emit("error",new Error("Received Topic Alias is out of range"));return}else if(s.topicAliasRecv.put(r,h))s.log("handlePublish :: registered topic: %s - alias: %d",r,h);else{s.log("handlePublish :: topic alias out of range. alias: %d",h),s.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(s.log("handlePublish: qos %d",e),e){case 2:{c.customHandleAcks(r,n,u,(h,d)=>{if(typeof h=="number"&&(d=h,h=null),h)return s.emit("error",h);if(l.indexOf(d)===-1)return s.emit("error",new Error("Wrong reason code for pubrec"));d?s._sendPacket({cmd:"pubrec",messageId:i,reasonCode:d},t):s.incomingStore.put(u,()=>{s._sendPacket({cmd:"pubrec",messageId:i},t)})});break}case 1:{c.customHandleAcks(r,n,u,(h,d)=>{if(typeof h=="number"&&(d=h,h=null),h)return s.emit("error",h);if(l.indexOf(d)===-1)return s.emit("error",new Error("Wrong reason code for puback"));d||s.emit("message",r,n,u),s.handleMessage(u,y=>{if(y)return t&&t(y);s._sendPacket({cmd:"puback",messageId:i,reasonCode:d},t)})});break}case 0:s.emit("message",r,n,u),s.handleMessage(u,t);break;default:s.log("handlePublish: unknown QoS. Doing nothing.");break}};o.default=a}),Yu=we((o,l)=>{l.exports={version:"5.14.1"}}),ar=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.MQTTJS_VERSION=o.nextTick=o.ErrorWithSubackPacket=o.ErrorWithReasonCode=void 0,o.applyMixin=s;var l=class ou extends Error{constructor(r,n){super(r);Pe(this,"code");this.code=n,Object.setPrototypeOf(this,ou.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};o.ErrorWithReasonCode=l;var a=class su extends Error{constructor(r,n){super(r);Pe(this,"packet");this.packet=n,Object.setPrototypeOf(this,su.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};o.ErrorWithSubackPacket=a;function s(u,t,r=!1){let n=[t];for(;;){let e=n[0],i=Object.getPrototypeOf(e);if(i!=null&&i.prototype)n.unshift(i);else break}for(let e of n)for(let i of Object.getOwnPropertyNames(e.prototype))(r||i!=="constructor")&&Object.defineProperty(u.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)??Object.create(null))}o.nextTick=typeof(Je==null?void 0:Je.nextTick)=="function"?Je.nextTick:u=>{setTimeout(u,0)},o.MQTTJS_VERSION=Yu().version}),Tr=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=void 0;var l=ar();o.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 a=(s,u)=>{let{messageId:t}=u,r=u.cmd,n=null,e=s.outgoing[t]?s.outgoing[t].cb:null,i=null;if(!e){s.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(s.log("_handleAck :: packet type",r),r){case"pubcomp":case"puback":{let c=u.reasonCode;c&&c>0&&c!==16?(i=new l.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[c]}`,c),s._removeOutgoingAndStoreMessage(t,()=>{e(i,u)})):s._removeOutgoingAndStoreMessage(t,e);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:t};let c=u.reasonCode;c&&c>0&&c!==16?(i=new l.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[c]}`,c),s._removeOutgoingAndStoreMessage(t,()=>{e(i,u)})):s._sendPacket(n);break}case"suback":{delete s.outgoing[t],s.messageIdProvider.deallocate(t);let c=u.granted;for(let h=0;h<c.length;h++){let d=c[h];if(d&128){i=new Error(`Subscribe error: ${o.ReasonCodes[d]}`),i.code=d;let y=s.messageIdToTopic[t];y&&y.forEach(b=>{delete s._resubscribeTopics[b]})}}delete s.messageIdToTopic[t],s._invokeStoreProcessingQueue(),e(i,u);break}case"unsuback":{delete s.outgoing[t],s.messageIdProvider.deallocate(t),s._invokeStoreProcessingQueue(),e(null,u);break}default:s.emit("error",new Error("unrecognized packet type"))}s.disconnecting&&Object.keys(s.outgoing).length===0&&s.emit("outgoingEmpty")};o.default=a}),Qu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=ar(),a=Tr(),s=(u,t)=>{let{options:r}=u,n=r.protocolVersion,e=n===5?t.reasonCode:t.returnCode;if(n!==5){let i=new l.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${n}`,e);u.emit("error",i);return}u.handleAuth(t,(i,c)=>{if(i){u.emit("error",i);return}if(e===24)u.reconnecting=!1,u._sendPacket(c);else{let h=new l.ErrorWithReasonCode(`Connection refused: ${a.ReasonCodes[e]}`,e);u.emit("error",h)}})};o.default=s}),Ju=we(o=>{var y,b,S,w,x,g,_,E,v,C,P,I,T,k,W,A,N,q,M,le,re,ee,ue,G,oe,R,Q,he,z,$o,X,D,ae,H,au,ne,be,ce,Vt,Kt,qo,ln,un,ot,zo,Sr,Ht,Vo,De;de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.LRUCache=void 0;var l=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,a=new Set,s=typeof Je=="object"&&Je?Je:{},u=(f,p,m,O)=>{typeof s.emitWarning=="function"?s.emitWarning(f,p,m,O):console.error(`[${m}] ${p}: ${f}`)},t=globalThis.AbortController,r=globalThis.AbortSignal;if(typeof t>"u"){r=class{constructor(){Pe(this,"onabort");Pe(this,"_onabort",[]);Pe(this,"reason");Pe(this,"aborted",!1)}addEventListener(m,O){this._onabort.push(O)}},t=class{constructor(){Pe(this,"signal",new r);p()}abort(m){var O,B;if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let V of this.signal._onabort)V(m);(B=(O=this.signal).onabort)==null||B.call(O,m)}}};let f=((y=s.env)==null?void 0:y.LRU_CACHE_IGNORE_AC_WARNING)!=="1",p=()=>{f&&(f=!1,u("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",p))}}var n=f=>!a.has(f),e=f=>f&&f===Math.floor(f)&&f>0&&isFinite(f),i=f=>e(f)?f<=Math.pow(2,8)?Uint8Array:f<=Math.pow(2,16)?Uint16Array:f<=Math.pow(2,32)?Uint32Array:f<=Number.MAX_SAFE_INTEGER?c:null:null,c=class extends Array{constructor(f){super(f),this.fill(0)}},h=(b=class{constructor(p,m){Pe(this,"heap");Pe(this,"length");if(!F(b,S))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new m(p),this.length=0}static create(p){let m=i(p);if(!m)return[];$e(b,S,!0);let O=new b(p,m);return $e(b,S,!1),O}push(p){this.heap[this.length++]=p}pop(){return this.heap[--this.length]}},S=new WeakMap,Qe(b,S,!1),b),d=(De=class{constructor(p){Qe(this,z);Qe(this,g);Qe(this,_);Qe(this,E);Qe(this,v);Qe(this,C);Qe(this,P);Pe(this,"ttl");Pe(this,"ttlResolution");Pe(this,"ttlAutopurge");Pe(this,"updateAgeOnGet");Pe(this,"updateAgeOnHas");Pe(this,"allowStale");Pe(this,"noDisposeOnSet");Pe(this,"noUpdateTTL");Pe(this,"maxEntrySize");Pe(this,"sizeCalculation");Pe(this,"noDeleteOnFetchRejection");Pe(this,"noDeleteOnStaleGet");Pe(this,"allowStaleOnFetchAbort");Pe(this,"allowStaleOnFetchRejection");Pe(this,"ignoreFetchAbort");Qe(this,I);Qe(this,T);Qe(this,k);Qe(this,W);Qe(this,A);Qe(this,N);Qe(this,q);Qe(this,M);Qe(this,le);Qe(this,re);Qe(this,ee);Qe(this,ue);Qe(this,G);Qe(this,oe);Qe(this,R);Qe(this,Q);Qe(this,he);Qe(this,X,()=>{});Qe(this,D,()=>{});Qe(this,ae,()=>{});Qe(this,H,()=>!1);Qe(this,ne,p=>{});Qe(this,be,(p,m,O)=>{});Qe(this,ce,(p,m,O,B)=>{if(O||B)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Pe(this,w,"LRUCache");let{max:m=0,ttl:O,ttlResolution:B=1,ttlAutopurge:V,updateAgeOnGet:ie,updateAgeOnHas:$,allowStale:J,dispose:Te,disposeAfter:Re,noDisposeOnSet:Ne,noUpdateTTL:Fe,maxSize:nt=0,maxEntrySize:rt=0,sizeCalculation:Ke,fetchMethod:Xe,memoMethod:Ue,noDeleteOnFetchRejection:Ye,noDeleteOnStaleGet:Ze,allowStaleOnFetchRejection:lt,allowStaleOnFetchAbort:ct,ignoreFetchAbort:Et}=p;if(m!==0&&!e(m))throw new TypeError("max option must be a nonnegative integer");let j=m?i(m):Array;if(!j)throw new Error("invalid max value: "+m);if($e(this,g,m),$e(this,_,nt),this.maxEntrySize=rt||F(this,_),this.sizeCalculation=Ke,this.sizeCalculation){if(!F(this,_)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Ue!==void 0&&typeof Ue!="function")throw new TypeError("memoMethod must be a function if defined");if($e(this,P,Ue),Xe!==void 0&&typeof Xe!="function")throw new TypeError("fetchMethod must be a function if specified");if($e(this,C,Xe),$e(this,Q,!!Xe),$e(this,k,new Map),$e(this,W,new Array(m).fill(void 0)),$e(this,A,new Array(m).fill(void 0)),$e(this,N,new j(m)),$e(this,q,new j(m)),$e(this,M,0),$e(this,le,0),$e(this,re,h.create(m)),$e(this,I,0),$e(this,T,0),typeof Te=="function"&&$e(this,E,Te),typeof Re=="function"?($e(this,v,Re),$e(this,ee,[])):($e(this,v,void 0),$e(this,ee,void 0)),$e(this,R,!!F(this,E)),$e(this,he,!!F(this,v)),this.noDisposeOnSet=!!Ne,this.noUpdateTTL=!!Fe,this.noDeleteOnFetchRejection=!!Ye,this.allowStaleOnFetchRejection=!!lt,this.allowStaleOnFetchAbort=!!ct,this.ignoreFetchAbort=!!Et,this.maxEntrySize!==0){if(F(this,_)!==0&&!e(F(this,_)))throw new TypeError("maxSize must be a positive integer if specified");if(!e(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Le(this,z,au).call(this)}if(this.allowStale=!!J,this.noDeleteOnStaleGet=!!Ze,this.updateAgeOnGet=!!ie,this.updateAgeOnHas=!!$,this.ttlResolution=e(B)||B===0?B:1,this.ttlAutopurge=!!V,this.ttl=O||0,this.ttl){if(!e(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Le(this,z,$o).call(this)}if(F(this,g)===0&&this.ttl===0&&F(this,_)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!F(this,g)&&!F(this,_)){let U="LRU_CACHE_UNBOUNDED";n(U)&&(a.add(U),u("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,De))}}static unsafeExposeInternals(p){return{starts:F(p,G),ttls:F(p,oe),sizes:F(p,ue),keyMap:F(p,k),keyList:F(p,W),valList:F(p,A),next:F(p,N),prev:F(p,q),get head(){return F(p,M)},get tail(){return F(p,le)},free:F(p,re),isBackgroundFetch:m=>{var O;return Le(O=p,z,ot).call(O,m)},backgroundFetch:(m,O,B,V)=>{var ie;return Le(ie=p,z,un).call(ie,m,O,B,V)},moveToTail:m=>{var O;return Le(O=p,z,Sr).call(O,m)},indexes:m=>{var O;return Le(O=p,z,Vt).call(O,m)},rindexes:m=>{var O;return Le(O=p,z,Kt).call(O,m)},isStale:m=>{var O;return F(O=p,H).call(O,m)}}}get max(){return F(this,g)}get maxSize(){return F(this,_)}get calculatedSize(){return F(this,T)}get size(){return F(this,I)}get fetchMethod(){return F(this,C)}get memoMethod(){return F(this,P)}get dispose(){return F(this,E)}get disposeAfter(){return F(this,v)}getRemainingTTL(p){return F(this,k).has(p)?1/0:0}*entries(){for(let p of Le(this,z,Vt).call(this))F(this,A)[p]!==void 0&&F(this,W)[p]!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield[F(this,W)[p],F(this,A)[p]])}*rentries(){for(let p of Le(this,z,Kt).call(this))F(this,A)[p]!==void 0&&F(this,W)[p]!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield[F(this,W)[p],F(this,A)[p]])}*keys(){for(let p of Le(this,z,Vt).call(this)){let m=F(this,W)[p];m!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield m)}}*rkeys(){for(let p of Le(this,z,Kt).call(this)){let m=F(this,W)[p];m!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield m)}}*values(){for(let p of Le(this,z,Vt).call(this))F(this,A)[p]!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield F(this,A)[p])}*rvalues(){for(let p of Le(this,z,Kt).call(this))F(this,A)[p]!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield F(this,A)[p])}[(x=Symbol.iterator,w=Symbol.toStringTag,x)](){return this.entries()}find(p,m={}){for(let O of Le(this,z,Vt).call(this)){let B=F(this,A)[O],V=Le(this,z,ot).call(this,B)?B.__staleWhileFetching:B;if(V!==void 0&&p(V,F(this,W)[O],this))return this.get(F(this,W)[O],m)}}forEach(p,m=this){for(let O of Le(this,z,Vt).call(this)){let B=F(this,A)[O],V=Le(this,z,ot).call(this,B)?B.__staleWhileFetching:B;V!==void 0&&p.call(m,V,F(this,W)[O],this)}}rforEach(p,m=this){for(let O of Le(this,z,Kt).call(this)){let B=F(this,A)[O],V=Le(this,z,ot).call(this,B)?B.__staleWhileFetching:B;V!==void 0&&p.call(m,V,F(this,W)[O],this)}}purgeStale(){let p=!1;for(let m of Le(this,z,Kt).call(this,{allowStale:!0}))F(this,H).call(this,m)&&(Le(this,z,Ht).call(this,F(this,W)[m],"expire"),p=!0);return p}info(p){let m=F(this,k).get(p);if(m===void 0)return;let O=F(this,A)[m],B=Le(this,z,ot).call(this,O)?O.__staleWhileFetching:O;if(B===void 0)return;let V={value:B};if(F(this,oe)&&F(this,G)){let ie=F(this,oe)[m],$=F(this,G)[m];if(ie&&$){let J=ie-(l.now()-$);V.ttl=J,V.start=Date.now()}}return F(this,ue)&&(V.size=F(this,ue)[m]),V}dump(){let p=[];for(let m of Le(this,z,Vt).call(this,{allowStale:!0})){let O=F(this,W)[m],B=F(this,A)[m],V=Le(this,z,ot).call(this,B)?B.__staleWhileFetching:B;if(V===void 0||O===void 0)continue;let ie={value:V};if(F(this,oe)&&F(this,G)){ie.ttl=F(this,oe)[m];let $=l.now()-F(this,G)[m];ie.start=Math.floor(Date.now()-$)}F(this,ue)&&(ie.size=F(this,ue)[m]),p.unshift([O,ie])}return p}load(p){this.clear();for(let[m,O]of p){if(O.start){let B=Date.now()-O.start;O.start=l.now()-B}this.set(m,O.value,O)}}set(p,m,O={}){var Fe,nt,rt,Ke,Xe;if(m===void 0)return this.delete(p),this;let{ttl:B=this.ttl,start:V,noDisposeOnSet:ie=this.noDisposeOnSet,sizeCalculation:$=this.sizeCalculation,status:J}=O,{noUpdateTTL:Te=this.noUpdateTTL}=O,Re=F(this,ce).call(this,p,m,O.size||0,$);if(this.maxEntrySize&&Re>this.maxEntrySize)return J&&(J.set="miss",J.maxEntrySizeExceeded=!0),Le(this,z,Ht).call(this,p,"set"),this;let Ne=F(this,I)===0?void 0:F(this,k).get(p);if(Ne===void 0)Ne=F(this,I)===0?F(this,le):F(this,re).length!==0?F(this,re).pop():F(this,I)===F(this,g)?Le(this,z,ln).call(this,!1):F(this,I),F(this,W)[Ne]=p,F(this,A)[Ne]=m,F(this,k).set(p,Ne),F(this,N)[F(this,le)]=Ne,F(this,q)[Ne]=F(this,le),$e(this,le,Ne),an(this,I)._++,F(this,be).call(this,Ne,Re,J),J&&(J.set="add"),Te=!1;else{Le(this,z,Sr).call(this,Ne);let Ue=F(this,A)[Ne];if(m!==Ue){if(F(this,Q)&&Le(this,z,ot).call(this,Ue)){Ue.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Ye}=Ue;Ye!==void 0&&!ie&&(F(this,R)&&((Fe=F(this,E))==null||Fe.call(this,Ye,p,"set")),F(this,he)&&((nt=F(this,ee))==null||nt.push([Ye,p,"set"])))}else ie||(F(this,R)&&((rt=F(this,E))==null||rt.call(this,Ue,p,"set")),F(this,he)&&((Ke=F(this,ee))==null||Ke.push([Ue,p,"set"])));if(F(this,ne).call(this,Ne),F(this,be).call(this,Ne,Re,J),F(this,A)[Ne]=m,J){J.set="replace";let Ye=Ue&&Le(this,z,ot).call(this,Ue)?Ue.__staleWhileFetching:Ue;Ye!==void 0&&(J.oldValue=Ye)}}else J&&(J.set="update")}if(B!==0&&!F(this,oe)&&Le(this,z,$o).call(this),F(this,oe)&&(Te||F(this,ae).call(this,Ne,B,V),J&&F(this,D).call(this,J,Ne)),!ie&&F(this,he)&&F(this,ee)){let Ue=F(this,ee),Ye;for(;Ye=Ue==null?void 0:Ue.shift();)(Xe=F(this,v))==null||Xe.call(this,...Ye)}return this}pop(){var p;try{for(;F(this,I);){let m=F(this,A)[F(this,M)];if(Le(this,z,ln).call(this,!0),Le(this,z,ot).call(this,m)){if(m.__staleWhileFetching)return m.__staleWhileFetching}else if(m!==void 0)return m}}finally{if(F(this,he)&&F(this,ee)){let m=F(this,ee),O;for(;O=m==null?void 0:m.shift();)(p=F(this,v))==null||p.call(this,...O)}}}has(p,m={}){let{updateAgeOnHas:O=this.updateAgeOnHas,status:B}=m,V=F(this,k).get(p);if(V!==void 0){let ie=F(this,A)[V];if(Le(this,z,ot).call(this,ie)&&ie.__staleWhileFetching===void 0)return!1;if(F(this,H).call(this,V))B&&(B.has="stale",F(this,D).call(this,B,V));else return O&&F(this,X).call(this,V),B&&(B.has="hit",F(this,D).call(this,B,V)),!0}else B&&(B.has="miss");return!1}peek(p,m={}){let{allowStale:O=this.allowStale}=m,B=F(this,k).get(p);if(B===void 0||!O&&F(this,H).call(this,B))return;let V=F(this,A)[B];return Le(this,z,ot).call(this,V)?V.__staleWhileFetching:V}async fetch(p,m={}){let{allowStale:O=this.allowStale,updateAgeOnGet:B=this.updateAgeOnGet,noDeleteOnStaleGet:V=this.noDeleteOnStaleGet,ttl:ie=this.ttl,noDisposeOnSet:$=this.noDisposeOnSet,size:J=0,sizeCalculation:Te=this.sizeCalculation,noUpdateTTL:Re=this.noUpdateTTL,noDeleteOnFetchRejection:Ne=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Fe=this.allowStaleOnFetchRejection,ignoreFetchAbort:nt=this.ignoreFetchAbort,allowStaleOnFetchAbort:rt=this.allowStaleOnFetchAbort,context:Ke,forceRefresh:Xe=!1,status:Ue,signal:Ye}=m;if(!F(this,Q))return Ue&&(Ue.fetch="get"),this.get(p,{allowStale:O,updateAgeOnGet:B,noDeleteOnStaleGet:V,status:Ue});let Ze={allowStale:O,updateAgeOnGet:B,noDeleteOnStaleGet:V,ttl:ie,noDisposeOnSet:$,size:J,sizeCalculation:Te,noUpdateTTL:Re,noDeleteOnFetchRejection:Ne,allowStaleOnFetchRejection:Fe,allowStaleOnFetchAbort:rt,ignoreFetchAbort:nt,status:Ue,signal:Ye},lt=F(this,k).get(p);if(lt===void 0){Ue&&(Ue.fetch="miss");let ct=Le(this,z,un).call(this,p,lt,Ze,Ke);return ct.__returned=ct}else{let ct=F(this,A)[lt];if(Le(this,z,ot).call(this,ct)){let Ae=O&&ct.__staleWhileFetching!==void 0;return Ue&&(Ue.fetch="inflight",Ae&&(Ue.returnedStale=!0)),Ae?ct.__staleWhileFetching:ct.__returned=ct}let Et=F(this,H).call(this,lt);if(!Xe&&!Et)return Ue&&(Ue.fetch="hit"),Le(this,z,Sr).call(this,lt),B&&F(this,X).call(this,lt),Ue&&F(this,D).call(this,Ue,lt),ct;let j=Le(this,z,un).call(this,p,lt,Ze,Ke),U=j.__staleWhileFetching!==void 0&&O;return Ue&&(Ue.fetch=Et?"stale":"refresh",U&&Et&&(Ue.returnedStale=!0)),U?j.__staleWhileFetching:j.__returned=j}}async forceFetch(p,m={}){let O=await this.fetch(p,m);if(O===void 0)throw new Error("fetch() returned undefined");return O}memo(p,m={}){let O=F(this,P);if(!O)throw new Error("no memoMethod provided to constructor");let{context:B,forceRefresh:V,...ie}=m,$=this.get(p,ie);if(!V&&$!==void 0)return $;let J=O(p,$,{options:ie,context:B});return this.set(p,J,ie),J}get(p,m={}){let{allowStale:O=this.allowStale,updateAgeOnGet:B=this.updateAgeOnGet,noDeleteOnStaleGet:V=this.noDeleteOnStaleGet,status:ie}=m,$=F(this,k).get(p);if($!==void 0){let J=F(this,A)[$],Te=Le(this,z,ot).call(this,J);return ie&&F(this,D).call(this,ie,$),F(this,H).call(this,$)?(ie&&(ie.get="stale"),Te?(ie&&O&&J.__staleWhileFetching!==void 0&&(ie.returnedStale=!0),O?J.__staleWhileFetching:void 0):(V||Le(this,z,Ht).call(this,p,"expire"),ie&&O&&(ie.returnedStale=!0),O?J:void 0)):(ie&&(ie.get="hit"),Te?J.__staleWhileFetching:(Le(this,z,Sr).call(this,$),B&&F(this,X).call(this,$),J))}else ie&&(ie.get="miss")}delete(p){return Le(this,z,Ht).call(this,p,"delete")}clear(){return Le(this,z,Vo).call(this,"delete")}},g=new WeakMap,_=new WeakMap,E=new WeakMap,v=new WeakMap,C=new WeakMap,P=new WeakMap,I=new WeakMap,T=new WeakMap,k=new WeakMap,W=new WeakMap,A=new WeakMap,N=new WeakMap,q=new WeakMap,M=new WeakMap,le=new WeakMap,re=new WeakMap,ee=new WeakMap,ue=new WeakMap,G=new WeakMap,oe=new WeakMap,R=new WeakMap,Q=new WeakMap,he=new WeakMap,z=new WeakSet,$o=function(){let p=new c(F(this,g)),m=new c(F(this,g));$e(this,oe,p),$e(this,G,m),$e(this,ae,(V,ie,$=l.now())=>{if(m[V]=ie!==0?$:0,p[V]=ie,ie!==0&&this.ttlAutopurge){let J=setTimeout(()=>{F(this,H).call(this,V)&&Le(this,z,Ht).call(this,F(this,W)[V],"expire")},ie+1);J.unref&&J.unref()}}),$e(this,X,V=>{m[V]=p[V]!==0?l.now():0}),$e(this,D,(V,ie)=>{if(p[ie]){let $=p[ie],J=m[ie];if(!$||!J)return;V.ttl=$,V.start=J,V.now=O||B();let Te=V.now-J;V.remainingTTL=$-Te}});let O=0,B=()=>{let V=l.now();if(this.ttlResolution>0){O=V;let ie=setTimeout(()=>O=0,this.ttlResolution);ie.unref&&ie.unref()}return V};this.getRemainingTTL=V=>{let ie=F(this,k).get(V);if(ie===void 0)return 0;let $=p[ie],J=m[ie];if(!$||!J)return 1/0;let Te=(O||B())-J;return $-Te},$e(this,H,V=>{let ie=m[V],$=p[V];return!!$&&!!ie&&(O||B())-ie>$})},X=new WeakMap,D=new WeakMap,ae=new WeakMap,H=new WeakMap,au=function(){let p=new c(F(this,g));$e(this,T,0),$e(this,ue,p),$e(this,ne,m=>{$e(this,T,F(this,T)-p[m]),p[m]=0}),$e(this,ce,(m,O,B,V)=>{if(Le(this,z,ot).call(this,O))return 0;if(!e(B))if(V){if(typeof V!="function")throw new TypeError("sizeCalculation must be a function");if(B=V(O,m),!e(B))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return B}),$e(this,be,(m,O,B)=>{if(p[m]=O,F(this,_)){let V=F(this,_)-p[m];for(;F(this,T)>V;)Le(this,z,ln).call(this,!0)}$e(this,T,F(this,T)+p[m]),B&&(B.entrySize=O,B.totalCalculatedSize=F(this,T))})},ne=new WeakMap,be=new WeakMap,ce=new WeakMap,Vt=function*({allowStale:p=this.allowStale}={}){if(F(this,I))for(let m=F(this,le);!(!Le(this,z,qo).call(this,m)||((p||!F(this,H).call(this,m))&&(yield m),m===F(this,M)));)m=F(this,q)[m]},Kt=function*({allowStale:p=this.allowStale}={}){if(F(this,I))for(let m=F(this,M);!(!Le(this,z,qo).call(this,m)||((p||!F(this,H).call(this,m))&&(yield m),m===F(this,le)));)m=F(this,N)[m]},qo=function(p){return p!==void 0&&F(this,k).get(F(this,W)[p])===p},ln=function(p){var V,ie;let m=F(this,M),O=F(this,W)[m],B=F(this,A)[m];return F(this,Q)&&Le(this,z,ot).call(this,B)?B.__abortController.abort(new Error("evicted")):(F(this,R)||F(this,he))&&(F(this,R)&&((V=F(this,E))==null||V.call(this,B,O,"evict")),F(this,he)&&((ie=F(this,ee))==null||ie.push([B,O,"evict"]))),F(this,ne).call(this,m),p&&(F(this,W)[m]=void 0,F(this,A)[m]=void 0,F(this,re).push(m)),F(this,I)===1?($e(this,M,$e(this,le,0)),F(this,re).length=0):$e(this,M,F(this,N)[m]),F(this,k).delete(O),an(this,I)._--,m},un=function(p,m,O,B){let V=m===void 0?void 0:F(this,A)[m];if(Le(this,z,ot).call(this,V))return V;let ie=new t,{signal:$}=O;$==null||$.addEventListener("abort",()=>ie.abort($.reason),{signal:ie.signal});let J={signal:ie.signal,options:O,context:B},Te=(Ke,Xe=!1)=>{let{aborted:Ue}=ie.signal,Ye=O.ignoreFetchAbort&&Ke!==void 0;if(O.status&&(Ue&&!Xe?(O.status.fetchAborted=!0,O.status.fetchError=ie.signal.reason,Ye&&(O.status.fetchAbortIgnored=!0)):O.status.fetchResolved=!0),Ue&&!Ye&&!Xe)return Ne(ie.signal.reason);let Ze=nt;return F(this,A)[m]===nt&&(Ke===void 0?Ze.__staleWhileFetching?F(this,A)[m]=Ze.__staleWhileFetching:Le(this,z,Ht).call(this,p,"fetch"):(O.status&&(O.status.fetchUpdated=!0),this.set(p,Ke,J.options))),Ke},Re=Ke=>(O.status&&(O.status.fetchRejected=!0,O.status.fetchError=Ke),Ne(Ke)),Ne=Ke=>{let{aborted:Xe}=ie.signal,Ue=Xe&&O.allowStaleOnFetchAbort,Ye=Ue||O.allowStaleOnFetchRejection,Ze=Ye||O.noDeleteOnFetchRejection,lt=nt;if(F(this,A)[m]===nt&&(!Ze||lt.__staleWhileFetching===void 0?Le(this,z,Ht).call(this,p,"fetch"):Ue||(F(this,A)[m]=lt.__staleWhileFetching)),Ye)return O.status&<.__staleWhileFetching!==void 0&&(O.status.returnedStale=!0),lt.__staleWhileFetching;if(lt.__returned===lt)throw Ke},Fe=(Ke,Xe)=>{var Ye;let Ue=(Ye=F(this,C))==null?void 0:Ye.call(this,p,V,J);Ue&&Ue instanceof Promise&&Ue.then(Ze=>Ke(Ze===void 0?void 0:Ze),Xe),ie.signal.addEventListener("abort",()=>{(!O.ignoreFetchAbort||O.allowStaleOnFetchAbort)&&(Ke(void 0),O.allowStaleOnFetchAbort&&(Ke=Ze=>Te(Ze,!0)))})};O.status&&(O.status.fetchDispatched=!0);let nt=new Promise(Fe).then(Te,Re),rt=Object.assign(nt,{__abortController:ie,__staleWhileFetching:V,__returned:void 0});return m===void 0?(this.set(p,rt,{...J.options,status:void 0}),m=F(this,k).get(p)):F(this,A)[m]=rt,rt},ot=function(p){if(!F(this,Q))return!1;let m=p;return!!m&&m instanceof Promise&&m.hasOwnProperty("__staleWhileFetching")&&m.__abortController instanceof t},zo=function(p,m){F(this,q)[m]=p,F(this,N)[p]=m},Sr=function(p){p!==F(this,le)&&(p===F(this,M)?$e(this,M,F(this,N)[p]):Le(this,z,zo).call(this,F(this,q)[p],F(this,N)[p]),Le(this,z,zo).call(this,F(this,le),p),$e(this,le,p))},Ht=function(p,m){var B,V,ie,$;let O=!1;if(F(this,I)!==0){let J=F(this,k).get(p);if(J!==void 0)if(O=!0,F(this,I)===1)Le(this,z,Vo).call(this,m);else{F(this,ne).call(this,J);let Te=F(this,A)[J];if(Le(this,z,ot).call(this,Te)?Te.__abortController.abort(new Error("deleted")):(F(this,R)||F(this,he))&&(F(this,R)&&((B=F(this,E))==null||B.call(this,Te,p,m)),F(this,he)&&((V=F(this,ee))==null||V.push([Te,p,m]))),F(this,k).delete(p),F(this,W)[J]=void 0,F(this,A)[J]=void 0,J===F(this,le))$e(this,le,F(this,q)[J]);else if(J===F(this,M))$e(this,M,F(this,N)[J]);else{let Re=F(this,q)[J];F(this,N)[Re]=F(this,N)[J];let Ne=F(this,N)[J];F(this,q)[Ne]=F(this,q)[J]}an(this,I)._--,F(this,re).push(J)}}if(F(this,he)&&((ie=F(this,ee))!=null&&ie.length)){let J=F(this,ee),Te;for(;Te=J==null?void 0:J.shift();)($=F(this,v))==null||$.call(this,...Te)}return O},Vo=function(p){var m,O,B;for(let V of Le(this,z,Kt).call(this,{allowStale:!0})){let ie=F(this,A)[V];if(Le(this,z,ot).call(this,ie))ie.__abortController.abort(new Error("deleted"));else{let $=F(this,W)[V];F(this,R)&&((m=F(this,E))==null||m.call(this,ie,$,p)),F(this,he)&&((O=F(this,ee))==null||O.push([ie,$,p]))}}if(F(this,k).clear(),F(this,A).fill(void 0),F(this,W).fill(void 0),F(this,oe)&&F(this,G)&&(F(this,oe).fill(0),F(this,G).fill(0)),F(this,ue)&&F(this,ue).fill(0),$e(this,M,0),$e(this,le,0),F(this,re).length=0,$e(this,T,0),$e(this,I,0),F(this,he)&&F(this,ee)){let V=F(this,ee),ie;for(;ie=V==null?void 0:V.shift();)(B=F(this,v))==null||B.call(this,...ie)}},De);o.LRUCache=d}),Mt=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.ContainerIterator=o.Container=o.Base=void 0;var l=class{constructor(u=0){this.iteratorType=u}equals(u){return this.o===u.o}};o.ContainerIterator=l;var a=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};o.Base=a;var s=class extends a{};o.Container=s}),Xu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Mt(),a=class extends l.Base{constructor(u=[]){super(),this.S=[];let t=this;u.forEach(function(r){t.push(r)})}clear(){this.i=0,this.S=[]}push(u){return this.S.push(u),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},s=a;o.default=s}),Zu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Mt(),a=class extends l.Base{constructor(u=[]){super(),this.j=0,this.q=[];let t=this;u.forEach(function(r){t.push(r)})}clear(){this.q=[],this.i=this.j=0}push(u){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let r=this.i;for(let n=0;n<r;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=u}else this.q[this.j+this.i]=u;return++this.i}pop(){if(this.i===0)return;let u=this.q[this.j++];return this.i-=1,u}front(){if(this.i!==0)return this.q[this.j]}},s=a;o.default=s}),ec=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Mt(),a=class extends l.Base{constructor(u=[],t=function(n,e){return n>e?-1:n<e?1:0},r=!0){if(super(),this.v=t,Array.isArray(u))this.C=r?[...u]:u;else{this.C=[];let e=this;u.forEach(function(i){e.C.push(i)})}this.i=this.C.length;let n=this.i>>1;for(let e=this.i-1>>1;e>=0;--e)this.k(e,n)}m(u){let t=this.C[u];for(;u>0;){let r=u-1>>1,n=this.C[r];if(this.v(n,t)<=0)break;this.C[u]=n,u=r}this.C[u]=t}k(u,t){let r=this.C[u];for(;u<t;){let n=u<<1|1,e=n+1,i=this.C[n];if(e<this.i&&this.v(i,this.C[e])>0&&(n=e,i=this.C[e]),this.v(i,r)>=0)break;this.C[u]=i,u=n}this.C[u]=r}clear(){this.i=0,this.C.length=0}push(u){this.C.push(u),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let u=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),u}top(){return this.C[0]}find(u){return this.C.indexOf(u)>=0}remove(u){let t=this.C.indexOf(u);return t<0?!1:(t===0?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(u){let t=this.C.indexOf(u);return t<0?!1:(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}},s=a;o.default=s}),Ti=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Mt(),a=class extends l.Container{},s=a;o.default=s}),Bt=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.throwIteratorAccessError=l;function l(){throw new RangeError("Iterator access denied!")}}),Es=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.RandomIterator=void 0;var l=Mt(),a=Bt(),s=class extends l.ContainerIterator{constructor(u,t){super(t),this.o=u,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,a.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,a.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,a.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,a.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(u){this.container.setElementByPos(this.o,u)}};o.RandomIterator=s}),tc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=s(Ti()),a=Es();function s(n){return n&&n.t?n:{default:n}}var u=class lu extends a.RandomIterator{constructor(e,i,c){super(e,c),this.container=i}copy(){return new lu(this.o,this.container,this.iteratorType)}},t=class extends l.default{constructor(n=[],e=!0){if(super(),Array.isArray(n))this.J=e?[...n]:n,this.i=n.length;else{this.J=[];let i=this;n.forEach(function(c){i.pushBack(c)})}}clear(){this.i=0,this.J.length=0}begin(){return new u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J[n]}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J.splice(n,1),this.i-=1,this.i}eraseElementByValue(n){let e=0;for(let i=0;i<this.i;++i)this.J[i]!==n&&(this.J[e++]=this.J[i]);return this.i=this.J.length=e,this.i}eraseElementByIterator(n){let e=n.o;return n=n.next(),this.eraseElementByPos(e),n}pushBack(n){return this.J.push(n),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(n,e){if(n<0||n>this.i-1)throw new RangeError;this.J[n]=e}insert(n,e,i=1){if(n<0||n>this.i)throw new RangeError;return this.J.splice(n,0,...new Array(i).fill(e)),this.i+=i,this.i}find(n){for(let e=0;e<this.i;++e)if(this.J[e]===n)return new u(e,this);return this.end()}reverse(){this.J.reverse()}unique(){let n=1;for(let e=1;e<this.i;++e)this.J[e]!==this.J[e-1]&&(this.J[n++]=this.J[e]);return this.i=this.J.length=n,this.i}sort(n){this.J.sort(n)}forEach(n){for(let e=0;e<this.i;++e)n(this.J[e],e,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},r=t;o.default=r}),rc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(Ti()),a=Mt(),s=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class uu extends a.ContainerIterator{constructor(i,c,h,d){super(d),this.o=i,this.h=c,this.container=h,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o.l}set pointer(i){this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o.l=i}copy(){return new uu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let i=this;e.forEach(function(c){i.pushBack(c)})}V(e){let{L:i,B:c}=e;i.B=c,c.L=i,e===this.p&&(this.p=c),e===this._&&(this._=i),this.i-=1}G(e,i){let c=i.B,h={l:e,L:i,B:c};i.B=h,c.L=h,i===this.h&&(this.p=h),c===this.h&&(this._=h),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new t(this.p,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this._,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return i.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return this.V(i),this.i}eraseElementByValue(e){let i=this.p;for(;i!==this.h;)i.l===e&&this.V(i),i=i.B;return this.i}eraseElementByIterator(e){let i=e.o;return i===this.h&&(0,s.throwIteratorAccessError)(),e=e.next(),this.V(i),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(this.i===0)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(this.i===0)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,i){if(e<0||e>this.i-1)throw new RangeError;let c=this.p;for(;e--;)c=c.B;c.l=i}insert(e,i,c=1){if(e<0||e>this.i)throw new RangeError;if(c<=0)return this.i;if(e===0)for(;c--;)this.pushFront(i);else if(e===this.i)for(;c--;)this.pushBack(i);else{let h=this.p;for(let y=1;y<e;++y)h=h.B;let d=h.B;for(this.i+=c;c--;)h.B={l:i,L:h},h.B.L=h,h=h.B;h.B=d,d.L=h}return this.i}find(e){let i=this.p;for(;i!==this.h;){if(i.l===e)return new t(i,this.h,this);i=i.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,i=this._,c=0;for(;c<<1<this.i;){let h=e.l;e.l=i.l,i.l=h,e=e.B,i=i.L,c+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let i=e;for(;i.B!==this.h&&i.l===i.B.l;)i=i.B,this.i-=1;e.B=i.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let i=[];this.forEach(function(h){i.push(h)}),i.sort(e);let c=this.p;i.forEach(function(h){c.l=h,c=c.B})}merge(e){let i=this;if(this.i===0)e.forEach(function(c){i.pushBack(c)});else{let c=this.p;e.forEach(function(h){for(;c!==i.h&&c.l<=h;)c=c.B;i.G(h,c.L)})}return this.i}forEach(e){let i=this.p,c=0;for(;i!==this.h;)e(i.l,c++,this),i=i.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}).bind(this)()}},n=r;o.default=n}),nc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=s(Ti()),a=Es();function s(n){return n&&n.t?n:{default:n}}var u=class cu extends a.RandomIterator{constructor(e,i,c){super(e,c),this.container=i}copy(){return new cu(this.o,this.container,this.iteratorType)}},t=class extends l.default{constructor(n=[],e=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let i=(()=>{if(typeof n.length=="number")return n.length;if(typeof n.size=="number")return n.size;if(typeof n.size=="function")return n.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=e,this.P=Math.max(Math.ceil(i/this.F),1);for(let d=0;d<this.P;++d)this.A.push(new Array(this.F));let c=Math.ceil(i/this.F);this.j=this.R=(this.P>>1)-(c>>1),this.D=this.N=this.F-i%this.F>>1;let h=this;n.forEach(function(d){h.pushBack(d)})}T(){let n=[],e=Math.max(this.P>>1,1);for(let i=0;i<e;++i)n[i]=new Array(this.F);for(let i=this.j;i<this.P;++i)n[n.length]=this.A[i];for(let i=0;i<this.R;++i)n[n.length]=this.A[i];n[n.length]=[...this.A[this.R]],this.j=e,this.R=n.length-1;for(let i=0;i<e;++i)n[n.length]=new Array(this.F);this.A=n,this.P=n.length}O(n){let e=this.D+n+1,i=e%this.F,c=i-1,h=this.j+(e-i)/this.F;return i===0&&(h-=1),h%=this.P,c<0&&(c+=this.F),{curNodeBucketIndex:h,curNodePointerIndex:c}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(n){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=n,this.i}popBack(){if(this.i===0)return;let n=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,n}pushFront(n){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=n,this.i}popFront(){if(this.i===0)return;let n=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,n}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:e,curNodePointerIndex:i}=this.O(n);return this.A[e][i]}setElementByPos(n,e){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:i,curNodePointerIndex:c}=this.O(n);this.A[i][c]=e}insert(n,e,i=1){if(n<0||n>this.i)throw new RangeError;if(n===0)for(;i--;)this.pushFront(e);else if(n===this.i)for(;i--;)this.pushBack(e);else{let c=[];for(let h=n;h<this.i;++h)c.push(this.getElementByPos(h));this.cut(n-1);for(let h=0;h<i;++h)this.pushBack(e);for(let h=0;h<c.length;++h)this.pushBack(c[h])}return this.i}cut(n){if(n<0)return this.clear(),0;let{curNodeBucketIndex:e,curNodePointerIndex:i}=this.O(n);return this.R=e,this.N=i,this.i=n+1,this.i}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;if(n===0)this.popFront();else if(n===this.i-1)this.popBack();else{let e=[];for(let c=n+1;c<this.i;++c)e.push(this.getElementByPos(c));this.cut(n),this.popBack();let i=this;e.forEach(function(c){i.pushBack(c)})}return this.i}eraseElementByValue(n){if(this.i===0)return 0;let e=[];for(let c=0;c<this.i;++c){let h=this.getElementByPos(c);h!==n&&e.push(h)}let i=e.length;for(let c=0;c<i;++c)this.setElementByPos(c,e[c]);return this.cut(i-1)}eraseElementByIterator(n){let e=n.o;return this.eraseElementByPos(e),n=n.next(),n}find(n){for(let e=0;e<this.i;++e)if(this.getElementByPos(e)===n)return new u(e,this);return this.end()}reverse(){let n=0,e=this.i-1;for(;n<e;){let i=this.getElementByPos(n);this.setElementByPos(n,this.getElementByPos(e)),this.setElementByPos(e,i),n+=1,e-=1}}unique(){if(this.i<=1)return this.i;let n=1,e=this.getElementByPos(0);for(let i=1;i<this.i;++i){let c=this.getElementByPos(i);c!==e&&(e=c,this.setElementByPos(n++,c))}for(;this.i>n;)this.popBack();return this.i}sort(n){let e=[];for(let i=0;i<this.i;++i)e.push(this.getElementByPos(i));e.sort(n);for(let i=0;i<this.i;++i)this.setElementByPos(i,e[i])}shrinkToFit(){if(this.i===0)return;let n=[];this.forEach(function(e){n.push(e)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let e=0;e<this.P;++e)this.A.push(new Array(this.F));for(let e=0;e<n.length;++e)this.pushBack(n[e])}forEach(n){for(let e=0;e<this.i;++e)n(this.getElementByPos(e),e,this)}[Symbol.iterator](){return(function*(){for(let n=0;n<this.i;++n)yield this.getElementByPos(n)}).bind(this)()}},r=t;o.default=r}),ic=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.TreeNodeEnableIndex=o.TreeNode=void 0;var l=class{constructor(s,u){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=s,this.l=u}L(){let s=this;if(s.ee===1&&s.tt.tt===s)s=s.W;else if(s.U)for(s=s.U;s.W;)s=s.W;else{let u=s.tt;for(;u.U===s;)s=u,u=s.tt;s=u}return s}B(){let s=this;if(s.W){for(s=s.W;s.U;)s=s.U;return s}else{let u=s.tt;for(;u.W===s;)s=u,u=s.tt;return s.W!==u?u:s}}te(){let s=this.tt,u=this.W,t=u.U;return s.tt===this?s.tt=u:s.U===this?s.U=u:s.W=u,u.tt=s,u.U=this,this.tt=u,this.W=t,t&&(t.tt=this),u}se(){let s=this.tt,u=this.U,t=u.W;return s.tt===this?s.tt=u:s.U===this?s.U=u:s.W=u,u.tt=s,u.W=this,this.tt=u,this.U=t,t&&(t.tt=this),u}};o.TreeNode=l;var a=class extends l{constructor(){super(...arguments),this.rt=1}te(){let s=super.te();return this.ie(),s.ie(),s}se(){let s=super.se();return this.ie(),s.ie(),s}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};o.TreeNodeEnableIndex=a}),xs=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=ic(),a=Mt(),s=Bt(),u=class extends a.Container{constructor(r=function(e,i){return e<i?-1:e>i?1:0},n=!1){super(),this.Y=void 0,this.v=r,n?(this.re=l.TreeNodeEnableIndex,this.M=function(e,i,c){let h=this.ne(e,i,c);if(h){let d=h.tt;for(;d!==this.h;)d.rt+=1,d=d.tt;let y=this.he(h);if(y){let{parentNode:b,grandParent:S,curNode:w}=y;b.ie(),S.ie(),w.ie()}}return this.i},this.V=function(e){let i=this.fe(e);for(;i!==this.h;)i.rt-=1,i=i.tt}):(this.re=l.TreeNode,this.M=function(e,i,c){let h=this.ne(e,i,c);return h&&this.he(h),this.i},this.V=this.fe),this.h=new this.re}X(r,n){let e=this.h;for(;r;){let i=this.v(r.u,n);if(i<0)r=r.W;else if(i>0)e=r,r=r.U;else return r}return e}Z(r,n){let e=this.h;for(;r;)this.v(r.u,n)<=0?r=r.W:(e=r,r=r.U);return e}$(r,n){let e=this.h;for(;r;){let i=this.v(r.u,n);if(i<0)e=r,r=r.W;else if(i>0)r=r.U;else return r}return e}rr(r,n){let e=this.h;for(;r;)this.v(r.u,n)<0?(e=r,r=r.W):r=r.U;return e}ue(r){for(;;){let n=r.tt;if(n===this.h)return;if(r.ee===1){r.ee=0;return}if(r===n.U){let e=n.W;if(e.ee===1)e.ee=0,n.ee=1,n===this.Y?this.Y=n.te():n.te();else if(e.W&&e.W.ee===1){e.ee=n.ee,n.ee=0,e.W.ee=0,n===this.Y?this.Y=n.te():n.te();return}else e.U&&e.U.ee===1?(e.ee=1,e.U.ee=0,e.se()):(e.ee=1,r=n)}else{let e=n.U;if(e.ee===1)e.ee=0,n.ee=1,n===this.Y?this.Y=n.se():n.se();else if(e.U&&e.U.ee===1){e.ee=n.ee,n.ee=0,e.U.ee=0,n===this.Y?this.Y=n.se():n.se();return}else e.W&&e.W.ee===1?(e.ee=1,e.W.ee=0,e.te()):(e.ee=1,r=n)}}}fe(r){if(this.i===1)return this.clear(),this.h;let n=r;for(;n.U||n.W;){if(n.W)for(n=n.W;n.U;)n=n.U;else n=n.U;[r.u,n.u]=[n.u,r.u],[r.l,n.l]=[n.l,r.l],r=n}this.h.U===n?this.h.U=n.tt:this.h.W===n&&(this.h.W=n.tt),this.ue(n);let e=n.tt;return n===e.U?e.U=void 0:e.W=void 0,this.i-=1,this.Y.ee=0,e}oe(r,n){return r===void 0?!1:this.oe(r.U,n)||n(r)?!0:this.oe(r.W,n)}he(r){for(;;){let n=r.tt;if(n.ee===0)return;let e=n.tt;if(n===e.U){let i=e.W;if(i&&i.ee===1){if(i.ee=n.ee=0,e===this.Y)return;e.ee=1,r=e;continue}else if(r===n.W){if(r.ee=0,r.U&&(r.U.tt=n),r.W&&(r.W.tt=e),n.W=r.U,e.U=r.W,r.U=n,r.W=e,e===this.Y)this.Y=r,this.h.tt=r;else{let c=e.tt;c.U===e?c.U=r:c.W=r}return r.tt=e.tt,n.tt=r,e.tt=r,e.ee=1,{parentNode:n,grandParent:e,curNode:r}}else n.ee=0,e===this.Y?this.Y=e.se():e.se(),e.ee=1}else{let i=e.U;if(i&&i.ee===1){if(i.ee=n.ee=0,e===this.Y)return;e.ee=1,r=e;continue}else if(r===n.U){if(r.ee=0,r.U&&(r.U.tt=e),r.W&&(r.W.tt=n),e.W=r.U,n.U=r.W,r.U=e,r.W=n,e===this.Y)this.Y=r,this.h.tt=r;else{let c=e.tt;c.U===e?c.U=r:c.W=r}return r.tt=e.tt,n.tt=r,e.tt=r,e.ee=1,{parentNode:n,grandParent:e,curNode:r}}else n.ee=0,e===this.Y?this.Y=e.te():e.te(),e.ee=1}return}}ne(r,n,e){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,n),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let i,c=this.h.U,h=this.v(c.u,r);if(h===0){c.l=n;return}else if(h>0)c.U=new this.re(r,n),c.U.tt=c,i=c.U,this.h.U=i;else{let d=this.h.W,y=this.v(d.u,r);if(y===0){d.l=n;return}else if(y<0)d.W=new this.re(r,n),d.W.tt=d,i=d.W,this.h.W=i;else{if(e!==void 0){let b=e.o;if(b!==this.h){let S=this.v(b.u,r);if(S===0){b.l=n;return}else if(S>0){let w=b.L(),x=this.v(w.u,r);if(x===0){w.l=n;return}else x<0&&(i=new this.re(r,n),w.W===void 0?(w.W=i,i.tt=w):(b.U=i,i.tt=b))}}}if(i===void 0)for(i=this.Y;;){let b=this.v(i.u,r);if(b>0){if(i.U===void 0){i.U=new this.re(r,n),i.U.tt=i,i=i.U;break}i=i.U}else if(b<0){if(i.W===void 0){i.W=new this.re(r,n),i.W.tt=i,i=i.W;break}i=i.W}else{i.l=n;return}}}}return this.i+=1,i}I(r,n){for(;r;){let e=this.v(r.u,n);if(e<0)r=r.W;else if(e>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,n){let e=r.o;if(e===this.h&&(0,s.throwIteratorAccessError)(),this.i===1)return e.u=n,!0;if(e===this.h.U)return this.v(e.B().u,n)>0?(e.u=n,!0):!1;if(e===this.h.W)return this.v(e.L().u,n)<0?(e.u=n,!0):!1;let i=e.L().u;if(this.v(i,n)>=0)return!1;let c=e.B().u;return this.v(c,n)<=0?!1:(e.u=n,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n=0,e=this;return this.oe(this.Y,function(i){return r===n?(e.V(i),!0):(n+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let n=this.I(this.Y,r);return n===this.h?!1:(this.V(n),!0)}eraseElementByIterator(r){let n=r.o;n===this.h&&(0,s.throwIteratorAccessError)();let e=n.W===void 0;return r.iteratorType===0?e&&r.next():(!e||n.U===void 0)&&r.next(),this.V(n),r}forEach(r){let n=0;for(let e of this)r(e,n++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n,e=0;for(let i of this){if(e===r){n=i;break}e+=1}return n}getHeight(){if(this.i===0)return 0;let r=function(n){return n?Math.max(r(n.U),r(n.W))+1:0};return r(this.Y)}},t=u;o.default=t}),As=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Mt(),a=Bt(),s=class extends l.ContainerIterator{constructor(t,r,n){super(n),this.o=t,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,a.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,a.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let t=this.o,r=this.h.tt;if(t===this.h)return r?r.rt-1:0;let n=0;for(t.U&&(n+=t.U.rt);t!==r;){let e=t.tt;t===e.W&&(n+=1,e.U&&(n+=e.U.rt)),t=e}return n}},u=s;o.default=u}),oc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(xs()),a=u(As()),s=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class fu extends a.default{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o.u}copy(){return new fu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[],i,c){super(i,c);let h=this;e.forEach(function(d){h.insert(d)})}*K(e){e!==void 0&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new t(this.h.U||this.h,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this.h.W||this.h,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,i){return this.M(e,void 0,i)}find(e){let i=this.I(this.Y,e);return new t(i,this.h,this)}lowerBound(e){let i=this.X(this.Y,e);return new t(i,this.h,this)}upperBound(e){let i=this.Z(this.Y,e);return new t(i,this.h,this)}reverseLowerBound(e){let i=this.$(this.Y,e);return new t(i,this.h,this)}reverseUpperBound(e){let i=this.rr(this.Y,e);return new t(i,this.h,this)}union(e){let i=this;return e.forEach(function(c){i.insert(c)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=r;o.default=n}),sc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(xs()),a=u(As()),s=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class hu extends a.default{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){this.o===this.h&&(0,s.throwIteratorAccessError)();let i=this;return new Proxy([],{get(c,h){if(h==="0")return i.o.u;if(h==="1")return i.o.l},set(c,h,d){if(h!=="1")throw new TypeError("props must be 1");return i.o.l=d,!0}})}copy(){return new hu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[],i,c){super(i,c);let h=this;e.forEach(function(d){h.setElement(d[0],d[1])})}*K(e){e!==void 0&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new t(this.h.U||this.h,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this.h.W||this.h,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){if(this.i===0)return;let e=this.h.U;return[e.u,e.l]}back(){if(this.i===0)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let i=this.X(this.Y,e);return new t(i,this.h,this)}upperBound(e){let i=this.Z(this.Y,e);return new t(i,this.h,this)}reverseLowerBound(e){let i=this.$(this.Y,e);return new t(i,this.h,this)}reverseUpperBound(e){let i=this.rr(this.Y,e);return new t(i,this.h,this)}setElement(e,i,c){return this.M(e,i,c)}find(e){let i=this.I(this.Y,e);return new t(i,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let i=this;return e.forEach(function(c){i.setElement(c[0],c[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=r;o.default=n}),Is=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=l;function l(a){let s=typeof a;return s==="object"&&a!==null||s==="function"}}),ks=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.HashContainerIterator=o.HashContainer=void 0;var l=Mt(),a=u(Is()),s=Bt();function u(n){return n&&n.t?n:{default:n}}var t=class extends l.ContainerIterator{constructor(n,e,i){super(i),this.o=n,this.h=e,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.L,this})}};o.HashContainerIterator=t;var r=class extends l.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(n){let{L:e,B:i}=n;e.B=i,i.L=e,n===this.p&&(this.p=i),n===this._&&(this._=e),this.i-=1}M(n,e,i){i===void 0&&(i=(0,a.default)(n));let c;if(i){let h=n[this.HASH_TAG];if(h!==void 0)return this.H[h].l=e,this.i;Object.defineProperty(n,this.HASH_TAG,{value:this.H.length,configurable:!0}),c={u:n,l:e,L:this._,B:this.h},this.H.push(c)}else{let h=this.g[n];if(h)return h.l=e,this.i;c={u:n,l:e,L:this._,B:this.h},this.g[n]=c}return this.i===0?(this.p=c,this.h.B=c):this._.B=c,this._=c,this.h.L=c,++this.i}I(n,e){if(e===void 0&&(e=(0,a.default)(n)),e){let i=n[this.HASH_TAG];return i===void 0?this.h:this.H[i]}else return this.g[n]||this.h}clear(){let n=this.HASH_TAG;this.H.forEach(function(e){delete e.u[n]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(n,e){let i;if(e===void 0&&(e=(0,a.default)(n)),e){let c=n[this.HASH_TAG];if(c===void 0)return!1;delete n[this.HASH_TAG],i=this.H[c],delete this.H[c]}else{if(i=this.g[n],i===void 0)return!1;delete this.g[n]}return this.V(i),!0}eraseElementByIterator(n){let e=n.o;return e===this.h&&(0,s.throwIteratorAccessError)(),this.V(e),n.next()}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let e=this.p;for(;n--;)e=e.B;return this.V(e),this.i}};o.HashContainer=r}),ac=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=ks(),a=Bt(),s=class pu extends l.HashContainerIterator{constructor(n,e,i,c){super(n,e,c),this.container=i}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new pu(this.o,this.h,this.container,this.iteratorType)}},u=class extends l.HashContainer{constructor(r=[]){super();let n=this;r.forEach(function(e){n.insert(e)})}begin(){return new s(this.p,this.h,this)}end(){return new s(this.h,this.h,this)}rBegin(){return new s(this._,this.h,this,1)}rEnd(){return new s(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(r,n){return this.M(r,void 0,n)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n=this.p;for(;r--;)n=n.B;return n.u}find(r,n){let e=this.I(r,n);return new s(e,this.h,this)}forEach(r){let n=0,e=this.p;for(;e!==this.h;)r(e.u,n++,this),e=e.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}},t=u;o.default=t}),lc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=ks(),a=u(Is()),s=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class du extends l.HashContainerIterator{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){this.o===this.h&&(0,s.throwIteratorAccessError)();let i=this;return new Proxy([],{get(c,h){if(h==="0")return i.o.u;if(h==="1")return i.o.l},set(c,h,d){if(h!=="1")throw new TypeError("props must be 1");return i.o.l=d,!0}})}copy(){return new du(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.HashContainer{constructor(e=[]){super();let i=this;e.forEach(function(c){i.setElement(c[0],c[1])})}begin(){return new t(this.p,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this._,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(e,i,c){return this.M(e,i,c)}getElementByKey(e,i){if(i===void 0&&(i=(0,a.default)(e)),i){let h=e[this.HASH_TAG];return h!==void 0?this.H[h].l:void 0}let c=this.g[e];return c?c.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return[i.u,i.l]}find(e,i){let c=this.I(e,i);return new t(c,this.h,this)}forEach(e){let i=0,c=this.p;for(;c!==this.h;)e([c.u,c.l],i++,this),c=c.B}[Symbol.iterator](){return(function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}).bind(this)()}},n=r;o.default=n}),uc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),Object.defineProperty(o,"Deque",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(o,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(o,"HashSet",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(o,"LinkList",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(o,"OrderedMap",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(o,"OrderedSet",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(o,"PriorityQueue",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(o,"Queue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(o,"Stack",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(o,"Vector",{enumerable:!0,get:function(){return u.default}});var l=h(Xu()),a=h(Zu()),s=h(ec()),u=h(tc()),t=h(rc()),r=h(nc()),n=h(oc()),e=h(sc()),i=h(ac()),c=h(lc());function h(d){return d&&d.t?d:{default:d}}}),cc=we((o,l)=>{de(),ye(),ge();var a=uc().OrderedSet,s=Nt()("number-allocator:trace"),u=Nt()("number-allocator:error");function t(n,e){this.low=n,this.high=e}t.prototype.equals=function(n){return this.low===n.low&&this.high===n.high},t.prototype.compare=function(n){return this.low<n.low&&this.high<n.low?-1:n.low<this.low&&n.high<this.low?1:0};function r(n,e){if(!(this instanceof r))return new r(n,e);this.min=n,this.max=e,this.ss=new a([],(i,c)=>i.compare(c)),s("Create"),this.clear()}r.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},r.prototype.alloc=function(){if(this.ss.size()===0)return s("alloc():empty"),null;let n=this.ss.begin(),e=n.pointer.low,i=n.pointer.high,c=e;return c+1<=i?this.ss.updateKeyByIterator(n,new t(e+1,i)):this.ss.eraseElementByPos(0),s("alloc():"+c),c},r.prototype.use=function(n){let e=new t(n,n),i=this.ss.lowerBound(e);if(!i.equals(this.ss.end())){let c=i.pointer.low,h=i.pointer.high;return i.pointer.equals(e)?(this.ss.eraseElementByIterator(i),s("use():"+n),!0):c>n?!1:c===n?(this.ss.updateKeyByIterator(i,new t(c+1,h)),s("use():"+n),!0):h===n?(this.ss.updateKeyByIterator(i,new t(c,h-1)),s("use():"+n),!0):(this.ss.updateKeyByIterator(i,new t(n+1,h)),this.ss.insert(new t(c,n-1)),s("use():"+n),!0)}return s("use():failed"),!1},r.prototype.free=function(n){if(n<this.min||n>this.max){u("free():"+n+" is out of range");return}let e=new t(n,n),i=this.ss.upperBound(e);if(i.equals(this.ss.end())){if(i.equals(this.ss.begin())){this.ss.insert(e);return}i.pre();let c=i.pointer.high;i.pointer.high+1===n?this.ss.updateKeyByIterator(i,new t(c,n)):this.ss.insert(e)}else if(i.equals(this.ss.begin()))if(n+1===i.pointer.low){let c=i.pointer.high;this.ss.updateKeyByIterator(i,new t(n,c))}else this.ss.insert(e);else{let c=i.pointer.low,h=i.pointer.high;i.pre();let d=i.pointer.low;i.pointer.high+1===n?n+1===c?(this.ss.eraseElementByIterator(i),this.ss.updateKeyByIterator(i,new t(d,h))):this.ss.updateKeyByIterator(i,new t(d,n)):n+1===c?(this.ss.eraseElementByIterator(i.next()),this.ss.insert(new t(n,h))):this.ss.insert(e)}s("free():"+n)},r.prototype.clear=function(){s("clear()"),this.ss.clear(),this.ss.insert(new t(this.min,this.max))},r.prototype.intervalCount=function(){return this.ss.size()},r.prototype.dump=function(){console.log("length:"+this.ss.size());for(let n of this.ss)console.log(n)},l.exports=r}),Os=we((o,l)=>{de(),ye(),ge();var a=cc();l.exports.NumberAllocator=a}),fc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Ju(),a=Os(),s=class{constructor(u){Pe(this,"aliasToTopic");Pe(this,"topicToAlias");Pe(this,"max");Pe(this,"numberAllocator");Pe(this,"length");u>0&&(this.aliasToTopic=new l.LRUCache({max:u}),this.topicToAlias={},this.numberAllocator=new a.NumberAllocator(1,u),this.max=u,this.length=0)}put(u,t){if(t===0||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,u),this.topicToAlias[u]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(u){return this.aliasToTopic.get(u)}getAliasByTopic(u){let t=this.topicToAlias[u];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]}};o.default=s}),hc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(o,"__esModule",{value:!0});var a=Tr(),s=l(fc()),u=ar(),t=(r,n)=>{r.log("_handleConnack");let{options:e}=r,i=e.protocolVersion===5?n.reasonCode:n.returnCode;if(clearTimeout(r.connackTimer),delete r.topicAliasSend,n.properties){if(n.properties.topicAliasMaximum){if(n.properties.topicAliasMaximum>65535){r.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}n.properties.topicAliasMaximum>0&&(r.topicAliasSend=new s.default(n.properties.topicAliasMaximum))}n.properties.serverKeepAlive&&e.keepalive&&(e.keepalive=n.properties.serverKeepAlive),n.properties.maximumPacketSize&&(e.properties||(e.properties={}),e.properties.maximumPacketSize=n.properties.maximumPacketSize)}if(i===0)r.reconnecting=!1,r._onConnect(n);else if(i>0){let c=new u.ErrorWithReasonCode(`Connection refused: ${a.ReasonCodes[i]}`,i);r.emit("error",c),r.options.reconnectOnConnackError&&r._cleanUp(!0)}};o.default=t}),pc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(a,s,u)=>{a.log("handling pubrel packet");let t=typeof u<"u"?u:a.noop,{messageId:r}=s,n={cmd:"pubcomp",messageId:r};a.incomingStore.get(s,(e,i)=>{e?a._sendPacket(n,t):(a.emit("message",i.topic,i.payload,i),a.handleMessage(i,c=>{if(c)return t(c);a.incomingStore.del(i,a.noop),a._sendPacket(n,t)}))})};o.default=l}),dc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0});var a=l(Gu()),s=l(Qu()),u=l(hc()),t=l(Tr()),r=l(pc()),n=(e,i,c)=>{let{options:h}=e;if(h.protocolVersion===5&&h.properties&&h.properties.maximumPacketSize&&h.properties.maximumPacketSize<i.length)return e.emit("error",new Error(`exceeding packets size ${i.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",i),i.cmd){case"publish":(0,a.default)(e,i,c);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,t.default)(e,i),c();break;case"pubrel":e.reschedulePing(),(0,r.default)(e,i,c);break;case"connack":(0,u.default)(e,i),c();break;case"auth":e.reschedulePing(),(0,s.default)(e,i),c();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),c();break;case"disconnect":e.emit("disconnect",i),c();break;default:e.log("_handlePacket :: unknown command"),c();break}};o.default=n}),Ts=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=class{constructor(){Pe(this,"nextId");this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let a=this.nextId++;return this.nextId===65536&&(this.nextId=1),a}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(a){return!0}deallocate(a){}clear(){}};o.default=l}),gc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=class{constructor(a){Pe(this,"aliasToTopic");Pe(this,"max");Pe(this,"length");this.aliasToTopic={},this.max=a}put(a,s){return s===0||s>this.max?!1:(this.aliasToTopic[s]=a,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(a){return this.aliasToTopic[a]}clear(){this.aliasToTopic={}}};o.default=l}),yc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(o,"__esModule",{value:!0}),o.TypedEventEmitter=void 0;var a=l((Qt(),tt(Ft))),s=ar(),u=class{};o.TypedEventEmitter=u,(0,s.applyMixin)(u,a.default)}),Pr=we((o,l)=>{de(),ye(),ge();function a(s){"@babel/helpers - typeof";return l.exports=a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},l.exports.__esModule=!0,l.exports.default=l.exports,a(s)}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),mc=we((o,l)=>{de(),ye(),ge();var a=Pr().default;function s(u,t){if(a(u)!="object"||!u)return u;var r=u[Symbol.toPrimitive];if(r!==void 0){var n=r.call(u,t||"default");if(a(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(u)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),bc=we((o,l)=>{de(),ye(),ge();var a=Pr().default,s=mc();function u(t){var r=s(t,"string");return a(r)=="symbol"?r:r+""}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),vc=we((o,l)=>{de(),ye(),ge();var a=bc();function s(u,t,r){return(t=a(t))in u?Object.defineProperty(u,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[t]=r,u}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),wc=we((o,l)=>{de(),ye(),ge();function a(s){if(Array.isArray(s))return s}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),_c=we((o,l)=>{de(),ye(),ge();function a(s,u){var t=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(t!=null){var r,n,e,i,c=[],h=!0,d=!1;try{if(e=(t=t.call(s)).next,u===0){if(Object(t)!==t)return;h=!1}else for(;!(h=(r=e.call(t)).done)&&(c.push(r.value),c.length!==u);h=!0);}catch(y){d=!0,n=y}finally{try{if(!h&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(d)throw n}}return c}}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Sc=we((o,l)=>{de(),ye(),ge();function a(s,u){(u==null||u>s.length)&&(u=s.length);for(var t=0,r=Array(u);t<u;t++)r[t]=s[t];return r}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Ec=we((o,l)=>{de(),ye(),ge();var a=Sc();function s(u,t){if(u){if(typeof u=="string")return a(u,t);var r={}.toString.call(u).slice(8,-1);return r==="Object"&&u.constructor&&(r=u.constructor.name),r==="Map"||r==="Set"?Array.from(u):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(u,t):void 0}}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),xc=we((o,l)=>{de(),ye(),ge();function a(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
32
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Ac=we((o,l)=>{de(),ye(),ge();var a=wc(),s=_c(),u=Ec(),t=xc();function r(n,e){return a(n)||s(n,e)||u(n,e)||t()}l.exports=r,l.exports.__esModule=!0,l.exports.default=l.exports}),Ps=we((o,l)=>{de(),ye(),ge(),function(a,s){typeof o=="object"&&typeof l<"u"?s(o):typeof define=="function"&&define.amd?define(["exports"],s):(a=typeof globalThis<"u"?globalThis:a||self,s(a.fastUniqueNumbers={}))}(o,function(a){var s=function(y){return function(b){var S=y(b);return b.add(S),S}},u=function(y){return function(b,S){return y.set(b,S),S}},t=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,n=r*2,e=function(y,b){return function(S){var w=b.get(S),x=w===void 0?S.size:w<n?w+1:0;if(!S.has(x))return y(S,x);if(S.size<r){for(;S.has(x);)x=Math.floor(Math.random()*n);return y(S,x)}if(S.size>t)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;S.has(x);)x=Math.floor(Math.random()*t);return y(S,x)}},i=new WeakMap,c=u(i),h=e(c,i),d=s(h);a.addUniqueNumber=d,a.generateUniqueNumber=h})}),Ic=we((o,l)=>{de(),ye(),ge();function a(u,t,r,n,e,i,c){try{var h=u[i](c),d=h.value}catch(y){return void r(y)}h.done?t(d):Promise.resolve(d).then(n,e)}function s(u){return function(){var t=this,r=arguments;return new Promise(function(n,e){var i=u.apply(t,r);function c(d){a(i,n,e,c,h,"next",d)}function h(d){a(i,n,e,c,h,"throw",d)}c(void 0)})}}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Cs=we((o,l)=>{de(),ye(),ge();function a(s,u){this.v=s,this.k=u}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),js=we((o,l)=>{de(),ye(),ge();function a(s,u,t,r){var n=Object.defineProperty;try{n({},"",{})}catch{n=0}l.exports=a=function(e,i,c,h){function d(y,b){a(e,y,function(S){return this._invoke(y,b,S)})}i?n?n(e,i,{value:c,enumerable:!h,configurable:!h,writable:!h}):e[i]=c:(d("next",0),d("throw",1),d("return",2))},l.exports.__esModule=!0,l.exports.default=l.exports,a(s,u,t,r)}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Rs=we((o,l)=>{de(),ye(),ge();var a=js();function s(){var u,t,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",e=r.toStringTag||"@@toStringTag";function i(x,g,_,E){var v=g&&g.prototype instanceof h?g:h,C=Object.create(v.prototype);return a(C,"_invoke",function(P,I,T){var k,W,A,N=0,q=T||[],M=!1,le={p:0,n:0,v:u,a:re,f:re.bind(u,4),d:function(ee,ue){return k=ee,W=0,A=u,le.n=ue,c}};function re(ee,ue){for(W=ee,A=ue,t=0;!M&&N&&!G&&t<q.length;t++){var G,oe=q[t],R=le.p,Q=oe[2];ee>3?(G=Q===ue)&&(A=oe[(W=oe[4])?5:(W=3,3)],oe[4]=oe[5]=u):oe[0]<=R&&((G=ee<2&&R<oe[1])?(W=0,le.v=ue,le.n=oe[1]):R<Q&&(G=ee<3||oe[0]>ue||ue>Q)&&(oe[4]=ee,oe[5]=ue,le.n=Q,W=0))}if(G||ee>1)return c;throw M=!0,ue}return function(ee,ue,G){if(N>1)throw TypeError("Generator is already running");for(M&&ue===1&&re(ue,G),W=ue,A=G;(t=W<2?u:A)||!M;){k||(W?W<3?(W>1&&(le.n=-1),re(W,A)):le.n=A:le.v=A);try{if(N=2,k){if(W||(ee="next"),t=k[ee]){if(!(t=t.call(k,A)))throw TypeError("iterator result is not an object");if(!t.done)return t;A=t.value,W<2&&(W=0)}else W===1&&(t=k.return)&&t.call(k),W<2&&(A=TypeError("The iterator does not provide a '"+ee+"' method"),W=1);k=u}else if((t=(M=le.n<0)?A:P.call(I,le))!==c)break}catch(oe){k=u,W=1,A=oe}finally{N=1}}return{value:t,done:M}}}(x,_,E),!0),C}var c={};function h(){}function d(){}function y(){}t=Object.getPrototypeOf;var b=[][n]?t(t([][n]())):(a(t={},n,function(){return this}),t),S=y.prototype=h.prototype=Object.create(b);function w(x){return Object.setPrototypeOf?Object.setPrototypeOf(x,y):(x.__proto__=y,a(x,e,"GeneratorFunction")),x.prototype=Object.create(S),x}return d.prototype=y,a(S,"constructor",y),a(y,"constructor",d),d.displayName="GeneratorFunction",a(y,e,"GeneratorFunction"),a(S),a(S,e,"Generator"),a(S,n,function(){return this}),a(S,"toString",function(){return"[object Generator]"}),(l.exports=s=function(){return{w:i,m:w}},l.exports.__esModule=!0,l.exports.default=l.exports)()}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Ns=we((o,l)=>{de(),ye(),ge();var a=Cs(),s=js();function u(t,r){function n(i,c,h,d){try{var y=t[i](c),b=y.value;return b instanceof a?r.resolve(b.v).then(function(S){n("next",S,h,d)},function(S){n("throw",S,h,d)}):r.resolve(b).then(function(S){y.value=S,h(y)},function(S){return n("throw",S,h,d)})}catch(S){d(S)}}var e;this.next||(s(u.prototype),s(u.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),s(this,"_invoke",function(i,c,h){function d(){return new r(function(y,b){n(i,h,y,b)})}return e=e?e.then(d,d):d()},!0)}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),Ms=we((o,l)=>{de(),ye(),ge();var a=Rs(),s=Ns();function u(t,r,n,e,i){return new s(a().w(t,r,n,e),i||Promise)}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),kc=we((o,l)=>{de(),ye(),ge();var a=Ms();function s(u,t,r,n,e){var i=a(u,t,r,n,e);return i.next().then(function(c){return c.done?c.value:i.next()})}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Oc=we((o,l)=>{de(),ye(),ge();function a(s){var u=Object(s),t=[];for(var r in u)t.unshift(r);return function n(){for(;t.length;)if((r=t.pop())in u)return n.value=r,n.done=!1,n;return n.done=!0,n}}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Tc=we((o,l)=>{de(),ye(),ge();var a=Pr().default;function s(u){if(u!=null){var t=u[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length))return{next:function(){return u&&r>=u.length&&(u=void 0),{value:u&&u[r++],done:!u}}}}throw new TypeError(a(u)+" is not iterable")}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Pc=we((o,l)=>{de(),ye(),ge();var a=Cs(),s=Rs(),u=kc(),t=Ms(),r=Ns(),n=Oc(),e=Tc();function i(){var c=s(),h=c.m(i),d=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function y(w){var x=typeof w=="function"&&w.constructor;return!!x&&(x===d||(x.displayName||x.name)==="GeneratorFunction")}var b={throw:1,return:2,break:3,continue:3};function S(w){var x,g;return function(_){x||(x={stop:function(){return g(_.a,2)},catch:function(){return _.v},abrupt:function(E,v){return g(_.a,b[E],v)},delegateYield:function(E,v,C){return x.resultName=v,g(_.d,e(E),C)},finish:function(E){return g(_.f,E)}},g=function(E,v,C){_.p=x.prev,_.n=x.next;try{return E(v,C)}finally{x.next=_.n}}),x.resultName&&(x[x.resultName]=_.v,x.resultName=void 0),x.sent=_.v,x.next=_.n;try{return w.call(this,x)}finally{_.p=x.prev,_.n=x.next}}}return(l.exports=i=function(){return{wrap:function(w,x,g,_){return c.w(S(w),x,g,_&&_.reverse())},isGeneratorFunction:y,mark:c.m,awrap:function(w,x){return new a(w,x)},AsyncIterator:r,async:function(w,x,g,_,E){return(y(x)?t:u)(S(w),x,g,_,E)},keys:n,values:e}},l.exports.__esModule=!0,l.exports.default=l.exports)()}l.exports=i,l.exports.__esModule=!0,l.exports.default=l.exports}),Cc=we((o,l)=>{de(),ye(),ge();var a=Pc()();l.exports=a;try{regeneratorRuntime=a}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=a:Function("r","regeneratorRuntime = r")(a)}}),jc=we((o,l)=>{de(),ye(),ge(),function(a,s){typeof o=="object"&&typeof l<"u"?s(o,vc(),Ac(),Ps(),Ic(),Cc()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","fast-unique-numbers","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],s):(a=typeof globalThis<"u"?globalThis:a||self,s(a.brokerFactory={},a._defineProperty,a._slicedToArray,a.fastUniqueNumbers,a._asyncToGenerator,a._regeneratorRuntime))}(o,function(a,s,u,t,r,n){var e=function(g){return typeof g.start=="function"},i=new WeakMap;function c(g,_){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);_&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(g,C).enumerable})),E.push.apply(E,v)}return E}function h(g){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};_%2?c(Object(E),!0).forEach(function(v){s(g,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):c(Object(E)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(E,v))})}return g}var d=function(g){return h(h({},g),{},{connect:function(_){var E=_.call;return r(n.mark(function v(){var C,P,I,T;return n.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return C=new MessageChannel,P=C.port1,I=C.port2,k.next=1,E("connect",{port:P},[P]);case 1:return T=k.sent,i.set(I,T),k.abrupt("return",I);case 2:case"end":return k.stop()}},v)}))},disconnect:function(_){var E=_.call;return function(){var v=r(n.mark(function C(P){var I;return n.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(I=i.get(P),I!==void 0){T.next=1;break}throw new Error("The given port is not connected.");case 1:return T.next=2,E("disconnect",{portId:I});case 2:case"end":return T.stop()}},C)}));return function(C){return v.apply(this,arguments)}}()},isSupported:function(_){var E=_.call;return function(){return E("isSupported")}}})};function y(g,_){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);_&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(g,C).enumerable})),E.push.apply(E,v)}return E}function b(g){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};_%2?y(Object(E),!0).forEach(function(v){s(g,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):y(Object(E)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(E,v))})}return g}var S=new WeakMap,w=function(g){if(S.has(g))return S.get(g);var _=new Map;return S.set(g,_),_},x=function(g){var _=d(g);return function(E){var v=w(E);E.addEventListener("message",function(q){var M=q.data,le=M.id;if(le!==null&&v.has(le)){var re=v.get(le),ee=re.reject,ue=re.resolve;v.delete(le),M.error===void 0?ue(M.result):ee(new Error(M.error.message))}}),e(E)&&E.start();for(var C=function(q){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(re,ee){var ue=t.generateUniqueNumber(v);v.set(ue,{reject:ee,resolve:re}),M===null?E.postMessage({id:ue,method:q},le):E.postMessage({id:ue,method:q,params:M},le)})},P=function(q,M){var le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];E.postMessage({id:null,method:q,params:M},le)},I={},T=0,k=Object.entries(_);T<k.length;T++){var W=u(k[T],2),A=W[0],N=W[1];I=b(b({},I),{},s({},A,N({call:C,notify:P})))}return b({},I)}};a.createBroker=x})}),Rc=we((o,l)=>{de(),ye(),ge(),function(a,s){typeof o=="object"&&typeof l<"u"?s(o,Pr(),jc(),Ps()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],s):(a=typeof globalThis<"u"?globalThis:a||self,s(a.workerTimersBroker={},a._typeof,a.brokerFactory,a.fastUniqueNumbers))}(o,function(a,s,u,t){var r=new Map([[0,null]]),n=new Map([[0,null]]),e=u.createBroker({clearInterval:function(c){var h=c.call;return function(d){s(r.get(d))==="symbol"&&(r.set(d,null),h("clear",{timerId:d,timerType:"interval"}).then(function(){r.delete(d)}))}},clearTimeout:function(c){var h=c.call;return function(d){s(n.get(d))==="symbol"&&(n.set(d,null),h("clear",{timerId:d,timerType:"timeout"}).then(function(){n.delete(d)}))}},setInterval:function(c){var h=c.call;return function(d){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=arguments.length,S=new Array(b>2?b-2:0),w=2;w<b;w++)S[w-2]=arguments[w];var x=Symbol(),g=t.generateUniqueNumber(r);r.set(g,x);var _=function(){return h("set",{delay:y,now:performance.timeOrigin+performance.now(),timerId:g,timerType:"interval"}).then(function(){var E=r.get(g);if(E===void 0)throw new Error("The timer is in an undefined state.");E===x&&(d.apply(void 0,S),r.get(g)===x&&_())})};return _(),g}},setTimeout:function(c){var h=c.call;return function(d){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=arguments.length,S=new Array(b>2?b-2:0),w=2;w<b;w++)S[w-2]=arguments[w];var x=Symbol(),g=t.generateUniqueNumber(n);return n.set(g,x),h("set",{delay:y,now:performance.timeOrigin+performance.now(),timerId:g,timerType:"timeout"}).then(function(){var _=n.get(g);if(_===void 0)throw new Error("The timer is in an undefined state.");_===x&&(n.delete(g),d.apply(void 0,S))}),g}}}),i=function(c){var h=new Worker(c);return e(h)};a.load=i,a.wrap=e})}),Nc=we((o,l)=>{de(),ye(),ge(),function(a,s){typeof o=="object"&&typeof l<"u"?s(o,Rc()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],s):(a=typeof globalThis<"u"?globalThis:a||self,s(a.workerTimers={},a.workerTimersBroker))}(o,function(a,s){var u=function(h,d){var y=null;return function(){if(y!==null)return y;var b=new Blob([d],{type:"application/javascript; charset=utf-8"}),S=URL.createObjectURL(b);return y=h(S),setTimeout(function(){return URL.revokeObjectURL(S)}),y}},t=`(()=>{var e={45:(e,t,r)=>{var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},293:e=>{function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},472:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise((function(t){e.set(a,[r(n,s,i,e,t,a),t])}))}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark((function e(r){var n,o,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark((function e(r){var n,o,u,a,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},546:e=>{function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){if(r)a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n;else{var u=function(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))};u("next",0),u("throw",1),u("return",2)}},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},623:function(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark((function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])}))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,(function(){u(),r.close(),x.delete(a)})),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark((function e(){var t,n,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},633:(e,t,r)=>{var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,r)=>{var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then((function(e){u("next",e,a,i)}),(function(e){u("throw",e,a,i)})):r.resolve(c).then((function(e){s.value=e,a(s)}),(function(e){return u("throw",e,a,i)}))}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(e,t,n){function o(){return new r((function(t,r){u(e,n,t,r)}))}return a=a?a.then(o,o):o()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then((function(e){return e.done?e.value:a.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,r=u(s.load,t),n=function(h){return r().clearInterval(h)},e=function(h){return r().clearTimeout(h)},i=function(){var h;return(h=r()).setInterval.apply(h,arguments)},c=function(){var h;return(h=r()).setTimeout.apply(h,arguments)};a.clearInterval=n,a.clearTimeout=e,a.setInterval=i,a.setTimeout=c})}),Cr=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.isReactNativeBrowser=o.isWebWorker=void 0;var l=()=>{var t;return typeof window<"u"?typeof navigator<"u"&&((t=navigator.userAgent)==null?void 0:t.toLowerCase().indexOf(" electron/"))>-1&&(Je!=null&&Je.versions)?!Object.prototype.hasOwnProperty.call(Je.versions,"electron"):typeof window.document<"u":!1},a=()=>{var t,r;return!!(typeof self=="object"&&((r=(t=self==null?void 0:self.constructor)==null?void 0:t.name)!=null&&r.includes("WorkerGlobalScope"))&&typeof Deno>"u")},s=()=>typeof navigator<"u"&&navigator.product==="ReactNative",u=l()||a()||s();o.isWebWorker=a(),o.isReactNativeBrowser=s(),o.default=u}),Mc=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(i,c,h,d){d===void 0&&(d=h);var y=Object.getOwnPropertyDescriptor(c,h);(!y||("get"in y?!c.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(i,d,y)}:function(i,c,h,d){d===void 0&&(d=h),i[d]=c[h]}),a=o&&o.__setModuleDefault||(Object.create?function(i,c){Object.defineProperty(i,"default",{enumerable:!0,value:c})}:function(i,c){i.default=c}),s=o&&o.__importStar||function(){var i=function(c){return i=Object.getOwnPropertyNames||function(h){var d=[];for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(d[d.length]=y);return d},i(c)};return function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var d=i(c),y=0;y<d.length;y++)d[y]!=="default"&&l(h,c,d[y]);return a(h,c),h}}();Object.defineProperty(o,"__esModule",{value:!0});var u=Nc(),t=s(Cr()),r={set:u.setInterval,clear:u.clearInterval},n={set:(i,c)=>setInterval(i,c),clear:i=>clearInterval(i)},e=i=>{switch(i){case"native":return n;case"worker":return r;case"auto":default:return t.default&&!t.isWebWorker&&!t.isReactNativeBrowser?r:n}};o.default=e}),Bs=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(o,"__esModule",{value:!0});var a=l(Mc()),s=class{constructor(u,t){Pe(this,"_keepalive");Pe(this,"timerId");Pe(this,"timer");Pe(this,"destroyed",!1);Pe(this,"counter");Pe(this,"client");Pe(this,"_keepaliveTimeoutTimestamp");Pe(this,"_intervalEvery");this.client=u,this.timer=typeof t=="object"&&"set"in t&&"clear"in t?t:(0,a.default)(t),this.setKeepalive(u.options.keepalive)}get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(u){if(u*=1e3,isNaN(u)||u<=0||u>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${u}`);this._keepalive=u,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${u}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let u=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+u,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};o.default=s}),Pi=we(o=>{var v;de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(C,P,I,T){T===void 0&&(T=I);var k=Object.getOwnPropertyDescriptor(P,I);(!k||("get"in k?!P.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return P[I]}}),Object.defineProperty(C,T,k)}:function(C,P,I,T){T===void 0&&(T=I),C[T]=P[I]}),a=o&&o.__setModuleDefault||(Object.create?function(C,P){Object.defineProperty(C,"default",{enumerable:!0,value:P})}:function(C,P){C.default=P}),s=o&&o.__importStar||function(){var C=function(P){return C=Object.getOwnPropertyNames||function(I){var T=[];for(var k in I)Object.prototype.hasOwnProperty.call(I,k)&&(T[T.length]=k);return T},C(P)};return function(P){if(P&&P.__esModule)return P;var I={};if(P!=null)for(var T=C(P),k=0;k<T.length;k++)T[k]!=="default"&&l(I,P,T[k]);return a(I,P),I}}(),u=o&&o.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(o,"__esModule",{value:!0});var t=u(zu()),r=Xt(),n=u(Ku()),e=u(Nt()),i=s(Hu()),c=u(Ss()),h=u(dc()),d=u(Ts()),y=u(gc()),b=ar(),S=yc(),w=u(Bs()),x=s(Cr()),g=globalThis.setImmediate||((...C)=>{let P=C.shift();(0,b.nextTick)(()=>{P(...C)})}),_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},E=(v=class extends S.TypedEventEmitter{constructor(I,T){super();Pe(this,"connected");Pe(this,"disconnecting");Pe(this,"disconnected");Pe(this,"reconnecting");Pe(this,"incomingStore");Pe(this,"outgoingStore");Pe(this,"options");Pe(this,"queueQoSZero");Pe(this,"_reconnectCount");Pe(this,"log");Pe(this,"messageIdProvider");Pe(this,"outgoing");Pe(this,"messageIdToTopic");Pe(this,"noop");Pe(this,"keepaliveManager");Pe(this,"stream");Pe(this,"queue");Pe(this,"streamBuilder");Pe(this,"_resubscribeTopics");Pe(this,"connackTimer");Pe(this,"reconnectTimer");Pe(this,"_storeProcessing");Pe(this,"_packetIdsDuringStoreProcessing");Pe(this,"_storeProcessingQueue");Pe(this,"_firstConnection");Pe(this,"topicAliasRecv");Pe(this,"topicAliasSend");Pe(this,"_deferredReconnect");Pe(this,"connackPacket");this.options=T||{};for(let k in _)typeof this.options[k]>"u"?this.options[k]=_[k]:this.options[k]=T[k];this.log=this.options.log||(0,e.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",v.VERSION),x.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",x.default?"browser":"node"),this.log("MqttClient :: options.protocol",T.protocol),this.log("MqttClient :: options.protocolVersion",T.protocolVersion),this.log("MqttClient :: options.username",T.username),this.log("MqttClient :: options.keepalive",T.keepalive),this.log("MqttClient :: options.reconnectPeriod",T.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",T.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",T.properties?T.properties.topicAliasMaximum:void 0),this.options.clientId=typeof T.clientId=="string"?T.clientId:v.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=T.protocolVersion===5&&T.customHandleAcks?T.customHandleAcks:(...k)=>{k[3](null,0)},this.options.writeCache||(t.default.writeToStream.cacheNumbers=!1),this.streamBuilder=I,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new d.default:this.options.messageIdProvider,this.outgoingStore=T.outgoingStore||new c.default,this.incomingStore=T.incomingStore||new c.default,this.queueQoSZero=T.queueQoSZero===void 0?!0:T.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,T.properties&&T.properties.topicAliasMaximum>0&&(T.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(T.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:k}=this,W=()=>{let A=k.shift();this.log("deliver :: entry %o",A);let N=null;if(!A){this._resubscribe();return}N=A.packet,this.log("deliver :: call _sendPacket for %o",N);let q=!0;N.messageId&&N.messageId!==0&&(this.messageIdProvider.register(N.messageId)||(q=!1)),q?this._sendPacket(N,M=>{A.cb&&A.cb(M),W()}):(this.log("messageId: %d has already used. The message is skipped and removed.",N.messageId),W())};this.log("connect :: sending queued packets"),W()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}handleAuth(I,T){T()}handleMessage(I,T){T()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var le;let I=new r.Writable,T=t.default.parser(this.options),k=null,W=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),T.on("packet",re=>{this.log("parser :: on packet push to packets array."),W.push(re)});let A=()=>{this.log("work :: getting next packet in queue");let re=W.shift();if(re)this.log("work :: packet pulled from queue"),(0,h.default)(this,re,N);else{this.log("work :: no packets in queue");let ee=k;k=null,this.log("work :: done flag is %s",!!ee),ee&&ee()}},N=()=>{if(W.length)(0,b.nextTick)(A);else{let re=k;k=null,re()}};I._write=(re,ee,ue)=>{k=ue,this.log("writable stream :: parsing buffer"),T.parse(re),A()};let q=re=>{this.log("streamErrorHandler :: error",re.message),re.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",re)):this.noop(re)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(I),this.stream.on("error",q),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 M={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(M.will={...this.options.will,payload:(le=this.options.will)==null?void 0:le.payload}),this.topicAliasRecv&&(M.properties||(M.properties={}),this.topicAliasRecv&&(M.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(M),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&&typeof this.options.authPacket=="object"){let re={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(re)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(I,T,k,W){this.log("publish :: message `%s` to topic `%s`",T,I);let{options:A}=this;typeof k=="function"&&(W=k,k=null),k=k||{},k={qos:0,retain:!1,dup:!1,...k};let{qos:N,retain:q,dup:M,properties:le,cbStorePut:re}=k;if(this._checkDisconnecting(W))return this;let ee=()=>{let ue=0;if((N===1||N===2)&&(ue=this._nextId(),ue===null))return this.log("No messageId left"),!1;let G={cmd:"publish",topic:I,payload:T,qos:N,retain:q,messageId:ue,dup:M};switch(A.protocolVersion===5&&(G.properties=le),this.log("publish :: qos",N),N){case 1:case 2:this.outgoing[G.messageId]={volatile:!1,cb:W||this.noop},this.log("MqttClient:publish: packet cmd: %s",G.cmd),this._sendPacket(G,void 0,re);break;default:this.log("MqttClient:publish: packet cmd: %s",G.cmd),this._sendPacket(G,W,re);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ee())&&this._storeProcessingQueue.push({invoke:ee,cbStorePut:k.cbStorePut,callback:W}),this}publishAsync(I,T,k){return new Promise((W,A)=>{this.publish(I,T,k,(N,q)=>{N?A(N):W(q)})})}subscribe(I,T,k){let W=this.options.protocolVersion;typeof T=="function"&&(k=T),k=k||this.noop;let A=!1,N=[];typeof I=="string"?(I=[I],N=I):Array.isArray(I)?N=I:typeof I=="object"&&(A=I.resubscribe,delete I.resubscribe,N=Object.keys(I));let q=i.validateTopics(N);if(q!==null)return g(k,new Error(`Invalid topic ${q}`)),this;if(this._checkDisconnecting(k))return this.log("subscribe: discconecting true"),this;let M={qos:0};W===5&&(M.nl=!1,M.rap=!1,M.rh=0),T={...M,...T};let{properties:le}=T,re=[],ee=(oe,R)=>{if(R=R||T,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,oe)||this._resubscribeTopics[oe].qos<R.qos||A){let Q={topic:oe,qos:R.qos};W===5&&(Q.nl=R.nl,Q.rap=R.rap,Q.rh=R.rh,Q.properties=le),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",Q.topic,Q.qos),re.push(Q)}};if(Array.isArray(I)?I.forEach(oe=>{this.log("subscribe: array topic %s",oe),ee(oe)}):Object.keys(I).forEach(oe=>{this.log("subscribe: object topic %s, %o",oe,I[oe]),ee(oe,I[oe])}),!re.length)return k(null,[]),this;let ue=(oe,R)=>{let Q={cmd:"subscribe",subscriptions:oe,messageId:R};if(le&&(Q.properties=le),this.options.resubscribe){this.log("subscribe :: resubscribe true");let z=[];oe.forEach(Ee=>{if(this.options.reconnectPeriod>0){let X={qos:Ee.qos};W===5&&(X.nl=Ee.nl||!1,X.rap=Ee.rap||!1,X.rh=Ee.rh||0,X.properties=Ee.properties),this._resubscribeTopics[Ee.topic]=X,z.push(Ee.topic)}}),this.messageIdToTopic[Q.messageId]=z}let he=new Promise((z,Ee)=>{this.outgoing[Q.messageId]={volatile:!0,cb(X,D){if(!X){let{granted:ae}=D;for(let H=0;H<ae.length;H+=1)oe[H].qos=ae[H]}X?Ee(new b.ErrorWithSubackPacket(X.message,D)):z(D)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(Q),he},G=()=>{let oe=this.options.subscribeBatchSize??re.length,R=[];for(let Q=0;Q<re.length;Q+=oe){let he=re.slice(Q,Q+oe),z=this._nextId();if(z===null)return this.log("No messageId left"),!1;R.push(ue(he,z))}return Promise.all(R).then(Q=>{k(null,re,Q.at(-1))}).catch(Q=>{k(Q,re,Q.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!G())&&this._storeProcessingQueue.push({invoke:G,callback:k}),this}subscribeAsync(I,T){return new Promise((k,W)=>{this.subscribe(I,T,(A,N)=>{A?W(A):k(N)})})}unsubscribe(I,T,k){typeof I=="string"&&(I=[I]),typeof T=="function"&&(k=T),k=k||this.noop;let W=i.validateTopics(I);if(W!==null)return g(k,new Error(`Invalid topic ${W}`)),this;if(this._checkDisconnecting(k))return this;let A=()=>{let N=this._nextId();if(N===null)return this.log("No messageId left"),!1;let q={cmd:"unsubscribe",messageId:N,unsubscriptions:[]};return typeof I=="string"?q.unsubscriptions=[I]:Array.isArray(I)&&(q.unsubscriptions=I),this.options.resubscribe&&q.unsubscriptions.forEach(M=>{delete this._resubscribeTopics[M]}),typeof T=="object"&&T.properties&&(q.properties=T.properties),this.outgoing[q.messageId]={volatile:!0,cb:k},this.log("unsubscribe: call _sendPacket"),this._sendPacket(q),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!A())&&this._storeProcessingQueue.push({invoke:A,callback:k}),this}unsubscribeAsync(I,T){return new Promise((k,W)=>{this.unsubscribe(I,T,(A,N)=>{A?W(A):k(N)})})}end(I,T,k){this.log("end :: (%s)",this.options.clientId),(I==null||typeof I!="boolean")&&(k=k||T,T=I,I=!1),typeof T!="object"&&(k=k||T,T=null),this.log("end :: cb? %s",!!k),(!k||typeof k!="function")&&(k=this.noop);let W=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(N=>{this.outgoingStore.close(q=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),k){let M=N||q;this.log("end :: closeStores: invoking callback with args"),k(M)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},A=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,I),this._cleanUp(I,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.nextTick)(W)},T)};return this.disconnecting?(k(),this):(this._clearReconnect(),this.disconnecting=!0,!I&&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,A,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),A()),this)}endAsync(I,T){return new Promise((k,W)=>{this.end(I,T,A=>{A?W(A):k()})})}removeOutgoingMessage(I){if(this.outgoing[I]){let{cb:T}=this.outgoing[I];this._removeOutgoingAndStoreMessage(I,()=>{T(new Error("Message removed"))})}return this}reconnect(I){this.log("client reconnect");let T=()=>{I?(this.options.incomingStore=I.incomingStore,this.options.outgoingStore=I.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=T:T(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(I=>{this.outgoing[I].volatile&&typeof this.outgoing[I].cb=="function"&&(this.outgoing[I].cb(new Error("Connection closed")),delete this.outgoing[I])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(I=>{typeof this.outgoing[I].cb=="function"&&(this.outgoing[I].cb(new Error("Connection closed")),delete this.outgoing[I])}))}_removeTopicAliasAndRecoverTopicName(I){let T;I.properties&&(T=I.properties.topicAlias);let k=I.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",T,k),k.length===0){if(typeof T>"u")return new Error("Unregistered Topic Alias");if(k=this.topicAliasSend.getTopicByAlias(T),typeof k>"u")return new Error("Unregistered Topic Alias");I.topic=k}T&&delete I.properties.topicAlias}_checkDisconnecting(I){return this.disconnecting&&(I&&I!==this.noop?I(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(I,T,k={}){if(T&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",T)),this.log("_cleanUp :: forced? %s",I),I)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let W={cmd:"disconnect",...k};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(W,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),g(()=>{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(I,T,k){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",I.cmd);let W=I,A;if(W.cmd==="publish"&&(W=(0,n.default)(I),A=this._removeTopicAliasAndRecoverTopicName(W),A))return T&&T(A);this.outgoingStore.put(W,N=>{if(N)return T&&T(N);k(),this._writePacket(I,T)})}_applyTopicAlias(I){if(this.options.protocolVersion===5&&I.cmd==="publish"){let T;I.properties&&(T=I.properties.topicAlias);let k=I.topic.toString();if(this.topicAliasSend)if(T){if(k.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",k,T),!this.topicAliasSend.put(k,T)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",k,T),new Error("Sending Topic Alias out of range")}else k.length!==0&&(this.options.autoAssignTopicAlias?(T=this.topicAliasSend.getAliasByTopic(k),T?(I.topic="",I.properties={...I.properties,topicAlias:T},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",k,T)):(T=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(k,T),I.properties={...I.properties,topicAlias:T},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",k,T))):this.options.autoUseTopicAlias&&(T=this.topicAliasSend.getAliasByTopic(k),T&&(I.topic="",I.properties={...I.properties,topicAlias:T},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",k,T))));else if(T)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",k,T),new Error("Sending Topic Alias out of range")}}_noop(I){this.log("noop ::",I)}_writePacket(I,T){this.log("_writePacket :: packet: %O",I),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",I),this.log("_writePacket :: writing to stream");let k=t.default.writeToStream(I,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",k),!k&&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(I,T,k,W){this.log("_sendPacket :: (%s) :: start",this.options.clientId),k=k||this.noop,T=T||this.noop;let A=this._applyTopicAlias(I);if(A){T(A);return}if(!this.connected){if(I.cmd==="auth"){this._writePacket(I,T);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(I,T,k);return}if(W){this._writePacket(I,T);return}switch(I.cmd){case"publish":break;case"pubrel":this._storeAndSend(I,T,k);return;default:this._writePacket(I,T);return}switch(I.qos){case 2:case 1:this._storeAndSend(I,T,k);break;case 0:default:this._writePacket(I,T);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(I,T,k){this.log("_storePacket :: packet: %o",I),this.log("_storePacket :: cb? %s",!!T),k=k||this.noop;let W=I;if(W.cmd==="publish"){W=(0,n.default)(I);let N=this._removeTopicAliasAndRecoverTopicName(W);if(N)return T&&T(N)}let A=W.qos||0;A===0&&this.queueQoSZero||W.cmd!=="publish"?this.queue.push({packet:W,cb:T}):A>0?(T=this.outgoing[W.messageId]?this.outgoing[W.messageId].cb:null,this.outgoingStore.put(W,N=>{if(N)return T&&T(N);k()})):T&&T(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new w.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(I=!1){this.keepaliveManager&&this.options.keepalive&&(I||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let I=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&I.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let T=0;T<I.length;T++){let k={};k[I[T]]=this._resubscribeTopics[I[T]],k.resubscribe=!0,this.subscribe(k,{properties:k[I[T]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(I){if(this.disconnected){this.emit("connect",I);return}this.connackPacket=I,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let T=()=>{let k=this.outgoingStore.createStream(),W=()=>{k.destroy(),k=null,this._flushStoreProcessingQueue(),A()},A=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",W),k.on("error",q=>{A(),this._flushStoreProcessingQueue(),this.removeListener("close",W),this.emit("error",q)});let N=()=>{if(!k)return;let q=k.read(1),M;if(!q){k.once("readable",N);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[q.messageId]){N();return}!this.disconnecting&&!this.reconnectTimer?(M=this.outgoing[q.messageId]?this.outgoing[q.messageId].cb:null,this.outgoing[q.messageId]={volatile:!1,cb(le,re){M&&M(le,re),N()}},this._packetIdsDuringStoreProcessing[q.messageId]=!0,this.messageIdProvider.register(q.messageId)?this._sendPacket(q,void 0,void 0,!0):this.log("messageId: %d has already used.",q.messageId)):k.destroy&&k.destroy()};k.on("end",()=>{let q=!0;for(let M in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[M]){q=!1;break}this.removeListener("close",W),q?(A(),this._invokeAllStoreProcessingQueue(),this.emit("connect",I)):T()}),N()};T()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let I=this._storeProcessingQueue[0];if(I&&I.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let I of this._storeProcessingQueue)I.cbStorePut&&I.cbStorePut(new Error("Connection closed")),I.callback&&I.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(I,T){delete this.outgoing[I],this.outgoingStore.del({messageId:I},(k,W)=>{T(k,W),this.messageIdProvider.deallocate(I),this._invokeStoreProcessingQueue()})}},Pe(v,"VERSION",b.MQTTJS_VERSION),v);o.default=E}),Bc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Os(),a=class{constructor(){Pe(this,"numberAllocator");Pe(this,"lastId");this.numberAllocator=new l.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(s){return this.numberAllocator.use(s)}deallocate(s){this.numberAllocator.free(s)}clear(){this.numberAllocator.clear()}};o.default=a});function Lc(){if(Ci)return jr;Ci=!0;let o=2147483647,l=36,a=1,s=26,u=38,t=700,r=72,n=128,e="-",i=/^xn--/,c=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=l-a,b=Math.floor,S=String.fromCharCode;function w(k){throw new RangeError(d[k])}function x(k,W){let A=[],N=k.length;for(;N--;)A[N]=W(k[N]);return A}function g(k,W){let A=k.split("@"),N="";A.length>1&&(N=A[0]+"@",k=A[1]),k=k.replace(h,".");let q=k.split("."),M=x(q,W).join(".");return N+M}function _(k){let W=[],A=0,N=k.length;for(;A<N;){let q=k.charCodeAt(A++);if(q>=55296&&q<=56319&&A<N){let M=k.charCodeAt(A++);(M&64512)==56320?W.push(((q&1023)<<10)+(M&1023)+65536):(W.push(q),A--)}else W.push(q)}return W}let E=k=>String.fromCodePoint(...k),v=function(k){return k>=48&&k<58?26+(k-48):k>=65&&k<91?k-65:k>=97&&k<123?k-97:l},C=function(k,W){return k+22+75*(k<26)-((W!=0)<<5)},P=function(k,W,A){let N=0;for(k=A?b(k/t):k>>1,k+=b(k/W);k>y*s>>1;N+=l)k=b(k/y);return b(N+(y+1)*k/(k+u))},I=function(k){let W=[],A=k.length,N=0,q=n,M=r,le=k.lastIndexOf(e);le<0&&(le=0);for(let re=0;re<le;++re)k.charCodeAt(re)>=128&&w("not-basic"),W.push(k.charCodeAt(re));for(let re=le>0?le+1:0;re<A;){let ee=N;for(let G=1,oe=l;;oe+=l){re>=A&&w("invalid-input");let R=v(k.charCodeAt(re++));R>=l&&w("invalid-input"),R>b((o-N)/G)&&w("overflow"),N+=R*G;let Q=oe<=M?a:oe>=M+s?s:oe-M;if(R<Q)break;let he=l-Q;G>b(o/he)&&w("overflow"),G*=he}let ue=W.length+1;M=P(N-ee,ue,ee==0),b(N/ue)>o-q&&w("overflow"),q+=b(N/ue),N%=ue,W.splice(N++,0,q)}return String.fromCodePoint(...W)},T=function(k){let W=[];k=_(k);let A=k.length,N=n,q=0,M=r;for(let ee of k)ee<128&&W.push(S(ee));let le=W.length,re=le;for(le&&W.push(e);re<A;){let ee=o;for(let G of k)G>=N&&G<ee&&(ee=G);let ue=re+1;ee-N>b((o-q)/ue)&&w("overflow"),q+=(ee-N)*ue,N=ee;for(let G of k)if(G<N&&++q>o&&w("overflow"),G===N){let oe=q;for(let R=l;;R+=l){let Q=R<=M?a:R>=M+s?s:R-M;if(oe<Q)break;let he=oe-Q,z=l-Q;W.push(S(C(Q+he%z,0))),oe=b(he/z)}W.push(S(C(oe,0))),M=P(q,ue,re===le),q=0,++re}++q,++N}return W.join("")};return jr={version:"2.3.1",ucs2:{decode:_,encode:E},decode:I,encode:T,toASCII:function(k){return g(k,function(W){return c.test(W)?"xn--"+T(W):W})},toUnicode:function(k){return g(k,function(W){return i.test(W)?I(W.slice(4).toLowerCase()):W})}},jr}var jr,Ci,$t,Uc=_t(()=>{de(),ye(),ge(),jr={},Ci=!1,$t=Lc(),$t.decode,$t.encode,$t.toASCII,$t.toUnicode,$t.ucs2,$t.version});function Dc(){return Mi||(Mi=!0,Ni=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},l=Symbol("test"),a=Object(l);if(typeof l=="string"||Object.prototype.toString.call(l)!=="[object Symbol]"||Object.prototype.toString.call(a)!=="[object Symbol]")return!1;var s=42;o[l]=s;for(l in o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var u=Object.getOwnPropertySymbols(o);if(u.length!==1||u[0]!==l||!Object.prototype.propertyIsEnumerable.call(o,l))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var t=Object.getOwnPropertyDescriptor(o,l);if(t.value!==s||t.enumerable!==!0)return!1}return!0}),Ni}function Fc(){return Li||(Li=!0,Bi=Error),Bi}function Wc(){return Di||(Di=!0,Ui=EvalError),Ui}function $c(){return Wi||(Wi=!0,Fi=RangeError),Fi}function qc(){return qi||(qi=!0,$i=ReferenceError),$i}function Ls(){return Vi||(Vi=!0,zi=SyntaxError),zi}function vr(){return Hi||(Hi=!0,Ki=TypeError),Ki}function zc(){return Yi||(Yi=!0,Gi=URIError),Gi}function Vc(){if(Qi)return Rr;Qi=!0;var o=typeof Symbol<"u"&&Symbol,l=Dc();return Rr=function(){return typeof o!="function"||typeof Symbol!="function"||typeof o("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:l()},Rr}function Kc(){if(Ji)return Nr;Ji=!0;var o={__proto__:null,foo:{}},l=Object;return Nr=function(){return{__proto__:o}.foo===o.foo&&!(o instanceof l)},Nr}function Hc(){if(Xi)return Mr;Xi=!0;var o="Function.prototype.bind called on incompatible ",l=Object.prototype.toString,a=Math.max,s="[object Function]",u=function(n,e){for(var i=[],c=0;c<n.length;c+=1)i[c]=n[c];for(var h=0;h<e.length;h+=1)i[h+n.length]=e[h];return i},t=function(n,e){for(var i=[],c=e,h=0;c<n.length;c+=1,h+=1)i[h]=n[c];return i},r=function(n,e){for(var i="",c=0;c<n.length;c+=1)i+=n[c],c+1<n.length&&(i+=e);return i};return Mr=function(n){var e=this;if(typeof e!="function"||l.apply(e)!==s)throw new TypeError(o+e);for(var i=t(arguments,1),c,h=function(){if(this instanceof c){var w=e.apply(this,u(i,arguments));return Object(w)===w?w:this}return e.apply(n,u(i,arguments))},d=a(0,e.length-i.length),y=[],b=0;b<d;b++)y[b]="$"+b;if(c=Function("binder","return function ("+r(y,",")+"){ return binder.apply(this,arguments); }")(h),e.prototype){var S=function(){};S.prototype=e.prototype,c.prototype=new S,S.prototype=null}return c},Mr}function ji(){if(Zi)return Br;Zi=!0;var o=Hc();return Br=Function.prototype.bind||o,Br}function Gc(){if(eo)return Lr;eo=!0;var o=Function.prototype.call,l=Object.prototype.hasOwnProperty,a=ji();return Lr=a.call(o,l),Lr}function lr(){if(to)return Ur;to=!0;var o,l=Fc(),a=Wc(),s=$c(),u=qc(),t=Ls(),r=vr(),n=zc(),e=Function,i=function(re){try{return e('"use strict"; return ('+re+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var h=function(){throw new r},d=c?function(){try{return arguments.callee,h}catch{try{return c(arguments,"callee").get}catch{return h}}}():h,y=Vc()(),b=Kc()(),S=Object.getPrototypeOf||(b?function(re){return re.__proto__}:null),w={},x=typeof Uint8Array>"u"||!S?o:S(Uint8Array),g={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?o:ArrayBuffer,"%ArrayIteratorPrototype%":y&&S?S([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?o:Atomics,"%BigInt%":typeof BigInt>"u"?o:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?o:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":l,"%eval%":eval,"%EvalError%":a,"%Float32Array%":typeof Float32Array>"u"?o:Float32Array,"%Float64Array%":typeof Float64Array>"u"?o:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?o:FinalizationRegistry,"%Function%":e,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?o:Int8Array,"%Int16Array%":typeof Int16Array>"u"?o:Int16Array,"%Int32Array%":typeof Int32Array>"u"?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&S?S(S([][Symbol.iterator]())):o,"%JSON%":typeof JSON=="object"?JSON:o,"%Map%":typeof Map>"u"?o:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!S?o:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?o:Promise,"%Proxy%":typeof Proxy>"u"?o:Proxy,"%RangeError%":s,"%ReferenceError%":u,"%Reflect%":typeof Reflect>"u"?o:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?o:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!S?o:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&S?S(""[Symbol.iterator]()):o,"%Symbol%":y?Symbol:o,"%SyntaxError%":t,"%ThrowTypeError%":d,"%TypedArray%":x,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?o:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?o:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?o:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?o:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?o:WeakMap,"%WeakRef%":typeof WeakRef>"u"?o:WeakRef,"%WeakSet%":typeof WeakSet>"u"?o:WeakSet};if(S)try{null.error}catch(re){var _=S(S(re));g["%Error.prototype%"]=_}var E=function re(ee){var ue;if(ee==="%AsyncFunction%")ue=i("async function () {}");else if(ee==="%GeneratorFunction%")ue=i("function* () {}");else if(ee==="%AsyncGeneratorFunction%")ue=i("async function* () {}");else if(ee==="%AsyncGenerator%"){var G=re("%AsyncGeneratorFunction%");G&&(ue=G.prototype)}else if(ee==="%AsyncIteratorPrototype%"){var oe=re("%AsyncGenerator%");oe&&S&&(ue=S(oe.prototype))}return g[ee]=ue,ue},v={__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"]},C=ji(),P=Gc(),I=C.call(Function.call,Array.prototype.concat),T=C.call(Function.apply,Array.prototype.splice),k=C.call(Function.call,String.prototype.replace),W=C.call(Function.call,String.prototype.slice),A=C.call(Function.call,RegExp.prototype.exec),N=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,M=function(re){var ee=W(re,0,1),ue=W(re,-1);if(ee==="%"&&ue!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(ue==="%"&&ee!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var G=[];return k(re,N,function(oe,R,Q,he){G[G.length]=Q?k(he,q,"$1"):R||oe}),G},le=function(re,ee){var ue=re,G;if(P(v,ue)&&(G=v[ue],ue="%"+G[0]+"%"),P(g,ue)){var oe=g[ue];if(oe===w&&(oe=E(ue)),typeof oe>"u"&&!ee)throw new r("intrinsic "+re+" exists, but is not available. Please file an issue!");return{alias:G,name:ue,value:oe}}throw new t("intrinsic "+re+" does not exist!")};return Ur=function(re,ee){if(typeof re!="string"||re.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ee!="boolean")throw new r('"allowMissing" argument must be a boolean');if(A(/^%?[^%]*%?$/,re)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ue=M(re),G=ue.length>0?ue[0]:"",oe=le("%"+G+"%",ee),R=oe.name,Q=oe.value,he=!1,z=oe.alias;z&&(G=z[0],T(ue,I([0,1],z)));for(var Ee=1,X=!0;Ee<ue.length;Ee+=1){var D=ue[Ee],ae=W(D,0,1),H=W(D,-1);if((ae==='"'||ae==="'"||ae==="`"||H==='"'||H==="'"||H==="`")&&ae!==H)throw new t("property names with quotes must have matching quotes");if((D==="constructor"||!X)&&(he=!0),G+="."+D,R="%"+G+"%",P(g,R))Q=g[R];else if(Q!=null){if(!(D in Q)){if(!ee)throw new r("base intrinsic for "+re+" exists, but the property is not available.");return}if(c&&Ee+1>=ue.length){var te=c(Q,D);X=!!te,X&&"get"in te&&!("originalValue"in te.get)?Q=te.get:Q=Q[D]}else X=P(Q,D),Q=Q[D];X&&!he&&(g[R]=Q)}}return Q},Ur}function Ri(){if(ro)return Dr;ro=!0;var o=lr(),l=o("%Object.defineProperty%",!0)||!1;if(l)try{l({},"a",{value:1})}catch{l=!1}return Dr=l,Dr}function Us(){if(no)return Fr;no=!0;var o=lr(),l=o("%Object.getOwnPropertyDescriptor%",!0);if(l)try{l([],"length")}catch{l=null}return Fr=l,Fr}function Yc(){if(io)return Wr;io=!0;var o=Ri(),l=Ls(),a=vr(),s=Us();return Wr=function(u,t,r){if(!u||typeof u!="object"&&typeof u!="function")throw new a("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new a("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new a("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new a("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new a("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new a("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,e=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!s&&s(u,t);if(o)o(u,t,{configurable:i===null&&h?h.configurable:!i,enumerable:n===null&&h?h.enumerable:!n,value:r,writable:e===null&&h?h.writable:!e});else if(c||!n&&!e&&!i)u[t]=r;else throw new l("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Wr}function Qc(){if(oo)return $r;oo=!0;var o=Ri(),l=function(){return!!o};return l.hasArrayLengthDefineBug=function(){if(!o)return null;try{return o([],"length",{value:1}).length!==1}catch{return!0}},$r=l,$r}function Jc(){if(so)return qr;so=!0;var o=lr(),l=Yc(),a=Qc()(),s=Us(),u=vr(),t=o("%Math.floor%");return qr=function(r,n){if(typeof r!="function")throw new u("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||t(n)!==n)throw new u("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],i=!0,c=!0;if("length"in r&&s){var h=s(r,"length");h&&!h.configurable&&(i=!1),h&&!h.writable&&(c=!1)}return(i||c||!e)&&(a?l(r,"length",n,!0,!0):l(r,"length",n)),r},qr}function Xc(){if(ao)return ur;ao=!0;var o=ji(),l=lr(),a=Jc(),s=vr(),u=l("%Function.prototype.apply%"),t=l("%Function.prototype.call%"),r=l("%Reflect.apply%",!0)||o.call(t,u),n=Ri(),e=l("%Math.max%");ur=function(c){if(typeof c!="function")throw new s("a function is required");var h=r(o,t,arguments);return a(h,1+e(0,c.length-(arguments.length-1)),!0)};var i=function(){return r(o,u,arguments)};return n?n(ur,"apply",{value:i}):ur.apply=i,ur}function Zc(){if(lo)return zr;lo=!0;var o=lr(),l=Xc(),a=l(o("String.prototype.indexOf"));return zr=function(s,u){var t=o(s,!!u);return typeof t=="function"&&a(s,".prototype.")>-1?l(t):t},zr}var Ni,Mi,Bi,Li,Ui,Di,Fi,Wi,$i,qi,zi,Vi,Ki,Hi,Gi,Yi,Rr,Qi,Nr,Ji,Mr,Xi,Br,Zi,Lr,eo,Ur,to,Dr,ro,Fr,no,Wr,io,$r,oo,qr,so,ur,ao,zr,lo,ef=_t(()=>{de(),ye(),ge(),Ni={},Mi=!1,Bi={},Li=!1,Ui={},Di=!1,Fi={},Wi=!1,$i={},qi=!1,zi={},Vi=!1,Ki={},Hi=!1,Gi={},Yi=!1,Rr={},Qi=!1,Nr={},Ji=!1,Mr={},Xi=!1,Br={},Zi=!1,Lr={},eo=!1,Ur={},to=!1,Dr={},ro=!1,Fr={},no=!1,Wr={},io=!1,$r={},oo=!1,qr={},so=!1,ur={},ao=!1,zr={},lo=!1});function uo(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function tf(){!Zt||!er||(Zt=!1,er.length?Ot=er.concat(Ot):wr=-1,Ot.length&&Ds())}function Ds(){if(!Zt){var o=setTimeout(tf,0);Zt=!0;for(var l=Ot.length;l;){for(er=Ot,Ot=[];++wr<l;)er&&er[wr].run();wr=-1,l=Ot.length}er=null,Zt=!1,clearTimeout(o)}}function rf(o){var l=new Array(arguments.length-1);if(arguments.length>1)for(var a=1;a<arguments.length;a++)l[a-1]=arguments[a];Ot.push(new Fs(o,l)),Ot.length===1&&!Zt&&setTimeout(Ds,0)}function Fs(o,l){this.fun=o,this.array=l}function bt(){}function nf(o){uo("_linkedBinding")}function of(o){uo("dlopen")}function sf(){return[]}function af(){return[]}function lf(o,l){if(!o)throw new Error(l||"assertion error")}function uf(){return!1}function cf(){return Lt.now()/1e3}function co(o){var l=Math.floor((Date.now()-Lt.now())*.001),a=Lt.now()*.001,s=Math.floor(a)+l,u=Math.floor(a%1*1e9);return o&&(s=s-o[0],u=u-o[1],u<0&&(s--,u+=Kr)),[s,u]}function qt(){return ho}function ff(o){return[]}var Ot,Zt,er,wr,Ws,$s,qs,zs,Vs,Ks,Hs,Gs,Ys,Qs,Js,Xs,Zs,ea,ta,ra,na,ia,oa,sa,aa,Vr,la,ua,ca,fa,ha,pa,da,ga,ya,ma,ba,va,wa,_a,Sa,Ea,xa,Aa,Ia,ka,Oa,Ta,Pa,Ca,ja,Lt,fo,Kr,Ra,Na,Ma,Ba,La,Ua,Da,Fa,Wa,$a,qa,ho,za=_t(()=>{de(),ye(),ge(),Ot=[],Zt=!1,wr=-1,Fs.prototype.run=function(){this.fun.apply(null,this.array)},Ws="browser",$s="x64",qs="browser",zs={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Vs=["/usr/bin/node"],Ks=[],Hs="v16.8.0",Gs={},Ys=function(o,l){console.warn((l?l+": ":"")+o)},Qs=function(o){uo("binding")},Js=function(o){return 0},Xs=function(){return"/"},Zs=function(o){},ea={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},ta=bt,ra=[],na={},ia=!1,oa={},sa=bt,aa=bt,Vr=function(){return{}},la=Vr,ua=Vr,ca=bt,fa=bt,ha=bt,pa={},da={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ga=bt,ya=bt,ma=bt,ba=bt,va=bt,wa=bt,_a=bt,Sa=void 0,Ea=void 0,xa=void 0,Aa=bt,Ia=2,ka=1,Oa="/bin/usr/node",Ta=9229,Pa="node",Ca=[],ja=bt,Lt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Lt.now===void 0&&(fo=Date.now(),Lt.timing&&Lt.timing.navigationStart&&(fo=Lt.timing.navigationStart),Lt.now=()=>Date.now()-fo),Kr=1e9,co.bigint=function(o){var l=co(o);return typeof BigInt>"u"?l[0]*Kr+l[1]:BigInt(l[0]*Kr)+BigInt(l[1])},Ra=10,Na={},Ma=0,Ba=qt,La=qt,Ua=qt,Da=qt,Fa=qt,Wa=bt,$a=qt,qa=qt,ho={version:Hs,versions:Gs,arch:$s,platform:qs,release:ea,_rawDebug:ta,moduleLoadList:ra,binding:Qs,_linkedBinding:nf,_events:Na,_eventsCount:Ma,_maxListeners:Ra,on:qt,addListener:Ba,once:La,off:Ua,removeListener:Da,removeAllListeners:Fa,emit:Wa,prependListener:$a,prependOnceListener:qa,listeners:ff,domain:na,_exiting:ia,config:oa,dlopen:of,uptime:cf,_getActiveRequests:sf,_getActiveHandles:af,reallyExit:sa,_kill:aa,cpuUsage:Vr,resourceUsage:la,memoryUsage:ua,kill:ca,exit:fa,openStdin:ha,allowedNodeEnvironmentFlags:pa,assert:lf,features:da,_fatalExceptions:ga,setUncaughtExceptionCaptureCallback:ya,hasUncaughtExceptionCaptureCallback:uf,emitWarning:Ys,nextTick:rf,_tickCallback:ma,_debugProcess:ba,_debugEnd:va,_startProfilerIdleNotifier:wa,_stopProfilerIdleNotifier:_a,stdout:Sa,stdin:xa,stderr:Ea,abort:Aa,umask:Js,chdir:Zs,cwd:Xs,env:zs,title:Ws,argv:Vs,execArgv:Ks,pid:Ia,ppid:ka,execPath:Oa,debugPort:Ta,hrtime:co,argv0:Pa,_preload_modules:Ca,setSourceMapsEnabled:ja}});function hf(){if(po)return Hr;po=!0;var o=ho;function l(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function a(t,r){for(var n="",e=0,i=-1,c=0,h,d=0;d<=t.length;++d){if(d<t.length)h=t.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(i===d-1||c===1))if(i!==d-1&&c===2){if(n.length<2||e!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var y=n.lastIndexOf("/");if(y!==n.length-1){y===-1?(n="",e=0):(n=n.slice(0,y),e=n.length-1-n.lastIndexOf("/")),i=d,c=0;continue}}else if(n.length===2||n.length===1){n="",e=0,i=d,c=0;continue}}r&&(n.length>0?n+="/..":n="..",e=2)}else n.length>0?n+="/"+t.slice(i+1,d):n=t.slice(i+1,d),e=d-i-1;i=d,c=0}else h===46&&c!==-1?++c:c=-1}return n}function s(t,r){var n=r.dir||r.root,e=r.base||(r.name||"")+(r.ext||"");return n?n===r.root?n+e:n+t+e:e}var u={resolve:function(){for(var t="",r=!1,n,e=arguments.length-1;e>=-1&&!r;e--){var i;e>=0?i=arguments[e]:(n===void 0&&(n=o.cwd()),i=n),l(i),i.length!==0&&(t=i+"/"+t,r=i.charCodeAt(0)===47)}return t=a(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(l(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=a(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return l(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var n=arguments[r];l(n),n.length>0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":u.normalize(t)},relative:function(t,r){if(l(t),l(r),t===r||(t=u.resolve(t),r=u.resolve(r),t===r))return"";for(var n=1;n<t.length&&t.charCodeAt(n)===47;++n);for(var e=t.length,i=e-n,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var h=r.length,d=h-c,y=i<d?i:d,b=-1,S=0;S<=y;++S){if(S===y){if(d>y){if(r.charCodeAt(c+S)===47)return r.slice(c+S+1);if(S===0)return r.slice(c+S)}else i>y&&(t.charCodeAt(n+S)===47?b=S:S===0&&(b=0));break}var w=t.charCodeAt(n+S),x=r.charCodeAt(c+S);if(w!==x)break;w===47&&(b=S)}var g="";for(S=n+b+1;S<=e;++S)(S===e||t.charCodeAt(S)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(c+b):(c+=b,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(t){return t},dirname:function(t){if(l(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,e=-1,i=!0,c=t.length-1;c>=1;--c)if(r=t.charCodeAt(c),r===47){if(!i){e=c;break}}else i=!1;return e===-1?n?"/":".":n&&e===1?"//":t.slice(0,e)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');l(t);var n=0,e=-1,i=!0,c;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var h=r.length-1,d=-1;for(c=t.length-1;c>=0;--c){var y=t.charCodeAt(c);if(y===47){if(!i){n=c+1;break}}else d===-1&&(i=!1,d=c+1),h>=0&&(y===r.charCodeAt(h)?--h===-1&&(e=c):(h=-1,e=d))}return n===e?e=d:e===-1&&(e=t.length),t.slice(n,e)}else{for(c=t.length-1;c>=0;--c)if(t.charCodeAt(c)===47){if(!i){n=c+1;break}}else e===-1&&(i=!1,e=c+1);return e===-1?"":t.slice(n,e)}},extname:function(t){l(t);for(var r=-1,n=0,e=-1,i=!0,c=0,h=t.length-1;h>=0;--h){var d=t.charCodeAt(h);if(d===47){if(!i){n=h+1;break}continue}e===-1&&(i=!1,e=h+1),d===46?r===-1?r=h:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||e===-1||c===0||c===1&&r===e-1&&r===n+1?"":t.slice(r,e)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return s("/",t)},parse:function(t){l(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),e=n===47,i;e?(r.root="/",i=1):i=0;for(var c=-1,h=0,d=-1,y=!0,b=t.length-1,S=0;b>=i;--b){if(n=t.charCodeAt(b),n===47){if(!y){h=b+1;break}continue}d===-1&&(y=!1,d=b+1),n===46?c===-1?c=b:S!==1&&(S=1):c!==-1&&(S=-1)}return c===-1||d===-1||S===0||S===1&&c===d-1&&c===h+1?d!==-1&&(h===0&&e?r.base=r.name=t.slice(1,d):r.base=r.name=t.slice(h,d)):(h===0&&e?(r.name=t.slice(1,c),r.base=t.slice(1,d)):(r.name=t.slice(h,c),r.base=t.slice(h,d)),r.ext=t.slice(c,d)),h>0?r.dir=t.slice(0,h-1):e&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return u.posix=u,Hr=u,Hr}var Hr,po,go,pf=_t(()=>{de(),ye(),ge(),za(),Hr={},po=!1,go=hf()}),Va={};nr(Va,{URL:()=>rl,Url:()=>Ja,default:()=>vt,fileURLToPath:()=>Ha,format:()=>Xa,parse:()=>tl,pathToFileURL:()=>Ga,resolve:()=>Za,resolveObject:()=>el});function df(){if(mo)return Gr;mo=!0;var o=typeof Map=="function"&&Map.prototype,l=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,a=o&&l&&typeof l.get=="function"?l.get:null,s=o&&Map.prototype.forEach,u=typeof Set=="function"&&Set.prototype,t=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,r=u&&t&&typeof t.get=="function"?t.get:null,n=u&&Set.prototype.forEach,e=typeof WeakMap=="function"&&WeakMap.prototype,i=e?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,h=c?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,y=d?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,S=Object.prototype.toString,w=Function.prototype.toString,x=String.prototype.match,g=String.prototype.slice,_=String.prototype.replace,E=String.prototype.toUpperCase,v=String.prototype.toLowerCase,C=RegExp.prototype.test,P=Array.prototype.concat,I=Array.prototype.join,T=Array.prototype.slice,k=Math.floor,W=typeof BigInt=="function"?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,q=typeof Symbol=="function"&&typeof Symbol.iterator=="object",M=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===q||!0)?Symbol.toStringTag:null,le=Object.prototype.propertyIsEnumerable,re=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function ee($,J){if($===1/0||$===-1/0||$!==$||$&&$>-1e3&&$<1e3||C.call(/e/,J))return J;var Te=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $=="number"){var Re=$<0?-k(-$):k($);if(Re!==$){var Ne=String(Re),Fe=g.call(J,Ne.length+1);return _.call(Ne,Te,"$&_")+"."+_.call(_.call(Fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(J,Te,"$&_")}var ue=Ya,G=ue.custom,oe=te(G)?G:null;Gr=function $(J,Te,Re,Ne){var Fe=Te||{};if(ce(Fe,"quoteStyle")&&Fe.quoteStyle!=="single"&&Fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ce(Fe,"maxStringLength")&&(typeof Fe.maxStringLength=="number"?Fe.maxStringLength<0&&Fe.maxStringLength!==1/0:Fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var nt=ce(Fe,"customInspect")?Fe.customInspect:!0;if(typeof nt!="boolean"&&nt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ce(Fe,"indent")&&Fe.indent!==null&&Fe.indent!==" "&&!(parseInt(Fe.indent,10)===Fe.indent&&Fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ce(Fe,"numericSeparator")&&typeof Fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var rt=Fe.numericSeparator;if(typeof J>"u")return"undefined";if(J===null)return"null";if(typeof J=="boolean")return J?"true":"false";if(typeof J=="string")return fe(J,Fe);if(typeof J=="number"){if(J===0)return 1/0/J>0?"0":"-0";var Ke=String(J);return rt?ee(J,Ke):Ke}if(typeof J=="bigint"){var Xe=String(J)+"n";return rt?ee(J,Xe):Xe}var Ue=typeof Fe.depth>"u"?5:Fe.depth;if(typeof Re>"u"&&(Re=0),Re>=Ue&&Ue>0&&typeof J=="object")return he(J)?"[Array]":"[Object]";var Ye=B(Fe,Re);if(typeof Ne>"u")Ne=[];else if(se(Ne,J)>=0)return"[Circular]";function Ze(Ge,Ve,ze){if(Ve&&(Ne=T.call(Ne),Ne.push(Ve)),ze){var it={depth:Fe.depth};return ce(Fe,"quoteStyle")&&(it.quoteStyle=Fe.quoteStyle),$(Ge,it,Re+1,Ne)}return $(Ge,Fe,Re+1,Ne)}if(typeof J=="function"&&!Ee(J)){var lt=Y(J),ct=ie(J,Ze);return"[Function"+(lt?": "+lt:" (anonymous)")+"]"+(ct.length>0?" { "+I.call(ct,", ")+" }":"")}if(te(J)){var Et=q?_.call(String(J),/^(Symbol\(.*\))_[^)]*$/,"$1"):N.call(J);return typeof J=="object"&&!q?f(Et):Et}if(Ie(J)){for(var j="<"+v.call(String(J.nodeName)),U=J.attributes||[],Ae=0;Ae<U.length;Ae++)j+=" "+U[Ae].name+"="+R(Q(U[Ae].value),"double",Fe);return j+=">",J.childNodes&&J.childNodes.length&&(j+="..."),j+="</"+v.call(String(J.nodeName))+">",j}if(he(J)){if(J.length===0)return"[]";var Ce=ie(J,Ze);return Ye&&!O(Ce)?"["+V(Ce,Ye)+"]":"[ "+I.call(Ce,", ")+" ]"}if(X(J)){var Be=ie(J,Ze);return!("cause"in Error.prototype)&&"cause"in J&&!le.call(J,"cause")?"{ ["+String(J)+"] "+I.call(P.call("[cause]: "+Ze(J.cause),Be),", ")+" }":Be.length===0?"["+String(J)+"]":"{ ["+String(J)+"] "+I.call(Be,", ")+" }"}if(typeof J=="object"&&nt){if(oe&&typeof J[oe]=="function"&&ue)return ue(J,{depth:Ue-Re});if(nt!=="symbol"&&typeof J.inspect=="function")return J.inspect()}if(me(J)){var ft=[];return s&&s.call(J,function(Ge,Ve){ft.push(Ze(Ve,J,!0)+" => "+Ze(Ge,J))}),m("Map",a.call(J),ft,Ye)}if(Z(J)){var yt=[];return n&&n.call(J,function(Ge){yt.push(Ze(Ge,J))}),m("Set",r.call(J),yt,Ye)}if(pe(J))return p("WeakMap");if(ve(J))return p("WeakSet");if(_e(J))return p("WeakRef");if(ae(J))return f(Ze(Number(J)));if(ne(J))return f(Ze(W.call(J)));if(H(J))return f(b.call(J));if(D(J))return f(Ze(String(J)));if(typeof window<"u"&&J===window)return"{ [object Window] }";if(typeof globalThis<"u"&&J===globalThis||typeof Yr<"u"&&J===Yr)return"{ [object globalThis] }";if(!z(J)&&!Ee(J)){var At=ie(J,Ze),K=re?re(J)===Object.prototype:J instanceof Object||J.constructor===Object,xe=J instanceof Object?"":"null prototype",je=!K&&M&&Object(J)===J&&M in J?g.call(L(J),8,-1):xe?"Object":"",We=K||typeof J.constructor!="function"?"":J.constructor.name?J.constructor.name+" ":"",He=We+(je||xe?"["+I.call(P.call([],je||[],xe||[]),": ")+"] ":"");return At.length===0?He+"{}":Ye?He+"{"+V(At,Ye)+"}":He+"{ "+I.call(At,", ")+" }"}return String(J)};function R($,J,Te){var Re=(Te.quoteStyle||J)==="double"?'"':"'";return Re+$+Re}function Q($){return _.call(String($),/"/g,""")}function he($){return L($)==="[object Array]"&&(!M||!(typeof $=="object"&&M in $))}function z($){return L($)==="[object Date]"&&(!M||!(typeof $=="object"&&M in $))}function Ee($){return L($)==="[object RegExp]"&&(!M||!(typeof $=="object"&&M in $))}function X($){return L($)==="[object Error]"&&(!M||!(typeof $=="object"&&M in $))}function D($){return L($)==="[object String]"&&(!M||!(typeof $=="object"&&M in $))}function ae($){return L($)==="[object Number]"&&(!M||!(typeof $=="object"&&M in $))}function H($){return L($)==="[object Boolean]"&&(!M||!(typeof $=="object"&&M in $))}function te($){if(q)return $&&typeof $=="object"&&$ instanceof Symbol;if(typeof $=="symbol")return!0;if(!$||typeof $!="object"||!N)return!1;try{return N.call($),!0}catch{}return!1}function ne($){if(!$||typeof $!="object"||!W)return!1;try{return W.call($),!0}catch{}return!1}var be=Object.prototype.hasOwnProperty||function($){return $ in(this||Yr)};function ce($,J){return be.call($,J)}function L($){return S.call($)}function Y($){if($.name)return $.name;var J=x.call(w.call($),/^function\s*([\w$]+)/);return J?J[1]:null}function se($,J){if($.indexOf)return $.indexOf(J);for(var Te=0,Re=$.length;Te<Re;Te++)if($[Te]===J)return Te;return-1}function me($){if(!a||!$||typeof $!="object")return!1;try{a.call($);try{r.call($)}catch{return!0}return $ instanceof Map}catch{}return!1}function pe($){if(!i||!$||typeof $!="object")return!1;try{i.call($,i);try{h.call($,h)}catch{return!0}return $ instanceof WeakMap}catch{}return!1}function _e($){if(!y||!$||typeof $!="object")return!1;try{return y.call($),!0}catch{}return!1}function Z($){if(!r||!$||typeof $!="object")return!1;try{r.call($);try{a.call($)}catch{return!0}return $ instanceof Set}catch{}return!1}function ve($){if(!h||!$||typeof $!="object")return!1;try{h.call($,h);try{i.call($,i)}catch{return!0}return $ instanceof WeakSet}catch{}return!1}function Ie($){return!$||typeof $!="object"?!1:typeof HTMLElement<"u"&&$ instanceof HTMLElement?!0:typeof $.nodeName=="string"&&typeof $.getAttribute=="function"}function fe($,J){if($.length>J.maxStringLength){var Te=$.length-J.maxStringLength,Re="... "+Te+" more character"+(Te>1?"s":"");return fe(g.call($,0,J.maxStringLength),J)+Re}var Ne=_.call(_.call($,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,De);return R(Ne,"single",J)}function De($){var J=$.charCodeAt(0),Te={8:"b",9:"t",10:"n",12:"f",13:"r"}[J];return Te?"\\"+Te:"\\x"+(J<16?"0":"")+E.call(J.toString(16))}function f($){return"Object("+$+")"}function p($){return $+" { ? }"}function m($,J,Te,Re){var Ne=Re?V(Te,Re):I.call(Te,", ");return $+" ("+J+") {"+Ne+"}"}function O($){for(var J=0;J<$.length;J++)if(se($[J],`
|
|
30
|
+
<%s key={someKey} {...props} />`,Do,rr,kh,rr),Ae[rr+Do]=!0}}return K===a?U(ht):j(ht),ht}}function Be(K,xe,je){return Ce(K,xe,je,!0)}function ft(K,xe,je){return Ce(K,xe,je,!1)}var yt=ft,At=Be;hr.Fragment=a,hr.jsx=yt,hr.jsxs=At}()),hr}process.env.NODE_ENV==="production"?hn.exports=gu():hn.exports=yu();var ke=hn.exports;const pn=Oe.createContext(null),mu=({children:o,manifest:l})=>{const[s,a]=Oe.useState(l),[u,t]=Oe.useState(!1),r=Oe.useRef(!1);return Oe.useEffect(()=>{if(r.current)return;r.current=!0;const n=e=>{var i;if(((i=e.data)==null?void 0:i.type)==="RAMME_SYNC_MANIFEST"){const c=e.data.payload;a(c),t(!0)}};return window.addEventListener("message",n),window.parent!==window&&!window.__RAMME_HANDSHAKE_SENT&&(console.log("🔌 [Context] Handshake Sent 🤝"),window.parent.postMessage({type:"RAMME_CLIENT_READY"},"*"),window.__RAMME_HANDSHAKE_SENT=!0),()=>{window.removeEventListener("message",n),r.current=!1}},[]),ke.jsx(pn.Provider,{value:{manifest:s,isLive:u},children:o})},Ut=()=>{const o=Oe.useContext(pn);if(!o)throw new Error("useManifest must be used within a ManifestProvider");return o.manifest},dn=()=>{const o=Oe.useContext(pn);return o!=null&&o.isLive?"live":"static"};var gn=Object.defineProperty,bu=Object.getOwnPropertyDescriptor,vu=Object.getOwnPropertyNames,wu=Object.prototype.hasOwnProperty,_t=(o,l)=>()=>(o&&(l=o(o=0)),l),we=(o,l)=>()=>(l||o((l={exports:{}}).exports,l),l.exports),nr=(o,l)=>{for(var s in l)gn(o,s,{get:l[s],enumerable:!0})},_u=(o,l,s,a)=>{if(l&&typeof l=="object"||typeof l=="function")for(let u of vu(l))!wu.call(o,u)&&u!==s&&gn(o,u,{get:()=>l[u],enumerable:!(a=bu(l,u))||a.enumerable});return o},tt=o=>_u(gn({},"__esModule",{value:!0}),o),de=_t(()=>{}),Je={};nr(Je,{_debugEnd:()=>Qn,_debugProcess:()=>Yn,_events:()=>hi,_eventsCount:()=>pi,_exiting:()=>Nn,_fatalExceptions:()=>Kn,_getActiveHandles:()=>es,_getActiveRequests:()=>Zo,_kill:()=>Un,_linkedBinding:()=>Jo,_maxListeners:()=>fi,_preload_modules:()=>li,_rawDebug:()=>jn,_startProfilerIdleNotifier:()=>Jn,_stopProfilerIdleNotifier:()=>Xn,_tickCallback:()=>Gn,abort:()=>ri,addListener:()=>di,allowedNodeEnvironmentFlags:()=>zn,arch:()=>bn,argv:()=>_n,argv0:()=>ai,assert:()=>ts,binding:()=>In,browser:()=>Cn,chdir:()=>Tn,config:()=>Bn,cpuUsage:()=>dr,cwd:()=>On,debugPort:()=>si,default:()=>Si,dlopen:()=>Xo,domain:()=>Mn,emit:()=>vi,emitWarning:()=>An,env:()=>wn,execArgv:()=>Sn,execPath:()=>oi,exit:()=>$n,features:()=>Vn,hasUncaughtExceptionCaptureCallback:()=>rs,hrtime:()=>Er,kill:()=>Wn,listeners:()=>is,memoryUsage:()=>Fn,moduleLoadList:()=>Rn,nextTick:()=>Yo,off:()=>yi,on:()=>Tt,once:()=>gi,openStdin:()=>qn,pid:()=>ni,platform:()=>vn,ppid:()=>ii,prependListener:()=>wi,prependOnceListener:()=>_i,reallyExit:()=>Ln,release:()=>Pn,removeAllListeners:()=>bi,removeListener:()=>mi,resourceUsage:()=>Dn,setSourceMapsEnabled:()=>ui,setUncaughtExceptionCaptureCallback:()=>Hn,stderr:()=>ei,stdin:()=>ti,stdout:()=>Zn,title:()=>mn,umask:()=>kn,uptime:()=>ns,version:()=>En,versions:()=>xn});function yn(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function Su(){!Gt||!Yt||(Gt=!1,Yt.length?kt=Yt.concat(kt):pr=-1,kt.length&&Go())}function Go(){if(!Gt){var o=setTimeout(Su,0);Gt=!0;for(var l=kt.length;l;){for(Yt=kt,kt=[];++pr<l;)Yt&&Yt[pr].run();pr=-1,l=kt.length}Yt=null,Gt=!1,clearTimeout(o)}}function Yo(o){var l=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)l[s-1]=arguments[s];kt.push(new Qo(o,l)),kt.length===1&&!Gt&&setTimeout(Go,0)}function Qo(o,l){this.fun=o,this.array=l}function mt(){}function Jo(o){yn("_linkedBinding")}function Xo(o){yn("dlopen")}function Zo(){return[]}function es(){return[]}function ts(o,l){if(!o)throw new Error(l||"assertion error")}function rs(){return!1}function ns(){return Pt.now()/1e3}function Er(o){var l=Math.floor((Date.now()-Pt.now())*.001),s=Pt.now()*.001,a=Math.floor(s)+l,u=Math.floor(s%1*1e9);return o&&(a=a-o[0],u=u-o[1],u<0&&(a--,u+=xr)),[a,u]}function Tt(){return Si}function is(o){return[]}var kt,Gt,Yt,pr,mn,bn,vn,wn,_n,Sn,En,xn,An,In,kn,On,Tn,Pn,Cn,jn,Rn,Mn,Nn,Bn,Ln,Un,dr,Dn,Fn,Wn,$n,qn,zn,Vn,Kn,Hn,Gn,Yn,Qn,Jn,Xn,Zn,ei,ti,ri,ni,ii,oi,si,ai,li,ui,Pt,ci,xr,fi,hi,pi,di,gi,yi,mi,bi,vi,wi,_i,Si,Eu=_t(()=>{de(),ye(),ge(),kt=[],Gt=!1,pr=-1,Qo.prototype.run=function(){this.fun.apply(null,this.array)},mn="browser",bn="x64",vn="browser",wn={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},_n=["/usr/bin/node"],Sn=[],En="v16.8.0",xn={},An=function(o,l){console.warn((l?l+": ":"")+o)},In=function(o){yn("binding")},kn=function(o){return 0},On=function(){return"/"},Tn=function(o){},Pn={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},Cn=!0,jn=mt,Rn=[],Mn={},Nn=!1,Bn={},Ln=mt,Un=mt,dr=function(){return{}},Dn=dr,Fn=dr,Wn=mt,$n=mt,qn=mt,zn={},Vn={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},Kn=mt,Hn=mt,Gn=mt,Yn=mt,Qn=mt,Jn=mt,Xn=mt,Zn=void 0,ei=void 0,ti=void 0,ri=mt,ni=2,ii=1,oi="/bin/usr/node",si=9229,ai="node",li=[],ui=mt,Pt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Pt.now===void 0&&(ci=Date.now(),Pt.timing&&Pt.timing.navigationStart&&(ci=Pt.timing.navigationStart),Pt.now=()=>Date.now()-ci),xr=1e9,Er.bigint=function(o){var l=Er(o);return typeof BigInt>"u"?l[0]*xr+l[1]:BigInt(l[0]*xr)+BigInt(l[1])},fi=10,hi={},pi=0,di=Tt,gi=Tt,yi=Tt,mi=Tt,bi=Tt,vi=mt,wi=Tt,_i=Tt,Si={version:En,versions:xn,arch:bn,platform:vn,browser:Cn,release:Pn,_rawDebug:jn,moduleLoadList:Rn,binding:In,_linkedBinding:Jo,_events:hi,_eventsCount:pi,_maxListeners:fi,on:Tt,addListener:di,once:gi,off:yi,removeListener:mi,removeAllListeners:bi,emit:vi,prependListener:wi,prependOnceListener:_i,listeners:is,domain:Mn,_exiting:Nn,config:Bn,dlopen:Xo,uptime:ns,_getActiveRequests:Zo,_getActiveHandles:es,reallyExit:Ln,_kill:Un,cpuUsage:dr,resourceUsage:Dn,memoryUsage:Fn,kill:Wn,exit:$n,openStdin:qn,allowedNodeEnvironmentFlags:zn,assert:ts,features:Vn,_fatalExceptions:Kn,setUncaughtExceptionCaptureCallback:Hn,hasUncaughtExceptionCaptureCallback:rs,emitWarning:An,nextTick:Yo,_tickCallback:Gn,_debugProcess:Yn,_debugEnd:Qn,_startProfilerIdleNotifier:Jn,_stopProfilerIdleNotifier:Xn,stdout:Zn,stdin:ti,stderr:ei,abort:ri,umask:kn,chdir:Tn,cwd:On,env:wn,title:mn,argv:_n,execArgv:Sn,pid:ni,ppid:ii,execPath:oi,debugPort:si,hrtime:Er,argv0:ai,_preload_modules:li,setSourceMapsEnabled:ui}}),ge=_t(()=>{Eu()});function xu(){if(Ei)return ir;Ei=!0,ir.byteLength=n,ir.toByteArray=i,ir.fromByteArray=d;for(var o=[],l=[],s=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,t=a.length;u<t;++u)o[u]=a[u],l[a.charCodeAt(u)]=u;l[45]=62,l[95]=63;function r(y){var b=y.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var S=y.indexOf("=");S===-1&&(S=b);var w=S===b?0:4-S%4;return[S,w]}function n(y){var b=r(y),S=b[0],w=b[1];return(S+w)*3/4-w}function e(y,b,S){return(b+S)*3/4-S}function i(y){var b,S=r(y),w=S[0],x=S[1],g=new s(e(y,w,x)),_=0,E=x>0?w-4:w,v;for(v=0;v<E;v+=4)b=l[y.charCodeAt(v)]<<18|l[y.charCodeAt(v+1)]<<12|l[y.charCodeAt(v+2)]<<6|l[y.charCodeAt(v+3)],g[_++]=b>>16&255,g[_++]=b>>8&255,g[_++]=b&255;return x===2&&(b=l[y.charCodeAt(v)]<<2|l[y.charCodeAt(v+1)]>>4,g[_++]=b&255),x===1&&(b=l[y.charCodeAt(v)]<<10|l[y.charCodeAt(v+1)]<<4|l[y.charCodeAt(v+2)]>>2,g[_++]=b>>8&255,g[_++]=b&255),g}function c(y){return o[y>>18&63]+o[y>>12&63]+o[y>>6&63]+o[y&63]}function h(y,b,S){for(var w,x=[],g=b;g<S;g+=3)w=(y[g]<<16&16711680)+(y[g+1]<<8&65280)+(y[g+2]&255),x.push(c(w));return x.join("")}function d(y){for(var b,S=y.length,w=S%3,x=[],g=16383,_=0,E=S-w;_<E;_+=g)x.push(h(y,_,_+g>E?E:_+g));return w===1?(b=y[S-1],x.push(o[b>>2]+o[b<<4&63]+"==")):w===2&&(b=(y[S-2]<<8)+y[S-1],x.push(o[b>>10]+o[b>>4&63]+o[b<<2&63]+"=")),x.join("")}return ir}function Au(){return xi?gr:(xi=!0,gr.read=function(o,l,s,a,u){var t,r,n=u*8-a-1,e=(1<<n)-1,i=e>>1,c=-7,h=s?u-1:0,d=s?-1:1,y=o[l+h];for(h+=d,t=y&(1<<-c)-1,y>>=-c,c+=n;c>0;t=t*256+o[l+h],h+=d,c-=8);for(r=t&(1<<-c)-1,t>>=-c,c+=a;c>0;r=r*256+o[l+h],h+=d,c-=8);if(t===0)t=1-i;else{if(t===e)return r?NaN:(y?-1:1)*(1/0);r=r+Math.pow(2,a),t=t-i}return(y?-1:1)*r*Math.pow(2,t-a)},gr.write=function(o,l,s,a,u,t){var r,n,e,i=t*8-u-1,c=(1<<i)-1,h=c>>1,d=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,y=a?0:t-1,b=a?1:-1,S=l<0||l===0&&1/l<0?1:0;for(l=Math.abs(l),isNaN(l)||l===1/0?(n=isNaN(l)?1:0,r=c):(r=Math.floor(Math.log(l)/Math.LN2),l*(e=Math.pow(2,-r))<1&&(r--,e*=2),r+h>=1?l+=d/e:l+=d*Math.pow(2,1-h),l*e>=2&&(r++,e/=2),r+h>=c?(n=0,r=c):r+h>=1?(n=(l*e-1)*Math.pow(2,u),r=r+h):(n=l*Math.pow(2,h-1)*Math.pow(2,u),r=0));u>=8;o[s+y]=n&255,y+=b,n/=256,u-=8);for(r=r<<u|n,i+=u;i>0;o[s+y]=r&255,y+=b,r/=256,i-=8);o[s+y-b]|=S*128},gr)}function Iu(){if(Ai)return Dt;Ai=!0;let o=xu(),l=Au(),s=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Dt.Buffer=r,Dt.SlowBuffer=x,Dt.INSPECT_MAX_BYTES=50;let a=2147483647;Dt.kMaxLength=a,r.TYPED_ARRAY_SUPPORT=u(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function u(){try{let f=new Uint8Array(1),p={foo:function(){return 42}};return Object.setPrototypeOf(p,Uint8Array.prototype),Object.setPrototypeOf(f,p),f.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function t(f){if(f>a)throw new RangeError('The value "'+f+'" is invalid for option "size"');let p=new Uint8Array(f);return Object.setPrototypeOf(p,r.prototype),p}function r(f,p,m){if(typeof f=="number"){if(typeof p=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return c(f)}return n(f,p,m)}r.poolSize=8192;function n(f,p,m){if(typeof f=="string")return h(f,p);if(ArrayBuffer.isView(f))return y(f);if(f==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f);if(Z(f,ArrayBuffer)||f&&Z(f.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Z(f,SharedArrayBuffer)||f&&Z(f.buffer,SharedArrayBuffer)))return b(f,p,m);if(typeof f=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let O=f.valueOf&&f.valueOf();if(O!=null&&O!==f)return r.from(O,p,m);let B=S(f);if(B)return B;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof f[Symbol.toPrimitive]=="function")return r.from(f[Symbol.toPrimitive]("string"),p,m);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof f)}r.from=function(f,p,m){return n(f,p,m)},Object.setPrototypeOf(r.prototype,Uint8Array.prototype),Object.setPrototypeOf(r,Uint8Array);function e(f){if(typeof f!="number")throw new TypeError('"size" argument must be of type number');if(f<0)throw new RangeError('The value "'+f+'" is invalid for option "size"')}function i(f,p,m){return e(f),f<=0?t(f):p!==void 0?typeof m=="string"?t(f).fill(p,m):t(f).fill(p):t(f)}r.alloc=function(f,p,m){return i(f,p,m)};function c(f){return e(f),t(f<0?0:w(f)|0)}r.allocUnsafe=function(f){return c(f)},r.allocUnsafeSlow=function(f){return c(f)};function h(f,p){if((typeof p!="string"||p==="")&&(p="utf8"),!r.isEncoding(p))throw new TypeError("Unknown encoding: "+p);let m=g(f,p)|0,O=t(m),B=O.write(f,p);return B!==m&&(O=O.slice(0,B)),O}function d(f){let p=f.length<0?0:w(f.length)|0,m=t(p);for(let O=0;O<p;O+=1)m[O]=f[O]&255;return m}function y(f){if(Z(f,Uint8Array)){let p=new Uint8Array(f);return b(p.buffer,p.byteOffset,p.byteLength)}return d(f)}function b(f,p,m){if(p<0||f.byteLength<p)throw new RangeError('"offset" is outside of buffer bounds');if(f.byteLength<p+(m||0))throw new RangeError('"length" is outside of buffer bounds');let O;return p===void 0&&m===void 0?O=new Uint8Array(f):m===void 0?O=new Uint8Array(f,p):O=new Uint8Array(f,p,m),Object.setPrototypeOf(O,r.prototype),O}function S(f){if(r.isBuffer(f)){let p=w(f.length)|0,m=t(p);return m.length===0||f.copy(m,0,0,p),m}if(f.length!==void 0)return typeof f.length!="number"||ve(f.length)?t(0):d(f);if(f.type==="Buffer"&&Array.isArray(f.data))return d(f.data)}function w(f){if(f>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return f|0}function x(f){return+f!=f&&(f=0),r.alloc(+f)}r.isBuffer=function(f){return f!=null&&f._isBuffer===!0&&f!==r.prototype},r.compare=function(f,p){if(Z(f,Uint8Array)&&(f=r.from(f,f.offset,f.byteLength)),Z(p,Uint8Array)&&(p=r.from(p,p.offset,p.byteLength)),!r.isBuffer(f)||!r.isBuffer(p))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(f===p)return 0;let m=f.length,O=p.length;for(let B=0,V=Math.min(m,O);B<V;++B)if(f[B]!==p[B]){m=f[B],O=p[B];break}return m<O?-1:O<m?1:0},r.isEncoding=function(f){switch(String(f).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}},r.concat=function(f,p){if(!Array.isArray(f))throw new TypeError('"list" argument must be an Array of Buffers');if(f.length===0)return r.alloc(0);let m;if(p===void 0)for(p=0,m=0;m<f.length;++m)p+=f[m].length;let O=r.allocUnsafe(p),B=0;for(m=0;m<f.length;++m){let V=f[m];if(Z(V,Uint8Array))B+V.length>O.length?(r.isBuffer(V)||(V=r.from(V)),V.copy(O,B)):Uint8Array.prototype.set.call(O,V,B);else if(r.isBuffer(V))V.copy(O,B);else throw new TypeError('"list" argument must be an Array of Buffers');B+=V.length}return O};function g(f,p){if(r.isBuffer(f))return f.length;if(ArrayBuffer.isView(f)||Z(f,ArrayBuffer))return f.byteLength;if(typeof f!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof f);let m=f.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&m===0)return 0;let B=!1;for(;;)switch(p){case"ascii":case"latin1":case"binary":return m;case"utf8":case"utf-8":return Y(f).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return m*2;case"hex":return m>>>1;case"base64":return pe(f).length;default:if(B)return O?-1:Y(f).length;p=(""+p).toLowerCase(),B=!0}}r.byteLength=g;function _(f,p,m){let O=!1;if((p===void 0||p<0)&&(p=0),p>this.length||((m===void 0||m>this.length)&&(m=this.length),m<=0)||(m>>>=0,p>>>=0,m<=p))return"";for(f||(f="utf8");;)switch(f){case"hex":return ee(this,p,m);case"utf8":case"utf-8":return M(this,p,m);case"ascii":return le(this,p,m);case"latin1":case"binary":return re(this,p,m);case"base64":return A(this,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ue(this,p,m);default:if(O)throw new TypeError("Unknown encoding: "+f);f=(f+"").toLowerCase(),O=!0}}r.prototype._isBuffer=!0;function E(f,p,m){let O=f[p];f[p]=f[m],f[m]=O}r.prototype.swap16=function(){let f=this.length;if(f%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let p=0;p<f;p+=2)E(this,p,p+1);return this},r.prototype.swap32=function(){let f=this.length;if(f%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let p=0;p<f;p+=4)E(this,p,p+3),E(this,p+1,p+2);return this},r.prototype.swap64=function(){let f=this.length;if(f%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let p=0;p<f;p+=8)E(this,p,p+7),E(this,p+1,p+6),E(this,p+2,p+5),E(this,p+3,p+4);return this},r.prototype.toString=function(){let f=this.length;return f===0?"":arguments.length===0?M(this,0,f):_.apply(this,arguments)},r.prototype.toLocaleString=r.prototype.toString,r.prototype.equals=function(f){if(!r.isBuffer(f))throw new TypeError("Argument must be a Buffer");return this===f?!0:r.compare(this,f)===0},r.prototype.inspect=function(){let f="",p=Dt.INSPECT_MAX_BYTES;return f=this.toString("hex",0,p).replace(/(.{2})/g,"$1 ").trim(),this.length>p&&(f+=" ... "),"<Buffer "+f+">"},s&&(r.prototype[s]=r.prototype.inspect),r.prototype.compare=function(f,p,m,O,B){if(Z(f,Uint8Array)&&(f=r.from(f,f.offset,f.byteLength)),!r.isBuffer(f))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof f);if(p===void 0&&(p=0),m===void 0&&(m=f?f.length:0),O===void 0&&(O=0),B===void 0&&(B=this.length),p<0||m>f.length||O<0||B>this.length)throw new RangeError("out of range index");if(O>=B&&p>=m)return 0;if(O>=B)return-1;if(p>=m)return 1;if(p>>>=0,m>>>=0,O>>>=0,B>>>=0,this===f)return 0;let V=B-O,ie=m-p,$=Math.min(V,ie),J=this.slice(O,B),Te=f.slice(p,m);for(let Re=0;Re<$;++Re)if(J[Re]!==Te[Re]){V=J[Re],ie=Te[Re];break}return V<ie?-1:ie<V?1:0};function v(f,p,m,O,B){if(f.length===0)return-1;if(typeof m=="string"?(O=m,m=0):m>2147483647?m=2147483647:m<-2147483648&&(m=-2147483648),m=+m,ve(m)&&(m=B?0:f.length-1),m<0&&(m=f.length+m),m>=f.length){if(B)return-1;m=f.length-1}else if(m<0)if(B)m=0;else return-1;if(typeof p=="string"&&(p=r.from(p,O)),r.isBuffer(p))return p.length===0?-1:C(f,p,m,O,B);if(typeof p=="number")return p=p&255,typeof Uint8Array.prototype.indexOf=="function"?B?Uint8Array.prototype.indexOf.call(f,p,m):Uint8Array.prototype.lastIndexOf.call(f,p,m):C(f,[p],m,O,B);throw new TypeError("val must be string, number or Buffer")}function C(f,p,m,O,B){let V=1,ie=f.length,$=p.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(f.length<2||p.length<2)return-1;V=2,ie/=2,$/=2,m/=2}function J(Re,Me){return V===1?Re[Me]:Re.readUInt16BE(Me*V)}let Te;if(B){let Re=-1;for(Te=m;Te<ie;Te++)if(J(f,Te)===J(p,Re===-1?0:Te-Re)){if(Re===-1&&(Re=Te),Te-Re+1===$)return Re*V}else Re!==-1&&(Te-=Te-Re),Re=-1}else for(m+$>ie&&(m=ie-$),Te=m;Te>=0;Te--){let Re=!0;for(let Me=0;Me<$;Me++)if(J(f,Te+Me)!==J(p,Me)){Re=!1;break}if(Re)return Te}return-1}r.prototype.includes=function(f,p,m){return this.indexOf(f,p,m)!==-1},r.prototype.indexOf=function(f,p,m){return v(this,f,p,m,!0)},r.prototype.lastIndexOf=function(f,p,m){return v(this,f,p,m,!1)};function P(f,p,m,O){m=Number(m)||0;let B=f.length-m;O?(O=Number(O),O>B&&(O=B)):O=B;let V=p.length;O>V/2&&(O=V/2);let ie;for(ie=0;ie<O;++ie){let $=parseInt(p.substr(ie*2,2),16);if(ve($))return ie;f[m+ie]=$}return ie}function I(f,p,m,O){return _e(Y(p,f.length-m),f,m,O)}function T(f,p,m,O){return _e(se(p),f,m,O)}function k(f,p,m,O){return _e(pe(p),f,m,O)}function W(f,p,m,O){return _e(me(p,f.length-m),f,m,O)}r.prototype.write=function(f,p,m,O){if(p===void 0)O="utf8",m=this.length,p=0;else if(m===void 0&&typeof p=="string")O=p,m=this.length,p=0;else if(isFinite(p))p=p>>>0,isFinite(m)?(m=m>>>0,O===void 0&&(O="utf8")):(O=m,m=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let B=this.length-p;if((m===void 0||m>B)&&(m=B),f.length>0&&(m<0||p<0)||p>this.length)throw new RangeError("Attempt to write outside buffer bounds");O||(O="utf8");let V=!1;for(;;)switch(O){case"hex":return P(this,f,p,m);case"utf8":case"utf-8":return I(this,f,p,m);case"ascii":case"latin1":case"binary":return T(this,f,p,m);case"base64":return k(this,f,p,m);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,f,p,m);default:if(V)throw new TypeError("Unknown encoding: "+O);O=(""+O).toLowerCase(),V=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(f,p,m){return p===0&&m===f.length?o.fromByteArray(f):o.fromByteArray(f.slice(p,m))}function M(f,p,m){m=Math.min(f.length,m);let O=[],B=p;for(;B<m;){let V=f[B],ie=null,$=V>239?4:V>223?3:V>191?2:1;if(B+$<=m){let J,Te,Re,Me;switch($){case 1:V<128&&(ie=V);break;case 2:J=f[B+1],(J&192)===128&&(Me=(V&31)<<6|J&63,Me>127&&(ie=Me));break;case 3:J=f[B+1],Te=f[B+2],(J&192)===128&&(Te&192)===128&&(Me=(V&15)<<12|(J&63)<<6|Te&63,Me>2047&&(Me<55296||Me>57343)&&(ie=Me));break;case 4:J=f[B+1],Te=f[B+2],Re=f[B+3],(J&192)===128&&(Te&192)===128&&(Re&192)===128&&(Me=(V&15)<<18|(J&63)<<12|(Te&63)<<6|Re&63,Me>65535&&Me<1114112&&(ie=Me))}}ie===null?(ie=65533,$=1):ie>65535&&(ie-=65536,O.push(ie>>>10&1023|55296),ie=56320|ie&1023),O.push(ie),B+=$}return N(O)}let q=4096;function N(f){let p=f.length;if(p<=q)return String.fromCharCode.apply(String,f);let m="",O=0;for(;O<p;)m+=String.fromCharCode.apply(String,f.slice(O,O+=q));return m}function le(f,p,m){let O="";m=Math.min(f.length,m);for(let B=p;B<m;++B)O+=String.fromCharCode(f[B]&127);return O}function re(f,p,m){let O="";m=Math.min(f.length,m);for(let B=p;B<m;++B)O+=String.fromCharCode(f[B]);return O}function ee(f,p,m){let O=f.length;(!p||p<0)&&(p=0),(!m||m<0||m>O)&&(m=O);let B="";for(let V=p;V<m;++V)B+=Ie[f[V]];return B}function ue(f,p,m){let O=f.slice(p,m),B="";for(let V=0;V<O.length-1;V+=2)B+=String.fromCharCode(O[V]+O[V+1]*256);return B}r.prototype.slice=function(f,p){let m=this.length;f=~~f,p=p===void 0?m:~~p,f<0?(f+=m,f<0&&(f=0)):f>m&&(f=m),p<0?(p+=m,p<0&&(p=0)):p>m&&(p=m),p<f&&(p=f);let O=this.subarray(f,p);return Object.setPrototypeOf(O,r.prototype),O};function G(f,p,m){if(f%1!==0||f<0)throw new RangeError("offset is not uint");if(f+p>m)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUintLE=r.prototype.readUIntLE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let O=this[f],B=1,V=0;for(;++V<p&&(B*=256);)O+=this[f+V]*B;return O},r.prototype.readUintBE=r.prototype.readUIntBE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let O=this[f+--p],B=1;for(;p>0&&(B*=256);)O+=this[f+--p]*B;return O},r.prototype.readUint8=r.prototype.readUInt8=function(f,p){return f=f>>>0,p||G(f,1,this.length),this[f]},r.prototype.readUint16LE=r.prototype.readUInt16LE=function(f,p){return f=f>>>0,p||G(f,2,this.length),this[f]|this[f+1]<<8},r.prototype.readUint16BE=r.prototype.readUInt16BE=function(f,p){return f=f>>>0,p||G(f,2,this.length),this[f]<<8|this[f+1]},r.prototype.readUint32LE=r.prototype.readUInt32LE=function(f,p){return f=f>>>0,p||G(f,4,this.length),(this[f]|this[f+1]<<8|this[f+2]<<16)+this[f+3]*16777216},r.prototype.readUint32BE=r.prototype.readUInt32BE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]*16777216+(this[f+1]<<16|this[f+2]<<8|this[f+3])},r.prototype.readBigUInt64LE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let O=p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24,B=this[++f]+this[++f]*2**8+this[++f]*2**16+m*2**24;return BigInt(O)+(BigInt(B)<<BigInt(32))}),r.prototype.readBigUInt64BE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let O=p*2**24+this[++f]*2**16+this[++f]*2**8+this[++f],B=this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+m;return(BigInt(O)<<BigInt(32))+BigInt(B)}),r.prototype.readIntLE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let O=this[f],B=1,V=0;for(;++V<p&&(B*=256);)O+=this[f+V]*B;return B*=128,O>=B&&(O-=Math.pow(2,8*p)),O},r.prototype.readIntBE=function(f,p,m){f=f>>>0,p=p>>>0,m||G(f,p,this.length);let O=p,B=1,V=this[f+--O];for(;O>0&&(B*=256);)V+=this[f+--O]*B;return B*=128,V>=B&&(V-=Math.pow(2,8*p)),V},r.prototype.readInt8=function(f,p){return f=f>>>0,p||G(f,1,this.length),this[f]&128?(255-this[f]+1)*-1:this[f]},r.prototype.readInt16LE=function(f,p){f=f>>>0,p||G(f,2,this.length);let m=this[f]|this[f+1]<<8;return m&32768?m|4294901760:m},r.prototype.readInt16BE=function(f,p){f=f>>>0,p||G(f,2,this.length);let m=this[f+1]|this[f]<<8;return m&32768?m|4294901760:m},r.prototype.readInt32LE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]|this[f+1]<<8|this[f+2]<<16|this[f+3]<<24},r.prototype.readInt32BE=function(f,p){return f=f>>>0,p||G(f,4,this.length),this[f]<<24|this[f+1]<<16|this[f+2]<<8|this[f+3]},r.prototype.readBigInt64LE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let O=this[f+4]+this[f+5]*2**8+this[f+6]*2**16+(m<<24);return(BigInt(O)<<BigInt(32))+BigInt(p+this[++f]*2**8+this[++f]*2**16+this[++f]*2**24)}),r.prototype.readBigInt64BE=fe(function(f){f=f>>>0,ne(f,"offset");let p=this[f],m=this[f+7];(p===void 0||m===void 0)&&be(f,this.length-8);let O=(p<<24)+this[++f]*2**16+this[++f]*2**8+this[++f];return(BigInt(O)<<BigInt(32))+BigInt(this[++f]*2**24+this[++f]*2**16+this[++f]*2**8+m)}),r.prototype.readFloatLE=function(f,p){return f=f>>>0,p||G(f,4,this.length),l.read(this,f,!0,23,4)},r.prototype.readFloatBE=function(f,p){return f=f>>>0,p||G(f,4,this.length),l.read(this,f,!1,23,4)},r.prototype.readDoubleLE=function(f,p){return f=f>>>0,p||G(f,8,this.length),l.read(this,f,!0,52,8)},r.prototype.readDoubleBE=function(f,p){return f=f>>>0,p||G(f,8,this.length),l.read(this,f,!1,52,8)};function oe(f,p,m,O,B,V){if(!r.isBuffer(f))throw new TypeError('"buffer" argument must be a Buffer instance');if(p>B||p<V)throw new RangeError('"value" argument is out of bounds');if(m+O>f.length)throw new RangeError("Index out of range")}r.prototype.writeUintLE=r.prototype.writeUIntLE=function(f,p,m,O){if(f=+f,p=p>>>0,m=m>>>0,!O){let ie=Math.pow(2,8*m)-1;oe(this,f,p,m,ie,0)}let B=1,V=0;for(this[p]=f&255;++V<m&&(B*=256);)this[p+V]=f/B&255;return p+m},r.prototype.writeUintBE=r.prototype.writeUIntBE=function(f,p,m,O){if(f=+f,p=p>>>0,m=m>>>0,!O){let ie=Math.pow(2,8*m)-1;oe(this,f,p,m,ie,0)}let B=m-1,V=1;for(this[p+B]=f&255;--B>=0&&(V*=256);)this[p+B]=f/V&255;return p+m},r.prototype.writeUint8=r.prototype.writeUInt8=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,1,255,0),this[p]=f&255,p+1},r.prototype.writeUint16LE=r.prototype.writeUInt16LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,65535,0),this[p]=f&255,this[p+1]=f>>>8,p+2},r.prototype.writeUint16BE=r.prototype.writeUInt16BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,65535,0),this[p]=f>>>8,this[p+1]=f&255,p+2},r.prototype.writeUint32LE=r.prototype.writeUInt32LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,4294967295,0),this[p+3]=f>>>24,this[p+2]=f>>>16,this[p+1]=f>>>8,this[p]=f&255,p+4},r.prototype.writeUint32BE=r.prototype.writeUInt32BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,4294967295,0),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4};function R(f,p,m,O,B){te(p,O,B,f,m,7);let V=Number(p&BigInt(4294967295));f[m++]=V,V=V>>8,f[m++]=V,V=V>>8,f[m++]=V,V=V>>8,f[m++]=V;let ie=Number(p>>BigInt(32)&BigInt(4294967295));return f[m++]=ie,ie=ie>>8,f[m++]=ie,ie=ie>>8,f[m++]=ie,ie=ie>>8,f[m++]=ie,m}function Q(f,p,m,O,B){te(p,O,B,f,m,7);let V=Number(p&BigInt(4294967295));f[m+7]=V,V=V>>8,f[m+6]=V,V=V>>8,f[m+5]=V,V=V>>8,f[m+4]=V;let ie=Number(p>>BigInt(32)&BigInt(4294967295));return f[m+3]=ie,ie=ie>>8,f[m+2]=ie,ie=ie>>8,f[m+1]=ie,ie=ie>>8,f[m]=ie,m+8}r.prototype.writeBigUInt64LE=fe(function(f,p=0){return R(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeBigUInt64BE=fe(function(f,p=0){return Q(this,f,p,BigInt(0),BigInt("0xffffffffffffffff"))}),r.prototype.writeIntLE=function(f,p,m,O){if(f=+f,p=p>>>0,!O){let $=Math.pow(2,8*m-1);oe(this,f,p,m,$-1,-$)}let B=0,V=1,ie=0;for(this[p]=f&255;++B<m&&(V*=256);)f<0&&ie===0&&this[p+B-1]!==0&&(ie=1),this[p+B]=(f/V>>0)-ie&255;return p+m},r.prototype.writeIntBE=function(f,p,m,O){if(f=+f,p=p>>>0,!O){let $=Math.pow(2,8*m-1);oe(this,f,p,m,$-1,-$)}let B=m-1,V=1,ie=0;for(this[p+B]=f&255;--B>=0&&(V*=256);)f<0&&ie===0&&this[p+B+1]!==0&&(ie=1),this[p+B]=(f/V>>0)-ie&255;return p+m},r.prototype.writeInt8=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,1,127,-128),f<0&&(f=255+f+1),this[p]=f&255,p+1},r.prototype.writeInt16LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,32767,-32768),this[p]=f&255,this[p+1]=f>>>8,p+2},r.prototype.writeInt16BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,2,32767,-32768),this[p]=f>>>8,this[p+1]=f&255,p+2},r.prototype.writeInt32LE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,2147483647,-2147483648),this[p]=f&255,this[p+1]=f>>>8,this[p+2]=f>>>16,this[p+3]=f>>>24,p+4},r.prototype.writeInt32BE=function(f,p,m){return f=+f,p=p>>>0,m||oe(this,f,p,4,2147483647,-2147483648),f<0&&(f=4294967295+f+1),this[p]=f>>>24,this[p+1]=f>>>16,this[p+2]=f>>>8,this[p+3]=f&255,p+4},r.prototype.writeBigInt64LE=fe(function(f,p=0){return R(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),r.prototype.writeBigInt64BE=fe(function(f,p=0){return Q(this,f,p,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function he(f,p,m,O,B,V){if(m+O>f.length)throw new RangeError("Index out of range");if(m<0)throw new RangeError("Index out of range")}function z(f,p,m,O,B){return p=+p,m=m>>>0,B||he(f,p,m,4),l.write(f,p,m,O,23,4),m+4}r.prototype.writeFloatLE=function(f,p,m){return z(this,f,p,!0,m)},r.prototype.writeFloatBE=function(f,p,m){return z(this,f,p,!1,m)};function Ee(f,p,m,O,B){return p=+p,m=m>>>0,B||he(f,p,m,8),l.write(f,p,m,O,52,8),m+8}r.prototype.writeDoubleLE=function(f,p,m){return Ee(this,f,p,!0,m)},r.prototype.writeDoubleBE=function(f,p,m){return Ee(this,f,p,!1,m)},r.prototype.copy=function(f,p,m,O){if(!r.isBuffer(f))throw new TypeError("argument should be a Buffer");if(m||(m=0),!O&&O!==0&&(O=this.length),p>=f.length&&(p=f.length),p||(p=0),O>0&&O<m&&(O=m),O===m||f.length===0||this.length===0)return 0;if(p<0)throw new RangeError("targetStart out of bounds");if(m<0||m>=this.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("sourceEnd out of bounds");O>this.length&&(O=this.length),f.length-p<O-m&&(O=f.length-p+m);let B=O-m;return this===f&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(p,m,O):Uint8Array.prototype.set.call(f,this.subarray(m,O),p),B},r.prototype.fill=function(f,p,m,O){if(typeof f=="string"){if(typeof p=="string"?(O=p,p=0,m=this.length):typeof m=="string"&&(O=m,m=this.length),O!==void 0&&typeof O!="string")throw new TypeError("encoding must be a string");if(typeof O=="string"&&!r.isEncoding(O))throw new TypeError("Unknown encoding: "+O);if(f.length===1){let V=f.charCodeAt(0);(O==="utf8"&&V<128||O==="latin1")&&(f=V)}}else typeof f=="number"?f=f&255:typeof f=="boolean"&&(f=Number(f));if(p<0||this.length<p||this.length<m)throw new RangeError("Out of range index");if(m<=p)return this;p=p>>>0,m=m===void 0?this.length:m>>>0,f||(f=0);let B;if(typeof f=="number")for(B=p;B<m;++B)this[B]=f;else{let V=r.isBuffer(f)?f:r.from(f,O),ie=V.length;if(ie===0)throw new TypeError('The value "'+f+'" is invalid for argument "value"');for(B=0;B<m-p;++B)this[B+p]=V[B%ie]}return this};let X={};function D(f,p,m){X[f]=class extends m{constructor(){super(),Object.defineProperty(this,"message",{value:p.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${f}]`,this.stack,delete this.name}get code(){return f}set code(O){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:O,writable:!0})}toString(){return`${this.name} [${f}]: ${this.message}`}}}D("ERR_BUFFER_OUT_OF_BOUNDS",function(f){return f?`${f} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(f,p){return`The "${f}" argument must be of type number. Received type ${typeof p}`},TypeError),D("ERR_OUT_OF_RANGE",function(f,p,m){let O=`The value of "${f}" is out of range.`,B=m;return Number.isInteger(m)&&Math.abs(m)>2**32?B=ae(String(m)):typeof m=="bigint"&&(B=String(m),(m>BigInt(2)**BigInt(32)||m<-(BigInt(2)**BigInt(32)))&&(B=ae(B)),B+="n"),O+=` It must be ${p}. Received ${B}`,O},RangeError);function ae(f){let p="",m=f.length,O=f[0]==="-"?1:0;for(;m>=O+4;m-=3)p=`_${f.slice(m-3,m)}${p}`;return`${f.slice(0,m)}${p}`}function H(f,p,m){ne(p,"offset"),(f[p]===void 0||f[p+m]===void 0)&&be(p,f.length-(m+1))}function te(f,p,m,O,B,V){if(f>m||f<p){let ie=typeof p=="bigint"?"n":"",$;throw p===0||p===BigInt(0)?$=`>= 0${ie} and < 2${ie} ** ${(V+1)*8}${ie}`:$=`>= -(2${ie} ** ${(V+1)*8-1}${ie}) and < 2 ** ${(V+1)*8-1}${ie}`,new X.ERR_OUT_OF_RANGE("value",$,f)}H(O,B,V)}function ne(f,p){if(typeof f!="number")throw new X.ERR_INVALID_ARG_TYPE(p,"number",f)}function be(f,p,m){throw Math.floor(f)!==f?(ne(f,m),new X.ERR_OUT_OF_RANGE("offset","an integer",f)):p<0?new X.ERR_BUFFER_OUT_OF_BOUNDS:new X.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${p}`,f)}let ce=/[^+/0-9A-Za-z-_]/g;function L(f){if(f=f.split("=")[0],f=f.trim().replace(ce,""),f.length<2)return"";for(;f.length%4!==0;)f=f+"=";return f}function Y(f,p){p=p||1/0;let m,O=f.length,B=null,V=[];for(let ie=0;ie<O;++ie){if(m=f.charCodeAt(ie),m>55295&&m<57344){if(!B){if(m>56319){(p-=3)>-1&&V.push(239,191,189);continue}else if(ie+1===O){(p-=3)>-1&&V.push(239,191,189);continue}B=m;continue}if(m<56320){(p-=3)>-1&&V.push(239,191,189),B=m;continue}m=(B-55296<<10|m-56320)+65536}else B&&(p-=3)>-1&&V.push(239,191,189);if(B=null,m<128){if((p-=1)<0)break;V.push(m)}else if(m<2048){if((p-=2)<0)break;V.push(m>>6|192,m&63|128)}else if(m<65536){if((p-=3)<0)break;V.push(m>>12|224,m>>6&63|128,m&63|128)}else if(m<1114112){if((p-=4)<0)break;V.push(m>>18|240,m>>12&63|128,m>>6&63|128,m&63|128)}else throw new Error("Invalid code point")}return V}function se(f){let p=[];for(let m=0;m<f.length;++m)p.push(f.charCodeAt(m)&255);return p}function me(f,p){let m,O,B,V=[];for(let ie=0;ie<f.length&&!((p-=2)<0);++ie)m=f.charCodeAt(ie),O=m>>8,B=m%256,V.push(B),V.push(O);return V}function pe(f){return o.toByteArray(L(f))}function _e(f,p,m,O){let B;for(B=0;B<O&&!(B+m>=p.length||B>=f.length);++B)p[B+m]=f[B];return B}function Z(f,p){return f instanceof p||f!=null&&f.constructor!=null&&f.constructor.name!=null&&f.constructor.name===p.name}function ve(f){return f!==f}let Ie=function(){let f="0123456789abcdef",p=new Array(256);for(let m=0;m<16;++m){let O=m*16;for(let B=0;B<16;++B)p[O+B]=f[m]+f[B]}return p}();function fe(f){return typeof BigInt>"u"?De:f}function De(){throw new Error("BigInt not supported")}return Dt}var ir,Ei,gr,xi,Dt,Ai,ku=_t(()=>{de(),ye(),ge(),ir={},Ei=!1,gr={},xi=!1,Dt={},Ai=!1}),pt={};nr(pt,{Buffer:()=>Ar,INSPECT_MAX_BYTES:()=>os,default:()=>Ct,kMaxLength:()=>ss});var Ct,Ar,os,ss,dt=_t(()=>{de(),ye(),ge(),ku(),Ct=Iu(),Ct.Buffer,Ct.SlowBuffer,Ct.INSPECT_MAX_BYTES,Ct.kMaxLength,Ar=Ct.Buffer,os=Ct.INSPECT_MAX_BYTES,ss=Ct.kMaxLength}),ye=_t(()=>{dt()}),ut=we((o,l)=>{de(),ye(),ge();var s=class extends Error{constructor(a){if(!Array.isArray(a))throw new TypeError(`Expected input to be an Array, got ${typeof a}`);let u="";for(let t=0;t<a.length;t++)u+=` ${a[t].stack}
|
|
31
|
+
`;super(u),this.name="AggregateError",this.errors=a}};l.exports={AggregateError:s,ArrayIsArray(a){return Array.isArray(a)},ArrayPrototypeIncludes(a,u){return a.includes(u)},ArrayPrototypeIndexOf(a,u){return a.indexOf(u)},ArrayPrototypeJoin(a,u){return a.join(u)},ArrayPrototypeMap(a,u){return a.map(u)},ArrayPrototypePop(a,u){return a.pop(u)},ArrayPrototypePush(a,u){return a.push(u)},ArrayPrototypeSlice(a,u,t){return a.slice(u,t)},Error,FunctionPrototypeCall(a,u,...t){return a.call(u,...t)},FunctionPrototypeSymbolHasInstance(a,u){return Function.prototype[Symbol.hasInstance].call(a,u)},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(a,u){return Object.defineProperties(a,u)},ObjectDefineProperty(a,u,t){return Object.defineProperty(a,u,t)},ObjectGetOwnPropertyDescriptor(a,u){return Object.getOwnPropertyDescriptor(a,u)},ObjectKeys(a){return Object.keys(a)},ObjectSetPrototypeOf(a,u){return Object.setPrototypeOf(a,u)},Promise,PromisePrototypeCatch(a,u){return a.catch(u)},PromisePrototypeThen(a,u,t){return a.then(u,t)},PromiseReject(a){return Promise.reject(a)},PromiseResolve(a){return Promise.resolve(a)},ReflectApply:Reflect.apply,RegExpPrototypeTest(a,u){return a.test(u)},SafeSet:Set,String,StringPrototypeSlice(a,u,t){return a.slice(u,t)},StringPrototypeToLowerCase(a){return a.toLowerCase()},StringPrototypeToUpperCase(a){return a.toUpperCase()},StringPrototypeTrim(a){return a.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(a,u,t){return a.set(u,t)},Boolean,Uint8Array}}),as=we((o,l)=>{de(),ye(),ge(),l.exports={format(s,...a){return s.replace(/%([sdifj])/g,function(...[u,t]){let r=a.shift();return t==="f"?r.toFixed(6):t==="j"?JSON.stringify(r):t==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},inspect(s){switch(typeof s){case"string":if(s.includes("'"))if(s.includes('"')){if(!s.includes("`")&&!s.includes("${"))return`\`${s}\``}else return`"${s}"`;return`'${s}'`;case"number":return isNaN(s)?"NaN":Object.is(s,-0)?String(s):s;case"bigint":return`${String(s)}n`;case"boolean":case"undefined":return String(s);case"object":return"{}"}}}}),wt=we((o,l)=>{de(),ye(),ge();var{format:s,inspect:a}=as(),{AggregateError:u}=ut(),t=globalThis.AggregateError||u,r=Symbol("kIsNodeError"),n=["string","function","number","object","Function","Object","boolean","bigint","symbol"],e=/^([A-Z][a-z0-9]*)+$/,i="__node_internal_",c={};function h(g,_){if(!g)throw new c.ERR_INTERNAL_ASSERTION(_)}function d(g){let _="",E=g.length,v=g[0]==="-"?1:0;for(;E>=v+4;E-=3)_=`_${g.slice(E-3,E)}${_}`;return`${g.slice(0,E)}${_}`}function y(g,_,E){if(typeof _=="function")return h(_.length<=E.length,`Code: ${g}; The provided arguments length (${E.length}) does not match the required ones (${_.length}).`),_(...E);let v=(_.match(/%[dfijoOs]/g)||[]).length;return h(v===E.length,`Code: ${g}; The provided arguments length (${E.length}) does not match the required ones (${v}).`),E.length===0?_:s(_,...E)}function b(g,_,E){E||(E=Error);class v extends E{constructor(...P){super(y(g,_,P))}toString(){return`${this.name} [${g}]: ${this.message}`}}Object.defineProperties(v.prototype,{name:{value:E.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${g}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),v.prototype.code=g,v.prototype[r]=!0,c[g]=v}function S(g){let _=i+g.name;return Object.defineProperty(g,"name",{value:_}),g}function w(g,_){if(g&&_&&g!==_){if(Array.isArray(_.errors))return _.errors.push(g),_;let E=new t([_,g],_.message);return E.code=_.code,E}return g||_}var x=class extends Error{constructor(g="The operation was aborted",_=void 0){if(_!==void 0&&typeof _!="object")throw new c.ERR_INVALID_ARG_TYPE("options","Object",_);super(g,_),this.code="ABORT_ERR",this.name="AbortError"}};b("ERR_ASSERTION","%s",Error),b("ERR_INVALID_ARG_TYPE",(g,_,E)=>{h(typeof g=="string","'name' must be a string"),Array.isArray(_)||(_=[_]);let v="The ";g.endsWith(" argument")?v+=`${g} `:v+=`"${g}" ${g.includes(".")?"property":"argument"} `,v+="must be ";let C=[],P=[],I=[];for(let k of _)h(typeof k=="string","All expected entries have to be of type string"),n.includes(k)?C.push(k.toLowerCase()):e.test(k)?P.push(k):(h(k!=="object",'The value "object" should be written as "Object"'),I.push(k));if(P.length>0){let k=C.indexOf("object");k!==-1&&(C.splice(C,k,1),P.push("Object"))}if(C.length>0){switch(C.length){case 1:v+=`of type ${C[0]}`;break;case 2:v+=`one of type ${C[0]} or ${C[1]}`;break;default:{let k=C.pop();v+=`one of type ${C.join(", ")}, or ${k}`}}(P.length>0||I.length>0)&&(v+=" or ")}if(P.length>0){switch(P.length){case 1:v+=`an instance of ${P[0]}`;break;case 2:v+=`an instance of ${P[0]} or ${P[1]}`;break;default:{let k=P.pop();v+=`an instance of ${P.join(", ")}, or ${k}`}}I.length>0&&(v+=" or ")}switch(I.length){case 0:break;case 1:I[0].toLowerCase()!==I[0]&&(v+="an "),v+=`${I[0]}`;break;case 2:v+=`one of ${I[0]} or ${I[1]}`;break;default:{let k=I.pop();v+=`one of ${I.join(", ")}, or ${k}`}}if(E==null)v+=`. Received ${E}`;else if(typeof E=="function"&&E.name)v+=`. Received function ${E.name}`;else if(typeof E=="object"){var T;if((T=E.constructor)!==null&&T!==void 0&&T.name)v+=`. Received an instance of ${E.constructor.name}`;else{let k=a(E,{depth:-1});v+=`. Received ${k}`}}else{let k=a(E,{colors:!1});k.length>25&&(k=`${k.slice(0,25)}...`),v+=`. Received type ${typeof E} (${k})`}return v},TypeError),b("ERR_INVALID_ARG_VALUE",(g,_,E="is invalid")=>{let v=a(_);return v.length>128&&(v=v.slice(0,128)+"..."),`The ${g.includes(".")?"property":"argument"} '${g}' ${E}. Received ${v}`},TypeError),b("ERR_INVALID_RETURN_VALUE",(g,_,E)=>{var v;let C=E!=null&&(v=E.constructor)!==null&&v!==void 0&&v.name?`instance of ${E.constructor.name}`:`type ${typeof E}`;return`Expected ${g} to be returned from the "${_}" function but got ${C}.`},TypeError),b("ERR_MISSING_ARGS",(...g)=>{h(g.length>0,"At least one arg needs to be specified");let _,E=g.length;switch(g=(Array.isArray(g)?g:[g]).map(v=>`"${v}"`).join(" or "),E){case 1:_+=`The ${g[0]} argument`;break;case 2:_+=`The ${g[0]} and ${g[1]} arguments`;break;default:{let v=g.pop();_+=`The ${g.join(", ")}, and ${v} arguments`}break}return`${_} must be specified`},TypeError),b("ERR_OUT_OF_RANGE",(g,_,E)=>{h(_,'Missing "range" argument');let v;if(Number.isInteger(E)&&Math.abs(E)>2**32)v=d(String(E));else if(typeof E=="bigint"){v=String(E);let C=BigInt(2)**BigInt(32);(E>C||E<-C)&&(v=d(v)),v+="n"}else v=a(E);return`The value of "${g}" is out of range. It must be ${_}. Received ${v}`},RangeError),b("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),b("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),b("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),b("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),b("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),b("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),b("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),b("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),b("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),b("ERR_STREAM_WRITE_AFTER_END","write after end",Error),b("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),l.exports={AbortError:x,aggregateTwoErrors:S(w),hideStackFrames:S,codes:c}}),yr=we((o,l)=>{de(),ye(),ge();var{AbortController:s,AbortSignal:a}=typeof self<"u"?self:typeof window<"u"?window:void 0;l.exports=s,l.exports.AbortSignal=a,l.exports.default=s}),Ft={};nr(Ft,{EventEmitter:()=>ls,default:()=>or,defaultMaxListeners:()=>us,init:()=>cs,listenerCount:()=>fs,on:()=>hs,once:()=>ps});function Ou(){if(Ii)return mr;Ii=!0;var o=typeof Reflect=="object"?Reflect:null,l=o&&typeof o.apply=="function"?o.apply:function(E,v,C){return Function.prototype.apply.call(E,v,C)},s;o&&typeof o.ownKeys=="function"?s=o.ownKeys:Object.getOwnPropertySymbols?s=function(E){return Object.getOwnPropertyNames(E).concat(Object.getOwnPropertySymbols(E))}:s=function(E){return Object.getOwnPropertyNames(E)};function a(E){console&&console.warn&&console.warn(E)}var u=Number.isNaN||function(E){return E!==E};function t(){t.init.call(this)}mr=t,mr.once=x,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._eventsCount=0,t.prototype._maxListeners=void 0;var r=10;function n(E){if(typeof E!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof E)}Object.defineProperty(t,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(E){if(typeof E!="number"||E<0||u(E))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+E+".");r=E}}),t.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},t.prototype.setMaxListeners=function(E){if(typeof E!="number"||E<0||u(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};function e(E){return E._maxListeners===void 0?t.defaultMaxListeners:E._maxListeners}t.prototype.getMaxListeners=function(){return e(this)},t.prototype.emit=function(E){for(var v=[],C=1;C<arguments.length;C++)v.push(arguments[C]);var P=E==="error",I=this._events;if(I!==void 0)P=P&&I.error===void 0;else if(!P)return!1;if(P){var T;if(v.length>0&&(T=v[0]),T instanceof Error)throw T;var k=new Error("Unhandled error."+(T?" ("+T.message+")":""));throw k.context=T,k}var W=I[E];if(W===void 0)return!1;if(typeof W=="function")l(W,this,v);else for(var A=W.length,M=b(W,A),C=0;C<A;++C)l(M[C],this,v);return!0};function i(E,v,C,P){var I,T,k;if(n(C),T=E._events,T===void 0?(T=E._events=Object.create(null),E._eventsCount=0):(T.newListener!==void 0&&(E.emit("newListener",v,C.listener?C.listener:C),T=E._events),k=T[v]),k===void 0)k=T[v]=C,++E._eventsCount;else if(typeof k=="function"?k=T[v]=P?[C,k]:[k,C]:P?k.unshift(C):k.push(C),I=e(E),I>0&&k.length>I&&!k.warned){k.warned=!0;var W=new Error("Possible EventEmitter memory leak detected. "+k.length+" "+String(v)+" listeners added. Use emitter.setMaxListeners() to increase limit");W.name="MaxListenersExceededWarning",W.emitter=E,W.type=v,W.count=k.length,a(W)}return E}t.prototype.addListener=function(E,v){return i(this,E,v,!1)},t.prototype.on=t.prototype.addListener,t.prototype.prependListener=function(E,v){return i(this,E,v,!0)};function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(E,v,C){var P={fired:!1,wrapFn:void 0,target:E,type:v,listener:C},I=c.bind(P);return I.listener=C,P.wrapFn=I,I}t.prototype.once=function(E,v){return n(v),this.on(E,h(this,E,v)),this},t.prototype.prependOnceListener=function(E,v){return n(v),this.prependListener(E,h(this,E,v)),this},t.prototype.removeListener=function(E,v){var C,P,I,T,k;if(n(v),P=this._events,P===void 0)return this;if(C=P[E],C===void 0)return this;if(C===v||C.listener===v)--this._eventsCount===0?this._events=Object.create(null):(delete P[E],P.removeListener&&this.emit("removeListener",E,C.listener||v));else if(typeof C!="function"){for(I=-1,T=C.length-1;T>=0;T--)if(C[T]===v||C[T].listener===v){k=C[T].listener,I=T;break}if(I<0)return this;I===0?C.shift():S(C,I),C.length===1&&(P[E]=C[0]),P.removeListener!==void 0&&this.emit("removeListener",E,k||v)}return this},t.prototype.off=t.prototype.removeListener,t.prototype.removeAllListeners=function(E){var v,C,P;if(C=this._events,C===void 0)return this;if(C.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):C[E]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete C[E]),this;if(arguments.length===0){var I=Object.keys(C),T;for(P=0;P<I.length;++P)T=I[P],T!=="removeListener"&&this.removeAllListeners(T);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(v=C[E],typeof v=="function")this.removeListener(E,v);else if(v!==void 0)for(P=v.length-1;P>=0;P--)this.removeListener(E,v[P]);return this};function d(E,v,C){var P=E._events;if(P===void 0)return[];var I=P[v];return I===void 0?[]:typeof I=="function"?C?[I.listener||I]:[I]:C?w(I):b(I,I.length)}t.prototype.listeners=function(E){return d(this,E,!0)},t.prototype.rawListeners=function(E){return d(this,E,!1)},t.listenerCount=function(E,v){return typeof E.listenerCount=="function"?E.listenerCount(v):y.call(E,v)},t.prototype.listenerCount=y;function y(E){var v=this._events;if(v!==void 0){var C=v[E];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}t.prototype.eventNames=function(){return this._eventsCount>0?s(this._events):[]};function b(E,v){for(var C=new Array(v),P=0;P<v;++P)C[P]=E[P];return C}function S(E,v){for(;v+1<E.length;v++)E[v]=E[v+1];E.pop()}function w(E){for(var v=new Array(E.length),C=0;C<v.length;++C)v[C]=E[C].listener||E[C];return v}function x(E,v){return new Promise(function(C,P){function I(k){E.removeListener(v,T),P(k)}function T(){typeof E.removeListener=="function"&&E.removeListener("error",I),C([].slice.call(arguments))}_(E,v,T,{once:!0}),v!=="error"&&g(E,I,{once:!0})})}function g(E,v,C){typeof E.on=="function"&&_(E,"error",v,C)}function _(E,v,C,P){if(typeof E.on=="function")P.once?E.once(v,C):E.on(v,C);else if(typeof E.addEventListener=="function")E.addEventListener(v,function I(T){P.once&&E.removeEventListener(v,I),C(T)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof E)}return mr}var mr,Ii,or,ls,us,cs,fs,hs,ps,Qt=_t(()=>{de(),ye(),ge(),mr={},Ii=!1,or=Ou(),or.once,or.once=function(o,l){return new Promise((s,a)=>{function u(...r){t!==void 0&&o.removeListener("error",t),s(r)}let t;l!=="error"&&(t=r=>{o.removeListener(name,u),a(r)},o.once("error",t)),o.once(l,u)})},or.on=function(o,l){let s=[],a=[],u=null,t=!1,r={async next(){let i=s.shift();if(i)return createIterResult(i,!1);if(u){let c=Promise.reject(u);return u=null,c}return t?createIterResult(void 0,!0):new Promise((c,h)=>a.push({resolve:c,reject:h}))},async return(){o.removeListener(l,n),o.removeListener("error",e),t=!0;for(let i of a)i.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)},throw(i){u=i,o.removeListener(l,n),o.removeListener("error",e)},[Symbol.asyncIterator](){return this}};return o.on(l,n),o.on("error",e),r;function n(...i){let c=a.shift();c?c.resolve(createIterResult(i,!1)):s.push(i)}function e(i){t=!0;let c=a.shift();c?c.reject(i):u=i,r.return()}},{EventEmitter:ls,defaultMaxListeners:us,init:cs,listenerCount:fs,on:hs,once:ps}=or}),St=we((o,l)=>{de(),ye(),ge();var s=(dt(),tt(pt)),{format:a,inspect:u}=as(),{codes:{ERR_INVALID_ARG_TYPE:t}}=wt(),{kResistStopPropagation:r,AggregateError:n,SymbolDispose:e}=ut(),i=globalThis.AbortSignal||yr().AbortSignal,c=globalThis.AbortController||yr().AbortController,h=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||s.Blob,y=typeof d<"u"?function(w){return w instanceof d}:function(w){return!1},b=(w,x)=>{if(w!==void 0&&(w===null||typeof w!="object"||!("aborted"in w)))throw new t(x,"AbortSignal",w)},S=(w,x)=>{if(typeof w!="function")throw new t(x,"Function",w)};l.exports={AggregateError:n,kEmptyObject:Object.freeze({}),once(w){let x=!1;return function(...g){x||(x=!0,w.apply(this,g))}},createDeferredPromise:function(){let w,x;return{promise:new Promise((g,_)=>{w=g,x=_}),resolve:w,reject:x}},promisify(w){return new Promise((x,g)=>{w((_,...E)=>_?g(_):x(...E))})},debuglog(){return function(){}},format:a,inspect:u,types:{isAsyncFunction(w){return w instanceof h},isArrayBufferView(w){return ArrayBuffer.isView(w)}},isBlob:y,deprecate(w,x){return w},addAbortListener:(Qt(),tt(Ft)).addAbortListener||function(w,x){if(w===void 0)throw new t("signal","AbortSignal",w);b(w,"signal"),S(x,"listener");let g;return w.aborted?queueMicrotask(()=>x()):(w.addEventListener("abort",x,{__proto__:null,once:!0,[r]:!0}),g=()=>{w.removeEventListener("abort",x)}),{__proto__:null,[e](){var _;(_=g)===null||_===void 0||_()}}},AbortSignalAny:i.any||function(w){if(w.length===1)return w[0];let x=new c,g=()=>x.abort();return w.forEach(_=>{b(_,"signals"),_.addEventListener("abort",g,{once:!0})}),x.signal.addEventListener("abort",()=>{w.forEach(_=>_.removeEventListener("abort",g))},{once:!0}),x.signal}},l.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),br=we((o,l)=>{de(),ye(),ge();var{ArrayIsArray:s,ArrayPrototypeIncludes:a,ArrayPrototypeJoin:u,ArrayPrototypeMap:t,NumberIsInteger:r,NumberIsNaN:n,NumberMAX_SAFE_INTEGER:e,NumberMIN_SAFE_INTEGER:i,NumberParseInt:c,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:y,StringPrototypeToUpperCase:b,StringPrototypeTrim:S}=ut(),{hideStackFrames:w,codes:{ERR_SOCKET_BAD_PORT:x,ERR_INVALID_ARG_TYPE:g,ERR_INVALID_ARG_VALUE:_,ERR_OUT_OF_RANGE:E,ERR_UNKNOWN_SIGNAL:v}}=wt(),{normalizeEncoding:C}=St(),{isAsyncFunction:P,isArrayBufferView:I}=St().types,T={};function k(Z){return Z===(Z|0)}function W(Z){return Z===Z>>>0}var A=/^[0-7]+$/,M="must be a 32-bit unsigned integer or an octal string";function q(Z,ve,Ie){if(typeof Z>"u"&&(Z=Ie),typeof Z=="string"){if(d(A,Z)===null)throw new _(ve,Z,M);Z=c(Z,8)}return re(Z,ve),Z}var N=w((Z,ve,Ie=i,fe=e)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);if(Z<Ie||Z>fe)throw new E(ve,`>= ${Ie} && <= ${fe}`,Z)}),le=w((Z,ve,Ie=-2147483648,fe=2147483647)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);if(Z<Ie||Z>fe)throw new E(ve,`>= ${Ie} && <= ${fe}`,Z)}),re=w((Z,ve,Ie=!1)=>{if(typeof Z!="number")throw new g(ve,"number",Z);if(!r(Z))throw new E(ve,"an integer",Z);let fe=Ie?1:0,De=4294967295;if(Z<fe||Z>De)throw new E(ve,`>= ${fe} && <= ${De}`,Z)});function ee(Z,ve){if(typeof Z!="string")throw new g(ve,"string",Z)}function ue(Z,ve,Ie=void 0,fe){if(typeof Z!="number")throw new g(ve,"number",Z);if(Ie!=null&&Z<Ie||fe!=null&&Z>fe||(Ie!=null||fe!=null)&&n(Z))throw new E(ve,`${Ie!=null?`>= ${Ie}`:""}${Ie!=null&&fe!=null?" && ":""}${fe!=null?`<= ${fe}`:""}`,Z)}var G=w((Z,ve,Ie)=>{if(!a(Ie,Z)){let fe="must be one of: "+u(t(Ie,De=>typeof De=="string"?`'${De}'`:y(De)),", ");throw new _(ve,Z,fe)}});function oe(Z,ve){if(typeof Z!="boolean")throw new g(ve,"boolean",Z)}function R(Z,ve,Ie){return Z==null||!h(Z,ve)?Ie:Z[ve]}var Q=w((Z,ve,Ie=null)=>{let fe=R(Ie,"allowArray",!1),De=R(Ie,"allowFunction",!1);if(!R(Ie,"nullable",!1)&&Z===null||!fe&&s(Z)||typeof Z!="object"&&(!De||typeof Z!="function"))throw new g(ve,"Object",Z)}),he=w((Z,ve)=>{if(Z!=null&&typeof Z!="object"&&typeof Z!="function")throw new g(ve,"a dictionary",Z)}),z=w((Z,ve,Ie=0)=>{if(!s(Z))throw new g(ve,"Array",Z);if(Z.length<Ie){let fe=`must be longer than ${Ie}`;throw new _(ve,Z,fe)}});function Ee(Z,ve){z(Z,ve);for(let Ie=0;Ie<Z.length;Ie++)ee(Z[Ie],`${ve}[${Ie}]`)}function X(Z,ve){z(Z,ve);for(let Ie=0;Ie<Z.length;Ie++)oe(Z[Ie],`${ve}[${Ie}]`)}function D(Z,ve){z(Z,ve);for(let Ie=0;Ie<Z.length;Ie++){let fe=Z[Ie],De=`${ve}[${Ie}]`;if(fe==null)throw new g(De,"AbortSignal",fe);be(fe,De)}}function ae(Z,ve="signal"){if(ee(Z,ve),T[Z]===void 0)throw T[b(Z)]!==void 0?new v(Z+" (signals must use all capital letters)"):new v(Z)}var H=w((Z,ve="buffer")=>{if(!I(Z))throw new g(ve,["Buffer","TypedArray","DataView"],Z)});function te(Z,ve){let Ie=C(ve),fe=Z.length;if(Ie==="hex"&&fe%2!==0)throw new _("encoding",ve,`is invalid for data of length ${fe}`)}function ne(Z,ve="Port",Ie=!0){if(typeof Z!="number"&&typeof Z!="string"||typeof Z=="string"&&S(Z).length===0||+Z!==+Z>>>0||Z>65535||Z===0&&!Ie)throw new x(ve,Z,Ie);return Z|0}var be=w((Z,ve)=>{if(Z!==void 0&&(Z===null||typeof Z!="object"||!("aborted"in Z)))throw new g(ve,"AbortSignal",Z)}),ce=w((Z,ve)=>{if(typeof Z!="function")throw new g(ve,"Function",Z)}),L=w((Z,ve)=>{if(typeof Z!="function"||P(Z))throw new g(ve,"Function",Z)}),Y=w((Z,ve)=>{if(Z!==void 0)throw new g(ve,"undefined",Z)});function se(Z,ve,Ie){if(!a(Ie,Z))throw new g(ve,`('${u(Ie,"|")}')`,Z)}var me=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function pe(Z,ve){if(typeof Z>"u"||!d(me,Z))throw new _(ve,Z,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function _e(Z){if(typeof Z=="string")return pe(Z,"hints"),Z;if(s(Z)){let ve=Z.length,Ie="";if(ve===0)return Ie;for(let fe=0;fe<ve;fe++){let De=Z[fe];pe(De,"hints"),Ie+=De,fe!==ve-1&&(Ie+=", ")}return Ie}throw new _("hints",Z,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}l.exports={isInt32:k,isUint32:W,parseFileMode:q,validateArray:z,validateStringArray:Ee,validateBooleanArray:X,validateAbortSignalArray:D,validateBoolean:oe,validateBuffer:H,validateDictionary:he,validateEncoding:te,validateFunction:ce,validateInt32:le,validateInteger:N,validateNumber:ue,validateObject:Q,validateOneOf:G,validatePlainFunction:L,validatePort:ne,validateSignalName:ae,validateString:ee,validateUint32:re,validateUndefined:Y,validateUnion:se,validateAbortSignal:be,validateLinkHeaderValue:_e}}),Jt=we((o,l)=>{de(),ye(),ge();var s=l.exports={},a,u;function t(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?a=setTimeout:a=t}catch{a=t}try{typeof clearTimeout=="function"?u=clearTimeout:u=r}catch{u=r}})();function n(x){if(a===setTimeout)return setTimeout(x,0);if((a===t||!a)&&setTimeout)return a=setTimeout,setTimeout(x,0);try{return a(x,0)}catch{try{return a.call(null,x,0)}catch{return a.call(this,x,0)}}}function e(x){if(u===clearTimeout)return clearTimeout(x);if((u===r||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(x);try{return u(x)}catch{try{return u.call(null,x)}catch{return u.call(this,x)}}}var i=[],c=!1,h,d=-1;function y(){!c||!h||(c=!1,h.length?i=h.concat(i):d=-1,i.length&&b())}function b(){if(!c){var x=n(y);c=!0;for(var g=i.length;g;){for(h=i,i=[];++d<g;)h&&h[d].run();d=-1,g=i.length}h=null,c=!1,e(x)}}s.nextTick=function(x){var g=new Array(arguments.length-1);if(arguments.length>1)for(var _=1;_<arguments.length;_++)g[_-1]=arguments[_];i.push(new S(x,g)),i.length===1&&!c&&n(b)};function S(x,g){this.fun=x,this.array=g}S.prototype.run=function(){this.fun.apply(null,this.array)},s.title="browser",s.browser=!0,s.env={},s.argv=[],s.version="",s.versions={};function w(){}s.on=w,s.addListener=w,s.once=w,s.off=w,s.removeListener=w,s.removeAllListeners=w,s.emit=w,s.prependListener=w,s.prependOnceListener=w,s.listeners=function(x){return[]},s.binding=function(x){throw new Error("process.binding is not supported")},s.cwd=function(){return"/"},s.chdir=function(x){throw new Error("process.chdir is not supported")},s.umask=function(){return 0}}),jt=we((o,l)=>{de(),ye(),ge();var{SymbolAsyncIterator:s,SymbolIterator:a,SymbolFor:u}=ut(),t=u("nodejs.stream.destroyed"),r=u("nodejs.stream.errored"),n=u("nodejs.stream.readable"),e=u("nodejs.stream.writable"),i=u("nodejs.stream.disturbed"),c=u("nodejs.webstream.isClosedPromise"),h=u("nodejs.webstream.controllerErrorFunction");function d(R,Q=!1){var he;return!!(R&&typeof R.pipe=="function"&&typeof R.on=="function"&&(!Q||typeof R.pause=="function"&&typeof R.resume=="function")&&(!R._writableState||((he=R._readableState)===null||he===void 0?void 0:he.readable)!==!1)&&(!R._writableState||R._readableState))}function y(R){var Q;return!!(R&&typeof R.write=="function"&&typeof R.on=="function"&&(!R._readableState||((Q=R._writableState)===null||Q===void 0?void 0:Q.writable)!==!1))}function b(R){return!!(R&&typeof R.pipe=="function"&&R._readableState&&typeof R.on=="function"&&typeof R.write=="function")}function S(R){return R&&(R._readableState||R._writableState||typeof R.write=="function"&&typeof R.on=="function"||typeof R.pipe=="function"&&typeof R.on=="function")}function w(R){return!!(R&&!S(R)&&typeof R.pipeThrough=="function"&&typeof R.getReader=="function"&&typeof R.cancel=="function")}function x(R){return!!(R&&!S(R)&&typeof R.getWriter=="function"&&typeof R.abort=="function")}function g(R){return!!(R&&!S(R)&&typeof R.readable=="object"&&typeof R.writable=="object")}function _(R){return w(R)||x(R)||g(R)}function E(R,Q){return R==null?!1:Q===!0?typeof R[s]=="function":Q===!1?typeof R[a]=="function":typeof R[s]=="function"||typeof R[a]=="function"}function v(R){if(!S(R))return null;let Q=R._writableState,he=R._readableState,z=Q||he;return!!(R.destroyed||R[t]||z!=null&&z.destroyed)}function C(R){if(!y(R))return null;if(R.writableEnded===!0)return!0;let Q=R._writableState;return Q!=null&&Q.errored?!1:typeof(Q==null?void 0:Q.ended)!="boolean"?null:Q.ended}function P(R,Q){if(!y(R))return null;if(R.writableFinished===!0)return!0;let he=R._writableState;return he!=null&&he.errored?!1:typeof(he==null?void 0:he.finished)!="boolean"?null:!!(he.finished||Q===!1&&he.ended===!0&&he.length===0)}function I(R){if(!d(R))return null;if(R.readableEnded===!0)return!0;let Q=R._readableState;return!Q||Q.errored?!1:typeof(Q==null?void 0:Q.ended)!="boolean"?null:Q.ended}function T(R,Q){if(!d(R))return null;let he=R._readableState;return he!=null&&he.errored?!1:typeof(he==null?void 0:he.endEmitted)!="boolean"?null:!!(he.endEmitted||Q===!1&&he.ended===!0&&he.length===0)}function k(R){return R&&R[n]!=null?R[n]:typeof(R==null?void 0:R.readable)!="boolean"?null:v(R)?!1:d(R)&&R.readable&&!T(R)}function W(R){return R&&R[e]!=null?R[e]:typeof(R==null?void 0:R.writable)!="boolean"?null:v(R)?!1:y(R)&&R.writable&&!C(R)}function A(R,Q){return S(R)?v(R)?!0:!((Q==null?void 0:Q.readable)!==!1&&k(R)||(Q==null?void 0:Q.writable)!==!1&&W(R)):null}function M(R){var Q,he;return S(R)?R.writableErrored?R.writableErrored:(Q=(he=R._writableState)===null||he===void 0?void 0:he.errored)!==null&&Q!==void 0?Q:null:null}function q(R){var Q,he;return S(R)?R.readableErrored?R.readableErrored:(Q=(he=R._readableState)===null||he===void 0?void 0:he.errored)!==null&&Q!==void 0?Q:null:null}function N(R){if(!S(R))return null;if(typeof R.closed=="boolean")return R.closed;let Q=R._writableState,he=R._readableState;return typeof(Q==null?void 0:Q.closed)=="boolean"||typeof(he==null?void 0:he.closed)=="boolean"?(Q==null?void 0:Q.closed)||(he==null?void 0:he.closed):typeof R._closed=="boolean"&&le(R)?R._closed:null}function le(R){return typeof R._closed=="boolean"&&typeof R._defaultKeepAlive=="boolean"&&typeof R._removedConnection=="boolean"&&typeof R._removedContLen=="boolean"}function re(R){return typeof R._sent100=="boolean"&&le(R)}function ee(R){var Q;return typeof R._consuming=="boolean"&&typeof R._dumped=="boolean"&&((Q=R.req)===null||Q===void 0?void 0:Q.upgradeOrConnect)===void 0}function ue(R){if(!S(R))return null;let Q=R._writableState,he=R._readableState,z=Q||he;return!z&&re(R)||!!(z&&z.autoDestroy&&z.emitClose&&z.closed===!1)}function G(R){var Q;return!!(R&&((Q=R[i])!==null&&Q!==void 0?Q:R.readableDidRead||R.readableAborted))}function oe(R){var Q,he,z,Ee,X,D,ae,H,te,ne;return!!(R&&((Q=(he=(z=(Ee=(X=(D=R[r])!==null&&D!==void 0?D:R.readableErrored)!==null&&X!==void 0?X:R.writableErrored)!==null&&Ee!==void 0?Ee:(ae=R._readableState)===null||ae===void 0?void 0:ae.errorEmitted)!==null&&z!==void 0?z:(H=R._writableState)===null||H===void 0?void 0:H.errorEmitted)!==null&&he!==void 0?he:(te=R._readableState)===null||te===void 0?void 0:te.errored)!==null&&Q!==void 0?Q:!((ne=R._writableState)===null||ne===void 0)&&ne.errored))}l.exports={isDestroyed:v,kIsDestroyed:t,isDisturbed:G,kIsDisturbed:i,isErrored:oe,kIsErrored:r,isReadable:k,kIsReadable:n,kIsClosedPromise:c,kControllerErrorFunction:h,kIsWritable:e,isClosed:N,isDuplexNodeStream:b,isFinished:A,isIterable:E,isReadableNodeStream:d,isReadableStream:w,isReadableEnded:I,isReadableFinished:T,isReadableErrored:q,isNodeStream:S,isWebStream:_,isWritable:W,isWritableNodeStream:y,isWritableStream:x,isWritableEnded:C,isWritableFinished:P,isWritableErrored:M,isServerRequest:ee,isServerResponse:re,willEmitClose:ue,isTransformStream:g}}),Wt=we((o,l)=>{de(),ye(),ge();var s=Jt(),{AbortError:a,codes:u}=wt(),{ERR_INVALID_ARG_TYPE:t,ERR_STREAM_PREMATURE_CLOSE:r}=u,{kEmptyObject:n,once:e}=St(),{validateAbortSignal:i,validateFunction:c,validateObject:h,validateBoolean:d}=br(),{Promise:y,PromisePrototypeThen:b,SymbolDispose:S}=ut(),{isClosed:w,isReadable:x,isReadableNodeStream:g,isReadableStream:_,isReadableFinished:E,isReadableErrored:v,isWritable:C,isWritableNodeStream:P,isWritableStream:I,isWritableFinished:T,isWritableErrored:k,isNodeStream:W,willEmitClose:A,kIsClosedPromise:M}=jt(),q;function N(G){return G.setHeader&&typeof G.abort=="function"}var le=()=>{};function re(G,oe,R){var Q,he;if(arguments.length===2?(R=oe,oe=n):oe==null?oe=n:h(oe,"options"),c(R,"callback"),i(oe.signal,"options.signal"),R=e(R),_(G)||I(G))return ee(G,oe,R);if(!W(G))throw new t("stream",["ReadableStream","WritableStream","Stream"],G);let z=(Q=oe.readable)!==null&&Q!==void 0?Q:g(G),Ee=(he=oe.writable)!==null&&he!==void 0?he:P(G),X=G._writableState,D=G._readableState,ae=()=>{G.writable||ne()},H=A(G)&&g(G)===z&&P(G)===Ee,te=T(G,!1),ne=()=>{te=!0,G.destroyed&&(H=!1),!(H&&(!G.readable||z))&&(!z||be)&&R.call(G)},be=E(G,!1),ce=()=>{be=!0,G.destroyed&&(H=!1),!(H&&(!G.writable||Ee))&&(!Ee||te)&&R.call(G)},L=Z=>{R.call(G,Z)},Y=w(G),se=()=>{Y=!0;let Z=k(G)||v(G);if(Z&&typeof Z!="boolean")return R.call(G,Z);if(z&&!be&&g(G,!0)&&!E(G,!1))return R.call(G,new r);if(Ee&&!te&&!T(G,!1))return R.call(G,new r);R.call(G)},me=()=>{Y=!0;let Z=k(G)||v(G);if(Z&&typeof Z!="boolean")return R.call(G,Z);R.call(G)},pe=()=>{G.req.on("finish",ne)};N(G)?(G.on("complete",ne),H||G.on("abort",se),G.req?pe():G.on("request",pe)):Ee&&!X&&(G.on("end",ae),G.on("close",ae)),!H&&typeof G.aborted=="boolean"&&G.on("aborted",se),G.on("end",ce),G.on("finish",ne),oe.error!==!1&&G.on("error",L),G.on("close",se),Y?s.nextTick(se):X!=null&&X.errorEmitted||D!=null&&D.errorEmitted?H||s.nextTick(me):(!z&&(!H||x(G))&&(te||C(G)===!1)||!Ee&&(!H||C(G))&&(be||x(G)===!1)||D&&G.req&&G.aborted)&&s.nextTick(me);let _e=()=>{R=le,G.removeListener("aborted",se),G.removeListener("complete",ne),G.removeListener("abort",se),G.removeListener("request",pe),G.req&&G.req.removeListener("finish",ne),G.removeListener("end",ae),G.removeListener("close",ae),G.removeListener("finish",ne),G.removeListener("end",ce),G.removeListener("error",L),G.removeListener("close",se)};if(oe.signal&&!Y){let Z=()=>{let ve=R;_e(),ve.call(G,new a(void 0,{cause:oe.signal.reason}))};if(oe.signal.aborted)s.nextTick(Z);else{q=q||St().addAbortListener;let ve=q(oe.signal,Z),Ie=R;R=e((...fe)=>{ve[S](),Ie.apply(G,fe)})}}return _e}function ee(G,oe,R){let Q=!1,he=le;if(oe.signal)if(he=()=>{Q=!0,R.call(G,new a(void 0,{cause:oe.signal.reason}))},oe.signal.aborted)s.nextTick(he);else{q=q||St().addAbortListener;let Ee=q(oe.signal,he),X=R;R=e((...D)=>{Ee[S](),X.apply(G,D)})}let z=(...Ee)=>{Q||s.nextTick(()=>R.apply(G,Ee))};return b(G[M].promise,z,z),le}function ue(G,oe){var R;let Q=!1;return oe===null&&(oe=n),(R=oe)!==null&&R!==void 0&&R.cleanup&&(d(oe.cleanup,"cleanup"),Q=oe.cleanup),new y((he,z)=>{let Ee=re(G,oe,X=>{Q&&Ee(),X?z(X):he()})})}l.exports=re,l.exports.finished=ue}),sr=we((o,l)=>{de(),ye(),ge();var s=Jt(),{aggregateTwoErrors:a,codes:{ERR_MULTIPLE_CALLBACK:u},AbortError:t}=wt(),{Symbol:r}=ut(),{kIsDestroyed:n,isDestroyed:e,isFinished:i,isServerRequest:c}=jt(),h=r("kDestroy"),d=r("kConstruct");function y(A,M,q){A&&(A.stack,M&&!M.errored&&(M.errored=A),q&&!q.errored&&(q.errored=A))}function b(A,M){let q=this._readableState,N=this._writableState,le=N||q;return N!=null&&N.destroyed||q!=null&&q.destroyed?(typeof M=="function"&&M(),this):(y(A,N,q),N&&(N.destroyed=!0),q&&(q.destroyed=!0),le.constructed?S(this,A,M):this.once(h,function(re){S(this,a(re,A),M)}),this)}function S(A,M,q){let N=!1;function le(re){if(N)return;N=!0;let ee=A._readableState,ue=A._writableState;y(re,ue,ee),ue&&(ue.closed=!0),ee&&(ee.closed=!0),typeof q=="function"&&q(re),re?s.nextTick(w,A,re):s.nextTick(x,A)}try{A._destroy(M||null,le)}catch(re){le(re)}}function w(A,M){g(A,M),x(A)}function x(A){let M=A._readableState,q=A._writableState;q&&(q.closeEmitted=!0),M&&(M.closeEmitted=!0),(q!=null&&q.emitClose||M!=null&&M.emitClose)&&A.emit("close")}function g(A,M){let q=A._readableState,N=A._writableState;N!=null&&N.errorEmitted||q!=null&&q.errorEmitted||(N&&(N.errorEmitted=!0),q&&(q.errorEmitted=!0),A.emit("error",M))}function _(){let A=this._readableState,M=this._writableState;A&&(A.constructed=!0,A.closed=!1,A.closeEmitted=!1,A.destroyed=!1,A.errored=null,A.errorEmitted=!1,A.reading=!1,A.ended=A.readable===!1,A.endEmitted=A.readable===!1),M&&(M.constructed=!0,M.destroyed=!1,M.closed=!1,M.closeEmitted=!1,M.errored=null,M.errorEmitted=!1,M.finalCalled=!1,M.prefinished=!1,M.ended=M.writable===!1,M.ending=M.writable===!1,M.finished=M.writable===!1)}function E(A,M,q){let N=A._readableState,le=A._writableState;if(le!=null&&le.destroyed||N!=null&&N.destroyed)return this;N!=null&&N.autoDestroy||le!=null&&le.autoDestroy?A.destroy(M):M&&(M.stack,le&&!le.errored&&(le.errored=M),N&&!N.errored&&(N.errored=M),q?s.nextTick(g,A,M):g(A,M))}function v(A,M){if(typeof A._construct!="function")return;let q=A._readableState,N=A._writableState;q&&(q.constructed=!1),N&&(N.constructed=!1),A.once(d,M),!(A.listenerCount(d)>1)&&s.nextTick(C,A)}function C(A){let M=!1;function q(N){if(M){E(A,N??new u);return}M=!0;let le=A._readableState,re=A._writableState,ee=re||le;le&&(le.constructed=!0),re&&(re.constructed=!0),ee.destroyed?A.emit(h,N):N?E(A,N,!0):s.nextTick(P,A)}try{A._construct(N=>{s.nextTick(q,N)})}catch(N){s.nextTick(q,N)}}function P(A){A.emit(d)}function I(A){return(A==null?void 0:A.setHeader)&&typeof A.abort=="function"}function T(A){A.emit("close")}function k(A,M){A.emit("error",M),s.nextTick(T,A)}function W(A,M){!A||e(A)||(!M&&!i(A)&&(M=new t),c(A)?(A.socket=null,A.destroy(M)):I(A)?A.abort():I(A.req)?A.req.abort():typeof A.destroy=="function"?A.destroy(M):typeof A.close=="function"?A.close():M?s.nextTick(k,A,M):s.nextTick(T,A),A.destroyed||(A[n]=!0))}l.exports={construct:v,destroyer:W,destroy:b,undestroy:_,errorOrDestroy:E}}),ki=we((o,l)=>{de(),ye(),ge();var{ArrayIsArray:s,ObjectSetPrototypeOf:a}=ut(),{EventEmitter:u}=(Qt(),tt(Ft));function t(n){u.call(this,n)}a(t.prototype,u.prototype),a(t,u),t.prototype.pipe=function(n,e){let i=this;function c(x){n.writable&&n.write(x)===!1&&i.pause&&i.pause()}i.on("data",c);function h(){i.readable&&i.resume&&i.resume()}n.on("drain",h),!n._isStdio&&(!e||e.end!==!1)&&(i.on("end",y),i.on("close",b));let d=!1;function y(){d||(d=!0,n.end())}function b(){d||(d=!0,typeof n.destroy=="function"&&n.destroy())}function S(x){w(),u.listenerCount(this,"error")===0&&this.emit("error",x)}r(i,"error",S),r(n,"error",S);function w(){i.removeListener("data",c),n.removeListener("drain",h),i.removeListener("end",y),i.removeListener("close",b),i.removeListener("error",S),n.removeListener("error",S),i.removeListener("end",w),i.removeListener("close",w),n.removeListener("close",w)}return i.on("end",w),i.on("close",w),n.on("close",w),n.emit("pipe",i),n};function r(n,e,i){if(typeof n.prependListener=="function")return n.prependListener(e,i);!n._events||!n._events[e]?n.on(e,i):s(n._events[e])?n._events[e].unshift(i):n._events[e]=[i,n._events[e]]}l.exports={Stream:t,prependListener:r}}),Ir=we((o,l)=>{de(),ye(),ge();var{SymbolDispose:s}=ut(),{AbortError:a,codes:u}=wt(),{isNodeStream:t,isWebStream:r,kControllerErrorFunction:n}=jt(),e=Wt(),{ERR_INVALID_ARG_TYPE:i}=u,c,h=(d,y)=>{if(typeof d!="object"||!("aborted"in d))throw new i(y,"AbortSignal",d)};l.exports.addAbortSignal=function(d,y){if(h(d,"signal"),!t(y)&&!r(y))throw new i("stream",["ReadableStream","WritableStream","Stream"],y);return l.exports.addAbortSignalNoValidate(d,y)},l.exports.addAbortSignalNoValidate=function(d,y){if(typeof d!="object"||!("aborted"in d))return y;let b=t(y)?()=>{y.destroy(new a(void 0,{cause:d.reason}))}:()=>{y[n](new a(void 0,{cause:d.reason}))};if(d.aborted)b();else{c=c||St().addAbortListener;let S=c(d,b);e(y,S[s])}return y}}),Tu=we((o,l)=>{de(),ye(),ge();var{StringPrototypeSlice:s,SymbolIterator:a,TypedArrayPrototypeSet:u,Uint8Array:t}=ut(),{Buffer:r}=(dt(),tt(pt)),{inspect:n}=St();l.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?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(this.length===0)return"";let i=this.head,c=""+i.data;for(;(i=i.next)!==null;)c+=e+i.data;return c}concat(e){if(this.length===0)return r.alloc(0);let i=r.allocUnsafe(e>>>0),c=this.head,h=0;for(;c;)u(i,c.data,h),h+=c.data.length,c=c.next;return i}consume(e,i){let c=this.head.data;if(e<c.length){let h=c.slice(0,e);return this.head.data=c.slice(e),h}return e===c.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[a](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",c=this.head,h=0;do{let d=c.data;if(e>d.length)i+=d,e-=d.length;else{e===d.length?(i+=d,++h,c.next?this.head=c.next:this.head=this.tail=null):(i+=s(d,0,e),this.head=c,c.data=s(d,e));break}++h}while((c=c.next)!==null);return this.length-=h,i}_getBuffer(e){let i=r.allocUnsafe(e),c=e,h=this.head,d=0;do{let y=h.data;if(e>y.length)u(i,y,c-e),e-=y.length;else{e===y.length?(u(i,y,c-e),++d,h.next?this.head=h.next:this.head=this.tail=null):(u(i,new t(y.buffer,y.byteOffset,e),c-e),this.head=h,h.data=y.slice(e));break}++d}while((h=h.next)!==null);return this.length-=d,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return n(this,{...i,depth:0,customInspect:!1})}}}),kr=we((o,l)=>{de(),ye(),ge();var{MathFloor:s,NumberIsInteger:a}=ut(),{validateInteger:u}=br(),{ERR_INVALID_ARG_VALUE:t}=wt().codes,r=16*1024,n=16;function e(d,y,b){return d.highWaterMark!=null?d.highWaterMark:y?d[b]:null}function i(d){return d?n:r}function c(d,y){u(y,"value",0),d?n=y:r=y}function h(d,y,b,S){let w=e(y,S,b);if(w!=null){if(!a(w)||w<0){let x=S?`options.${b}`:"options.highWaterMark";throw new t(x,w)}return s(w)}return i(d.objectMode)}l.exports={getHighWaterMark:h,getDefaultHighWaterMark:i,setDefaultHighWaterMark:c}}),Pu=we((o,l)=>{de(),ye(),ge();var s=(dt(),tt(pt)),a=s.Buffer;function u(r,n){for(var e in r)n[e]=r[e]}a.from&&a.alloc&&a.allocUnsafe&&a.allocUnsafeSlow?l.exports=s:(u(s,o),o.Buffer=t);function t(r,n,e){return a(r,n,e)}t.prototype=Object.create(a.prototype),u(a,t),t.from=function(r,n,e){if(typeof r=="number")throw new TypeError("Argument must not be a number");return a(r,n,e)},t.alloc=function(r,n,e){if(typeof r!="number")throw new TypeError("Argument must be a number");var i=a(r);return n!==void 0?typeof e=="string"?i.fill(n,e):i.fill(n):i.fill(0),i},t.allocUnsafe=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return a(r)},t.allocUnsafeSlow=function(r){if(typeof r!="number")throw new TypeError("Argument must be a number");return s.SlowBuffer(r)}}),Cu=we(o=>{de(),ye(),ge();var l=Pu().Buffer,s=l.isEncoding||function(g){switch(g=""+g,g&&g.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 a(g){if(!g)return"utf8";for(var _;;)switch(g){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 g;default:if(_)return;g=(""+g).toLowerCase(),_=!0}}function u(g){var _=a(g);if(typeof _!="string"&&(l.isEncoding===s||!s(g)))throw new Error("Unknown encoding: "+g);return _||g}o.StringDecoder=t;function t(g){this.encoding=u(g);var _;switch(this.encoding){case"utf16le":this.text=d,this.end=y,_=4;break;case"utf8":this.fillLast=i,_=4;break;case"base64":this.text=b,this.end=S,_=3;break;default:this.write=w,this.end=x;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=l.allocUnsafe(_)}t.prototype.write=function(g){if(g.length===0)return"";var _,E;if(this.lastNeed){if(_=this.fillLast(g),_===void 0)return"";E=this.lastNeed,this.lastNeed=0}else E=0;return E<g.length?_?_+this.text(g,E):this.text(g,E):_||""},t.prototype.end=h,t.prototype.text=c,t.prototype.fillLast=function(g){if(this.lastNeed<=g.length)return g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,this.lastTotal-this.lastNeed,0,g.length),this.lastNeed-=g.length};function r(g){return g<=127?0:g>>5===6?2:g>>4===14?3:g>>3===30?4:g>>6===2?-1:-2}function n(g,_,E){var v=_.length-1;if(v<E)return 0;var C=r(_[v]);return C>=0?(C>0&&(g.lastNeed=C-1),C):--v<E||C===-2?0:(C=r(_[v]),C>=0?(C>0&&(g.lastNeed=C-2),C):--v<E||C===-2?0:(C=r(_[v]),C>=0?(C>0&&(C===2?C=0:g.lastNeed=C-3),C):0))}function e(g,_,E){if((_[0]&192)!==128)return g.lastNeed=0,"�";if(g.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return g.lastNeed=1,"�";if(g.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return g.lastNeed=2,"�"}}function i(g){var _=this.lastTotal-this.lastNeed,E=e(this,g);if(E!==void 0)return E;if(this.lastNeed<=g.length)return g.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);g.copy(this.lastChar,_,0,g.length),this.lastNeed-=g.length}function c(g,_){var E=n(this,g,_);if(!this.lastNeed)return g.toString("utf8",_);this.lastTotal=E;var v=g.length-(E-this.lastNeed);return g.copy(this.lastChar,0,v),g.toString("utf8",_,v)}function h(g){var _=g&&g.length?this.write(g):"";return this.lastNeed?_+"�":_}function d(g,_){if((g.length-_)%2===0){var E=g.toString("utf16le",_);if(E){var v=E.charCodeAt(E.length-1);if(v>=55296&&v<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1],E.slice(0,-1)}return E}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=g[g.length-1],g.toString("utf16le",_,g.length-1)}function y(g){var _=g&&g.length?this.write(g):"";if(this.lastNeed){var E=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,E)}return _}function b(g,_){var E=(g.length-_)%3;return E===0?g.toString("base64",_):(this.lastNeed=3-E,this.lastTotal=3,E===1?this.lastChar[0]=g[g.length-1]:(this.lastChar[0]=g[g.length-2],this.lastChar[1]=g[g.length-1]),g.toString("base64",_,g.length-E))}function S(g){var _=g&&g.length?this.write(g):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function w(g){return g.toString(this.encoding)}function x(g){return g&&g.length?this.write(g):""}}),ds=we((o,l)=>{de(),ye(),ge();var s=Jt(),{PromisePrototypeThen:a,SymbolAsyncIterator:u,SymbolIterator:t}=ut(),{Buffer:r}=(dt(),tt(pt)),{ERR_INVALID_ARG_TYPE:n,ERR_STREAM_NULL_VALUES:e}=wt().codes;function i(c,h,d){let y;if(typeof h=="string"||h instanceof r)return new c({objectMode:!0,...d,read(){this.push(h),this.push(null)}});let b;if(h&&h[u])b=!0,y=h[u]();else if(h&&h[t])b=!1,y=h[t]();else throw new n("iterable",["Iterable"],h);let S=new c({objectMode:!0,highWaterMark:1,...d}),w=!1;S._read=function(){w||(w=!0,g())},S._destroy=function(_,E){a(x(_),()=>s.nextTick(E,_),v=>s.nextTick(E,v||_))};async function x(_){let E=_!=null,v=typeof y.throw=="function";if(E&&v){let{value:C,done:P}=await y.throw(_);if(await C,P)return}if(typeof y.return=="function"){let{value:C}=await y.return();await C}}async function g(){for(;;){try{let{value:_,done:E}=b?await y.next():y.next();if(E)S.push(null);else{let v=_&&typeof _.then=="function"?await _:_;if(v===null)throw w=!1,new e;if(S.push(v))continue;w=!1}}catch(_){S.destroy(_)}break}}return S}l.exports=i}),Or=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayPrototypeIndexOf:a,NumberIsInteger:u,NumberIsNaN:t,NumberParseInt:r,ObjectDefineProperties:n,ObjectKeys:e,ObjectSetPrototypeOf:i,Promise:c,SafeSet:h,SymbolAsyncDispose:d,SymbolAsyncIterator:y,Symbol:b}=ut();l.exports=fe,fe.ReadableState=Ie;var{EventEmitter:S}=(Qt(),tt(Ft)),{Stream:w,prependListener:x}=ki(),{Buffer:g}=(dt(),tt(pt)),{addAbortSignal:_}=Ir(),E=Wt(),v=St().debuglog("stream",j=>{v=j}),C=Tu(),P=sr(),{getHighWaterMark:I,getDefaultHighWaterMark:T}=kr(),{aggregateTwoErrors:k,codes:{ERR_INVALID_ARG_TYPE:W,ERR_METHOD_NOT_IMPLEMENTED:A,ERR_OUT_OF_RANGE:M,ERR_STREAM_PUSH_AFTER_EOF:q,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N},AbortError:le}=wt(),{validateObject:re}=br(),ee=b("kPaused"),{StringDecoder:ue}=Cu(),G=ds();i(fe.prototype,w.prototype),i(fe,w);var oe=()=>{},{errorOrDestroy:R}=P,Q=1,he=2,z=4,Ee=8,X=16,D=32,ae=64,H=128,te=256,ne=512,be=1024,ce=2048,L=4096,Y=8192,se=16384,me=32768,pe=65536,_e=1<<17,Z=1<<18;function ve(j){return{enumerable:!1,get(){return(this.state&j)!==0},set(U){U?this.state|=j:this.state&=~j}}}n(Ie.prototype,{objectMode:ve(Q),ended:ve(he),endEmitted:ve(z),reading:ve(Ee),constructed:ve(X),sync:ve(D),needReadable:ve(ae),emittedReadable:ve(H),readableListening:ve(te),resumeScheduled:ve(ne),errorEmitted:ve(be),emitClose:ve(ce),autoDestroy:ve(L),destroyed:ve(Y),closed:ve(se),closeEmitted:ve(me),multiAwaitDrain:ve(pe),readingMore:ve(_e),dataEmitted:ve(Z)});function Ie(j,U,Ae){typeof Ae!="boolean"&&(Ae=U instanceof Rt()),this.state=ce|L|X|D,j&&j.objectMode&&(this.state|=Q),Ae&&j&&j.readableObjectMode&&(this.state|=Q),this.highWaterMark=j?I(this,j,"readableHighWaterMark",Ae):T(!1),this.buffer=new C,this.length=0,this.pipes=[],this.flowing=null,this[ee]=null,j&&j.emitClose===!1&&(this.state&=~ce),j&&j.autoDestroy===!1&&(this.state&=~L),this.errored=null,this.defaultEncoding=j&&j.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,j&&j.encoding&&(this.decoder=new ue(j.encoding),this.encoding=j.encoding)}function fe(j){if(!(this instanceof fe))return new fe(j);let U=this instanceof Rt();this._readableState=new Ie(j,this,U),j&&(typeof j.read=="function"&&(this._read=j.read),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.construct=="function"&&(this._construct=j.construct),j.signal&&!U&&_(j.signal,this)),w.call(this,j),P.construct(this,()=>{this._readableState.needReadable&&$(this,this._readableState)})}fe.prototype.destroy=P.destroy,fe.prototype._undestroy=P.undestroy,fe.prototype._destroy=function(j,U){U(j)},fe.prototype[S.captureRejectionSymbol]=function(j){this.destroy(j)},fe.prototype[d]=function(){let j;return this.destroyed||(j=this.readableEnded?null:new le,this.destroy(j)),new c((U,Ae)=>E(this,Ce=>Ce&&Ce!==j?Ae(Ce):U(null)))},fe.prototype.push=function(j,U){return De(this,j,U,!1)},fe.prototype.unshift=function(j,U){return De(this,j,U,!0)};function De(j,U,Ae,Ce){v("readableAddChunk",U);let Be=j._readableState,ft;if(!(Be.state&Q)&&(typeof U=="string"?(Ae=Ae||Be.defaultEncoding,Be.encoding!==Ae&&(Ce&&Be.encoding?U=g.from(U,Ae).toString(Be.encoding):(U=g.from(U,Ae),Ae=""))):U instanceof g?Ae="":w._isUint8Array(U)?(U=w._uint8ArrayToBuffer(U),Ae=""):U!=null&&(ft=new W("chunk",["string","Buffer","Uint8Array"],U))),ft)R(j,ft);else if(U===null)Be.state&=~Ee,B(j,Be);else if(Be.state&Q||U&&U.length>0)if(Ce)if(Be.state&z)R(j,new N);else{if(Be.destroyed||Be.errored)return!1;f(j,Be,U,!0)}else if(Be.ended)R(j,new q);else{if(Be.destroyed||Be.errored)return!1;Be.state&=~Ee,Be.decoder&&!Ae?(U=Be.decoder.write(U),Be.objectMode||U.length!==0?f(j,Be,U,!1):$(j,Be)):f(j,Be,U,!1)}else Ce||(Be.state&=~Ee,$(j,Be));return!Be.ended&&(Be.length<Be.highWaterMark||Be.length===0)}function f(j,U,Ae,Ce){U.flowing&&U.length===0&&!U.sync&&j.listenerCount("data")>0?(U.state&pe?U.awaitDrainWriters.clear():U.awaitDrainWriters=null,U.dataEmitted=!0,j.emit("data",Ae)):(U.length+=U.objectMode?1:Ae.length,Ce?U.buffer.unshift(Ae):U.buffer.push(Ae),U.state&ae&&V(j)),$(j,U)}fe.prototype.isPaused=function(){let j=this._readableState;return j[ee]===!0||j.flowing===!1},fe.prototype.setEncoding=function(j){let U=new ue(j);this._readableState.decoder=U,this._readableState.encoding=this._readableState.decoder.encoding;let Ae=this._readableState.buffer,Ce="";for(let Be of Ae)Ce+=U.write(Be);return Ae.clear(),Ce!==""&&Ae.push(Ce),this._readableState.length=Ce.length,this};var p=1073741824;function m(j){if(j>p)throw new M("size","<= 1GiB",j);return j--,j|=j>>>1,j|=j>>>2,j|=j>>>4,j|=j>>>8,j|=j>>>16,j++,j}function O(j,U){return j<=0||U.length===0&&U.ended?0:U.state&Q?1:t(j)?U.flowing&&U.length?U.buffer.first().length:U.length:j<=U.length?j:U.ended?U.length:0}fe.prototype.read=function(j){v("read",j),j===void 0?j=NaN:u(j)||(j=r(j,10));let U=this._readableState,Ae=j;if(j>U.highWaterMark&&(U.highWaterMark=m(j)),j!==0&&(U.state&=~H),j===0&&U.needReadable&&((U.highWaterMark!==0?U.length>=U.highWaterMark:U.length>0)||U.ended))return v("read: emitReadable",U.length,U.ended),U.length===0&&U.ended?Ye(this):V(this),null;if(j=O(j,U),j===0&&U.ended)return U.length===0&&Ye(this),null;let Ce=(U.state&ae)!==0;if(v("need readable",Ce),(U.length===0||U.length-j<U.highWaterMark)&&(Ce=!0,v("length less than watermark",Ce)),U.ended||U.reading||U.destroyed||U.errored||!U.constructed)Ce=!1,v("reading, ended or constructing",Ce);else if(Ce){v("do read"),U.state|=Ee|D,U.length===0&&(U.state|=ae);try{this._read(U.highWaterMark)}catch(ft){R(this,ft)}U.state&=~D,U.reading||(j=O(Ae,U))}let Be;return j>0?Be=Ue(j,U):Be=null,Be===null?(U.needReadable=U.length<=U.highWaterMark,j=0):(U.length-=j,U.multiAwaitDrain?U.awaitDrainWriters.clear():U.awaitDrainWriters=null),U.length===0&&(U.ended||(U.needReadable=!0),Ae!==j&&U.ended&&Ye(this)),Be!==null&&!U.errorEmitted&&!U.closeEmitted&&(U.dataEmitted=!0,this.emit("data",Be)),Be};function B(j,U){if(v("onEofChunk"),!U.ended){if(U.decoder){let Ae=U.decoder.end();Ae&&Ae.length&&(U.buffer.push(Ae),U.length+=U.objectMode?1:Ae.length)}U.ended=!0,U.sync?V(j):(U.needReadable=!1,U.emittedReadable=!0,ie(j))}}function V(j){let U=j._readableState;v("emitReadable",U.needReadable,U.emittedReadable),U.needReadable=!1,U.emittedReadable||(v("emitReadable",U.flowing),U.emittedReadable=!0,s.nextTick(ie,j))}function ie(j){let U=j._readableState;v("emitReadable_",U.destroyed,U.length,U.ended),!U.destroyed&&!U.errored&&(U.length||U.ended)&&(j.emit("readable"),U.emittedReadable=!1),U.needReadable=!U.flowing&&!U.ended&&U.length<=U.highWaterMark,rt(j)}function $(j,U){!U.readingMore&&U.constructed&&(U.readingMore=!0,s.nextTick(J,j,U))}function J(j,U){for(;!U.reading&&!U.ended&&(U.length<U.highWaterMark||U.flowing&&U.length===0);){let Ae=U.length;if(v("maybeReadMore read 0"),j.read(0),Ae===U.length)break}U.readingMore=!1}fe.prototype._read=function(j){throw new A("_read()")},fe.prototype.pipe=function(j,U){let Ae=this,Ce=this._readableState;Ce.pipes.length===1&&(Ce.multiAwaitDrain||(Ce.multiAwaitDrain=!0,Ce.awaitDrainWriters=new h(Ce.awaitDrainWriters?[Ce.awaitDrainWriters]:[]))),Ce.pipes.push(j),v("pipe count=%d opts=%j",Ce.pipes.length,U);let Be=(!U||U.end!==!1)&&j!==s.stdout&&j!==s.stderr?yt:ze;Ce.endEmitted?s.nextTick(Be):Ae.once("end",Be),j.on("unpipe",ft);function ft(it,et){v("onunpipe"),it===Ae&&et&&et.hasUnpiped===!1&&(et.hasUnpiped=!0,xe())}function yt(){v("onend"),j.end()}let At,K=!1;function xe(){v("cleanup"),j.removeListener("close",Ge),j.removeListener("finish",Ve),At&&j.removeListener("drain",At),j.removeListener("error",He),j.removeListener("unpipe",ft),Ae.removeListener("end",yt),Ae.removeListener("end",ze),Ae.removeListener("data",We),K=!0,At&&Ce.awaitDrainWriters&&(!j._writableState||j._writableState.needDrain)&&At()}function je(){K||(Ce.pipes.length===1&&Ce.pipes[0]===j?(v("false write response, pause",0),Ce.awaitDrainWriters=j,Ce.multiAwaitDrain=!1):Ce.pipes.length>1&&Ce.pipes.includes(j)&&(v("false write response, pause",Ce.awaitDrainWriters.size),Ce.awaitDrainWriters.add(j)),Ae.pause()),At||(At=Te(Ae,j),j.on("drain",At))}Ae.on("data",We);function We(it){v("ondata");let et=j.write(it);v("dest.write",et),et===!1&&je()}function He(it){if(v("onerror",it),ze(),j.removeListener("error",He),j.listenerCount("error")===0){let et=j._writableState||j._readableState;et&&!et.errorEmitted?R(j,it):j.emit("error",it)}}x(j,"error",He);function Ge(){j.removeListener("finish",Ve),ze()}j.once("close",Ge);function Ve(){v("onfinish"),j.removeListener("close",Ge),ze()}j.once("finish",Ve);function ze(){v("unpipe"),Ae.unpipe(j)}return j.emit("pipe",Ae),j.writableNeedDrain===!0?je():Ce.flowing||(v("pipe resume"),Ae.resume()),j};function Te(j,U){return function(){let Ae=j._readableState;Ae.awaitDrainWriters===U?(v("pipeOnDrain",1),Ae.awaitDrainWriters=null):Ae.multiAwaitDrain&&(v("pipeOnDrain",Ae.awaitDrainWriters.size),Ae.awaitDrainWriters.delete(U)),(!Ae.awaitDrainWriters||Ae.awaitDrainWriters.size===0)&&j.listenerCount("data")&&j.resume()}}fe.prototype.unpipe=function(j){let U=this._readableState,Ae={hasUnpiped:!1};if(U.pipes.length===0)return this;if(!j){let Be=U.pipes;U.pipes=[],this.pause();for(let ft=0;ft<Be.length;ft++)Be[ft].emit("unpipe",this,{hasUnpiped:!1});return this}let Ce=a(U.pipes,j);return Ce===-1?this:(U.pipes.splice(Ce,1),U.pipes.length===0&&this.pause(),j.emit("unpipe",this,Ae),this)},fe.prototype.on=function(j,U){let Ae=w.prototype.on.call(this,j,U),Ce=this._readableState;return j==="data"?(Ce.readableListening=this.listenerCount("readable")>0,Ce.flowing!==!1&&this.resume()):j==="readable"&&!Ce.endEmitted&&!Ce.readableListening&&(Ce.readableListening=Ce.needReadable=!0,Ce.flowing=!1,Ce.emittedReadable=!1,v("on readable",Ce.length,Ce.reading),Ce.length?V(this):Ce.reading||s.nextTick(Me,this)),Ae},fe.prototype.addListener=fe.prototype.on,fe.prototype.removeListener=function(j,U){let Ae=w.prototype.removeListener.call(this,j,U);return j==="readable"&&s.nextTick(Re,this),Ae},fe.prototype.off=fe.prototype.removeListener,fe.prototype.removeAllListeners=function(j){let U=w.prototype.removeAllListeners.apply(this,arguments);return(j==="readable"||j===void 0)&&s.nextTick(Re,this),U};function Re(j){let U=j._readableState;U.readableListening=j.listenerCount("readable")>0,U.resumeScheduled&&U[ee]===!1?U.flowing=!0:j.listenerCount("data")>0?j.resume():U.readableListening||(U.flowing=null)}function Me(j){v("readable nexttick read 0"),j.read(0)}fe.prototype.resume=function(){let j=this._readableState;return j.flowing||(v("resume"),j.flowing=!j.readableListening,Fe(this,j)),j[ee]=!1,this};function Fe(j,U){U.resumeScheduled||(U.resumeScheduled=!0,s.nextTick(nt,j,U))}function nt(j,U){v("resume",U.reading),U.reading||j.read(0),U.resumeScheduled=!1,j.emit("resume"),rt(j),U.flowing&&!U.reading&&j.read(0)}fe.prototype.pause=function(){return v("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(v("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[ee]=!0,this};function rt(j){let U=j._readableState;for(v("flow",U.flowing);U.flowing&&j.read()!==null;);}fe.prototype.wrap=function(j){let U=!1;j.on("data",Ce=>{!this.push(Ce)&&j.pause&&(U=!0,j.pause())}),j.on("end",()=>{this.push(null)}),j.on("error",Ce=>{R(this,Ce)}),j.on("close",()=>{this.destroy()}),j.on("destroy",()=>{this.destroy()}),this._read=()=>{U&&j.resume&&(U=!1,j.resume())};let Ae=e(j);for(let Ce=1;Ce<Ae.length;Ce++){let Be=Ae[Ce];this[Be]===void 0&&typeof j[Be]=="function"&&(this[Be]=j[Be].bind(j))}return this},fe.prototype[y]=function(){return Ke(this)},fe.prototype.iterator=function(j){return j!==void 0&&re(j,"options"),Ke(this,j)};function Ke(j,U){typeof j.read!="function"&&(j=fe.wrap(j,{objectMode:!0}));let Ae=Xe(j,U);return Ae.stream=j,Ae}async function*Xe(j,U){let Ae=oe;function Ce(yt){this===j?(Ae(),Ae=oe):Ae=yt}j.on("readable",Ce);let Be,ft=E(j,{writable:!1},yt=>{Be=yt?k(Be,yt):null,Ae(),Ae=oe});try{for(;;){let yt=j.destroyed?null:j.read();if(yt!==null)yield yt;else{if(Be)throw Be;if(Be===null)return;await new c(Ce)}}}catch(yt){throw Be=k(Be,yt),Be}finally{(Be||(U==null?void 0:U.destroyOnReturn)!==!1)&&(Be===void 0||j._readableState.autoDestroy)?P.destroyer(j,null):(j.off("readable",Ce),ft())}}n(fe.prototype,{readable:{__proto__:null,get(){let j=this._readableState;return!!j&&j.readable!==!1&&!j.destroyed&&!j.errorEmitted&&!j.endEmitted},set(j){this._readableState&&(this._readableState.readable=!!j)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(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(j){this._readableState&&(this._readableState.flowing=j)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},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:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(j){this._readableState&&(this._readableState.destroyed=j)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),n(Ie.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[ee]!==!1},set(j){this[ee]=!!j}}}),fe._fromList=Ue;function Ue(j,U){if(U.length===0)return null;let Ae;return U.objectMode?Ae=U.buffer.shift():!j||j>=U.length?(U.decoder?Ae=U.buffer.join(""):U.buffer.length===1?Ae=U.buffer.first():Ae=U.buffer.concat(U.length),U.buffer.clear()):Ae=U.buffer.consume(j,U.decoder),Ae}function Ye(j){let U=j._readableState;v("endReadable",U.endEmitted),U.endEmitted||(U.ended=!0,s.nextTick(Ze,U,j))}function Ze(j,U){if(v("endReadableNT",j.endEmitted,j.length),!j.errored&&!j.closeEmitted&&!j.endEmitted&&j.length===0){if(j.endEmitted=!0,U.emit("end"),U.writable&&U.allowHalfOpen===!1)s.nextTick(lt,U);else if(j.autoDestroy){let Ae=U._writableState;(!Ae||Ae.autoDestroy&&(Ae.finished||Ae.writable===!1))&&U.destroy()}}}function lt(j){j.writable&&!j.writableEnded&&!j.destroyed&&j.end()}fe.from=function(j,U){return G(fe,j,U)};var ct;function Et(){return ct===void 0&&(ct={}),ct}fe.fromWeb=function(j,U){return Et().newStreamReadableFromReadableStream(j,U)},fe.toWeb=function(j,U){return Et().newReadableStreamFromStreamReadable(j,U)},fe.wrap=function(j,U){var Ae,Ce;return new fe({objectMode:(Ae=(Ce=j.readableObjectMode)!==null&&Ce!==void 0?Ce:j.objectMode)!==null&&Ae!==void 0?Ae:!0,...U,destroy(Be,ft){P.destroyer(j,Be),ft(Be)}}).wrap(j)}}),Oi=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayPrototypeSlice:a,Error:u,FunctionPrototypeSymbolHasInstance:t,ObjectDefineProperty:r,ObjectDefineProperties:n,ObjectSetPrototypeOf:e,StringPrototypeToLowerCase:i,Symbol:c,SymbolHasInstance:h}=ut();l.exports=re,re.WritableState=N;var{EventEmitter:d}=(Qt(),tt(Ft)),y=ki().Stream,{Buffer:b}=(dt(),tt(pt)),S=sr(),{addAbortSignal:w}=Ir(),{getHighWaterMark:x,getDefaultHighWaterMark:g}=kr(),{ERR_INVALID_ARG_TYPE:_,ERR_METHOD_NOT_IMPLEMENTED:E,ERR_MULTIPLE_CALLBACK:v,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:P,ERR_STREAM_ALREADY_FINISHED:I,ERR_STREAM_NULL_VALUES:T,ERR_STREAM_WRITE_AFTER_END:k,ERR_UNKNOWN_ENCODING:W}=wt().codes,{errorOrDestroy:A}=S;e(re.prototype,y.prototype),e(re,y);function M(){}var q=c("kOnFinished");function N(L,Y,se){typeof se!="boolean"&&(se=Y instanceof Rt()),this.objectMode=!!(L&&L.objectMode),se&&(this.objectMode=this.objectMode||!!(L&&L.writableObjectMode)),this.highWaterMark=L?x(this,L,"writableHighWaterMark",se):g(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let me=!!(L&&L.decodeStrings===!1);this.decodeStrings=!me,this.defaultEncoding=L&&L.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=R.bind(void 0,Y),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,le(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!L||L.emitClose!==!1,this.autoDestroy=!L||L.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[q]=[]}function le(L){L.buffered=[],L.bufferedIndex=0,L.allBuffers=!0,L.allNoop=!0}N.prototype.getBuffer=function(){return a(this.buffered,this.bufferedIndex)},r(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function re(L){let Y=this instanceof Rt();if(!Y&&!t(re,this))return new re(L);this._writableState=new N(L,this,Y),L&&(typeof L.write=="function"&&(this._write=L.write),typeof L.writev=="function"&&(this._writev=L.writev),typeof L.destroy=="function"&&(this._destroy=L.destroy),typeof L.final=="function"&&(this._final=L.final),typeof L.construct=="function"&&(this._construct=L.construct),L.signal&&w(L.signal,this)),y.call(this,L),S.construct(this,()=>{let se=this._writableState;se.writing||Ee(this,se),H(this,se)})}r(re,h,{__proto__:null,value:function(L){return t(this,L)?!0:this!==re?!1:L&&L._writableState instanceof N}}),re.prototype.pipe=function(){A(this,new C)};function ee(L,Y,se,me){let pe=L._writableState;if(typeof se=="function")me=se,se=pe.defaultEncoding;else{if(!se)se=pe.defaultEncoding;else if(se!=="buffer"&&!b.isEncoding(se))throw new W(se);typeof me!="function"&&(me=M)}if(Y===null)throw new T;if(!pe.objectMode)if(typeof Y=="string")pe.decodeStrings!==!1&&(Y=b.from(Y,se),se="buffer");else if(Y instanceof b)se="buffer";else if(y._isUint8Array(Y))Y=y._uint8ArrayToBuffer(Y),se="buffer";else throw new _("chunk",["string","Buffer","Uint8Array"],Y);let _e;return pe.ending?_e=new k:pe.destroyed&&(_e=new P("write")),_e?(s.nextTick(me,_e),A(L,_e,!0),_e):(pe.pendingcb++,ue(L,pe,Y,se,me))}re.prototype.write=function(L,Y,se){return ee(this,L,Y,se)===!0},re.prototype.cork=function(){this._writableState.corked++},re.prototype.uncork=function(){let L=this._writableState;L.corked&&(L.corked--,L.writing||Ee(this,L))},re.prototype.setDefaultEncoding=function(L){if(typeof L=="string"&&(L=i(L)),!b.isEncoding(L))throw new W(L);return this._writableState.defaultEncoding=L,this};function ue(L,Y,se,me,pe){let _e=Y.objectMode?1:se.length;Y.length+=_e;let Z=Y.length<Y.highWaterMark;return Z||(Y.needDrain=!0),Y.writing||Y.corked||Y.errored||!Y.constructed?(Y.buffered.push({chunk:se,encoding:me,callback:pe}),Y.allBuffers&&me!=="buffer"&&(Y.allBuffers=!1),Y.allNoop&&pe!==M&&(Y.allNoop=!1)):(Y.writelen=_e,Y.writecb=pe,Y.writing=!0,Y.sync=!0,L._write(se,me,Y.onwrite),Y.sync=!1),Z&&!Y.errored&&!Y.destroyed}function G(L,Y,se,me,pe,_e,Z){Y.writelen=me,Y.writecb=Z,Y.writing=!0,Y.sync=!0,Y.destroyed?Y.onwrite(new P("write")):se?L._writev(pe,Y.onwrite):L._write(pe,_e,Y.onwrite),Y.sync=!1}function oe(L,Y,se,me){--Y.pendingcb,me(se),z(Y),A(L,se)}function R(L,Y){let se=L._writableState,me=se.sync,pe=se.writecb;if(typeof pe!="function"){A(L,new v);return}se.writing=!1,se.writecb=null,se.length-=se.writelen,se.writelen=0,Y?(Y.stack,se.errored||(se.errored=Y),L._readableState&&!L._readableState.errored&&(L._readableState.errored=Y),me?s.nextTick(oe,L,se,Y,pe):oe(L,se,Y,pe)):(se.buffered.length>se.bufferedIndex&&Ee(L,se),me?se.afterWriteTickInfo!==null&&se.afterWriteTickInfo.cb===pe?se.afterWriteTickInfo.count++:(se.afterWriteTickInfo={count:1,cb:pe,stream:L,state:se},s.nextTick(Q,se.afterWriteTickInfo)):he(L,se,1,pe))}function Q({stream:L,state:Y,count:se,cb:me}){return Y.afterWriteTickInfo=null,he(L,Y,se,me)}function he(L,Y,se,me){for(!Y.ending&&!L.destroyed&&Y.length===0&&Y.needDrain&&(Y.needDrain=!1,L.emit("drain"));se-- >0;)Y.pendingcb--,me();Y.destroyed&&z(Y),H(L,Y)}function z(L){if(L.writing)return;for(let pe=L.bufferedIndex;pe<L.buffered.length;++pe){var Y;let{chunk:_e,callback:Z}=L.buffered[pe],ve=L.objectMode?1:_e.length;L.length-=ve,Z((Y=L.errored)!==null&&Y!==void 0?Y:new P("write"))}let se=L[q].splice(0);for(let pe=0;pe<se.length;pe++){var me;se[pe]((me=L.errored)!==null&&me!==void 0?me:new P("end"))}le(L)}function Ee(L,Y){if(Y.corked||Y.bufferProcessing||Y.destroyed||!Y.constructed)return;let{buffered:se,bufferedIndex:me,objectMode:pe}=Y,_e=se.length-me;if(!_e)return;let Z=me;if(Y.bufferProcessing=!0,_e>1&&L._writev){Y.pendingcb-=_e-1;let ve=Y.allNoop?M:fe=>{for(let De=Z;De<se.length;++De)se[De].callback(fe)},Ie=Y.allNoop&&Z===0?se:a(se,Z);Ie.allBuffers=Y.allBuffers,G(L,Y,!0,Y.length,Ie,"",ve),le(Y)}else{do{let{chunk:ve,encoding:Ie,callback:fe}=se[Z];se[Z++]=null;let De=pe?1:ve.length;G(L,Y,!1,De,ve,Ie,fe)}while(Z<se.length&&!Y.writing);Z===se.length?le(Y):Z>256?(se.splice(0,Z),Y.bufferedIndex=0):Y.bufferedIndex=Z}Y.bufferProcessing=!1}re.prototype._write=function(L,Y,se){if(this._writev)this._writev([{chunk:L,encoding:Y}],se);else throw new E("_write()")},re.prototype._writev=null,re.prototype.end=function(L,Y,se){let me=this._writableState;typeof L=="function"?(se=L,L=null,Y=null):typeof Y=="function"&&(se=Y,Y=null);let pe;if(L!=null){let _e=ee(this,L,Y);_e instanceof u&&(pe=_e)}return me.corked&&(me.corked=1,this.uncork()),pe||(!me.errored&&!me.ending?(me.ending=!0,H(this,me,!0),me.ended=!0):me.finished?pe=new I("end"):me.destroyed&&(pe=new P("end"))),typeof se=="function"&&(pe||me.finished?s.nextTick(se,pe):me[q].push(se)),this};function X(L){return L.ending&&!L.destroyed&&L.constructed&&L.length===0&&!L.errored&&L.buffered.length===0&&!L.finished&&!L.writing&&!L.errorEmitted&&!L.closeEmitted}function D(L,Y){let se=!1;function me(pe){if(se){A(L,pe??v());return}if(se=!0,Y.pendingcb--,pe){let _e=Y[q].splice(0);for(let Z=0;Z<_e.length;Z++)_e[Z](pe);A(L,pe,Y.sync)}else X(Y)&&(Y.prefinished=!0,L.emit("prefinish"),Y.pendingcb++,s.nextTick(te,L,Y))}Y.sync=!0,Y.pendingcb++;try{L._final(me)}catch(pe){me(pe)}Y.sync=!1}function ae(L,Y){!Y.prefinished&&!Y.finalCalled&&(typeof L._final=="function"&&!Y.destroyed?(Y.finalCalled=!0,D(L,Y)):(Y.prefinished=!0,L.emit("prefinish")))}function H(L,Y,se){X(Y)&&(ae(L,Y),Y.pendingcb===0&&(se?(Y.pendingcb++,s.nextTick((me,pe)=>{X(pe)?te(me,pe):pe.pendingcb--},L,Y)):X(Y)&&(Y.pendingcb++,te(L,Y))))}function te(L,Y){Y.pendingcb--,Y.finished=!0;let se=Y[q].splice(0);for(let me=0;me<se.length;me++)se[me]();if(L.emit("finish"),Y.autoDestroy){let me=L._readableState;(!me||me.autoDestroy&&(me.endEmitted||me.readable===!1))&&L.destroy()}}n(re.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(L){this._writableState&&(this._writableState.destroyed=L)}},writable:{__proto__:null,get(){let L=this._writableState;return!!L&&L.writable!==!1&&!L.destroyed&&!L.errored&&!L.ending&&!L.ended},set(L){this._writableState&&(this._writableState.writable=!!L)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let L=this._writableState;return L?!L.destroyed&&!L.ending&&L.needDrain:!1}},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!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var ne=S.destroy;re.prototype.destroy=function(L,Y){let se=this._writableState;return!se.destroyed&&(se.bufferedIndex<se.buffered.length||se[q].length)&&s.nextTick(z,se),ne.call(this,L,Y),this},re.prototype._undestroy=S.undestroy,re.prototype._destroy=function(L,Y){Y(L)},re.prototype[d.captureRejectionSymbol]=function(L){this.destroy(L)};var be;function ce(){return be===void 0&&(be={}),be}re.fromWeb=function(L,Y){return ce().newStreamWritableFromWritableStream(L,Y)},re.toWeb=function(L){return ce().newWritableStreamFromStreamWritable(L)}}),ju=we((o,l)=>{de(),ye(),ge();var s=Jt(),a=(dt(),tt(pt)),{isReadable:u,isWritable:t,isIterable:r,isNodeStream:n,isReadableNodeStream:e,isWritableNodeStream:i,isDuplexNodeStream:c,isReadableStream:h,isWritableStream:d}=jt(),y=Wt(),{AbortError:b,codes:{ERR_INVALID_ARG_TYPE:S,ERR_INVALID_RETURN_VALUE:w}}=wt(),{destroyer:x}=sr(),g=Rt(),_=Or(),E=Oi(),{createDeferredPromise:v}=St(),C=ds(),P=globalThis.Blob||a.Blob,I=typeof P<"u"?function(q){return q instanceof P}:function(q){return!1},T=globalThis.AbortController||yr().AbortController,{FunctionPrototypeCall:k}=ut(),W=class extends g{constructor(q){super(q),(q==null?void 0:q.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(q==null?void 0:q.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};l.exports=function q(N,le){if(c(N))return N;if(e(N))return M({readable:N});if(i(N))return M({writable:N});if(n(N))return M({writable:!1,readable:!1});if(h(N))return M({readable:_.fromWeb(N)});if(d(N))return M({writable:E.fromWeb(N)});if(typeof N=="function"){let{value:ee,write:ue,final:G,destroy:oe}=A(N);if(r(ee))return C(W,ee,{objectMode:!0,write:ue,final:G,destroy:oe});let R=ee==null?void 0:ee.then;if(typeof R=="function"){let Q,he=k(R,ee,z=>{if(z!=null)throw new w("nully","body",z)},z=>{x(Q,z)});return Q=new W({objectMode:!0,readable:!1,write:ue,final(z){G(async()=>{try{await he,s.nextTick(z,null)}catch(Ee){s.nextTick(z,Ee)}})},destroy:oe})}throw new w("Iterable, AsyncIterable or AsyncFunction",le,ee)}if(I(N))return q(N.arrayBuffer());if(r(N))return C(W,N,{objectMode:!0,writable:!1});if(h(N==null?void 0:N.readable)&&d(N==null?void 0:N.writable))return W.fromWeb(N);if(typeof(N==null?void 0:N.writable)=="object"||typeof(N==null?void 0:N.readable)=="object"){let ee=N!=null&&N.readable?e(N==null?void 0:N.readable)?N==null?void 0:N.readable:q(N.readable):void 0,ue=N!=null&&N.writable?i(N==null?void 0:N.writable)?N==null?void 0:N.writable:q(N.writable):void 0;return M({readable:ee,writable:ue})}let re=N==null?void 0:N.then;if(typeof re=="function"){let ee;return k(re,N,ue=>{ue!=null&&ee.push(ue),ee.push(null)},ue=>{x(ee,ue)}),ee=new W({objectMode:!0,writable:!1,read(){}})}throw new S(le,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],N)};function A(q){let{promise:N,resolve:le}=v(),re=new T,ee=re.signal;return{value:q(async function*(){for(;;){let ue=N;N=null;let{chunk:G,done:oe,cb:R}=await ue;if(s.nextTick(R),oe)return;if(ee.aborted)throw new b(void 0,{cause:ee.reason});({promise:N,resolve:le}=v()),yield G}}(),{signal:ee}),write(ue,G,oe){let R=le;le=null,R({chunk:ue,done:!1,cb:oe})},final(ue){let G=le;le=null,G({done:!0,cb:ue})},destroy(ue,G){re.abort(),G(ue)}}}function M(q){let N=q.readable&&typeof q.readable.read!="function"?_.wrap(q.readable):q.readable,le=q.writable,re=!!u(N),ee=!!t(le),ue,G,oe,R,Q;function he(z){let Ee=R;R=null,Ee?Ee(z):z&&Q.destroy(z)}return Q=new W({readableObjectMode:!!(N!=null&&N.readableObjectMode),writableObjectMode:!!(le!=null&&le.writableObjectMode),readable:re,writable:ee}),ee&&(y(le,z=>{ee=!1,z&&x(N,z),he(z)}),Q._write=function(z,Ee,X){le.write(z,Ee)?X():ue=X},Q._final=function(z){le.end(),G=z},le.on("drain",function(){if(ue){let z=ue;ue=null,z()}}),le.on("finish",function(){if(G){let z=G;G=null,z()}})),re&&(y(N,z=>{re=!1,z&&x(N,z),he(z)}),N.on("readable",function(){if(oe){let z=oe;oe=null,z()}}),N.on("end",function(){Q.push(null)}),Q._read=function(){for(;;){let z=N.read();if(z===null){oe=Q._read;return}if(!Q.push(z))return}}),Q._destroy=function(z,Ee){!z&&R!==null&&(z=new b),oe=null,ue=null,G=null,R===null?Ee(z):(R=Ee,x(le,z),x(N,z))},Q}}),Rt=we((o,l)=>{de(),ye(),ge();var{ObjectDefineProperties:s,ObjectGetOwnPropertyDescriptor:a,ObjectKeys:u,ObjectSetPrototypeOf:t}=ut();l.exports=e;var r=Or(),n=Oi();t(e.prototype,r.prototype),t(e,r);{let d=u(n.prototype);for(let y=0;y<d.length;y++){let b=d[y];e.prototype[b]||(e.prototype[b]=n.prototype[b])}}function e(d){if(!(this instanceof e))return new e(d);r.call(this,d),n.call(this,d),d?(this.allowHalfOpen=d.allowHalfOpen!==!1,d.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),d.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(e.prototype,{writable:{__proto__:null,...a(n.prototype,"writable")},writableHighWaterMark:{__proto__:null,...a(n.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...a(n.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...a(n.prototype,"writableBuffer")},writableLength:{__proto__:null,...a(n.prototype,"writableLength")},writableFinished:{__proto__:null,...a(n.prototype,"writableFinished")},writableCorked:{__proto__:null,...a(n.prototype,"writableCorked")},writableEnded:{__proto__:null,...a(n.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...a(n.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(d){this._readableState&&this._writableState&&(this._readableState.destroyed=d,this._writableState.destroyed=d)}}});var i;function c(){return i===void 0&&(i={}),i}e.fromWeb=function(d,y){return c().newStreamDuplexFromReadableWritablePair(d,y)},e.toWeb=function(d){return c().newReadableWritablePairFromDuplex(d)};var h;e.from=function(d){return h||(h=ju()),h(d,"body")}}),gs=we((o,l)=>{de(),ye(),ge();var{ObjectSetPrototypeOf:s,Symbol:a}=ut();l.exports=e;var{ERR_METHOD_NOT_IMPLEMENTED:u}=wt().codes,t=Rt(),{getHighWaterMark:r}=kr();s(e.prototype,t.prototype),s(e,t);var n=a("kCallback");function e(h){if(!(this instanceof e))return new e(h);let d=h?r(this,h,"readableHighWaterMark",!0):null;d===0&&(h={...h,highWaterMark:null,readableHighWaterMark:d,writableHighWaterMark:h.writableHighWaterMark||0}),t.call(this,h),this._readableState.sync=!1,this[n]=null,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",c)}function i(h){typeof this._flush=="function"&&!this.destroyed?this._flush((d,y)=>{if(d){h?h(d):this.destroy(d);return}y!=null&&this.push(y),this.push(null),h&&h()}):(this.push(null),h&&h())}function c(){this._final!==i&&i.call(this)}e.prototype._final=i,e.prototype._transform=function(h,d,y){throw new u("_transform()")},e.prototype._write=function(h,d,y){let b=this._readableState,S=this._writableState,w=b.length;this._transform(h,d,(x,g)=>{if(x){y(x);return}g!=null&&this.push(g),S.ended||w===b.length||b.length<b.highWaterMark?y():this[n]=y})},e.prototype._read=function(){if(this[n]){let h=this[n];this[n]=null,h()}}}),ys=we((o,l)=>{de(),ye(),ge();var{ObjectSetPrototypeOf:s}=ut();l.exports=u;var a=gs();s(u.prototype,a.prototype),s(u,a);function u(t){if(!(this instanceof u))return new u(t);a.call(this,t)}u.prototype._transform=function(t,r,n){n(null,t)}}),Ti=we((o,l)=>{de(),ye(),ge();var s=Jt(),{ArrayIsArray:a,Promise:u,SymbolAsyncIterator:t,SymbolDispose:r}=ut(),n=Wt(),{once:e}=St(),i=sr(),c=Rt(),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:y,ERR_MISSING_ARGS:b,ERR_STREAM_DESTROYED:S,ERR_STREAM_PREMATURE_CLOSE:w},AbortError:x}=wt(),{validateFunction:g,validateAbortSignal:_}=br(),{isIterable:E,isReadable:v,isReadableNodeStream:C,isNodeStream:P,isTransformStream:I,isWebStream:T,isReadableStream:k,isReadableFinished:W}=jt(),A=globalThis.AbortController||yr().AbortController,M,q,N;function le(z,Ee,X){let D=!1;z.on("close",()=>{D=!0});let ae=n(z,{readable:Ee,writable:X},H=>{D=!H});return{destroy:H=>{D||(D=!0,i.destroyer(z,H||new S("pipe")))},cleanup:ae}}function re(z){return g(z[z.length-1],"streams[stream.length - 1]"),z.pop()}function ee(z){if(E(z))return z;if(C(z))return ue(z);throw new d("val",["Readable","Iterable","AsyncIterable"],z)}async function*ue(z){q||(q=Or()),yield*q.prototype[t].call(z)}async function G(z,Ee,X,{end:D}){let ae,H=null,te=ce=>{if(ce&&(ae=ce),H){let L=H;H=null,L()}},ne=()=>new u((ce,L)=>{ae?L(ae):H=()=>{ae?L(ae):ce()}});Ee.on("drain",te);let be=n(Ee,{readable:!1},te);try{Ee.writableNeedDrain&&await ne();for await(let ce of z)Ee.write(ce)||await ne();D&&(Ee.end(),await ne()),X()}catch(ce){X(ae!==ce?h(ae,ce):ce)}finally{be(),Ee.off("drain",te)}}async function oe(z,Ee,X,{end:D}){I(Ee)&&(Ee=Ee.writable);let ae=Ee.getWriter();try{for await(let H of z)await ae.ready,ae.write(H).catch(()=>{});await ae.ready,D&&await ae.close(),X()}catch(H){try{await ae.abort(H),X(H)}catch(te){X(te)}}}function R(...z){return Q(z,e(re(z)))}function Q(z,Ee,X){if(z.length===1&&a(z[0])&&(z=z[0]),z.length<2)throw new b("streams");let D=new A,ae=D.signal,H=X==null?void 0:X.signal,te=[];_(H,"options.signal");function ne(){pe(new x)}N=N||St().addAbortListener;let be;H&&(be=N(H,ne));let ce,L,Y=[],se=0;function me(Ie){pe(Ie,--se===0)}function pe(Ie,fe){var De;if(Ie&&(!ce||ce.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ce=Ie),!(!ce&&!fe)){for(;Y.length;)Y.shift()(ce);(De=be)===null||De===void 0||De[r](),D.abort(),fe&&(ce||te.forEach(f=>f()),s.nextTick(Ee,ce,L))}}let _e;for(let Ie=0;Ie<z.length;Ie++){let fe=z[Ie],De=Ie<z.length-1,f=Ie>0,p=De||(X==null?void 0:X.end)!==!1,m=Ie===z.length-1;if(P(fe)){let O=function(B){B&&B.name!=="AbortError"&&B.code!=="ERR_STREAM_PREMATURE_CLOSE"&&me(B)};if(p){let{destroy:B,cleanup:V}=le(fe,De,f);Y.push(B),v(fe)&&m&&te.push(V)}fe.on("error",O),v(fe)&&m&&te.push(()=>{fe.removeListener("error",O)})}if(Ie===0)if(typeof fe=="function"){if(_e=fe({signal:ae}),!E(_e))throw new y("Iterable, AsyncIterable or Stream","source",_e)}else E(fe)||C(fe)||I(fe)?_e=fe:_e=c.from(fe);else if(typeof fe=="function"){if(I(_e)){var Z;_e=ee((Z=_e)===null||Z===void 0?void 0:Z.readable)}else _e=ee(_e);if(_e=fe(_e,{signal:ae}),De){if(!E(_e,!0))throw new y("AsyncIterable",`transform[${Ie-1}]`,_e)}else{var ve;M||(M=ys());let O=new M({objectMode:!0}),B=(ve=_e)===null||ve===void 0?void 0:ve.then;if(typeof B=="function")se++,B.call(_e,$=>{L=$,$!=null&&O.write($),p&&O.end(),s.nextTick(me)},$=>{O.destroy($),s.nextTick(me,$)});else if(E(_e,!0))se++,G(_e,O,me,{end:p});else if(k(_e)||I(_e)){let $=_e.readable||_e;se++,G($,O,me,{end:p})}else throw new y("AsyncIterable or Promise","destination",_e);_e=O;let{destroy:V,cleanup:ie}=le(_e,!1,!0);Y.push(V),m&&te.push(ie)}}else if(P(fe)){if(C(_e)){se+=2;let O=he(_e,fe,me,{end:p});v(fe)&&m&&te.push(O)}else if(I(_e)||k(_e)){let O=_e.readable||_e;se++,G(O,fe,me,{end:p})}else if(E(_e))se++,G(_e,fe,me,{end:p});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_e);_e=fe}else if(T(fe)){if(C(_e))se++,oe(ee(_e),fe,me,{end:p});else if(k(_e)||E(_e))se++,oe(_e,fe,me,{end:p});else if(I(_e))se++,oe(_e.readable,fe,me,{end:p});else throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],_e);_e=fe}else _e=c.from(fe)}return(ae!=null&&ae.aborted||H!=null&&H.aborted)&&s.nextTick(ne),_e}function he(z,Ee,X,{end:D}){let ae=!1;if(Ee.on("close",()=>{ae||X(new w)}),z.pipe(Ee,{end:!1}),D){let H=function(){ae=!0,Ee.end()};W(z)?s.nextTick(H):z.once("end",H)}else X();return n(z,{readable:!0,writable:!1},H=>{let te=z._readableState;H&&H.code==="ERR_STREAM_PREMATURE_CLOSE"&&te&&te.ended&&!te.errored&&!te.errorEmitted?z.once("end",X).once("error",X):X(H)}),n(Ee,{readable:!1,writable:!0},X)}l.exports={pipelineImpl:Q,pipeline:R}}),ms=we((o,l)=>{de(),ye(),ge();var{pipeline:s}=Ti(),a=Rt(),{destroyer:u}=sr(),{isNodeStream:t,isReadable:r,isWritable:n,isWebStream:e,isTransformStream:i,isWritableStream:c,isReadableStream:h}=jt(),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:y,ERR_MISSING_ARGS:b}}=wt(),S=Wt();l.exports=function(...w){if(w.length===0)throw new b("streams");if(w.length===1)return a.from(w[0]);let x=[...w];if(typeof w[0]=="function"&&(w[0]=a.from(w[0])),typeof w[w.length-1]=="function"){let A=w.length-1;w[A]=a.from(w[A])}for(let A=0;A<w.length;++A)if(!(!t(w[A])&&!e(w[A]))){if(A<w.length-1&&!(r(w[A])||h(w[A])||i(w[A])))throw new y(`streams[${A}]`,x[A],"must be readable");if(A>0&&!(n(w[A])||c(w[A])||i(w[A])))throw new y(`streams[${A}]`,x[A],"must be writable")}let g,_,E,v,C;function P(A){let M=v;v=null,M?M(A):A?C.destroy(A):!W&&!k&&C.destroy()}let I=w[0],T=s(w,P),k=!!(n(I)||c(I)||i(I)),W=!!(r(T)||h(T)||i(T));if(C=new a({writableObjectMode:!!(I!=null&&I.writableObjectMode),readableObjectMode:!!(T!=null&&T.readableObjectMode),writable:k,readable:W}),k){if(t(I))C._write=function(M,q,N){I.write(M,q)?N():g=N},C._final=function(M){I.end(),_=M},I.on("drain",function(){if(g){let M=g;g=null,M()}});else if(e(I)){let M=(i(I)?I.writable:I).getWriter();C._write=async function(q,N,le){try{await M.ready,M.write(q).catch(()=>{}),le()}catch(re){le(re)}},C._final=async function(q){try{await M.ready,M.close().catch(()=>{}),_=q}catch(N){q(N)}}}let A=i(T)?T.readable:T;S(A,()=>{if(_){let M=_;_=null,M()}})}if(W){if(t(T))T.on("readable",function(){if(E){let A=E;E=null,A()}}),T.on("end",function(){C.push(null)}),C._read=function(){for(;;){let A=T.read();if(A===null){E=C._read;return}if(!C.push(A))return}};else if(e(T)){let A=(i(T)?T.readable:T).getReader();C._read=async function(){for(;;)try{let{value:M,done:q}=await A.read();if(!C.push(M))return;if(q){C.push(null);return}}catch{return}}}}return C._destroy=function(A,M){!A&&v!==null&&(A=new d),E=null,g=null,_=null,v===null?M(A):(v=M,t(T)&&u(T,A))},C}}),Ru=we((o,l)=>{de(),ye(),ge();var s=globalThis.AbortController||yr().AbortController,{codes:{ERR_INVALID_ARG_VALUE:a,ERR_INVALID_ARG_TYPE:u,ERR_MISSING_ARGS:t,ERR_OUT_OF_RANGE:r},AbortError:n}=wt(),{validateAbortSignal:e,validateInteger:i,validateObject:c}=br(),h=ut().Symbol("kWeak"),d=ut().Symbol("kResistStopPropagation"),{finished:y}=Wt(),b=ms(),{addAbortSignalNoValidate:S}=Ir(),{isWritable:w,isNodeStream:x}=jt(),{deprecate:g}=St(),{ArrayPrototypePush:_,Boolean:E,MathFloor:v,Number:C,NumberIsNaN:P,Promise:I,PromiseReject:T,PromiseResolve:k,PromisePrototypeThen:W,Symbol:A}=ut(),M=A("kEmpty"),q=A("kEof");function N(H,te){if(te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),x(H)&&!w(H))throw new a("stream",H,"must be writable");let ne=b(this,H);return te!=null&&te.signal&&S(te.signal,ne),ne}function le(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal");let ne=1;(te==null?void 0:te.concurrency)!=null&&(ne=v(te.concurrency));let be=ne-1;return(te==null?void 0:te.highWaterMark)!=null&&(be=v(te.highWaterMark)),i(ne,"options.concurrency",1),i(be,"options.highWaterMark",0),be+=ne,(async function*(){let ce=St().AbortSignalAny([te==null?void 0:te.signal].filter(E)),L=this,Y=[],se={signal:ce},me,pe,_e=!1,Z=0;function ve(){_e=!0,Ie()}function Ie(){Z-=1,fe()}function fe(){pe&&!_e&&Z<ne&&Y.length<be&&(pe(),pe=null)}async function De(){try{for await(let f of L){if(_e)return;if(ce.aborted)throw new n;try{if(f=H(f,se),f===M)continue;f=k(f)}catch(p){f=T(p)}Z+=1,W(f,Ie,ve),Y.push(f),me&&(me(),me=null),!_e&&(Y.length>=be||Z>=ne)&&await new I(p=>{pe=p})}Y.push(q)}catch(f){let p=T(f);W(p,Ie,ve),Y.push(p)}finally{_e=!0,me&&(me(),me=null)}}De();try{for(;;){for(;Y.length>0;){let f=await Y[0];if(f===q)return;if(ce.aborted)throw new n;f!==M&&(yield f),Y.shift(),fe()}await new I(f=>{me=f})}}finally{_e=!0,pe&&(pe(),pe=null)}}).call(this)}function re(H=void 0){return H!=null&&c(H,"options"),(H==null?void 0:H.signal)!=null&&e(H.signal,"options.signal"),(async function*(){let te=0;for await(let be of this){var ne;if(H!=null&&(ne=H.signal)!==null&&ne!==void 0&&ne.aborted)throw new n({cause:H.signal.reason});yield[te++,be]}}).call(this)}async function ee(H,te=void 0){for await(let ne of R.call(this,H,te))return!0;return!1}async function ue(H,te=void 0){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);return!await ee.call(this,async(...ne)=>!await H(...ne),te)}async function G(H,te){for await(let ne of R.call(this,H,te))return ne}async function oe(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);async function ne(be,ce){return await H(be,ce),M}for await(let be of le.call(this,ne,te));}function R(H,te){if(typeof H!="function")throw new u("fn",["Function","AsyncFunction"],H);async function ne(be,ce){return await H(be,ce)?be:M}return le.call(this,ne,te)}var Q=class extends t{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function he(H,te,ne){var be;if(typeof H!="function")throw new u("reducer",["Function","AsyncFunction"],H);ne!=null&&c(ne,"options"),(ne==null?void 0:ne.signal)!=null&&e(ne.signal,"options.signal");let ce=arguments.length>1;if(ne!=null&&(be=ne.signal)!==null&&be!==void 0&&be.aborted){let pe=new n(void 0,{cause:ne.signal.reason});throw this.once("error",()=>{}),await y(this.destroy(pe)),pe}let L=new s,Y=L.signal;if(ne!=null&&ne.signal){let pe={once:!0,[h]:this,[d]:!0};ne.signal.addEventListener("abort",()=>L.abort(),pe)}let se=!1;try{for await(let pe of this){var me;if(se=!0,ne!=null&&(me=ne.signal)!==null&&me!==void 0&&me.aborted)throw new n;ce?te=await H(te,pe,{signal:Y}):(te=pe,ce=!0)}if(!se&&!ce)throw new Q}finally{L.abort()}return te}async function z(H){H!=null&&c(H,"options"),(H==null?void 0:H.signal)!=null&&e(H.signal,"options.signal");let te=[];for await(let be of this){var ne;if(H!=null&&(ne=H.signal)!==null&&ne!==void 0&&ne.aborted)throw new n(void 0,{cause:H.signal.reason});_(te,be)}return te}function Ee(H,te){let ne=le.call(this,H,te);return(async function*(){for await(let be of ne)yield*be}).call(this)}function X(H){if(H=C(H),P(H))return 0;if(H<0)throw new r("number",">= 0",H);return H}function D(H,te=void 0){return te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),H=X(H),(async function*(){var ne;if(te!=null&&(ne=te.signal)!==null&&ne!==void 0&&ne.aborted)throw new n;for await(let ce of this){var be;if(te!=null&&(be=te.signal)!==null&&be!==void 0&&be.aborted)throw new n;H--<=0&&(yield ce)}}).call(this)}function ae(H,te=void 0){return te!=null&&c(te,"options"),(te==null?void 0:te.signal)!=null&&e(te.signal,"options.signal"),H=X(H),(async function*(){var ne;if(te!=null&&(ne=te.signal)!==null&&ne!==void 0&&ne.aborted)throw new n;for await(let ce of this){var be;if(te!=null&&(be=te.signal)!==null&&be!==void 0&&be.aborted)throw new n;if(H-- >0&&(yield ce),H<=0)return}}).call(this)}l.exports.streamReturningOperators={asIndexedPairs:g(re,"readable.asIndexedPairs will be removed in a future version."),drop:D,filter:R,flatMap:Ee,map:le,take:ae,compose:N},l.exports.promiseReturningOperators={every:ue,forEach:oe,reduce:he,toArray:z,some:ee,find:G}}),bs=we((o,l)=>{de(),ye(),ge();var{ArrayPrototypePop:s,Promise:a}=ut(),{isIterable:u,isNodeStream:t,isWebStream:r}=jt(),{pipelineImpl:n}=Ti(),{finished:e}=Wt();vs();function i(...c){return new a((h,d)=>{let y,b,S=c[c.length-1];if(S&&typeof S=="object"&&!t(S)&&!u(S)&&!r(S)){let w=s(c);y=w.signal,b=w.end}n(c,(w,x)=>{w?d(w):h(x)},{signal:y,end:b})})}l.exports={finished:e,pipeline:i}}),vs=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),{ObjectDefineProperty:a,ObjectKeys:u,ReflectApply:t}=ut(),{promisify:{custom:r}}=St(),{streamReturningOperators:n,promiseReturningOperators:e}=Ru(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:i}}=wt(),c=ms(),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:d}=kr(),{pipeline:y}=Ti(),{destroyer:b}=sr(),S=Wt(),w=bs(),x=jt(),g=l.exports=ki().Stream;g.isDestroyed=x.isDestroyed,g.isDisturbed=x.isDisturbed,g.isErrored=x.isErrored,g.isReadable=x.isReadable,g.isWritable=x.isWritable,g.Readable=Or();for(let E of u(n)){let v=function(...P){if(new.target)throw i();return g.Readable.from(t(C,this,P))},C=n[E];a(v,"name",{__proto__:null,value:C.name}),a(v,"length",{__proto__:null,value:C.length}),a(g.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}for(let E of u(e)){let v=function(...P){if(new.target)throw i();return t(C,this,P)},C=e[E];a(v,"name",{__proto__:null,value:C.name}),a(v,"length",{__proto__:null,value:C.length}),a(g.Readable.prototype,E,{__proto__:null,value:v,enumerable:!1,configurable:!0,writable:!0})}g.Writable=Oi(),g.Duplex=Rt(),g.Transform=gs(),g.PassThrough=ys(),g.pipeline=y;var{addAbortSignal:_}=Ir();g.addAbortSignal=_,g.finished=S,g.destroy=b,g.compose=c,g.setDefaultHighWaterMark=h,g.getDefaultHighWaterMark=d,a(g,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return w}}),a(y,r,{__proto__:null,enumerable:!0,get(){return w.pipeline}}),a(S,r,{__proto__:null,enumerable:!0,get(){return w.finished}}),g.Stream=g,g._isUint8Array=function(E){return E instanceof Uint8Array},g._uint8ArrayToBuffer=function(E){return s.from(E.buffer,E.byteOffset,E.byteLength)}}),Xt=we((o,l)=>{de(),ye(),ge();var s=vs(),a=bs(),u=s.Readable.destroy;l.exports=s.Readable,l.exports._uint8ArrayToBuffer=s._uint8ArrayToBuffer,l.exports._isUint8Array=s._isUint8Array,l.exports.isDisturbed=s.isDisturbed,l.exports.isErrored=s.isErrored,l.exports.isReadable=s.isReadable,l.exports.Readable=s.Readable,l.exports.Writable=s.Writable,l.exports.Duplex=s.Duplex,l.exports.Transform=s.Transform,l.exports.PassThrough=s.PassThrough,l.exports.addAbortSignal=s.addAbortSignal,l.exports.finished=s.finished,l.exports.destroy=s.destroy,l.exports.destroy=u,l.exports.pipeline=s.pipeline,l.exports.compose=s.compose,Object.defineProperty(s,"promises",{configurable:!0,enumerable:!0,get(){return a}}),l.exports.Stream=s.Stream,l.exports.default=l.exports}),Mu=we((o,l)=>{de(),ye(),ge(),typeof Object.create=="function"?l.exports=function(s,a){a&&(s.super_=a,s.prototype=Object.create(a.prototype,{constructor:{value:s,enumerable:!1,writable:!0,configurable:!0}}))}:l.exports=function(s,a){if(a){s.super_=a;var u=function(){};u.prototype=a.prototype,s.prototype=new u,s.prototype.constructor=s}}}),Nu=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),a=Symbol.for("BufferList");function u(t){if(!(this instanceof u))return new u(t);u._init.call(this,t)}u._init=function(t){Object.defineProperty(this,a,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},u.prototype._new=function(t){return new u(t)},u.prototype._offset=function(t){if(t===0)return[0,0];let r=0;for(let n=0;n<this._bufs.length;n++){let e=r+this._bufs[n].length;if(t<e||n===this._bufs.length-1)return[n,t-r];r=e}},u.prototype._reverseOffset=function(t){let r=t[0],n=t[1];for(let e=0;e<r;e++)n+=this._bufs[e].length;return n},u.prototype.getBuffers=function(){return this._bufs},u.prototype.get=function(t){if(t>this.length||t<0)return;let r=this._offset(t);return this._bufs[r[0]][r[1]]},u.prototype.slice=function(t,r){return typeof t=="number"&&t<0&&(t+=this.length),typeof r=="number"&&r<0&&(r+=this.length),this.copy(null,0,t,r)},u.prototype.copy=function(t,r,n,e){if((typeof n!="number"||n<0)&&(n=0),(typeof e!="number"||e>this.length)&&(e=this.length),n>=this.length||e<=0)return t||s.alloc(0);let i=!!t,c=this._offset(n),h=e-n,d=h,y=i&&r||0,b=c[1];if(n===0&&e===this.length){if(!i)return this._bufs.length===1?this._bufs[0]:s.concat(this._bufs,this.length);for(let S=0;S<this._bufs.length;S++)this._bufs[S].copy(t,y),y+=this._bufs[S].length;return t}if(d<=this._bufs[c[0]].length-b)return i?this._bufs[c[0]].copy(t,r,b,b+d):this._bufs[c[0]].slice(b,b+d);i||(t=s.allocUnsafe(h));for(let S=c[0];S<this._bufs.length;S++){let w=this._bufs[S].length-b;if(d>w)this._bufs[S].copy(t,y,b),y+=w;else{this._bufs[S].copy(t,y,b,b+d),y+=w;break}d-=w,b&&(b=0)}return t.length>y?t.slice(0,y):t},u.prototype.shallowSlice=function(t,r){if(t=t||0,r=typeof r!="number"?this.length:r,t<0&&(t+=this.length),r<0&&(r+=this.length),t===r)return this._new();let n=this._offset(t),e=this._offset(r),i=this._bufs.slice(n[0],e[0]+1);return e[1]===0?i.pop():i[i.length-1]=i[i.length-1].slice(0,e[1]),n[1]!==0&&(i[0]=i[0].slice(n[1])),this._new(i)},u.prototype.toString=function(t,r,n){return this.slice(r,n).toString(t)},u.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;for(;this._bufs.length;)if(t>=this._bufs[0].length)t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}return this},u.prototype.duplicate=function(){let t=this._new();for(let r=0;r<this._bufs.length;r++)t.append(this._bufs[r]);return t},u.prototype.append=function(t){return this._attach(t,u.prototype._appendBuffer)},u.prototype.prepend=function(t){return this._attach(t,u.prototype._prependBuffer,!0)},u.prototype._attach=function(t,r,n){if(t==null)return this;if(t.buffer)r.call(this,s.from(t.buffer,t.byteOffset,t.byteLength));else if(Array.isArray(t)){let[e,i]=n?[t.length-1,-1]:[0,1];for(let c=e;c>=0&&c<t.length;c+=i)this._attach(t[c],r,n)}else if(this._isBufferList(t)){let[e,i]=n?[t._bufs.length-1,-1]:[0,1];for(let c=e;c>=0&&c<t._bufs.length;c+=i)this._attach(t._bufs[c],r,n)}else typeof t=="number"&&(t=t.toString()),r.call(this,s.from(t));return this},u.prototype._appendBuffer=function(t){this._bufs.push(t),this.length+=t.length},u.prototype._prependBuffer=function(t){this._bufs.unshift(t),this.length+=t.length},u.prototype.indexOf=function(t,r,n){if(n===void 0&&typeof r=="string"&&(n=r,r=void 0),typeof t=="function"||Array.isArray(t))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if(typeof t=="number"?t=s.from([t]):typeof t=="string"?t=s.from(t,n):this._isBufferList(t)?t=t.slice():Array.isArray(t.buffer)?t=s.from(t.buffer,t.byteOffset,t.byteLength):s.isBuffer(t)||(t=s.from(t)),r=Number(r||0),isNaN(r)&&(r=0),r<0&&(r=this.length+r),r<0&&(r=0),t.length===0)return r>this.length?this.length:r;let e=this._offset(r),i=e[0],c=e[1];for(;i<this._bufs.length;i++){let h=this._bufs[i];for(;c<h.length;)if(h.length-c>=t.length){let d=h.indexOf(t,c);if(d!==-1)return this._reverseOffset([i,d]);c=h.length-t.length+1}else{let d=this._reverseOffset([i,c]);if(this._match(d,t))return d;c++}c=0}return-1},u.prototype._match=function(t,r){if(this.length-t<r.length)return!1;for(let n=0;n<r.length;n++)if(this.get(t+n)!==r[n])return!1;return!0},function(){let t={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 r in t)(function(n){t[n]===null?u.prototype[n]=function(e,i){return this.slice(e,e+i)[n](0,i)}:u.prototype[n]=function(e=0){return this.slice(e,e+t[n])[n](0)}})(r)}(),u.prototype._isBufferList=function(t){return t instanceof u||u.isBufferList(t)},u.isBufferList=function(t){return t!=null&&t[a]},l.exports=u}),Bu=we((o,l)=>{de(),ye(),ge();var s=Xt().Duplex,a=Mu(),u=Nu();function t(r){if(!(this instanceof t))return new t(r);if(typeof r=="function"){this._callback=r;let n=(function(e){this._callback&&(this._callback(e),this._callback=null)}).bind(this);this.on("pipe",function(e){e.on("error",n)}),this.on("unpipe",function(e){e.removeListener("error",n)}),r=null}u._init.call(this,r),s.call(this)}a(t,s),Object.assign(t.prototype,u.prototype),t.prototype._new=function(r){return new t(r)},t.prototype._write=function(r,n,e){this._appendBuffer(r),typeof e=="function"&&e()},t.prototype._read=function(r){if(!this.length)return this.push(null);r=Math.min(r,this.length),this.push(this.slice(0,r)),this.consume(r)},t.prototype.end=function(r){s.prototype.end.call(this,r),this._callback&&(this._callback(null,this.slice()),this._callback=null)},t.prototype._destroy=function(r,n){this._bufs.length=0,this.length=0,n(r)},t.prototype._isBufferList=function(r){return r instanceof t||r instanceof u||t.isBufferList(r)},t.isBufferList=u.isBufferList,l.exports=t,l.exports.BufferListStream=t,l.exports.BufferList=u}),Lu=we((o,l)=>{de(),ye(),ge();var s=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}};l.exports=s}),ws=we((o,l)=>{de(),ye(),ge();var s=l.exports,{Buffer:a}=(dt(),tt(pt));s.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"},s.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},s.requiredHeaderFlagsErrors={};for(let t in s.requiredHeaderFlags){let r=s.requiredHeaderFlags[t];s.requiredHeaderFlagsErrors[t]="Invalid header flag bits, must be 0x"+r.toString(16)+" for "+s.types[t]+" packet"}s.codes={};for(let t in s.types){let r=s.types[t];s.codes[r]=t}s.CMD_SHIFT=4,s.CMD_MASK=240,s.DUP_MASK=8,s.QOS_MASK=3,s.QOS_SHIFT=1,s.RETAIN_MASK=1,s.VARBYTEINT_MASK=127,s.VARBYTEINT_FIN_MASK=128,s.VARBYTEINT_MAX=268435455,s.SESSIONPRESENT_MASK=1,s.SESSIONPRESENT_HEADER=a.from([s.SESSIONPRESENT_MASK]),s.CONNACK_HEADER=a.from([s.codes.connack<<s.CMD_SHIFT]),s.USERNAME_MASK=128,s.PASSWORD_MASK=64,s.WILL_RETAIN_MASK=32,s.WILL_QOS_MASK=24,s.WILL_QOS_SHIFT=3,s.WILL_FLAG_MASK=4,s.CLEAN_SESSION_MASK=2,s.CONNECT_HEADER=a.from([s.codes.connect<<s.CMD_SHIFT]),s.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},s.propertiesCodes={};for(let t in s.properties){let r=s.properties[t];s.propertiesCodes[r]=t}s.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"};function u(t){return[0,1,2].map(r=>[0,1].map(n=>[0,1].map(e=>{let i=a.alloc(1);return i.writeUInt8(s.codes[t]<<s.CMD_SHIFT|(n?s.DUP_MASK:0)|r<<s.QOS_SHIFT|e,0,!0),i})))}s.PUBLISH_HEADER=u("publish"),s.SUBSCRIBE_HEADER=u("subscribe"),s.SUBSCRIBE_OPTIONS_QOS_MASK=3,s.SUBSCRIBE_OPTIONS_NL_MASK=1,s.SUBSCRIBE_OPTIONS_NL_SHIFT=2,s.SUBSCRIBE_OPTIONS_RAP_MASK=1,s.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,s.SUBSCRIBE_OPTIONS_RH_MASK=3,s.SUBSCRIBE_OPTIONS_RH_SHIFT=4,s.SUBSCRIBE_OPTIONS_RH=[0,16,32],s.SUBSCRIBE_OPTIONS_NL=4,s.SUBSCRIBE_OPTIONS_RAP=8,s.SUBSCRIBE_OPTIONS_QOS=[0,1,2],s.UNSUBSCRIBE_HEADER=u("unsubscribe"),s.ACKS={unsuback:u("unsuback"),puback:u("puback"),pubcomp:u("pubcomp"),pubrel:u("pubrel"),pubrec:u("pubrec")},s.SUBACK_HEADER=a.from([s.codes.suback<<s.CMD_SHIFT]),s.VERSION3=a.from([3]),s.VERSION4=a.from([4]),s.VERSION5=a.from([5]),s.VERSION131=a.from([131]),s.VERSION132=a.from([132]),s.QOS=[0,1,2].map(t=>a.from([t])),s.EMPTY={pingreq:a.from([s.codes.pingreq<<4,0]),pingresp:a.from([s.codes.pingresp<<4,0]),disconnect:a.from([s.codes.disconnect<<4,0])},s.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"},s.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},s.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"},s.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"},s.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"},s.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}}),Uu=we((o,l)=>{de(),ye(),ge();var s=1e3,a=s*60,u=a*60,t=u*24,r=t*7,n=t*365.25;l.exports=function(d,y){y=y||{};var b=typeof d;if(b==="string"&&d.length>0)return e(d);if(b==="number"&&isFinite(d))return y.long?c(d):i(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function e(d){if(d=String(d),!(d.length>100)){var y=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(y){var b=parseFloat(y[1]),S=(y[2]||"ms").toLowerCase();switch(S){case"years":case"year":case"yrs":case"yr":case"y":return b*n;case"weeks":case"week":case"w":return b*r;case"days":case"day":case"d":return b*t;case"hours":case"hour":case"hrs":case"hr":case"h":return b*u;case"minutes":case"minute":case"mins":case"min":case"m":return b*a;case"seconds":case"second":case"secs":case"sec":case"s":return b*s;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return b;default:return}}}}function i(d){var y=Math.abs(d);return y>=t?Math.round(d/t)+"d":y>=u?Math.round(d/u)+"h":y>=a?Math.round(d/a)+"m":y>=s?Math.round(d/s)+"s":d+"ms"}function c(d){var y=Math.abs(d);return y>=t?h(d,y,t,"day"):y>=u?h(d,y,u,"hour"):y>=a?h(d,y,a,"minute"):y>=s?h(d,y,s,"second"):d+" ms"}function h(d,y,b,S){var w=y>=b*1.5;return Math.round(d/b)+" "+S+(w?"s":"")}}),Du=we((o,l)=>{de(),ye(),ge();function s(a){t.debug=t,t.default=t,t.coerce=h,t.disable=i,t.enable=n,t.enabled=c,t.humanize=Uu(),t.destroy=d,Object.keys(a).forEach(y=>{t[y]=a[y]}),t.names=[],t.skips=[],t.formatters={};function u(y){let b=0;for(let S=0;S<y.length;S++)b=(b<<5)-b+y.charCodeAt(S),b|=0;return t.colors[Math.abs(b)%t.colors.length]}t.selectColor=u;function t(y){let b,S=null,w,x;function g(..._){if(!g.enabled)return;let E=g,v=Number(new Date),C=v-(b||v);E.diff=C,E.prev=b,E.curr=v,b=v,_[0]=t.coerce(_[0]),typeof _[0]!="string"&&_.unshift("%O");let P=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(I,T)=>{if(I==="%%")return"%";P++;let k=t.formatters[T];if(typeof k=="function"){let W=_[P];I=k.call(E,W),_.splice(P,1),P--}return I}),t.formatArgs.call(E,_),(E.log||t.log).apply(E,_)}return g.namespace=y,g.useColors=t.useColors(),g.color=t.selectColor(y),g.extend=r,g.destroy=t.destroy,Object.defineProperty(g,"enabled",{enumerable:!0,configurable:!1,get:()=>S!==null?S:(w!==t.namespaces&&(w=t.namespaces,x=t.enabled(y)),x),set:_=>{S=_}}),typeof t.init=="function"&&t.init(g),g}function r(y,b){let S=t(this.namespace+(typeof b>"u"?":":b)+y);return S.log=this.log,S}function n(y){t.save(y),t.namespaces=y,t.names=[],t.skips=[];let b=(typeof y=="string"?y:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let S of b)S[0]==="-"?t.skips.push(S.slice(1)):t.names.push(S)}function e(y,b){let S=0,w=0,x=-1,g=0;for(;S<y.length;)if(w<b.length&&(b[w]===y[S]||b[w]==="*"))b[w]==="*"?(x=w,g=S,w++):(S++,w++);else if(x!==-1)w=x+1,g++,S=g;else return!1;for(;w<b.length&&b[w]==="*";)w++;return w===b.length}function i(){let y=[...t.names,...t.skips.map(b=>"-"+b)].join(",");return t.enable(""),y}function c(y){for(let b of t.skips)if(e(y,b))return!1;for(let b of t.names)if(e(y,b))return!0;return!1}function h(y){return y instanceof Error?y.stack||y.message:y}function d(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}l.exports=s}),Mt=we((o,l)=>{de(),ye(),ge(),o.formatArgs=a,o.save=u,o.load=t,o.useColors=s,o.storage=r(),o.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`."))}})(),o.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"];function s(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||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+)/)}function a(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+l.exports.humanize(this.diff),!this.useColors)return;let i="color: "+this.color;e.splice(1,0,i,"color: inherit");let c=0,h=0;e[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(c++,d==="%c"&&(h=c))}),e.splice(h,0,i)}o.log=console.debug||console.log||(()=>{});function u(e){try{e?o.storage.setItem("debug",e):o.storage.removeItem("debug")}catch{}}function t(){let e;try{e=o.storage.getItem("debug")||o.storage.getItem("DEBUG")}catch{}return!e&&typeof Je<"u"&&"env"in Je&&(e=Je.env.DEBUG),e}function r(){try{return localStorage}catch{}}l.exports=Du()(o);var{formatters:n}=l.exports;n.j=function(e){try{return JSON.stringify(e)}catch(i){return"[UnexpectedJSONParseError]: "+i.message}}}),Fu=we((o,l)=>{de(),ye(),ge();var s=Bu(),{EventEmitter:a}=(Qt(),tt(Ft)),u=Lu(),t=ws(),r=Mt()("mqtt-packet:parser"),n=class Wo extends a{constructor(){super(),this.parser=this.constructor.parser}static parser(i){return this instanceof Wo?(this.settings=i||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new Wo().parser(i)}_resetState(){r("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new u,this.error=null,this._list=s(),this._stateCounter=0}parse(i){for(this.error&&this._resetState(),this._list.append(i),r("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,r("parse: state complete. _stateCounter is now: %d",this._stateCounter),r("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return r("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let i=this._list.readUInt8(0),c=i>>t.CMD_SHIFT;this.packet.cmd=t.types[c];let h=i&15,d=t.requiredHeaderFlags[c];return d!=null&&h!==d?this._emitError(new Error(t.requiredHeaderFlagsErrors[c])):(this.packet.retain=(i&t.RETAIN_MASK)!==0,this.packet.qos=i>>t.QOS_SHIFT&t.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=(i&t.DUP_MASK)!==0,r("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){let i=this._parseVarByteNum(!0);return i&&(this.packet.length=i.value,this._list.consume(i.bytes)),r("_parseLength %d",i.value),!!i}_parsePayload(){r("_parsePayload: payload %O",this._list);let i=!1;if(this.packet.length===0||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"))}i=!0}return r("_parsePayload complete result: %s",i),i}_parseConnect(){r("_parseConnect");let i,c,h,d,y={},b=this.packet,S=this._parseString();if(S===null)return this._emitError(new Error("Cannot parse protocolId"));if(S!=="MQTT"&&S!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(b.protocolId=S,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(b.protocolVersion=this._list.readUInt8(this._pos),b.protocolVersion>=128&&(b.bridgeMode=!0,b.protocolVersion=b.protocolVersion-128),b.protocolVersion!==3&&b.protocolVersion!==4&&b.protocolVersion!==5)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(this._list.readUInt8(this._pos)&1)return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));y.username=this._list.readUInt8(this._pos)&t.USERNAME_MASK,y.password=this._list.readUInt8(this._pos)&t.PASSWORD_MASK,y.will=this._list.readUInt8(this._pos)&t.WILL_FLAG_MASK;let w=!!(this._list.readUInt8(this._pos)&t.WILL_RETAIN_MASK),x=(this._list.readUInt8(this._pos)&t.WILL_QOS_MASK)>>t.WILL_QOS_SHIFT;if(y.will)b.will={},b.will.retain=w,b.will.qos=x;else{if(w)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(x)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(b.clean=(this._list.readUInt8(this._pos)&t.CLEAN_SESSION_MASK)!==0,this._pos++,b.keepalive=this._parseNum(),b.keepalive===-1)return this._emitError(new Error("Packet too short"));if(b.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(b.properties=_)}let g=this._parseString();if(g===null)return this._emitError(new Error("Packet too short"));if(b.clientId=g,r("_parseConnect: packet.clientId: %s",b.clientId),y.will){if(b.protocolVersion===5){let _=this._parseProperties();Object.getOwnPropertyNames(_).length&&(b.will.properties=_)}if(i=this._parseString(),i===null)return this._emitError(new Error("Cannot parse will topic"));if(b.will.topic=i,r("_parseConnect: packet.will.topic: %s",b.will.topic),c=this._parseBuffer(),c===null)return this._emitError(new Error("Cannot parse will payload"));b.will.payload=c,r("_parseConnect: packet.will.paylaod: %s",b.will.payload)}if(y.username){if(d=this._parseString(),d===null)return this._emitError(new Error("Cannot parse username"));b.username=d,r("_parseConnect: packet.username: %s",b.username)}if(y.password){if(h=this._parseBuffer(),h===null)return this._emitError(new Error("Cannot parse password"));b.password=h}return this.settings=b,r("_parseConnect: complete"),b}_parseConnack(){r("_parseConnack");let i=this.packet;if(this._list.length<1)return null;let c=this._list.readUInt8(this._pos++);if(c>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(i.sessionPresent=!!(c&t.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?i.reasonCode=this._list.readUInt8(this._pos++):i.reasonCode=0;else{if(this._list.length<2)return null;i.returnCode=this._list.readUInt8(this._pos++)}if(i.returnCode===-1||i.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let h=this._parseProperties();Object.getOwnPropertyNames(h).length&&(i.properties=h)}r("_parseConnack: complete")}_parsePublish(){r("_parsePublish");let i=this.packet;if(i.topic=this._parseString(),i.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(i.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}i.payload=this._list.slice(this._pos,i.length),r("_parsePublish: payload from buffer list: %o",i.payload)}}_parseSubscribe(){r("_parseSubscribe");let i=this.packet,c,h,d,y,b,S,w;if(i.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let x=this._parseProperties();Object.getOwnPropertyNames(x).length&&(i.properties=x)}if(i.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<i.length;){if(c=this._parseString(),c===null)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=i.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(h=this._parseByte(),this.settings.protocolVersion===5){if(h&192)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(h&252)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(d=h&t.SUBSCRIBE_OPTIONS_QOS_MASK,d>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(S=(h>>t.SUBSCRIBE_OPTIONS_NL_SHIFT&t.SUBSCRIBE_OPTIONS_NL_MASK)!==0,b=(h>>t.SUBSCRIBE_OPTIONS_RAP_SHIFT&t.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,y=h>>t.SUBSCRIBE_OPTIONS_RH_SHIFT&t.SUBSCRIBE_OPTIONS_RH_MASK,y>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));w={topic:c,qos:d},this.settings.protocolVersion===5?(w.nl=S,w.rap=b,w.rh=y):this.settings.bridgeMode&&(w.rh=0,w.rap=!0,w.nl=!0),r("_parseSubscribe: push subscription `%s` to subscription",w),i.subscriptions.push(w)}}}_parseSuback(){r("_parseSuback");let i=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}if(i.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){let c=this._list.readUInt8(this._pos++);if(this.settings.protocolVersion===5){if(!t.MQTT5_SUBACK_CODES[c])return this._emitError(new Error("Invalid suback code"))}else if(c>2&&c!==128)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(c)}}}_parseUnsubscribe(){r("_parseUnsubscribe");let i=this.packet;if(i.unsubscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}if(i.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<i.length;){let c=this._parseString();if(c===null)return this._emitError(new Error("Cannot parse topic"));r("_parseUnsubscribe: push topic `%s` to unsubscriptions",c),i.unsubscriptions.push(c)}}}_parseUnsuback(){r("_parseUnsuback");let i=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((this.settings.protocolVersion===3||this.settings.protocolVersion===4)&&i.length!==2)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(i.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(this.settings.protocolVersion===5){let c=this._parseProperties();for(Object.getOwnPropertyNames(c).length&&(i.properties=c),i.granted=[];this._pos<this.packet.length;){let h=this._list.readUInt8(this._pos++);if(!t.MQTT5_UNSUBACK_CODES[h])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(h)}}}_parseConfirmation(){r("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);let i=this.packet;if(this._parseMessageId(),this.settings.protocolVersion===5){if(i.length>2){switch(i.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!t.MQTT5_PUBACK_PUBREC_CODES[i.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!t.MQTT5_PUBREL_PUBCOMP_CODES[i.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break}r("_parseConfirmation: packet.reasonCode `%d`",i.reasonCode)}else i.reasonCode=0;if(i.length>3){let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}}return!0}_parseDisconnect(){let i=this.packet;if(r("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?(i.reasonCode=this._parseByte(),t.MQTT5_DISCONNECT_CODES[i.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):i.reasonCode=0;let c=this._parseProperties();Object.getOwnPropertyNames(c).length&&(i.properties=c)}return r("_parseDisconnect result: true"),!0}_parseAuth(){r("_parseAuth");let i=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(i.reasonCode=this._parseByte(),!t.MQTT5_AUTH_CODES[i.reasonCode])return this._emitError(new Error("Invalid auth reason code"));let c=this._parseProperties();return Object.getOwnPropertyNames(c).length&&(i.properties=c),r("_parseAuth: result: true"),!0}_parseMessageId(){let i=this.packet;return i.messageId=this._parseNum(),i.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(r("_parseMessageId: packet.messageId %d",i.messageId),!0)}_parseString(i){let c=this._parseNum(),h=c+this._pos;if(c===-1||h>this._list.length||h>this.packet.length)return null;let d=this._list.toString("utf8",this._pos,h);return this._pos+=c,r("_parseString: result: %s",d),d}_parseStringPair(){return r("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let i=this._parseNum(),c=i+this._pos;if(i===-1||c>this._list.length||c>this.packet.length)return null;let h=this._list.slice(this._pos,c);return this._pos+=i,r("_parseBuffer: result: %o",h),h}_parseNum(){if(this._list.length-this._pos<2)return-1;let i=this._list.readUInt16BE(this._pos);return this._pos+=2,r("_parseNum: result: %s",i),i}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let i=this._list.readUInt32BE(this._pos);return this._pos+=4,r("_parse4ByteNum: result: %s",i),i}_parseVarByteNum(i){r("_parseVarByteNum");let c=4,h=0,d=1,y=0,b=!1,S,w=this._pos?this._pos:0;for(;h<c&&w+h<this._list.length;){if(S=this._list.readUInt8(w+h++),y+=d*(S&t.VARBYTEINT_MASK),d*=128,(S&t.VARBYTEINT_FIN_MASK)===0){b=!0;break}if(this._list.length<=h)break}return!b&&h===c&&this._list.length>=h&&this._emitError(new Error("Invalid variable byte integer")),w&&(this._pos+=h),b?i?b={bytes:h,value:y}:b=y:b=!1,r("_parseVarByteNum: result: %o",b),b}_parseByte(){let i;return this._pos<this._list.length&&(i=this._list.readUInt8(this._pos),this._pos++),r("_parseByte: result: %o",i),i}_parseByType(i){switch(r("_parseByType: type: %s",i),i){case"byte":return this._parseByte()!==0;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(){r("_parseProperties");let i=this._parseVarByteNum(),c=this._pos+i,h={};for(;this._pos<c;){let d=this._parseByte();if(!d)return this._emitError(new Error("Cannot parse property code type")),!1;let y=t.propertiesCodes[d];if(!y)return this._emitError(new Error("Unknown property")),!1;if(y==="userProperties"){h[y]||(h[y]=Object.create(null));let b=this._parseByType(t.propertiesTypes[y]);if(h[y][b.name])if(Array.isArray(h[y][b.name]))h[y][b.name].push(b.value);else{let S=h[y][b.name];h[y][b.name]=[S],h[y][b.name].push(b.value)}else h[y][b.name]=b.value;continue}h[y]?Array.isArray(h[y])?h[y].push(this._parseByType(t.propertiesTypes[y])):(h[y]=[h[y]],h[y].push(this._parseByType(t.propertiesTypes[y]))):h[y]=this._parseByType(t.propertiesTypes[y])}return h}_newPacket(){return r("_newPacket"),this.packet&&(this._list.consume(this.packet.length),r("_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)),r("_newPacket: new packet"),this.packet=new u,this._pos=0,!0}_emitError(i){r("_emitError",i),this.error=i,this.emit("error",i)}};l.exports=n}),Wu=we((o,l)=>{de(),ye(),ge();var{Buffer:s}=(dt(),tt(pt)),a=65536,u={},t=s.isBuffer(s.from([1,2]).subarray(0,1));function r(c){let h=s.allocUnsafe(2);return h.writeUInt8(c>>8,0),h.writeUInt8(c&255,1),h}function n(){for(let c=0;c<a;c++)u[c]=r(c)}function e(c){let h=0,d=0,y=s.allocUnsafe(4);do h=c%128|0,c=c/128|0,c>0&&(h=h|128),y.writeUInt8(h,d++);while(c>0&&d<4);return c>0&&(d=0),t?y.subarray(0,d):y.slice(0,d)}function i(c){let h=s.allocUnsafe(4);return h.writeUInt32BE(c,0),h}l.exports={cache:u,generateCache:n,generateNumber:r,genBufVariableByteInt:e,generate4ByteBuffer:i}}),$u=we((o,l)=>{de(),ye(),ge(),typeof Je>"u"||!Je.version||Je.version.indexOf("v0.")===0||Je.version.indexOf("v1.")===0&&Je.version.indexOf("v1.8.")!==0?l.exports={nextTick:s}:l.exports=Je;function s(a,u,t,r){if(typeof a!="function")throw new TypeError('"callback" argument must be a function');var n=arguments.length,e,i;switch(n){case 0:case 1:return Je.nextTick(a);case 2:return Je.nextTick(function(){a.call(null,u)});case 3:return Je.nextTick(function(){a.call(null,u,t)});case 4:return Je.nextTick(function(){a.call(null,u,t,r)});default:for(e=new Array(n-1),i=0;i<e.length;)e[i++]=arguments[i];return Je.nextTick(function(){a.apply(null,e)})}}}),_s=we((o,l)=>{de(),ye(),ge();var s=ws(),{Buffer:a}=(dt(),tt(pt)),u=a.allocUnsafe(0),t=a.from([0]),r=Wu(),n=$u().nextTick,e=Mt()("mqtt-packet:writeToStream"),i=r.cache,c=r.generateNumber,h=r.generateCache,d=r.genBufVariableByteInt,y=r.generate4ByteBuffer,b=re,S=!0;function w(X,D,ae){switch(e("generate called"),D.cork&&(D.cork(),n(x,D)),S&&(S=!1,h()),e("generate: packet.cmd: %s",X.cmd),X.cmd){case"connect":return g(X,D);case"connack":return _(X,D,ae);case"publish":return E(X,D,ae);case"puback":case"pubrec":case"pubrel":case"pubcomp":return v(X,D,ae);case"subscribe":return C(X,D,ae);case"suback":return P(X,D,ae);case"unsubscribe":return I(X,D,ae);case"unsuback":return T(X,D,ae);case"pingreq":case"pingresp":return k(X,D);case"disconnect":return W(X,D,ae);case"auth":return A(X,D,ae);default:return D.destroy(new Error("Unknown command")),!1}}Object.defineProperty(w,"cacheNumbers",{get(){return b===re},set(X){X?((!i||Object.keys(i).length===0)&&(S=!0),b=re):(S=!1,b=ee)}});function x(X){X.uncork()}function g(X,D,ae){let H=X||{},te=H.protocolId||"MQTT",ne=H.protocolVersion||4,be=H.will,ce=H.clean,L=H.keepalive||0,Y=H.clientId||"",se=H.username,me=H.password,pe=H.properties;ce===void 0&&(ce=!0);let _e=0;if(typeof te!="string"&&!a.isBuffer(te))return D.destroy(new Error("Invalid protocolId")),!1;if(_e+=te.length+2,ne!==3&&ne!==4&&ne!==5)return D.destroy(new Error("Invalid protocol version")),!1;if(_e+=1,(typeof Y=="string"||a.isBuffer(Y))&&(Y||ne>=4)&&(Y||ce))_e+=a.byteLength(Y)+2;else{if(ne<4)return D.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(ce*1===0)return D.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof L!="number"||L<0||L>65535||L%1!==0)return D.destroy(new Error("Invalid keepalive")),!1;_e+=2,_e+=1;let Z,ve;if(ne===5){if(Z=oe(D,pe),!Z)return!1;_e+=Z.length}if(be){if(typeof be!="object")return D.destroy(new Error("Invalid will")),!1;if(!be.topic||typeof be.topic!="string")return D.destroy(new Error("Invalid will topic")),!1;if(_e+=a.byteLength(be.topic)+2,_e+=2,be.payload)if(be.payload.length>=0)typeof be.payload=="string"?_e+=a.byteLength(be.payload):_e+=be.payload.length;else return D.destroy(new Error("Invalid will payload")),!1;if(ve={},ne===5){if(ve=oe(D,be.properties),!ve)return!1;_e+=ve.length}}let Ie=!1;if(se!=null)if(Ee(se))Ie=!0,_e+=a.byteLength(se)+2;else return D.destroy(new Error("Invalid username")),!1;if(me!=null){if(!Ie)return D.destroy(new Error("Username is required to use password")),!1;if(Ee(me))_e+=z(me)+2;else return D.destroy(new Error("Invalid password")),!1}D.write(s.CONNECT_HEADER),q(D,_e),G(D,te),H.bridgeMode&&(ne+=128),D.write(ne===131?s.VERSION131:ne===132?s.VERSION132:ne===4?s.VERSION4:ne===5?s.VERSION5:s.VERSION3);let fe=0;return fe|=se!=null?s.USERNAME_MASK:0,fe|=me!=null?s.PASSWORD_MASK:0,fe|=be&&be.retain?s.WILL_RETAIN_MASK:0,fe|=be&&be.qos?be.qos<<s.WILL_QOS_SHIFT:0,fe|=be?s.WILL_FLAG_MASK:0,fe|=ce?s.CLEAN_SESSION_MASK:0,D.write(a.from([fe])),b(D,L),ne===5&&Z.write(),G(D,Y),be&&(ne===5&&ve.write(),N(D,be.topic),G(D,be.payload)),se!=null&&G(D,se),me!=null&&G(D,me),!0}function _(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=H===5?te.reasonCode:te.returnCode,be=te.properties,ce=2;if(typeof ne!="number")return D.destroy(new Error("Invalid return code")),!1;let L=null;if(H===5){if(L=oe(D,be),!L)return!1;ce+=L.length}return D.write(s.CONNACK_HEADER),q(D,ce),D.write(te.sessionPresent?s.SESSIONPRESENT_HEADER:t),D.write(a.from([ne])),L==null||L.write(),!0}function E(X,D,ae){e("publish: packet: %o",X);let H=ae?ae.protocolVersion:4,te=X||{},ne=te.qos||0,be=te.retain?s.RETAIN_MASK:0,ce=te.topic,L=te.payload||u,Y=te.messageId,se=te.properties,me=0;if(typeof ce=="string")me+=a.byteLength(ce)+2;else if(a.isBuffer(ce))me+=ce.length+2;else return D.destroy(new Error("Invalid topic")),!1;if(a.isBuffer(L)?me+=L.length:me+=a.byteLength(L),ne&&typeof Y!="number")return D.destroy(new Error("Invalid messageId")),!1;ne&&(me+=2);let pe=null;if(H===5){if(pe=oe(D,se),!pe)return!1;me+=pe.length}return D.write(s.PUBLISH_HEADER[ne][te.dup?1:0][be?1:0]),q(D,me),b(D,z(ce)),D.write(ce),ne>0&&b(D,Y),pe==null||pe.write(),e("publish: payload: %o",L),D.write(L)}function v(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.cmd||"puback",be=te.messageId,ce=te.dup&&ne==="pubrel"?s.DUP_MASK:0,L=0,Y=te.reasonCode,se=te.properties,me=H===5?3:2;if(ne==="pubrel"&&(L=1),typeof be!="number")return D.destroy(new Error("Invalid messageId")),!1;let pe=null;if(H===5&&typeof se=="object"){if(pe=R(D,se,ae,me),!pe)return!1;me+=pe.length}return D.write(s.ACKS[ne][L][ce][0]),me===3&&(me+=Y!==0?1:-1),q(D,me),b(D,be),H===5&&me!==2&&D.write(a.from([Y])),pe!==null?pe.write():me===4&&D.write(a.from([0])),!0}function C(X,D,ae){e("subscribe: packet: ");let H=ae?ae.protocolVersion:4,te=X||{},ne=te.dup?s.DUP_MASK:0,be=te.messageId,ce=te.subscriptions,L=te.properties,Y=0;if(typeof be!="number")return D.destroy(new Error("Invalid messageId")),!1;Y+=2;let se=null;if(H===5){if(se=oe(D,L),!se)return!1;Y+=se.length}if(typeof ce=="object"&&ce.length)for(let pe=0;pe<ce.length;pe+=1){let _e=ce[pe].topic,Z=ce[pe].qos;if(typeof _e!="string")return D.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if(typeof Z!="number")return D.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(H===5){if(typeof(ce[pe].nl||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if(typeof(ce[pe].rap||!1)!="boolean")return D.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;let ve=ce[pe].rh||0;if(typeof ve!="number"||ve>2)return D.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}Y+=a.byteLength(_e)+2+1}else return D.destroy(new Error("Invalid subscriptions")),!1;e("subscribe: writing to stream: %o",s.SUBSCRIBE_HEADER),D.write(s.SUBSCRIBE_HEADER[1][ne?1:0][0]),q(D,Y),b(D,be),se!==null&&se.write();let me=!0;for(let pe of ce){let _e=pe.topic,Z=pe.qos,ve=+pe.nl,Ie=+pe.rap,fe=pe.rh,De;N(D,_e),De=s.SUBSCRIBE_OPTIONS_QOS[Z],H===5&&(De|=ve?s.SUBSCRIBE_OPTIONS_NL:0,De|=Ie?s.SUBSCRIBE_OPTIONS_RAP:0,De|=fe?s.SUBSCRIBE_OPTIONS_RH[fe]:0),me=D.write(a.from([De]))}return me}function P(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.granted,ce=te.properties,L=0;if(typeof ne!="number")return D.destroy(new Error("Invalid messageId")),!1;if(L+=2,typeof be=="object"&&be.length)for(let se=0;se<be.length;se+=1){if(typeof be[se]!="number")return D.destroy(new Error("Invalid qos vector")),!1;L+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let Y=null;if(H===5){if(Y=R(D,ce,ae,L),!Y)return!1;L+=Y.length}return D.write(s.SUBACK_HEADER),q(D,L),b(D,ne),Y!==null&&Y.write(),D.write(a.from(be))}function I(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.dup?s.DUP_MASK:0,ce=te.unsubscriptions,L=te.properties,Y=0;if(typeof ne!="number")return D.destroy(new Error("Invalid messageId")),!1;if(Y+=2,typeof ce=="object"&&ce.length)for(let pe=0;pe<ce.length;pe+=1){if(typeof ce[pe]!="string")return D.destroy(new Error("Invalid unsubscriptions")),!1;Y+=a.byteLength(ce[pe])+2}else return D.destroy(new Error("Invalid unsubscriptions")),!1;let se=null;if(H===5){if(se=oe(D,L),!se)return!1;Y+=se.length}D.write(s.UNSUBSCRIBE_HEADER[1][be?1:0][0]),q(D,Y),b(D,ne),se!==null&&se.write();let me=!0;for(let pe=0;pe<ce.length;pe++)me=N(D,ce[pe]);return me}function T(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.messageId,be=te.dup?s.DUP_MASK:0,ce=te.granted,L=te.properties,Y=te.cmd,se=0,me=2;if(typeof ne!="number")return D.destroy(new Error("Invalid messageId")),!1;if(H===5)if(typeof ce=="object"&&ce.length)for(let _e=0;_e<ce.length;_e+=1){if(typeof ce[_e]!="number")return D.destroy(new Error("Invalid qos vector")),!1;me+=1}else return D.destroy(new Error("Invalid qos vector")),!1;let pe=null;if(H===5){if(pe=R(D,L,ae,me),!pe)return!1;me+=pe.length}return D.write(s.ACKS[Y][se][be][0]),q(D,me),b(D,ne),pe!==null&&pe.write(),H===5&&D.write(a.from(ce)),!0}function k(X,D,ae){return D.write(s.EMPTY[X.cmd])}function W(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.reasonCode,be=te.properties,ce=H===5?1:0,L=null;if(H===5){if(L=R(D,be,ae,ce),!L)return!1;ce+=L.length}return D.write(a.from([s.codes.disconnect<<4])),q(D,ce),H===5&&D.write(a.from([ne])),L!==null&&L.write(),!0}function A(X,D,ae){let H=ae?ae.protocolVersion:4,te=X||{},ne=te.reasonCode,be=te.properties,ce=H===5?1:0;H!==5&&D.destroy(new Error("Invalid mqtt version for auth packet"));let L=R(D,be,ae,ce);return L?(ce+=L.length,D.write(a.from([s.codes.auth<<4])),q(D,ce),D.write(a.from([ne])),L!==null&&L.write(),!0):!1}var M={};function q(X,D){if(D>s.VARBYTEINT_MAX)return X.destroy(new Error(`Invalid variable byte integer: ${D}`)),!1;let ae=M[D];return ae||(ae=d(D),D<16384&&(M[D]=ae)),e("writeVarByteInt: writing to stream: %o",ae),X.write(ae)}function N(X,D){let ae=a.byteLength(D);return b(X,ae),e("writeString: %s",D),X.write(D,"utf8")}function le(X,D,ae){N(X,D),N(X,ae)}function re(X,D){return e("writeNumberCached: number: %d",D),e("writeNumberCached: %o",i[D]),X.write(i[D])}function ee(X,D){let ae=c(D);return e("writeNumberGenerated: %o",ae),X.write(ae)}function ue(X,D){let ae=y(D);return e("write4ByteNumber: %o",ae),X.write(ae)}function G(X,D){typeof D=="string"?N(X,D):D?(b(X,D.length),X.write(D)):b(X,0)}function oe(X,D){if(typeof D!="object"||D.length!=null)return{length:1,write(){he(X,{},0)}};let ae=0;function H(te,ne){let be=s.propertiesTypes[te],ce=0;switch(be){case"byte":{if(typeof ne!="boolean")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=2;break}case"int8":{if(typeof ne!="number"||ne<0||ne>255)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=2;break}case"binary":{if(ne&&ne===null)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=1+a.byteLength(ne)+2;break}case"int16":{if(typeof ne!="number"||ne<0||ne>65535)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=3;break}case"int32":{if(typeof ne!="number"||ne<0||ne>4294967295)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=5;break}case"var":{if(typeof ne!="number"||ne<0||ne>268435455)return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=1+a.byteLength(d(ne));break}case"string":{if(typeof ne!="string")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=3+a.byteLength(ne.toString());break}case"pair":{if(typeof ne!="object")return X.destroy(new Error(`Invalid ${te}: ${ne}`)),!1;ce+=Object.getOwnPropertyNames(ne).reduce((L,Y)=>{let se=ne[Y];return Array.isArray(se)?L+=se.reduce((me,pe)=>(me+=3+a.byteLength(Y.toString())+2+a.byteLength(pe.toString()),me),0):L+=3+a.byteLength(Y.toString())+2+a.byteLength(ne[Y].toString()),L},0);break}default:return X.destroy(new Error(`Invalid property ${te}: ${ne}`)),!1}return ce}if(D)for(let te in D){let ne=0,be=0,ce=D[te];if(ce!==void 0){if(Array.isArray(ce))for(let L=0;L<ce.length;L++){if(be=H(te,ce[L]),!be)return!1;ne+=be}else{if(be=H(te,ce),!be)return!1;ne=be}if(!ne)return!1;ae+=ne}}return{length:a.byteLength(d(ae))+ae,write(){he(X,D,ae)}}}function R(X,D,ae,H){let te=["reasonString","userProperties"],ne=ae&&ae.properties&&ae.properties.maximumPacketSize?ae.properties.maximumPacketSize:0,be=oe(X,D);if(ne)for(;H+be.length>ne;){let ce=te.shift();if(ce&&D[ce])delete D[ce],be=oe(X,D);else return!1}return be}function Q(X,D,ae){switch(s.propertiesTypes[D]){case"byte":{X.write(a.from([s.properties[D]])),X.write(a.from([+ae]));break}case"int8":{X.write(a.from([s.properties[D]])),X.write(a.from([ae]));break}case"binary":{X.write(a.from([s.properties[D]])),G(X,ae);break}case"int16":{X.write(a.from([s.properties[D]])),b(X,ae);break}case"int32":{X.write(a.from([s.properties[D]])),ue(X,ae);break}case"var":{X.write(a.from([s.properties[D]])),q(X,ae);break}case"string":{X.write(a.from([s.properties[D]])),N(X,ae);break}case"pair":{Object.getOwnPropertyNames(ae).forEach(H=>{let te=ae[H];Array.isArray(te)?te.forEach(ne=>{X.write(a.from([s.properties[D]])),le(X,H.toString(),ne.toString())}):(X.write(a.from([s.properties[D]])),le(X,H.toString(),te.toString()))});break}default:return X.destroy(new Error(`Invalid property ${D} value: ${ae}`)),!1}}function he(X,D,ae){q(X,ae);for(let H in D)if(Object.prototype.hasOwnProperty.call(D,H)&&D[H]!=null){let te=D[H];if(Array.isArray(te))for(let ne=0;ne<te.length;ne++)Q(X,H,te[ne]);else Q(X,H,te)}}function z(X){return X?X instanceof a?X.length:a.byteLength(X):0}function Ee(X){return typeof X=="string"||X instanceof a}l.exports=w}),qu=we((o,l)=>{de(),ye(),ge();var s=_s(),{EventEmitter:a}=(Qt(),tt(Ft)),{Buffer:u}=(dt(),tt(pt));function t(n,e){let i=new r;return s(n,i,e),i.concat()}var r=class extends a{constructor(){super(),this._array=new Array(20),this._i=0}write(n){return this._array[this._i++]=n,!0}concat(){let n=0,e=new Array(this._array.length),i=this._array,c=0,h;for(h=0;h<i.length&&i[h]!==void 0;h++)typeof i[h]!="string"?e[h]=i[h].length:e[h]=u.byteLength(i[h]),n+=e[h];let d=u.allocUnsafe(n);for(h=0;h<i.length&&i[h]!==void 0;h++)typeof i[h]!="string"?(i[h].copy(d,c),c+=e[h]):(d.write(i[h],c),c+=e[h]);return d}destroy(n){n&&this.emit("error",n)}};l.exports=t}),zu=we(o=>{de(),ye(),ge(),o.parser=Fu().parser,o.generate=qu(),o.writeToStream=_s()}),Vu=we((o,l)=>{de(),ye(),ge(),l.exports=a;function s(t){return t instanceof Ar?Ar.from(t):new t.constructor(t.buffer.slice(),t.byteOffset,t.length)}function a(t){if(t=t||{},t.circles)return u(t);let r=new Map;if(r.set(Date,h=>new Date(h)),r.set(Map,(h,d)=>new Map(e(Array.from(h),d))),r.set(Set,(h,d)=>new Set(e(Array.from(h),d))),t.constructorHandlers)for(let h of t.constructorHandlers)r.set(h[0],h[1]);let n=null;return t.proto?c:i;function e(h,d){let y=Object.keys(h),b=new Array(y.length);for(let S=0;S<y.length;S++){let w=y[S],x=h[w];typeof x!="object"||x===null?b[w]=x:x.constructor!==Object&&(n=r.get(x.constructor))?b[w]=n(x,d):ArrayBuffer.isView(x)?b[w]=s(x):b[w]=d(x)}return b}function i(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return e(h,i);if(h.constructor!==Object&&(n=r.get(h.constructor)))return n(h,i);let d={};for(let y in h){if(Object.hasOwnProperty.call(h,y)===!1)continue;let b=h[y];typeof b!="object"||b===null?d[y]=b:b.constructor!==Object&&(n=r.get(b.constructor))?d[y]=n(b,i):ArrayBuffer.isView(b)?d[y]=s(b):d[y]=i(b)}return d}function c(h){if(typeof h!="object"||h===null)return h;if(Array.isArray(h))return e(h,c);if(h.constructor!==Object&&(n=r.get(h.constructor)))return n(h,c);let d={};for(let y in h){let b=h[y];typeof b!="object"||b===null?d[y]=b:b.constructor!==Object&&(n=r.get(b.constructor))?d[y]=n(b,c):ArrayBuffer.isView(b)?d[y]=s(b):d[y]=c(b)}return d}}function u(t){let r=[],n=[],e=new Map;if(e.set(Date,y=>new Date(y)),e.set(Map,(y,b)=>new Map(c(Array.from(y),b))),e.set(Set,(y,b)=>new Set(c(Array.from(y),b))),t.constructorHandlers)for(let y of t.constructorHandlers)e.set(y[0],y[1]);let i=null;return t.proto?d:h;function c(y,b){let S=Object.keys(y),w=new Array(S.length);for(let x=0;x<S.length;x++){let g=S[x],_=y[g];if(typeof _!="object"||_===null)w[g]=_;else if(_.constructor!==Object&&(i=e.get(_.constructor)))w[g]=i(_,b);else if(ArrayBuffer.isView(_))w[g]=s(_);else{let E=r.indexOf(_);E!==-1?w[g]=n[E]:w[g]=b(_)}}return w}function h(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return c(y,h);if(y.constructor!==Object&&(i=e.get(y.constructor)))return i(y,h);let b={};r.push(y),n.push(b);for(let S in y){if(Object.hasOwnProperty.call(y,S)===!1)continue;let w=y[S];if(typeof w!="object"||w===null)b[S]=w;else if(w.constructor!==Object&&(i=e.get(w.constructor)))b[S]=i(w,h);else if(ArrayBuffer.isView(w))b[S]=s(w);else{let x=r.indexOf(w);x!==-1?b[S]=n[x]:b[S]=h(w)}}return r.pop(),n.pop(),b}function d(y){if(typeof y!="object"||y===null)return y;if(Array.isArray(y))return c(y,d);if(y.constructor!==Object&&(i=e.get(y.constructor)))return i(y,d);let b={};r.push(y),n.push(b);for(let S in y){let w=y[S];if(typeof w!="object"||w===null)b[S]=w;else if(w.constructor!==Object&&(i=e.get(w.constructor)))b[S]=i(w,d);else if(ArrayBuffer.isView(w))b[S]=s(w);else{let x=r.indexOf(w);x!==-1?b[S]=n[x]:b[S]=d(w)}}return r.pop(),n.pop(),b}}}),Ku=we((o,l)=>{de(),ye(),ge(),l.exports=Vu()()}),Hu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.validateTopic=l,o.validateTopics=s;function l(a){let u=a.split("/");for(let t=0;t<u.length;t++)if(u[t]!=="+"){if(u[t]==="#")return t===u.length-1;if(u[t].indexOf("+")!==-1||u[t].indexOf("#")!==-1)return!1}return!0}function s(a){if(a.length===0)return"empty_topic_list";for(let u=0;u<a.length;u++)if(!l(a[u]))return a[u];return null}}),Ss=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Xt(),s={objectMode:!0},a={clean:!0},u=class{constructor(t){Pe(this,"options");Pe(this,"_inflights");this.options=t||{},this.options={...a,...t},this._inflights=new Map}put(t,r){return this._inflights.set(t.messageId,t),r&&r(),this}createStream(){let t=new l.Readable(s),r=[],n=!1,e=0;return this._inflights.forEach((i,c)=>{r.push(i)}),t._read=()=>{!n&&e<r.length?t.push(r[e++]):t.push(null)},t.destroy=i=>{if(!n)return n=!0,setTimeout(()=>{t.emit("close")},0),t},t}del(t,r){let n=this._inflights.get(t.messageId);return n?(this._inflights.delete(t.messageId),r(null,n)):r&&r(new Error("missing packet")),this}get(t,r){let n=this._inflights.get(t.messageId);return n?r(null,n):r&&r(new Error("missing packet")),this}close(t){this.options.clean&&(this._inflights=null),t&&t()}};o.default=u}),Gu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=[0,16,128,131,135,144,145,151,153],s=(a,u,t)=>{a.log("handlePublish: packet %o",u),t=typeof t<"u"?t:a.noop;let r=u.topic.toString(),n=u.payload,{qos:e}=u,{messageId:i}=u,{options:c}=a;if(a.options.protocolVersion===5){let h;if(u.properties&&(h=u.properties.topicAlias),typeof h<"u")if(r.length===0)if(h>0&&h<=65535){let d=a.topicAliasRecv.getTopicByAlias(h);if(d)r=d,a.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",r,h);else{a.log("handlePublish :: unregistered topic alias. alias: %d",h),a.emit("error",new Error("Received unregistered Topic Alias"));return}}else{a.log("handlePublish :: topic alias out of range. alias: %d",h),a.emit("error",new Error("Received Topic Alias is out of range"));return}else if(a.topicAliasRecv.put(r,h))a.log("handlePublish :: registered topic: %s - alias: %d",r,h);else{a.log("handlePublish :: topic alias out of range. alias: %d",h),a.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(a.log("handlePublish: qos %d",e),e){case 2:{c.customHandleAcks(r,n,u,(h,d)=>{if(typeof h=="number"&&(d=h,h=null),h)return a.emit("error",h);if(l.indexOf(d)===-1)return a.emit("error",new Error("Wrong reason code for pubrec"));d?a._sendPacket({cmd:"pubrec",messageId:i,reasonCode:d},t):a.incomingStore.put(u,()=>{a._sendPacket({cmd:"pubrec",messageId:i},t)})});break}case 1:{c.customHandleAcks(r,n,u,(h,d)=>{if(typeof h=="number"&&(d=h,h=null),h)return a.emit("error",h);if(l.indexOf(d)===-1)return a.emit("error",new Error("Wrong reason code for puback"));d||a.emit("message",r,n,u),a.handleMessage(u,y=>{if(y)return t&&t(y);a._sendPacket({cmd:"puback",messageId:i,reasonCode:d},t)})});break}case 0:a.emit("message",r,n,u),a.handleMessage(u,t);break;default:a.log("handlePublish: unknown QoS. Doing nothing.");break}};o.default=s}),Yu=we((o,l)=>{l.exports={version:"5.14.1"}}),ar=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.MQTTJS_VERSION=o.nextTick=o.ErrorWithSubackPacket=o.ErrorWithReasonCode=void 0,o.applyMixin=a;var l=class ou extends Error{constructor(r,n){super(r);Pe(this,"code");this.code=n,Object.setPrototypeOf(this,ou.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}};o.ErrorWithReasonCode=l;var s=class su extends Error{constructor(r,n){super(r);Pe(this,"packet");this.packet=n,Object.setPrototypeOf(this,su.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}};o.ErrorWithSubackPacket=s;function a(u,t,r=!1){let n=[t];for(;;){let e=n[0],i=Object.getPrototypeOf(e);if(i!=null&&i.prototype)n.unshift(i);else break}for(let e of n)for(let i of Object.getOwnPropertyNames(e.prototype))(r||i!=="constructor")&&Object.defineProperty(u.prototype,i,Object.getOwnPropertyDescriptor(e.prototype,i)??Object.create(null))}o.nextTick=typeof(Je==null?void 0:Je.nextTick)=="function"?Je.nextTick:u=>{setTimeout(u,0)},o.MQTTJS_VERSION=Yu().version}),Tr=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=void 0;var l=ar();o.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 s=(a,u)=>{let{messageId:t}=u,r=u.cmd,n=null,e=a.outgoing[t]?a.outgoing[t].cb:null,i=null;if(!e){a.log("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(a.log("_handleAck :: packet type",r),r){case"pubcomp":case"puback":{let c=u.reasonCode;c&&c>0&&c!==16?(i=new l.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[c]}`,c),a._removeOutgoingAndStoreMessage(t,()=>{e(i,u)})):a._removeOutgoingAndStoreMessage(t,e);break}case"pubrec":{n={cmd:"pubrel",qos:2,messageId:t};let c=u.reasonCode;c&&c>0&&c!==16?(i=new l.ErrorWithReasonCode(`Publish error: ${o.ReasonCodes[c]}`,c),a._removeOutgoingAndStoreMessage(t,()=>{e(i,u)})):a._sendPacket(n);break}case"suback":{delete a.outgoing[t],a.messageIdProvider.deallocate(t);let c=u.granted;for(let h=0;h<c.length;h++){let d=c[h];if(d&128){i=new Error(`Subscribe error: ${o.ReasonCodes[d]}`),i.code=d;let y=a.messageIdToTopic[t];y&&y.forEach(b=>{delete a._resubscribeTopics[b]})}}delete a.messageIdToTopic[t],a._invokeStoreProcessingQueue(),e(i,u);break}case"unsuback":{delete a.outgoing[t],a.messageIdProvider.deallocate(t),a._invokeStoreProcessingQueue(),e(null,u);break}default:a.emit("error",new Error("unrecognized packet type"))}a.disconnecting&&Object.keys(a.outgoing).length===0&&a.emit("outgoingEmpty")};o.default=s}),Qu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=ar(),s=Tr(),a=(u,t)=>{let{options:r}=u,n=r.protocolVersion,e=n===5?t.reasonCode:t.returnCode;if(n!==5){let i=new l.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${n}`,e);u.emit("error",i);return}u.handleAuth(t,(i,c)=>{if(i){u.emit("error",i);return}if(e===24)u.reconnecting=!1,u._sendPacket(c);else{let h=new l.ErrorWithReasonCode(`Connection refused: ${s.ReasonCodes[e]}`,e);u.emit("error",h)}})};o.default=a}),Ju=we(o=>{var y,b,S,w,x,g,_,E,v,C,P,I,T,k,W,A,M,q,N,le,re,ee,ue,G,oe,R,Q,he,z,$o,X,D,ae,H,au,ne,be,ce,Vt,Kt,qo,un,cn,ot,zo,Sr,Ht,Vo,De;de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.LRUCache=void 0;var l=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,s=new Set,a=typeof Je=="object"&&Je?Je:{},u=(f,p,m,O)=>{typeof a.emitWarning=="function"?a.emitWarning(f,p,m,O):console.error(`[${m}] ${p}: ${f}`)},t=globalThis.AbortController,r=globalThis.AbortSignal;if(typeof t>"u"){r=class{constructor(){Pe(this,"onabort");Pe(this,"_onabort",[]);Pe(this,"reason");Pe(this,"aborted",!1)}addEventListener(m,O){this._onabort.push(O)}},t=class{constructor(){Pe(this,"signal",new r);p()}abort(m){var O,B;if(!this.signal.aborted){this.signal.reason=m,this.signal.aborted=!0;for(let V of this.signal._onabort)V(m);(B=(O=this.signal).onabort)==null||B.call(O,m)}}};let f=((y=a.env)==null?void 0:y.LRU_CACHE_IGNORE_AC_WARNING)!=="1",p=()=>{f&&(f=!1,u("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",p))}}var n=f=>!s.has(f),e=f=>f&&f===Math.floor(f)&&f>0&&isFinite(f),i=f=>e(f)?f<=Math.pow(2,8)?Uint8Array:f<=Math.pow(2,16)?Uint16Array:f<=Math.pow(2,32)?Uint32Array:f<=Number.MAX_SAFE_INTEGER?c:null:null,c=class extends Array{constructor(f){super(f),this.fill(0)}},h=(b=class{constructor(p,m){Pe(this,"heap");Pe(this,"length");if(!F(b,S))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new m(p),this.length=0}static create(p){let m=i(p);if(!m)return[];$e(b,S,!0);let O=new b(p,m);return $e(b,S,!1),O}push(p){this.heap[this.length++]=p}pop(){return this.heap[--this.length]}},S=new WeakMap,Qe(b,S,!1),b),d=(De=class{constructor(p){Qe(this,z);Qe(this,g);Qe(this,_);Qe(this,E);Qe(this,v);Qe(this,C);Qe(this,P);Pe(this,"ttl");Pe(this,"ttlResolution");Pe(this,"ttlAutopurge");Pe(this,"updateAgeOnGet");Pe(this,"updateAgeOnHas");Pe(this,"allowStale");Pe(this,"noDisposeOnSet");Pe(this,"noUpdateTTL");Pe(this,"maxEntrySize");Pe(this,"sizeCalculation");Pe(this,"noDeleteOnFetchRejection");Pe(this,"noDeleteOnStaleGet");Pe(this,"allowStaleOnFetchAbort");Pe(this,"allowStaleOnFetchRejection");Pe(this,"ignoreFetchAbort");Qe(this,I);Qe(this,T);Qe(this,k);Qe(this,W);Qe(this,A);Qe(this,M);Qe(this,q);Qe(this,N);Qe(this,le);Qe(this,re);Qe(this,ee);Qe(this,ue);Qe(this,G);Qe(this,oe);Qe(this,R);Qe(this,Q);Qe(this,he);Qe(this,X,()=>{});Qe(this,D,()=>{});Qe(this,ae,()=>{});Qe(this,H,()=>!1);Qe(this,ne,p=>{});Qe(this,be,(p,m,O)=>{});Qe(this,ce,(p,m,O,B)=>{if(O||B)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});Pe(this,w,"LRUCache");let{max:m=0,ttl:O,ttlResolution:B=1,ttlAutopurge:V,updateAgeOnGet:ie,updateAgeOnHas:$,allowStale:J,dispose:Te,disposeAfter:Re,noDisposeOnSet:Me,noUpdateTTL:Fe,maxSize:nt=0,maxEntrySize:rt=0,sizeCalculation:Ke,fetchMethod:Xe,memoMethod:Ue,noDeleteOnFetchRejection:Ye,noDeleteOnStaleGet:Ze,allowStaleOnFetchRejection:lt,allowStaleOnFetchAbort:ct,ignoreFetchAbort:Et}=p;if(m!==0&&!e(m))throw new TypeError("max option must be a nonnegative integer");let j=m?i(m):Array;if(!j)throw new Error("invalid max value: "+m);if($e(this,g,m),$e(this,_,nt),this.maxEntrySize=rt||F(this,_),this.sizeCalculation=Ke,this.sizeCalculation){if(!F(this,_)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(Ue!==void 0&&typeof Ue!="function")throw new TypeError("memoMethod must be a function if defined");if($e(this,P,Ue),Xe!==void 0&&typeof Xe!="function")throw new TypeError("fetchMethod must be a function if specified");if($e(this,C,Xe),$e(this,Q,!!Xe),$e(this,k,new Map),$e(this,W,new Array(m).fill(void 0)),$e(this,A,new Array(m).fill(void 0)),$e(this,M,new j(m)),$e(this,q,new j(m)),$e(this,N,0),$e(this,le,0),$e(this,re,h.create(m)),$e(this,I,0),$e(this,T,0),typeof Te=="function"&&$e(this,E,Te),typeof Re=="function"?($e(this,v,Re),$e(this,ee,[])):($e(this,v,void 0),$e(this,ee,void 0)),$e(this,R,!!F(this,E)),$e(this,he,!!F(this,v)),this.noDisposeOnSet=!!Me,this.noUpdateTTL=!!Fe,this.noDeleteOnFetchRejection=!!Ye,this.allowStaleOnFetchRejection=!!lt,this.allowStaleOnFetchAbort=!!ct,this.ignoreFetchAbort=!!Et,this.maxEntrySize!==0){if(F(this,_)!==0&&!e(F(this,_)))throw new TypeError("maxSize must be a positive integer if specified");if(!e(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");Le(this,z,au).call(this)}if(this.allowStale=!!J,this.noDeleteOnStaleGet=!!Ze,this.updateAgeOnGet=!!ie,this.updateAgeOnHas=!!$,this.ttlResolution=e(B)||B===0?B:1,this.ttlAutopurge=!!V,this.ttl=O||0,this.ttl){if(!e(this.ttl))throw new TypeError("ttl must be a positive integer if specified");Le(this,z,$o).call(this)}if(F(this,g)===0&&this.ttl===0&&F(this,_)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!F(this,g)&&!F(this,_)){let U="LRU_CACHE_UNBOUNDED";n(U)&&(s.add(U),u("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",U,De))}}static unsafeExposeInternals(p){return{starts:F(p,G),ttls:F(p,oe),sizes:F(p,ue),keyMap:F(p,k),keyList:F(p,W),valList:F(p,A),next:F(p,M),prev:F(p,q),get head(){return F(p,N)},get tail(){return F(p,le)},free:F(p,re),isBackgroundFetch:m=>{var O;return Le(O=p,z,ot).call(O,m)},backgroundFetch:(m,O,B,V)=>{var ie;return Le(ie=p,z,cn).call(ie,m,O,B,V)},moveToTail:m=>{var O;return Le(O=p,z,Sr).call(O,m)},indexes:m=>{var O;return Le(O=p,z,Vt).call(O,m)},rindexes:m=>{var O;return Le(O=p,z,Kt).call(O,m)},isStale:m=>{var O;return F(O=p,H).call(O,m)}}}get max(){return F(this,g)}get maxSize(){return F(this,_)}get calculatedSize(){return F(this,T)}get size(){return F(this,I)}get fetchMethod(){return F(this,C)}get memoMethod(){return F(this,P)}get dispose(){return F(this,E)}get disposeAfter(){return F(this,v)}getRemainingTTL(p){return F(this,k).has(p)?1/0:0}*entries(){for(let p of Le(this,z,Vt).call(this))F(this,A)[p]!==void 0&&F(this,W)[p]!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield[F(this,W)[p],F(this,A)[p]])}*rentries(){for(let p of Le(this,z,Kt).call(this))F(this,A)[p]!==void 0&&F(this,W)[p]!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield[F(this,W)[p],F(this,A)[p]])}*keys(){for(let p of Le(this,z,Vt).call(this)){let m=F(this,W)[p];m!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield m)}}*rkeys(){for(let p of Le(this,z,Kt).call(this)){let m=F(this,W)[p];m!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield m)}}*values(){for(let p of Le(this,z,Vt).call(this))F(this,A)[p]!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield F(this,A)[p])}*rvalues(){for(let p of Le(this,z,Kt).call(this))F(this,A)[p]!==void 0&&!Le(this,z,ot).call(this,F(this,A)[p])&&(yield F(this,A)[p])}[(x=Symbol.iterator,w=Symbol.toStringTag,x)](){return this.entries()}find(p,m={}){for(let O of Le(this,z,Vt).call(this)){let B=F(this,A)[O],V=Le(this,z,ot).call(this,B)?B.__staleWhileFetching:B;if(V!==void 0&&p(V,F(this,W)[O],this))return this.get(F(this,W)[O],m)}}forEach(p,m=this){for(let O of Le(this,z,Vt).call(this)){let B=F(this,A)[O],V=Le(this,z,ot).call(this,B)?B.__staleWhileFetching:B;V!==void 0&&p.call(m,V,F(this,W)[O],this)}}rforEach(p,m=this){for(let O of Le(this,z,Kt).call(this)){let B=F(this,A)[O],V=Le(this,z,ot).call(this,B)?B.__staleWhileFetching:B;V!==void 0&&p.call(m,V,F(this,W)[O],this)}}purgeStale(){let p=!1;for(let m of Le(this,z,Kt).call(this,{allowStale:!0}))F(this,H).call(this,m)&&(Le(this,z,Ht).call(this,F(this,W)[m],"expire"),p=!0);return p}info(p){let m=F(this,k).get(p);if(m===void 0)return;let O=F(this,A)[m],B=Le(this,z,ot).call(this,O)?O.__staleWhileFetching:O;if(B===void 0)return;let V={value:B};if(F(this,oe)&&F(this,G)){let ie=F(this,oe)[m],$=F(this,G)[m];if(ie&&$){let J=ie-(l.now()-$);V.ttl=J,V.start=Date.now()}}return F(this,ue)&&(V.size=F(this,ue)[m]),V}dump(){let p=[];for(let m of Le(this,z,Vt).call(this,{allowStale:!0})){let O=F(this,W)[m],B=F(this,A)[m],V=Le(this,z,ot).call(this,B)?B.__staleWhileFetching:B;if(V===void 0||O===void 0)continue;let ie={value:V};if(F(this,oe)&&F(this,G)){ie.ttl=F(this,oe)[m];let $=l.now()-F(this,G)[m];ie.start=Math.floor(Date.now()-$)}F(this,ue)&&(ie.size=F(this,ue)[m]),p.unshift([O,ie])}return p}load(p){this.clear();for(let[m,O]of p){if(O.start){let B=Date.now()-O.start;O.start=l.now()-B}this.set(m,O.value,O)}}set(p,m,O={}){var Fe,nt,rt,Ke,Xe;if(m===void 0)return this.delete(p),this;let{ttl:B=this.ttl,start:V,noDisposeOnSet:ie=this.noDisposeOnSet,sizeCalculation:$=this.sizeCalculation,status:J}=O,{noUpdateTTL:Te=this.noUpdateTTL}=O,Re=F(this,ce).call(this,p,m,O.size||0,$);if(this.maxEntrySize&&Re>this.maxEntrySize)return J&&(J.set="miss",J.maxEntrySizeExceeded=!0),Le(this,z,Ht).call(this,p,"set"),this;let Me=F(this,I)===0?void 0:F(this,k).get(p);if(Me===void 0)Me=F(this,I)===0?F(this,le):F(this,re).length!==0?F(this,re).pop():F(this,I)===F(this,g)?Le(this,z,un).call(this,!1):F(this,I),F(this,W)[Me]=p,F(this,A)[Me]=m,F(this,k).set(p,Me),F(this,M)[F(this,le)]=Me,F(this,q)[Me]=F(this,le),$e(this,le,Me),ln(this,I)._++,F(this,be).call(this,Me,Re,J),J&&(J.set="add"),Te=!1;else{Le(this,z,Sr).call(this,Me);let Ue=F(this,A)[Me];if(m!==Ue){if(F(this,Q)&&Le(this,z,ot).call(this,Ue)){Ue.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:Ye}=Ue;Ye!==void 0&&!ie&&(F(this,R)&&((Fe=F(this,E))==null||Fe.call(this,Ye,p,"set")),F(this,he)&&((nt=F(this,ee))==null||nt.push([Ye,p,"set"])))}else ie||(F(this,R)&&((rt=F(this,E))==null||rt.call(this,Ue,p,"set")),F(this,he)&&((Ke=F(this,ee))==null||Ke.push([Ue,p,"set"])));if(F(this,ne).call(this,Me),F(this,be).call(this,Me,Re,J),F(this,A)[Me]=m,J){J.set="replace";let Ye=Ue&&Le(this,z,ot).call(this,Ue)?Ue.__staleWhileFetching:Ue;Ye!==void 0&&(J.oldValue=Ye)}}else J&&(J.set="update")}if(B!==0&&!F(this,oe)&&Le(this,z,$o).call(this),F(this,oe)&&(Te||F(this,ae).call(this,Me,B,V),J&&F(this,D).call(this,J,Me)),!ie&&F(this,he)&&F(this,ee)){let Ue=F(this,ee),Ye;for(;Ye=Ue==null?void 0:Ue.shift();)(Xe=F(this,v))==null||Xe.call(this,...Ye)}return this}pop(){var p;try{for(;F(this,I);){let m=F(this,A)[F(this,N)];if(Le(this,z,un).call(this,!0),Le(this,z,ot).call(this,m)){if(m.__staleWhileFetching)return m.__staleWhileFetching}else if(m!==void 0)return m}}finally{if(F(this,he)&&F(this,ee)){let m=F(this,ee),O;for(;O=m==null?void 0:m.shift();)(p=F(this,v))==null||p.call(this,...O)}}}has(p,m={}){let{updateAgeOnHas:O=this.updateAgeOnHas,status:B}=m,V=F(this,k).get(p);if(V!==void 0){let ie=F(this,A)[V];if(Le(this,z,ot).call(this,ie)&&ie.__staleWhileFetching===void 0)return!1;if(F(this,H).call(this,V))B&&(B.has="stale",F(this,D).call(this,B,V));else return O&&F(this,X).call(this,V),B&&(B.has="hit",F(this,D).call(this,B,V)),!0}else B&&(B.has="miss");return!1}peek(p,m={}){let{allowStale:O=this.allowStale}=m,B=F(this,k).get(p);if(B===void 0||!O&&F(this,H).call(this,B))return;let V=F(this,A)[B];return Le(this,z,ot).call(this,V)?V.__staleWhileFetching:V}async fetch(p,m={}){let{allowStale:O=this.allowStale,updateAgeOnGet:B=this.updateAgeOnGet,noDeleteOnStaleGet:V=this.noDeleteOnStaleGet,ttl:ie=this.ttl,noDisposeOnSet:$=this.noDisposeOnSet,size:J=0,sizeCalculation:Te=this.sizeCalculation,noUpdateTTL:Re=this.noUpdateTTL,noDeleteOnFetchRejection:Me=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:Fe=this.allowStaleOnFetchRejection,ignoreFetchAbort:nt=this.ignoreFetchAbort,allowStaleOnFetchAbort:rt=this.allowStaleOnFetchAbort,context:Ke,forceRefresh:Xe=!1,status:Ue,signal:Ye}=m;if(!F(this,Q))return Ue&&(Ue.fetch="get"),this.get(p,{allowStale:O,updateAgeOnGet:B,noDeleteOnStaleGet:V,status:Ue});let Ze={allowStale:O,updateAgeOnGet:B,noDeleteOnStaleGet:V,ttl:ie,noDisposeOnSet:$,size:J,sizeCalculation:Te,noUpdateTTL:Re,noDeleteOnFetchRejection:Me,allowStaleOnFetchRejection:Fe,allowStaleOnFetchAbort:rt,ignoreFetchAbort:nt,status:Ue,signal:Ye},lt=F(this,k).get(p);if(lt===void 0){Ue&&(Ue.fetch="miss");let ct=Le(this,z,cn).call(this,p,lt,Ze,Ke);return ct.__returned=ct}else{let ct=F(this,A)[lt];if(Le(this,z,ot).call(this,ct)){let Ae=O&&ct.__staleWhileFetching!==void 0;return Ue&&(Ue.fetch="inflight",Ae&&(Ue.returnedStale=!0)),Ae?ct.__staleWhileFetching:ct.__returned=ct}let Et=F(this,H).call(this,lt);if(!Xe&&!Et)return Ue&&(Ue.fetch="hit"),Le(this,z,Sr).call(this,lt),B&&F(this,X).call(this,lt),Ue&&F(this,D).call(this,Ue,lt),ct;let j=Le(this,z,cn).call(this,p,lt,Ze,Ke),U=j.__staleWhileFetching!==void 0&&O;return Ue&&(Ue.fetch=Et?"stale":"refresh",U&&Et&&(Ue.returnedStale=!0)),U?j.__staleWhileFetching:j.__returned=j}}async forceFetch(p,m={}){let O=await this.fetch(p,m);if(O===void 0)throw new Error("fetch() returned undefined");return O}memo(p,m={}){let O=F(this,P);if(!O)throw new Error("no memoMethod provided to constructor");let{context:B,forceRefresh:V,...ie}=m,$=this.get(p,ie);if(!V&&$!==void 0)return $;let J=O(p,$,{options:ie,context:B});return this.set(p,J,ie),J}get(p,m={}){let{allowStale:O=this.allowStale,updateAgeOnGet:B=this.updateAgeOnGet,noDeleteOnStaleGet:V=this.noDeleteOnStaleGet,status:ie}=m,$=F(this,k).get(p);if($!==void 0){let J=F(this,A)[$],Te=Le(this,z,ot).call(this,J);return ie&&F(this,D).call(this,ie,$),F(this,H).call(this,$)?(ie&&(ie.get="stale"),Te?(ie&&O&&J.__staleWhileFetching!==void 0&&(ie.returnedStale=!0),O?J.__staleWhileFetching:void 0):(V||Le(this,z,Ht).call(this,p,"expire"),ie&&O&&(ie.returnedStale=!0),O?J:void 0)):(ie&&(ie.get="hit"),Te?J.__staleWhileFetching:(Le(this,z,Sr).call(this,$),B&&F(this,X).call(this,$),J))}else ie&&(ie.get="miss")}delete(p){return Le(this,z,Ht).call(this,p,"delete")}clear(){return Le(this,z,Vo).call(this,"delete")}},g=new WeakMap,_=new WeakMap,E=new WeakMap,v=new WeakMap,C=new WeakMap,P=new WeakMap,I=new WeakMap,T=new WeakMap,k=new WeakMap,W=new WeakMap,A=new WeakMap,M=new WeakMap,q=new WeakMap,N=new WeakMap,le=new WeakMap,re=new WeakMap,ee=new WeakMap,ue=new WeakMap,G=new WeakMap,oe=new WeakMap,R=new WeakMap,Q=new WeakMap,he=new WeakMap,z=new WeakSet,$o=function(){let p=new c(F(this,g)),m=new c(F(this,g));$e(this,oe,p),$e(this,G,m),$e(this,ae,(V,ie,$=l.now())=>{if(m[V]=ie!==0?$:0,p[V]=ie,ie!==0&&this.ttlAutopurge){let J=setTimeout(()=>{F(this,H).call(this,V)&&Le(this,z,Ht).call(this,F(this,W)[V],"expire")},ie+1);J.unref&&J.unref()}}),$e(this,X,V=>{m[V]=p[V]!==0?l.now():0}),$e(this,D,(V,ie)=>{if(p[ie]){let $=p[ie],J=m[ie];if(!$||!J)return;V.ttl=$,V.start=J,V.now=O||B();let Te=V.now-J;V.remainingTTL=$-Te}});let O=0,B=()=>{let V=l.now();if(this.ttlResolution>0){O=V;let ie=setTimeout(()=>O=0,this.ttlResolution);ie.unref&&ie.unref()}return V};this.getRemainingTTL=V=>{let ie=F(this,k).get(V);if(ie===void 0)return 0;let $=p[ie],J=m[ie];if(!$||!J)return 1/0;let Te=(O||B())-J;return $-Te},$e(this,H,V=>{let ie=m[V],$=p[V];return!!$&&!!ie&&(O||B())-ie>$})},X=new WeakMap,D=new WeakMap,ae=new WeakMap,H=new WeakMap,au=function(){let p=new c(F(this,g));$e(this,T,0),$e(this,ue,p),$e(this,ne,m=>{$e(this,T,F(this,T)-p[m]),p[m]=0}),$e(this,ce,(m,O,B,V)=>{if(Le(this,z,ot).call(this,O))return 0;if(!e(B))if(V){if(typeof V!="function")throw new TypeError("sizeCalculation must be a function");if(B=V(O,m),!e(B))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return B}),$e(this,be,(m,O,B)=>{if(p[m]=O,F(this,_)){let V=F(this,_)-p[m];for(;F(this,T)>V;)Le(this,z,un).call(this,!0)}$e(this,T,F(this,T)+p[m]),B&&(B.entrySize=O,B.totalCalculatedSize=F(this,T))})},ne=new WeakMap,be=new WeakMap,ce=new WeakMap,Vt=function*({allowStale:p=this.allowStale}={}){if(F(this,I))for(let m=F(this,le);!(!Le(this,z,qo).call(this,m)||((p||!F(this,H).call(this,m))&&(yield m),m===F(this,N)));)m=F(this,q)[m]},Kt=function*({allowStale:p=this.allowStale}={}){if(F(this,I))for(let m=F(this,N);!(!Le(this,z,qo).call(this,m)||((p||!F(this,H).call(this,m))&&(yield m),m===F(this,le)));)m=F(this,M)[m]},qo=function(p){return p!==void 0&&F(this,k).get(F(this,W)[p])===p},un=function(p){var V,ie;let m=F(this,N),O=F(this,W)[m],B=F(this,A)[m];return F(this,Q)&&Le(this,z,ot).call(this,B)?B.__abortController.abort(new Error("evicted")):(F(this,R)||F(this,he))&&(F(this,R)&&((V=F(this,E))==null||V.call(this,B,O,"evict")),F(this,he)&&((ie=F(this,ee))==null||ie.push([B,O,"evict"]))),F(this,ne).call(this,m),p&&(F(this,W)[m]=void 0,F(this,A)[m]=void 0,F(this,re).push(m)),F(this,I)===1?($e(this,N,$e(this,le,0)),F(this,re).length=0):$e(this,N,F(this,M)[m]),F(this,k).delete(O),ln(this,I)._--,m},cn=function(p,m,O,B){let V=m===void 0?void 0:F(this,A)[m];if(Le(this,z,ot).call(this,V))return V;let ie=new t,{signal:$}=O;$==null||$.addEventListener("abort",()=>ie.abort($.reason),{signal:ie.signal});let J={signal:ie.signal,options:O,context:B},Te=(Ke,Xe=!1)=>{let{aborted:Ue}=ie.signal,Ye=O.ignoreFetchAbort&&Ke!==void 0;if(O.status&&(Ue&&!Xe?(O.status.fetchAborted=!0,O.status.fetchError=ie.signal.reason,Ye&&(O.status.fetchAbortIgnored=!0)):O.status.fetchResolved=!0),Ue&&!Ye&&!Xe)return Me(ie.signal.reason);let Ze=nt;return F(this,A)[m]===nt&&(Ke===void 0?Ze.__staleWhileFetching?F(this,A)[m]=Ze.__staleWhileFetching:Le(this,z,Ht).call(this,p,"fetch"):(O.status&&(O.status.fetchUpdated=!0),this.set(p,Ke,J.options))),Ke},Re=Ke=>(O.status&&(O.status.fetchRejected=!0,O.status.fetchError=Ke),Me(Ke)),Me=Ke=>{let{aborted:Xe}=ie.signal,Ue=Xe&&O.allowStaleOnFetchAbort,Ye=Ue||O.allowStaleOnFetchRejection,Ze=Ye||O.noDeleteOnFetchRejection,lt=nt;if(F(this,A)[m]===nt&&(!Ze||lt.__staleWhileFetching===void 0?Le(this,z,Ht).call(this,p,"fetch"):Ue||(F(this,A)[m]=lt.__staleWhileFetching)),Ye)return O.status&<.__staleWhileFetching!==void 0&&(O.status.returnedStale=!0),lt.__staleWhileFetching;if(lt.__returned===lt)throw Ke},Fe=(Ke,Xe)=>{var Ye;let Ue=(Ye=F(this,C))==null?void 0:Ye.call(this,p,V,J);Ue&&Ue instanceof Promise&&Ue.then(Ze=>Ke(Ze===void 0?void 0:Ze),Xe),ie.signal.addEventListener("abort",()=>{(!O.ignoreFetchAbort||O.allowStaleOnFetchAbort)&&(Ke(void 0),O.allowStaleOnFetchAbort&&(Ke=Ze=>Te(Ze,!0)))})};O.status&&(O.status.fetchDispatched=!0);let nt=new Promise(Fe).then(Te,Re),rt=Object.assign(nt,{__abortController:ie,__staleWhileFetching:V,__returned:void 0});return m===void 0?(this.set(p,rt,{...J.options,status:void 0}),m=F(this,k).get(p)):F(this,A)[m]=rt,rt},ot=function(p){if(!F(this,Q))return!1;let m=p;return!!m&&m instanceof Promise&&m.hasOwnProperty("__staleWhileFetching")&&m.__abortController instanceof t},zo=function(p,m){F(this,q)[m]=p,F(this,M)[p]=m},Sr=function(p){p!==F(this,le)&&(p===F(this,N)?$e(this,N,F(this,M)[p]):Le(this,z,zo).call(this,F(this,q)[p],F(this,M)[p]),Le(this,z,zo).call(this,F(this,le),p),$e(this,le,p))},Ht=function(p,m){var B,V,ie,$;let O=!1;if(F(this,I)!==0){let J=F(this,k).get(p);if(J!==void 0)if(O=!0,F(this,I)===1)Le(this,z,Vo).call(this,m);else{F(this,ne).call(this,J);let Te=F(this,A)[J];if(Le(this,z,ot).call(this,Te)?Te.__abortController.abort(new Error("deleted")):(F(this,R)||F(this,he))&&(F(this,R)&&((B=F(this,E))==null||B.call(this,Te,p,m)),F(this,he)&&((V=F(this,ee))==null||V.push([Te,p,m]))),F(this,k).delete(p),F(this,W)[J]=void 0,F(this,A)[J]=void 0,J===F(this,le))$e(this,le,F(this,q)[J]);else if(J===F(this,N))$e(this,N,F(this,M)[J]);else{let Re=F(this,q)[J];F(this,M)[Re]=F(this,M)[J];let Me=F(this,M)[J];F(this,q)[Me]=F(this,q)[J]}ln(this,I)._--,F(this,re).push(J)}}if(F(this,he)&&((ie=F(this,ee))!=null&&ie.length)){let J=F(this,ee),Te;for(;Te=J==null?void 0:J.shift();)($=F(this,v))==null||$.call(this,...Te)}return O},Vo=function(p){var m,O,B;for(let V of Le(this,z,Kt).call(this,{allowStale:!0})){let ie=F(this,A)[V];if(Le(this,z,ot).call(this,ie))ie.__abortController.abort(new Error("deleted"));else{let $=F(this,W)[V];F(this,R)&&((m=F(this,E))==null||m.call(this,ie,$,p)),F(this,he)&&((O=F(this,ee))==null||O.push([ie,$,p]))}}if(F(this,k).clear(),F(this,A).fill(void 0),F(this,W).fill(void 0),F(this,oe)&&F(this,G)&&(F(this,oe).fill(0),F(this,G).fill(0)),F(this,ue)&&F(this,ue).fill(0),$e(this,N,0),$e(this,le,0),F(this,re).length=0,$e(this,T,0),$e(this,I,0),F(this,he)&&F(this,ee)){let V=F(this,ee),ie;for(;ie=V==null?void 0:V.shift();)(B=F(this,v))==null||B.call(this,...ie)}},De);o.LRUCache=d}),Nt=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.ContainerIterator=o.Container=o.Base=void 0;var l=class{constructor(u=0){this.iteratorType=u}equals(u){return this.o===u.o}};o.ContainerIterator=l;var s=class{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}};o.Base=s;var a=class extends s{};o.Container=a}),Xu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(u=[]){super(),this.S=[];let t=this;u.forEach(function(r){t.push(r)})}clear(){this.i=0,this.S=[]}push(u){return this.S.push(u),this.i+=1,this.i}pop(){if(this.i!==0)return this.i-=1,this.S.pop()}top(){return this.S[this.i-1]}},a=s;o.default=a}),Zu=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(u=[]){super(),this.j=0,this.q=[];let t=this;u.forEach(function(r){t.push(r)})}clear(){this.q=[],this.i=this.j=0}push(u){let t=this.q.length;if(this.j/t>.5&&this.j+this.i>=t&&t>4096){let r=this.i;for(let n=0;n<r;++n)this.q[n]=this.q[this.j+n];this.j=0,this.q[this.i]=u}else this.q[this.j+this.i]=u;return++this.i}pop(){if(this.i===0)return;let u=this.q[this.j++];return this.i-=1,u}front(){if(this.i!==0)return this.q[this.j]}},a=s;o.default=a}),ec=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Base{constructor(u=[],t=function(n,e){return n>e?-1:n<e?1:0},r=!0){if(super(),this.v=t,Array.isArray(u))this.C=r?[...u]:u;else{this.C=[];let e=this;u.forEach(function(i){e.C.push(i)})}this.i=this.C.length;let n=this.i>>1;for(let e=this.i-1>>1;e>=0;--e)this.k(e,n)}m(u){let t=this.C[u];for(;u>0;){let r=u-1>>1,n=this.C[r];if(this.v(n,t)<=0)break;this.C[u]=n,u=r}this.C[u]=t}k(u,t){let r=this.C[u];for(;u<t;){let n=u<<1|1,e=n+1,i=this.C[n];if(e<this.i&&this.v(i,this.C[e])>0&&(n=e,i=this.C[e]),this.v(i,r)>=0)break;this.C[u]=i,u=n}this.C[u]=r}clear(){this.i=0,this.C.length=0}push(u){this.C.push(u),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let u=this.C[0],t=this.C.pop();return this.i-=1,this.i&&(this.C[0]=t,this.k(0,this.i>>1)),u}top(){return this.C[0]}find(u){return this.C.indexOf(u)>=0}remove(u){let t=this.C.indexOf(u);return t<0?!1:(t===0?this.pop():t===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(t,1,this.C.pop()),this.i-=1,this.m(t),this.k(t,this.i>>1)),!0)}updateItem(u){let t=this.C.indexOf(u);return t<0?!1:(this.m(t),this.k(t,this.i>>1),!0)}toArray(){return[...this.C]}},a=s;o.default=a}),Pi=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=class extends l.Container{},a=s;o.default=a}),Bt=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.throwIteratorAccessError=l;function l(){throw new RangeError("Iterator access denied!")}}),Es=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.RandomIterator=void 0;var l=Nt(),s=Bt(),a=class extends l.ContainerIterator{constructor(u,t){super(t),this.o=u,this.iteratorType===0?(this.pre=function(){return this.o===0&&(0,s.throwIteratorAccessError)(),this.o-=1,this},this.next=function(){return this.o===this.container.size()&&(0,s.throwIteratorAccessError)(),this.o+=1,this}):(this.pre=function(){return this.o===this.container.size()-1&&(0,s.throwIteratorAccessError)(),this.o+=1,this},this.next=function(){return this.o===-1&&(0,s.throwIteratorAccessError)(),this.o-=1,this})}get pointer(){return this.container.getElementByPos(this.o)}set pointer(u){this.container.setElementByPos(this.o,u)}};o.RandomIterator=a}),tc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=a(Pi()),s=Es();function a(n){return n&&n.t?n:{default:n}}var u=class lu extends s.RandomIterator{constructor(e,i,c){super(e,c),this.container=i}copy(){return new lu(this.o,this.container,this.iteratorType)}},t=class extends l.default{constructor(n=[],e=!0){if(super(),Array.isArray(n))this.J=e?[...n]:n,this.i=n.length;else{this.J=[];let i=this;n.forEach(function(c){i.pushBack(c)})}}clear(){this.i=0,this.J.length=0}begin(){return new u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-1,this,1)}front(){return this.J[0]}back(){return this.J[this.i-1]}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J[n]}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;return this.J.splice(n,1),this.i-=1,this.i}eraseElementByValue(n){let e=0;for(let i=0;i<this.i;++i)this.J[i]!==n&&(this.J[e++]=this.J[i]);return this.i=this.J.length=e,this.i}eraseElementByIterator(n){let e=n.o;return n=n.next(),this.eraseElementByPos(e),n}pushBack(n){return this.J.push(n),this.i+=1,this.i}popBack(){if(this.i!==0)return this.i-=1,this.J.pop()}setElementByPos(n,e){if(n<0||n>this.i-1)throw new RangeError;this.J[n]=e}insert(n,e,i=1){if(n<0||n>this.i)throw new RangeError;return this.J.splice(n,0,...new Array(i).fill(e)),this.i+=i,this.i}find(n){for(let e=0;e<this.i;++e)if(this.J[e]===n)return new u(e,this);return this.end()}reverse(){this.J.reverse()}unique(){let n=1;for(let e=1;e<this.i;++e)this.J[e]!==this.J[e-1]&&(this.J[n++]=this.J[e]);return this.i=this.J.length=n,this.i}sort(n){this.J.sort(n)}forEach(n){for(let e=0;e<this.i;++e)n(this.J[e],e,this)}[Symbol.iterator](){return(function*(){yield*this.J}).bind(this)()}},r=t;o.default=r}),rc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(Pi()),s=Nt(),a=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class uu extends s.ContainerIterator{constructor(i,c,h,d){super(d),this.o=i,this.h=c,this.container=h,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l}set pointer(i){this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.l=i}copy(){return new uu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[]){super(),this.h={},this.p=this._=this.h.L=this.h.B=this.h;let i=this;e.forEach(function(c){i.pushBack(c)})}V(e){let{L:i,B:c}=e;i.B=c,c.L=i,e===this.p&&(this.p=c),e===this._&&(this._=i),this.i-=1}G(e,i){let c=i.B,h={l:e,L:i,B:c};i.B=h,c.L=h,i===this.h&&(this.p=h),c===this.h&&(this._=h),this.i+=1}clear(){this.i=0,this.p=this._=this.h.L=this.h.B=this.h}begin(){return new t(this.p,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this._,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){return this.p.l}back(){return this._.l}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return i.l}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return this.V(i),this.i}eraseElementByValue(e){let i=this.p;for(;i!==this.h;)i.l===e&&this.V(i),i=i.B;return this.i}eraseElementByIterator(e){let i=e.o;return i===this.h&&(0,a.throwIteratorAccessError)(),e=e.next(),this.V(i),e}pushBack(e){return this.G(e,this._),this.i}popBack(){if(this.i===0)return;let e=this._.l;return this.V(this._),e}pushFront(e){return this.G(e,this.h),this.i}popFront(){if(this.i===0)return;let e=this.p.l;return this.V(this.p),e}setElementByPos(e,i){if(e<0||e>this.i-1)throw new RangeError;let c=this.p;for(;e--;)c=c.B;c.l=i}insert(e,i,c=1){if(e<0||e>this.i)throw new RangeError;if(c<=0)return this.i;if(e===0)for(;c--;)this.pushFront(i);else if(e===this.i)for(;c--;)this.pushBack(i);else{let h=this.p;for(let y=1;y<e;++y)h=h.B;let d=h.B;for(this.i+=c;c--;)h.B={l:i,L:h},h.B.L=h,h=h.B;h.B=d,d.L=h}return this.i}find(e){let i=this.p;for(;i!==this.h;){if(i.l===e)return new t(i,this.h,this);i=i.B}return this.end()}reverse(){if(this.i<=1)return;let e=this.p,i=this._,c=0;for(;c<<1<this.i;){let h=e.l;e.l=i.l,i.l=h,e=e.B,i=i.L,c+=1}}unique(){if(this.i<=1)return this.i;let e=this.p;for(;e!==this.h;){let i=e;for(;i.B!==this.h&&i.l===i.B.l;)i=i.B,this.i-=1;e.B=i.B,e.B.L=e,e=e.B}return this.i}sort(e){if(this.i<=1)return;let i=[];this.forEach(function(h){i.push(h)}),i.sort(e);let c=this.p;i.forEach(function(h){c.l=h,c=c.B})}merge(e){let i=this;if(this.i===0)e.forEach(function(c){i.pushBack(c)});else{let c=this.p;e.forEach(function(h){for(;c!==i.h&&c.l<=h;)c=c.B;i.G(h,c.L)})}return this.i}forEach(e){let i=this.p,c=0;for(;i!==this.h;)e(i.l,c++,this),i=i.B}[Symbol.iterator](){return(function*(){if(this.i===0)return;let e=this.p;for(;e!==this.h;)yield e.l,e=e.B}).bind(this)()}},n=r;o.default=n}),nc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=a(Pi()),s=Es();function a(n){return n&&n.t?n:{default:n}}var u=class cu extends s.RandomIterator{constructor(e,i,c){super(e,c),this.container=i}copy(){return new cu(this.o,this.container,this.iteratorType)}},t=class extends l.default{constructor(n=[],e=4096){super(),this.j=0,this.D=0,this.R=0,this.N=0,this.P=0,this.A=[];let i=(()=>{if(typeof n.length=="number")return n.length;if(typeof n.size=="number")return n.size;if(typeof n.size=="function")return n.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=e,this.P=Math.max(Math.ceil(i/this.F),1);for(let d=0;d<this.P;++d)this.A.push(new Array(this.F));let c=Math.ceil(i/this.F);this.j=this.R=(this.P>>1)-(c>>1),this.D=this.N=this.F-i%this.F>>1;let h=this;n.forEach(function(d){h.pushBack(d)})}T(){let n=[],e=Math.max(this.P>>1,1);for(let i=0;i<e;++i)n[i]=new Array(this.F);for(let i=this.j;i<this.P;++i)n[n.length]=this.A[i];for(let i=0;i<this.R;++i)n[n.length]=this.A[i];n[n.length]=[...this.A[this.R]],this.j=e,this.R=n.length-1;for(let i=0;i<e;++i)n[n.length]=new Array(this.F);this.A=n,this.P=n.length}O(n){let e=this.D+n+1,i=e%this.F,c=i-1,h=this.j+(e-i)/this.F;return i===0&&(h-=1),h%=this.P,c<0&&(c+=this.F),{curNodeBucketIndex:h,curNodePointerIndex:c}}clear(){this.A=[new Array(this.F)],this.P=1,this.j=this.R=this.i=0,this.D=this.N=this.F>>1}begin(){return new u(0,this)}end(){return new u(this.i,this)}rBegin(){return new u(this.i-1,this,1)}rEnd(){return new u(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(n){return this.i&&(this.N<this.F-1?this.N+=1:this.R<this.P-1?(this.R+=1,this.N=0):(this.R=0,this.N=0),this.R===this.j&&this.N===this.D&&this.T()),this.i+=1,this.A[this.R][this.N]=n,this.i}popBack(){if(this.i===0)return;let n=this.A[this.R][this.N];return this.i!==1&&(this.N>0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,n}pushFront(n){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=n,this.i}popFront(){if(this.i===0)return;let n=this.A[this.j][this.D];return this.i!==1&&(this.D<this.F-1?this.D+=1:this.j<this.P-1?(this.j+=1,this.D=0):(this.j=0,this.D=0)),this.i-=1,n}getElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:e,curNodePointerIndex:i}=this.O(n);return this.A[e][i]}setElementByPos(n,e){if(n<0||n>this.i-1)throw new RangeError;let{curNodeBucketIndex:i,curNodePointerIndex:c}=this.O(n);this.A[i][c]=e}insert(n,e,i=1){if(n<0||n>this.i)throw new RangeError;if(n===0)for(;i--;)this.pushFront(e);else if(n===this.i)for(;i--;)this.pushBack(e);else{let c=[];for(let h=n;h<this.i;++h)c.push(this.getElementByPos(h));this.cut(n-1);for(let h=0;h<i;++h)this.pushBack(e);for(let h=0;h<c.length;++h)this.pushBack(c[h])}return this.i}cut(n){if(n<0)return this.clear(),0;let{curNodeBucketIndex:e,curNodePointerIndex:i}=this.O(n);return this.R=e,this.N=i,this.i=n+1,this.i}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;if(n===0)this.popFront();else if(n===this.i-1)this.popBack();else{let e=[];for(let c=n+1;c<this.i;++c)e.push(this.getElementByPos(c));this.cut(n),this.popBack();let i=this;e.forEach(function(c){i.pushBack(c)})}return this.i}eraseElementByValue(n){if(this.i===0)return 0;let e=[];for(let c=0;c<this.i;++c){let h=this.getElementByPos(c);h!==n&&e.push(h)}let i=e.length;for(let c=0;c<i;++c)this.setElementByPos(c,e[c]);return this.cut(i-1)}eraseElementByIterator(n){let e=n.o;return this.eraseElementByPos(e),n=n.next(),n}find(n){for(let e=0;e<this.i;++e)if(this.getElementByPos(e)===n)return new u(e,this);return this.end()}reverse(){let n=0,e=this.i-1;for(;n<e;){let i=this.getElementByPos(n);this.setElementByPos(n,this.getElementByPos(e)),this.setElementByPos(e,i),n+=1,e-=1}}unique(){if(this.i<=1)return this.i;let n=1,e=this.getElementByPos(0);for(let i=1;i<this.i;++i){let c=this.getElementByPos(i);c!==e&&(e=c,this.setElementByPos(n++,c))}for(;this.i>n;)this.popBack();return this.i}sort(n){let e=[];for(let i=0;i<this.i;++i)e.push(this.getElementByPos(i));e.sort(n);for(let i=0;i<this.i;++i)this.setElementByPos(i,e[i])}shrinkToFit(){if(this.i===0)return;let n=[];this.forEach(function(e){n.push(e)}),this.P=Math.max(Math.ceil(this.i/this.F),1),this.i=this.j=this.R=this.D=this.N=0,this.A=[];for(let e=0;e<this.P;++e)this.A.push(new Array(this.F));for(let e=0;e<n.length;++e)this.pushBack(n[e])}forEach(n){for(let e=0;e<this.i;++e)n(this.getElementByPos(e),e,this)}[Symbol.iterator](){return(function*(){for(let n=0;n<this.i;++n)yield this.getElementByPos(n)}).bind(this)()}},r=t;o.default=r}),ic=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.TreeNodeEnableIndex=o.TreeNode=void 0;var l=class{constructor(a,u){this.ee=1,this.u=void 0,this.l=void 0,this.U=void 0,this.W=void 0,this.tt=void 0,this.u=a,this.l=u}L(){let a=this;if(a.ee===1&&a.tt.tt===a)a=a.W;else if(a.U)for(a=a.U;a.W;)a=a.W;else{let u=a.tt;for(;u.U===a;)a=u,u=a.tt;a=u}return a}B(){let a=this;if(a.W){for(a=a.W;a.U;)a=a.U;return a}else{let u=a.tt;for(;u.W===a;)a=u,u=a.tt;return a.W!==u?u:a}}te(){let a=this.tt,u=this.W,t=u.U;return a.tt===this?a.tt=u:a.U===this?a.U=u:a.W=u,u.tt=a,u.U=this,this.tt=u,this.W=t,t&&(t.tt=this),u}se(){let a=this.tt,u=this.U,t=u.W;return a.tt===this?a.tt=u:a.U===this?a.U=u:a.W=u,u.tt=a,u.W=this,this.tt=u,this.U=t,t&&(t.tt=this),u}};o.TreeNode=l;var s=class extends l{constructor(){super(...arguments),this.rt=1}te(){let a=super.te();return this.ie(),a.ie(),a}se(){let a=super.se();return this.ie(),a.ie(),a}ie(){this.rt=1,this.U&&(this.rt+=this.U.rt),this.W&&(this.rt+=this.W.rt)}};o.TreeNodeEnableIndex=s}),xs=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=ic(),s=Nt(),a=Bt(),u=class extends s.Container{constructor(r=function(e,i){return e<i?-1:e>i?1:0},n=!1){super(),this.Y=void 0,this.v=r,n?(this.re=l.TreeNodeEnableIndex,this.M=function(e,i,c){let h=this.ne(e,i,c);if(h){let d=h.tt;for(;d!==this.h;)d.rt+=1,d=d.tt;let y=this.he(h);if(y){let{parentNode:b,grandParent:S,curNode:w}=y;b.ie(),S.ie(),w.ie()}}return this.i},this.V=function(e){let i=this.fe(e);for(;i!==this.h;)i.rt-=1,i=i.tt}):(this.re=l.TreeNode,this.M=function(e,i,c){let h=this.ne(e,i,c);return h&&this.he(h),this.i},this.V=this.fe),this.h=new this.re}X(r,n){let e=this.h;for(;r;){let i=this.v(r.u,n);if(i<0)r=r.W;else if(i>0)e=r,r=r.U;else return r}return e}Z(r,n){let e=this.h;for(;r;)this.v(r.u,n)<=0?r=r.W:(e=r,r=r.U);return e}$(r,n){let e=this.h;for(;r;){let i=this.v(r.u,n);if(i<0)e=r,r=r.W;else if(i>0)r=r.U;else return r}return e}rr(r,n){let e=this.h;for(;r;)this.v(r.u,n)<0?(e=r,r=r.W):r=r.U;return e}ue(r){for(;;){let n=r.tt;if(n===this.h)return;if(r.ee===1){r.ee=0;return}if(r===n.U){let e=n.W;if(e.ee===1)e.ee=0,n.ee=1,n===this.Y?this.Y=n.te():n.te();else if(e.W&&e.W.ee===1){e.ee=n.ee,n.ee=0,e.W.ee=0,n===this.Y?this.Y=n.te():n.te();return}else e.U&&e.U.ee===1?(e.ee=1,e.U.ee=0,e.se()):(e.ee=1,r=n)}else{let e=n.U;if(e.ee===1)e.ee=0,n.ee=1,n===this.Y?this.Y=n.se():n.se();else if(e.U&&e.U.ee===1){e.ee=n.ee,n.ee=0,e.U.ee=0,n===this.Y?this.Y=n.se():n.se();return}else e.W&&e.W.ee===1?(e.ee=1,e.W.ee=0,e.te()):(e.ee=1,r=n)}}}fe(r){if(this.i===1)return this.clear(),this.h;let n=r;for(;n.U||n.W;){if(n.W)for(n=n.W;n.U;)n=n.U;else n=n.U;[r.u,n.u]=[n.u,r.u],[r.l,n.l]=[n.l,r.l],r=n}this.h.U===n?this.h.U=n.tt:this.h.W===n&&(this.h.W=n.tt),this.ue(n);let e=n.tt;return n===e.U?e.U=void 0:e.W=void 0,this.i-=1,this.Y.ee=0,e}oe(r,n){return r===void 0?!1:this.oe(r.U,n)||n(r)?!0:this.oe(r.W,n)}he(r){for(;;){let n=r.tt;if(n.ee===0)return;let e=n.tt;if(n===e.U){let i=e.W;if(i&&i.ee===1){if(i.ee=n.ee=0,e===this.Y)return;e.ee=1,r=e;continue}else if(r===n.W){if(r.ee=0,r.U&&(r.U.tt=n),r.W&&(r.W.tt=e),n.W=r.U,e.U=r.W,r.U=n,r.W=e,e===this.Y)this.Y=r,this.h.tt=r;else{let c=e.tt;c.U===e?c.U=r:c.W=r}return r.tt=e.tt,n.tt=r,e.tt=r,e.ee=1,{parentNode:n,grandParent:e,curNode:r}}else n.ee=0,e===this.Y?this.Y=e.se():e.se(),e.ee=1}else{let i=e.U;if(i&&i.ee===1){if(i.ee=n.ee=0,e===this.Y)return;e.ee=1,r=e;continue}else if(r===n.U){if(r.ee=0,r.U&&(r.U.tt=e),r.W&&(r.W.tt=n),e.W=r.U,n.U=r.W,r.U=e,r.W=n,e===this.Y)this.Y=r,this.h.tt=r;else{let c=e.tt;c.U===e?c.U=r:c.W=r}return r.tt=e.tt,n.tt=r,e.tt=r,e.ee=1,{parentNode:n,grandParent:e,curNode:r}}else n.ee=0,e===this.Y?this.Y=e.te():e.te(),e.ee=1}return}}ne(r,n,e){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,n),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let i,c=this.h.U,h=this.v(c.u,r);if(h===0){c.l=n;return}else if(h>0)c.U=new this.re(r,n),c.U.tt=c,i=c.U,this.h.U=i;else{let d=this.h.W,y=this.v(d.u,r);if(y===0){d.l=n;return}else if(y<0)d.W=new this.re(r,n),d.W.tt=d,i=d.W,this.h.W=i;else{if(e!==void 0){let b=e.o;if(b!==this.h){let S=this.v(b.u,r);if(S===0){b.l=n;return}else if(S>0){let w=b.L(),x=this.v(w.u,r);if(x===0){w.l=n;return}else x<0&&(i=new this.re(r,n),w.W===void 0?(w.W=i,i.tt=w):(b.U=i,i.tt=b))}}}if(i===void 0)for(i=this.Y;;){let b=this.v(i.u,r);if(b>0){if(i.U===void 0){i.U=new this.re(r,n),i.U.tt=i,i=i.U;break}i=i.U}else if(b<0){if(i.W===void 0){i.W=new this.re(r,n),i.W.tt=i,i=i.W;break}i=i.W}else{i.l=n;return}}}}return this.i+=1,i}I(r,n){for(;r;){let e=this.v(r.u,n);if(e<0)r=r.W;else if(e>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,n){let e=r.o;if(e===this.h&&(0,a.throwIteratorAccessError)(),this.i===1)return e.u=n,!0;if(e===this.h.U)return this.v(e.B().u,n)>0?(e.u=n,!0):!1;if(e===this.h.W)return this.v(e.L().u,n)<0?(e.u=n,!0):!1;let i=e.L().u;if(this.v(i,n)>=0)return!1;let c=e.B().u;return this.v(c,n)<=0?!1:(e.u=n,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n=0,e=this;return this.oe(this.Y,function(i){return r===n?(e.V(i),!0):(n+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let n=this.I(this.Y,r);return n===this.h?!1:(this.V(n),!0)}eraseElementByIterator(r){let n=r.o;n===this.h&&(0,a.throwIteratorAccessError)();let e=n.W===void 0;return r.iteratorType===0?e&&r.next():(!e||n.U===void 0)&&r.next(),this.V(n),r}forEach(r){let n=0;for(let e of this)r(e,n++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n,e=0;for(let i of this){if(e===r){n=i;break}e+=1}return n}getHeight(){if(this.i===0)return 0;let r=function(n){return n?Math.max(r(n.U),r(n.W))+1:0};return r(this.Y)}},t=u;o.default=t}),As=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=Nt(),s=Bt(),a=class extends l.ContainerIterator{constructor(t,r,n){super(n),this.o=t,this.h=r,this.iteratorType===0?(this.pre=function(){return this.o===this.h.U&&(0,s.throwIteratorAccessError)(),this.o=this.o.L(),this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.B(),this}):(this.pre=function(){return this.o===this.h.W&&(0,s.throwIteratorAccessError)(),this.o=this.o.B(),this},this.next=function(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o=this.o.L(),this})}get index(){let t=this.o,r=this.h.tt;if(t===this.h)return r?r.rt-1:0;let n=0;for(t.U&&(n+=t.U.rt);t!==r;){let e=t.tt;t===e.W&&(n+=1,e.U&&(n+=e.U.rt)),t=e}return n}},u=a;o.default=u}),oc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(xs()),s=u(As()),a=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class fu extends s.default{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o.u}copy(){return new fu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[],i,c){super(i,c);let h=this;e.forEach(function(d){h.insert(d)})}*K(e){e!==void 0&&(yield*this.K(e.U),yield e.u,yield*this.K(e.W))}begin(){return new t(this.h.U||this.h,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this.h.W||this.h,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(e,i){return this.M(e,void 0,i)}find(e){let i=this.I(this.Y,e);return new t(i,this.h,this)}lowerBound(e){let i=this.X(this.Y,e);return new t(i,this.h,this)}upperBound(e){let i=this.Z(this.Y,e);return new t(i,this.h,this)}reverseLowerBound(e){let i=this.$(this.Y,e);return new t(i,this.h,this)}reverseUpperBound(e){let i=this.rr(this.Y,e);return new t(i,this.h,this)}union(e){let i=this;return e.forEach(function(c){i.insert(c)}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=r;o.default=n}),sc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=u(xs()),s=u(As()),a=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class hu extends s.default{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let i=this;return new Proxy([],{get(c,h){if(h==="0")return i.o.u;if(h==="1")return i.o.l},set(c,h,d){if(h!=="1")throw new TypeError("props must be 1");return i.o.l=d,!0}})}copy(){return new hu(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.default{constructor(e=[],i,c){super(i,c);let h=this;e.forEach(function(d){h.setElement(d[0],d[1])})}*K(e){e!==void 0&&(yield*this.K(e.U),yield[e.u,e.l],yield*this.K(e.W))}begin(){return new t(this.h.U||this.h,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this.h.W||this.h,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){if(this.i===0)return;let e=this.h.U;return[e.u,e.l]}back(){if(this.i===0)return;let e=this.h.W;return[e.u,e.l]}lowerBound(e){let i=this.X(this.Y,e);return new t(i,this.h,this)}upperBound(e){let i=this.Z(this.Y,e);return new t(i,this.h,this)}reverseLowerBound(e){let i=this.$(this.Y,e);return new t(i,this.h,this)}reverseUpperBound(e){let i=this.rr(this.Y,e);return new t(i,this.h,this)}setElement(e,i,c){return this.M(e,i,c)}find(e){let i=this.I(this.Y,e);return new t(i,this.h,this)}getElementByKey(e){return this.I(this.Y,e).l}union(e){let i=this;return e.forEach(function(c){i.setElement(c[0],c[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}},n=r;o.default=n}),Is=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=l;function l(s){let a=typeof s;return a==="object"&&s!==null||a==="function"}}),ks=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.HashContainerIterator=o.HashContainer=void 0;var l=Nt(),s=u(Is()),a=Bt();function u(n){return n&&n.t?n:{default:n}}var t=class extends l.ContainerIterator{constructor(n,e,i){super(i),this.o=n,this.h=e,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,a.throwIteratorAccessError)(),this.o=this.o.L,this})}};o.HashContainerIterator=t;var r=class extends l.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(n){let{L:e,B:i}=n;e.B=i,i.L=e,n===this.p&&(this.p=i),n===this._&&(this._=e),this.i-=1}M(n,e,i){i===void 0&&(i=(0,s.default)(n));let c;if(i){let h=n[this.HASH_TAG];if(h!==void 0)return this.H[h].l=e,this.i;Object.defineProperty(n,this.HASH_TAG,{value:this.H.length,configurable:!0}),c={u:n,l:e,L:this._,B:this.h},this.H.push(c)}else{let h=this.g[n];if(h)return h.l=e,this.i;c={u:n,l:e,L:this._,B:this.h},this.g[n]=c}return this.i===0?(this.p=c,this.h.B=c):this._.B=c,this._=c,this.h.L=c,++this.i}I(n,e){if(e===void 0&&(e=(0,s.default)(n)),e){let i=n[this.HASH_TAG];return i===void 0?this.h:this.H[i]}else return this.g[n]||this.h}clear(){let n=this.HASH_TAG;this.H.forEach(function(e){delete e.u[n]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(n,e){let i;if(e===void 0&&(e=(0,s.default)(n)),e){let c=n[this.HASH_TAG];if(c===void 0)return!1;delete n[this.HASH_TAG],i=this.H[c],delete this.H[c]}else{if(i=this.g[n],i===void 0)return!1;delete this.g[n]}return this.V(i),!0}eraseElementByIterator(n){let e=n.o;return e===this.h&&(0,a.throwIteratorAccessError)(),this.V(e),n.next()}eraseElementByPos(n){if(n<0||n>this.i-1)throw new RangeError;let e=this.p;for(;n--;)e=e.B;return this.V(e),this.i}};o.HashContainer=r}),ac=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=ks(),s=Bt(),a=class pu extends l.HashContainerIterator{constructor(n,e,i,c){super(n,e,c),this.container=i}get pointer(){return this.o===this.h&&(0,s.throwIteratorAccessError)(),this.o.u}copy(){return new pu(this.o,this.h,this.container,this.iteratorType)}},u=class extends l.HashContainer{constructor(r=[]){super();let n=this;r.forEach(function(e){n.insert(e)})}begin(){return new a(this.p,this.h,this)}end(){return new a(this.h,this.h,this)}rBegin(){return new a(this._,this.h,this,1)}rEnd(){return new a(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(r,n){return this.M(r,void 0,n)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let n=this.p;for(;r--;)n=n.B;return n.u}find(r,n){let e=this.I(r,n);return new a(e,this.h,this)}forEach(r){let n=0,e=this.p;for(;e!==this.h;)r(e.u,n++,this),e=e.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}},t=u;o.default=t}),lc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),o.default=void 0;var l=ks(),s=u(Is()),a=Bt();function u(e){return e&&e.t?e:{default:e}}var t=class du extends l.HashContainerIterator{constructor(i,c,h,d){super(i,c,d),this.container=h}get pointer(){this.o===this.h&&(0,a.throwIteratorAccessError)();let i=this;return new Proxy([],{get(c,h){if(h==="0")return i.o.u;if(h==="1")return i.o.l},set(c,h,d){if(h!=="1")throw new TypeError("props must be 1");return i.o.l=d,!0}})}copy(){return new du(this.o,this.h,this.container,this.iteratorType)}},r=class extends l.HashContainer{constructor(e=[]){super();let i=this;e.forEach(function(c){i.setElement(c[0],c[1])})}begin(){return new t(this.p,this.h,this)}end(){return new t(this.h,this.h,this)}rBegin(){return new t(this._,this.h,this,1)}rEnd(){return new t(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(e,i,c){return this.M(e,i,c)}getElementByKey(e,i){if(i===void 0&&(i=(0,s.default)(e)),i){let h=e[this.HASH_TAG];return h!==void 0?this.H[h].l:void 0}let c=this.g[e];return c?c.l:void 0}getElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let i=this.p;for(;e--;)i=i.B;return[i.u,i.l]}find(e,i){let c=this.I(e,i);return new t(c,this.h,this)}forEach(e){let i=0,c=this.p;for(;c!==this.h;)e([c.u,c.l],i++,this),c=c.B}[Symbol.iterator](){return(function*(){let e=this.p;for(;e!==this.h;)yield[e.u,e.l],e=e.B}).bind(this)()}},n=r;o.default=n}),uc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"t",{value:!0}),Object.defineProperty(o,"Deque",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(o,"HashMap",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(o,"HashSet",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(o,"LinkList",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(o,"OrderedMap",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(o,"OrderedSet",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(o,"PriorityQueue",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(o,"Queue",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(o,"Stack",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(o,"Vector",{enumerable:!0,get:function(){return u.default}});var l=h(Xu()),s=h(Zu()),a=h(ec()),u=h(tc()),t=h(rc()),r=h(nc()),n=h(oc()),e=h(sc()),i=h(ac()),c=h(lc());function h(d){return d&&d.t?d:{default:d}}}),cc=we((o,l)=>{de(),ye(),ge();var s=uc().OrderedSet,a=Mt()("number-allocator:trace"),u=Mt()("number-allocator:error");function t(n,e){this.low=n,this.high=e}t.prototype.equals=function(n){return this.low===n.low&&this.high===n.high},t.prototype.compare=function(n){return this.low<n.low&&this.high<n.low?-1:n.low<this.low&&n.high<this.low?1:0};function r(n,e){if(!(this instanceof r))return new r(n,e);this.min=n,this.max=e,this.ss=new s([],(i,c)=>i.compare(c)),a("Create"),this.clear()}r.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},r.prototype.alloc=function(){if(this.ss.size()===0)return a("alloc():empty"),null;let n=this.ss.begin(),e=n.pointer.low,i=n.pointer.high,c=e;return c+1<=i?this.ss.updateKeyByIterator(n,new t(e+1,i)):this.ss.eraseElementByPos(0),a("alloc():"+c),c},r.prototype.use=function(n){let e=new t(n,n),i=this.ss.lowerBound(e);if(!i.equals(this.ss.end())){let c=i.pointer.low,h=i.pointer.high;return i.pointer.equals(e)?(this.ss.eraseElementByIterator(i),a("use():"+n),!0):c>n?!1:c===n?(this.ss.updateKeyByIterator(i,new t(c+1,h)),a("use():"+n),!0):h===n?(this.ss.updateKeyByIterator(i,new t(c,h-1)),a("use():"+n),!0):(this.ss.updateKeyByIterator(i,new t(n+1,h)),this.ss.insert(new t(c,n-1)),a("use():"+n),!0)}return a("use():failed"),!1},r.prototype.free=function(n){if(n<this.min||n>this.max){u("free():"+n+" is out of range");return}let e=new t(n,n),i=this.ss.upperBound(e);if(i.equals(this.ss.end())){if(i.equals(this.ss.begin())){this.ss.insert(e);return}i.pre();let c=i.pointer.high;i.pointer.high+1===n?this.ss.updateKeyByIterator(i,new t(c,n)):this.ss.insert(e)}else if(i.equals(this.ss.begin()))if(n+1===i.pointer.low){let c=i.pointer.high;this.ss.updateKeyByIterator(i,new t(n,c))}else this.ss.insert(e);else{let c=i.pointer.low,h=i.pointer.high;i.pre();let d=i.pointer.low;i.pointer.high+1===n?n+1===c?(this.ss.eraseElementByIterator(i),this.ss.updateKeyByIterator(i,new t(d,h))):this.ss.updateKeyByIterator(i,new t(d,n)):n+1===c?(this.ss.eraseElementByIterator(i.next()),this.ss.insert(new t(n,h))):this.ss.insert(e)}a("free():"+n)},r.prototype.clear=function(){a("clear()"),this.ss.clear(),this.ss.insert(new t(this.min,this.max))},r.prototype.intervalCount=function(){return this.ss.size()},r.prototype.dump=function(){console.log("length:"+this.ss.size());for(let n of this.ss)console.log(n)},l.exports=r}),Os=we((o,l)=>{de(),ye(),ge();var s=cc();l.exports.NumberAllocator=s}),fc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Ju(),s=Os(),a=class{constructor(u){Pe(this,"aliasToTopic");Pe(this,"topicToAlias");Pe(this,"max");Pe(this,"numberAllocator");Pe(this,"length");u>0&&(this.aliasToTopic=new l.LRUCache({max:u}),this.topicToAlias={},this.numberAllocator=new s.NumberAllocator(1,u),this.max=u,this.length=0)}put(u,t){if(t===0||t>this.max)return!1;let r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,u),this.topicToAlias[u]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(u){return this.aliasToTopic.get(u)}getAliasByTopic(u){let t=this.topicToAlias[u];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]}};o.default=a}),hc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(o,"__esModule",{value:!0});var s=Tr(),a=l(fc()),u=ar(),t=(r,n)=>{r.log("_handleConnack");let{options:e}=r,i=e.protocolVersion===5?n.reasonCode:n.returnCode;if(clearTimeout(r.connackTimer),delete r.topicAliasSend,n.properties){if(n.properties.topicAliasMaximum){if(n.properties.topicAliasMaximum>65535){r.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}n.properties.topicAliasMaximum>0&&(r.topicAliasSend=new a.default(n.properties.topicAliasMaximum))}n.properties.serverKeepAlive&&e.keepalive&&(e.keepalive=n.properties.serverKeepAlive),n.properties.maximumPacketSize&&(e.properties||(e.properties={}),e.properties.maximumPacketSize=n.properties.maximumPacketSize)}if(i===0)r.reconnecting=!1,r._onConnect(n);else if(i>0){let c=new u.ErrorWithReasonCode(`Connection refused: ${s.ReasonCodes[i]}`,i);r.emit("error",c),r.options.reconnectOnConnackError&&r._cleanUp(!0)}};o.default=t}),pc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(s,a,u)=>{s.log("handling pubrel packet");let t=typeof u<"u"?u:s.noop,{messageId:r}=a,n={cmd:"pubcomp",messageId:r};s.incomingStore.get(a,(e,i)=>{e?s._sendPacket(n,t):(s.emit("message",i.topic,i.payload,i),s.handleMessage(i,c=>{if(c)return t(c);s.incomingStore.del(i,s.noop),s._sendPacket(n,t)}))})};o.default=l}),dc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(o,"__esModule",{value:!0});var s=l(Gu()),a=l(Qu()),u=l(hc()),t=l(Tr()),r=l(pc()),n=(e,i,c)=>{let{options:h}=e;if(h.protocolVersion===5&&h.properties&&h.properties.maximumPacketSize&&h.properties.maximumPacketSize<i.length)return e.emit("error",new Error(`exceeding packets size ${i.cmd}`)),e.end({reasonCode:149,properties:{reasonString:"Maximum packet size was exceeded"}}),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",i),i.cmd){case"publish":(0,s.default)(e,i,c);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing(),(0,t.default)(e,i),c();break;case"pubrel":e.reschedulePing(),(0,r.default)(e,i,c);break;case"connack":(0,u.default)(e,i),c();break;case"auth":e.reschedulePing(),(0,a.default)(e,i),c();break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),c();break;case"disconnect":e.emit("disconnect",i),c();break;default:e.log("_handlePacket :: unknown command"),c();break}};o.default=n}),Ts=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=class{constructor(){Pe(this,"nextId");this.nextId=Math.max(1,Math.floor(Math.random()*65535))}allocate(){let s=this.nextId++;return this.nextId===65536&&(this.nextId=1),s}getLastAllocated(){return this.nextId===1?65535:this.nextId-1}register(s){return!0}deallocate(s){}clear(){}};o.default=l}),gc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=class{constructor(s){Pe(this,"aliasToTopic");Pe(this,"max");Pe(this,"length");this.aliasToTopic={},this.max=s}put(s,a){return a===0||a>this.max?!1:(this.aliasToTopic[a]=s,this.length=Object.keys(this.aliasToTopic).length,!0)}getTopicByAlias(s){return this.aliasToTopic[s]}clear(){this.aliasToTopic={}}};o.default=l}),yc=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(o,"__esModule",{value:!0}),o.TypedEventEmitter=void 0;var s=l((Qt(),tt(Ft))),a=ar(),u=class{};o.TypedEventEmitter=u,(0,a.applyMixin)(u,s.default)}),Pr=we((o,l)=>{de(),ye(),ge();function s(a){"@babel/helpers - typeof";return l.exports=s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},l.exports.__esModule=!0,l.exports.default=l.exports,s(a)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),mc=we((o,l)=>{de(),ye(),ge();var s=Pr().default;function a(u,t){if(s(u)!="object"||!u)return u;var r=u[Symbol.toPrimitive];if(r!==void 0){var n=r.call(u,t||"default");if(s(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(u)}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),bc=we((o,l)=>{de(),ye(),ge();var s=Pr().default,a=mc();function u(t){var r=a(t,"string");return s(r)=="symbol"?r:r+""}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),vc=we((o,l)=>{de(),ye(),ge();var s=bc();function a(u,t,r){return(t=s(t))in u?Object.defineProperty(u,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):u[t]=r,u}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),wc=we((o,l)=>{de(),ye(),ge();function s(a){if(Array.isArray(a))return a}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),_c=we((o,l)=>{de(),ye(),ge();function s(a,u){var t=a==null?null:typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(t!=null){var r,n,e,i,c=[],h=!0,d=!1;try{if(e=(t=t.call(a)).next,u===0){if(Object(t)!==t)return;h=!1}else for(;!(h=(r=e.call(t)).done)&&(c.push(r.value),c.length!==u);h=!0);}catch(y){d=!0,n=y}finally{try{if(!h&&t.return!=null&&(i=t.return(),Object(i)!==i))return}finally{if(d)throw n}}return c}}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Sc=we((o,l)=>{de(),ye(),ge();function s(a,u){(u==null||u>a.length)&&(u=a.length);for(var t=0,r=Array(u);t<u;t++)r[t]=a[t];return r}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Ec=we((o,l)=>{de(),ye(),ge();var s=Sc();function a(u,t){if(u){if(typeof u=="string")return s(u,t);var r={}.toString.call(u).slice(8,-1);return r==="Object"&&u.constructor&&(r=u.constructor.name),r==="Map"||r==="Set"?Array.from(u):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(u,t):void 0}}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),xc=we((o,l)=>{de(),ye(),ge();function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
32
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Ac=we((o,l)=>{de(),ye(),ge();var s=wc(),a=_c(),u=Ec(),t=xc();function r(n,e){return s(n)||a(n,e)||u(n,e)||t()}l.exports=r,l.exports.__esModule=!0,l.exports.default=l.exports}),Ps=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o):typeof define=="function"&&define.amd?define(["exports"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.fastUniqueNumbers={}))}(o,function(s){var a=function(y){return function(b){var S=y(b);return b.add(S),S}},u=function(y){return function(b,S){return y.set(b,S),S}},t=Number.MAX_SAFE_INTEGER===void 0?9007199254740991:Number.MAX_SAFE_INTEGER,r=536870912,n=r*2,e=function(y,b){return function(S){var w=b.get(S),x=w===void 0?S.size:w<n?w+1:0;if(!S.has(x))return y(S,x);if(S.size<r){for(;S.has(x);)x=Math.floor(Math.random()*n);return y(S,x)}if(S.size>t)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;S.has(x);)x=Math.floor(Math.random()*t);return y(S,x)}},i=new WeakMap,c=u(i),h=e(c,i),d=a(h);s.addUniqueNumber=d,s.generateUniqueNumber=h})}),Ic=we((o,l)=>{de(),ye(),ge();function s(u,t,r,n,e,i,c){try{var h=u[i](c),d=h.value}catch(y){return void r(y)}h.done?t(d):Promise.resolve(d).then(n,e)}function a(u){return function(){var t=this,r=arguments;return new Promise(function(n,e){var i=u.apply(t,r);function c(d){s(i,n,e,c,h,"next",d)}function h(d){s(i,n,e,c,h,"throw",d)}c(void 0)})}}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Cs=we((o,l)=>{de(),ye(),ge();function s(a,u){this.v=a,this.k=u}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),js=we((o,l)=>{de(),ye(),ge();function s(a,u,t,r){var n=Object.defineProperty;try{n({},"",{})}catch{n=0}l.exports=s=function(e,i,c,h){function d(y,b){s(e,y,function(S){return this._invoke(y,b,S)})}i?n?n(e,i,{value:c,enumerable:!h,configurable:!h,writable:!h}):e[i]=c:(d("next",0),d("throw",1),d("return",2))},l.exports.__esModule=!0,l.exports.default=l.exports,s(a,u,t,r)}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Rs=we((o,l)=>{de(),ye(),ge();var s=js();function a(){var u,t,r=typeof Symbol=="function"?Symbol:{},n=r.iterator||"@@iterator",e=r.toStringTag||"@@toStringTag";function i(x,g,_,E){var v=g&&g.prototype instanceof h?g:h,C=Object.create(v.prototype);return s(C,"_invoke",function(P,I,T){var k,W,A,M=0,q=T||[],N=!1,le={p:0,n:0,v:u,a:re,f:re.bind(u,4),d:function(ee,ue){return k=ee,W=0,A=u,le.n=ue,c}};function re(ee,ue){for(W=ee,A=ue,t=0;!N&&M&&!G&&t<q.length;t++){var G,oe=q[t],R=le.p,Q=oe[2];ee>3?(G=Q===ue)&&(A=oe[(W=oe[4])?5:(W=3,3)],oe[4]=oe[5]=u):oe[0]<=R&&((G=ee<2&&R<oe[1])?(W=0,le.v=ue,le.n=oe[1]):R<Q&&(G=ee<3||oe[0]>ue||ue>Q)&&(oe[4]=ee,oe[5]=ue,le.n=Q,W=0))}if(G||ee>1)return c;throw N=!0,ue}return function(ee,ue,G){if(M>1)throw TypeError("Generator is already running");for(N&&ue===1&&re(ue,G),W=ue,A=G;(t=W<2?u:A)||!N;){k||(W?W<3?(W>1&&(le.n=-1),re(W,A)):le.n=A:le.v=A);try{if(M=2,k){if(W||(ee="next"),t=k[ee]){if(!(t=t.call(k,A)))throw TypeError("iterator result is not an object");if(!t.done)return t;A=t.value,W<2&&(W=0)}else W===1&&(t=k.return)&&t.call(k),W<2&&(A=TypeError("The iterator does not provide a '"+ee+"' method"),W=1);k=u}else if((t=(N=le.n<0)?A:P.call(I,le))!==c)break}catch(oe){k=u,W=1,A=oe}finally{M=1}}return{value:t,done:N}}}(x,_,E),!0),C}var c={};function h(){}function d(){}function y(){}t=Object.getPrototypeOf;var b=[][n]?t(t([][n]())):(s(t={},n,function(){return this}),t),S=y.prototype=h.prototype=Object.create(b);function w(x){return Object.setPrototypeOf?Object.setPrototypeOf(x,y):(x.__proto__=y,s(x,e,"GeneratorFunction")),x.prototype=Object.create(S),x}return d.prototype=y,s(S,"constructor",y),s(y,"constructor",d),d.displayName="GeneratorFunction",s(y,e,"GeneratorFunction"),s(S),s(S,e,"Generator"),s(S,n,function(){return this}),s(S,"toString",function(){return"[object Generator]"}),(l.exports=a=function(){return{w:i,m:w}},l.exports.__esModule=!0,l.exports.default=l.exports)()}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Ms=we((o,l)=>{de(),ye(),ge();var s=Cs(),a=js();function u(t,r){function n(i,c,h,d){try{var y=t[i](c),b=y.value;return b instanceof s?r.resolve(b.v).then(function(S){n("next",S,h,d)},function(S){n("throw",S,h,d)}):r.resolve(b).then(function(S){y.value=S,h(y)},function(S){return n("throw",S,h,d)})}catch(S){d(S)}}var e;this.next||(a(u.prototype),a(u.prototype,typeof Symbol=="function"&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),a(this,"_invoke",function(i,c,h){function d(){return new r(function(y,b){n(i,h,y,b)})}return e=e?e.then(d,d):d()},!0)}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),Ns=we((o,l)=>{de(),ye(),ge();var s=Rs(),a=Ms();function u(t,r,n,e,i){return new a(s().w(t,r,n,e),i||Promise)}l.exports=u,l.exports.__esModule=!0,l.exports.default=l.exports}),kc=we((o,l)=>{de(),ye(),ge();var s=Ns();function a(u,t,r,n,e){var i=s(u,t,r,n,e);return i.next().then(function(c){return c.done?c.value:i.next()})}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Oc=we((o,l)=>{de(),ye(),ge();function s(a){var u=Object(a),t=[];for(var r in u)t.unshift(r);return function n(){for(;t.length;)if((r=t.pop())in u)return n.value=r,n.done=!1,n;return n.done=!0,n}}l.exports=s,l.exports.__esModule=!0,l.exports.default=l.exports}),Tc=we((o,l)=>{de(),ye(),ge();var s=Pr().default;function a(u){if(u!=null){var t=u[typeof Symbol=="function"&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(u);if(typeof u.next=="function")return u;if(!isNaN(u.length))return{next:function(){return u&&r>=u.length&&(u=void 0),{value:u&&u[r++],done:!u}}}}throw new TypeError(s(u)+" is not iterable")}l.exports=a,l.exports.__esModule=!0,l.exports.default=l.exports}),Pc=we((o,l)=>{de(),ye(),ge();var s=Cs(),a=Rs(),u=kc(),t=Ns(),r=Ms(),n=Oc(),e=Tc();function i(){var c=a(),h=c.m(i),d=(Object.getPrototypeOf?Object.getPrototypeOf(h):h.__proto__).constructor;function y(w){var x=typeof w=="function"&&w.constructor;return!!x&&(x===d||(x.displayName||x.name)==="GeneratorFunction")}var b={throw:1,return:2,break:3,continue:3};function S(w){var x,g;return function(_){x||(x={stop:function(){return g(_.a,2)},catch:function(){return _.v},abrupt:function(E,v){return g(_.a,b[E],v)},delegateYield:function(E,v,C){return x.resultName=v,g(_.d,e(E),C)},finish:function(E){return g(_.f,E)}},g=function(E,v,C){_.p=x.prev,_.n=x.next;try{return E(v,C)}finally{x.next=_.n}}),x.resultName&&(x[x.resultName]=_.v,x.resultName=void 0),x.sent=_.v,x.next=_.n;try{return w.call(this,x)}finally{_.p=x.prev,_.n=x.next}}}return(l.exports=i=function(){return{wrap:function(w,x,g,_){return c.w(S(w),x,g,_&&_.reverse())},isGeneratorFunction:y,mark:c.m,awrap:function(w,x){return new s(w,x)},AsyncIterator:r,async:function(w,x,g,_,E){return(y(x)?t:u)(S(w),x,g,_,E)},keys:n,values:e}},l.exports.__esModule=!0,l.exports.default=l.exports)()}l.exports=i,l.exports.__esModule=!0,l.exports.default=l.exports}),Cc=we((o,l)=>{de(),ye(),ge();var s=Pc()();l.exports=s;try{regeneratorRuntime=s}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=s:Function("r","regeneratorRuntime = r")(s)}}),jc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,vc(),Ac(),Ps(),Ic(),Cc()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/defineProperty","@babel/runtime/helpers/slicedToArray","fast-unique-numbers","@babel/runtime/helpers/asyncToGenerator","@babel/runtime/regenerator"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.brokerFactory={},s._defineProperty,s._slicedToArray,s.fastUniqueNumbers,s._asyncToGenerator,s._regeneratorRuntime))}(o,function(s,a,u,t,r,n){var e=function(g){return typeof g.start=="function"},i=new WeakMap;function c(g,_){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);_&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(g,C).enumerable})),E.push.apply(E,v)}return E}function h(g){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};_%2?c(Object(E),!0).forEach(function(v){a(g,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):c(Object(E)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(E,v))})}return g}var d=function(g){return h(h({},g),{},{connect:function(_){var E=_.call;return r(n.mark(function v(){var C,P,I,T;return n.wrap(function(k){for(;;)switch(k.prev=k.next){case 0:return C=new MessageChannel,P=C.port1,I=C.port2,k.next=1,E("connect",{port:P},[P]);case 1:return T=k.sent,i.set(I,T),k.abrupt("return",I);case 2:case"end":return k.stop()}},v)}))},disconnect:function(_){var E=_.call;return function(){var v=r(n.mark(function C(P){var I;return n.wrap(function(T){for(;;)switch(T.prev=T.next){case 0:if(I=i.get(P),I!==void 0){T.next=1;break}throw new Error("The given port is not connected.");case 1:return T.next=2,E("disconnect",{portId:I});case 2:case"end":return T.stop()}},C)}));return function(C){return v.apply(this,arguments)}}()},isSupported:function(_){var E=_.call;return function(){return E("isSupported")}}})};function y(g,_){var E=Object.keys(g);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(g);_&&(v=v.filter(function(C){return Object.getOwnPropertyDescriptor(g,C).enumerable})),E.push.apply(E,v)}return E}function b(g){for(var _=1;_<arguments.length;_++){var E=arguments[_]!=null?arguments[_]:{};_%2?y(Object(E),!0).forEach(function(v){a(g,v,E[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(g,Object.getOwnPropertyDescriptors(E)):y(Object(E)).forEach(function(v){Object.defineProperty(g,v,Object.getOwnPropertyDescriptor(E,v))})}return g}var S=new WeakMap,w=function(g){if(S.has(g))return S.get(g);var _=new Map;return S.set(g,_),_},x=function(g){var _=d(g);return function(E){var v=w(E);E.addEventListener("message",function(q){var N=q.data,le=N.id;if(le!==null&&v.has(le)){var re=v.get(le),ee=re.reject,ue=re.resolve;v.delete(le),N.error===void 0?ue(N.result):ee(new Error(N.error.message))}}),e(E)&&E.start();for(var C=function(q){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return new Promise(function(re,ee){var ue=t.generateUniqueNumber(v);v.set(ue,{reject:ee,resolve:re}),N===null?E.postMessage({id:ue,method:q},le):E.postMessage({id:ue,method:q,params:N},le)})},P=function(q,N){var le=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];E.postMessage({id:null,method:q,params:N},le)},I={},T=0,k=Object.entries(_);T<k.length;T++){var W=u(k[T],2),A=W[0],M=W[1];I=b(b({},I),{},a({},A,M({call:C,notify:P})))}return b({},I)}};s.createBroker=x})}),Rc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,Pr(),jc(),Ps()):typeof define=="function"&&define.amd?define(["exports","@babel/runtime/helpers/typeof","broker-factory","fast-unique-numbers"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.workerTimersBroker={},s._typeof,s.brokerFactory,s.fastUniqueNumbers))}(o,function(s,a,u,t){var r=new Map([[0,null]]),n=new Map([[0,null]]),e=u.createBroker({clearInterval:function(c){var h=c.call;return function(d){a(r.get(d))==="symbol"&&(r.set(d,null),h("clear",{timerId:d,timerType:"interval"}).then(function(){r.delete(d)}))}},clearTimeout:function(c){var h=c.call;return function(d){a(n.get(d))==="symbol"&&(n.set(d,null),h("clear",{timerId:d,timerType:"timeout"}).then(function(){n.delete(d)}))}},setInterval:function(c){var h=c.call;return function(d){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=arguments.length,S=new Array(b>2?b-2:0),w=2;w<b;w++)S[w-2]=arguments[w];var x=Symbol(),g=t.generateUniqueNumber(r);r.set(g,x);var _=function(){return h("set",{delay:y,now:performance.timeOrigin+performance.now(),timerId:g,timerType:"interval"}).then(function(){var E=r.get(g);if(E===void 0)throw new Error("The timer is in an undefined state.");E===x&&(d.apply(void 0,S),r.get(g)===x&&_())})};return _(),g}},setTimeout:function(c){var h=c.call;return function(d){for(var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,b=arguments.length,S=new Array(b>2?b-2:0),w=2;w<b;w++)S[w-2]=arguments[w];var x=Symbol(),g=t.generateUniqueNumber(n);return n.set(g,x),h("set",{delay:y,now:performance.timeOrigin+performance.now(),timerId:g,timerType:"timeout"}).then(function(){var _=n.get(g);if(_===void 0)throw new Error("The timer is in an undefined state.");_===x&&(n.delete(g),d.apply(void 0,S))}),g}}}),i=function(c){var h=new Worker(c);return e(h)};s.load=i,s.wrap=e})}),Mc=we((o,l)=>{de(),ye(),ge(),function(s,a){typeof o=="object"&&typeof l<"u"?a(o,Rc()):typeof define=="function"&&define.amd?define(["exports","worker-timers-broker"],a):(s=typeof globalThis<"u"?globalThis:s||self,a(s.workerTimers={},s.workerTimersBroker))}(o,function(s,a){var u=function(h,d){var y=null;return function(){if(y!==null)return y;var b=new Blob([d],{type:"application/javascript; charset=utf-8"}),S=URL.createObjectURL(b);return y=h(S),setTimeout(function(){return URL.revokeObjectURL(S)}),y}},t=`(()=>{var e={45:(e,t,r)=>{var n=r(738).default;e.exports=function(e,t){if("object"!=n(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var o=r.call(e,t||"default");if("object"!=n(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},79:e=>{e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},122:(e,t,r)=>{var n=r(79);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},156:e=>{e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,u,a,i=[],s=!0,c=!1;try{if(u=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=u.call(r)).done)&&(i.push(n.value),i.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return i}},e.exports.__esModule=!0,e.exports.default=e.exports},172:e=>{e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},293:e=>{function t(e,t,r,n,o,u,a){try{var i=e[u](a),s=i.value}catch(e){return void r(e)}i.done?t(s):Promise.resolve(s).then(n,o)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(o,u){var a=e.apply(r,n);function i(e){t(a,o,u,i,s,"next",e)}function s(e){t(a,o,u,i,s,"throw",e)}i(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},373:e=>{e.exports=function(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}},e.exports.__esModule=!0,e.exports.default=e.exports},389:function(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,u=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<u?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*u);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,s=r(i),c=a(s,i),f=t(c);e.addUniqueNumber=f,e.generateUniqueNumber=c}(t)},472:function(e,t,r){!function(e,t,r,n){"use strict";var o=function(e,t){return function(r){var o=t.get(r);if(void 0===o)return Promise.resolve(!1);var u=n(o,2),a=u[0],i=u[1];return e(a),t.delete(r),i(!1),Promise.resolve(!0)}},u=function(e,t){var r=function(n,o,u,a){var i=n-e.now();i>0?o.set(a,[t(r,i,n,o,u,a),u]):(o.delete(a),u(!0))};return r},a=function(e,t,r,n){return function(o,u,a){var i=o+u-t.timeOrigin,s=i-t.now();return new Promise((function(t){e.set(a,[r(n,s,i,e,t,a),t])}))}},i=new Map,s=o(globalThis.clearTimeout,i),c=new Map,f=o(globalThis.clearTimeout,c),l=u(performance,globalThis.setTimeout),p=a(i,performance,globalThis.setTimeout,l),d=a(c,performance,globalThis.setTimeout,l);r.createWorker(self,{clear:function(){var r=e(t.mark((function e(r){var n,o,u;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.timerId,o=r.timerType,e.next=1,"interval"===o?s(n):f(n);case 1:return u=e.sent,e.abrupt("return",{result:u});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}(),set:function(){var r=e(t.mark((function e(r){var n,o,u,a,i;return t.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=r.delay,o=r.now,u=r.timerId,a=r.timerType,e.next=1,("interval"===a?p:d)(n,o,u);case 1:return i=e.sent,e.abrupt("return",{result:i});case 2:case"end":return e.stop()}}),e)})));function n(e){return r.apply(this,arguments)}return n}()})}(r(293),r(756),r(623),r(715))},546:e=>{function t(r,n,o,u){var a=Object.defineProperty;try{a({},"",{})}catch(r){a=0}e.exports=t=function(e,r,n,o){if(r)a?a(e,r,{value:n,enumerable:!o,configurable:!o,writable:!o}):e[r]=n;else{var u=function(r,n){t(e,r,(function(e){return this._invoke(r,n,e)}))};u("next",0),u("throw",1),u("return",2)}},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n,o,u)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},579:(e,t,r)=>{var n=r(738).default;e.exports=function(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(n(e)+" is not iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},623:function(e,t,r){!function(e,t,r,n,o){"use strict";var u={INTERNAL_ERROR:-32603,INVALID_PARAMS:-32602,METHOD_NOT_FOUND:-32601},a=function(e,t){return Object.assign(new Error(e),{status:t})},i=function(e){return a('The requested method called "'.concat(e,'" is not supported.'),u.METHOD_NOT_FOUND)},s=function(e){return a('The handler of the method called "'.concat(e,'" returned no required result.'),u.INTERNAL_ERROR)},c=function(e){return a('The handler of the method called "'.concat(e,'" returned an unexpected result.'),u.INTERNAL_ERROR)},f=function(e){return a('The specified parameter called "portId" with the given value "'.concat(e,'" does not identify a port connected to this worker.'),u.INVALID_PARAMS)},l=function(e,n){return function(){var o=t(r.mark((function t(o){var u,a,f,l,p,d,v,x,y,b,h,m,_,g,w;return r.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(u=o.data,a=u.id,f=u.method,l=u.params,p=n[f],t.prev=1,void 0!==p){t.next=2;break}throw i(f);case 2:if(void 0!==(d=void 0===l?p():p(l))){t.next=3;break}throw s(f);case 3:if(!(d instanceof Promise)){t.next=5;break}return t.next=4,d;case 4:g=t.sent,t.next=6;break;case 5:g=d;case 6:if(v=g,null!==a){t.next=8;break}if(void 0===v.result){t.next=7;break}throw c(f);case 7:t.next=10;break;case 8:if(void 0!==v.result){t.next=9;break}throw c(f);case 9:x=v.result,y=v.transferables,b=void 0===y?[]:y,e.postMessage({id:a,result:x},b);case 10:t.next=12;break;case 11:t.prev=11,w=t.catch(1),h=w.message,m=w.status,_=void 0===m?-32603:m,e.postMessage({error:{code:_,message:h},id:a});case 12:case"end":return t.stop()}}),t,null,[[1,11]])})));return function(e){return o.apply(this,arguments)}}()},p=function(){return new Promise((function(e){var t=new ArrayBuffer(0),r=new MessageChannel,n=r.port1,o=r.port2;n.onmessage=function(t){var r=t.data;return e(null!==r)},o.postMessage(t,[t])}))};function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function v(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var x=new Map,y=function(e,n,u){return v(v({},n),{},{connect:function(t){var r=t.port;r.start();var u=e(r,n),a=o.generateUniqueNumber(x);return x.set(a,(function(){u(),r.close(),x.delete(a)})),{result:a}},disconnect:function(e){var t=e.portId,r=x.get(t);if(void 0===r)throw f(t);return r(),{result:null}},isSupported:function(){var e=t(r.mark((function e(){var t,n,o;return r.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,p();case 1:if(!e.sent){e.next=5;break}if(!((t=u())instanceof Promise)){e.next=3;break}return e.next=2,t;case 2:o=e.sent,e.next=4;break;case 3:o=t;case 4:return n=o,e.abrupt("return",{result:n});case 5:return e.abrupt("return",{result:!1});case 6:case"end":return e.stop()}}),e)})));function n(){return e.apply(this,arguments)}return n}()})},b=function(e,t){var r=y(b,t,arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0}),n=l(e,r);return e.addEventListener("message",n),function(){return e.removeEventListener("message",n)}};e.createWorker=b,e.isSupported=p}(t,r(293),r(756),r(693),r(389))},633:(e,t,r)=>{var n=r(172),o=r(993),u=r(869),a=r(887),i=r(791),s=r(373),c=r(579);function f(){"use strict";var t=o(),r=t.m(f),l=(Object.getPrototypeOf?Object.getPrototypeOf(r):r.__proto__).constructor;function p(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))}var d={throw:1,return:2,break:3,continue:3};function v(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,d[e],t)},delegateYield:function(e,o,u){return t.resultName=o,r(n.d,c(e),u)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(e.exports=f=function(){return{wrap:function(e,r,n,o){return t.w(v(e),r,n,o&&o.reverse())},isGeneratorFunction:p,mark:t.m,awrap:function(e,t){return new n(e,t)},AsyncIterator:i,async:function(e,t,r,n,o){return(p(t)?a:u)(v(e),t,r,n,o)},keys:s,values:c}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=f,e.exports.__esModule=!0,e.exports.default=e.exports},693:(e,t,r)=>{var n=r(736);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},715:(e,t,r)=>{var n=r(987),o=r(156),u=r(122),a=r(752);e.exports=function(e,t){return n(e)||o(e,t)||u(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},736:(e,t,r)=>{var n=r(738).default,o=r(45);e.exports=function(e){var t=o(e,"string");return"symbol"==n(t)?t:t+""},e.exports.__esModule=!0,e.exports.default=e.exports},738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},752:e=>{e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},756:(e,t,r)=>{var n=r(633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},791:(e,t,r)=>{var n=r(172),o=r(546);e.exports=function e(t,r){function u(e,o,a,i){try{var s=t[e](o),c=s.value;return c instanceof n?r.resolve(c.v).then((function(e){u("next",e,a,i)}),(function(e){u("throw",e,a,i)})):r.resolve(c).then((function(e){s.value=e,a(s)}),(function(e){return u("throw",e,a,i)}))}catch(e){i(e)}}var a;this.next||(o(e.prototype),o(e.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",(function(){return this}))),o(this,"_invoke",(function(e,t,n){function o(){return new r((function(t,r){u(e,n,t,r)}))}return a=a?a.then(o,o):o()}),!0)},e.exports.__esModule=!0,e.exports.default=e.exports},869:(e,t,r)=>{var n=r(887);e.exports=function(e,t,r,o,u){var a=n(e,t,r,o,u);return a.next().then((function(e){return e.done?e.value:a.next()}))},e.exports.__esModule=!0,e.exports.default=e.exports},887:(e,t,r)=>{var n=r(993),o=r(791);e.exports=function(e,t,r,u,a){return new o(n().w(e,t,r,u),a||Promise)},e.exports.__esModule=!0,e.exports.default=e.exports},987:e=>{e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},993:(e,t,r)=>{var n=r(546);function o(){var t,r,u="function"==typeof Symbol?Symbol:{},a=u.iterator||"@@iterator",i=u.toStringTag||"@@toStringTag";function s(e,o,u,a){var i=o&&o.prototype instanceof f?o:f,s=Object.create(i.prototype);return n(s,"_invoke",function(e,n,o){var u,a,i,s=0,f=o||[],l=!1,p={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return u=e,a=0,i=t,p.n=r,c}};function d(e,n){for(a=e,i=n,r=0;!l&&s&&!o&&r<f.length;r++){var o,u=f[r],d=p.p,v=u[2];e>3?(o=v===n)&&(i=u[(a=u[4])?5:(a=3,3)],u[4]=u[5]=t):u[0]<=d&&((o=e<2&&d<u[1])?(a=0,p.v=n,p.n=u[1]):d<v&&(o=e<3||u[0]>n||n>v)&&(u[4]=e,u[5]=n,p.n=v,a=0))}if(o||e>1)return c;throw l=!0,n}return function(o,f,v){if(s>1)throw TypeError("Generator is already running");for(l&&1===f&&d(f,v),a=f,i=v;(r=a<2?t:i)||!l;){u||(a?a<3?(a>1&&(p.n=-1),d(a,i)):p.n=i:p.v=i);try{if(s=2,u){if(a||(o="next"),r=u[o]){if(!(r=r.call(u,i)))throw TypeError("iterator result is not an object");if(!r.done)return r;i=r.value,a<2&&(a=0)}else 1===a&&(r=u.return)&&r.call(u),a<2&&(i=TypeError("The iterator does not provide a '"+o+"' method"),a=1);u=t}else if((r=(l=p.n<0)?i:e.call(n,p))!==c)break}catch(e){u=t,a=1,i=e}finally{s=1}}return{value:r,done:l}}}(e,u,a),!0),s}var c={};function f(){}function l(){}function p(){}r=Object.getPrototypeOf;var d=[][a]?r(r([][a]())):(n(r={},a,(function(){return this})),r),v=p.prototype=f.prototype=Object.create(d);function x(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,n(e,i,"GeneratorFunction")),e.prototype=Object.create(v),e}return l.prototype=p,n(v,"constructor",p),n(p,"constructor",l),l.displayName="GeneratorFunction",n(p,i,"GeneratorFunction"),n(v),n(v,i,"Generator"),n(v,a,(function(){return this})),n(v,"toString",(function(){return"[object Generator]"})),(e.exports=o=function(){return{w:s,m:x}},e.exports.__esModule=!0,e.exports.default=e.exports)()}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var u=t[n]={exports:{}};return e[n].call(u.exports,u,u.exports,r),u.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";r(472)})()})();`,r=u(a.load,t),n=function(h){return r().clearInterval(h)},e=function(h){return r().clearTimeout(h)},i=function(){var h;return(h=r()).setInterval.apply(h,arguments)},c=function(){var h;return(h=r()).setTimeout.apply(h,arguments)};s.clearInterval=n,s.clearTimeout=e,s.setInterval=i,s.setTimeout=c})}),Cr=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.isReactNativeBrowser=o.isWebWorker=void 0;var l=()=>{var t;return typeof window<"u"?typeof navigator<"u"&&((t=navigator.userAgent)==null?void 0:t.toLowerCase().indexOf(" electron/"))>-1&&(Je!=null&&Je.versions)?!Object.prototype.hasOwnProperty.call(Je.versions,"electron"):typeof window.document<"u":!1},s=()=>{var t,r;return!!(typeof self=="object"&&((r=(t=self==null?void 0:self.constructor)==null?void 0:t.name)!=null&&r.includes("WorkerGlobalScope"))&&typeof Deno>"u")},a=()=>typeof navigator<"u"&&navigator.product==="ReactNative",u=l()||s()||a();o.isWebWorker=s(),o.isReactNativeBrowser=a(),o.default=u}),Nc=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(i,c,h,d){d===void 0&&(d=h);var y=Object.getOwnPropertyDescriptor(c,h);(!y||("get"in y?!c.__esModule:y.writable||y.configurable))&&(y={enumerable:!0,get:function(){return c[h]}}),Object.defineProperty(i,d,y)}:function(i,c,h,d){d===void 0&&(d=h),i[d]=c[h]}),s=o&&o.__setModuleDefault||(Object.create?function(i,c){Object.defineProperty(i,"default",{enumerable:!0,value:c})}:function(i,c){i.default=c}),a=o&&o.__importStar||function(){var i=function(c){return i=Object.getOwnPropertyNames||function(h){var d=[];for(var y in h)Object.prototype.hasOwnProperty.call(h,y)&&(d[d.length]=y);return d},i(c)};return function(c){if(c&&c.__esModule)return c;var h={};if(c!=null)for(var d=i(c),y=0;y<d.length;y++)d[y]!=="default"&&l(h,c,d[y]);return s(h,c),h}}();Object.defineProperty(o,"__esModule",{value:!0});var u=Mc(),t=a(Cr()),r={set:u.setInterval,clear:u.clearInterval},n={set:(i,c)=>setInterval(i,c),clear:i=>clearInterval(i)},e=i=>{switch(i){case"native":return n;case"worker":return r;case"auto":default:return t.default&&!t.isWebWorker&&!t.isReactNativeBrowser?r:n}};o.default=e}),Bs=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};Object.defineProperty(o,"__esModule",{value:!0});var s=l(Nc()),a=class{constructor(u,t){Pe(this,"_keepalive");Pe(this,"timerId");Pe(this,"timer");Pe(this,"destroyed",!1);Pe(this,"counter");Pe(this,"client");Pe(this,"_keepaliveTimeoutTimestamp");Pe(this,"_intervalEvery");this.client=u,this.timer=typeof t=="object"&&"set"in t&&"clear"in t?t:(0,s.default)(t),this.setKeepalive(u.options.keepalive)}get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(u){if(u*=1e3,isNaN(u)||u<=0||u>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${u}`);this._keepalive=u,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${u}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;let u=Math.ceil(this._keepalive*1.5);this._keepaliveTimeoutTimestamp=Date.now()+u,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,this.counter===2?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}};o.default=a}),Ci=we(o=>{var v;de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(C,P,I,T){T===void 0&&(T=I);var k=Object.getOwnPropertyDescriptor(P,I);(!k||("get"in k?!P.__esModule:k.writable||k.configurable))&&(k={enumerable:!0,get:function(){return P[I]}}),Object.defineProperty(C,T,k)}:function(C,P,I,T){T===void 0&&(T=I),C[T]=P[I]}),s=o&&o.__setModuleDefault||(Object.create?function(C,P){Object.defineProperty(C,"default",{enumerable:!0,value:P})}:function(C,P){C.default=P}),a=o&&o.__importStar||function(){var C=function(P){return C=Object.getOwnPropertyNames||function(I){var T=[];for(var k in I)Object.prototype.hasOwnProperty.call(I,k)&&(T[T.length]=k);return T},C(P)};return function(P){if(P&&P.__esModule)return P;var I={};if(P!=null)for(var T=C(P),k=0;k<T.length;k++)T[k]!=="default"&&l(I,P,T[k]);return s(I,P),I}}(),u=o&&o.__importDefault||function(C){return C&&C.__esModule?C:{default:C}};Object.defineProperty(o,"__esModule",{value:!0});var t=u(zu()),r=Xt(),n=u(Ku()),e=u(Mt()),i=a(Hu()),c=u(Ss()),h=u(dc()),d=u(Ts()),y=u(gc()),b=ar(),S=yc(),w=u(Bs()),x=a(Cr()),g=globalThis.setImmediate||((...C)=>{let P=C.shift();(0,b.nextTick)(()=>{P(...C)})}),_={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"},E=(v=class extends S.TypedEventEmitter{constructor(I,T){super();Pe(this,"connected");Pe(this,"disconnecting");Pe(this,"disconnected");Pe(this,"reconnecting");Pe(this,"incomingStore");Pe(this,"outgoingStore");Pe(this,"options");Pe(this,"queueQoSZero");Pe(this,"_reconnectCount");Pe(this,"log");Pe(this,"messageIdProvider");Pe(this,"outgoing");Pe(this,"messageIdToTopic");Pe(this,"noop");Pe(this,"keepaliveManager");Pe(this,"stream");Pe(this,"queue");Pe(this,"streamBuilder");Pe(this,"_resubscribeTopics");Pe(this,"connackTimer");Pe(this,"reconnectTimer");Pe(this,"_storeProcessing");Pe(this,"_packetIdsDuringStoreProcessing");Pe(this,"_storeProcessingQueue");Pe(this,"_firstConnection");Pe(this,"topicAliasRecv");Pe(this,"topicAliasSend");Pe(this,"_deferredReconnect");Pe(this,"connackPacket");this.options=T||{};for(let k in _)typeof this.options[k]>"u"?this.options[k]=_[k]:this.options[k]=T[k];this.log=this.options.log||(0,e.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",v.VERSION),x.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",x.default?"browser":"node"),this.log("MqttClient :: options.protocol",T.protocol),this.log("MqttClient :: options.protocolVersion",T.protocolVersion),this.log("MqttClient :: options.username",T.username),this.log("MqttClient :: options.keepalive",T.keepalive),this.log("MqttClient :: options.reconnectPeriod",T.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",T.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",T.properties?T.properties.topicAliasMaximum:void 0),this.options.clientId=typeof T.clientId=="string"?T.clientId:v.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=T.protocolVersion===5&&T.customHandleAcks?T.customHandleAcks:(...k)=>{k[3](null,0)},this.options.writeCache||(t.default.writeToStream.cacheNumbers=!1),this.streamBuilder=I,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new d.default:this.options.messageIdProvider,this.outgoingStore=T.outgoingStore||new c.default,this.incomingStore=T.incomingStore||new c.default,this.queueQoSZero=T.queueQoSZero===void 0?!0:T.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,T.properties&&T.properties.topicAliasMaximum>0&&(T.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(T.properties.topicAliasMaximum)),this.on("connect",()=>{let{queue:k}=this,W=()=>{let A=k.shift();this.log("deliver :: entry %o",A);let M=null;if(!A){this._resubscribe();return}M=A.packet,this.log("deliver :: call _sendPacket for %o",M);let q=!0;M.messageId&&M.messageId!==0&&(this.messageIdProvider.register(M.messageId)||(q=!1)),q?this._sendPacket(M,N=>{A.cb&&A.cb(N),W()}):(this.log("messageId: %d has already used. The message is skipped and removed.",M.messageId),W())};this.log("connect :: sending queued packets"),W()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}handleAuth(I,T){T()}handleMessage(I,T){T()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}connect(){var le;let I=new r.Writable,T=t.default.parser(this.options),k=null,W=[];this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),T.on("packet",re=>{this.log("parser :: on packet push to packets array."),W.push(re)});let A=()=>{this.log("work :: getting next packet in queue");let re=W.shift();if(re)this.log("work :: packet pulled from queue"),(0,h.default)(this,re,M);else{this.log("work :: no packets in queue");let ee=k;k=null,this.log("work :: done flag is %s",!!ee),ee&&ee()}},M=()=>{if(W.length)(0,b.nextTick)(A);else{let re=k;k=null,re()}};I._write=(re,ee,ue)=>{k=ue,this.log("writable stream :: parsing buffer"),T.parse(re),A()};let q=re=>{this.log("streamErrorHandler :: error",re.message),re.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",re)):this.noop(re)};this.log("connect :: pipe stream to writable stream"),this.stream.pipe(I),this.stream.on("error",q),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 N={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties};if(this.options.will&&(N.will={...this.options.will,payload:(le=this.options.will)==null?void 0:le.payload}),this.topicAliasRecv&&(N.properties||(N.properties={}),this.topicAliasRecv&&(N.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._writePacket(N),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&&typeof this.options.authPacket=="object"){let re={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(re)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>{this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this.emit("error",new Error("connack timeout")),this._cleanUp(!0)},this.options.connectTimeout),this}publish(I,T,k,W){this.log("publish :: message `%s` to topic `%s`",T,I);let{options:A}=this;typeof k=="function"&&(W=k,k=null),k=k||{},k={qos:0,retain:!1,dup:!1,...k};let{qos:M,retain:q,dup:N,properties:le,cbStorePut:re}=k;if(this._checkDisconnecting(W))return this;let ee=()=>{let ue=0;if((M===1||M===2)&&(ue=this._nextId(),ue===null))return this.log("No messageId left"),!1;let G={cmd:"publish",topic:I,payload:T,qos:M,retain:q,messageId:ue,dup:N};switch(A.protocolVersion===5&&(G.properties=le),this.log("publish :: qos",M),M){case 1:case 2:this.outgoing[G.messageId]={volatile:!1,cb:W||this.noop},this.log("MqttClient:publish: packet cmd: %s",G.cmd),this._sendPacket(G,void 0,re);break;default:this.log("MqttClient:publish: packet cmd: %s",G.cmd),this._sendPacket(G,W,re);break}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!ee())&&this._storeProcessingQueue.push({invoke:ee,cbStorePut:k.cbStorePut,callback:W}),this}publishAsync(I,T,k){return new Promise((W,A)=>{this.publish(I,T,k,(M,q)=>{M?A(M):W(q)})})}subscribe(I,T,k){let W=this.options.protocolVersion;typeof T=="function"&&(k=T),k=k||this.noop;let A=!1,M=[];typeof I=="string"?(I=[I],M=I):Array.isArray(I)?M=I:typeof I=="object"&&(A=I.resubscribe,delete I.resubscribe,M=Object.keys(I));let q=i.validateTopics(M);if(q!==null)return g(k,new Error(`Invalid topic ${q}`)),this;if(this._checkDisconnecting(k))return this.log("subscribe: discconecting true"),this;let N={qos:0};W===5&&(N.nl=!1,N.rap=!1,N.rh=0),T={...N,...T};let{properties:le}=T,re=[],ee=(oe,R)=>{if(R=R||T,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,oe)||this._resubscribeTopics[oe].qos<R.qos||A){let Q={topic:oe,qos:R.qos};W===5&&(Q.nl=R.nl,Q.rap=R.rap,Q.rh=R.rh,Q.properties=le),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",Q.topic,Q.qos),re.push(Q)}};if(Array.isArray(I)?I.forEach(oe=>{this.log("subscribe: array topic %s",oe),ee(oe)}):Object.keys(I).forEach(oe=>{this.log("subscribe: object topic %s, %o",oe,I[oe]),ee(oe,I[oe])}),!re.length)return k(null,[]),this;let ue=(oe,R)=>{let Q={cmd:"subscribe",subscriptions:oe,messageId:R};if(le&&(Q.properties=le),this.options.resubscribe){this.log("subscribe :: resubscribe true");let z=[];oe.forEach(Ee=>{if(this.options.reconnectPeriod>0){let X={qos:Ee.qos};W===5&&(X.nl=Ee.nl||!1,X.rap=Ee.rap||!1,X.rh=Ee.rh||0,X.properties=Ee.properties),this._resubscribeTopics[Ee.topic]=X,z.push(Ee.topic)}}),this.messageIdToTopic[Q.messageId]=z}let he=new Promise((z,Ee)=>{this.outgoing[Q.messageId]={volatile:!0,cb(X,D){if(!X){let{granted:ae}=D;for(let H=0;H<ae.length;H+=1)oe[H].qos=ae[H]}X?Ee(new b.ErrorWithSubackPacket(X.message,D)):z(D)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(Q),he},G=()=>{let oe=this.options.subscribeBatchSize??re.length,R=[];for(let Q=0;Q<re.length;Q+=oe){let he=re.slice(Q,Q+oe),z=this._nextId();if(z===null)return this.log("No messageId left"),!1;R.push(ue(he,z))}return Promise.all(R).then(Q=>{k(null,re,Q.at(-1))}).catch(Q=>{k(Q,re,Q.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!G())&&this._storeProcessingQueue.push({invoke:G,callback:k}),this}subscribeAsync(I,T){return new Promise((k,W)=>{this.subscribe(I,T,(A,M)=>{A?W(A):k(M)})})}unsubscribe(I,T,k){typeof I=="string"&&(I=[I]),typeof T=="function"&&(k=T),k=k||this.noop;let W=i.validateTopics(I);if(W!==null)return g(k,new Error(`Invalid topic ${W}`)),this;if(this._checkDisconnecting(k))return this;let A=()=>{let M=this._nextId();if(M===null)return this.log("No messageId left"),!1;let q={cmd:"unsubscribe",messageId:M,unsubscriptions:[]};return typeof I=="string"?q.unsubscriptions=[I]:Array.isArray(I)&&(q.unsubscriptions=I),this.options.resubscribe&&q.unsubscriptions.forEach(N=>{delete this._resubscribeTopics[N]}),typeof T=="object"&&T.properties&&(q.properties=T.properties),this.outgoing[q.messageId]={volatile:!0,cb:k},this.log("unsubscribe: call _sendPacket"),this._sendPacket(q),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!A())&&this._storeProcessingQueue.push({invoke:A,callback:k}),this}unsubscribeAsync(I,T){return new Promise((k,W)=>{this.unsubscribe(I,T,(A,M)=>{A?W(A):k(M)})})}end(I,T,k){this.log("end :: (%s)",this.options.clientId),(I==null||typeof I!="boolean")&&(k=k||T,T=I,I=!1),typeof T!="object"&&(k=k||T,T=null),this.log("end :: cb? %s",!!k),(!k||typeof k!="function")&&(k=this.noop);let W=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this.incomingStore.close(M=>{this.outgoingStore.close(q=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),k){let N=M||q;this.log("end :: closeStores: invoking callback with args"),k(N)}})}),this._deferredReconnect?this._deferredReconnect():(this.options.reconnectPeriod===0||this.options.manualConnect)&&(this.disconnecting=!1)},A=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,I),this._cleanUp(I,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,b.nextTick)(W)},T)};return this.disconnecting?(k(),this):(this._clearReconnect(),this.disconnecting=!0,!I&&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,A,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),A()),this)}endAsync(I,T){return new Promise((k,W)=>{this.end(I,T,A=>{A?W(A):k()})})}removeOutgoingMessage(I){if(this.outgoing[I]){let{cb:T}=this.outgoing[I];this._removeOutgoingAndStoreMessage(I,()=>{T(new Error("Message removed"))})}return this}reconnect(I){this.log("client reconnect");let T=()=>{I?(this.options.incomingStore=I.incomingStore,this.options.outgoingStore=I.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new c.default,this.outgoingStore=this.options.outgoingStore||new c.default,this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=T:T(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(I=>{this.outgoing[I].volatile&&typeof this.outgoing[I].cb=="function"&&(this.outgoing[I].cb(new Error("Connection closed")),delete this.outgoing[I])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(I=>{typeof this.outgoing[I].cb=="function"&&(this.outgoing[I].cb(new Error("Connection closed")),delete this.outgoing[I])}))}_removeTopicAliasAndRecoverTopicName(I){let T;I.properties&&(T=I.properties.topicAlias);let k=I.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",T,k),k.length===0){if(typeof T>"u")return new Error("Unregistered Topic Alias");if(k=this.topicAliasSend.getTopicByAlias(T),typeof k>"u")return new Error("Unregistered Topic Alias");I.topic=k}T&&delete I.properties.topicAlias}_checkDisconnecting(I){return this.disconnecting&&(I&&I!==this.noop?I(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(I,T,k={}){if(T&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",T)),this.log("_cleanUp :: forced? %s",I),I)this.options.reconnectPeriod===0&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let W={cmd:"disconnect",...k};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(W,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),g(()=>{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(I,T,k){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",I.cmd);let W=I,A;if(W.cmd==="publish"&&(W=(0,n.default)(I),A=this._removeTopicAliasAndRecoverTopicName(W),A))return T&&T(A);this.outgoingStore.put(W,M=>{if(M)return T&&T(M);k(),this._writePacket(I,T)})}_applyTopicAlias(I){if(this.options.protocolVersion===5&&I.cmd==="publish"){let T;I.properties&&(T=I.properties.topicAlias);let k=I.topic.toString();if(this.topicAliasSend)if(T){if(k.length!==0&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",k,T),!this.topicAliasSend.put(k,T)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",k,T),new Error("Sending Topic Alias out of range")}else k.length!==0&&(this.options.autoAssignTopicAlias?(T=this.topicAliasSend.getAliasByTopic(k),T?(I.topic="",I.properties={...I.properties,topicAlias:T},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",k,T)):(T=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(k,T),I.properties={...I.properties,topicAlias:T},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",k,T))):this.options.autoUseTopicAlias&&(T=this.topicAliasSend.getAliasByTopic(k),T&&(I.topic="",I.properties={...I.properties,topicAlias:T},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",k,T))));else if(T)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",k,T),new Error("Sending Topic Alias out of range")}}_noop(I){this.log("noop ::",I)}_writePacket(I,T){this.log("_writePacket :: packet: %O",I),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",I),this.log("_writePacket :: writing to stream");let k=t.default.writeToStream(I,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",k),!k&&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(I,T,k,W){this.log("_sendPacket :: (%s) :: start",this.options.clientId),k=k||this.noop,T=T||this.noop;let A=this._applyTopicAlias(I);if(A){T(A);return}if(!this.connected){if(I.cmd==="auth"){this._writePacket(I,T);return}this.log("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(I,T,k);return}if(W){this._writePacket(I,T);return}switch(I.cmd){case"publish":break;case"pubrel":this._storeAndSend(I,T,k);return;default:this._writePacket(I,T);return}switch(I.qos){case 2:case 1:this._storeAndSend(I,T,k);break;case 0:default:this._writePacket(I,T);break}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}_storePacket(I,T,k){this.log("_storePacket :: packet: %o",I),this.log("_storePacket :: cb? %s",!!T),k=k||this.noop;let W=I;if(W.cmd==="publish"){W=(0,n.default)(I);let M=this._removeTopicAliasAndRecoverTopicName(W);if(M)return T&&T(M)}let A=W.qos||0;A===0&&this.queueQoSZero||W.cmd!=="publish"?this.queue.push({packet:W,cb:T}):A>0?(T=this.outgoing[W.messageId]?this.outgoing[W.messageId].cb:null,this.outgoingStore.put(W,M=>{if(M)return T&&T(M);k()})):T&&T(new Error("No connection to broker"))}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.options.keepalive),!this.keepaliveManager&&this.options.keepalive&&(this.keepaliveManager=new w.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(I=!1){this.keepaliveManager&&this.options.keepalive&&(I||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.emit("error",new Error("Keepalive timeout")),this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0)}_resubscribe(){this.log("_resubscribe");let I=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&I.length>0)if(this.options.resubscribe)if(this.options.protocolVersion===5){this.log("_resubscribe: protocolVersion 5");for(let T=0;T<I.length;T++){let k={};k[I[T]]=this._resubscribeTopics[I[T]],k.resubscribe=!0,this.subscribe(k,{properties:k[I[T]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(I){if(this.disconnected){this.emit("connect",I);return}this.connackPacket=I,this.messageIdProvider.clear(),this._setupKeepaliveManager(),this.connected=!0;let T=()=>{let k=this.outgoingStore.createStream(),W=()=>{k.destroy(),k=null,this._flushStoreProcessingQueue(),A()},A=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",W),k.on("error",q=>{A(),this._flushStoreProcessingQueue(),this.removeListener("close",W),this.emit("error",q)});let M=()=>{if(!k)return;let q=k.read(1),N;if(!q){k.once("readable",M);return}if(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[q.messageId]){M();return}!this.disconnecting&&!this.reconnectTimer?(N=this.outgoing[q.messageId]?this.outgoing[q.messageId].cb:null,this.outgoing[q.messageId]={volatile:!1,cb(le,re){N&&N(le,re),M()}},this._packetIdsDuringStoreProcessing[q.messageId]=!0,this.messageIdProvider.register(q.messageId)?this._sendPacket(q,void 0,void 0,!0):this.log("messageId: %d has already used.",q.messageId)):k.destroy&&k.destroy()};k.on("end",()=>{let q=!0;for(let N in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[N]){q=!1;break}this.removeListener("close",W),q?(A(),this._invokeAllStoreProcessingQueue(),this.emit("connect",I)):T()}),M()};T()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){let I=this._storeProcessingQueue[0];if(I&&I.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(let I of this._storeProcessingQueue)I.cbStorePut&&I.cbStorePut(new Error("Connection closed")),I.callback&&I.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(I,T){delete this.outgoing[I],this.outgoingStore.del({messageId:I},(k,W)=>{T(k,W),this.messageIdProvider.deallocate(I),this._invokeStoreProcessingQueue()})}},Pe(v,"VERSION",b.MQTTJS_VERSION),v);o.default=E}),Bc=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=Os(),s=class{constructor(){Pe(this,"numberAllocator");Pe(this,"lastId");this.numberAllocator=new l.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(a){return this.numberAllocator.use(a)}deallocate(a){this.numberAllocator.free(a)}clear(){this.numberAllocator.clear()}};o.default=s});function Lc(){if(ji)return jr;ji=!0;let o=2147483647,l=36,s=1,a=26,u=38,t=700,r=72,n=128,e="-",i=/^xn--/,c=/[^\0-\x7F]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,d={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},y=l-s,b=Math.floor,S=String.fromCharCode;function w(k){throw new RangeError(d[k])}function x(k,W){let A=[],M=k.length;for(;M--;)A[M]=W(k[M]);return A}function g(k,W){let A=k.split("@"),M="";A.length>1&&(M=A[0]+"@",k=A[1]),k=k.replace(h,".");let q=k.split("."),N=x(q,W).join(".");return M+N}function _(k){let W=[],A=0,M=k.length;for(;A<M;){let q=k.charCodeAt(A++);if(q>=55296&&q<=56319&&A<M){let N=k.charCodeAt(A++);(N&64512)==56320?W.push(((q&1023)<<10)+(N&1023)+65536):(W.push(q),A--)}else W.push(q)}return W}let E=k=>String.fromCodePoint(...k),v=function(k){return k>=48&&k<58?26+(k-48):k>=65&&k<91?k-65:k>=97&&k<123?k-97:l},C=function(k,W){return k+22+75*(k<26)-((W!=0)<<5)},P=function(k,W,A){let M=0;for(k=A?b(k/t):k>>1,k+=b(k/W);k>y*a>>1;M+=l)k=b(k/y);return b(M+(y+1)*k/(k+u))},I=function(k){let W=[],A=k.length,M=0,q=n,N=r,le=k.lastIndexOf(e);le<0&&(le=0);for(let re=0;re<le;++re)k.charCodeAt(re)>=128&&w("not-basic"),W.push(k.charCodeAt(re));for(let re=le>0?le+1:0;re<A;){let ee=M;for(let G=1,oe=l;;oe+=l){re>=A&&w("invalid-input");let R=v(k.charCodeAt(re++));R>=l&&w("invalid-input"),R>b((o-M)/G)&&w("overflow"),M+=R*G;let Q=oe<=N?s:oe>=N+a?a:oe-N;if(R<Q)break;let he=l-Q;G>b(o/he)&&w("overflow"),G*=he}let ue=W.length+1;N=P(M-ee,ue,ee==0),b(M/ue)>o-q&&w("overflow"),q+=b(M/ue),M%=ue,W.splice(M++,0,q)}return String.fromCodePoint(...W)},T=function(k){let W=[];k=_(k);let A=k.length,M=n,q=0,N=r;for(let ee of k)ee<128&&W.push(S(ee));let le=W.length,re=le;for(le&&W.push(e);re<A;){let ee=o;for(let G of k)G>=M&&G<ee&&(ee=G);let ue=re+1;ee-M>b((o-q)/ue)&&w("overflow"),q+=(ee-M)*ue,M=ee;for(let G of k)if(G<M&&++q>o&&w("overflow"),G===M){let oe=q;for(let R=l;;R+=l){let Q=R<=N?s:R>=N+a?a:R-N;if(oe<Q)break;let he=oe-Q,z=l-Q;W.push(S(C(Q+he%z,0))),oe=b(he/z)}W.push(S(C(oe,0))),N=P(q,ue,re===le),q=0,++re}++q,++M}return W.join("")};return jr={version:"2.3.1",ucs2:{decode:_,encode:E},decode:I,encode:T,toASCII:function(k){return g(k,function(W){return c.test(W)?"xn--"+T(W):W})},toUnicode:function(k){return g(k,function(W){return i.test(W)?I(W.slice(4).toLowerCase()):W})}},jr}var jr,ji,$t,Uc=_t(()=>{de(),ye(),ge(),jr={},ji=!1,$t=Lc(),$t.decode,$t.encode,$t.toASCII,$t.toUnicode,$t.ucs2,$t.version});function Dc(){return Bi||(Bi=!0,Ni=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var o={},l=Symbol("test"),s=Object(l);if(typeof l=="string"||Object.prototype.toString.call(l)!=="[object Symbol]"||Object.prototype.toString.call(s)!=="[object Symbol]")return!1;var a=42;o[l]=a;for(l in o)return!1;if(typeof Object.keys=="function"&&Object.keys(o).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(o).length!==0)return!1;var u=Object.getOwnPropertySymbols(o);if(u.length!==1||u[0]!==l||!Object.prototype.propertyIsEnumerable.call(o,l))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var t=Object.getOwnPropertyDescriptor(o,l);if(t.value!==a||t.enumerable!==!0)return!1}return!0}),Ni}function Fc(){return Ui||(Ui=!0,Li=Error),Li}function Wc(){return Fi||(Fi=!0,Di=EvalError),Di}function $c(){return $i||($i=!0,Wi=RangeError),Wi}function qc(){return zi||(zi=!0,qi=ReferenceError),qi}function Ls(){return Ki||(Ki=!0,Vi=SyntaxError),Vi}function vr(){return Gi||(Gi=!0,Hi=TypeError),Hi}function zc(){return Qi||(Qi=!0,Yi=URIError),Yi}function Vc(){if(Ji)return Rr;Ji=!0;var o=typeof Symbol<"u"&&Symbol,l=Dc();return Rr=function(){return typeof o!="function"||typeof Symbol!="function"||typeof o("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:l()},Rr}function Kc(){if(Xi)return Mr;Xi=!0;var o={__proto__:null,foo:{}},l=Object;return Mr=function(){return{__proto__:o}.foo===o.foo&&!(o instanceof l)},Mr}function Hc(){if(Zi)return Nr;Zi=!0;var o="Function.prototype.bind called on incompatible ",l=Object.prototype.toString,s=Math.max,a="[object Function]",u=function(n,e){for(var i=[],c=0;c<n.length;c+=1)i[c]=n[c];for(var h=0;h<e.length;h+=1)i[h+n.length]=e[h];return i},t=function(n,e){for(var i=[],c=e,h=0;c<n.length;c+=1,h+=1)i[h]=n[c];return i},r=function(n,e){for(var i="",c=0;c<n.length;c+=1)i+=n[c],c+1<n.length&&(i+=e);return i};return Nr=function(n){var e=this;if(typeof e!="function"||l.apply(e)!==a)throw new TypeError(o+e);for(var i=t(arguments,1),c,h=function(){if(this instanceof c){var w=e.apply(this,u(i,arguments));return Object(w)===w?w:this}return e.apply(n,u(i,arguments))},d=s(0,e.length-i.length),y=[],b=0;b<d;b++)y[b]="$"+b;if(c=Function("binder","return function ("+r(y,",")+"){ return binder.apply(this,arguments); }")(h),e.prototype){var S=function(){};S.prototype=e.prototype,c.prototype=new S,S.prototype=null}return c},Nr}function Ri(){if(eo)return Br;eo=!0;var o=Hc();return Br=Function.prototype.bind||o,Br}function Gc(){if(to)return Lr;to=!0;var o=Function.prototype.call,l=Object.prototype.hasOwnProperty,s=Ri();return Lr=s.call(o,l),Lr}function lr(){if(ro)return Ur;ro=!0;var o,l=Fc(),s=Wc(),a=$c(),u=qc(),t=Ls(),r=vr(),n=zc(),e=Function,i=function(re){try{return e('"use strict"; return ('+re+").constructor;")()}catch{}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch{c=null}var h=function(){throw new r},d=c?function(){try{return arguments.callee,h}catch{try{return c(arguments,"callee").get}catch{return h}}}():h,y=Vc()(),b=Kc()(),S=Object.getPrototypeOf||(b?function(re){return re.__proto__}:null),w={},x=typeof Uint8Array>"u"||!S?o:S(Uint8Array),g={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?o:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?o:ArrayBuffer,"%ArrayIteratorPrototype%":y&&S?S([][Symbol.iterator]()):o,"%AsyncFromSyncIteratorPrototype%":o,"%AsyncFunction%":w,"%AsyncGenerator%":w,"%AsyncGeneratorFunction%":w,"%AsyncIteratorPrototype%":w,"%Atomics%":typeof Atomics>"u"?o:Atomics,"%BigInt%":typeof BigInt>"u"?o:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?o:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?o:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?o:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":l,"%eval%":eval,"%EvalError%":s,"%Float32Array%":typeof Float32Array>"u"?o:Float32Array,"%Float64Array%":typeof Float64Array>"u"?o:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?o:FinalizationRegistry,"%Function%":e,"%GeneratorFunction%":w,"%Int8Array%":typeof Int8Array>"u"?o:Int8Array,"%Int16Array%":typeof Int16Array>"u"?o:Int16Array,"%Int32Array%":typeof Int32Array>"u"?o:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":y&&S?S(S([][Symbol.iterator]())):o,"%JSON%":typeof JSON=="object"?JSON:o,"%Map%":typeof Map>"u"?o:Map,"%MapIteratorPrototype%":typeof Map>"u"||!y||!S?o:S(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?o:Promise,"%Proxy%":typeof Proxy>"u"?o:Proxy,"%RangeError%":a,"%ReferenceError%":u,"%Reflect%":typeof Reflect>"u"?o:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?o:Set,"%SetIteratorPrototype%":typeof Set>"u"||!y||!S?o:S(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?o:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":y&&S?S(""[Symbol.iterator]()):o,"%Symbol%":y?Symbol:o,"%SyntaxError%":t,"%ThrowTypeError%":d,"%TypedArray%":x,"%TypeError%":r,"%Uint8Array%":typeof Uint8Array>"u"?o:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?o:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?o:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?o:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?o:WeakMap,"%WeakRef%":typeof WeakRef>"u"?o:WeakRef,"%WeakSet%":typeof WeakSet>"u"?o:WeakSet};if(S)try{null.error}catch(re){var _=S(S(re));g["%Error.prototype%"]=_}var E=function re(ee){var ue;if(ee==="%AsyncFunction%")ue=i("async function () {}");else if(ee==="%GeneratorFunction%")ue=i("function* () {}");else if(ee==="%AsyncGeneratorFunction%")ue=i("async function* () {}");else if(ee==="%AsyncGenerator%"){var G=re("%AsyncGeneratorFunction%");G&&(ue=G.prototype)}else if(ee==="%AsyncIteratorPrototype%"){var oe=re("%AsyncGenerator%");oe&&S&&(ue=S(oe.prototype))}return g[ee]=ue,ue},v={__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"]},C=Ri(),P=Gc(),I=C.call(Function.call,Array.prototype.concat),T=C.call(Function.apply,Array.prototype.splice),k=C.call(Function.call,String.prototype.replace),W=C.call(Function.call,String.prototype.slice),A=C.call(Function.call,RegExp.prototype.exec),M=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,q=/\\(\\)?/g,N=function(re){var ee=W(re,0,1),ue=W(re,-1);if(ee==="%"&&ue!=="%")throw new t("invalid intrinsic syntax, expected closing `%`");if(ue==="%"&&ee!=="%")throw new t("invalid intrinsic syntax, expected opening `%`");var G=[];return k(re,M,function(oe,R,Q,he){G[G.length]=Q?k(he,q,"$1"):R||oe}),G},le=function(re,ee){var ue=re,G;if(P(v,ue)&&(G=v[ue],ue="%"+G[0]+"%"),P(g,ue)){var oe=g[ue];if(oe===w&&(oe=E(ue)),typeof oe>"u"&&!ee)throw new r("intrinsic "+re+" exists, but is not available. Please file an issue!");return{alias:G,name:ue,value:oe}}throw new t("intrinsic "+re+" does not exist!")};return Ur=function(re,ee){if(typeof re!="string"||re.length===0)throw new r("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof ee!="boolean")throw new r('"allowMissing" argument must be a boolean');if(A(/^%?[^%]*%?$/,re)===null)throw new t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var ue=N(re),G=ue.length>0?ue[0]:"",oe=le("%"+G+"%",ee),R=oe.name,Q=oe.value,he=!1,z=oe.alias;z&&(G=z[0],T(ue,I([0,1],z)));for(var Ee=1,X=!0;Ee<ue.length;Ee+=1){var D=ue[Ee],ae=W(D,0,1),H=W(D,-1);if((ae==='"'||ae==="'"||ae==="`"||H==='"'||H==="'"||H==="`")&&ae!==H)throw new t("property names with quotes must have matching quotes");if((D==="constructor"||!X)&&(he=!0),G+="."+D,R="%"+G+"%",P(g,R))Q=g[R];else if(Q!=null){if(!(D in Q)){if(!ee)throw new r("base intrinsic for "+re+" exists, but the property is not available.");return}if(c&&Ee+1>=ue.length){var te=c(Q,D);X=!!te,X&&"get"in te&&!("originalValue"in te.get)?Q=te.get:Q=Q[D]}else X=P(Q,D),Q=Q[D];X&&!he&&(g[R]=Q)}}return Q},Ur}function Mi(){if(no)return Dr;no=!0;var o=lr(),l=o("%Object.defineProperty%",!0)||!1;if(l)try{l({},"a",{value:1})}catch{l=!1}return Dr=l,Dr}function Us(){if(io)return Fr;io=!0;var o=lr(),l=o("%Object.getOwnPropertyDescriptor%",!0);if(l)try{l([],"length")}catch{l=null}return Fr=l,Fr}function Yc(){if(oo)return Wr;oo=!0;var o=Mi(),l=Ls(),s=vr(),a=Us();return Wr=function(u,t,r){if(!u||typeof u!="object"&&typeof u!="function")throw new s("`obj` must be an object or a function`");if(typeof t!="string"&&typeof t!="symbol")throw new s("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new s("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new s("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new s("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new s("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,e=arguments.length>4?arguments[4]:null,i=arguments.length>5?arguments[5]:null,c=arguments.length>6?arguments[6]:!1,h=!!a&&a(u,t);if(o)o(u,t,{configurable:i===null&&h?h.configurable:!i,enumerable:n===null&&h?h.enumerable:!n,value:r,writable:e===null&&h?h.writable:!e});else if(c||!n&&!e&&!i)u[t]=r;else throw new l("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Wr}function Qc(){if(so)return $r;so=!0;var o=Mi(),l=function(){return!!o};return l.hasArrayLengthDefineBug=function(){if(!o)return null;try{return o([],"length",{value:1}).length!==1}catch{return!0}},$r=l,$r}function Jc(){if(ao)return qr;ao=!0;var o=lr(),l=Yc(),s=Qc()(),a=Us(),u=vr(),t=o("%Math.floor%");return qr=function(r,n){if(typeof r!="function")throw new u("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||t(n)!==n)throw new u("`length` must be a positive 32-bit integer");var e=arguments.length>2&&!!arguments[2],i=!0,c=!0;if("length"in r&&a){var h=a(r,"length");h&&!h.configurable&&(i=!1),h&&!h.writable&&(c=!1)}return(i||c||!e)&&(s?l(r,"length",n,!0,!0):l(r,"length",n)),r},qr}function Xc(){if(lo)return ur;lo=!0;var o=Ri(),l=lr(),s=Jc(),a=vr(),u=l("%Function.prototype.apply%"),t=l("%Function.prototype.call%"),r=l("%Reflect.apply%",!0)||o.call(t,u),n=Mi(),e=l("%Math.max%");ur=function(c){if(typeof c!="function")throw new a("a function is required");var h=r(o,t,arguments);return s(h,1+e(0,c.length-(arguments.length-1)),!0)};var i=function(){return r(o,u,arguments)};return n?n(ur,"apply",{value:i}):ur.apply=i,ur}function Zc(){if(uo)return zr;uo=!0;var o=lr(),l=Xc(),s=l(o("String.prototype.indexOf"));return zr=function(a,u){var t=o(a,!!u);return typeof t=="function"&&s(a,".prototype.")>-1?l(t):t},zr}var Ni,Bi,Li,Ui,Di,Fi,Wi,$i,qi,zi,Vi,Ki,Hi,Gi,Yi,Qi,Rr,Ji,Mr,Xi,Nr,Zi,Br,eo,Lr,to,Ur,ro,Dr,no,Fr,io,Wr,oo,$r,so,qr,ao,ur,lo,zr,uo,ef=_t(()=>{de(),ye(),ge(),Ni={},Bi=!1,Li={},Ui=!1,Di={},Fi=!1,Wi={},$i=!1,qi={},zi=!1,Vi={},Ki=!1,Hi={},Gi=!1,Yi={},Qi=!1,Rr={},Ji=!1,Mr={},Xi=!1,Nr={},Zi=!1,Br={},eo=!1,Lr={},to=!1,Ur={},ro=!1,Dr={},no=!1,Fr={},io=!1,Wr={},oo=!1,$r={},so=!1,qr={},ao=!1,ur={},lo=!1,zr={},uo=!1});function co(o){throw new Error("Node.js process "+o+" is not supported by JSPM core outside of Node.js")}function tf(){!Zt||!er||(Zt=!1,er.length?Ot=er.concat(Ot):wr=-1,Ot.length&&Ds())}function Ds(){if(!Zt){var o=setTimeout(tf,0);Zt=!0;for(var l=Ot.length;l;){for(er=Ot,Ot=[];++wr<l;)er&&er[wr].run();wr=-1,l=Ot.length}er=null,Zt=!1,clearTimeout(o)}}function rf(o){var l=new Array(arguments.length-1);if(arguments.length>1)for(var s=1;s<arguments.length;s++)l[s-1]=arguments[s];Ot.push(new Fs(o,l)),Ot.length===1&&!Zt&&setTimeout(Ds,0)}function Fs(o,l){this.fun=o,this.array=l}function bt(){}function nf(o){co("_linkedBinding")}function of(o){co("dlopen")}function sf(){return[]}function af(){return[]}function lf(o,l){if(!o)throw new Error(l||"assertion error")}function uf(){return!1}function cf(){return Lt.now()/1e3}function fo(o){var l=Math.floor((Date.now()-Lt.now())*.001),s=Lt.now()*.001,a=Math.floor(s)+l,u=Math.floor(s%1*1e9);return o&&(a=a-o[0],u=u-o[1],u<0&&(a--,u+=Kr)),[a,u]}function qt(){return po}function ff(o){return[]}var Ot,Zt,er,wr,Ws,$s,qs,zs,Vs,Ks,Hs,Gs,Ys,Qs,Js,Xs,Zs,ea,ta,ra,na,ia,oa,sa,aa,Vr,la,ua,ca,fa,ha,pa,da,ga,ya,ma,ba,va,wa,_a,Sa,Ea,xa,Aa,Ia,ka,Oa,Ta,Pa,Ca,ja,Lt,ho,Kr,Ra,Ma,Na,Ba,La,Ua,Da,Fa,Wa,$a,qa,po,za=_t(()=>{de(),ye(),ge(),Ot=[],Zt=!1,wr=-1,Fs.prototype.run=function(){this.fun.apply(null,this.array)},Ws="browser",$s="x64",qs="browser",zs={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},Vs=["/usr/bin/node"],Ks=[],Hs="v16.8.0",Gs={},Ys=function(o,l){console.warn((l?l+": ":"")+o)},Qs=function(o){co("binding")},Js=function(o){return 0},Xs=function(){return"/"},Zs=function(o){},ea={name:"node",sourceUrl:"",headersUrl:"",libUrl:""},ta=bt,ra=[],na={},ia=!1,oa={},sa=bt,aa=bt,Vr=function(){return{}},la=Vr,ua=Vr,ca=bt,fa=bt,ha=bt,pa={},da={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},ga=bt,ya=bt,ma=bt,ba=bt,va=bt,wa=bt,_a=bt,Sa=void 0,Ea=void 0,xa=void 0,Aa=bt,Ia=2,ka=1,Oa="/bin/usr/node",Ta=9229,Pa="node",Ca=[],ja=bt,Lt={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0},Lt.now===void 0&&(ho=Date.now(),Lt.timing&&Lt.timing.navigationStart&&(ho=Lt.timing.navigationStart),Lt.now=()=>Date.now()-ho),Kr=1e9,fo.bigint=function(o){var l=fo(o);return typeof BigInt>"u"?l[0]*Kr+l[1]:BigInt(l[0]*Kr)+BigInt(l[1])},Ra=10,Ma={},Na=0,Ba=qt,La=qt,Ua=qt,Da=qt,Fa=qt,Wa=bt,$a=qt,qa=qt,po={version:Hs,versions:Gs,arch:$s,platform:qs,release:ea,_rawDebug:ta,moduleLoadList:ra,binding:Qs,_linkedBinding:nf,_events:Ma,_eventsCount:Na,_maxListeners:Ra,on:qt,addListener:Ba,once:La,off:Ua,removeListener:Da,removeAllListeners:Fa,emit:Wa,prependListener:$a,prependOnceListener:qa,listeners:ff,domain:na,_exiting:ia,config:oa,dlopen:of,uptime:cf,_getActiveRequests:sf,_getActiveHandles:af,reallyExit:sa,_kill:aa,cpuUsage:Vr,resourceUsage:la,memoryUsage:ua,kill:ca,exit:fa,openStdin:ha,allowedNodeEnvironmentFlags:pa,assert:lf,features:da,_fatalExceptions:ga,setUncaughtExceptionCaptureCallback:ya,hasUncaughtExceptionCaptureCallback:uf,emitWarning:Ys,nextTick:rf,_tickCallback:ma,_debugProcess:ba,_debugEnd:va,_startProfilerIdleNotifier:wa,_stopProfilerIdleNotifier:_a,stdout:Sa,stdin:xa,stderr:Ea,abort:Aa,umask:Js,chdir:Zs,cwd:Xs,env:zs,title:Ws,argv:Vs,execArgv:Ks,pid:Ia,ppid:ka,execPath:Oa,debugPort:Ta,hrtime:fo,argv0:Pa,_preload_modules:Ca,setSourceMapsEnabled:ja}});function hf(){if(go)return Hr;go=!0;var o=po;function l(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}function s(t,r){for(var n="",e=0,i=-1,c=0,h,d=0;d<=t.length;++d){if(d<t.length)h=t.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(i===d-1||c===1))if(i!==d-1&&c===2){if(n.length<2||e!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){var y=n.lastIndexOf("/");if(y!==n.length-1){y===-1?(n="",e=0):(n=n.slice(0,y),e=n.length-1-n.lastIndexOf("/")),i=d,c=0;continue}}else if(n.length===2||n.length===1){n="",e=0,i=d,c=0;continue}}r&&(n.length>0?n+="/..":n="..",e=2)}else n.length>0?n+="/"+t.slice(i+1,d):n=t.slice(i+1,d),e=d-i-1;i=d,c=0}else h===46&&c!==-1?++c:c=-1}return n}function a(t,r){var n=r.dir||r.root,e=r.base||(r.name||"")+(r.ext||"");return n?n===r.root?n+e:n+t+e:e}var u={resolve:function(){for(var t="",r=!1,n,e=arguments.length-1;e>=-1&&!r;e--){var i;e>=0?i=arguments[e]:(n===void 0&&(n=o.cwd()),i=n),l(i),i.length!==0&&(t=i+"/"+t,r=i.charCodeAt(0)===47)}return t=s(t,!r),r?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(l(t),t.length===0)return".";var r=t.charCodeAt(0)===47,n=t.charCodeAt(t.length-1)===47;return t=s(t,!r),t.length===0&&!r&&(t="."),t.length>0&&n&&(t+="/"),r?"/"+t:t},isAbsolute:function(t){return l(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,r=0;r<arguments.length;++r){var n=arguments[r];l(n),n.length>0&&(t===void 0?t=n:t+="/"+n)}return t===void 0?".":u.normalize(t)},relative:function(t,r){if(l(t),l(r),t===r||(t=u.resolve(t),r=u.resolve(r),t===r))return"";for(var n=1;n<t.length&&t.charCodeAt(n)===47;++n);for(var e=t.length,i=e-n,c=1;c<r.length&&r.charCodeAt(c)===47;++c);for(var h=r.length,d=h-c,y=i<d?i:d,b=-1,S=0;S<=y;++S){if(S===y){if(d>y){if(r.charCodeAt(c+S)===47)return r.slice(c+S+1);if(S===0)return r.slice(c+S)}else i>y&&(t.charCodeAt(n+S)===47?b=S:S===0&&(b=0));break}var w=t.charCodeAt(n+S),x=r.charCodeAt(c+S);if(w!==x)break;w===47&&(b=S)}var g="";for(S=n+b+1;S<=e;++S)(S===e||t.charCodeAt(S)===47)&&(g.length===0?g+="..":g+="/..");return g.length>0?g+r.slice(c+b):(c+=b,r.charCodeAt(c)===47&&++c,r.slice(c))},_makeLong:function(t){return t},dirname:function(t){if(l(t),t.length===0)return".";for(var r=t.charCodeAt(0),n=r===47,e=-1,i=!0,c=t.length-1;c>=1;--c)if(r=t.charCodeAt(c),r===47){if(!i){e=c;break}}else i=!1;return e===-1?n?"/":".":n&&e===1?"//":t.slice(0,e)},basename:function(t,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');l(t);var n=0,e=-1,i=!0,c;if(r!==void 0&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var h=r.length-1,d=-1;for(c=t.length-1;c>=0;--c){var y=t.charCodeAt(c);if(y===47){if(!i){n=c+1;break}}else d===-1&&(i=!1,d=c+1),h>=0&&(y===r.charCodeAt(h)?--h===-1&&(e=c):(h=-1,e=d))}return n===e?e=d:e===-1&&(e=t.length),t.slice(n,e)}else{for(c=t.length-1;c>=0;--c)if(t.charCodeAt(c)===47){if(!i){n=c+1;break}}else e===-1&&(i=!1,e=c+1);return e===-1?"":t.slice(n,e)}},extname:function(t){l(t);for(var r=-1,n=0,e=-1,i=!0,c=0,h=t.length-1;h>=0;--h){var d=t.charCodeAt(h);if(d===47){if(!i){n=h+1;break}continue}e===-1&&(i=!1,e=h+1),d===46?r===-1?r=h:c!==1&&(c=1):r!==-1&&(c=-1)}return r===-1||e===-1||c===0||c===1&&r===e-1&&r===n+1?"":t.slice(r,e)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return a("/",t)},parse:function(t){l(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0),e=n===47,i;e?(r.root="/",i=1):i=0;for(var c=-1,h=0,d=-1,y=!0,b=t.length-1,S=0;b>=i;--b){if(n=t.charCodeAt(b),n===47){if(!y){h=b+1;break}continue}d===-1&&(y=!1,d=b+1),n===46?c===-1?c=b:S!==1&&(S=1):c!==-1&&(S=-1)}return c===-1||d===-1||S===0||S===1&&c===d-1&&c===h+1?d!==-1&&(h===0&&e?r.base=r.name=t.slice(1,d):r.base=r.name=t.slice(h,d)):(h===0&&e?(r.name=t.slice(1,c),r.base=t.slice(1,d)):(r.name=t.slice(h,c),r.base=t.slice(h,d)),r.ext=t.slice(c,d)),h>0?r.dir=t.slice(0,h-1):e&&(r.dir="/"),r},sep:"/",delimiter:":",win32:null,posix:null};return u.posix=u,Hr=u,Hr}var Hr,go,yo,pf=_t(()=>{de(),ye(),ge(),za(),Hr={},go=!1,yo=hf()}),Va={};nr(Va,{URL:()=>rl,Url:()=>Ja,default:()=>vt,fileURLToPath:()=>Ha,format:()=>Xa,parse:()=>tl,pathToFileURL:()=>Ga,resolve:()=>Za,resolveObject:()=>el});function df(){if(bo)return Gr;bo=!0;var o=typeof Map=="function"&&Map.prototype,l=Object.getOwnPropertyDescriptor&&o?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,s=o&&l&&typeof l.get=="function"?l.get:null,a=o&&Map.prototype.forEach,u=typeof Set=="function"&&Set.prototype,t=Object.getOwnPropertyDescriptor&&u?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,r=u&&t&&typeof t.get=="function"?t.get:null,n=u&&Set.prototype.forEach,e=typeof WeakMap=="function"&&WeakMap.prototype,i=e?WeakMap.prototype.has:null,c=typeof WeakSet=="function"&&WeakSet.prototype,h=c?WeakSet.prototype.has:null,d=typeof WeakRef=="function"&&WeakRef.prototype,y=d?WeakRef.prototype.deref:null,b=Boolean.prototype.valueOf,S=Object.prototype.toString,w=Function.prototype.toString,x=String.prototype.match,g=String.prototype.slice,_=String.prototype.replace,E=String.prototype.toUpperCase,v=String.prototype.toLowerCase,C=RegExp.prototype.test,P=Array.prototype.concat,I=Array.prototype.join,T=Array.prototype.slice,k=Math.floor,W=typeof BigInt=="function"?BigInt.prototype.valueOf:null,A=Object.getOwnPropertySymbols,M=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,q=typeof Symbol=="function"&&typeof Symbol.iterator=="object",N=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===q||!0)?Symbol.toStringTag:null,le=Object.prototype.propertyIsEnumerable,re=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function($){return $.__proto__}:null);function ee($,J){if($===1/0||$===-1/0||$!==$||$&&$>-1e3&&$<1e3||C.call(/e/,J))return J;var Te=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof $=="number"){var Re=$<0?-k(-$):k($);if(Re!==$){var Me=String(Re),Fe=g.call(J,Me.length+1);return _.call(Me,Te,"$&_")+"."+_.call(_.call(Fe,/([0-9]{3})/g,"$&_"),/_$/,"")}}return _.call(J,Te,"$&_")}var ue=Ya,G=ue.custom,oe=te(G)?G:null;Gr=function $(J,Te,Re,Me){var Fe=Te||{};if(ce(Fe,"quoteStyle")&&Fe.quoteStyle!=="single"&&Fe.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(ce(Fe,"maxStringLength")&&(typeof Fe.maxStringLength=="number"?Fe.maxStringLength<0&&Fe.maxStringLength!==1/0:Fe.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var nt=ce(Fe,"customInspect")?Fe.customInspect:!0;if(typeof nt!="boolean"&&nt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(ce(Fe,"indent")&&Fe.indent!==null&&Fe.indent!==" "&&!(parseInt(Fe.indent,10)===Fe.indent&&Fe.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(ce(Fe,"numericSeparator")&&typeof Fe.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var rt=Fe.numericSeparator;if(typeof J>"u")return"undefined";if(J===null)return"null";if(typeof J=="boolean")return J?"true":"false";if(typeof J=="string")return fe(J,Fe);if(typeof J=="number"){if(J===0)return 1/0/J>0?"0":"-0";var Ke=String(J);return rt?ee(J,Ke):Ke}if(typeof J=="bigint"){var Xe=String(J)+"n";return rt?ee(J,Xe):Xe}var Ue=typeof Fe.depth>"u"?5:Fe.depth;if(typeof Re>"u"&&(Re=0),Re>=Ue&&Ue>0&&typeof J=="object")return he(J)?"[Array]":"[Object]";var Ye=B(Fe,Re);if(typeof Me>"u")Me=[];else if(se(Me,J)>=0)return"[Circular]";function Ze(Ge,Ve,ze){if(Ve&&(Me=T.call(Me),Me.push(Ve)),ze){var it={depth:Fe.depth};return ce(Fe,"quoteStyle")&&(it.quoteStyle=Fe.quoteStyle),$(Ge,it,Re+1,Me)}return $(Ge,Fe,Re+1,Me)}if(typeof J=="function"&&!Ee(J)){var lt=Y(J),ct=ie(J,Ze);return"[Function"+(lt?": "+lt:" (anonymous)")+"]"+(ct.length>0?" { "+I.call(ct,", ")+" }":"")}if(te(J)){var Et=q?_.call(String(J),/^(Symbol\(.*\))_[^)]*$/,"$1"):M.call(J);return typeof J=="object"&&!q?f(Et):Et}if(Ie(J)){for(var j="<"+v.call(String(J.nodeName)),U=J.attributes||[],Ae=0;Ae<U.length;Ae++)j+=" "+U[Ae].name+"="+R(Q(U[Ae].value),"double",Fe);return j+=">",J.childNodes&&J.childNodes.length&&(j+="..."),j+="</"+v.call(String(J.nodeName))+">",j}if(he(J)){if(J.length===0)return"[]";var Ce=ie(J,Ze);return Ye&&!O(Ce)?"["+V(Ce,Ye)+"]":"[ "+I.call(Ce,", ")+" ]"}if(X(J)){var Be=ie(J,Ze);return!("cause"in Error.prototype)&&"cause"in J&&!le.call(J,"cause")?"{ ["+String(J)+"] "+I.call(P.call("[cause]: "+Ze(J.cause),Be),", ")+" }":Be.length===0?"["+String(J)+"]":"{ ["+String(J)+"] "+I.call(Be,", ")+" }"}if(typeof J=="object"&&nt){if(oe&&typeof J[oe]=="function"&&ue)return ue(J,{depth:Ue-Re});if(nt!=="symbol"&&typeof J.inspect=="function")return J.inspect()}if(me(J)){var ft=[];return a&&a.call(J,function(Ge,Ve){ft.push(Ze(Ve,J,!0)+" => "+Ze(Ge,J))}),m("Map",s.call(J),ft,Ye)}if(Z(J)){var yt=[];return n&&n.call(J,function(Ge){yt.push(Ze(Ge,J))}),m("Set",r.call(J),yt,Ye)}if(pe(J))return p("WeakMap");if(ve(J))return p("WeakSet");if(_e(J))return p("WeakRef");if(ae(J))return f(Ze(Number(J)));if(ne(J))return f(Ze(W.call(J)));if(H(J))return f(b.call(J));if(D(J))return f(Ze(String(J)));if(typeof window<"u"&&J===window)return"{ [object Window] }";if(typeof globalThis<"u"&&J===globalThis||typeof Yr<"u"&&J===Yr)return"{ [object globalThis] }";if(!z(J)&&!Ee(J)){var At=ie(J,Ze),K=re?re(J)===Object.prototype:J instanceof Object||J.constructor===Object,xe=J instanceof Object?"":"null prototype",je=!K&&N&&Object(J)===J&&N in J?g.call(L(J),8,-1):xe?"Object":"",We=K||typeof J.constructor!="function"?"":J.constructor.name?J.constructor.name+" ":"",He=We+(je||xe?"["+I.call(P.call([],je||[],xe||[]),": ")+"] ":"");return At.length===0?He+"{}":Ye?He+"{"+V(At,Ye)+"}":He+"{ "+I.call(At,", ")+" }"}return String(J)};function R($,J,Te){var Re=(Te.quoteStyle||J)==="double"?'"':"'";return Re+$+Re}function Q($){return _.call(String($),/"/g,""")}function he($){return L($)==="[object Array]"&&(!N||!(typeof $=="object"&&N in $))}function z($){return L($)==="[object Date]"&&(!N||!(typeof $=="object"&&N in $))}function Ee($){return L($)==="[object RegExp]"&&(!N||!(typeof $=="object"&&N in $))}function X($){return L($)==="[object Error]"&&(!N||!(typeof $=="object"&&N in $))}function D($){return L($)==="[object String]"&&(!N||!(typeof $=="object"&&N in $))}function ae($){return L($)==="[object Number]"&&(!N||!(typeof $=="object"&&N in $))}function H($){return L($)==="[object Boolean]"&&(!N||!(typeof $=="object"&&N in $))}function te($){if(q)return $&&typeof $=="object"&&$ instanceof Symbol;if(typeof $=="symbol")return!0;if(!$||typeof $!="object"||!M)return!1;try{return M.call($),!0}catch{}return!1}function ne($){if(!$||typeof $!="object"||!W)return!1;try{return W.call($),!0}catch{}return!1}var be=Object.prototype.hasOwnProperty||function($){return $ in(this||Yr)};function ce($,J){return be.call($,J)}function L($){return S.call($)}function Y($){if($.name)return $.name;var J=x.call(w.call($),/^function\s*([\w$]+)/);return J?J[1]:null}function se($,J){if($.indexOf)return $.indexOf(J);for(var Te=0,Re=$.length;Te<Re;Te++)if($[Te]===J)return Te;return-1}function me($){if(!s||!$||typeof $!="object")return!1;try{s.call($);try{r.call($)}catch{return!0}return $ instanceof Map}catch{}return!1}function pe($){if(!i||!$||typeof $!="object")return!1;try{i.call($,i);try{h.call($,h)}catch{return!0}return $ instanceof WeakMap}catch{}return!1}function _e($){if(!y||!$||typeof $!="object")return!1;try{return y.call($),!0}catch{}return!1}function Z($){if(!r||!$||typeof $!="object")return!1;try{r.call($);try{s.call($)}catch{return!0}return $ instanceof Set}catch{}return!1}function ve($){if(!h||!$||typeof $!="object")return!1;try{h.call($,h);try{i.call($,i)}catch{return!0}return $ instanceof WeakSet}catch{}return!1}function Ie($){return!$||typeof $!="object"?!1:typeof HTMLElement<"u"&&$ instanceof HTMLElement?!0:typeof $.nodeName=="string"&&typeof $.getAttribute=="function"}function fe($,J){if($.length>J.maxStringLength){var Te=$.length-J.maxStringLength,Re="... "+Te+" more character"+(Te>1?"s":"");return fe(g.call($,0,J.maxStringLength),J)+Re}var Me=_.call(_.call($,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,De);return R(Me,"single",J)}function De($){var J=$.charCodeAt(0),Te={8:"b",9:"t",10:"n",12:"f",13:"r"}[J];return Te?"\\"+Te:"\\x"+(J<16?"0":"")+E.call(J.toString(16))}function f($){return"Object("+$+")"}function p($){return $+" { ? }"}function m($,J,Te,Re){var Me=Re?V(Te,Re):I.call(Te,", ");return $+" ("+J+") {"+Me+"}"}function O($){for(var J=0;J<$.length;J++)if(se($[J],`
|
|
33
33
|
`)>=0)return!1;return!0}function B($,J){var Te;if($.indent===" ")Te=" ";else if(typeof $.indent=="number"&&$.indent>0)Te=I.call(Array($.indent+1)," ");else return null;return{base:Te,prev:I.call(Array(J+1),Te)}}function V($,J){if($.length===0)return"";var Te=`
|
|
34
34
|
`+J.prev+J.base;return Te+I.call($,","+Te)+`
|
|
35
|
-
`+J.prev}function ie($,J){var Te=he($),Re=[];if(Te){Re.length=$.length;for(var Ne=0;Ne<$.length;Ne++)Re[Ne]=ce($,Ne)?J($[Ne],$):""}var Fe=typeof A=="function"?A($):[],nt;if(q){nt={};for(var rt=0;rt<Fe.length;rt++)nt["$"+Fe[rt]]=Fe[rt]}for(var Ke in $)ce($,Ke)&&(Te&&String(Number(Ke))===Ke&&Ke<$.length||q&&nt["$"+Ke]instanceof Symbol||(C.call(/[^\w$]/,Ke)?Re.push(J(Ke,$)+": "+J($[Ke],$)):Re.push(Ke+": "+J($[Ke],$))));if(typeof A=="function")for(var Xe=0;Xe<Fe.length;Xe++)le.call($,Fe[Xe])&&Re.push("["+J(Fe[Xe])+"]: "+J($[Fe[Xe]],$));return Re}return Gr}function gf(){if(bo)return Qr;bo=!0;var o=lr(),l=Zc(),a=df(),s=vr(),u=o("%WeakMap%",!0),t=o("%Map%",!0),r=l("WeakMap.prototype.get",!0),n=l("WeakMap.prototype.set",!0),e=l("WeakMap.prototype.has",!0),i=l("Map.prototype.get",!0),c=l("Map.prototype.set",!0),h=l("Map.prototype.has",!0),d=function(w,x){for(var g=w,_;(_=g.next)!==null;g=_)if(_.key===x)return g.next=_.next,_.next=w.next,w.next=_,_},y=function(w,x){var g=d(w,x);return g&&g.value},b=function(w,x,g){var _=d(w,x);_?_.value=g:w.next={key:x,next:w.next,value:g}},S=function(w,x){return!!d(w,x)};return Qr=function(){var w,x,g,_={assert:function(E){if(!_.has(E))throw new s("Side channel does not contain "+a(E))},get:function(E){if(u&&E&&(typeof E=="object"||typeof E=="function")){if(w)return r(w,E)}else if(t){if(x)return i(x,E)}else if(g)return y(g,E)},has:function(E){if(u&&E&&(typeof E=="object"||typeof E=="function")){if(w)return e(w,E)}else if(t){if(x)return h(x,E)}else if(g)return S(g,E);return!1},set:function(E,v){u&&E&&(typeof E=="object"||typeof E=="function")?(w||(w=new u),n(w,E,v)):t?(x||(x=new t),c(x,E,v)):(g||(g={key:{},next:null}),b(g,E,v))}};return _},Qr}function yo(){if(vo)return Jr;vo=!0;var o=String.prototype.replace,l=/%20/g,a={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Jr={default:a.RFC3986,formatters:{RFC1738:function(s){return o.call(s,l,"+")},RFC3986:function(s){return String(s)}},RFC1738:a.RFC1738,RFC3986:a.RFC3986},Jr}function Ka(){if(wo)return Xr;wo=!0;var o=yo(),l=Object.prototype.hasOwnProperty,a=Array.isArray,s=function(){for(var w=[],x=0;x<256;++x)w.push("%"+((x<16?"0":"")+x.toString(16)).toUpperCase());return w}(),u=function(w){for(;w.length>1;){var x=w.pop(),g=x.obj[x.prop];if(a(g)){for(var _=[],E=0;E<g.length;++E)typeof g[E]<"u"&&_.push(g[E]);x.obj[x.prop]=_}}},t=function(w,x){for(var g=x&&x.plainObjects?Object.create(null):{},_=0;_<w.length;++_)typeof w[_]<"u"&&(g[_]=w[_]);return g},r=function w(x,g,_){if(!g)return x;if(typeof g!="object"){if(a(x))x.push(g);else if(x&&typeof x=="object")(_&&(_.plainObjects||_.allowPrototypes)||!l.call(Object.prototype,g))&&(x[g]=!0);else return[x,g];return x}if(!x||typeof x!="object")return[x].concat(g);var E=x;return a(x)&&!a(g)&&(E=t(x,_)),a(x)&&a(g)?(g.forEach(function(v,C){if(l.call(x,C)){var P=x[C];P&&typeof P=="object"&&v&&typeof v=="object"?x[C]=w(P,v,_):x.push(v)}else x[C]=v}),x):Object.keys(g).reduce(function(v,C){var P=g[C];return l.call(v,C)?v[C]=w(v[C],P,_):v[C]=P,v},E)},n=function(w,x){return Object.keys(x).reduce(function(g,_){return g[_]=x[_],g},w)},e=function(w,x,g){var _=w.replace(/\+/g," ");if(g==="iso-8859-1")return _.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(_)}catch{return _}},i=1024,c=function(w,x,g,_,E){if(w.length===0)return w;var v=w;if(typeof w=="symbol"?v=Symbol.prototype.toString.call(w):typeof w!="string"&&(v=String(w)),g==="iso-8859-1")return escape(v).replace(/%u[0-9a-f]{4}/gi,function(A){return"%26%23"+parseInt(A.slice(2),16)+"%3B"});for(var C="",P=0;P<v.length;P+=i){for(var I=v.length>=i?v.slice(P,P+i):v,T=[],k=0;k<I.length;++k){var W=I.charCodeAt(k);if(W===45||W===46||W===95||W===126||W>=48&&W<=57||W>=65&&W<=90||W>=97&&W<=122||E===o.RFC1738&&(W===40||W===41)){T[T.length]=I.charAt(k);continue}if(W<128){T[T.length]=s[W];continue}if(W<2048){T[T.length]=s[192|W>>6]+s[128|W&63];continue}if(W<55296||W>=57344){T[T.length]=s[224|W>>12]+s[128|W>>6&63]+s[128|W&63];continue}k+=1,W=65536+((W&1023)<<10|I.charCodeAt(k)&1023),T[T.length]=s[240|W>>18]+s[128|W>>12&63]+s[128|W>>6&63]+s[128|W&63]}C+=T.join("")}return C},h=function(w){for(var x=[{obj:{o:w},prop:"o"}],g=[],_=0;_<x.length;++_)for(var E=x[_],v=E.obj[E.prop],C=Object.keys(v),P=0;P<C.length;++P){var I=C[P],T=v[I];typeof T=="object"&&T!==null&&g.indexOf(T)===-1&&(x.push({obj:v,prop:I}),g.push(T))}return u(x),w},d=function(w){return Object.prototype.toString.call(w)==="[object RegExp]"},y=function(w){return!w||typeof w!="object"?!1:!!(w.constructor&&w.constructor.isBuffer&&w.constructor.isBuffer(w))},b=function(w,x){return[].concat(w,x)},S=function(w,x){if(a(w)){for(var g=[],_=0;_<w.length;_+=1)g.push(x(w[_]));return g}return x(w)};return Xr={arrayToObject:t,assign:n,combine:b,compact:h,decode:e,encode:c,isBuffer:y,isRegExp:d,maybeMap:S,merge:r},Xr}function yf(){if(_o)return Zr;_o=!0;var o=gf(),l=Ka(),a=yo(),s=Object.prototype.hasOwnProperty,u={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,w){return S+"["+w+"]"},repeat:function(S){return S}},t=Array.isArray,r=Array.prototype.push,n=function(S,w){r.apply(S,t(w)?w:[w])},e=Date.prototype.toISOString,i=a.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:l.encode,encodeValuesOnly:!1,format:i,formatter:a.formatters[i],indices:!1,serializeDate:function(S){return e.call(S)},skipNulls:!1,strictNullHandling:!1},h=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},d={},y=function S(w,x,g,_,E,v,C,P,I,T,k,W,A,N,q,M,le,re){for(var ee=w,ue=re,G=0,oe=!1;(ue=ue.get(d))!==void 0&&!oe;){var R=ue.get(w);if(G+=1,typeof R<"u"){if(R===G)throw new RangeError("Cyclic object value");oe=!0}typeof ue.get(d)>"u"&&(G=0)}if(typeof T=="function"?ee=T(x,ee):ee instanceof Date?ee=A(ee):g==="comma"&&t(ee)&&(ee=l.maybeMap(ee,function(L){return L instanceof Date?A(L):L})),ee===null){if(v)return I&&!M?I(x,c.encoder,le,"key",N):x;ee=""}if(h(ee)||l.isBuffer(ee)){if(I){var Q=M?x:I(x,c.encoder,le,"key",N);return[q(Q)+"="+q(I(ee,c.encoder,le,"value",N))]}return[q(x)+"="+q(String(ee))]}var he=[];if(typeof ee>"u")return he;var z;if(g==="comma"&&t(ee))M&&I&&(ee=l.maybeMap(ee,I)),z=[{value:ee.length>0?ee.join(",")||null:void 0}];else if(t(T))z=T;else{var Ee=Object.keys(ee);z=k?Ee.sort(k):Ee}var X=P?x.replace(/\./g,"%2E"):x,D=_&&t(ee)&&ee.length===1?X+"[]":X;if(E&&t(ee)&&ee.length===0)return D+"[]";for(var ae=0;ae<z.length;++ae){var H=z[ae],te=typeof H=="object"&&typeof H.value<"u"?H.value:ee[H];if(!(C&&te===null)){var ne=W&&P?H.replace(/\./g,"%2E"):H,be=t(ee)?typeof g=="function"?g(D,ne):D:D+(W?"."+ne:"["+ne+"]");re.set(w,G);var ce=o();ce.set(d,re),n(he,S(te,be,g,_,E,v,C,P,g==="comma"&&M&&t(ee)?null:I,T,k,W,A,N,q,M,le,ce))}}return he},b=function(S){if(!S)return c;if(typeof S.allowEmptyArrays<"u"&&typeof S.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof S.encodeDotInKeys<"u"&&typeof S.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var w=S.charset||c.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var x=a.default;if(typeof S.format<"u"){if(!s.call(a.formatters,S.format))throw new TypeError("Unknown format option provided.");x=S.format}var g=a.formatters[x],_=c.filter;(typeof S.filter=="function"||t(S.filter))&&(_=S.filter);var E;if(S.arrayFormat in u?E=S.arrayFormat:"indices"in S?E=S.indices?"indices":"repeat":E=c.arrayFormat,"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=typeof S.allowDots>"u"?S.encodeDotInKeys===!0?!0:c.allowDots:!!S.allowDots;return{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:c.addQueryPrefix,allowDots:v,allowEmptyArrays:typeof S.allowEmptyArrays=="boolean"?!!S.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:E,charset:w,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:c.charsetSentinel,commaRoundTrip:S.commaRoundTrip,delimiter:typeof S.delimiter>"u"?c.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:c.encode,encodeDotInKeys:typeof S.encodeDotInKeys=="boolean"?S.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof S.encoder=="function"?S.encoder:c.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:c.encodeValuesOnly,filter:_,format:x,formatter:g,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:c.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:c.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:c.strictNullHandling}};return Zr=function(S,w){var x=S,g=b(w),_,E;typeof g.filter=="function"?(E=g.filter,x=E("",x)):t(g.filter)&&(E=g.filter,_=E);var v=[];if(typeof x!="object"||x===null)return"";var C=u[g.arrayFormat],P=C==="comma"&&g.commaRoundTrip;_||(_=Object.keys(x)),g.sort&&_.sort(g.sort);for(var I=o(),T=0;T<_.length;++T){var k=_[T];g.skipNulls&&x[k]===null||n(v,y(x[k],k,C,P,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,I))}var W=v.join(g.delimiter),A=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?A+="utf8=%26%2310003%3B&":A+="utf8=%E2%9C%93&"),W.length>0?A+W:""},Zr}function mf(){if(So)return en;So=!0;var o=Ka(),l=Object.prototype.hasOwnProperty,a=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},u=function(d){return d.replace(/&#(\d+);/g,function(y,b){return String.fromCharCode(parseInt(b,10))})},t=function(d,y){return d&&typeof d=="string"&&y.comma&&d.indexOf(",")>-1?d.split(","):d},r="utf8=%26%2310003%3B",n="utf8=%E2%9C%93",e=function(d,y){var b={__proto__:null},S=y.ignoreQueryPrefix?d.replace(/^\?/,""):d;S=S.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var w=y.parameterLimit===1/0?void 0:y.parameterLimit,x=S.split(y.delimiter,w),g=-1,_,E=y.charset;if(y.charsetSentinel)for(_=0;_<x.length;++_)x[_].indexOf("utf8=")===0&&(x[_]===n?E="utf-8":x[_]===r&&(E="iso-8859-1"),g=_,_=x.length);for(_=0;_<x.length;++_)if(_!==g){var v=x[_],C=v.indexOf("]="),P=C===-1?v.indexOf("="):C+1,I,T;P===-1?(I=y.decoder(v,s.decoder,E,"key"),T=y.strictNullHandling?null:""):(I=y.decoder(v.slice(0,P),s.decoder,E,"key"),T=o.maybeMap(t(v.slice(P+1),y),function(W){return y.decoder(W,s.decoder,E,"value")})),T&&y.interpretNumericEntities&&E==="iso-8859-1"&&(T=u(T)),v.indexOf("[]=")>-1&&(T=a(T)?[T]:T);var k=l.call(b,I);k&&y.duplicates==="combine"?b[I]=o.combine(b[I],T):(!k||y.duplicates==="last")&&(b[I]=T)}return b},i=function(d,y,b,S){for(var w=S?y:t(y,b),x=d.length-1;x>=0;--x){var g,_=d[x];if(_==="[]"&&b.parseArrays)g=b.allowEmptyArrays&&(w===""||b.strictNullHandling&&w===null)?[]:[].concat(w);else{g=b.plainObjects?Object.create(null):{};var E=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,v=b.decodeDotInKeys?E.replace(/%2E/g,"."):E,C=parseInt(v,10);!b.parseArrays&&v===""?g={0:w}:!isNaN(C)&&_!==v&&String(C)===v&&C>=0&&b.parseArrays&&C<=b.arrayLimit?(g=[],g[C]=w):v!=="__proto__"&&(g[v]=w)}w=g}return w},c=function(d,y,b,S){if(d){var w=b.allowDots?d.replace(/\.([^.[]+)/g,"[$1]"):d,x=/(\[[^[\]]*])/,g=/(\[[^[\]]*])/g,_=b.depth>0&&x.exec(w),E=_?w.slice(0,_.index):w,v=[];if(E){if(!b.plainObjects&&l.call(Object.prototype,E)&&!b.allowPrototypes)return;v.push(E)}for(var C=0;b.depth>0&&(_=g.exec(w))!==null&&C<b.depth;){if(C+=1,!b.plainObjects&&l.call(Object.prototype,_[1].slice(1,-1))&&!b.allowPrototypes)return;v.push(_[1])}if(_){if(b.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+b.depth+" and strictDepth is true");v.push("["+w.slice(_.index)+"]")}return i(v,y,b,S)}},h=function(d){if(!d)return s;if(typeof d.allowEmptyArrays<"u"&&typeof d.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof d.decodeDotInKeys<"u"&&typeof d.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(d.decoder!==null&&typeof d.decoder<"u"&&typeof d.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof d.charset<"u"&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=typeof d.charset>"u"?s.charset:d.charset,b=typeof d.duplicates>"u"?s.duplicates:d.duplicates;if(b!=="combine"&&b!=="first"&&b!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var S=typeof d.allowDots>"u"?d.decodeDotInKeys===!0?!0:s.allowDots:!!d.allowDots;return{allowDots:S,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:typeof d.allowPrototypes=="boolean"?d.allowPrototypes:s.allowPrototypes,allowSparse:typeof d.allowSparse=="boolean"?d.allowSparse:s.allowSparse,arrayLimit:typeof d.arrayLimit=="number"?d.arrayLimit:s.arrayLimit,charset:y,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:s.charsetSentinel,comma:typeof d.comma=="boolean"?d.comma:s.comma,decodeDotInKeys:typeof d.decodeDotInKeys=="boolean"?d.decodeDotInKeys:s.decodeDotInKeys,decoder:typeof d.decoder=="function"?d.decoder:s.decoder,delimiter:typeof d.delimiter=="string"||o.isRegExp(d.delimiter)?d.delimiter:s.delimiter,depth:typeof d.depth=="number"||d.depth===!1?+d.depth:s.depth,duplicates:b,ignoreQueryPrefix:d.ignoreQueryPrefix===!0,interpretNumericEntities:typeof d.interpretNumericEntities=="boolean"?d.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:typeof d.parameterLimit=="number"?d.parameterLimit:s.parameterLimit,parseArrays:d.parseArrays!==!1,plainObjects:typeof d.plainObjects=="boolean"?d.plainObjects:s.plainObjects,strictDepth:typeof d.strictDepth=="boolean"?!!d.strictDepth:s.strictDepth,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:s.strictNullHandling}};return en=function(d,y){var b=h(y);if(d===""||d===null||typeof d>"u")return b.plainObjects?Object.create(null):{};for(var S=typeof d=="string"?e(d,b):d,w=b.plainObjects?Object.create(null):{},x=Object.keys(S),g=0;g<x.length;++g){var _=x[g],E=c(_,S[_],b,typeof d=="string");w=o.merge(w,E,b)}return b.allowSparse===!0?w:o.compact(w)},en}function bf(){if(Eo)return tn;Eo=!0;var o=yf(),l=mf(),a=yo();return tn={formats:a,parse:l,stringify:o},tn}function vf(){if(xo)return zt;xo=!0;var o=$t;function l(){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 a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,t=["<",">",'"',"`"," ","\r",`
|
|
36
|
-
`," "],r=["{","}","|","\\","^","`"].concat(t),n=["'"].concat(r),e=["%","/","?",";","#"].concat(n),i=["/","?","#"],c=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=bf();function x(v,C,P){if(v&&typeof v=="object"&&v instanceof l)return v;var I=new l;return I.parse(v,C,P),I}l.prototype.parse=function(v,C,P){if(typeof v!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof v);var I=v.indexOf("?"),T=I!==-1&&I<v.indexOf("#")?"?":"#",k=v.split(T),W=/\\/g;k[0]=k[0].replace(W,"/"),v=k.join(T);var A=v;if(A=A.trim(),!P&&v.split("#").length===1){var
|
|
37
|
-
`)&&(l=l.replace(cl,"%0A")),l.includes("\r")&&(l=l.replace(fl,"%0D")),l.includes(" ")&&(l=l.replace(hl,"%09")),s.pathname=l,s}var Ya,Gr,mo,Yr,Qr,bo,Jr,vo,Xr,wo,Zr,_o,en,So,tn,Eo,zt,xo,vt,Qa,Ja,Xa,Za,el,tl,rl,nl,il,ol,sl,rn,al,ll,ul,cl,fl,hl,Sf=_t(()=>{de(),ye(),ge(),Uc(),ef(),pf(),za(),Ya=Object.freeze(Object.create(null)),Gr={},mo=!1,Yr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Qr={},bo=!1,Jr={},vo=!1,Xr={},wo=!1,Zr={},_o=!1,en={},So=!1,tn={},Eo=!1,zt={},xo=!1,vt=vf(),vt.parse,vt.resolve,vt.resolveObject,vt.format,vt.Url,Qa=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,vt.URL=typeof URL<"u"?URL:null,vt.pathToFileURL=Ga,vt.fileURLToPath=Ha,Ja=vt.Url,Xa=vt.format,Za=vt.resolve,el=vt.resolveObject,tl=vt.parse,rl=vt.URL,nl=92,il=47,ol=97,sl=122,rn=Qa==="win32",al=/\//g,ll=/%/g,ul=/\\/g,cl=/\n/g,fl=/\r/g,hl=/\t/g}),Ef=we((o,l)=>{de(),ye(),ge(),l.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Ao=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.BufferedDuplex=void 0,o.writev=s;var l=Xt(),a=(dt(),tt(pt));function s(t,r){let n=new Array(t.length);for(let e=0;e<t.length;e++)typeof t[e].chunk=="string"?n[e]=a.Buffer.from(t[e].chunk,"utf8"):n[e]=t[e].chunk;this._write(a.Buffer.concat(n),"binary",r)}var u=class extends l.Duplex{constructor(r,n,e){super({objectMode:!0});Pe(this,"socket");Pe(this,"proxy");Pe(this,"isSocketOpen");Pe(this,"writeQueue");this.proxy=n,this.socket=e,this.writeQueue=[],r.objectMode||(this._writev=s.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",i=>{!this.destroyed&&this.readable&&this.push(i)})}_read(r){this.proxy.read(r)}_write(r,n,e){this.isSocketOpen?this.writeToProxy(r,n,e):this.writeQueue.push({chunk:r,encoding:n,cb:e})}_final(r){this.writeQueue=[],this.proxy.end(r)}_destroy(r,n){this.writeQueue=[],this.proxy.destroy(),n(r)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(r,n,e){this.proxy.write(r,n)===!1?this.proxy.once("drain",e):e()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:r,encoding:n,cb:e}=this.writeQueue.shift();this.writeToProxy(r,n,e)}}};o.BufferedDuplex=u}),nn=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(o,"__esModule",{value:!0}),o.streamBuilder=o.browserStreamBuilder=void 0;var a=(dt(),tt(pt)),s=l(Ef()),u=l(Nt()),t=Xt(),r=l(Cr()),n=Ao(),e=(0,u.default)("mqttjs:ws"),i=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(x,g){let _=`${x.protocol}://${x.hostname}:${x.port}${x.path}`;return typeof x.transformWsUrl=="function"&&(_=x.transformWsUrl(_,x,g)),_}function h(x){let g=x;return x.port||(x.protocol==="wss"?g.port=443:g.port=80),x.path||(g.path="/"),x.wsOptions||(g.wsOptions={}),!r.default&&!x.forceNativeWebSocket&&x.protocol==="wss"&&i.forEach(_=>{Object.prototype.hasOwnProperty.call(x,_)&&!Object.prototype.hasOwnProperty.call(x.wsOptions,_)&&(g.wsOptions[_]=x[_])}),g}function d(x){let g=h(x);if(g.hostname||(g.hostname=g.host),!g.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let _=new URL(document.URL);g.hostname=_.hostname,g.port||(g.port=Number(_.port))}return g.objectMode===void 0&&(g.objectMode=!(g.binary===!0||g.binary===void 0)),g}function y(x,g,_){e("createWebSocket"),e(`protocol: ${_.protocolId} ${_.protocolVersion}`);let E=_.protocolId==="MQIsdp"&&_.protocolVersion===3?"mqttv3.1":"mqtt";e(`creating new Websocket for url: ${g} and protocol: ${E}`);let v;return _.createWebsocket?v=_.createWebsocket(g,[E],_):v=new s.default(g,[E],_.wsOptions),v}function b(x,g){let _=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt",E=c(g,x),v;return g.createWebsocket?v=g.createWebsocket(E,[_],g):v=new WebSocket(E,[_]),v.binaryType="arraybuffer",v}var S=(x,g)=>{e("streamBuilder");let _=h(g);_.hostname=_.hostname||_.host||"localhost";let E=c(_,x),v=y(x,E,_),C=s.default.createWebSocketStream(v,_.wsOptions);return C.url=E,v.on("close",()=>{C.destroy()}),C};o.streamBuilder=S;var w=(x,g)=>{e("browserStreamBuilder");let _,E=d(g).browserBufferSize||1024*512,v=g.browserBufferTimeout||1e3,C=!g.objectMode,P=b(x,g),I=k(g,M,le);g.objectMode||(I._writev=n.writev.bind(I)),I.on("close",()=>{P.close()});let T=typeof P.addEventListener<"u";P.readyState===P.OPEN?(_=I,_.socket=P):(_=new n.BufferedDuplex(g,I,P),T?P.addEventListener("open",W):P.onopen=W),T?(P.addEventListener("close",A),P.addEventListener("error",N),P.addEventListener("message",q)):(P.onclose=A,P.onerror=N,P.onmessage=q);function k(re,ee,ue){let G=new t.Transform({objectMode:re.objectMode});return G._write=ee,G._flush=ue,G}function W(){e("WebSocket onOpen"),_ instanceof n.BufferedDuplex&&_.socketReady()}function A(re){e("WebSocket onClose",re),_.end(),_.destroy()}function N(re){e("WebSocket onError",re);let ee=new Error("WebSocket error");ee.event=re,_.destroy(ee)}async function q(re){if(!I||!I.readable||!I.writable)return;let{data:ee}=re;ee instanceof ArrayBuffer?ee=a.Buffer.from(ee):ee instanceof Blob?ee=a.Buffer.from(await new Response(ee).arrayBuffer()):ee=a.Buffer.from(ee,"utf8"),I.push(ee)}function M(re,ee,ue){if(P.bufferedAmount>E){setTimeout(M,v,re,ee,ue);return}C&&typeof re=="string"&&(re=a.Buffer.from(re,"utf8"));try{P.send(re)}catch(G){return ue(G)}ue()}function le(re){P.close(),re()}return _};o.browserStreamBuilder=w}),Io={};nr(Io,{Server:()=>at,Socket:()=>at,Stream:()=>at,_createServerHandle:()=>at,_normalizeArgs:()=>at,_setSimultaneousAccepts:()=>at,connect:()=>at,createConnection:()=>at,createServer:()=>at,default:()=>pl,isIP:()=>at,isIPv4:()=>at,isIPv6:()=>at});function at(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var pl,dl=_t(()=>{de(),ye(),ge(),pl={_createServerHandle:at,_normalizeArgs:at,_setSimultaneousAccepts:at,connect:at,createConnection:at,createServer:at,isIP:at,isIPv4:at,isIPv6:at,Server:at,Socket:at,Stream:at}}),gl=we((o,l)=>{de(),ye(),ge(),l.exports={}}),yl=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(o,"__esModule",{value:!0});var a=l((dl(),tt(Io))),s=l(Nt()),u=l(gl()),t=(0,s.default)("mqttjs:tcp"),r=(n,e)=>{if(e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",e.socksProxy)return(0,u.default)(e.hostname,e.port,e.socksProxy,{timeout:e.socksTimeout});let{port:i,path:c}=e,h=e.hostname;return t("port %d and host %s",i,h),a.default.createConnection({port:i,host:h,path:c})};o.default=r}),ml={};nr(ml,{default:()=>bl});var bl,xf=_t(()=>{de(),ye(),ge(),bl={}}),vl=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(o,"__esModule",{value:!0});var a=(xf(),tt(ml)),s=l((dl(),tt(Io))),u=l(Nt()),t=l(gl()),r=(0,u.default)("mqttjs:tls");function n(i){let{host:c,port:h,socksProxy:d,...y}=i;if(d!==void 0){let b=(0,t.default)(c,h,d,{timeout:i.socksTimeout});return(0,a.connect)({...y,socket:b})}return(0,a.connect)(i)}var e=(i,c)=>{c.port=c.port||8883,c.host=c.hostname||c.host||"localhost",s.default.isIP(c.host)===0&&(c.servername=c.host),c.rejectUnauthorized=c.rejectUnauthorized!==!1,delete c.path,r("port %d host %s rejectUnauthorized %b",c.port,c.host,c.rejectUnauthorized);let h=n(c);h.on("secureConnect",()=>{c.rejectUnauthorized&&!h.authorized?h.emit("error",new Error("TLS not authorized")):h.removeListener("error",d)});function d(y){c.rejectUnauthorized&&i.emit("error",y),h.end()}return h.on("error",d),h};o.default=e}),wl=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(dt(),tt(pt)),a=Xt(),s=Ao(),u,t,r;function n(){let d=new a.Transform;return d._write=(y,b,S)=>{u.send({data:y.buffer,success(){S()},fail(w){S(new Error(w))}})},d._flush=y=>{u.close({success(){y()}})},d}function e(d){d.hostname||(d.hostname="localhost"),d.path||(d.path="/"),d.wsOptions||(d.wsOptions={})}function i(d,y){let b=d.protocol==="wxs"?"wss":"ws",S=`${b}://${d.hostname}${d.path}`;return d.port&&d.port!==80&&d.port!==443&&(S=`${b}://${d.hostname}:${d.port}${d.path}`),typeof d.transformWsUrl=="function"&&(S=d.transformWsUrl(S,d,y)),S}function c(){u.onOpen(()=>{r.socketReady()}),u.onMessage(d=>{let{data:y}=d;y instanceof ArrayBuffer?y=l.Buffer.from(y):y=l.Buffer.from(y,"utf8"),t.push(y)}),u.onClose(()=>{r.emit("close"),r.end(),r.destroy()}),u.onError(d=>{let y=new Error(d.errMsg);r.destroy(y)})}var h=(d,y)=>{if(y.hostname=y.hostname||y.host,!y.hostname)throw new Error("Could not determine host. Specify host manually.");let b=y.protocolId==="MQIsdp"&&y.protocolVersion===3?"mqttv3.1":"mqtt";e(y);let S=i(y,d);u=wx.connectSocket({url:S,protocols:[b]}),t=n(),r=new s.BufferedDuplex(y,t,u),r._destroy=(x,g)=>{u.close({success(){g&&g(x)}})};let w=r.destroy;return r.destroy=(x,g)=>(r.destroy=w,setTimeout(()=>{u.close({fail(){r._destroy(x,g)}})},0),r),c(),r};o.default=h}),_l=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(dt(),tt(pt)),a=Xt(),s=Ao(),u,t,r,n=!1;function e(){let y=new a.Transform;return y._write=(b,S,w)=>{u.sendSocketMessage({data:b.buffer,success(){w()},fail(){w(new Error)}})},y._flush=b=>{u.closeSocket({success(){b()}})},y}function i(y){y.hostname||(y.hostname="localhost"),y.path||(y.path="/"),y.wsOptions||(y.wsOptions={})}function c(y,b){let S=y.protocol==="alis"?"wss":"ws",w=`${S}://${y.hostname}${y.path}`;return y.port&&y.port!==80&&y.port!==443&&(w=`${S}://${y.hostname}:${y.port}${y.path}`),typeof y.transformWsUrl=="function"&&(w=y.transformWsUrl(w,y,b)),w}function h(){n||(n=!0,u.onSocketOpen(()=>{r.socketReady()}),u.onSocketMessage(y=>{if(typeof y.data=="string"){let b=l.Buffer.from(y.data,"base64");t.push(b)}else{let b=new FileReader;b.addEventListener("load",()=>{if(b.result instanceof ArrayBuffer){t.push(l.Buffer.from(b.result));return}t.push(l.Buffer.from(b.result,"utf-8"))}),b.readAsArrayBuffer(y.data)}}),u.onSocketClose(()=>{r.end(),r.destroy()}),u.onSocketError(y=>{r.destroy(y)}))}var d=(y,b)=>{if(b.hostname=b.hostname||b.host,!b.hostname)throw new Error("Could not determine host. Specify host manually.");let S=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt";i(b);let w=c(b,y);return u=b.my,u.connectSocket({url:w,protocols:S}),t=e(),r=new s.BufferedDuplex(b,t,u),h(),r};o.default=d}),Af=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(o,"__esModule",{value:!0}),o.connectAsync=c;var a=l(Nt()),s=l((Sf(),tt(Va))),u=l(Pi()),t=l(Cr());typeof(Je==null?void 0:Je.nextTick)!="function"&&(Je.nextTick=setImmediate);var r=(0,a.default)("mqttjs"),n=null;function e(h){let d;if(h.auth)if(d=h.auth.match(/^(.+):(.+)$/),d){let[,y,b]=d;h.username=y,h.password=b}else h.username=h.auth}function i(h,d){var S,w,x;if(r("connecting to an MQTT broker..."),typeof h=="object"&&!d&&(d=h,h=""),d=d||{},h&&typeof h=="string"){let g=s.default.parse(h,!0),_={};if(g.port!=null&&(_.port=Number(g.port)),_.host=g.hostname,_.query=g.query,_.auth=g.auth,_.protocol=g.protocol,_.path=g.path,d={..._,...d},!d.protocol)throw new Error("Missing protocol");d.protocol=d.protocol.replace(/:$/,"")}if(d.unixSocket=d.unixSocket||((S=d.protocol)==null?void 0:S.includes("+unix")),d.unixSocket?d.protocol=d.protocol.replace("+unix",""):!((w=d.protocol)!=null&&w.startsWith("ws"))&&!((x=d.protocol)!=null&&x.startsWith("wx"))&&delete d.path,e(d),d.query&&typeof d.query.clientId=="string"&&(d.clientId=d.query.clientId),t.default||d.unixSocket?d.socksProxy=void 0:d.socksProxy===void 0&&typeof Je<"u"&&(d.socksProxy=Je.env.MQTTJS_SOCKS_PROXY),d.cert&&d.key)if(d.protocol){if(["mqtts","wss","wxs","alis"].indexOf(d.protocol)===-1)switch(d.protocol){case"mqtt":d.protocol="mqtts";break;case"ws":d.protocol="wss";break;case"wx":d.protocol="wxs";break;case"ali":d.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${d.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(n||(n={},!t.default&&!d.forceNativeWebSocket?(n.ws=nn().streamBuilder,n.wss=nn().streamBuilder,n.mqtt=yl().default,n.tcp=yl().default,n.ssl=vl().default,n.tls=n.ssl,n.mqtts=vl().default):(n.ws=nn().browserStreamBuilder,n.wss=nn().browserStreamBuilder,n.wx=wl().default,n.wxs=wl().default,n.ali=_l().default,n.alis=_l().default)),!n[d.protocol]){let g=["mqtts","wss"].indexOf(d.protocol)!==-1;d.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((_,E)=>g&&E%2===0?!1:typeof n[_]=="function")[0]}if(d.clean===!1&&!d.clientId)throw new Error("Missing clientId for unclean clients");d.protocol&&(d.defaultProtocol=d.protocol);function y(g){return d.servers&&((!g._reconnectCount||g._reconnectCount===d.servers.length)&&(g._reconnectCount=0),d.host=d.servers[g._reconnectCount].host,d.port=d.servers[g._reconnectCount].port,d.protocol=d.servers[g._reconnectCount].protocol?d.servers[g._reconnectCount].protocol:d.defaultProtocol,d.hostname=d.host,g._reconnectCount++),r("calling streambuilder for",d.protocol),n[d.protocol](g,d)}let b=new u.default(y,d);return b.on("error",()=>{}),b}function c(h,d,y=!0){return new Promise((b,S)=>{let w=i(h,d),x={connect:_=>{g(),b(w)},end:()=>{g(),b(w)},error:_=>{g(),w.end(),S(_)}};y===!1&&(x.close=()=>{x.error(new Error("Couldn't connect to server"))});function g(){Object.keys(x).forEach(_=>{w.off(_,x[_])})}Object.keys(x).forEach(_=>{w.on(_,x[_])})})}o.default=i}),Sl=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(y,b,S,w){w===void 0&&(w=S);var x=Object.getOwnPropertyDescriptor(b,S);(!x||("get"in x?!b.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return b[S]}}),Object.defineProperty(y,w,x)}:function(y,b,S,w){w===void 0&&(w=S),y[w]=b[S]}),a=o&&o.__setModuleDefault||(Object.create?function(y,b){Object.defineProperty(y,"default",{enumerable:!0,value:b})}:function(y,b){y.default=b}),s=o&&o.__importStar||function(){var y=function(b){return y=Object.getOwnPropertyNames||function(S){var w=[];for(var x in S)Object.prototype.hasOwnProperty.call(S,x)&&(w[w.length]=x);return w},y(b)};return function(b){if(b&&b.__esModule)return b;var S={};if(b!=null)for(var w=y(b),x=0;x<w.length;x++)w[x]!=="default"&&l(S,b,w[x]);return a(S,b),S}}(),u=o&&o.__exportStar||function(y,b){for(var S in y)S!=="default"&&!Object.prototype.hasOwnProperty.call(b,S)&&l(b,y,S)},t=o&&o.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=o.KeepaliveManager=o.UniqueMessageIdProvider=o.DefaultMessageIdProvider=o.Store=o.MqttClient=o.connectAsync=o.connect=o.Client=void 0;var r=t(Pi());o.MqttClient=r.default;var n=t(Ts());o.DefaultMessageIdProvider=n.default;var e=t(Bc());o.UniqueMessageIdProvider=e.default;var i=t(Ss());o.Store=i.default;var c=s(Af());o.connect=c.default,Object.defineProperty(o,"connectAsync",{enumerable:!0,get:function(){return c.connectAsync}});var h=t(Bs());o.KeepaliveManager=h.default,o.Client=r.default,u(Pi(),o),u(ar(),o);var d=Tr();Object.defineProperty(o,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})}),If=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(r,n,e,i){i===void 0&&(i=e);var c=Object.getOwnPropertyDescriptor(n,e);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(r,i,c)}:function(r,n,e,i){i===void 0&&(i=e),r[i]=n[e]}),a=o&&o.__setModuleDefault||(Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n}),s=o&&o.__importStar||function(){var r=function(n){return r=Object.getOwnPropertyNames||function(e){var i=[];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(i[i.length]=c);return i},r(n)};return function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var i=r(n),c=0;c<i.length;c++)i[c]!=="default"&&l(e,n,i[c]);return a(e,n),e}}(),u=o&&o.__exportStar||function(r,n){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(n,e)&&l(n,r,e)};Object.defineProperty(o,"__esModule",{value:!0});var t=s(Sl());o.default=t,u(Sl(),o)});const kf=If();/*! Bundled license information:
|
|
35
|
+
`+J.prev}function ie($,J){var Te=he($),Re=[];if(Te){Re.length=$.length;for(var Me=0;Me<$.length;Me++)Re[Me]=ce($,Me)?J($[Me],$):""}var Fe=typeof A=="function"?A($):[],nt;if(q){nt={};for(var rt=0;rt<Fe.length;rt++)nt["$"+Fe[rt]]=Fe[rt]}for(var Ke in $)ce($,Ke)&&(Te&&String(Number(Ke))===Ke&&Ke<$.length||q&&nt["$"+Ke]instanceof Symbol||(C.call(/[^\w$]/,Ke)?Re.push(J(Ke,$)+": "+J($[Ke],$)):Re.push(Ke+": "+J($[Ke],$))));if(typeof A=="function")for(var Xe=0;Xe<Fe.length;Xe++)le.call($,Fe[Xe])&&Re.push("["+J(Fe[Xe])+"]: "+J($[Fe[Xe]],$));return Re}return Gr}function gf(){if(vo)return Qr;vo=!0;var o=lr(),l=Zc(),s=df(),a=vr(),u=o("%WeakMap%",!0),t=o("%Map%",!0),r=l("WeakMap.prototype.get",!0),n=l("WeakMap.prototype.set",!0),e=l("WeakMap.prototype.has",!0),i=l("Map.prototype.get",!0),c=l("Map.prototype.set",!0),h=l("Map.prototype.has",!0),d=function(w,x){for(var g=w,_;(_=g.next)!==null;g=_)if(_.key===x)return g.next=_.next,_.next=w.next,w.next=_,_},y=function(w,x){var g=d(w,x);return g&&g.value},b=function(w,x,g){var _=d(w,x);_?_.value=g:w.next={key:x,next:w.next,value:g}},S=function(w,x){return!!d(w,x)};return Qr=function(){var w,x,g,_={assert:function(E){if(!_.has(E))throw new a("Side channel does not contain "+s(E))},get:function(E){if(u&&E&&(typeof E=="object"||typeof E=="function")){if(w)return r(w,E)}else if(t){if(x)return i(x,E)}else if(g)return y(g,E)},has:function(E){if(u&&E&&(typeof E=="object"||typeof E=="function")){if(w)return e(w,E)}else if(t){if(x)return h(x,E)}else if(g)return S(g,E);return!1},set:function(E,v){u&&E&&(typeof E=="object"||typeof E=="function")?(w||(w=new u),n(w,E,v)):t?(x||(x=new t),c(x,E,v)):(g||(g={key:{},next:null}),b(g,E,v))}};return _},Qr}function mo(){if(wo)return Jr;wo=!0;var o=String.prototype.replace,l=/%20/g,s={RFC1738:"RFC1738",RFC3986:"RFC3986"};return Jr={default:s.RFC3986,formatters:{RFC1738:function(a){return o.call(a,l,"+")},RFC3986:function(a){return String(a)}},RFC1738:s.RFC1738,RFC3986:s.RFC3986},Jr}function Ka(){if(_o)return Xr;_o=!0;var o=mo(),l=Object.prototype.hasOwnProperty,s=Array.isArray,a=function(){for(var w=[],x=0;x<256;++x)w.push("%"+((x<16?"0":"")+x.toString(16)).toUpperCase());return w}(),u=function(w){for(;w.length>1;){var x=w.pop(),g=x.obj[x.prop];if(s(g)){for(var _=[],E=0;E<g.length;++E)typeof g[E]<"u"&&_.push(g[E]);x.obj[x.prop]=_}}},t=function(w,x){for(var g=x&&x.plainObjects?Object.create(null):{},_=0;_<w.length;++_)typeof w[_]<"u"&&(g[_]=w[_]);return g},r=function w(x,g,_){if(!g)return x;if(typeof g!="object"){if(s(x))x.push(g);else if(x&&typeof x=="object")(_&&(_.plainObjects||_.allowPrototypes)||!l.call(Object.prototype,g))&&(x[g]=!0);else return[x,g];return x}if(!x||typeof x!="object")return[x].concat(g);var E=x;return s(x)&&!s(g)&&(E=t(x,_)),s(x)&&s(g)?(g.forEach(function(v,C){if(l.call(x,C)){var P=x[C];P&&typeof P=="object"&&v&&typeof v=="object"?x[C]=w(P,v,_):x.push(v)}else x[C]=v}),x):Object.keys(g).reduce(function(v,C){var P=g[C];return l.call(v,C)?v[C]=w(v[C],P,_):v[C]=P,v},E)},n=function(w,x){return Object.keys(x).reduce(function(g,_){return g[_]=x[_],g},w)},e=function(w,x,g){var _=w.replace(/\+/g," ");if(g==="iso-8859-1")return _.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(_)}catch{return _}},i=1024,c=function(w,x,g,_,E){if(w.length===0)return w;var v=w;if(typeof w=="symbol"?v=Symbol.prototype.toString.call(w):typeof w!="string"&&(v=String(w)),g==="iso-8859-1")return escape(v).replace(/%u[0-9a-f]{4}/gi,function(A){return"%26%23"+parseInt(A.slice(2),16)+"%3B"});for(var C="",P=0;P<v.length;P+=i){for(var I=v.length>=i?v.slice(P,P+i):v,T=[],k=0;k<I.length;++k){var W=I.charCodeAt(k);if(W===45||W===46||W===95||W===126||W>=48&&W<=57||W>=65&&W<=90||W>=97&&W<=122||E===o.RFC1738&&(W===40||W===41)){T[T.length]=I.charAt(k);continue}if(W<128){T[T.length]=a[W];continue}if(W<2048){T[T.length]=a[192|W>>6]+a[128|W&63];continue}if(W<55296||W>=57344){T[T.length]=a[224|W>>12]+a[128|W>>6&63]+a[128|W&63];continue}k+=1,W=65536+((W&1023)<<10|I.charCodeAt(k)&1023),T[T.length]=a[240|W>>18]+a[128|W>>12&63]+a[128|W>>6&63]+a[128|W&63]}C+=T.join("")}return C},h=function(w){for(var x=[{obj:{o:w},prop:"o"}],g=[],_=0;_<x.length;++_)for(var E=x[_],v=E.obj[E.prop],C=Object.keys(v),P=0;P<C.length;++P){var I=C[P],T=v[I];typeof T=="object"&&T!==null&&g.indexOf(T)===-1&&(x.push({obj:v,prop:I}),g.push(T))}return u(x),w},d=function(w){return Object.prototype.toString.call(w)==="[object RegExp]"},y=function(w){return!w||typeof w!="object"?!1:!!(w.constructor&&w.constructor.isBuffer&&w.constructor.isBuffer(w))},b=function(w,x){return[].concat(w,x)},S=function(w,x){if(s(w)){for(var g=[],_=0;_<w.length;_+=1)g.push(x(w[_]));return g}return x(w)};return Xr={arrayToObject:t,assign:n,combine:b,compact:h,decode:e,encode:c,isBuffer:y,isRegExp:d,maybeMap:S,merge:r},Xr}function yf(){if(So)return Zr;So=!0;var o=gf(),l=Ka(),s=mo(),a=Object.prototype.hasOwnProperty,u={brackets:function(S){return S+"[]"},comma:"comma",indices:function(S,w){return S+"["+w+"]"},repeat:function(S){return S}},t=Array.isArray,r=Array.prototype.push,n=function(S,w){r.apply(S,t(w)?w:[w])},e=Date.prototype.toISOString,i=s.default,c={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:l.encode,encodeValuesOnly:!1,format:i,formatter:s.formatters[i],indices:!1,serializeDate:function(S){return e.call(S)},skipNulls:!1,strictNullHandling:!1},h=function(S){return typeof S=="string"||typeof S=="number"||typeof S=="boolean"||typeof S=="symbol"||typeof S=="bigint"},d={},y=function S(w,x,g,_,E,v,C,P,I,T,k,W,A,M,q,N,le,re){for(var ee=w,ue=re,G=0,oe=!1;(ue=ue.get(d))!==void 0&&!oe;){var R=ue.get(w);if(G+=1,typeof R<"u"){if(R===G)throw new RangeError("Cyclic object value");oe=!0}typeof ue.get(d)>"u"&&(G=0)}if(typeof T=="function"?ee=T(x,ee):ee instanceof Date?ee=A(ee):g==="comma"&&t(ee)&&(ee=l.maybeMap(ee,function(L){return L instanceof Date?A(L):L})),ee===null){if(v)return I&&!N?I(x,c.encoder,le,"key",M):x;ee=""}if(h(ee)||l.isBuffer(ee)){if(I){var Q=N?x:I(x,c.encoder,le,"key",M);return[q(Q)+"="+q(I(ee,c.encoder,le,"value",M))]}return[q(x)+"="+q(String(ee))]}var he=[];if(typeof ee>"u")return he;var z;if(g==="comma"&&t(ee))N&&I&&(ee=l.maybeMap(ee,I)),z=[{value:ee.length>0?ee.join(",")||null:void 0}];else if(t(T))z=T;else{var Ee=Object.keys(ee);z=k?Ee.sort(k):Ee}var X=P?x.replace(/\./g,"%2E"):x,D=_&&t(ee)&&ee.length===1?X+"[]":X;if(E&&t(ee)&&ee.length===0)return D+"[]";for(var ae=0;ae<z.length;++ae){var H=z[ae],te=typeof H=="object"&&typeof H.value<"u"?H.value:ee[H];if(!(C&&te===null)){var ne=W&&P?H.replace(/\./g,"%2E"):H,be=t(ee)?typeof g=="function"?g(D,ne):D:D+(W?"."+ne:"["+ne+"]");re.set(w,G);var ce=o();ce.set(d,re),n(he,S(te,be,g,_,E,v,C,P,g==="comma"&&N&&t(ee)?null:I,T,k,W,A,M,q,N,le,ce))}}return he},b=function(S){if(!S)return c;if(typeof S.allowEmptyArrays<"u"&&typeof S.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof S.encodeDotInKeys<"u"&&typeof S.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(S.encoder!==null&&typeof S.encoder<"u"&&typeof S.encoder!="function")throw new TypeError("Encoder has to be a function.");var w=S.charset||c.charset;if(typeof S.charset<"u"&&S.charset!=="utf-8"&&S.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var x=s.default;if(typeof S.format<"u"){if(!a.call(s.formatters,S.format))throw new TypeError("Unknown format option provided.");x=S.format}var g=s.formatters[x],_=c.filter;(typeof S.filter=="function"||t(S.filter))&&(_=S.filter);var E;if(S.arrayFormat in u?E=S.arrayFormat:"indices"in S?E=S.indices?"indices":"repeat":E=c.arrayFormat,"commaRoundTrip"in S&&typeof S.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var v=typeof S.allowDots>"u"?S.encodeDotInKeys===!0?!0:c.allowDots:!!S.allowDots;return{addQueryPrefix:typeof S.addQueryPrefix=="boolean"?S.addQueryPrefix:c.addQueryPrefix,allowDots:v,allowEmptyArrays:typeof S.allowEmptyArrays=="boolean"?!!S.allowEmptyArrays:c.allowEmptyArrays,arrayFormat:E,charset:w,charsetSentinel:typeof S.charsetSentinel=="boolean"?S.charsetSentinel:c.charsetSentinel,commaRoundTrip:S.commaRoundTrip,delimiter:typeof S.delimiter>"u"?c.delimiter:S.delimiter,encode:typeof S.encode=="boolean"?S.encode:c.encode,encodeDotInKeys:typeof S.encodeDotInKeys=="boolean"?S.encodeDotInKeys:c.encodeDotInKeys,encoder:typeof S.encoder=="function"?S.encoder:c.encoder,encodeValuesOnly:typeof S.encodeValuesOnly=="boolean"?S.encodeValuesOnly:c.encodeValuesOnly,filter:_,format:x,formatter:g,serializeDate:typeof S.serializeDate=="function"?S.serializeDate:c.serializeDate,skipNulls:typeof S.skipNulls=="boolean"?S.skipNulls:c.skipNulls,sort:typeof S.sort=="function"?S.sort:null,strictNullHandling:typeof S.strictNullHandling=="boolean"?S.strictNullHandling:c.strictNullHandling}};return Zr=function(S,w){var x=S,g=b(w),_,E;typeof g.filter=="function"?(E=g.filter,x=E("",x)):t(g.filter)&&(E=g.filter,_=E);var v=[];if(typeof x!="object"||x===null)return"";var C=u[g.arrayFormat],P=C==="comma"&&g.commaRoundTrip;_||(_=Object.keys(x)),g.sort&&_.sort(g.sort);for(var I=o(),T=0;T<_.length;++T){var k=_[T];g.skipNulls&&x[k]===null||n(v,y(x[k],k,C,P,g.allowEmptyArrays,g.strictNullHandling,g.skipNulls,g.encodeDotInKeys,g.encode?g.encoder:null,g.filter,g.sort,g.allowDots,g.serializeDate,g.format,g.formatter,g.encodeValuesOnly,g.charset,I))}var W=v.join(g.delimiter),A=g.addQueryPrefix===!0?"?":"";return g.charsetSentinel&&(g.charset==="iso-8859-1"?A+="utf8=%26%2310003%3B&":A+="utf8=%E2%9C%93&"),W.length>0?A+W:""},Zr}function mf(){if(Eo)return en;Eo=!0;var o=Ka(),l=Object.prototype.hasOwnProperty,s=Array.isArray,a={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:o.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1},u=function(d){return d.replace(/&#(\d+);/g,function(y,b){return String.fromCharCode(parseInt(b,10))})},t=function(d,y){return d&&typeof d=="string"&&y.comma&&d.indexOf(",")>-1?d.split(","):d},r="utf8=%26%2310003%3B",n="utf8=%E2%9C%93",e=function(d,y){var b={__proto__:null},S=y.ignoreQueryPrefix?d.replace(/^\?/,""):d;S=S.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var w=y.parameterLimit===1/0?void 0:y.parameterLimit,x=S.split(y.delimiter,w),g=-1,_,E=y.charset;if(y.charsetSentinel)for(_=0;_<x.length;++_)x[_].indexOf("utf8=")===0&&(x[_]===n?E="utf-8":x[_]===r&&(E="iso-8859-1"),g=_,_=x.length);for(_=0;_<x.length;++_)if(_!==g){var v=x[_],C=v.indexOf("]="),P=C===-1?v.indexOf("="):C+1,I,T;P===-1?(I=y.decoder(v,a.decoder,E,"key"),T=y.strictNullHandling?null:""):(I=y.decoder(v.slice(0,P),a.decoder,E,"key"),T=o.maybeMap(t(v.slice(P+1),y),function(W){return y.decoder(W,a.decoder,E,"value")})),T&&y.interpretNumericEntities&&E==="iso-8859-1"&&(T=u(T)),v.indexOf("[]=")>-1&&(T=s(T)?[T]:T);var k=l.call(b,I);k&&y.duplicates==="combine"?b[I]=o.combine(b[I],T):(!k||y.duplicates==="last")&&(b[I]=T)}return b},i=function(d,y,b,S){for(var w=S?y:t(y,b),x=d.length-1;x>=0;--x){var g,_=d[x];if(_==="[]"&&b.parseArrays)g=b.allowEmptyArrays&&(w===""||b.strictNullHandling&&w===null)?[]:[].concat(w);else{g=b.plainObjects?Object.create(null):{};var E=_.charAt(0)==="["&&_.charAt(_.length-1)==="]"?_.slice(1,-1):_,v=b.decodeDotInKeys?E.replace(/%2E/g,"."):E,C=parseInt(v,10);!b.parseArrays&&v===""?g={0:w}:!isNaN(C)&&_!==v&&String(C)===v&&C>=0&&b.parseArrays&&C<=b.arrayLimit?(g=[],g[C]=w):v!=="__proto__"&&(g[v]=w)}w=g}return w},c=function(d,y,b,S){if(d){var w=b.allowDots?d.replace(/\.([^.[]+)/g,"[$1]"):d,x=/(\[[^[\]]*])/,g=/(\[[^[\]]*])/g,_=b.depth>0&&x.exec(w),E=_?w.slice(0,_.index):w,v=[];if(E){if(!b.plainObjects&&l.call(Object.prototype,E)&&!b.allowPrototypes)return;v.push(E)}for(var C=0;b.depth>0&&(_=g.exec(w))!==null&&C<b.depth;){if(C+=1,!b.plainObjects&&l.call(Object.prototype,_[1].slice(1,-1))&&!b.allowPrototypes)return;v.push(_[1])}if(_){if(b.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+b.depth+" and strictDepth is true");v.push("["+w.slice(_.index)+"]")}return i(v,y,b,S)}},h=function(d){if(!d)return a;if(typeof d.allowEmptyArrays<"u"&&typeof d.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof d.decodeDotInKeys<"u"&&typeof d.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(d.decoder!==null&&typeof d.decoder<"u"&&typeof d.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof d.charset<"u"&&d.charset!=="utf-8"&&d.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var y=typeof d.charset>"u"?a.charset:d.charset,b=typeof d.duplicates>"u"?a.duplicates:d.duplicates;if(b!=="combine"&&b!=="first"&&b!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var S=typeof d.allowDots>"u"?d.decodeDotInKeys===!0?!0:a.allowDots:!!d.allowDots;return{allowDots:S,allowEmptyArrays:typeof d.allowEmptyArrays=="boolean"?!!d.allowEmptyArrays:a.allowEmptyArrays,allowPrototypes:typeof d.allowPrototypes=="boolean"?d.allowPrototypes:a.allowPrototypes,allowSparse:typeof d.allowSparse=="boolean"?d.allowSparse:a.allowSparse,arrayLimit:typeof d.arrayLimit=="number"?d.arrayLimit:a.arrayLimit,charset:y,charsetSentinel:typeof d.charsetSentinel=="boolean"?d.charsetSentinel:a.charsetSentinel,comma:typeof d.comma=="boolean"?d.comma:a.comma,decodeDotInKeys:typeof d.decodeDotInKeys=="boolean"?d.decodeDotInKeys:a.decodeDotInKeys,decoder:typeof d.decoder=="function"?d.decoder:a.decoder,delimiter:typeof d.delimiter=="string"||o.isRegExp(d.delimiter)?d.delimiter:a.delimiter,depth:typeof d.depth=="number"||d.depth===!1?+d.depth:a.depth,duplicates:b,ignoreQueryPrefix:d.ignoreQueryPrefix===!0,interpretNumericEntities:typeof d.interpretNumericEntities=="boolean"?d.interpretNumericEntities:a.interpretNumericEntities,parameterLimit:typeof d.parameterLimit=="number"?d.parameterLimit:a.parameterLimit,parseArrays:d.parseArrays!==!1,plainObjects:typeof d.plainObjects=="boolean"?d.plainObjects:a.plainObjects,strictDepth:typeof d.strictDepth=="boolean"?!!d.strictDepth:a.strictDepth,strictNullHandling:typeof d.strictNullHandling=="boolean"?d.strictNullHandling:a.strictNullHandling}};return en=function(d,y){var b=h(y);if(d===""||d===null||typeof d>"u")return b.plainObjects?Object.create(null):{};for(var S=typeof d=="string"?e(d,b):d,w=b.plainObjects?Object.create(null):{},x=Object.keys(S),g=0;g<x.length;++g){var _=x[g],E=c(_,S[_],b,typeof d=="string");w=o.merge(w,E,b)}return b.allowSparse===!0?w:o.compact(w)},en}function bf(){if(xo)return tn;xo=!0;var o=yf(),l=mf(),s=mo();return tn={formats:s,parse:l,stringify:o},tn}function vf(){if(Ao)return zt;Ao=!0;var o=$t;function l(){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 s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,t=["<",">",'"',"`"," ","\r",`
|
|
36
|
+
`," "],r=["{","}","|","\\","^","`"].concat(t),n=["'"].concat(r),e=["%","/","?",";","#"].concat(n),i=["/","?","#"],c=255,h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,y={javascript:!0,"javascript:":!0},b={javascript:!0,"javascript:":!0},S={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},w=bf();function x(v,C,P){if(v&&typeof v=="object"&&v instanceof l)return v;var I=new l;return I.parse(v,C,P),I}l.prototype.parse=function(v,C,P){if(typeof v!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof v);var I=v.indexOf("?"),T=I!==-1&&I<v.indexOf("#")?"?":"#",k=v.split(T),W=/\\/g;k[0]=k[0].replace(W,"/"),v=k.join(T);var A=v;if(A=A.trim(),!P&&v.split("#").length===1){var M=u.exec(A);if(M)return this.path=A,this.href=A,this.pathname=M[1],M[2]?(this.search=M[2],C?this.query=w.parse(this.search.substr(1)):this.query=this.search.substr(1)):C&&(this.search="",this.query={}),this}var q=s.exec(A);if(q){q=q[0];var N=q.toLowerCase();this.protocol=N,A=A.substr(q.length)}if(P||q||A.match(/^\/\/[^@/]+@[^@/]+/)){var le=A.substr(0,2)==="//";le&&!(q&&b[q])&&(A=A.substr(2),this.slashes=!0)}if(!b[q]&&(le||q&&!S[q])){for(var re=-1,ee=0;ee<i.length;ee++){var ue=A.indexOf(i[ee]);ue!==-1&&(re===-1||ue<re)&&(re=ue)}var G,oe;re===-1?oe=A.lastIndexOf("@"):oe=A.lastIndexOf("@",re),oe!==-1&&(G=A.slice(0,oe),A=A.slice(oe+1),this.auth=decodeURIComponent(G)),re=-1;for(var ee=0;ee<e.length;ee++){var ue=A.indexOf(e[ee]);ue!==-1&&(re===-1||ue<re)&&(re=ue)}re===-1&&(re=A.length),this.host=A.slice(0,re),A=A.slice(re),this.parseHost(),this.hostname=this.hostname||"";var R=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!R)for(var Q=this.hostname.split(/\./),ee=0,he=Q.length;ee<he;ee++){var z=Q[ee];if(z&&!z.match(h)){for(var Ee="",X=0,D=z.length;X<D;X++)z.charCodeAt(X)>127?Ee+="x":Ee+=z[X];if(!Ee.match(h)){var ae=Q.slice(0,ee),H=Q.slice(ee+1),te=z.match(d);te&&(ae.push(te[1]),H.unshift(te[2])),H.length&&(A="/"+H.join(".")+A),this.hostname=ae.join(".");break}}}this.hostname.length>c?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=o.toASCII(this.hostname));var ne=this.port?":"+this.port:"",be=this.hostname||"";this.host=be+ne,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),A[0]!=="/"&&(A="/"+A))}if(!y[N])for(var ee=0,he=n.length;ee<he;ee++){var ce=n[ee];if(A.indexOf(ce)!==-1){var L=encodeURIComponent(ce);L===ce&&(L=escape(ce)),A=A.split(ce).join(L)}}var Y=A.indexOf("#");Y!==-1&&(this.hash=A.substr(Y),A=A.slice(0,Y));var se=A.indexOf("?");if(se!==-1?(this.search=A.substr(se),this.query=A.substr(se+1),C&&(this.query=w.parse(this.query)),A=A.slice(0,se)):C&&(this.search="",this.query={}),A&&(this.pathname=A),S[N]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var ne=this.pathname||"",me=this.search||"";this.path=ne+me}return this.href=this.format(),this};function g(v){return typeof v=="string"&&(v=x(v)),v instanceof l?v.format():l.prototype.format.call(v)}l.prototype.format=function(){var v=this.auth||"";v&&(v=encodeURIComponent(v),v=v.replace(/%3A/i,":"),v+="@");var C=this.protocol||"",P=this.pathname||"",I=this.hash||"",T=!1,k="";this.host?T=v+this.host:this.hostname&&(T=v+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(T+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(k=w.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var W=this.search||k&&"?"+k||"";return C&&C.substr(-1)!==":"&&(C+=":"),this.slashes||(!C||S[C])&&T!==!1?(T="//"+(T||""),P&&P.charAt(0)!=="/"&&(P="/"+P)):T||(T=""),I&&I.charAt(0)!=="#"&&(I="#"+I),W&&W.charAt(0)!=="?"&&(W="?"+W),P=P.replace(/[?#]/g,function(A){return encodeURIComponent(A)}),W=W.replace("#","%23"),C+T+P+W+I};function _(v,C){return x(v,!1,!0).resolve(C)}l.prototype.resolve=function(v){return this.resolveObject(x(v,!1,!0)).format()};function E(v,C){return v?x(v,!1,!0).resolveObject(C):C}return l.prototype.resolveObject=function(v){if(typeof v=="string"){var C=new l;C.parse(v,!1,!0),v=C}for(var P=new l,I=Object.keys(this),T=0;T<I.length;T++){var k=I[T];P[k]=this[k]}if(P.hash=v.hash,v.href==="")return P.href=P.format(),P;if(v.slashes&&!v.protocol){for(var W=Object.keys(v),A=0;A<W.length;A++){var M=W[A];M!=="protocol"&&(P[M]=v[M])}return S[P.protocol]&&P.hostname&&!P.pathname&&(P.pathname="/",P.path=P.pathname),P.href=P.format(),P}if(v.protocol&&v.protocol!==P.protocol){if(!S[v.protocol]){for(var q=Object.keys(v),N=0;N<q.length;N++){var le=q[N];P[le]=v[le]}return P.href=P.format(),P}if(P.protocol=v.protocol,!v.host&&!b[v.protocol]){for(var he=(v.pathname||"").split("/");he.length&&!(v.host=he.shift()););v.host||(v.host=""),v.hostname||(v.hostname=""),he[0]!==""&&he.unshift(""),he.length<2&&he.unshift(""),P.pathname=he.join("/")}else P.pathname=v.pathname;if(P.search=v.search,P.query=v.query,P.host=v.host||"",P.auth=v.auth,P.hostname=v.hostname||v.host,P.port=v.port,P.pathname||P.search){var re=P.pathname||"",ee=P.search||"";P.path=re+ee}return P.slashes=P.slashes||v.slashes,P.href=P.format(),P}var ue=P.pathname&&P.pathname.charAt(0)==="/",G=v.host||v.pathname&&v.pathname.charAt(0)==="/",oe=G||ue||P.host&&v.pathname,R=oe,Q=P.pathname&&P.pathname.split("/")||[],he=v.pathname&&v.pathname.split("/")||[],z=P.protocol&&!S[P.protocol];if(z&&(P.hostname="",P.port=null,P.host&&(Q[0]===""?Q[0]=P.host:Q.unshift(P.host)),P.host="",v.protocol&&(v.hostname=null,v.port=null,v.host&&(he[0]===""?he[0]=v.host:he.unshift(v.host)),v.host=null),oe=oe&&(he[0]===""||Q[0]==="")),G)P.host=v.host||v.host===""?v.host:P.host,P.hostname=v.hostname||v.hostname===""?v.hostname:P.hostname,P.search=v.search,P.query=v.query,Q=he;else if(he.length)Q||(Q=[]),Q.pop(),Q=Q.concat(he),P.search=v.search,P.query=v.query;else if(v.search!=null){if(z){P.host=Q.shift(),P.hostname=P.host;var Ee=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;Ee&&(P.auth=Ee.shift(),P.hostname=Ee.shift(),P.host=P.hostname)}return P.search=v.search,P.query=v.query,(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.href=P.format(),P}if(!Q.length)return P.pathname=null,P.search?P.path="/"+P.search:P.path=null,P.href=P.format(),P;for(var X=Q.slice(-1)[0],D=(P.host||v.host||Q.length>1)&&(X==="."||X==="..")||X==="",ae=0,H=Q.length;H>=0;H--)X=Q[H],X==="."?Q.splice(H,1):X===".."?(Q.splice(H,1),ae++):ae&&(Q.splice(H,1),ae--);if(!oe&&!R)for(;ae--;ae)Q.unshift("..");oe&&Q[0]!==""&&(!Q[0]||Q[0].charAt(0)!=="/")&&Q.unshift(""),D&&Q.join("/").substr(-1)!=="/"&&Q.push("");var te=Q[0]===""||Q[0]&&Q[0].charAt(0)==="/";if(z){P.hostname=te?"":Q.length?Q.shift():"",P.host=P.hostname;var Ee=P.host&&P.host.indexOf("@")>0?P.host.split("@"):!1;Ee&&(P.auth=Ee.shift(),P.hostname=Ee.shift(),P.host=P.hostname)}return oe=oe||P.host&&Q.length,oe&&!te&&Q.unshift(""),Q.length>0?P.pathname=Q.join("/"):(P.pathname=null,P.path=null),(P.pathname!==null||P.search!==null)&&(P.path=(P.pathname?P.pathname:"")+(P.search?P.search:"")),P.auth=v.auth||P.auth,P.slashes=P.slashes||v.slashes,P.href=P.format(),P},l.prototype.parseHost=function(){var v=this.host,C=a.exec(v);C&&(C=C[0],C!==":"&&(this.port=C.substr(1)),v=v.substr(0,v.length-C.length)),v&&(this.hostname=v)},zt.parse=x,zt.resolve=_,zt.resolveObject=E,zt.format=g,zt.Url=l,zt}function Ha(o){if(typeof o=="string")o=new URL(o);else if(!(o instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(o.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return rn?wf(o):_f(o)}function wf(o){let l=o.hostname,s=o.pathname;for(let a=0;a<s.length;a++)if(s[a]==="%"){let u=s.codePointAt(a+2)||32;if(s[a+1]==="2"&&u===102||s[a+1]==="5"&&u===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(s=s.replace(al,"\\"),s=decodeURIComponent(s),l!=="")return`\\\\${l}${s}`;{let a=s.codePointAt(1)|32,u=s[2];if(a<ol||a>sl||u!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return s.slice(1)}}function _f(o){if(o.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let l=o.pathname;for(let s=0;s<l.length;s++)if(l[s]==="%"){let a=l.codePointAt(s+2)||32;if(l[s+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(l)}function Ga(o){let l=yo.resolve(o),s=o.charCodeAt(o.length-1);(s===il||rn&&s===nl)&&l[l.length-1]!==yo.sep&&(l+="/");let a=new URL("file://");return l.includes("%")&&(l=l.replace(ll,"%25")),!rn&&l.includes("\\")&&(l=l.replace(ul,"%5C")),l.includes(`
|
|
37
|
+
`)&&(l=l.replace(cl,"%0A")),l.includes("\r")&&(l=l.replace(fl,"%0D")),l.includes(" ")&&(l=l.replace(hl,"%09")),a.pathname=l,a}var Ya,Gr,bo,Yr,Qr,vo,Jr,wo,Xr,_o,Zr,So,en,Eo,tn,xo,zt,Ao,vt,Qa,Ja,Xa,Za,el,tl,rl,nl,il,ol,sl,rn,al,ll,ul,cl,fl,hl,Sf=_t(()=>{de(),ye(),ge(),Uc(),ef(),pf(),za(),Ya=Object.freeze(Object.create(null)),Gr={},bo=!1,Yr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Qr={},vo=!1,Jr={},wo=!1,Xr={},_o=!1,Zr={},So=!1,en={},Eo=!1,tn={},xo=!1,zt={},Ao=!1,vt=vf(),vt.parse,vt.resolve,vt.resolveObject,vt.format,vt.Url,Qa=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0,vt.URL=typeof URL<"u"?URL:null,vt.pathToFileURL=Ga,vt.fileURLToPath=Ha,Ja=vt.Url,Xa=vt.format,Za=vt.resolve,el=vt.resolveObject,tl=vt.parse,rl=vt.URL,nl=92,il=47,ol=97,sl=122,rn=Qa==="win32",al=/\//g,ll=/%/g,ul=/\\/g,cl=/\n/g,fl=/\r/g,hl=/\t/g}),Ef=we((o,l)=>{de(),ye(),ge(),l.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}}),Io=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0}),o.BufferedDuplex=void 0,o.writev=a;var l=Xt(),s=(dt(),tt(pt));function a(t,r){let n=new Array(t.length);for(let e=0;e<t.length;e++)typeof t[e].chunk=="string"?n[e]=s.Buffer.from(t[e].chunk,"utf8"):n[e]=t[e].chunk;this._write(s.Buffer.concat(n),"binary",r)}var u=class extends l.Duplex{constructor(r,n,e){super({objectMode:!0});Pe(this,"socket");Pe(this,"proxy");Pe(this,"isSocketOpen");Pe(this,"writeQueue");this.proxy=n,this.socket=e,this.writeQueue=[],r.objectMode||(this._writev=a.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",i=>{!this.destroyed&&this.readable&&this.push(i)})}_read(r){this.proxy.read(r)}_write(r,n,e){this.isSocketOpen?this.writeToProxy(r,n,e):this.writeQueue.push({chunk:r,encoding:n,cb:e})}_final(r){this.writeQueue=[],this.proxy.end(r)}_destroy(r,n){this.writeQueue=[],this.proxy.destroy(),n(r)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(r,n,e){this.proxy.write(r,n)===!1?this.proxy.once("drain",e):e()}processWriteQueue(){for(;this.writeQueue.length>0;){let{chunk:r,encoding:n,cb:e}=this.writeQueue.shift();this.writeToProxy(r,n,e)}}};o.BufferedDuplex=u}),nn=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(x){return x&&x.__esModule?x:{default:x}};Object.defineProperty(o,"__esModule",{value:!0}),o.streamBuilder=o.browserStreamBuilder=void 0;var s=(dt(),tt(pt)),a=l(Ef()),u=l(Mt()),t=Xt(),r=l(Cr()),n=Io(),e=(0,u.default)("mqttjs:ws"),i=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function c(x,g){let _=`${x.protocol}://${x.hostname}:${x.port}${x.path}`;return typeof x.transformWsUrl=="function"&&(_=x.transformWsUrl(_,x,g)),_}function h(x){let g=x;return x.port||(x.protocol==="wss"?g.port=443:g.port=80),x.path||(g.path="/"),x.wsOptions||(g.wsOptions={}),!r.default&&!x.forceNativeWebSocket&&x.protocol==="wss"&&i.forEach(_=>{Object.prototype.hasOwnProperty.call(x,_)&&!Object.prototype.hasOwnProperty.call(x.wsOptions,_)&&(g.wsOptions[_]=x[_])}),g}function d(x){let g=h(x);if(g.hostname||(g.hostname=g.host),!g.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let _=new URL(document.URL);g.hostname=_.hostname,g.port||(g.port=Number(_.port))}return g.objectMode===void 0&&(g.objectMode=!(g.binary===!0||g.binary===void 0)),g}function y(x,g,_){e("createWebSocket"),e(`protocol: ${_.protocolId} ${_.protocolVersion}`);let E=_.protocolId==="MQIsdp"&&_.protocolVersion===3?"mqttv3.1":"mqtt";e(`creating new Websocket for url: ${g} and protocol: ${E}`);let v;return _.createWebsocket?v=_.createWebsocket(g,[E],_):v=new a.default(g,[E],_.wsOptions),v}function b(x,g){let _=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt",E=c(g,x),v;return g.createWebsocket?v=g.createWebsocket(E,[_],g):v=new WebSocket(E,[_]),v.binaryType="arraybuffer",v}var S=(x,g)=>{e("streamBuilder");let _=h(g);_.hostname=_.hostname||_.host||"localhost";let E=c(_,x),v=y(x,E,_),C=a.default.createWebSocketStream(v,_.wsOptions);return C.url=E,v.on("close",()=>{C.destroy()}),C};o.streamBuilder=S;var w=(x,g)=>{e("browserStreamBuilder");let _,E=d(g).browserBufferSize||1024*512,v=g.browserBufferTimeout||1e3,C=!g.objectMode,P=b(x,g),I=k(g,N,le);g.objectMode||(I._writev=n.writev.bind(I)),I.on("close",()=>{P.close()});let T=typeof P.addEventListener<"u";P.readyState===P.OPEN?(_=I,_.socket=P):(_=new n.BufferedDuplex(g,I,P),T?P.addEventListener("open",W):P.onopen=W),T?(P.addEventListener("close",A),P.addEventListener("error",M),P.addEventListener("message",q)):(P.onclose=A,P.onerror=M,P.onmessage=q);function k(re,ee,ue){let G=new t.Transform({objectMode:re.objectMode});return G._write=ee,G._flush=ue,G}function W(){e("WebSocket onOpen"),_ instanceof n.BufferedDuplex&&_.socketReady()}function A(re){e("WebSocket onClose",re),_.end(),_.destroy()}function M(re){e("WebSocket onError",re);let ee=new Error("WebSocket error");ee.event=re,_.destroy(ee)}async function q(re){if(!I||!I.readable||!I.writable)return;let{data:ee}=re;ee instanceof ArrayBuffer?ee=s.Buffer.from(ee):ee instanceof Blob?ee=s.Buffer.from(await new Response(ee).arrayBuffer()):ee=s.Buffer.from(ee,"utf8"),I.push(ee)}function N(re,ee,ue){if(P.bufferedAmount>E){setTimeout(N,v,re,ee,ue);return}C&&typeof re=="string"&&(re=s.Buffer.from(re,"utf8"));try{P.send(re)}catch(G){return ue(G)}ue()}function le(re){P.close(),re()}return _};o.browserStreamBuilder=w}),ko={};nr(ko,{Server:()=>at,Socket:()=>at,Stream:()=>at,_createServerHandle:()=>at,_normalizeArgs:()=>at,_setSimultaneousAccepts:()=>at,connect:()=>at,createConnection:()=>at,createServer:()=>at,default:()=>pl,isIP:()=>at,isIPv4:()=>at,isIPv6:()=>at});function at(){throw new Error("Node.js net module is not supported by JSPM core outside of Node.js")}var pl,dl=_t(()=>{de(),ye(),ge(),pl={_createServerHandle:at,_normalizeArgs:at,_setSimultaneousAccepts:at,connect:at,createConnection:at,createServer:at,isIP:at,isIPv4:at,isIPv6:at,Server:at,Socket:at,Stream:at}}),gl=we((o,l)=>{de(),ye(),ge(),l.exports={}}),yl=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(o,"__esModule",{value:!0});var s=l((dl(),tt(ko))),a=l(Mt()),u=l(gl()),t=(0,a.default)("mqttjs:tcp"),r=(n,e)=>{if(e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",e.socksProxy)return(0,u.default)(e.hostname,e.port,e.socksProxy,{timeout:e.socksTimeout});let{port:i,path:c}=e,h=e.hostname;return t("port %d and host %s",i,h),s.default.createConnection({port:i,host:h,path:c})};o.default=r}),ml={};nr(ml,{default:()=>bl});var bl,xf=_t(()=>{de(),ye(),ge(),bl={}}),vl=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(i){return i&&i.__esModule?i:{default:i}};Object.defineProperty(o,"__esModule",{value:!0});var s=(xf(),tt(ml)),a=l((dl(),tt(ko))),u=l(Mt()),t=l(gl()),r=(0,u.default)("mqttjs:tls");function n(i){let{host:c,port:h,socksProxy:d,...y}=i;if(d!==void 0){let b=(0,t.default)(c,h,d,{timeout:i.socksTimeout});return(0,s.connect)({...y,socket:b})}return(0,s.connect)(i)}var e=(i,c)=>{c.port=c.port||8883,c.host=c.hostname||c.host||"localhost",a.default.isIP(c.host)===0&&(c.servername=c.host),c.rejectUnauthorized=c.rejectUnauthorized!==!1,delete c.path,r("port %d host %s rejectUnauthorized %b",c.port,c.host,c.rejectUnauthorized);let h=n(c);h.on("secureConnect",()=>{c.rejectUnauthorized&&!h.authorized?h.emit("error",new Error("TLS not authorized")):h.removeListener("error",d)});function d(y){c.rejectUnauthorized&&i.emit("error",y),h.end()}return h.on("error",d),h};o.default=e}),wl=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(dt(),tt(pt)),s=Xt(),a=Io(),u,t,r;function n(){let d=new s.Transform;return d._write=(y,b,S)=>{u.send({data:y.buffer,success(){S()},fail(w){S(new Error(w))}})},d._flush=y=>{u.close({success(){y()}})},d}function e(d){d.hostname||(d.hostname="localhost"),d.path||(d.path="/"),d.wsOptions||(d.wsOptions={})}function i(d,y){let b=d.protocol==="wxs"?"wss":"ws",S=`${b}://${d.hostname}${d.path}`;return d.port&&d.port!==80&&d.port!==443&&(S=`${b}://${d.hostname}:${d.port}${d.path}`),typeof d.transformWsUrl=="function"&&(S=d.transformWsUrl(S,d,y)),S}function c(){u.onOpen(()=>{r.socketReady()}),u.onMessage(d=>{let{data:y}=d;y instanceof ArrayBuffer?y=l.Buffer.from(y):y=l.Buffer.from(y,"utf8"),t.push(y)}),u.onClose(()=>{r.emit("close"),r.end(),r.destroy()}),u.onError(d=>{let y=new Error(d.errMsg);r.destroy(y)})}var h=(d,y)=>{if(y.hostname=y.hostname||y.host,!y.hostname)throw new Error("Could not determine host. Specify host manually.");let b=y.protocolId==="MQIsdp"&&y.protocolVersion===3?"mqttv3.1":"mqtt";e(y);let S=i(y,d);u=wx.connectSocket({url:S,protocols:[b]}),t=n(),r=new a.BufferedDuplex(y,t,u),r._destroy=(x,g)=>{u.close({success(){g&&g(x)}})};let w=r.destroy;return r.destroy=(x,g)=>(r.destroy=w,setTimeout(()=>{u.close({fail(){r._destroy(x,g)}})},0),r),c(),r};o.default=h}),_l=we(o=>{de(),ye(),ge(),Object.defineProperty(o,"__esModule",{value:!0});var l=(dt(),tt(pt)),s=Xt(),a=Io(),u,t,r,n=!1;function e(){let y=new s.Transform;return y._write=(b,S,w)=>{u.sendSocketMessage({data:b.buffer,success(){w()},fail(){w(new Error)}})},y._flush=b=>{u.closeSocket({success(){b()}})},y}function i(y){y.hostname||(y.hostname="localhost"),y.path||(y.path="/"),y.wsOptions||(y.wsOptions={})}function c(y,b){let S=y.protocol==="alis"?"wss":"ws",w=`${S}://${y.hostname}${y.path}`;return y.port&&y.port!==80&&y.port!==443&&(w=`${S}://${y.hostname}:${y.port}${y.path}`),typeof y.transformWsUrl=="function"&&(w=y.transformWsUrl(w,y,b)),w}function h(){n||(n=!0,u.onSocketOpen(()=>{r.socketReady()}),u.onSocketMessage(y=>{if(typeof y.data=="string"){let b=l.Buffer.from(y.data,"base64");t.push(b)}else{let b=new FileReader;b.addEventListener("load",()=>{if(b.result instanceof ArrayBuffer){t.push(l.Buffer.from(b.result));return}t.push(l.Buffer.from(b.result,"utf-8"))}),b.readAsArrayBuffer(y.data)}}),u.onSocketClose(()=>{r.end(),r.destroy()}),u.onSocketError(y=>{r.destroy(y)}))}var d=(y,b)=>{if(b.hostname=b.hostname||b.host,!b.hostname)throw new Error("Could not determine host. Specify host manually.");let S=b.protocolId==="MQIsdp"&&b.protocolVersion===3?"mqttv3.1":"mqtt";i(b);let w=c(b,y);return u=b.my,u.connectSocket({url:w,protocols:S}),t=e(),r=new a.BufferedDuplex(b,t,u),h(),r};o.default=d}),Af=we(o=>{de(),ye(),ge();var l=o&&o.__importDefault||function(h){return h&&h.__esModule?h:{default:h}};Object.defineProperty(o,"__esModule",{value:!0}),o.connectAsync=c;var s=l(Mt()),a=l((Sf(),tt(Va))),u=l(Ci()),t=l(Cr());typeof(Je==null?void 0:Je.nextTick)!="function"&&(Je.nextTick=setImmediate);var r=(0,s.default)("mqttjs"),n=null;function e(h){let d;if(h.auth)if(d=h.auth.match(/^(.+):(.+)$/),d){let[,y,b]=d;h.username=y,h.password=b}else h.username=h.auth}function i(h,d){var S,w,x;if(r("connecting to an MQTT broker..."),typeof h=="object"&&!d&&(d=h,h=""),d=d||{},h&&typeof h=="string"){let g=a.default.parse(h,!0),_={};if(g.port!=null&&(_.port=Number(g.port)),_.host=g.hostname,_.query=g.query,_.auth=g.auth,_.protocol=g.protocol,_.path=g.path,d={..._,...d},!d.protocol)throw new Error("Missing protocol");d.protocol=d.protocol.replace(/:$/,"")}if(d.unixSocket=d.unixSocket||((S=d.protocol)==null?void 0:S.includes("+unix")),d.unixSocket?d.protocol=d.protocol.replace("+unix",""):!((w=d.protocol)!=null&&w.startsWith("ws"))&&!((x=d.protocol)!=null&&x.startsWith("wx"))&&delete d.path,e(d),d.query&&typeof d.query.clientId=="string"&&(d.clientId=d.query.clientId),t.default||d.unixSocket?d.socksProxy=void 0:d.socksProxy===void 0&&typeof Je<"u"&&(d.socksProxy=Je.env.MQTTJS_SOCKS_PROXY),d.cert&&d.key)if(d.protocol){if(["mqtts","wss","wxs","alis"].indexOf(d.protocol)===-1)switch(d.protocol){case"mqtt":d.protocol="mqtts";break;case"ws":d.protocol="wss";break;case"wx":d.protocol="wxs";break;case"ali":d.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${d.protocol}"!`)}}else throw new Error("Missing secure protocol key");if(n||(n={},!t.default&&!d.forceNativeWebSocket?(n.ws=nn().streamBuilder,n.wss=nn().streamBuilder,n.mqtt=yl().default,n.tcp=yl().default,n.ssl=vl().default,n.tls=n.ssl,n.mqtts=vl().default):(n.ws=nn().browserStreamBuilder,n.wss=nn().browserStreamBuilder,n.wx=wl().default,n.wxs=wl().default,n.ali=_l().default,n.alis=_l().default)),!n[d.protocol]){let g=["mqtts","wss"].indexOf(d.protocol)!==-1;d.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((_,E)=>g&&E%2===0?!1:typeof n[_]=="function")[0]}if(d.clean===!1&&!d.clientId)throw new Error("Missing clientId for unclean clients");d.protocol&&(d.defaultProtocol=d.protocol);function y(g){return d.servers&&((!g._reconnectCount||g._reconnectCount===d.servers.length)&&(g._reconnectCount=0),d.host=d.servers[g._reconnectCount].host,d.port=d.servers[g._reconnectCount].port,d.protocol=d.servers[g._reconnectCount].protocol?d.servers[g._reconnectCount].protocol:d.defaultProtocol,d.hostname=d.host,g._reconnectCount++),r("calling streambuilder for",d.protocol),n[d.protocol](g,d)}let b=new u.default(y,d);return b.on("error",()=>{}),b}function c(h,d,y=!0){return new Promise((b,S)=>{let w=i(h,d),x={connect:_=>{g(),b(w)},end:()=>{g(),b(w)},error:_=>{g(),w.end(),S(_)}};y===!1&&(x.close=()=>{x.error(new Error("Couldn't connect to server"))});function g(){Object.keys(x).forEach(_=>{w.off(_,x[_])})}Object.keys(x).forEach(_=>{w.on(_,x[_])})})}o.default=i}),Sl=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(y,b,S,w){w===void 0&&(w=S);var x=Object.getOwnPropertyDescriptor(b,S);(!x||("get"in x?!b.__esModule:x.writable||x.configurable))&&(x={enumerable:!0,get:function(){return b[S]}}),Object.defineProperty(y,w,x)}:function(y,b,S,w){w===void 0&&(w=S),y[w]=b[S]}),s=o&&o.__setModuleDefault||(Object.create?function(y,b){Object.defineProperty(y,"default",{enumerable:!0,value:b})}:function(y,b){y.default=b}),a=o&&o.__importStar||function(){var y=function(b){return y=Object.getOwnPropertyNames||function(S){var w=[];for(var x in S)Object.prototype.hasOwnProperty.call(S,x)&&(w[w.length]=x);return w},y(b)};return function(b){if(b&&b.__esModule)return b;var S={};if(b!=null)for(var w=y(b),x=0;x<w.length;x++)w[x]!=="default"&&l(S,b,w[x]);return s(S,b),S}}(),u=o&&o.__exportStar||function(y,b){for(var S in y)S!=="default"&&!Object.prototype.hasOwnProperty.call(b,S)&&l(b,y,S)},t=o&&o.__importDefault||function(y){return y&&y.__esModule?y:{default:y}};Object.defineProperty(o,"__esModule",{value:!0}),o.ReasonCodes=o.KeepaliveManager=o.UniqueMessageIdProvider=o.DefaultMessageIdProvider=o.Store=o.MqttClient=o.connectAsync=o.connect=o.Client=void 0;var r=t(Ci());o.MqttClient=r.default;var n=t(Ts());o.DefaultMessageIdProvider=n.default;var e=t(Bc());o.UniqueMessageIdProvider=e.default;var i=t(Ss());o.Store=i.default;var c=a(Af());o.connect=c.default,Object.defineProperty(o,"connectAsync",{enumerable:!0,get:function(){return c.connectAsync}});var h=t(Bs());o.KeepaliveManager=h.default,o.Client=r.default,u(Ci(),o),u(ar(),o);var d=Tr();Object.defineProperty(o,"ReasonCodes",{enumerable:!0,get:function(){return d.ReasonCodes}})}),If=we(o=>{de(),ye(),ge();var l=o&&o.__createBinding||(Object.create?function(r,n,e,i){i===void 0&&(i=e);var c=Object.getOwnPropertyDescriptor(n,e);(!c||("get"in c?!n.__esModule:c.writable||c.configurable))&&(c={enumerable:!0,get:function(){return n[e]}}),Object.defineProperty(r,i,c)}:function(r,n,e,i){i===void 0&&(i=e),r[i]=n[e]}),s=o&&o.__setModuleDefault||(Object.create?function(r,n){Object.defineProperty(r,"default",{enumerable:!0,value:n})}:function(r,n){r.default=n}),a=o&&o.__importStar||function(){var r=function(n){return r=Object.getOwnPropertyNames||function(e){var i=[];for(var c in e)Object.prototype.hasOwnProperty.call(e,c)&&(i[i.length]=c);return i},r(n)};return function(n){if(n&&n.__esModule)return n;var e={};if(n!=null)for(var i=r(n),c=0;c<i.length;c++)i[c]!=="default"&&l(e,n,i[c]);return s(e,n),e}}(),u=o&&o.__exportStar||function(r,n){for(var e in r)e!=="default"&&!Object.prototype.hasOwnProperty.call(n,e)&&l(n,r,e)};Object.defineProperty(o,"__esModule",{value:!0});var t=a(Sl());o.default=t,u(Sl(),o)});const kf=If();/*! Bundled license information:
|
|
38
38
|
|
|
39
39
|
@jspm/core/nodelibs/browser/chunk-DtuTasat.js:
|
|
40
40
|
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
@@ -44,63 +44,63 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
44
44
|
|
|
45
45
|
@babel/runtime/helpers/regenerator.js:
|
|
46
46
|
(*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE *)
|
|
47
|
-
*/const El=Oe.createContext(null),Of=({children:o})=>{const[l,a]=Oe.useState(!1),[s,u]=Oe.useState({}),t=Oe.useRef(null),r=Oe.useRef(new Set),n=Ut();Oe.useEffect(()=>{const h=n.config.brokerUrl||"wss://test.mosquitto.org:8081";console.log(`[MQTT] Connecting to ${h}...`),t.current&&t.current.end();const d=kf.connect(h);return t.current=d,d.on("connect",()=>{console.log("[MQTT] Connected ✅"),a(!0),r.current.forEach(y=>d.subscribe(y))}),d.on("message",(y,b)=>{const S=b.toString();u(w=>({...w,[y]:S}))}),d.on("error",y=>{console.error("[MQTT] Connection error: ",y),d.end()}),()=>{console.log("[MQTT] Disconnecting..."),d.end()}},[n.config.brokerUrl]);const e=h=>{t.current&&!r.current.has(h)&&(t.current.subscribe(h),r.current.add(h))},i=h=>{t.current&&r.current.has(h)&&(t.current.unsubscribe(h),r.current.delete(h))},c=(h,d)=>{t.current&&t.current.publish(h,d)};return ke.jsx(El.Provider,{value:{isConnected:l,lastMessage:s,subscribe:e,unsubscribe:i,publish:c},children:o})},ko=()=>{const o=Oe.useContext(El);if(!o)throw new Error("useMqtt must be used within an MqttProvider");return o},xl=Oe.createContext([]),Tf=()=>{const o=Oe.useContext(xl);if(o===void 0)throw new Error("useSitemap must be used within a SitemapProvider");return o},Pf=xl.Provider,Cf=()=>{const{publish:o,isConnected:l}=ko(),a=Ut(),{config:s,domain:u}=a;return{sendAction:Oe.useCallback(async(r,n)=>{const e=u.entities.find(h=>h.id===r);if(!e){console.warn(`[Action] Entity ID '${r}' not found in manifest.`);return}const i=e.signals[0],c=u.signals.find(h=>h.id===i);if(!c){console.warn(`[Action] No signal linked to entity: ${r}`);return}if(s.mockMode){console.log(`%c[Mock Action] Setting ${e.name} to:`,"color: #10b981; font-weight: bold;",n);return}if(c.source==="mqtt"&&c.topic){if(!l){console.warn("[Action] Cannot send: MQTT disconnected");return}const h=typeof n=="object"?JSON.stringify(n):String(n);console.log(`[MQTT] Publishing to '${c.topic}': ${h}`),o(c.topic,h)}if(c.source==="http"&&c.endpoint)try{await fetch(c.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:c.id,value:n})})}catch{console.log("[HTTP] (Simulation) Request sent.")}},[s.mockMode,l,o,u])}},Al=(o,l)=>{const[a,s]=Oe.useState(()=>{if(typeof window>"u")return l;try{const n=window.localStorage.getItem(o);return n?JSON.parse(n):(window.localStorage.setItem(o,JSON.stringify(l)),l)}catch(n){return console.error(`[Data Lake] Error reading key "${o}":`,n),l}}),u=Oe.useCallback(n=>{s(e=>{let i;e.length>0&&typeof e[0].id=="number"?i=e.reduce((b,S)=>typeof S.id=="number"&&S.id>b?S.id:b,0)+1:i=`id_${Date.now()}`;const h={...n,id:i},d=[...e,h];return window.localStorage.setItem(o,JSON.stringify(d)),d})},[o]),t=Oe.useCallback(n=>{s(e=>{const i=e.map(c=>c.id===n.id?n:c);return window.localStorage.setItem(o,JSON.stringify(i)),i})},[o]),r=Oe.useCallback(n=>{s(e=>{const i=e.filter(c=>c.id!==n);return window.localStorage.setItem(o,JSON.stringify(i)),i})},[o]);return{data:a,createItem:u,updateItem:t,deleteItem:r}};function jf(o,l={}){const{filters:a,sort:s,page:u=1,pageSize:t=10}=l,r=Oe.useMemo(()=>!a||a.length===0?o:o.filter(i=>a.every(c=>{const h=i[c.field];switch(c.operator){case"equals":return h==c.value;case"neq":return h!=c.value;case"contains":return String(h).toLowerCase().includes(String(c.value).toLowerCase());case"gt":return h>c.value;case"lt":return h<c.value;default:return!0}})),[o,a]),n=Oe.useMemo(()=>s?[...r].sort((i,c)=>{const h=i[s.field],d=c[s.field];return h<d?s.direction==="asc"?-1:1:h>d?s.direction==="asc"?1:-1:0}):r,[r,s]);return{data:Oe.useMemo(()=>{const i=(u-1)*t;return n.slice(i,i+t)},[n,u,t]),total:r.length,pageCount:Math.ceil(r.length/t)}}const Rf="ramme_db_",Nf=(o,l)=>{const a=l+1,s=o.label||"Item";switch(o.type){case"text":return`${s} ${a}`;case"number":return Math.floor(Math.random()*100)+1;case"currency":return(Math.random()*1e3).toFixed(2);case"boolean":return Math.random()>.5;case"date":const u=new Date;return u.setDate(u.getDate()-a*2),u.toISOString().split("T")[0];case"status":return["Active","Pending","Inactive","Archived"][l%4];case"email":return`user${a}@example.com`;case"image":return`https://i.pravatar.cc/150?u=${a}`;case"textarea":return`This is a sample description for ${s} ${a}. It contains enough text to test multi-line rendering.`;default:return`${s}-${a}`}},Oo=(o,l)=>Oe.useMemo(()=>{if(!o)return[];if(typeof window<"u"){const a=`${Rf}${o}`,s=localStorage.getItem(a);if(s)try{const u=JSON.parse(s);if(Array.isArray(u)&&u.length>0)return u}catch{console.warn(`[JIT Seeder] Corrupt data in ${a}, falling back to generation.`)}}return l?(console.log(`🌱 [JIT Seeder] Generating 5 mock records for: ${o}`),Array.from({length:5}).map((s,u)=>{const t={id:`jit_${o}_${u+1}`};return l.fields.forEach(r=>{r.key!=="id"&&(t[r.key]=Nf(r,u))}),t})):[]},[o,l]),Il=({isOpen:o,onClose:l,onSubmit:a,title:s,fields:u,initialData:t})=>{const r=t||{},n=!!r.id,e=Oe.useMemo(()=>u.filter(i=>!(i.key==="id"&&!n)).map(i=>{const c=i.key==="id",h={name:i.key,label:i.label,required:i.required,placeholder:i.description||`Enter ${i.label.toLowerCase()}`,value:r[i.key]!==void 0?r[i.key]:i.defaultValue||"",colSpan:1,disabled:c};switch(i.type){case"number":case"integer":case"currency":return{...h,type:"number",value:Number(h.value)||0};case"boolean":return{...h,type:"toggle",checked:!!h.value};case"date":return{...h,type:"datepicker",value:h.value?new Date(h.value):null};case"status":return{...h,type:"select",options:[{value:"Active",label:"Active"},{value:"Pending",label:"Pending"},{value:"Inactive",label:"Inactive"},{value:"Archived",label:"Archived"}]};case"textarea":return{...h,type:"textarea",colSpan:2};case"email":return{...h,type:"email"};default:return{...h,type:"text"}}}),[u,r,n]);return ke.jsx(qe.Drawer,{isOpen:o,onClose:l,title:`${n?"Edit":"New"} ${s}`,size:"500px",children:ke.jsx("div",{className:"p-6",children:ke.jsx(qe.FormTemplate,{fields:e,onSubmit:i=>{a({...r,...i})},children:ke.jsxs("div",{className:"flex justify-end gap-2 mt-8 pt-4 border-t border-border",children:[ke.jsx(qe.Button,{variant:"outline",onClick:l,type:"button",children:"Cancel"}),ke.jsx(qe.Button,{type:"submit",variant:"primary",children:n?"Save Changes":"Create Record"})]})})})})},To=({dataId:o,title:l,getResourceMeta:a})=>{const{addToast:s}=qe.useToast(),u=Ut(),t=Oe.useMemo(()=>{var q;const A=(q=u.resources)==null?void 0:q.find(M=>M.id===o);if(A)return A;const N=a==null?void 0:a(o);return N?{...N,id:o}:null},[u,o]),r=Oo(o,t),{data:n,createItem:e,updateItem:i,deleteItem:c}=Al(`ramme_db_${o}`,r),[h,d]=Oe.useState(!1),[y,b]=Oe.useState(null),[S,w]=Oe.useState(null),[x,g]=Oe.useState([]),[_,E]=Oe.useState(""),v=Oe.useMemo(()=>{if(!(t!=null&&t.fields))return[];const A=t.fields.map(N=>{const q={field:N.key,headerName:N.label,filter:!0,sortable:!0,resizable:!0,flex:1};return N.type==="currency"&&(q.valueFormatter=M=>M.value?`$${Number(M.value).toLocaleString()}`:""),N.type==="date"&&(q.valueFormatter=M=>M.value?new Date(M.value).toLocaleDateString():""),N.type==="status"&&(q.cellRenderer=M=>{const re={active:"bg-green-100 text-green-800",paid:"bg-green-100 text-green-800",pending:"bg-yellow-100 text-yellow-800",inactive:"bg-slate-100 text-slate-600",overdue:"bg-red-100 text-red-800"}[String(M.value).toLowerCase()]||"bg-slate-100 text-slate-800";return ke.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${re}`,children:M.value})}),q});return A.length>0&&(A[0].headerCheckboxSelection=!0,A[0].checkboxSelection=!0,A[0].minWidth=180),A.push({headerName:"Actions",field:"id",width:100,pinned:"right",cellRenderer:N=>ke.jsx("div",{className:"flex items-center gap-1",children:ke.jsx(qe.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:q=>{q.stopPropagation(),b(N.data),d(!0)},children:ke.jsx(qe.Icon,{name:"edit-2",size:14,className:"text-slate-500"})})})}),A},[t]),C=Oe.useMemo(()=>(t==null?void 0:t.fields.find(A=>A.type==="text"&&A.key!=="id"))||(t==null?void 0:t.fields[0]),[t]),P=Oe.useMemo(()=>t==null?void 0:t.fields.find(A=>A.type==="status"),[t]),I=Oe.useCallback(A=>{w(A.api)},[]),T=Oe.useCallback(()=>{S&&g(S.getSelectedRows())},[S]),k=()=>{confirm(`Delete ${x.length} items?`)&&(x.forEach(A=>c(A.id)),g([]),s(`${x.length} items deleted`,"success"))},W=A=>{if(A.id&&(y!=null&&y.id))i(A),s("Item updated","success");else{const{id:N,...q}=A;e(q),s("Item created","success")}d(!1)};return ke.jsxs(qe.Card,{className:"flex flex-col h-[600px] border border-border shadow-sm overflow-hidden bg-card",children:[ke.jsxs("div",{className:"p-4 border-b border-border flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-muted/5",children:[x.length>0?ke.jsxs("div",{className:"flex items-center gap-3 animate-in fade-in slide-in-from-left-2 duration-200",children:[ke.jsxs("span",{className:"bg-primary text-primary-foreground text-xs font-bold px-2 py-1 rounded-md",children:[x.length," Selected"]}),ke.jsx(qe.Button,{size:"sm",variant:"danger",onClick:k,iconLeft:"trash-2",children:"Delete"})]}):ke.jsxs("div",{className:"flex items-center gap-2",children:[ke.jsx("div",{className:"p-2 bg-primary/10 rounded-md text-primary",children:ke.jsx(qe.Icon,{name:"table",size:18})}),ke.jsxs("div",{children:[ke.jsx("h3",{className:"text-base font-bold text-foreground leading-tight",children:l||(t==null?void 0:t.name)||o}),ke.jsxs("p",{className:"text-xs text-muted-foreground",children:[n.length," records found"]})]})]}),ke.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[ke.jsx("div",{className:"w-full sm:w-64",children:ke.jsx(qe.SearchInput,{placeholder:"Quick search...",value:_,onChange:A=>{E(A.target.value),S==null||S.updateGridOptions({quickFilterText:A.target.value})}})}),ke.jsx("div",{className:"h-6 w-px bg-border mx-1 hidden sm:block"}),ke.jsx(qe.Button,{size:"sm",variant:"primary",iconLeft:"plus",onClick:()=>{b({}),d(!0)},children:"Add"})]})]}),ke.jsxs("div",{className:"flex-1 w-full bg-card relative overflow-hidden",children:[ke.jsx("div",{className:"hidden md:block h-full",children:ke.jsx(qe.DataTable,{rowData:n,columnDefs:v,onGridReady:I,onSelectionChanged:T,rowSelection:"multiple",pagination:!0,paginationPageSize:10,headerHeight:48,rowHeight:48,enableCellTextSelection:!0})}),ke.jsxs("div",{className:"block md:hidden h-full overflow-y-auto p-4 space-y-3 bg-muted/5",children:[n.map(A=>ke.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 shadow-sm relative group",children:[ke.jsxs("div",{className:"flex justify-between items-start mb-2",children:[ke.jsxs("div",{children:[ke.jsx("h4",{className:"font-semibold text-foreground",children:C?A[C.key]:A.id}),ke.jsx("p",{className:"text-xs text-muted-foreground font-mono mt-0.5 opacity-70",children:A.id})]}),P&&ke.jsx(qe.Badge,{variant:["active","paid"].includes(String(A[P.key]).toLowerCase())?"success":["pending"].includes(String(A[P.key]).toLowerCase())?"warning":"secondary",children:A[P.key]})]}),ke.jsx("div",{className:"space-y-1 text-sm text-muted-foreground mb-4",children:t==null?void 0:t.fields.filter(N=>N.key!==(C==null?void 0:C.key)&&N.key!==(P==null?void 0:P.key)&&N.key!=="id").slice(0,3).map(N=>ke.jsxs("div",{className:"flex justify-between border-b border-dashed border-border/50 pb-1 last:border-0",children:[ke.jsxs("span",{className:"opacity-70",children:[N.label,":"]}),ke.jsx("span",{className:"font-medium text-foreground",children:N.type==="currency"?`$${Number(A[N.key]).toLocaleString()}`:N.type==="date"?new Date(A[N.key]).toLocaleDateString():A[N.key]})]},N.key))}),ke.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/50",children:[ke.jsxs(qe.Button,{size:"sm",variant:"outline",className:"flex-1 h-8 text-xs",onClick:()=>{b(A),d(!0)},children:[ke.jsx(qe.Icon,{name:"edit-2",size:12,className:"mr-2"})," Edit"]}),ke.jsx(qe.Button,{size:"sm",variant:"ghost",className:"text-destructive hover:bg-destructive/10 px-3 h-8",onClick:()=>{confirm("Delete?")&&c(A.id)},children:ke.jsx(qe.Icon,{name:"trash-2",size:14})})]})]},A.id)),n.length===0&&ke.jsx("div",{className:"text-center p-8 text-muted-foreground",children:"No records found."})]})]}),ke.jsx(Il,{isOpen:h,onClose:()=>d(!1),onSubmit:W,title:(t==null?void 0:t.name)||"Item",fields:(t==null?void 0:t.fields)||[],initialData:y})]})};/**
|
|
48
|
-
* @license lucide-react v0.
|
|
47
|
+
*/const El=Oe.createContext(null),Of=({children:o})=>{const[l,s]=Oe.useState(!1),[a,u]=Oe.useState({}),t=Oe.useRef(null),r=Oe.useRef(new Set),n=Ut();Oe.useEffect(()=>{const h=n.config.brokerUrl||"wss://test.mosquitto.org:8081";console.log(`[MQTT] Connecting to ${h}...`),t.current&&t.current.end();const d=kf.connect(h);return t.current=d,d.on("connect",()=>{console.log("[MQTT] Connected ✅"),s(!0),r.current.forEach(y=>d.subscribe(y))}),d.on("message",(y,b)=>{const S=b.toString();u(w=>({...w,[y]:S}))}),d.on("error",y=>{console.error("[MQTT] Connection error: ",y),d.end()}),()=>{console.log("[MQTT] Disconnecting..."),d.end()}},[n.config.brokerUrl]);const e=h=>{t.current&&!r.current.has(h)&&(t.current.subscribe(h),r.current.add(h))},i=h=>{t.current&&r.current.has(h)&&(t.current.unsubscribe(h),r.current.delete(h))},c=(h,d)=>{t.current&&t.current.publish(h,d)};return ke.jsx(El.Provider,{value:{isConnected:l,lastMessage:a,subscribe:e,unsubscribe:i,publish:c},children:o})},Oo=()=>{const o=Oe.useContext(El);if(!o)throw new Error("useMqtt must be used within an MqttProvider");return o},xl=Oe.createContext([]),Tf=()=>{const o=Oe.useContext(xl);if(o===void 0)throw new Error("useSitemap must be used within a SitemapProvider");return o},Pf=xl.Provider,Cf=()=>{const{publish:o,isConnected:l}=Oo(),s=Ut(),{config:a,domain:u}=s;return{sendAction:Oe.useCallback(async(r,n)=>{const e=u.entities.find(h=>h.id===r);if(!e){console.warn(`[Action] Entity ID '${r}' not found in manifest.`);return}const i=e.signals[0],c=u.signals.find(h=>h.id===i);if(!c){console.warn(`[Action] No signal linked to entity: ${r}`);return}if(a.mockMode){console.log(`%c[Mock Action] Setting ${e.name} to:`,"color: #10b981; font-weight: bold;",n);return}if(c.source==="mqtt"&&c.topic){if(!l){console.warn("[Action] Cannot send: MQTT disconnected");return}const h=typeof n=="object"?JSON.stringify(n):String(n);console.log(`[MQTT] Publishing to '${c.topic}': ${h}`),o(c.topic,h)}if(c.source==="http"&&c.endpoint)try{await fetch(c.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:c.id,value:n})})}catch{console.log("[HTTP] (Simulation) Request sent.")}},[a.mockMode,l,o,u])}},Al=(o,l)=>{const[s,a]=Oe.useState(()=>{if(typeof window>"u")return l;try{const n=window.localStorage.getItem(o);return n?JSON.parse(n):(window.localStorage.setItem(o,JSON.stringify(l)),l)}catch(n){return console.error(`[Data Lake] Error reading key "${o}":`,n),l}}),u=Oe.useCallback(n=>{a(e=>{let i;e.length>0&&typeof e[0].id=="number"?i=e.reduce((b,S)=>typeof S.id=="number"&&S.id>b?S.id:b,0)+1:i=`id_${Date.now()}`;const h={...n,id:i},d=[...e,h];return window.localStorage.setItem(o,JSON.stringify(d)),d})},[o]),t=Oe.useCallback(n=>{a(e=>{const i=e.map(c=>c.id===n.id?n:c);return window.localStorage.setItem(o,JSON.stringify(i)),i})},[o]),r=Oe.useCallback(n=>{a(e=>{const i=e.filter(c=>c.id!==n);return window.localStorage.setItem(o,JSON.stringify(i)),i})},[o]);return{data:s,createItem:u,updateItem:t,deleteItem:r}};function jf(o,l={}){const{filters:s,sort:a,page:u=1,pageSize:t=10}=l,r=Oe.useMemo(()=>!s||s.length===0?o:o.filter(i=>s.every(c=>{const h=i[c.field];switch(c.operator){case"equals":return h==c.value;case"neq":return h!=c.value;case"contains":return String(h).toLowerCase().includes(String(c.value).toLowerCase());case"gt":return h>c.value;case"lt":return h<c.value;default:return!0}})),[o,s]),n=Oe.useMemo(()=>a?[...r].sort((i,c)=>{const h=i[a.field],d=c[a.field];return h<d?a.direction==="asc"?-1:1:h>d?a.direction==="asc"?1:-1:0}):r,[r,a]);return{data:Oe.useMemo(()=>{const i=(u-1)*t;return n.slice(i,i+t)},[n,u,t]),total:r.length,pageCount:Math.ceil(r.length/t)}}const Rf="ramme_db_",Mf=(o,l)=>{const s=l+1,a=o.label||"Item";switch(o.type){case"text":return`${a} ${s}`;case"number":return Math.floor(Math.random()*100)+1;case"currency":return(Math.random()*1e3).toFixed(2);case"boolean":return Math.random()>.5;case"date":const u=new Date;return u.setDate(u.getDate()-s*2),u.toISOString().split("T")[0];case"status":return["Active","Pending","Inactive","Archived"][l%4];case"email":return`user${s}@example.com`;case"image":return`https://i.pravatar.cc/150?u=${s}`;case"textarea":return`This is a sample description for ${a} ${s}. It contains enough text to test multi-line rendering.`;default:return`${a}-${s}`}},To=(o,l)=>Oe.useMemo(()=>{if(!o)return[];if(typeof window<"u"){const s=`${Rf}${o}`,a=localStorage.getItem(s);if(a)try{const u=JSON.parse(a);if(Array.isArray(u)&&u.length>0)return u}catch{console.warn(`[JIT Seeder] Corrupt data in ${s}, falling back to generation.`)}}return l?(console.log(`🌱 [JIT Seeder] Generating 5 mock records for: ${o}`),Array.from({length:5}).map((a,u)=>{const t={id:`jit_${o}_${u+1}`};return l.fields.forEach(r=>{r.key!=="id"&&(t[r.key]=Mf(r,u))}),t})):[]},[o,l]),Il=({isOpen:o,onClose:l,onSubmit:s,title:a,fields:u,initialData:t})=>{const r=t||{},n=!!r.id,e=Oe.useMemo(()=>u.filter(i=>!(i.key==="id"&&!n)).map(i=>{const c=i.key==="id",h={name:i.key,label:i.label,required:i.required,placeholder:i.description||`Enter ${i.label.toLowerCase()}`,value:r[i.key]!==void 0?r[i.key]:i.defaultValue||"",colSpan:1,disabled:c};switch(i.type){case"number":case"integer":case"currency":return{...h,type:"number",value:Number(h.value)||0};case"boolean":return{...h,type:"toggle",checked:!!h.value};case"date":return{...h,type:"datepicker",value:h.value?new Date(h.value):null};case"status":return{...h,type:"select",options:[{value:"Active",label:"Active"},{value:"Pending",label:"Pending"},{value:"Inactive",label:"Inactive"},{value:"Archived",label:"Archived"}]};case"textarea":return{...h,type:"textarea",colSpan:2};case"email":return{...h,type:"email"};default:return{...h,type:"text"}}}),[u,r,n]);return ke.jsx(qe.Drawer,{isOpen:o,onClose:l,title:`${n?"Edit":"New"} ${a}`,size:"500px",children:ke.jsx("div",{className:"p-6",children:ke.jsx(qe.FormTemplate,{fields:e,onSubmit:i=>{s({...r,...i})},children:ke.jsxs("div",{className:"flex justify-end gap-2 mt-8 pt-4 border-t border-border",children:[ke.jsx(qe.Button,{variant:"outline",onClick:l,type:"button",children:"Cancel"}),ke.jsx(qe.Button,{type:"submit",variant:"primary",children:n?"Save Changes":"Create Record"})]})})})})},Po=({dataId:o,title:l,getResourceMeta:s})=>{const{addToast:a}=qe.useToast(),u=Ut(),t=Oe.useMemo(()=>{var q;const A=(q=u.resources)==null?void 0:q.find(N=>N.id===o);if(A)return A;const M=s==null?void 0:s(o);return M?{...M,id:o}:null},[u,o]),r=To(o,t),{data:n,createItem:e,updateItem:i,deleteItem:c}=Al(`ramme_db_${o}`,r),[h,d]=Oe.useState(!1),[y,b]=Oe.useState(null),[S,w]=Oe.useState(null),[x,g]=Oe.useState([]),[_,E]=Oe.useState(""),v=Oe.useMemo(()=>{if(!(t!=null&&t.fields))return[];const A=t.fields.map(M=>{const q={field:M.key,headerName:M.label,filter:!0,sortable:!0,resizable:!0,flex:1};return M.type==="currency"&&(q.valueFormatter=N=>N.value?`$${Number(N.value).toLocaleString()}`:""),M.type==="date"&&(q.valueFormatter=N=>N.value?new Date(N.value).toLocaleDateString():""),M.type==="status"&&(q.cellRenderer=N=>{const re={active:"bg-green-100 text-green-800",paid:"bg-green-100 text-green-800",pending:"bg-yellow-100 text-yellow-800",inactive:"bg-slate-100 text-slate-600",overdue:"bg-red-100 text-red-800"}[String(N.value).toLowerCase()]||"bg-slate-100 text-slate-800";return ke.jsx("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium ${re}`,children:N.value})}),q});return A.length>0&&(A[0].headerCheckboxSelection=!0,A[0].checkboxSelection=!0,A[0].minWidth=180),A.push({headerName:"Actions",field:"id",width:100,pinned:"right",cellRenderer:M=>ke.jsx("div",{className:"flex items-center gap-1",children:ke.jsx(qe.Button,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:q=>{q.stopPropagation(),b(M.data),d(!0)},children:ke.jsx(qe.Icon,{name:"edit-2",size:14,className:"text-slate-500"})})})}),A},[t]),C=Oe.useMemo(()=>(t==null?void 0:t.fields.find(A=>A.type==="text"&&A.key!=="id"))||(t==null?void 0:t.fields[0]),[t]),P=Oe.useMemo(()=>t==null?void 0:t.fields.find(A=>A.type==="status"),[t]),I=Oe.useCallback(A=>{w(A.api)},[]),T=Oe.useCallback(()=>{S&&g(S.getSelectedRows())},[S]),k=()=>{confirm(`Delete ${x.length} items?`)&&(x.forEach(A=>c(A.id)),g([]),a(`${x.length} items deleted`,"success"))},W=A=>{if(A.id&&(y!=null&&y.id))i(A),a("Item updated","success");else{const{id:M,...q}=A;e(q),a("Item created","success")}d(!1)};return ke.jsxs(qe.Card,{className:"flex flex-col h-[600px] border border-border shadow-sm overflow-hidden bg-card",children:[ke.jsxs("div",{className:"p-4 border-b border-border flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 bg-muted/5",children:[x.length>0?ke.jsxs("div",{className:"flex items-center gap-3 animate-in fade-in slide-in-from-left-2 duration-200",children:[ke.jsxs("span",{className:"bg-primary text-primary-foreground text-xs font-bold px-2 py-1 rounded-md",children:[x.length," Selected"]}),ke.jsx(qe.Button,{size:"sm",variant:"danger",onClick:k,iconLeft:"trash-2",children:"Delete"})]}):ke.jsxs("div",{className:"flex items-center gap-2",children:[ke.jsx("div",{className:"p-2 bg-primary/10 rounded-md text-primary",children:ke.jsx(qe.Icon,{name:"table",size:18})}),ke.jsxs("div",{children:[ke.jsx("h3",{className:"text-base font-bold text-foreground leading-tight",children:l||(t==null?void 0:t.name)||o}),ke.jsxs("p",{className:"text-xs text-muted-foreground",children:[n.length," records found"]})]})]}),ke.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[ke.jsx("div",{className:"w-full sm:w-64",children:ke.jsx(qe.SearchInput,{placeholder:"Quick search...",value:_,onChange:A=>{E(A.target.value),S==null||S.updateGridOptions({quickFilterText:A.target.value})}})}),ke.jsx("div",{className:"h-6 w-px bg-border mx-1 hidden sm:block"}),ke.jsx(qe.Button,{size:"sm",variant:"primary",iconLeft:"plus",onClick:()=>{b({}),d(!0)},children:"Add"})]})]}),ke.jsxs("div",{className:"flex-1 w-full bg-card relative overflow-hidden",children:[ke.jsx("div",{className:"hidden md:block h-full",children:ke.jsx(qe.DataTable,{rowData:n,columnDefs:v,onGridReady:I,onSelectionChanged:T,rowSelection:"multiple",pagination:!0,paginationPageSize:10,headerHeight:48,rowHeight:48,enableCellTextSelection:!0})}),ke.jsxs("div",{className:"block md:hidden h-full overflow-y-auto p-4 space-y-3 bg-muted/5",children:[n.map(A=>ke.jsxs("div",{className:"bg-background border border-border rounded-lg p-4 shadow-sm relative group",children:[ke.jsxs("div",{className:"flex justify-between items-start mb-2",children:[ke.jsxs("div",{children:[ke.jsx("h4",{className:"font-semibold text-foreground",children:C?A[C.key]:A.id}),ke.jsx("p",{className:"text-xs text-muted-foreground font-mono mt-0.5 opacity-70",children:A.id})]}),P&&ke.jsx(qe.Badge,{variant:["active","paid"].includes(String(A[P.key]).toLowerCase())?"success":["pending"].includes(String(A[P.key]).toLowerCase())?"warning":"secondary",children:A[P.key]})]}),ke.jsx("div",{className:"space-y-1 text-sm text-muted-foreground mb-4",children:t==null?void 0:t.fields.filter(M=>M.key!==(C==null?void 0:C.key)&&M.key!==(P==null?void 0:P.key)&&M.key!=="id").slice(0,3).map(M=>ke.jsxs("div",{className:"flex justify-between border-b border-dashed border-border/50 pb-1 last:border-0",children:[ke.jsxs("span",{className:"opacity-70",children:[M.label,":"]}),ke.jsx("span",{className:"font-medium text-foreground",children:M.type==="currency"?`$${Number(A[M.key]).toLocaleString()}`:M.type==="date"?new Date(A[M.key]).toLocaleDateString():A[M.key]})]},M.key))}),ke.jsxs("div",{className:"flex gap-2 pt-2 border-t border-border/50",children:[ke.jsxs(qe.Button,{size:"sm",variant:"outline",className:"flex-1 h-8 text-xs",onClick:()=>{b(A),d(!0)},children:[ke.jsx(qe.Icon,{name:"edit-2",size:12,className:"mr-2"})," Edit"]}),ke.jsx(qe.Button,{size:"sm",variant:"ghost",className:"text-destructive hover:bg-destructive/10 px-3 h-8",onClick:()=>{confirm("Delete?")&&c(A.id)},children:ke.jsx(qe.Icon,{name:"trash-2",size:14})})]})]},A.id)),n.length===0&&ke.jsx("div",{className:"text-center p-8 text-muted-foreground",children:"No records found."})]})]}),ke.jsx(Il,{isOpen:h,onClose:()=>d(!1),onSubmit:W,title:(t==null?void 0:t.name)||"Item",fields:(t==null?void 0:t.fields)||[],initialData:y})]})};/**
|
|
48
|
+
* @license lucide-react v0.454.0 - ISC
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the ISC license.
|
|
51
51
|
* See the LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/const
|
|
53
|
-
* @license lucide-react v0.
|
|
52
|
+
*/const Nf=o=>o.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),kl=(...o)=>o.filter((l,s,a)=>!!l&&l.trim()!==""&&a.indexOf(l)===s).join(" ").trim();/**
|
|
53
|
+
* @license lucide-react v0.454.0 - ISC
|
|
54
54
|
*
|
|
55
55
|
* This source code is licensed under the ISC license.
|
|
56
56
|
* See the LICENSE file in the root directory of this source tree.
|
|
57
|
-
*/var
|
|
58
|
-
* @license lucide-react v0.
|
|
57
|
+
*/var Bf={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
58
|
+
* @license lucide-react v0.454.0 - ISC
|
|
59
59
|
*
|
|
60
60
|
* This source code is licensed under the ISC license.
|
|
61
61
|
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
-
*/const
|
|
63
|
-
* @license lucide-react v0.
|
|
62
|
+
*/const Lf=Oe.forwardRef(({color:o="currentColor",size:l=24,strokeWidth:s=2,absoluteStrokeWidth:a,className:u="",children:t,iconNode:r,...n},e)=>Oe.createElement("svg",{ref:e,...Bf,width:l,height:l,stroke:o,strokeWidth:a?Number(s)*24/Number(l):s,className:kl("lucide",u),...n},[...r.map(([i,c])=>Oe.createElement(i,c)),...Array.isArray(t)?t:[t]]));/**
|
|
63
|
+
* @license lucide-react v0.454.0 - ISC
|
|
64
64
|
*
|
|
65
65
|
* This source code is licensed under the ISC license.
|
|
66
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
-
*/const tr=(o,l)=>{const
|
|
68
|
-
* @license lucide-react v0.
|
|
67
|
+
*/const tr=(o,l)=>{const s=Oe.forwardRef(({className:a,...u},t)=>Oe.createElement(Lf,{ref:t,iconNode:l,className:kl(`lucide-${Nf(o)}`,a),...u}));return s.displayName=`${o}`,s};/**
|
|
68
|
+
* @license lucide-react v0.454.0 - ISC
|
|
69
69
|
*
|
|
70
70
|
* This source code is licensed under the ISC license.
|
|
71
71
|
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
-
*/const
|
|
73
|
-
* @license lucide-react v0.
|
|
72
|
+
*/const Uf=tr("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
|
|
73
|
+
* @license lucide-react v0.454.0 - ISC
|
|
74
74
|
*
|
|
75
75
|
* This source code is licensed under the ISC license.
|
|
76
76
|
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
-
*/const
|
|
78
|
-
* @license lucide-react v0.
|
|
77
|
+
*/const Df=tr("LayoutTemplate",[["rect",{width:"18",height:"7",x:"3",y:"3",rx:"1",key:"f1a2em"}],["rect",{width:"9",height:"7",x:"3",y:"14",rx:"1",key:"jqznyg"}],["rect",{width:"5",height:"7",x:"16",y:"14",rx:"1",key:"q5h2i8"}]]);/**
|
|
78
|
+
* @license lucide-react v0.454.0 - ISC
|
|
79
79
|
*
|
|
80
80
|
* This source code is licensed under the ISC license.
|
|
81
81
|
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
-
*/const
|
|
83
|
-
* @license lucide-react v0.
|
|
82
|
+
*/const Ff=tr("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
83
|
+
* @license lucide-react v0.454.0 - ISC
|
|
84
84
|
*
|
|
85
85
|
* This source code is licensed under the ISC license.
|
|
86
86
|
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
-
*/const
|
|
88
|
-
* @license lucide-react v0.
|
|
87
|
+
*/const Wf=tr("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
88
|
+
* @license lucide-react v0.454.0 - ISC
|
|
89
89
|
*
|
|
90
90
|
* This source code is licensed under the ISC license.
|
|
91
91
|
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
-
*/const
|
|
93
|
-
* @license lucide-react v0.
|
|
92
|
+
*/const $f=tr("WandSparkles",[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]]);/**
|
|
93
|
+
* @license lucide-react v0.454.0 - ISC
|
|
94
94
|
*
|
|
95
95
|
* This source code is licensed under the ISC license.
|
|
96
96
|
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
-
*/const
|
|
98
|
-
* @license lucide-react v0.
|
|
97
|
+
*/const qf=tr("WifiOff",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
98
|
+
* @license lucide-react v0.454.0 - ISC
|
|
99
99
|
*
|
|
100
100
|
* This source code is licensed under the ISC license.
|
|
101
101
|
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
-
*/const
|
|
103
|
-
* @remix-run/router v1.23.
|
|
102
|
+
*/const zf=tr("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),Ol={SmartTable:Po,DataTable:Po,StatCard:qe.StatCard,DeviceCard:qe.DeviceCard,BarChart:qe.BarChart,LineChart:qe.LineChart,Button:qe.Button,Unknown:({type:o})=>ke.jsxs("div",{className:"h-24 w-full border-2 border-dashed border-amber-300 bg-amber-50 rounded-lg flex flex-col items-center justify-center text-amber-700 text-sm",children:[ke.jsx(Df,{className:"mb-2 opacity-50",size:20}),ke.jsxs("span",{children:["Unknown Component: ",ke.jsx("strong",{children:o})]})]})},Vf=o=>Ol[o]||Ol.Unknown;class Kf extends Oe.Component{constructor(l){super(l),this.state={hasError:!1,error:""}}static getDerivedStateFromError(l){return{hasError:!0,error:l.message}}render(){return this.state.hasError?ke.jsxs("div",{className:"h-full min-h-[100px] p-4 border-2 border-dashed border-red-300 bg-red-50/50 rounded-lg flex flex-col items-center justify-center text-red-600 text-xs",children:[ke.jsx(Wf,{size:16,className:"mb-2 opacity-80"}),ke.jsx("span",{className:"font-bold",children:"Render Error"}),ke.jsx("span",{className:"opacity-75 text-center truncate max-w-[200px]",children:this.state.error})]}):this.props.children}}const Hf=({block:o,manifest:l})=>{var e,i,c,h,d;const s=Vf(o.type),a=(e=o.props.dataId)==null?void 0:e.toLowerCase(),u=Oe.useMemo(()=>{var y;return(y=l.resources)==null?void 0:y.find(b=>b.id.toLowerCase()===a)},[l,a]),t=To(a,u),r=(c=(i=t==null?void 0:t[0])==null?void 0:i.id)==null?void 0:c.toString().startsWith("jit_"),n=Oe.useMemo(()=>{if(a&&o.type==="SmartTable"&&!o.props.columnDefs&&u)return u.fields.map(y=>({field:y.key,headerName:y.label,filter:!0,flex:1,cellRenderer:y.type==="status"?b=>ke.jsx(qe.Badge,{variant:"secondary",children:b.value}):void 0}))},[a,o.type,u,o.props.columnDefs]);return ke.jsx("div",{style:{gridColumn:`span ${((h=o.layout)==null?void 0:h.colSpan)||1}`,gridRow:`span ${((d=o.layout)==null?void 0:d.rowSpan)||1}`},className:"relative group",children:ke.jsxs(Kf,{children:[ke.jsx("div",{className:"absolute -top-3 right-0 opacity-0 group-hover:opacity-100 transition-opacity z-20 pointer-events-none translate-y-2 group-hover:translate-y-0 duration-200",children:ke.jsxs("div",{className:`text-[10px] px-2 py-1 rounded-md shadow-lg border border-white/10 flex items-center gap-1.5 font-mono ${r?"bg-amber-600 text-white":"bg-slate-800 text-slate-200"}`,children:[ke.jsx("span",{className:"font-bold",children:o.type}),a&&ke.jsxs(ke.Fragment,{children:[" ",ke.jsx("span",{className:"opacity-40",children:"|"})," ",r?ke.jsx($f,{size:10,className:"animate-pulse"}):ke.jsx(Uf,{size:10})," ",a]})]})}),ke.jsx(s,{...o.props,rowData:o.type==="SmartTable"?void 0:t,columnDefs:o.props.columnDefs||n,className:"w-full h-full"})]})})},Tl=({pageId:o})=>{var r;const l=Ut(),a=dn()==="live",u=Oe.useMemo(()=>{var n;return(n=l.pages)==null?void 0:n.find(e=>e.id===o)},[l,o]);if(!u)return ke.jsxs("div",{className:"p-8 space-y-4 flex flex-col items-center justify-center h-[50vh]",children:[ke.jsx(Ff,{className:"animate-spin text-primary mb-4",size:32}),ke.jsx("p",{className:"text-muted-foreground",children:"Loading Blueprint..."})]});const t=ke.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full text-xs font-bold border transition-colors duration-300 ${a?"bg-green-100 text-green-700 border-green-200":"bg-slate-100 text-slate-500 border-slate-200"}`,children:[a?ke.jsx(zf,{size:14,className:"text-green-600 animate-pulse"}):ke.jsx(qf,{size:14}),a?"LIVE BRIDGE":"STATIC MODE"]});return ke.jsxs("div",{className:"p-6 md:p-8 max-w-7xl mx-auto w-full space-y-8",children:[ke.jsxs("header",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 border-b border-border/40 pb-6",children:[ke.jsxs("div",{className:"space-y-1",children:[ke.jsx("h1",{className:"text-3xl font-bold tracking-tight text-foreground",children:u.title}),u.description&&ke.jsx("p",{className:"text-muted-foreground",children:u.description})]}),ke.jsx("div",{className:"flex items-center gap-2",children:t})]}),ke.jsx("div",{className:"grid gap-8 pb-20",children:(r=u.sections)==null?void 0:r.map(n=>{var e;return ke.jsxs("section",{className:"space-y-6",children:[n.title&&ke.jsx("div",{className:"flex items-center gap-2 pb-2 border-b border-border/60",children:ke.jsx("h3",{className:"text-sm font-bold uppercase tracking-wider text-muted-foreground/80",children:n.title})}),ke.jsx("div",{className:"grid gap-6",style:{gridTemplateColumns:`repeat(${((e=n.layout)==null?void 0:e.columns)||1}, minmax(0, 1fr))`},children:n.blocks.map(i=>ke.jsx(Hf,{block:i,manifest:l},i.id))})]},n.id)})})]})},Gf=o=>{const l=Ut(),a=dn()==="live";return Oe.useMemo(()=>{const u=(l.pages||[]).map(n=>({id:n.id,path:n.slug,title:n.title,icon:n.icon||"layout",component:()=>ke.jsx(Tl,{pageId:n.id})}));if(a&&u.length>0)return u;const t=new Set(o.map(n=>n.id)),r=u.filter(n=>!t.has(n.id));return[...o,...r]},[l,o,a])},Yf={name:"loading",version:"0.0.0",capabilities:[],navigation:[]};function Qf(){const[o,l]=Oe.useState(Yf),{lastMessage:s,isConnected:a}=Oo();return Oe.useEffect(()=>{if(s&&s.topic==="ramme/manifest/update")try{const u=JSON.parse(s.payload.toString());l(u)}catch(u){console.error("Failed to parse manifest update",u)}},[s]),{manifest:o,isLive:a}}const Pl=o=>{let l;const s=new Set,a=(i,c)=>{const h=typeof i=="function"?i(l):i;if(!Object.is(h,l)){const d=l;l=c??(typeof h!="object"||h===null)?h:Object.assign({},l,h),s.forEach(y=>y(l,d))}},u=()=>l,n={setState:a,getState:u,getInitialState:()=>e,subscribe:i=>(s.add(i),()=>s.delete(i))},e=l=o(a,u,n);return n},Jf=o=>o?Pl(o):Pl,Xf=o=>o;function Zf(o,l=Xf){const s=Oe.useSyncExternalStore(o.subscribe,Oe.useCallback(()=>l(o.getState()),[o,l]),Oe.useCallback(()=>l(o.getInitialState()),[o,l]));return Oe.useDebugValue(s),s}const Cl=o=>{const l=Jf(o),s=a=>Zf(l,a);return Object.assign(s,l),s},eh=o=>o?Cl(o):Cl,th={living_room_ac:{value:72,timestamp:Date.now()},living_room_hum:{value:45,timestamp:Date.now()},server_01:{value:42,timestamp:Date.now()},front_door_lock:{value:"LOCKED",timestamp:Date.now()}},on=eh(o=>({signals:th,updateSignal:(l,s)=>o(a=>({signals:{...a.signals,[l]:{value:s,timestamp:Date.now()}}})),updateSignals:l=>o(s=>{const a={...s.signals};return Object.entries(l).forEach(([u,t])=>{a[u]={value:t,timestamp:Date.now()}}),{signals:a}})})),Co=()=>on(o=>o.signals),jl=(o=!0)=>{const{updateSignals:l}=on();Oe.useEffect(()=>{if(!o)return;console.log("[System] Simulation Mode: ON 🎲");const s=setInterval(()=>{const a={};a.living_room_ac=Number((72+(Math.random()*4-2)).toFixed(1)),a.living_room_hum=Number((45+(Math.random()*6-3)).toFixed(1)),a.server_01=Math.floor(Math.random()*100),Math.random()>.99&&(a.front_door_lock=Math.random()>.5?"LOCKED":"UNLOCKED"),l(a)},2e3);return()=>clearInterval(s)},[o,l])},rh=o=>{const l=on(r=>r.signals[o]),s=Ut(),a=Oe.useMemo(()=>s.domain.signals.find(r=>r.id===o),[o,s]),u=(l==null?void 0:l.value)??(a==null?void 0:a.defaultValue)??0,t=l?Date.now()-l.timestamp>1e4:!0;return{id:o,value:u,unit:a==null?void 0:a.unit,min:a==null?void 0:a.min,max:a==null?void 0:a.max,timestamp:l==null?void 0:l.timestamp,status:t?"stale":"fresh"}},nh=()=>{const o=Co(),{addToast:l}=qe.useToast(),s=Ut();jl(s.config.mockMode);const a=async(u,t)=>{switch(console.log(`[Engine] Executing: ${u.type}`,u),u.type){case"send_notification":l(u.config.message||"Notification Sent","info");break;case"update_resource":l(`Updating Resource: ${JSON.stringify(u.config)}`,"success");break;case"navigate":window.location.href=u.config.path;break;case"agent_task":l("AI Agent Analyzing...","info"),setTimeout(()=>l('🤖 Agent: "System Nominal"',"success",3e3),1500);break}};return Oe.useEffect(()=>{var u;(u=s.domain)!=null&&u.workflows&&s.domain.workflows.forEach(t=>{if(t.active&&t.trigger.type==="signal_change"){const r=t.trigger.config.signalId,n=t.trigger.config.condition,e=o[r];if(e){const i=e.value;try{ih(i,n)&&(console.log(`[Engine] Trigger Fired: ${t.name}`),t.actions.forEach(h=>a(h,{signal:i})))}catch{}}}})},[o,l,s.domain.workflows]),{triggerWorkflow:u=>{var r,n;const t=(n=(r=s.domain)==null?void 0:r.workflows)==null?void 0:n.find(e=>e.id===u);t&&t.actions.forEach(e=>a(e))}}},ih=(o,l)=>{if(!l)return!1;const s=l.trim().split(" "),a=s[0],u=parseFloat(s[1]);switch(a){case">":return o>u;case"<":return o<u;case">=":return o>=u;case"<=":return o<=u;case"==":return o===u;default:return!1}},oh="ramme_db_",sh=o=>{if(!(typeof window>"u")){if(!o){console.warn("⚠️ [Data Lake] No registry provided to seeder. Skipping initialization.");return}console.groupCollapsed("🌊 [Data Lake] Initialization"),Object.entries(o).forEach(([l,s])=>{const a=`${oh}${l}`;localStorage.getItem(a)||(console.log(`✨ Seeding collection: ${l}`),localStorage.setItem(a,JSON.stringify(s)))}),console.groupEnd()}},Rl=o=>{switch(o){case"fresh":return"online";case"stale":return"warning";case"disconnected":return"offline";case"error":return"error";default:return"offline"}},ah=({block:o,getComponent:l,getMockData:s})=>{const a=l(o.type),u=Co(),{signalId:t,dataId:r,...n}=o.props,e={...n,dataId:r,signalId:t};if(r){const i=s(r);e.data=i||[],e.rowData=i||[]}if(t&&u&&t in u){const i=u[t];if(i){const c=typeof i=="object"&&i!==null,h=c&&"value"in i?i.value:i,d=c&&"status"in i?i.status:"fresh";e.value=typeof h=="number"?h:String(h),e.status=Rl(String(d))}else e.status=Rl("disconnected")}return ke.jsx(a,{...e},o.id)};/**
|
|
103
|
+
* @remix-run/router v1.23.2
|
|
104
104
|
*
|
|
105
105
|
* Copyright (c) Remix Software Inc.
|
|
106
106
|
*
|
|
@@ -108,8 +108,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
108
108
|
* LICENSE.md file in the root directory of this source tree.
|
|
109
109
|
*
|
|
110
110
|
* @license MIT
|
|
111
|
-
*/function
|
|
112
|
-
* React Router v6.30.
|
|
111
|
+
*/function jo(){return jo=Object.assign?Object.assign.bind():function(o){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])}return o},jo.apply(this,arguments)}var Ml;(function(o){o.Pop="POP",o.Push="PUSH",o.Replace="REPLACE"})(Ml||(Ml={}));function gt(o,l){if(o===!1||o===null||typeof o>"u")throw new Error(l)}function sn(o,l){if(!o){typeof console<"u"&&console.warn(l);try{throw new Error(l)}catch{}}}function Nl(o){let l={};if(o){let s=o.indexOf("#");s>=0&&(l.hash=o.substr(s),o=o.substr(0,s));let a=o.indexOf("?");a>=0&&(l.search=o.substr(a),o=o.substr(0,a)),o&&(l.pathname=o)}return l}var Bl;(function(o){o.data="data",o.deferred="deferred",o.redirect="redirect",o.error="error"})(Bl||(Bl={}));const lh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,uh=o=>lh.test(o);function ch(o,l){l===void 0&&(l="/");let{pathname:s,search:a="",hash:u=""}=typeof o=="string"?Nl(o):o,t;if(s)if(uh(s))t=s;else{if(s.includes("//")){let r=s;s=s.replace(/\/\/+/g,"/"),sn(!1,"Pathnames cannot have embedded double slashes - normalizing "+(r+" -> "+s))}s.startsWith("/")?t=Ll(s.substring(1),"/"):t=Ll(s,l)}else t=l;return{pathname:t,search:ph(a),hash:dh(u)}}function Ll(o,l){let s=l.replace(/\/+$/,"").split("/");return o.split("/").forEach(u=>{u===".."?s.length>1&&s.pop():u!=="."&&s.push(u)}),s.length>1?s.join("/"):"/"}function Ro(o,l,s,a){return"Cannot include a '"+o+"' character in a manually specified "+("`to."+l+"` field ["+JSON.stringify(a)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function fh(o){return o.filter((l,s)=>s===0||l.route.path&&l.route.path.length>0)}function Ul(o,l){let s=fh(o);return l?s.map((a,u)=>u===s.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function Dl(o,l,s,a){a===void 0&&(a=!1);let u;typeof o=="string"?u=Nl(o):(u=jo({},o),gt(!u.pathname||!u.pathname.includes("?"),Ro("?","pathname","search",u)),gt(!u.pathname||!u.pathname.includes("#"),Ro("#","pathname","hash",u)),gt(!u.search||!u.search.includes("#"),Ro("#","search","hash",u)));let t=o===""||u.pathname==="",r=t?"/":u.pathname,n;if(r==null)n=s;else{let h=l.length-1;if(!a&&r.startsWith("..")){let d=r.split("/");for(;d[0]==="..";)d.shift(),h-=1;u.pathname=d.join("/")}n=h>=0?l[h]:"/"}let e=ch(u,n),i=r&&r!=="/"&&r.endsWith("/"),c=(t||r===".")&&s.endsWith("/");return!e.pathname.endsWith("/")&&(i||c)&&(e.pathname+="/"),e}const hh=o=>o.join("/").replace(/\/\/+/g,"/"),ph=o=>!o||o==="?"?"":o.startsWith("?")?o:"?"+o,dh=o=>!o||o==="#"?"":o.startsWith("#")?o:"#"+o,Fl=["post","put","patch","delete"];new Set(Fl);const gh=["get",...Fl];new Set(gh);/**
|
|
112
|
+
* React Router v6.30.3
|
|
113
113
|
*
|
|
114
114
|
* Copyright (c) Remix Software Inc.
|
|
115
115
|
*
|
|
@@ -117,4 +117,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
117
117
|
* LICENSE.md file in the root directory of this source tree.
|
|
118
118
|
*
|
|
119
119
|
* @license MIT
|
|
120
|
-
*/function
|
|
120
|
+
*/function Mo(){return Mo=Object.assign?Object.assign.bind():function(o){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(o[a]=s[a])}return o},Mo.apply(this,arguments)}const No=st.createContext(null);process.env.NODE_ENV!=="production"&&(No.displayName="DataRouter");const yh=st.createContext(null);process.env.NODE_ENV!=="production"&&(yh.displayName="DataRouterState");const mh=st.createContext(null);process.env.NODE_ENV!=="production"&&(mh.displayName="Await");const an=st.createContext(null);process.env.NODE_ENV!=="production"&&(an.displayName="Navigation");const Bo=st.createContext(null);process.env.NODE_ENV!=="production"&&(Bo.displayName="Location");const _r=st.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(_r.displayName="Route");const bh=st.createContext(null);process.env.NODE_ENV!=="production"&&(bh.displayName="RouteError");function Lo(){return st.useContext(Bo)!=null}function Wl(){return Lo()||(process.env.NODE_ENV!=="production"?gt(!1,"useLocation() may be used only in the context of a <Router> component."):gt(!1)),st.useContext(Bo).location}const $l="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ql(o){st.useContext(an).static||st.useLayoutEffect(o)}function vh(){let{isDataRoute:o}=st.useContext(_r);return o?xh():wh()}function wh(){Lo()||(process.env.NODE_ENV!=="production"?gt(!1,"useNavigate() may be used only in the context of a <Router> component."):gt(!1));let o=st.useContext(No),{basename:l,future:s,navigator:a}=st.useContext(an),{matches:u}=st.useContext(_r),{pathname:t}=Wl(),r=JSON.stringify(Ul(u,s.v7_relativeSplatPath)),n=st.useRef(!1);return ql(()=>{n.current=!0}),st.useCallback(function(i,c){if(c===void 0&&(c={}),process.env.NODE_ENV!=="production"&&sn(n.current,$l),!n.current)return;if(typeof i=="number"){a.go(i);return}let h=Dl(i,JSON.parse(r),t,c.relative==="path");o==null&&l!=="/"&&(h.pathname=h.pathname==="/"?l:hh([l,h.pathname])),(c.replace?a.replace:a.push)(h,c.state,c)},[l,a,r,t,o])}var zl=function(o){return o.UseBlocker="useBlocker",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o}(zl||{}),Vl=function(o){return o.UseBlocker="useBlocker",o.UseLoaderData="useLoaderData",o.UseActionData="useActionData",o.UseRouteError="useRouteError",o.UseNavigation="useNavigation",o.UseRouteLoaderData="useRouteLoaderData",o.UseMatches="useMatches",o.UseRevalidator="useRevalidator",o.UseNavigateStable="useNavigate",o.UseRouteId="useRouteId",o}(Vl||{});function Kl(o){return o+" must be used within a data router. See https://reactrouter.com/v6/routers/picking-a-router."}function _h(o){let l=st.useContext(No);return l||(process.env.NODE_ENV!=="production"?gt(!1,Kl(o)):gt(!1)),l}function Sh(o){let l=st.useContext(_r);return l||(process.env.NODE_ENV!=="production"?gt(!1,Kl(o)):gt(!1)),l}function Eh(o){let l=Sh(o),s=l.matches[l.matches.length-1];return s.route.id||(process.env.NODE_ENV!=="production"?gt(!1,o+' can only be used on routes that contain a unique "id"'):gt(!1)),s.route.id}function xh(){let{router:o}=_h(zl.UseNavigateStable),l=Eh(Vl.UseNavigateStable),s=st.useRef(!1);return ql(()=>{s.current=!0}),st.useCallback(function(u,t){t===void 0&&(t={}),process.env.NODE_ENV!=="production"&&sn(s.current,$l),s.current&&(typeof u=="number"?o.navigate(u):o.navigate(u,Mo({fromRouteId:l},t)))},[o,l])}function Ah(o){let{to:l,replace:s,state:a,relative:u}=o;Lo()||(process.env.NODE_ENV!=="production"?gt(!1,"<Navigate> may be used only in the context of a <Router> component."):gt(!1));let{future:t,static:r}=st.useContext(an);process.env.NODE_ENV!=="production"&&sn(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:n}=st.useContext(_r),{pathname:e}=Wl(),i=vh(),c=Dl(l,Ul(n,t.v7_relativeSplatPath),e,u==="path"),h=JSON.stringify(c);return st.useEffect(()=>i(JSON.parse(h),{replace:s,state:a,relative:u}),[i,h,u,s,a]),null}function Uo(o){process.env.NODE_ENV!=="production"?gt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>."):gt(!1)}new Promise(()=>{});const Hl=o=>o.map(l=>{if(l.children&&l.children.length>0){const s=l.children[0].path;return ke.jsxs(Uo,{path:l.path,element:ke.jsx(l.component,{}),children:[ke.jsx(Uo,{index:!0,element:ke.jsx(Ah,{to:s,replace:!0})}),Hl(l.children)]},l.id)}return ke.jsx(Uo,{path:l.path,element:ke.jsx(l.component,{})},l.id)}),Gl=Se.z.object({key:Se.z.string(),label:Se.z.string(),type:Se.z.enum(["text","number","currency","date","boolean","status","email","image","textarea"]),required:Se.z.boolean().optional(),description:Se.z.string().optional(),defaultValue:Se.z.any().optional()}),Yl=Se.z.object({id:Se.z.string(),name:Se.z.string(),fields:Se.z.array(Gl),defaultView:Se.z.enum(["table","grid","list"]).optional(),features:Se.z.object({searchable:Se.z.boolean().optional(),creatable:Se.z.boolean().optional(),editable:Se.z.boolean().optional(),deletable:Se.z.boolean().optional(),exportable:Se.z.boolean().optional()}).optional()}),Ql=Se.z.object({id:Se.z.string().min(1,"Signal ID is required"),label:Se.z.string(),description:Se.z.string().optional(),kind:Se.z.enum(["sensor","actuator","setpoint","metric","status","kpi"]),source:Se.z.enum(["mock","mqtt","http","derived","local"]),topic:Se.z.string().optional(),endpoint:Se.z.string().optional(),jsonPath:Se.z.string().optional(),refreshRate:Se.z.number().optional().default(1e3),defaultValue:Se.z.any().optional(),unit:Se.z.string().optional(),min:Se.z.number().optional(),max:Se.z.number().optional()}),Jl=Se.z.object({id:Se.z.string(),name:Se.z.string(),description:Se.z.string().optional(),type:Se.z.string(),category:Se.z.string().default("logical"),signals:Se.z.array(Se.z.string()),ui:Se.z.object({icon:Se.z.string().optional(),color:Se.z.string().optional(),dashboardComponent:Se.z.string().optional()}).optional()}),Xl=Se.z.object({id:Se.z.string(),type:Se.z.enum(["signal_change","manual_action","schedule","webhook"]),config:Se.z.record(Se.z.string(),Se.z.any())}),Zl=Se.z.object({id:Se.z.string(),type:Se.z.enum(["update_resource","send_notification","mqtt_publish","api_call","navigate","agent_task"]),config:Se.z.record(Se.z.string(),Se.z.any())}),eu=Se.z.object({id:Se.z.string(),name:Se.z.string(),active:Se.z.boolean().default(!0),trigger:Xl,actions:Se.z.array(Zl)}),tu=Se.z.object({id:Se.z.string(),type:Se.z.string(),props:Se.z.record(Se.z.string(),Se.z.any()),layout:Se.z.object({colSpan:Se.z.number().optional(),rowSpan:Se.z.number().optional()}).optional()}),ru=Se.z.object({id:Se.z.string(),title:Se.z.string().optional(),description:Se.z.string().optional(),layout:Se.z.object({columns:Se.z.number().optional(),variant:Se.z.enum(["grid","stack","split"]).optional()}).optional(),blocks:Se.z.array(tu)}),nu=Se.z.object({id:Se.z.string(),slug:Se.z.string(),title:Se.z.string(),description:Se.z.string().optional(),icon:Se.z.string().optional(),sections:Se.z.array(ru)}),Ih=Se.z.object({meta:Se.z.object({name:Se.z.string(),version:Se.z.string(),description:Se.z.string().optional(),author:Se.z.string().optional(),createdAt:Se.z.string().optional()}),config:Se.z.object({theme:Se.z.enum(["light","dark","system","corporate","midnight","blueprint"]).default("system"),mockMode:Se.z.boolean().default(!0),brokerUrl:Se.z.string().optional()}),modules:Se.z.array(Se.z.string()).optional(),resources:Se.z.array(Yl).optional(),domain:Se.z.object({signals:Se.z.array(Ql),entities:Se.z.array(Jl),workflows:Se.z.array(eu).optional()}),pages:Se.z.array(nu).optional()});Ne.ActionSchema=Zl,Ne.AppSpecificationSchema=Ih,Ne.AutoForm=Il,Ne.BlockSchema=tu,Ne.DynamicBlock=ah,Ne.DynamicPage=Tl,Ne.EntitySchema=Jl,Ne.FieldSchema=Gl,Ne.ManifestProvider=mu,Ne.MqttProvider=Of,Ne.PageSchema=nu,Ne.PageSectionSchema=ru,Ne.ResourceSchema=Yl,Ne.SignalSchema=Ql,Ne.SitemapProvider=Pf,Ne.SmartTable=Po,Ne.TriggerSchema=Xl,Ne.WorkflowSchema=eu,Ne.generateRoutes=Hl,Ne.initializeDataLake=sh,Ne.useAction=Cf,Ne.useBridgeStatus=dn,Ne.useCrudLocalStorage=Al,Ne.useDataQuery=jf,Ne.useDynamicSitemap=Gf,Ne.useGeneratedSignals=Co,Ne.useJustInTimeSeeder=To,Ne.useLiveBridge=Qf,Ne.useManifest=Ut,Ne.useMqtt=Oo,Ne.useSignal=rh,Ne.useSignalStore=on,Ne.useSimulation=jl,Ne.useSitemap=Tf,Ne.useWorkflowEngine=nh,Object.defineProperty(Ne,Symbol.toStringTag,{value:"Module"})});
|