@sebbo2002/vestaboard2mqtt 6.0.3 → 6.0.4-develop.1
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/bin/start.cjs +4 -4
- package/dist/bin/start.cjs.map +1 -1
- package/dist/bin/start.js +1 -1
- package/dist/{chunk-GAFNM5FO.js → chunk-Z36WS5HL.js} +5 -5
- package/dist/chunk-Z36WS5HL.js.map +1 -0
- package/dist/lib/index.cjs +4 -4
- package/dist/lib/index.cjs.map +1 -1
- package/dist/lib/index.js +1 -1
- package/package.json +3 -3
- package/dist/chunk-GAFNM5FO.js.map +0 -1
package/dist/lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var Su=Object.create;var hr=Object.defineProperty;var Eu=Object.getOwnPropertyDescriptor;var xu=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Cu=Object.prototype.hasOwnProperty;var U=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Gn=(t,e)=>{for(var r in e)hr(t,r,{get:e[r],enumerable:!0})},Qn=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xu(e))!Cu.call(t,n)&&n!==r&&hr(t,n,{get:()=>e[n],enumerable:!(i=Eu(e,n))||i.enumerable});return t};var ui=(t,e,r)=>(r=t!=null?Su(Tu(t)):{},Qn(e||!t||!t.__esModule?hr(r,"default",{value:t,enumerable:!0}):r,t)),Yn=t=>Qn(hr({},"__esModule",{value:!0}),t);var dr=g((Yg,Xn)=>{"use strict";Xn.exports=Ou;var Pu=Object.prototype.hasOwnProperty;function Ou(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)Pu.call(r,i)&&(t[i]=r[i])}return t}});var fi=g((Xg,Jn)=>{"use strict";Jn.exports=require("stream")});var rs=g((Jg,ts)=>{"use strict";function Zn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Iu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zn(Object(r),!0).forEach(function(i){Ru(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zn(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Ru(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Au(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function es(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Bu(t,e,r){return e&&es(t.prototype,e),r&&es(t,r),t}var ku=require("buffer"),pr=ku.Buffer,Lu=require("util"),ci=Lu.inspect,Mu=ci&&ci.custom||"inspect";function qu(t,e,r){pr.prototype.copy.call(t,e,r)}ts.exports=(function(){function t(){Au(this,t),this.head=null,this.tail=null,this.length=0}return Bu(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return pr.alloc(0);for(var i=pr.allocUnsafe(r>>>0),n=this.head,s=0;n;)qu(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var o=i.data,a=r>o.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(r){var i=pr.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var o=n.data,a=r>o.length?o.length:r;if(o.copy(i,i.length-r,0,a),r-=a,r===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:Mu,value:function(r,i){return ci(this,Iu({},i,{depth:0,customInspect:!1}))}}]),t})()});var di=g((Zg,ns)=>{"use strict";function Nu(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(hi,this,t)):process.nextTick(hi,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(gr,r):(r._writableState.errorEmitted=!0,process.nextTick(is,r,s)):process.nextTick(is,r,s):e?(process.nextTick(gr,r),e(s)):process.nextTick(gr,r)}),this)}function is(t,e){hi(t,e),gr(t)}function gr(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Du(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function hi(t,e){t.emit("error",e)}function Uu(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}ns.exports={destroy:Nu,undestroy:Du,errorOrDestroy:Uu}});var Be=g((ey,as)=>{"use strict";var os={};function ne(t,e,r){r||(r=Error);function i(s,o,a){return typeof e=="string"?e:e(s,o,a)}class n extends r{constructor(o,a,u){super(i(o,a,u))}}n.prototype.name=r.name,n.prototype.code=t,os[t]=n}function ss(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(i=>String(i)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function ju(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Fu(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Wu(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}ne("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);ne("ERR_INVALID_ARG_TYPE",function(t,e,r){let i;typeof e=="string"&&ju(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(Fu(t," argument"))n=`The ${t} ${i} ${ss(e,"type")}`;else{let s=Wu(t,".")?"property":"argument";n=`The "${t}" ${s} ${i} ${ss(e,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);ne("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ne("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});ne("ERR_STREAM_PREMATURE_CLOSE","Premature close");ne("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});ne("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ne("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ne("ERR_STREAM_WRITE_AFTER_END","write after end");ne("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ne("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);ne("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");as.exports.codes=os});var pi=g((ty,ls)=>{"use strict";var Vu=Be().codes.ERR_INVALID_OPT_VALUE;function Hu(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Ku(t,e,r,i){var n=Hu(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new Vu(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}ls.exports={getHighWaterMark:Ku}});var us=g((ry,gi)=>{"use strict";typeof Object.create=="function"?gi.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:gi.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var we=g((iy,_i)=>{"use strict";try{if(yi=require("util"),typeof yi.inherits!="function")throw"";_i.exports=yi.inherits}catch{_i.exports=us()}var yi});var cs=g((ny,fs)=>{"use strict";fs.exports=require("util").deprecate});var bi=g((sy,_s)=>{"use strict";_s.exports=L;function ds(t){var e=this;this.next=null,this.entry=null,this.finish=function(){vf(e,t)}}var yt;L.WritableState=Lt;var zu={deprecate:cs()},ps=fi(),_r=require("buffer").Buffer,$u=global.Uint8Array||function(){};function Gu(t){return _r.from(t)}function Qu(t){return _r.isBuffer(t)||t instanceof $u}var vi=di(),Yu=pi(),Xu=Yu.getHighWaterMark,ke=Be().codes,Ju=ke.ERR_INVALID_ARG_TYPE,Zu=ke.ERR_METHOD_NOT_IMPLEMENTED,ef=ke.ERR_MULTIPLE_CALLBACK,tf=ke.ERR_STREAM_CANNOT_PIPE,rf=ke.ERR_STREAM_DESTROYED,nf=ke.ERR_STREAM_NULL_VALUES,sf=ke.ERR_STREAM_WRITE_AFTER_END,of=ke.ERR_UNKNOWN_ENCODING,_t=vi.errorOrDestroy;we()(L,ps);function af(){}function Lt(t,e,r){yt=yt||Je(),t=t||{},typeof r!="boolean"&&(r=e instanceof yt),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Xu(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){pf(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new ds(this)}Lt.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Lt.prototype,"buffer",{get:zu.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var yr;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(yr=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(e){return yr.call(this,e)?!0:this!==L?!1:e&&e._writableState instanceof Lt}})):yr=function(e){return e instanceof this};function L(t){yt=yt||Je();var e=this instanceof yt;if(!e&&!yr.call(L,this))return new L(t);this._writableState=new Lt(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),ps.call(this)}L.prototype.pipe=function(){_t(this,new tf)};function lf(t,e){var r=new sf;_t(t,r),process.nextTick(e,r)}function uf(t,e,r,i){var n;return r===null?n=new nf:typeof r!="string"&&!e.objectMode&&(n=new Ju("chunk",["string","Buffer"],r)),n?(_t(t,n),process.nextTick(i,n),!1):!0}L.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&Qu(t);return s&&!_r.isBuffer(t)&&(t=Gu(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=af),i.ending?lf(this,r):(s||uf(this,i,t,r))&&(i.pendingcb++,n=cf(this,i,s,t,e,r)),n};L.prototype.cork=function(){this._writableState.corked++};L.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&gs(this,t))};L.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new of(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(L.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ff(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=_r.from(e,r)),e}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cf(t,e,r,i,n,s){if(!r){var o=ff(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else mi(t,e,!1,a,i,n,s);return u}function mi(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new rf("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function hf(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(kt,t,e),t._writableState.errorEmitted=!0,_t(t,i)):(n(i),t._writableState.errorEmitted=!0,_t(t,i),kt(t,e))}function df(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function pf(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new ef;if(df(r),e)hf(t,r,i,e,n);else{var s=ys(r)||t.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&gs(t,r),i?process.nextTick(hs,t,r,s,n):hs(t,r,s,n)}}function hs(t,e,r,i){r||gf(t,e),e.pendingcb--,i(),kt(t,e)}function gf(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function gs(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var o=0,a=!0;r;)n[o]=r,r.isBuf||(a=!1),r=r.next,o+=1;n.allBuffers=a,mi(t,e,!0,e.length,n,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new ds(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback,h=e.objectMode?1:u.length;if(mi(t,e,!1,h,u,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}L.prototype._write=function(t,e,r){r(new Zu("_write()"))};L.prototype._writev=null;L.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||mf(this,i,r),this};Object.defineProperty(L.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ys(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function yf(t,e){t._final(function(r){e.pendingcb--,r&&_t(t,r),e.prefinished=!0,t.emit("prefinish"),kt(t,e)})}function _f(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(yf,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function kt(t,e){var r=ys(e);if(r&&(_f(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function mf(t,e,r){e.ending=!0,kt(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function vf(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(L.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});L.prototype.destroy=vi.destroy;L.prototype._undestroy=vi.undestroy;L.prototype._destroy=function(t,e){e(t)}});var Je=g((oy,vs)=>{"use strict";var bf=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};vs.exports=ge;var ms=Ei(),Si=bi();we()(ge,ms);for(wi=bf(Si.prototype),mr=0;mr<wi.length;mr++)vr=wi[mr],ge.prototype[vr]||(ge.prototype[vr]=Si.prototype[vr]);var wi,vr,mr;function ge(t){if(!(this instanceof ge))return new ge(t);ms.call(this,t),Si.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",wf)))}Object.defineProperty(ge.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(ge.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(ge.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function wf(){this._writableState.ended||process.nextTick(Sf,this)}function Sf(t){t.end()}Object.defineProperty(ge.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Ss=g((xi,ws)=>{"use strict";var br=require("buffer"),ye=br.Buffer;function bs(t,e){for(var r in t)e[r]=t[r]}ye.from&&ye.alloc&&ye.allocUnsafe&&ye.allocUnsafeSlow?ws.exports=br:(bs(br,xi),xi.Buffer=Ze);function Ze(t,e,r){return ye(t,e,r)}Ze.prototype=Object.create(ye.prototype);bs(ye,Ze);Ze.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ye(t,e,r)};Ze.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=ye(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Ze.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ye(t)};Ze.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return br.SlowBuffer(t)}});var Pi=g(xs=>{"use strict";var Ci=Ss().Buffer,Es=Ci.isEncoding||function(t){switch(t=""+t,t&&t.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 Ef(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function xf(t){var e=Ef(t);if(typeof e!="string"&&(Ci.isEncoding===Es||!Es(t)))throw new Error("Unknown encoding: "+t);return e||t}xs.StringDecoder=Mt;function Mt(t){this.encoding=xf(t);var e;switch(this.encoding){case"utf16le":this.text=Rf,this.end=Af,e=4;break;case"utf8":this.fillLast=Pf,e=4;break;case"base64":this.text=Bf,this.end=kf,e=3;break;default:this.write=Lf,this.end=Mf;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ci.allocUnsafe(e)}Mt.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Mt.prototype.end=If;Mt.prototype.text=Of;Mt.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ti(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Tf(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Ti(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Ti(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Ti(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function Cf(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function Pf(t){var e=this.lastTotal-this.lastNeed,r=Cf(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function Of(t,e){var r=Tf(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function If(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Rf(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Af(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Bf(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function kf(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Lf(t){return t.toString(this.encoding)}function Mf(t){return t&&t.length?this.write(t):""}});var wr=g((ly,Ps)=>{"use strict";var Ts=Be().codes.ERR_STREAM_PREMATURE_CLOSE;function qf(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function Nf(){}function Df(t){return t.setHeader&&typeof t.abort=="function"}function Cs(t,e,r){if(typeof e=="function")return Cs(t,null,e);e||(e={}),r=qf(r||Nf);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||a()},o=t._writableState&&t._writableState.finished,a=function(){n=!1,o=!0,i||r.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){i=!1,u=!0,n||r.call(t)},f=function(m){r.call(t,m)},h=function(){var m;if(i&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new Ts),r.call(t,m);if(n&&!o)return(!t._writableState||!t._writableState.ended)&&(m=new Ts),r.call(t,m)},c=function(){t.req.on("finish",a)};return Df(t)?(t.on("complete",a),t.on("abort",h),t.req?c():t.on("request",c)):n&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",f),t.on("close",h),function(){t.removeListener("complete",a),t.removeListener("abort",h),t.removeListener("request",c),t.req&&t.req.removeListener("finish",a),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",f),t.removeListener("close",h)}}Ps.exports=Cs});var Is=g((uy,Os)=>{"use strict";var Sr;function Le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Uf=wr(),Me=Symbol("lastResolve"),et=Symbol("lastReject"),qt=Symbol("error"),Er=Symbol("ended"),tt=Symbol("lastPromise"),Oi=Symbol("handlePromise"),rt=Symbol("stream");function qe(t,e){return{value:t,done:e}}function jf(t){var e=t[Me];if(e!==null){var r=t[rt].read();r!==null&&(t[tt]=null,t[Me]=null,t[et]=null,e(qe(r,!1)))}}function Ff(t){process.nextTick(jf,t)}function Wf(t,e){return function(r,i){t.then(function(){if(e[Er]){r(qe(void 0,!0));return}e[Oi](r,i)},i)}}var Vf=Object.getPrototypeOf(function(){}),Hf=Object.setPrototypeOf((Sr={get stream(){return this[rt]},next:function(){var e=this,r=this[qt];if(r!==null)return Promise.reject(r);if(this[Er])return Promise.resolve(qe(void 0,!0));if(this[rt].destroyed)return new Promise(function(o,a){process.nextTick(function(){e[qt]?a(e[qt]):o(qe(void 0,!0))})});var i=this[tt],n;if(i)n=new Promise(Wf(i,this));else{var s=this[rt].read();if(s!==null)return Promise.resolve(qe(s,!1));n=new Promise(this[Oi])}return this[tt]=n,n}},Le(Sr,Symbol.asyncIterator,function(){return this}),Le(Sr,"return",function(){var e=this;return new Promise(function(r,i){e[rt].destroy(null,function(n){if(n){i(n);return}r(qe(void 0,!0))})})}),Sr),Vf),Kf=function(e){var r,i=Object.create(Hf,(r={},Le(r,rt,{value:e,writable:!0}),Le(r,Me,{value:null,writable:!0}),Le(r,et,{value:null,writable:!0}),Le(r,qt,{value:null,writable:!0}),Le(r,Er,{value:e._readableState.endEmitted,writable:!0}),Le(r,Oi,{value:function(s,o){var a=i[rt].read();a?(i[tt]=null,i[Me]=null,i[et]=null,s(qe(a,!1))):(i[Me]=s,i[et]=o)},writable:!0}),r));return i[tt]=null,Uf(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=i[et];s!==null&&(i[tt]=null,i[Me]=null,i[et]=null,s(n)),i[qt]=n;return}var o=i[Me];o!==null&&(i[tt]=null,i[Me]=null,i[et]=null,o(qe(void 0,!0))),i[Er]=!0}),e.on("readable",Ff.bind(null,i)),i};Os.exports=Kf});var ks=g((fy,Bs)=>{"use strict";function Rs(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(i,n)}function zf(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(u){Rs(s,i,n,o,a,"next",u)}function a(u){Rs(s,i,n,o,a,"throw",u)}o(void 0)})}}function As(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function $f(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?As(Object(r),!0).forEach(function(i){Gf(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):As(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Gf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Qf=Be().codes.ERR_INVALID_ARG_TYPE;function Yf(t,e,r){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new Qf("iterable",["Iterable"],e);var n=new t($f({objectMode:!0},r)),s=!1;n._read=function(){s||(s=!0,o())};function o(){return a.apply(this,arguments)}function a(){return a=zf(function*(){try{var u=yield i.next(),l=u.value,f=u.done;f?n.push(null):n.push(yield l)?o():s=!1}catch(h){n.destroy(h)}}),a.apply(this,arguments)}return n}Bs.exports=Yf});var Ei=g((hy,Vs)=>{"use strict";Vs.exports=P;var mt;P.ReadableState=Ns;var cy=require("events").EventEmitter,qs=function(e,r){return e.listeners(r).length},Dt=fi(),xr=require("buffer").Buffer,Xf=global.Uint8Array||function(){};function Jf(t){return xr.from(t)}function Zf(t){return xr.isBuffer(t)||t instanceof Xf}var Ii=require("util"),x;Ii&&Ii.debuglog?x=Ii.debuglog("stream"):x=function(){};var ec=rs(),qi=di(),tc=pi(),rc=tc.getHighWaterMark,Tr=Be().codes,ic=Tr.ERR_INVALID_ARG_TYPE,nc=Tr.ERR_STREAM_PUSH_AFTER_EOF,sc=Tr.ERR_METHOD_NOT_IMPLEMENTED,oc=Tr.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,vt,Ri,Ai;we()(P,Dt);var Nt=qi.errorOrDestroy,Bi=["error","close","destroy","pause","resume"];function ac(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Ns(t,e,r){mt=mt||Je(),t=t||{},typeof r!="boolean"&&(r=e instanceof mt),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=rc(this,t,"readableHighWaterMark",r),this.buffer=new ec,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(vt||(vt=Pi().StringDecoder),this.decoder=new vt(t.encoding),this.encoding=t.encoding)}function P(t){if(mt=mt||Je(),!(this instanceof P))return new P(t);var e=this instanceof mt;this._readableState=new Ns(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Dt.call(this)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});P.prototype.destroy=qi.destroy;P.prototype._undestroy=qi.undestroy;P.prototype._destroy=function(t,e){e(t)};P.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=xr.from(t,e),e=""),i=!0),Ds(this,t,e,!1,i)};P.prototype.unshift=function(t){return Ds(this,t,null,!0,!1)};function Ds(t,e,r,i,n){x("readableAddChunk",e);var s=t._readableState;if(e===null)s.reading=!1,fc(t,s);else{var o;if(n||(o=lc(s,e)),o)Nt(t,o);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==xr.prototype&&(e=Jf(e)),i)s.endEmitted?Nt(t,new oc):ki(t,s,e,!0);else if(s.ended)Nt(t,new nc);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?ki(t,s,e,!1):Mi(t,s)):ki(t,s,e,!1)}else i||(s.reading=!1,Mi(t,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function ki(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Cr(t)),Mi(t,e)}function lc(t,e){var r;return!Zf(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new ic("chunk",["string","Buffer","Uint8Array"],e)),r}P.prototype.isPaused=function(){return this._readableState.flowing===!1};P.prototype.setEncoding=function(t){vt||(vt=Pi().StringDecoder);var e=new vt(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var Ls=1073741824;function uc(t){return t>=Ls?t=Ls:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Ms(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=uc(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}P.prototype.read=function(t){x("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return x("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Li(this):Cr(this),null;if(t=Ms(t,e),t===0&&e.ended)return e.length===0&&Li(this),null;var i=e.needReadable;x("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,x("length less than watermark",i)),e.ended||e.reading?(i=!1,x("reading or ended",i)):i&&(x("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Ms(r,e)));var n;return t>0?n=Fs(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Li(this)),n!==null&&this.emit("data",n),n};function fc(t,e){if(x("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Cr(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Us(t)))}}function Cr(t){var e=t._readableState;x("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(x("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Us,t))}function Us(t){var e=t._readableState;x("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Ni(t)}function Mi(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(cc,t,e))}function cc(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(x("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}P.prototype._read=function(t){Nt(this,new sc("_read()"))};P.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,x("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,s=n?a:y;i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(v,b){x("onunpipe"),v===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,f())}function a(){x("onend"),t.end()}var u=hc(r);t.on("drain",u);var l=!1;function f(){x("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",c),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",h),l=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",h);function h(v){x("ondata");var b=t.write(v);x("dest.write",b),b===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&Ws(i.pipes,t)!==-1)&&!l&&(x("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function c(v){x("onerror",v),y(),t.removeListener("error",c),qs(t,"error")===0&&Nt(t,v)}ac(t,"error",c);function d(){t.removeListener("finish",m),y()}t.once("close",d);function m(){x("onfinish"),t.removeListener("close",d),y()}t.once("finish",m);function y(){x("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(x("pipe resume"),r.resume()),t};function hc(t){return function(){var r=t._readableState;x("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&qs(t,"data")&&(r.flowing=!0,Ni(t))}}P.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=Ws(e.pipes,t);return o===-1?this:(e.pipes.splice(o,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};P.prototype.on=function(t,e){var r=Dt.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,x("on readable",i.length,i.reading),i.length?Cr(this):i.reading||process.nextTick(dc,this)),r};P.prototype.addListener=P.prototype.on;P.prototype.removeListener=function(t,e){var r=Dt.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(js,this),r};P.prototype.removeAllListeners=function(t){var e=Dt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(js,this),e};function js(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function dc(t){x("readable nexttick read 0"),t.read(0)}P.prototype.resume=function(){var t=this._readableState;return t.flowing||(x("resume"),t.flowing=!t.readableListening,pc(this,t)),t.paused=!1,this};function pc(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(gc,t,e))}function gc(t,e){x("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Ni(t),e.flowing&&!e.reading&&t.read(0)}P.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ni(t){var e=t._readableState;for(x("flow",e.flowing);e.flowing&&t.read()!==null;);}P.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(x("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&e.push(o)}e.push(null)}),t.on("data",function(o){if(x("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var a=e.push(o);a||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=(function(a){return function(){return t[a].apply(t,arguments)}})(n));for(var s=0;s<Bi.length;s++)t.on(Bi[s],this.emit.bind(this,Bi[s]));return this._read=function(o){x("wrapped _read",o),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(P.prototype[Symbol.asyncIterator]=function(){return Ri===void 0&&(Ri=Is()),Ri(this)});Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});P._fromList=Fs;Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Fs(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Li(t){var e=t._readableState;x("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(yc,e,t))}function yc(t,e){if(x("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(P.from=function(t,e){return Ai===void 0&&(Ai=ks()),Ai(P,t,e)});function Ws(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var Di=g((dy,Ks)=>{"use strict";Ks.exports=Se;var Pr=Be().codes,_c=Pr.ERR_METHOD_NOT_IMPLEMENTED,mc=Pr.ERR_MULTIPLE_CALLBACK,vc=Pr.ERR_TRANSFORM_ALREADY_TRANSFORMING,bc=Pr.ERR_TRANSFORM_WITH_LENGTH_0,Or=Je();we()(Se,Or);function wc(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new mc);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Se(t){if(!(this instanceof Se))return new Se(t);Or.call(this,t),this._transformState={afterTransform:wc.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Sc)}function Sc(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){Hs(t,e,r)}):Hs(this,null,null)}Se.prototype.push=function(t,e){return this._transformState.needTransform=!1,Or.prototype.push.call(this,t,e)};Se.prototype._transform=function(t,e,r){r(new _c("_transform()"))};Se.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Se.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Se.prototype._destroy=function(t,e){Or.prototype._destroy.call(this,t,function(r){e(r)})};function Hs(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new bc;if(t._transformState.transforming)throw new vc;return t.push(null)}});var Gs=g((py,$s)=>{"use strict";$s.exports=Ut;var zs=Di();we()(Ut,zs);function Ut(t){if(!(this instanceof Ut))return new Ut(t);zs.call(this,t)}Ut.prototype._transform=function(t,e,r){r(null,t)}});var Zs=g((gy,Js)=>{"use strict";var Ui;function Ec(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Xs=Be().codes,xc=Xs.ERR_MISSING_ARGS,Tc=Xs.ERR_STREAM_DESTROYED;function Qs(t){if(t)throw t}function Cc(t){return t.setHeader&&typeof t.abort=="function"}function Pc(t,e,r,i){i=Ec(i);var n=!1;t.on("close",function(){n=!0}),Ui===void 0&&(Ui=wr()),Ui(t,{readable:e,writable:r},function(o){if(o)return i(o);n=!0,i()});var s=!1;return function(o){if(!n&&!s){if(s=!0,Cc(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(o||new Tc("pipe"))}}}function Ys(t){t()}function Oc(t,e){return t.pipe(e)}function Ic(t){return!t.length||typeof t[t.length-1]!="function"?Qs:t.pop()}function Rc(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=Ic(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new xc("streams");var n,s=e.map(function(o,a){var u=a<e.length-1,l=a>0;return Pc(o,u,l,function(f){n||(n=f),f&&s.forEach(Ys),!u&&(s.forEach(Ys),i(n))})});return e.reduce(Oc)}Js.exports=Rc});var Ne=g((se,Ft)=>{"use strict";var jt=require("stream");process.env.READABLE_STREAM==="disable"&&jt?(Ft.exports=jt.Readable,Object.assign(Ft.exports,jt),Ft.exports.Stream=jt):(se=Ft.exports=Ei(),se.Stream=jt||se,se.Readable=se,se.Writable=bi(),se.Duplex=Je(),se.Transform=Di(),se.PassThrough=Gs(),se.finished=wr(),se.pipeline=Zs())});var Ir=g((yy,eo)=>{"use strict";var Ac=dr(),Bc=Ne().Readable,kc={objectMode:!0},Lc={clean:!0};function De(t){if(!(this instanceof De))return new De(t);this.options=t||{},this.options=Ac(Lc,t),this._inflights=new Map}De.prototype.put=function(t,e){return this._inflights.set(t.messageId,t),e&&e(),this};De.prototype.createStream=function(){let t=new Bc(kc),e=[],r=!1,i=0;return this._inflights.forEach(function(n,s){e.push(n)}),t._read=function(){!r&&i<e.length?this.push(e[i++]):this.push(null)},t.destroy=function(){if(r)return;let n=this;r=!0,setTimeout(function(){n.emit("close")},0)},t};De.prototype.del=function(t,e){return t=this._inflights.get(t.messageId),t?(this._inflights.delete(t.messageId),e(null,t)):e&&e(new Error("missing packet")),this};De.prototype.get=function(t,e){return t=this._inflights.get(t.messageId),t?e(null,t):e&&e(new Error("missing packet")),this};De.prototype.close=function(t){this.options.clean&&(this._inflights=null),t&&t()};eo.exports=De});var ro=g((_y,to)=>{"use strict";function bt(t){if(!(this instanceof bt))return new bt(t);this.aliasToTopic={},this.max=t}bt.prototype.put=function(t,e){return e===0||e>this.max?!1:(this.aliasToTopic[e]=t,this.length=Object.keys(this.aliasToTopic).length,!0)};bt.prototype.getTopicByAlias=function(t){return this.aliasToTopic[t]};bt.prototype.clear=function(){this.aliasToTopic={}};to.exports=bt});var no=g((my,io)=>{"use strict";io.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var oo=g((vy,so)=>{"use strict";so.exports=O;O.Node=it;O.create=O;function O(t){var e=this;if(e instanceof O||(e=new O),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}O.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};O.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};O.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};O.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)qc(this,arguments[t]);return this.length};O.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Nc(this,arguments[t]);return this.length};O.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};O.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};O.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,i=0;r!==null;i++)t.call(e,r.value,i,this),r=r.next};O.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,i=this.length-1;r!==null;i--)t.call(e,r.value,i,this),r=r.prev};O.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};O.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};O.prototype.map=function(t,e){e=e||this;for(var r=new O,i=this.head;i!==null;)r.push(t.call(e,i.value,this)),i=i.next;return r};O.prototype.mapReverse=function(t,e){e=e||this;for(var r=new O,i=this.tail;i!==null;)r.push(t.call(e,i.value,this)),i=i.prev;return r};O.prototype.reduce=function(t,e){var r,i=this.head;if(arguments.length>1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)r=t(r,i.value,n),i=i.next;return r};O.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)r=t(r,i.value,n),i=i.prev;return r};O.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};O.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};O.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new O;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&i<t;i++)n=n.next;for(;n!==null&&i<e;i++,n=n.next)r.push(n.value);return r};O.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new O;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>t;i--,n=n.prev)r.push(n.value);return r};O.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,n=this.head;n!==null&&i<t;i++)n=n.next;for(var s=[],i=0;n&&i<e;i++)s.push(n.value),n=this.removeNode(n);n===null&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(var i=0;i<r.length;i++)n=Mc(this,n,r[i]);return s};O.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=e,this.tail=t,this};function Mc(t,e,r){var i=e===t.head?new it(r,null,e,t):new it(r,e,e.next,t);return i.next===null&&(t.tail=i),i.prev===null&&(t.head=i),t.length++,i}function qc(t,e){t.tail=new it(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function Nc(t,e){t.head=new it(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function it(t,e,r,i){if(!(this instanceof it))return new it(t,e,r,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{no()(O)}catch{}});var co=g((by,fo)=>{"use strict";var Dc=oo(),nt=Symbol("max"),xe=Symbol("length"),wt=Symbol("lengthCalculator"),Vt=Symbol("allowStale"),st=Symbol("maxAge"),Ee=Symbol("dispose"),ao=Symbol("noDisposeOnSet"),W=Symbol("lruList"),ue=Symbol("cache"),uo=Symbol("updateAgeOnGet"),ji=()=>1,Wi=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[nt]=e.max||1/0,i=e.length||ji;if(this[wt]=typeof i!="function"?ji:i,this[Vt]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[st]=e.maxAge||0,this[Ee]=e.dispose,this[ao]=e.noDisposeOnSet||!1,this[uo]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[nt]=e||1/0,Wt(this)}get max(){return this[nt]}set allowStale(e){this[Vt]=!!e}get allowStale(){return this[Vt]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[st]=e,Wt(this)}get maxAge(){return this[st]}set lengthCalculator(e){typeof e!="function"&&(e=ji),e!==this[wt]&&(this[wt]=e,this[xe]=0,this[W].forEach(r=>{r.length=this[wt](r.value,r.key),this[xe]+=r.length})),Wt(this)}get lengthCalculator(){return this[wt]}get length(){return this[xe]}get itemCount(){return this[W].length}rforEach(e,r){r=r||this;for(let i=this[W].tail;i!==null;){let n=i.prev;lo(this,e,i,r),i=n}}forEach(e,r){r=r||this;for(let i=this[W].head;i!==null;){let n=i.next;lo(this,e,i,r),i=n}}keys(){return this[W].toArray().map(e=>e.key)}values(){return this[W].toArray().map(e=>e.value)}reset(){this[Ee]&&this[W]&&this[W].length&&this[W].forEach(e=>this[Ee](e.key,e.value)),this[ue]=new Map,this[W]=new Dc,this[xe]=0}dump(){return this[W].map(e=>Rr(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[W]}set(e,r,i){if(i=i||this[st],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,s=this[wt](r,e);if(this[ue].has(e)){if(s>this[nt])return St(this,this[ue].get(e)),!1;let u=this[ue].get(e).value;return this[Ee]&&(this[ao]||this[Ee](e,u.value)),u.now=n,u.maxAge=i,u.value=r,this[xe]+=s-u.length,u.length=s,this.get(e),Wt(this),!0}let o=new Vi(e,r,s,n,i);return o.length>this[nt]?(this[Ee]&&this[Ee](e,r),!1):(this[xe]+=o.length,this[W].unshift(o),this[ue].set(e,this[W].head),Wt(this),!0)}has(e){if(!this[ue].has(e))return!1;let r=this[ue].get(e).value;return!Rr(this,r)}get(e){return Fi(this,e,!0)}peek(e){return Fi(this,e,!1)}pop(){let e=this[W].tail;return e?(St(this,e),e.value):null}del(e){St(this,this[ue].get(e))}load(e){this.reset();let r=Date.now();for(let i=e.length-1;i>=0;i--){let n=e[i],s=n.e||0;if(s===0)this.set(n.k,n.v);else{let o=s-r;o>0&&this.set(n.k,n.v,o)}}}prune(){this[ue].forEach((e,r)=>Fi(this,r,!1))}},Fi=(t,e,r)=>{let i=t[ue].get(e);if(i){let n=i.value;if(Rr(t,n)){if(St(t,i),!t[Vt])return}else r&&(t[uo]&&(i.value.now=Date.now()),t[W].unshiftNode(i));return n.value}},Rr=(t,e)=>{if(!e||!e.maxAge&&!t[st])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[st]&&r>t[st]},Wt=t=>{if(t[xe]>t[nt])for(let e=t[W].tail;t[xe]>t[nt]&&e!==null;){let r=e.prev;St(t,e),e=r}},St=(t,e)=>{if(e){let r=e.value;t[Ee]&&t[Ee](r.key,r.value),t[xe]-=r.length,t[ue].delete(r.key),t[W].removeNode(e)}},Vi=class{constructor(e,r,i,n,s){this.key=e,this.value=r,this.length=i,this.now=n,this.maxAge=s||0}},lo=(t,e,r,i)=>{let n=r.value;Rr(t,n)&&(St(t,r),t[Vt]||(n=void 0)),n&&e.call(i,n.value,n.key,t)};fo.exports=Wi});var Uc,A,Te,Et,Y=U(()=>{"use strict";Uc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),A=(function(){function t(e){e===void 0&&(e=t.NORMAL),this.iteratorType=e}return t.NORMAL=!1,t.REVERSE=!0,t})(),Te=(function(){function t(){this.length=0}return t.prototype.size=function(){return this.length},t.prototype.empty=function(){return this.length===0},t})(),Et=(function(t){Uc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Te)});var jc,Fc,ho,po=U(()=>{"use strict";Y();jc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Fc=(function(t){jc(e,t);function e(r){r===void 0&&(r=[]);var i=t.call(this)||this;return i.stack=[],r.forEach(function(n){return i.push(n)}),i}return e.prototype.clear=function(){this.length=0,this.stack.length=0},e.prototype.push=function(r){this.stack.push(r),this.length+=1},e.prototype.pop=function(){this.stack.pop(),this.length>0&&(this.length-=1)},e.prototype.top=function(){return this.stack[this.length-1]},e})(Te),ho=Fc});var Wc,Vc,Ue,Ht=U(()=>{"use strict";Y();Wc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Vc=(function(t){Wc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Et),Ue=Vc});function B(t,e,r){if(t<e||t>r)throw new RangeError}var je=U(()=>{"use strict"});var Hc,Ar,Hi=U(()=>{"use strict";je();Y();Hc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Ar=(function(t){Hc(e,t);function e(r,i,n,s,o){var a=t.call(this,o)||this;return a.node=r,a.size=i,a.getElementByPos=n,a.setElementByPos=s,a.iteratorType===A.NORMAL?(a.pre=function(){if(this.node===0)throw new RangeError("Deque iterator access denied!");return this.node-=1,this},a.next=function(){if(this.node===this.size())throw new RangeError("Deque Iterator access denied!");return this.node+=1,this}):(a.pre=function(){if(this.node===this.size()-1)throw new RangeError("Deque iterator access denied!");return this.node+=1,this},a.next=function(){if(this.node===-1)throw new RangeError("Deque iterator access denied!");return this.node-=1,this}),a}return Object.defineProperty(e.prototype,"pointer",{get:function(){return B(this.node,0,this.size()-1),this.getElementByPos(this.node)},set:function(r){B(this.node,0,this.size()-1),this.setElementByPos(this.node,r)},enumerable:!1,configurable:!0}),e.prototype.equals=function(r){return this.node===r.node},e})(A)});var go,Kc,zc,$c,ot,Gc,Br,Ki=U(()=>{"use strict";Ht();je();Y();Hi();go=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Kc=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},zc=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},$c=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},ot=(function(t){go(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.copy=function(){return new e(this.node,this.size,this.getElementByPos,this.setElementByPos,this.iteratorType)},e})(Ar),Gc=(function(t){go(e,t);function e(r,i){r===void 0&&(r=[]),i===void 0&&(i=4096);var n=t.call(this)||this;n.first=0,n.curFirst=0,n.last=0,n.curLast=0,n.bucketNum=0,n.map=[];var s;if("size"in r)typeof r.size=="number"?s=r.size:s=r.size();else if("length"in r)s=r.length;else throw new RangeError("Can't get container's size!");n.bucketSize=i,n.bucketNum=Math.max(Math.ceil(s/n.bucketSize),1);for(var o=0;o<n.bucketNum;++o)n.map.push(new Array(n.bucketSize));var a=Math.ceil(s/n.bucketSize);return n.first=n.last=(n.bucketNum>>1)-(a>>1),n.curFirst=n.curLast=n.bucketSize-s%n.bucketSize>>1,r.forEach(function(u){return n.pushBack(u)}),n.size=n.size.bind(n),n.getElementByPos=n.getElementByPos.bind(n),n.setElementByPos=n.setElementByPos.bind(n),n}return e.prototype.reAllocate=function(){for(var r=[],i=Math.max(this.bucketNum>>1,1),n=0;n<i;++n)r[n]=new Array(this.bucketSize);for(var n=this.first;n<this.bucketNum;++n)r[r.length]=this.map[n];for(var n=0;n<this.last;++n)r[r.length]=this.map[n];r[r.length]=$c([],zc(this.map[this.last]),!1),this.first=i,this.last=r.length-1;for(var n=0;n<i;++n)r[r.length]=new Array(this.bucketSize);this.map=r,this.bucketNum=r.length},e.prototype.getElementIndex=function(r){var i=this.curFirst+r+1,n=i%this.bucketSize,s=n-1,o=this.first+(i-n)/this.bucketSize;return n===0&&(o-=1),o%=this.bucketNum,s<0&&(s+=this.bucketSize),{curNodeBucketIndex:o,curNodePointerIndex:s}},e.prototype.clear=function(){this.map=[[]],this.bucketNum=1,this.first=this.last=this.length=0,this.curFirst=this.curLast=this.bucketSize>>1},e.prototype.front=function(){return this.map[this.first][this.curFirst]},e.prototype.back=function(){return this.map[this.last][this.curLast]},e.prototype.begin=function(){return new ot(0,this.size,this.getElementByPos,this.setElementByPos)},e.prototype.end=function(){return new ot(this.length,this.size,this.getElementByPos,this.setElementByPos)},e.prototype.rBegin=function(){return new ot(this.length-1,this.size,this.getElementByPos,this.setElementByPos,A.REVERSE)},e.prototype.rEnd=function(){return new ot(-1,this.size,this.getElementByPos,this.setElementByPos,A.REVERSE)},e.prototype.pushBack=function(r){this.length&&(this.curLast<this.bucketSize-1?this.curLast+=1:this.last<this.bucketNum-1?(this.last+=1,this.curLast=0):(this.last=0,this.curLast=0),this.last===this.first&&this.curLast===this.curFirst&&this.reAllocate()),this.length+=1,this.map[this.last][this.curLast]=r},e.prototype.popBack=function(){this.length&&(this.map[this.last][this.curLast]=void 0,this.length!==1&&(this.curLast>0?this.curLast-=1:this.last>0?(this.last-=1,this.curLast=this.bucketSize-1):(this.last=this.bucketNum-1,this.curLast=this.bucketSize-1)),this.length-=1)},e.prototype.pushFront=function(r){this.length&&(this.curFirst>0?this.curFirst-=1:this.first>0?(this.first-=1,this.curFirst=this.bucketSize-1):(this.first=this.bucketNum-1,this.curFirst=this.bucketSize-1),this.first===this.last&&this.curFirst===this.curLast&&this.reAllocate()),this.length+=1,this.map[this.first][this.curFirst]=r},e.prototype.popFront=function(){this.length&&(this.map[this.first][this.curFirst]=void 0,this.length!==1&&(this.curFirst<this.bucketSize-1?this.curFirst+=1:this.first<this.bucketNum-1?(this.first+=1,this.curFirst=0):(this.first=0,this.curFirst=0)),this.length-=1)},e.prototype.forEach=function(r){for(var i=0;i<this.length;++i)r(this.getElementByPos(i),i)},e.prototype.getElementByPos=function(r){B(r,0,this.length-1);var i=this.getElementIndex(r),n=i.curNodeBucketIndex,s=i.curNodePointerIndex;return this.map[n][s]},e.prototype.setElementByPos=function(r,i){B(r,0,this.length-1);var n=this.getElementIndex(r),s=n.curNodeBucketIndex,o=n.curNodePointerIndex;this.map[s][o]=i},e.prototype.insert=function(r,i,n){if(n===void 0&&(n=1),B(r,0,this.length),r===0)for(;n--;)this.pushFront(i);else if(r===this.length)for(;n--;)this.pushBack(i);else{for(var s=[],o=r;o<this.length;++o)s.push(this.getElementByPos(o));this.cut(r-1);for(var o=0;o<n;++o)this.pushBack(i);for(var o=0;o<s.length;++o)this.pushBack(s[o])}},e.prototype.cut=function(r){if(r<0){this.clear();return}var i=this.getElementIndex(r),n=i.curNodeBucketIndex,s=i.curNodePointerIndex;this.last=n,this.curLast=s,this.length=r+1},e.prototype.eraseElementByPos=function(r){var i=this;if(B(r,0,this.length-1),r===0)this.popFront();else if(r===this.length-1)this.popBack();else{for(var n=[],s=r+1;s<this.length;++s)n.push(this.getElementByPos(s));this.cut(r),this.popBack(),n.forEach(function(o){return i.pushBack(o)})}},e.prototype.eraseElementByValue=function(r){if(this.length){for(var i=[],n=0;n<this.length;++n){var s=this.getElementByPos(n);s!==r&&i.push(s)}for(var o=i.length,n=0;n<o;++n)this.setElementByPos(n,i[n]);this.cut(o-1)}},e.prototype.eraseElementByIterator=function(r){var i=r.node;return this.eraseElementByPos(i),r=r.next(),r},e.prototype.find=function(r){for(var i=0;i<this.length;++i)if(this.getElementByPos(i)===r)return new ot(i,this.size,this.getElementByPos,this.setElementByPos);return this.end()},e.prototype.reverse=function(){for(var r=0,i=this.length-1;r<i;){var n=this.getElementByPos(r);this.setElementByPos(r,this.getElementByPos(i)),this.setElementByPos(i,n),r+=1,i-=1}},e.prototype.unique=function(){if(!(this.length<=1)){for(var r=1,i=this.getElementByPos(0),n=1;n<this.length;++n){var s=this.getElementByPos(n);s!==i&&(i=s,this.setElementByPos(r++,s))}for(;this.length>r;)this.popBack()}},e.prototype.sort=function(r){for(var i=[],n=0;n<this.length;++n)i.push(this.getElementByPos(n));i.sort(r);for(var n=0;n<this.length;++n)this.setElementByPos(n,i[n])},e.prototype.shrinkToFit=function(){if(this.length){var r=[];this.forEach(function(n){return r.push(n)}),this.bucketNum=Math.max(Math.ceil(this.length/this.bucketSize),1),this.length=this.first=this.last=this.curFirst=this.curLast=0,this.map=[];for(var i=0;i<this.bucketNum;++i)this.map.push(new Array(this.bucketSize));for(var i=0;i<r.length;++i)this.pushBack(r[i])}},e.prototype[Symbol.iterator]=function(){return function(){var r;return Kc(this,function(i){switch(i.label){case 0:r=0,i.label=1;case 1:return r<this.length?[4,this.getElementByPos(r)]:[3,4];case 2:i.sent(),i.label=3;case 3:return++r,[3,1];case 4:return[2]}})}.bind(this)()},e})(Ue),Br=Gc});var Qc,Yc,yo,_o=U(()=>{"use strict";Ki();Y();Qc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Yc=(function(t){Qc(e,t);function e(r){r===void 0&&(r=[]);var i=t.call(this)||this;return i.queue=new Br(r),i.length=i.queue.size(),i}return e.prototype.clear=function(){this.queue.clear(),this.length=0},e.prototype.push=function(r){this.queue.pushBack(r),this.length+=1},e.prototype.pop=function(){this.queue.popFront(),this.length&&(this.length-=1)},e.prototype.front=function(){return this.queue.front()},e})(Te),yo=Yc});var Xc,kr,Jc,Zc,mo,vo=U(()=>{"use strict";Y();Xc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),kr=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},Jc=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},Zc=(function(t){Xc(e,t);function e(r,i,n){var s;r===void 0&&(r=[]),i===void 0&&(i=function(d,m){return d>m?-1:d<m?1:0}),n===void 0&&(n=!0);var o=t.call(this)||this;o.cmp=i,Array.isArray(r)?o.priorityQueue=n?Jc([],kr(r),!1):r:(o.priorityQueue=[],r.forEach(function(d){return o.priorityQueue.push(d)})),o.length=o.priorityQueue.length;for(var a=o.length-1>>1;a>=0;--a)for(var u=a,l=u<<1|1;l<o.length;){var f=l,h=f+1,c=f;if(h<o.length&&o.cmp(o.priorityQueue[f],o.priorityQueue[h])>0&&(c=h),o.cmp(o.priorityQueue[u],o.priorityQueue[c])<=0)break;s=kr([o.priorityQueue[c],o.priorityQueue[u]],2),o.priorityQueue[u]=s[0],o.priorityQueue[c]=s[1],u=c,l=u<<1|1}return o}return e.prototype.adjust=function(r){var i,n,s=r<<1|1,o=(r<<1)+2;s<this.length&&this.cmp(this.priorityQueue[r],this.priorityQueue[s])>0&&(i=kr([this.priorityQueue[s],this.priorityQueue[r]],2),this.priorityQueue[r]=i[0],this.priorityQueue[s]=i[1]),o<this.length&&this.cmp(this.priorityQueue[r],this.priorityQueue[o])>0&&(n=kr([this.priorityQueue[o],this.priorityQueue[r]],2),this.priorityQueue[r]=n[0],this.priorityQueue[o]=n[1])},e.prototype.clear=function(){this.length=0,this.priorityQueue.length=0},e.prototype.push=function(r){if(this.priorityQueue.push(r),this.length+=1,this.length!==1)for(var i=this.length-1;i>0;){var n=i-1>>1;if(this.cmp(this.priorityQueue[n],r)<=0)break;this.adjust(n),i=n}},e.prototype.pop=function(){if(this.length){var r=this.priorityQueue[this.length-1];this.length-=1;for(var i=0;i<this.length;){var n=i<<1|1,s=(i<<1)+2;if(n>=this.length)break;var o=n;if(s<this.length&&this.cmp(this.priorityQueue[n],this.priorityQueue[s])>0&&(o=s),this.cmp(this.priorityQueue[o],r)>=0)break;this.priorityQueue[i]=this.priorityQueue[o],i=o}this.priorityQueue[i]=r,this.priorityQueue.pop()}},e.prototype.top=function(){return this.priorityQueue[0]},e})(Te),mo=Zc});var So,eh,bo,wo,th,at,rh,M,Lr=U(()=>{"use strict";Ht();je();Y();Hi();So=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),eh=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},bo=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},wo=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},th=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},at=(function(t){So(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.copy=function(){return new e(this.node,this.size,this.getElementByPos,this.setElementByPos,this.iteratorType)},e})(Ar),rh=(function(t){So(e,t);function e(r,i){r===void 0&&(r=[]),i===void 0&&(i=!0);var n=t.call(this)||this;return Array.isArray(r)?(n.vector=i?wo([],bo(r),!1):r,n.length=r.length):(n.vector=[],r.forEach(function(s){return n.pushBack(s)})),n.size=n.size.bind(n),n.getElementByPos=n.getElementByPos.bind(n),n.setElementByPos=n.setElementByPos.bind(n),n}return e.prototype.clear=function(){this.length=0,this.vector.length=0},e.prototype.begin=function(){return new at(0,this.size,this.getElementByPos,this.setElementByPos)},e.prototype.end=function(){return new at(this.length,this.size,this.getElementByPos,this.setElementByPos)},e.prototype.rBegin=function(){return new at(this.length-1,this.size,this.getElementByPos,this.setElementByPos,A.REVERSE)},e.prototype.rEnd=function(){return new at(-1,this.size,this.getElementByPos,this.setElementByPos,A.REVERSE)},e.prototype.front=function(){return this.vector[0]},e.prototype.back=function(){return this.vector[this.length-1]},e.prototype.forEach=function(r){for(var i=0;i<this.length;++i)r(this.vector[i],i)},e.prototype.getElementByPos=function(r){return B(r,0,this.length-1),this.vector[r]},e.prototype.eraseElementByPos=function(r){B(r,0,this.length-1),this.vector.splice(r,1),this.length-=1},e.prototype.eraseElementByValue=function(r){for(var i=0,n=0;n<this.length;++n)this.vector[n]!==r&&(this.vector[i++]=this.vector[n]);this.length=this.vector.length=i},e.prototype.eraseElementByIterator=function(r){var i=r.node;return r=r.next(),this.eraseElementByPos(i),r},e.prototype.pushBack=function(r){this.vector.push(r),this.length+=1},e.prototype.popBack=function(){this.length&&(this.vector.pop(),this.length-=1)},e.prototype.setElementByPos=function(r,i){B(r,0,this.length-1),this.vector[r]=i},e.prototype.insert=function(r,i,n){var s;n===void 0&&(n=1),B(r,0,this.length),(s=this.vector).splice.apply(s,wo([r,0],bo(new Array(n).fill(i)),!1)),this.length+=n},e.prototype.find=function(r){for(var i=0;i<this.length;++i)if(this.vector[i]===r)return new at(i,this.size,this.getElementByPos,this.getElementByPos);return this.end()},e.prototype.reverse=function(){this.vector.reverse()},e.prototype.unique=function(){for(var r=1,i=1;i<this.length;++i)this.vector[i]!==this.vector[i-1]&&(this.vector[r++]=this.vector[i]);this.length=this.vector.length=r},e.prototype.sort=function(r){this.vector.sort(r)},e.prototype[Symbol.iterator]=function(){return function(){return eh(this,function(r){switch(r.label){case 0:return[5,th(this.vector)];case 1:return[2,r.sent()]}})}.bind(this)()},e})(Ue),M=rh});var Eo,ih,Kt,lt,nh,xo,To=U(()=>{"use strict";Ht();je();Y();Eo=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),ih=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Kt=(function(){function t(e){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=e}return t})(),lt=(function(t){Eo(e,t);function e(r,i,n){var s=t.call(this,n)||this;return s.node=r,s.header=i,s.iteratorType===A.NORMAL?(s.pre=function(){if(this.node.pre===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre,this},s.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next,this}):(s.pre=function(){if(this.node.next===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next,this},s.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre,this}),s}return Object.defineProperty(e.prototype,"pointer",{get:function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node.value},set:function(r){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");this.node.value=r},enumerable:!1,configurable:!0}),e.prototype.equals=function(r){return this.node===r.node},e.prototype.copy=function(){return new e(this.node,this.header,this.iteratorType)},e})(A),nh=(function(t){Eo(e,t);function e(r){r===void 0&&(r=[]);var i=t.call(this)||this;return i.header=new Kt,i.head=void 0,i.tail=void 0,r.forEach(function(n){return i.pushBack(n)}),i}return e.prototype.clear=function(){this.length=0,this.head=this.tail=void 0,this.header.pre=this.header.next=void 0},e.prototype.begin=function(){return new lt(this.head||this.header,this.header)},e.prototype.end=function(){return new lt(this.header,this.header)},e.prototype.rBegin=function(){return new lt(this.tail||this.header,this.header,A.REVERSE)},e.prototype.rEnd=function(){return new lt(this.header,this.header,A.REVERSE)},e.prototype.front=function(){return this.head?this.head.value:void 0},e.prototype.back=function(){return this.tail?this.tail.value:void 0},e.prototype.forEach=function(r){if(this.length)for(var i=this.head,n=0;i!==this.header;)r(i.value,n++),i=i.next},e.prototype.getElementByPos=function(r){B(r,0,this.length-1);for(var i=this.head;r--;)i=i.next;return i.value},e.prototype.eraseElementByPos=function(r){if(B(r,0,this.length-1),r===0)this.popFront();else if(r===this.length-1)this.popBack();else{for(var i=this.head;r--;)i=i.next;i=i;var n=i.pre,s=i.next;s.pre=n,n.next=s,this.length-=1}},e.prototype.eraseElementByValue=function(r){for(;this.head&&this.head.value===r;)this.popFront();for(;this.tail&&this.tail.value===r;)this.popBack();if(this.head)for(var i=this.head;i!==this.header;){if(i.value===r){var n=i.pre,s=i.next;s&&(s.pre=n),n&&(n.next=s),this.length-=1}i=i.next}},e.prototype.eraseElementByIterator=function(r){var i=r.node;if(i===this.header)throw new RangeError("Invalid iterator");if(r=r.next(),this.head===i)this.popFront();else if(this.tail===i)this.popBack();else{var n=i.pre,s=i.next;s&&(s.pre=n),n&&(n.next=s),this.length-=1}return r},e.prototype.pushBack=function(r){this.length+=1;var i=new Kt(r);this.tail?(this.tail.next=i,i.pre=this.tail,this.tail=i):(this.head=this.tail=i,this.header.next=this.head,this.head.pre=this.header),this.tail.next=this.header,this.header.pre=this.tail},e.prototype.popBack=function(){this.tail&&(this.length-=1,this.head===this.tail?(this.head=this.tail=void 0,this.header.next=void 0):(this.tail=this.tail.pre,this.tail&&(this.tail.next=void 0)),this.header.pre=this.tail,this.tail&&(this.tail.next=this.header))},e.prototype.setElementByPos=function(r,i){B(r,0,this.length-1);for(var n=this.head;r--;)n=n.next;n.value=i},e.prototype.insert=function(r,i,n){if(n===void 0&&(n=1),B(r,0,this.length),!(n<=0))if(r===0)for(;n--;)this.pushFront(i);else if(r===this.length)for(;n--;)this.pushBack(i);else{for(var s=this.head,o=1;o<r;++o)s=s.next;var a=s.next;for(this.length+=n;n--;)s.next=new Kt(i),s.next.pre=s,s=s.next;s.next=a,a&&(a.pre=s)}},e.prototype.find=function(r){if(!this.head)return this.end();for(var i=this.head;i!==this.header;){if(i.value===r)return new lt(i,this.header);i=i.next}return this.end()},e.prototype.reverse=function(){if(!(this.length<=1))for(var r=this.head,i=this.tail,n=0;n<<1<this.length;){var s=r.value;r.value=i.value,i.value=s,r=r.next,i=i.pre,n+=1}},e.prototype.unique=function(){if(!(this.length<=1))for(var r=this.head;r!==this.header;){for(var i=r;i.next&&i.value===i.next.value;)i=i.next,this.length-=1;r.next=i.next,r.next&&(r.next.pre=r),r=r.next}},e.prototype.sort=function(r){if(!(this.length<=1)){var i=[];this.forEach(function(s){return i.push(s)}),i.sort(r);var n=this.head;i.forEach(function(s){n.value=s,n=n.next})}},e.prototype.pushFront=function(r){this.length+=1;var i=new Kt(r);this.head?(i.next=this.head,this.head.pre=i,this.head=i):(this.head=this.tail=i,this.tail.next=this.header,this.header.pre=this.tail),this.header.next=this.head,this.head.pre=this.header},e.prototype.popFront=function(){this.head&&(this.length-=1,this.head===this.tail?(this.head=this.tail=void 0,this.header.pre=this.tail):(this.head=this.head.next,this.head&&(this.head.pre=this.header)),this.header.next=this.head)},e.prototype.merge=function(r){var i=this;if(!this.head){r.forEach(function(s){return i.pushBack(s)});return}var n=this.head;r.forEach(function(s){for(;n&&n!==i.header&&n.value<=s;)n=n.next;if(n===i.header)i.pushBack(s),n=i.tail;else if(n===i.head)i.pushFront(s),n=i.head;else{i.length+=1;var o=n.pre;o.next=new Kt(s),o.next.pre=o,o.next.next=n,n.pre=o.next}})},e.prototype[Symbol.iterator]=function(){return function(){var r;return ih(this,function(i){switch(i.label){case 0:if(!this.head)return[2];r=this.head,i.label=1;case 1:return r===this.header?[3,3]:[4,r.value];case 2:return i.sent(),r=r.next,[3,1];case 3:return[2]}})}.bind(this)()},e})(Ue),xo=nh});var sh,w,Co=U(()=>{"use strict";sh=(function(){function t(e,r){this.color=!0,this.key=void 0,this.value=void 0,this.left=void 0,this.right=void 0,this.parent=void 0,this.key=e,this.value=r}return t.prototype.pre=function(){var e=this;if(e.color===t.RED&&e.parent.parent===e)e=e.right;else if(e.left)for(e=e.left;e.right;)e=e.right;else{for(var r=e.parent;r.left===e;)e=r,r=e.parent;e=r}return e},t.prototype.next=function(){var e=this;if(e.right)for(e=e.right;e.left;)e=e.left;else{for(var r=e.parent;r.right===e;)e=r,r=e.parent;e.right!==r&&(e=r)}return e},t.prototype.rotateLeft=function(){var e=this.parent,r=this.right,i=r.left;return e.parent===this?e.parent=r:e.left===this?e.left=r:e.right=r,r.parent=e,r.left=this,this.parent=r,this.right=i,i&&(i.parent=this),r},t.prototype.rotateRight=function(){var e=this.parent,r=this.left,i=r.right;return e.parent===this?e.parent=r:e.left===this?e.left=r:e.right=r,r.parent=e,r.right=this,this.parent=r,this.left=i,i&&(i.parent=this),r},t.prototype.remove=function(){var e=this.parent;this===e.left?e.left=void 0:e.right=void 0},t.RED=!0,t.BLACK=!1,t})(),w=sh});var oh,Po,ah,xt,Mr=U(()=>{"use strict";Co();Y();je();oh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Po=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},ah=(function(t){oh(e,t);function e(r){r===void 0&&(r=function(n,s){return n<s?-1:n>s?1:0});var i=t.call(this)||this;return i.root=void 0,i.header=new w,i.inOrderTraversal=function(n,s){if(n===void 0)return!1;var o=i.inOrderTraversal(n.left,s);return o||s(n)?!0:i.inOrderTraversal(n.right,s)},i.cmp=r,i}return e.prototype._lowerBound=function(r,i){for(var n;r;){var s=this.cmp(r.key,i);if(s<0)r=r.right;else if(s>0)n=r,r=r.left;else return r}return n===void 0?this.header:n},e.prototype._upperBound=function(r,i){for(var n;r;){var s=this.cmp(r.key,i);s<=0?r=r.right:s>0&&(n=r,r=r.left)}return n===void 0?this.header:n},e.prototype._reverseLowerBound=function(r,i){for(var n;r;){var s=this.cmp(r.key,i);if(s<0)n=r,r=r.right;else if(s>0)r=r.left;else return r}return n===void 0?this.header:n},e.prototype._reverseUpperBound=function(r,i){for(var n;r;){var s=this.cmp(r.key,i);s<0?(n=r,r=r.right):s>=0&&(r=r.left)}return n===void 0?this.header:n},e.prototype.eraseNodeSelfBalance=function(r){for(;;){var i=r.parent;if(i===this.header)return;if(r.color===w.RED){r.color=w.BLACK;return}if(r===i.left){var n=i.right;if(n.color===w.RED)n.color=w.BLACK,i.color=w.RED,i===this.root?this.root=i.rotateLeft():i.rotateLeft();else if(n.color===w.BLACK)if(n.right&&n.right.color===w.RED){n.color=i.color,i.color=w.BLACK,n.right.color=w.BLACK,i===this.root?this.root=i.rotateLeft():i.rotateLeft();return}else n.left&&n.left.color===w.RED?(n.color=w.RED,n.left.color=w.BLACK,n.rotateRight()):(n.color=w.RED,r=i)}else{var n=i.left;if(n.color===w.RED)n.color=w.BLACK,i.color=w.RED,i===this.root?this.root=i.rotateRight():i.rotateRight();else if(n.left&&n.left.color===w.RED){n.color=i.color,i.color=w.BLACK,n.left.color=w.BLACK,i===this.root?this.root=i.rotateRight():i.rotateRight();return}else n.right&&n.right.color===w.RED?(n.color=w.RED,n.right.color=w.BLACK,n.rotateLeft()):(n.color=w.RED,r=i)}}},e.prototype.eraseNode=function(r){var i,n;if(this.length===1){this.clear();return}for(var s=r;s.left||s.right;){if(s.right)for(s=s.right;s.left;)s=s.left;else s.left&&(s=s.left);i=Po([s.key,r.key],2),r.key=i[0],s.key=i[1],n=Po([s.value,r.value],2),r.value=n[0],s.value=n[1],r=s}this.header.left===s?this.header.left=s.parent:this.header.right===s&&(this.header.right=s.parent),this.eraseNodeSelfBalance(s),s.remove(),this.length-=1,this.root.color=w.BLACK},e.prototype.insertNodeSelfBalance=function(r){for(;;){var i=r.parent;if(i.color===w.BLACK)return;var n=i.parent;if(i===n.left){var s=n.right;if(s&&s.color===w.RED){if(s.color=i.color=w.BLACK,n===this.root)return;n.color=w.RED,r=n;continue}else if(r===i.right){if(r.color=w.BLACK,r.left&&(r.left.parent=i),r.right&&(r.right.parent=n),i.right=r.left,n.left=r.right,r.left=i,r.right=n,n===this.root)this.root=r,this.header.parent=r;else{var o=n.parent;o.left===n?o.left=r:o.right=r}r.parent=n.parent,i.parent=r,n.parent=r}else i.color=w.BLACK,n===this.root?this.root=n.rotateRight():n.rotateRight();n.color=w.RED}else{var s=n.left;if(s&&s.color===w.RED){if(s.color=i.color=w.BLACK,n===this.root)return;n.color=w.RED,r=n;continue}else if(r===i.left){if(r.color=w.BLACK,r.left&&(r.left.parent=n),r.right&&(r.right.parent=i),n.right=r.left,i.left=r.right,r.left=n,r.right=i,n===this.root)this.root=r,this.header.parent=r;else{var o=n.parent;o.left===n?o.left=r:o.right=r}r.parent=n.parent,i.parent=r,n.parent=r}else i.color=w.BLACK,n===this.root?this.root=n.rotateLeft():n.rotateLeft();n.color=w.RED}return}},e.prototype.findElementNode=function(r,i){for(;r;){var n=this.cmp(r.key,i);if(n<0)r=r.right;else if(n>0)r=r.left;else return r}return r},e.prototype.set=function(r,i,n){if(this.root===void 0){this.length+=1,this.root=new w(r,i),this.root.color=w.BLACK,this.root.parent=this.header,this.header.parent=this.root,this.header.left=this.root,this.header.right=this.root;return}var s,o=this.header.left,a=this.cmp(o.key,r);if(a===0){o.value=i;return}else if(a>0)o.left=new w(r,i),o.left.parent=o,s=o.left,this.header.left=s;else{var u=this.header.right,l=this.cmp(u.key,r);if(l===0){u.value=i;return}else if(l<0)u.right=new w(r,i),u.right.parent=u,s=u.right,this.header.right=s;else{if(n!==void 0){var f=n.node;if(f!==this.header){var h=this.cmp(f.key,r);if(h===0){f.value=i;return}else if(h>0){var c=f.pre(),d=this.cmp(c.key,r);if(d===0){c.value=i;return}else d<0&&(s=new w(r,i),c.right===void 0?(c.right=s,s.parent=c):(f.left=s,s.parent=f))}}}if(s===void 0)for(s=this.root;;){var m=this.cmp(s.key,r);if(m>0){if(s.left===void 0){s.left=new w(r,i),s.left.parent=s,s=s.left;break}s=s.left}else if(m<0){if(s.right===void 0){s.right=new w(r,i),s.right.parent=s,s=s.right;break}s=s.right}else{s.value=i;return}}}}this.length+=1,this.insertNodeSelfBalance(s)},e.prototype.clear=function(){this.length=0,this.root=void 0,this.header.parent=void 0,this.header.left=this.header.right=void 0},e.prototype.updateKeyByIterator=function(r,i){var n=r.node;if(n===this.header)throw new TypeError("Invalid iterator!");if(this.length===1)return n.key=i,!0;if(n===this.header.left)return this.cmp(n.next().key,i)>0?(n.key=i,!0):!1;if(n===this.header.right)return this.cmp(n.pre().key,i)<0?(n.key=i,!0):!1;var s=n.pre().key;if(this.cmp(s,i)>=0)return!1;var o=n.next().key;return this.cmp(o,i)<=0?!1:(n.key=i,!0)},e.prototype.eraseElementByPos=function(r){var i=this;B(r,0,this.length-1);var n=0;this.inOrderTraversal(this.root,function(s){return r===n?(i.eraseNode(s),!0):(n+=1,!1)})},e.prototype.eraseElementByKey=function(r){if(this.length){var i=this.findElementNode(this.root,r);i!==void 0&&this.eraseNode(i)}},e.prototype.eraseElementByIterator=function(r){var i=r.node;if(i===this.header)throw new RangeError("Invalid iterator");return i.right===void 0&&(r=r.next()),this.eraseNode(i),r},e.prototype.getHeight=function(){if(!this.length)return 0;var r=function(i){return i?Math.max(r(i.left),r(i.right))+1:0};return r(this.root)},e})(Et),xt=ah});var lh,uh,qr,zi=U(()=>{"use strict";Y();lh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),uh=(function(t){lh(e,t);function e(r,i,n){var s=t.call(this,n)||this;return s.node=r,s.header=i,s.iteratorType===A.NORMAL?(s.pre=function(){if(this.node===this.header.left)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre(),this},s.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next(),this}):(s.pre=function(){if(this.node===this.header.right)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next(),this},s.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre(),this}),s}return e.prototype.equals=function(r){return this.node===r.node},e})(A),qr=uh});var Oo,fh,Nr,fe,ch,Ce,$i=U(()=>{"use strict";Mr();Y();je();zi();Oo=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),fh=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Nr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fe=(function(t){Oo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"pointer",{get:function(){if(this.node===this.header)throw new RangeError("OrderedSet iterator access denied!");return this.node.key},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.node,this.header,this.iteratorType)},e})(qr),ch=(function(t){Oo(e,t);function e(r,i){r===void 0&&(r=[]);var n=t.call(this,i)||this;return n.iterationFunc=function(s){return fh(this,function(o){switch(o.label){case 0:return s===void 0?[2]:[5,Nr(this.iterationFunc(s.left))];case 1:return o.sent(),[4,s.key];case 2:return o.sent(),[5,Nr(this.iterationFunc(s.right))];case 3:return o.sent(),[2]}})},r.forEach(function(s){return n.insert(s)}),n.iterationFunc=n.iterationFunc.bind(n),n}return e.prototype.begin=function(){return new fe(this.header.left||this.header,this.header)},e.prototype.end=function(){return new fe(this.header,this.header)},e.prototype.rBegin=function(){return new fe(this.header.right||this.header,this.header,A.REVERSE)},e.prototype.rEnd=function(){return new fe(this.header,this.header,A.REVERSE)},e.prototype.front=function(){return this.header.left?this.header.left.key:void 0},e.prototype.back=function(){return this.header.right?this.header.right.key:void 0},e.prototype.forEach=function(r){var i,n,s=0;try{for(var o=Nr(this),a=o.next();!a.done;a=o.next()){var u=a.value;r(u,s++)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}},e.prototype.getElementByPos=function(r){var i,n;B(r,0,this.length-1);var s,o=0;try{for(var a=Nr(this),u=a.next();!u.done;u=a.next()){var l=u.value;o===r&&(s=l),o+=1}}catch(f){i={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s},e.prototype.insert=function(r,i){this.set(r,void 0,i)},e.prototype.find=function(r){var i=this.findElementNode(this.root,r);return i!==void 0?new fe(i,this.header):this.end()},e.prototype.lowerBound=function(r){var i=this._lowerBound(this.root,r);return new fe(i,this.header)},e.prototype.upperBound=function(r){var i=this._upperBound(this.root,r);return new fe(i,this.header)},e.prototype.reverseLowerBound=function(r){var i=this._reverseLowerBound(this.root,r);return new fe(i,this.header)},e.prototype.reverseUpperBound=function(r){var i=this._reverseUpperBound(this.root,r);return new fe(i,this.header)},e.prototype.union=function(r){var i=this;r.forEach(function(n){return i.insert(n)})},e.prototype[Symbol.iterator]=function(){return this.iterationFunc(this.root)},e})(xt),Ce=ch});var Ro,hh,Io,Dr,ce,dh,he,Gi=U(()=>{"use strict";Y();je();Mr();zi();Ro=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),hh=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Io=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},Dr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ce=(function(t){Ro(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"pointer",{get:function(){var r=this;if(this.node===this.header)throw new RangeError("OrderedMap iterator access denied");return new Proxy([],{get:function(i,n){if(n==="0")return r.node.key;if(n==="1")return r.node.value},set:function(i,n,s){if(n!=="1")throw new TypeError("props must be 1");return r.node.value=s,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.node,this.header,this.iteratorType)},e})(qr),dh=(function(t){Ro(e,t);function e(r,i){r===void 0&&(r=[]);var n=t.call(this,i)||this;return n.iterationFunc=function(s){return hh(this,function(o){switch(o.label){case 0:return s===void 0?[2]:[5,Dr(this.iterationFunc(s.left))];case 1:return o.sent(),[4,[s.key,s.value]];case 2:return o.sent(),[5,Dr(this.iterationFunc(s.right))];case 3:return o.sent(),[2]}})},n.iterationFunc=n.iterationFunc.bind(n),r.forEach(function(s){var o=Io(s,2),a=o[0],u=o[1];return n.setElement(a,u)}),n}return e.prototype.begin=function(){return new ce(this.header.left||this.header,this.header)},e.prototype.end=function(){return new ce(this.header,this.header)},e.prototype.rBegin=function(){return new ce(this.header.right||this.header,this.header,A.REVERSE)},e.prototype.rEnd=function(){return new ce(this.header,this.header,A.REVERSE)},e.prototype.front=function(){if(this.length){var r=this.header.left;return[r.key,r.value]}},e.prototype.back=function(){if(this.length){var r=this.header.right;return[r.key,r.value]}},e.prototype.forEach=function(r){var i,n,s=0;try{for(var o=Dr(this),a=o.next();!a.done;a=o.next()){var u=a.value;r(u,s++)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}},e.prototype.lowerBound=function(r){var i=this._lowerBound(this.root,r);return new ce(i,this.header)},e.prototype.upperBound=function(r){var i=this._upperBound(this.root,r);return new ce(i,this.header)},e.prototype.reverseLowerBound=function(r){var i=this._reverseLowerBound(this.root,r);return new ce(i,this.header)},e.prototype.reverseUpperBound=function(r){var i=this._reverseUpperBound(this.root,r);return new ce(i,this.header)},e.prototype.setElement=function(r,i,n){this.set(r,i,n)},e.prototype.find=function(r){var i=this.findElementNode(this.root,r);return i!==void 0?new ce(i,this.header):this.end()},e.prototype.getElementByKey=function(r){var i=this.findElementNode(this.root,r);return i?i.value:void 0},e.prototype.getElementByPos=function(r){var i,n;B(r,0,this.length-1);var s,o=0;try{for(var a=Dr(this),u=a.next();!u.done;u=a.next()){var l=u.value;if(o===r){s=l;break}o+=1}}catch(f){i={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s},e.prototype.union=function(r){var i=this;r.forEach(function(n){var s=Io(n,2),o=s[0],a=s[1];return i.setElement(o,a)})},e.prototype[Symbol.iterator]=function(){return this.iterationFunc(this.root)},e})(xt),he=dh});var ph,gh,q,Ur=U(()=>{"use strict";Y();ph=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),gh=(function(t){ph(e,t);function e(r,i){r===void 0&&(r=16),i===void 0&&(i=function(s){var o;typeof s!="string"?o=JSON.stringify(s):o=s;for(var a=0,u=o.length,l=0;l<u;l++){var f=o.charCodeAt(l);a=(a<<5)-a+f,a|=0}return a>>>0});var n=t.call(this)||this;if(r<16||(r&r-1)!==0)throw new RangeError("InitBucketNum range error");return n.bucketNum=n.initBucketNum=r,n.hashFunc=i,n}return e.prototype.clear=function(){this.length=0,this.bucketNum=this.initBucketNum,this.hashTable=[]},e.sigma=.75,e.treeifyThreshold=8,e.untreeifyThreshold=6,e.minTreeifySize=64,e.maxBucketNum=1<<30,e})(Te),q=gh});var yh,_h,mh,vh,Ao,Bo=U(()=>{"use strict";Ur();Lr();$i();yh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),_h=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},mh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vh=(function(t){yh(e,t);function e(r,i,n){r===void 0&&(r=[]);var s=t.call(this,i,n)||this;return s.hashTable=[],r.forEach(function(o){return s.insert(o)}),s}return e.prototype.reAllocate=function(){var r=this;if(!(this.bucketNum>=q.maxBucketNum)){var i=[],n=this.bucketNum;this.bucketNum<<=1;for(var s=Object.keys(this.hashTable),o=s.length,a=function(f){var h=parseInt(s[f]),c=u.hashTable[h],d=c.size();if(d===0)return"continue";if(d===1){var m=c.front();return i[u.hashFunc(m)&u.bucketNum-1]=new M([m],!1),"continue"}var y=[],v=[];c.forEach(function(b){var C=r.hashFunc(b);(C&n)===0?y.push(b):v.push(b)}),c instanceof Ce?(y.length>q.untreeifyThreshold?i[h]=new Ce(y):y.length&&(i[h]=new M(y,!1)),v.length>q.untreeifyThreshold?i[h+n]=new Ce(v):v.length&&(i[h+n]=new M(v,!1))):(y.length>=q.treeifyThreshold?i[h]=new Ce(y):y.length&&(i[h]=new M(y,!1)),v.length>=q.treeifyThreshold?i[h+n]=new Ce(v):v.length&&(i[h+n]=new M(v,!1)))},u=this,l=0;l<o;++l)a(l);this.hashTable=i}},e.prototype.forEach=function(r){for(var i=Object.values(this.hashTable),n=i.length,s=0,o=0;o<n;++o)i[o].forEach(function(a){return r(a,s++)})},e.prototype.insert=function(r){var i=this.hashFunc(r)&this.bucketNum-1,n=this.hashTable[i];if(!n)this.hashTable[i]=new M([r],!1),this.length+=1;else{var s=n.size();if(n instanceof M){if(!n.find(r).equals(n.end()))return;if(n.pushBack(r),s+1>=q.treeifyThreshold){if(this.bucketNum<=q.minTreeifySize){this.length+=1,this.reAllocate();return}this.hashTable[i]=new Ce(n)}this.length+=1}else{n.insert(r);var o=n.size();this.length+=o-s}}this.length>this.bucketNum*q.sigma&&this.reAllocate()},e.prototype.eraseElementByKey=function(r){var i=this.hashFunc(r)&this.bucketNum-1,n=this.hashTable[i];if(n){var s=n.size();if(s!==0)if(n instanceof M){n.eraseElementByValue(r);var o=n.size();this.length+=o-s}else{n.eraseElementByKey(r);var o=n.size();this.length+=o-s,o<=q.untreeifyThreshold&&(this.hashTable[i]=new M(n))}}},e.prototype.find=function(r){var i=this.hashFunc(r)&this.bucketNum-1,n=this.hashTable[i];return n?!n.find(r).equals(n.end()):!1},e.prototype[Symbol.iterator]=function(){return function(){var r,i,n,s,o,a,u,l,f,h;return _h(this,function(c){switch(c.label){case 0:r=Object.values(this.hashTable),i=r.length,n=0,c.label=1;case 1:if(!(n<i))return[3,10];s=r[n],c.label=2;case 2:c.trys.push([2,7,8,9]),o=(f=void 0,mh(s)),a=o.next(),c.label=3;case 3:return a.done?[3,6]:(u=a.value,[4,u]);case 4:c.sent(),c.label=5;case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return l=c.sent(),f={error:l},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(f)throw f.error}return[7];case 9:return++n,[3,1];case 10:return[2]}})}.bind(this)()},e})(q),Ao=vh});var bh,wh,zt,Sh,ko,Lo=U(()=>{"use strict";Ur();Lr();Gi();bh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),wh=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},zt=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sh=(function(t){bh(e,t);function e(r,i,n){r===void 0&&(r=[]);var s=t.call(this,i,n)||this;return s.hashTable=[],r.forEach(function(o){return s.setElement(o[0],o[1])}),s}return e.prototype.reAllocate=function(){var r=this;if(!(this.bucketNum>=q.maxBucketNum)){var i=[],n=this.bucketNum;this.bucketNum<<=1;for(var s=Object.keys(this.hashTable),o=s.length,a=function(f){var h=parseInt(s[f]),c=u.hashTable[h],d=c.size();if(d===0)return"continue";if(d===1){var m=c.front();return i[u.hashFunc(m[0])&u.bucketNum-1]=new M([m],!1),"continue"}var y=[],v=[];c.forEach(function(b){var C=r.hashFunc(b[0]);(C&n)===0?y.push(b):v.push(b)}),c instanceof he?(y.length>q.untreeifyThreshold?i[h]=new he(y):y.length&&(i[h]=new M(y,!1)),v.length>q.untreeifyThreshold?i[h+n]=new he(v):v.length&&(i[h+n]=new M(v,!1))):(y.length>=q.treeifyThreshold?i[h]=new he(y):y.length&&(i[h]=new M(y,!1)),v.length>=q.treeifyThreshold?i[h+n]=new he(v):v.length&&(i[h+n]=new M(v,!1)))},u=this,l=0;l<o;++l)a(l);this.hashTable=i}},e.prototype.forEach=function(r){for(var i=Object.values(this.hashTable),n=i.length,s=0,o=0;o<n;++o)i[o].forEach(function(a){return r(a,s++)})},e.prototype.setElement=function(r,i){var n,s,o=this.hashFunc(r)&this.bucketNum-1,a=this.hashTable[o];if(!a)this.length+=1,this.hashTable[o]=new M([[r,i]],!1);else{var u=a.size();if(a instanceof M){try{for(var l=zt(a),f=l.next();!f.done;f=l.next()){var h=f.value;if(h[0]===r){h[1]=i;return}}}catch(d){n={error:d}}finally{try{f&&!f.done&&(s=l.return)&&s.call(l)}finally{if(n)throw n.error}}if(a.pushBack([r,i]),u+1>=e.treeifyThreshold){if(this.bucketNum<=e.minTreeifySize){this.length+=1,this.reAllocate();return}this.hashTable[o]=new he(this.hashTable[o])}this.length+=1}else{a.setElement(r,i);var c=a.size();this.length+=c-u}}this.length>this.bucketNum*e.sigma&&this.reAllocate()},e.prototype.getElementByKey=function(r){var i,n,s=this.hashFunc(r)&this.bucketNum-1,o=this.hashTable[s];if(o){if(o instanceof he)return o.getElementByKey(r);try{for(var a=zt(o),u=a.next();!u.done;u=a.next()){var l=u.value;if(l[0]===r)return l[1]}}catch(f){i={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}}},e.prototype.eraseElementByKey=function(r){var i,n,s=this.hashFunc(r)&this.bucketNum-1,o=this.hashTable[s];if(o)if(o instanceof M){var a=0;try{for(var u=zt(o),l=u.next();!l.done;l=u.next()){var f=l.value;if(f[0]===r){o.eraseElementByPos(a),this.length-=1;return}a+=1}}catch(d){i={error:d}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.error}}}else{var h=o.size();o.eraseElementByKey(r);var c=o.size();this.length+=c-h,c<=q.untreeifyThreshold&&(this.hashTable[s]=new M(o))}},e.prototype.find=function(r){var i,n,s=this.hashFunc(r)&this.bucketNum-1,o=this.hashTable[s];if(!o)return!1;if(o instanceof he)return!o.find(r).equals(o.end());try{for(var a=zt(o),u=a.next();!u.done;u=a.next()){var l=u.value;if(l[0]===r)return!0}}catch(f){i={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return!1},e.prototype[Symbol.iterator]=function(){return function(){var r,i,n,s,o,a,u,l,f,h;return wh(this,function(c){switch(c.label){case 0:r=Object.values(this.hashTable),i=r.length,n=0,c.label=1;case 1:if(!(n<i))return[3,10];s=r[n],c.label=2;case 2:c.trys.push([2,7,8,9]),o=(f=void 0,zt(s)),a=o.next(),c.label=3;case 3:return a.done?[3,6]:(u=a.value,[4,u]);case 4:c.sent(),c.label=5;case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return l=c.sent(),f={error:l},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(f)throw f.error}return[7];case 9:return++n,[3,1];case 10:return[2]}})}.bind(this)()},e})(q),ko=Sh});var Mo={};Gn(Mo,{Container:()=>Et,ContainerIterator:()=>A,Deque:()=>Br,DequeIterator:()=>ot,HashContainer:()=>q,HashMap:()=>ko,HashSet:()=>Ao,LinkList:()=>xo,LinkListIterator:()=>lt,OrderedMap:()=>he,OrderedMapIterator:()=>ce,OrderedSet:()=>Ce,OrderedSetIterator:()=>fe,PriorityQueue:()=>mo,Queue:()=>yo,SequentialContainer:()=>Ue,Stack:()=>ho,TreeContainer:()=>xt,Vector:()=>M,VectorIterator:()=>at});var qo=U(()=>{"use strict";po();_o();vo();Lr();To();Ki();$i();Gi();Bo();Lo();Y();Ht();Mr();Ur()});var Do=g((q_,No)=>{"use strict";var Tt=1e3,Ct=Tt*60,Pt=Ct*60,ut=Pt*24,Eh=ut*7,xh=ut*365.25;No.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Th(t);if(r==="number"&&isFinite(t))return e.long?Ph(t):Ch(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Th(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*xh;case"weeks":case"week":case"w":return r*Eh;case"days":case"day":case"d":return r*ut;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Pt;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ct;case"seconds":case"second":case"secs":case"sec":case"s":return r*Tt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Ch(t){var e=Math.abs(t);return e>=ut?Math.round(t/ut)+"d":e>=Pt?Math.round(t/Pt)+"h":e>=Ct?Math.round(t/Ct)+"m":e>=Tt?Math.round(t/Tt)+"s":t+"ms"}function Ph(t){var e=Math.abs(t);return e>=ut?jr(t,e,ut,"day"):e>=Pt?jr(t,e,Pt,"hour"):e>=Ct?jr(t,e,Ct,"minute"):e>=Tt?jr(t,e,Tt,"second"):t+" ms"}function jr(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var Qi=g((N_,Uo)=>{"use strict";function Oh(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=n,r.enabled=a,r.humanize=Do(),r.destroy=l,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let c=0;c<f.length;c++)h=(h<<5)-h+f.charCodeAt(c),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(f){let h,c=null,d,m;function y(...v){if(!y.enabled)return;let b=y,C=Number(new Date),D=C-(h||C);b.diff=D,b.prev=h,b.curr=C,h=C,v[0]=r.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let K=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(Xe,Bt)=>{if(Xe==="%%")return"%";K++;let cr=r.formatters[Bt];if(typeof cr=="function"){let wu=v[K];Xe=cr.call(b,wu),v.splice(K,1),K--}return Xe}),r.formatArgs.call(b,v),(b.log||r.log).apply(b,v)}return y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=i,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>c!==null?c:(d!==r.namespaces&&(d=r.namespaces,m=r.enabled(f)),m),set:v=>{c=v}}),typeof r.init=="function"&&r.init(y),y}function i(f,h){let c=r(this.namespace+(typeof h>"u"?":":h)+f);return c.log=this.log,c}function n(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(" ",",").split(",").filter(Boolean);for(let c of h)c[0]==="-"?r.skips.push(c.slice(1)):r.names.push(c)}function s(f,h){let c=0,d=0,m=-1,y=0;for(;c<f.length;)if(d<h.length&&(h[d]===f[c]||h[d]==="*"))h[d]==="*"?(m=d,y=c,d++):(c++,d++);else if(m!==-1)d=m+1,y++,c=y;else return!1;for(;d<h.length&&h[d]==="*";)d++;return d===h.length}function o(){let f=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),f}function a(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}function u(f){return f instanceof Error?f.stack||f.message:f}function l(){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 r.enable(r.load()),r}Uo.exports=Oh});var jo=g((te,Fr)=>{"use strict";te.formatArgs=Rh;te.save=Ah;te.load=Bh;te.useColors=Ih;te.storage=kh();te.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();te.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 Ih(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Rh(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Fr.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}te.log=console.debug||console.log||(()=>{});function Ah(t){try{t?te.storage.setItem("debug",t):te.storage.removeItem("debug")}catch{}}function Bh(){let t;try{t=te.storage.getItem("debug")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function kh(){try{return localStorage}catch{}}Fr.exports=Qi()(te);var{formatters:Lh}=Fr.exports;Lh.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Wo=g((D_,Fo)=>{"use strict";Fo.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}});var Ko=g((U_,Ho)=>{"use strict";var Mh=require("os"),Vo=require("tty"),oe=Wo(),{env:V}=process,Fe;oe("no-color")||oe("no-colors")||oe("color=false")||oe("color=never")?Fe=0:(oe("color")||oe("colors")||oe("color=true")||oe("color=always"))&&(Fe=1);"FORCE_COLOR"in V&&(V.FORCE_COLOR==="true"?Fe=1:V.FORCE_COLOR==="false"?Fe=0:Fe=V.FORCE_COLOR.length===0?1:Math.min(parseInt(V.FORCE_COLOR,10),3));function Yi(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Xi(t,e){if(Fe===0)return 0;if(oe("color=16m")||oe("color=full")||oe("color=truecolor"))return 3;if(oe("color=256"))return 2;if(t&&!e&&Fe===void 0)return 0;let r=Fe||0;if(V.TERM==="dumb")return r;if(process.platform==="win32"){let i=Mh.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in V)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in V)||V.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in V)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(V.TEAMCITY_VERSION)?1:0;if(V.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in V){let i=parseInt((V.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(V.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(V.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(V.TERM)||"COLORTERM"in V?1:r}function qh(t){let e=Xi(t,t&&t.isTTY);return Yi(e)}Ho.exports={supportsColor:qh,stdout:Yi(Xi(!0,Vo.isatty(1))),stderr:Yi(Xi(!0,Vo.isatty(2)))}});var $o=g((H,Vr)=>{"use strict";var Nh=require("tty"),Wr=require("util");H.init=Hh;H.log=Fh;H.formatArgs=Uh;H.save=Wh;H.load=Vh;H.useColors=Dh;H.destroy=Wr.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");H.colors=[6,2,3,4,5,1];try{let t=Ko();t&&(t.stderr||t).level>=2&&(H.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}H.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,s)=>s.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),t[r]=i,t},{});function Dh(){return"colors"in H.inspectOpts?!!H.inspectOpts.colors:Nh.isatty(process.stderr.fd)}function Uh(t){let{namespace:e,useColors:r}=this;if(r){let i=this.color,n="\x1B[3"+(i<8?i:"8;5;"+i),s=` ${n};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
1
|
+
"use strict";var Su=Object.create;var hr=Object.defineProperty;var Eu=Object.getOwnPropertyDescriptor;var xu=Object.getOwnPropertyNames;var Tu=Object.getPrototypeOf,Cu=Object.prototype.hasOwnProperty;var U=(t,e)=>()=>(t&&(e=t(t=0)),e);var g=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Gn=(t,e)=>{for(var r in e)hr(t,r,{get:e[r],enumerable:!0})},Qn=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of xu(e))!Cu.call(t,n)&&n!==r&&hr(t,n,{get:()=>e[n],enumerable:!(i=Eu(e,n))||i.enumerable});return t};var ui=(t,e,r)=>(r=t!=null?Su(Tu(t)):{},Qn(e||!t||!t.__esModule?hr(r,"default",{value:t,enumerable:!0}):r,t)),Yn=t=>Qn(hr({},"__esModule",{value:!0}),t);var dr=g((Yg,Xn)=>{"use strict";Xn.exports=Ou;var Pu=Object.prototype.hasOwnProperty;function Ou(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)Pu.call(r,i)&&(t[i]=r[i])}return t}});var fi=g((Xg,Jn)=>{"use strict";Jn.exports=require("stream")});var rs=g((Jg,ts)=>{"use strict";function Zn(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Iu(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Zn(Object(r),!0).forEach(function(i){Ru(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Zn(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Ru(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Au(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function es(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Bu(t,e,r){return e&&es(t.prototype,e),r&&es(t,r),t}var ku=require("buffer"),pr=ku.Buffer,Lu=require("util"),ci=Lu.inspect,Mu=ci&&ci.custom||"inspect";function qu(t,e,r){pr.prototype.copy.call(t,e,r)}ts.exports=(function(){function t(){Au(this,t),this.head=null,this.tail=null,this.length=0}return Bu(t,[{key:"push",value:function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}},{key:"unshift",value:function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n}},{key:"concat",value:function(r){if(this.length===0)return pr.alloc(0);for(var i=pr.allocUnsafe(r>>>0),n=this.head,s=0;n;)qu(n.data,i,s),s+=n.data.length,n=n.next;return i}},{key:"consume",value:function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var i=this.head,n=1,s=i.data;for(r-=s.length;i=i.next;){var o=i.data,a=r>o.length?o.length:r;if(a===o.length?s+=o:s+=o.slice(0,r),r-=a,r===0){a===o.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=o.slice(a));break}++n}return this.length-=n,s}},{key:"_getBuffer",value:function(r){var i=pr.allocUnsafe(r),n=this.head,s=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var o=n.data,a=r>o.length?o.length:r;if(o.copy(i,i.length-r,0,a),r-=a,r===0){a===o.length?(++s,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=o.slice(a));break}++s}return this.length-=s,i}},{key:Mu,value:function(r,i){return ci(this,Iu({},i,{depth:0,customInspect:!1}))}}]),t})()});var di=g((Zg,ns)=>{"use strict";function Nu(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(hi,this,t)):process.nextTick(hi,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(s){!e&&s?r._writableState?r._writableState.errorEmitted?process.nextTick(gr,r):(r._writableState.errorEmitted=!0,process.nextTick(is,r,s)):process.nextTick(is,r,s):e?(process.nextTick(gr,r),e(s)):process.nextTick(gr,r)}),this)}function is(t,e){hi(t,e),gr(t)}function gr(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function Du(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function hi(t,e){t.emit("error",e)}function Uu(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}ns.exports={destroy:Nu,undestroy:Du,errorOrDestroy:Uu}});var Be=g((ey,as)=>{"use strict";var os={};function ne(t,e,r){r||(r=Error);function i(s,o,a){return typeof e=="string"?e:e(s,o,a)}class n extends r{constructor(o,a,u){super(i(o,a,u))}}n.prototype.name=r.name,n.prototype.code=t,os[t]=n}function ss(t,e){if(Array.isArray(t)){let r=t.length;return t=t.map(i=>String(i)),r>2?`one of ${e} ${t.slice(0,r-1).join(", ")}, or `+t[r-1]:r===2?`one of ${e} ${t[0]} or ${t[1]}`:`of ${e} ${t[0]}`}else return`of ${e} ${String(t)}`}function ju(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function Fu(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function Wu(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}ne("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);ne("ERR_INVALID_ARG_TYPE",function(t,e,r){let i;typeof e=="string"&&ju(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";let n;if(Fu(t," argument"))n=`The ${t} ${i} ${ss(e,"type")}`;else{let s=Wu(t,".")?"property":"argument";n=`The "${t}" ${s} ${i} ${ss(e,"type")}`}return n+=`. Received type ${typeof r}`,n},TypeError);ne("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ne("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});ne("ERR_STREAM_PREMATURE_CLOSE","Premature close");ne("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});ne("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ne("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ne("ERR_STREAM_WRITE_AFTER_END","write after end");ne("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ne("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);ne("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");as.exports.codes=os});var pi=g((ty,ls)=>{"use strict";var Vu=Be().codes.ERR_INVALID_OPT_VALUE;function Hu(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Ku(t,e,r,i){var n=Hu(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var s=i?r:"highWaterMark";throw new Vu(s,n)}return Math.floor(n)}return t.objectMode?16:16*1024}ls.exports={getHighWaterMark:Ku}});var us=g((ry,gi)=>{"use strict";typeof Object.create=="function"?gi.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:gi.exports=function(e,r){if(r){e.super_=r;var i=function(){};i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}}});var we=g((iy,_i)=>{"use strict";try{if(yi=require("util"),typeof yi.inherits!="function")throw"";_i.exports=yi.inherits}catch{_i.exports=us()}var yi});var cs=g((ny,fs)=>{"use strict";fs.exports=require("util").deprecate});var bi=g((sy,_s)=>{"use strict";_s.exports=L;function ds(t){var e=this;this.next=null,this.entry=null,this.finish=function(){vf(e,t)}}var yt;L.WritableState=Lt;var zu={deprecate:cs()},ps=fi(),_r=require("buffer").Buffer,$u=global.Uint8Array||function(){};function Gu(t){return _r.from(t)}function Qu(t){return _r.isBuffer(t)||t instanceof $u}var vi=di(),Yu=pi(),Xu=Yu.getHighWaterMark,ke=Be().codes,Ju=ke.ERR_INVALID_ARG_TYPE,Zu=ke.ERR_METHOD_NOT_IMPLEMENTED,ef=ke.ERR_MULTIPLE_CALLBACK,tf=ke.ERR_STREAM_CANNOT_PIPE,rf=ke.ERR_STREAM_DESTROYED,nf=ke.ERR_STREAM_NULL_VALUES,sf=ke.ERR_STREAM_WRITE_AFTER_END,of=ke.ERR_UNKNOWN_ENCODING,_t=vi.errorOrDestroy;we()(L,ps);function af(){}function Lt(t,e,r){yt=yt||Je(),t=t||{},typeof r!="boolean"&&(r=e instanceof yt),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=Xu(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){pf(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new ds(this)}Lt.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Lt.prototype,"buffer",{get:zu.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var yr;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(yr=Function.prototype[Symbol.hasInstance],Object.defineProperty(L,Symbol.hasInstance,{value:function(e){return yr.call(this,e)?!0:this!==L?!1:e&&e._writableState instanceof Lt}})):yr=function(e){return e instanceof this};function L(t){yt=yt||Je();var e=this instanceof yt;if(!e&&!yr.call(L,this))return new L(t);this._writableState=new Lt(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),ps.call(this)}L.prototype.pipe=function(){_t(this,new tf)};function lf(t,e){var r=new sf;_t(t,r),process.nextTick(e,r)}function uf(t,e,r,i){var n;return r===null?n=new nf:typeof r!="string"&&!e.objectMode&&(n=new Ju("chunk",["string","Buffer"],r)),n?(_t(t,n),process.nextTick(i,n),!1):!0}L.prototype.write=function(t,e,r){var i=this._writableState,n=!1,s=!i.objectMode&&Qu(t);return s&&!_r.isBuffer(t)&&(t=Gu(t)),typeof e=="function"&&(r=e,e=null),s?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=af),i.ending?lf(this,r):(s||uf(this,i,t,r))&&(i.pendingcb++,n=cf(this,i,s,t,e,r)),n};L.prototype.cork=function(){this._writableState.corked++};L.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&gs(this,t))};L.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new of(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(L.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ff(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=_r.from(e,r)),e}Object.defineProperty(L.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function cf(t,e,r,i,n,s){if(!r){var o=ff(e,i,n);i!==o&&(r=!0,n="buffer",i=o)}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var l=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:s,next:null},l?l.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else mi(t,e,!1,a,i,n,s);return u}function mi(t,e,r,i,n,s,o){e.writelen=i,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new rf("write")):r?t._writev(n,e.onwrite):t._write(n,s,e.onwrite),e.sync=!1}function hf(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(kt,t,e),t._writableState.errorEmitted=!0,_t(t,i)):(n(i),t._writableState.errorEmitted=!0,_t(t,i),kt(t,e))}function df(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function pf(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new ef;if(df(r),e)hf(t,r,i,e,n);else{var s=ys(r)||t.destroyed;!s&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&gs(t,r),i?process.nextTick(hs,t,r,s,n):hs(t,r,s,n)}}function hs(t,e,r,i){r||gf(t,e),e.pendingcb--,i(),kt(t,e)}function gf(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function gs(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),s=e.corkedRequestsFree;s.entry=r;for(var o=0,a=!0;r;)n[o]=r,r.isBuf||(a=!1),r=r.next,o+=1;n.allBuffers=a,mi(t,e,!0,e.length,n,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new ds(e),e.bufferedRequestCount=0}else{for(;r;){var u=r.chunk,l=r.encoding,f=r.callback,h=e.objectMode?1:u.length;if(mi(t,e,!1,h,u,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}L.prototype._write=function(t,e,r){r(new Zu("_write()"))};L.prototype._writev=null;L.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||mf(this,i,r),this};Object.defineProperty(L.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function ys(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function yf(t,e){t._final(function(r){e.pendingcb--,r&&_t(t,r),e.prefinished=!0,t.emit("prefinish"),kt(t,e)})}function _f(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(yf,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function kt(t,e){var r=ys(e);if(r&&(_f(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}function mf(t,e,r){e.ending=!0,kt(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function vf(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}Object.defineProperty(L.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});L.prototype.destroy=vi.destroy;L.prototype._undestroy=vi.undestroy;L.prototype._destroy=function(t,e){e(t)}});var Je=g((oy,vs)=>{"use strict";var bf=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};vs.exports=ge;var ms=Ei(),Si=bi();we()(ge,ms);for(wi=bf(Si.prototype),mr=0;mr<wi.length;mr++)vr=wi[mr],ge.prototype[vr]||(ge.prototype[vr]=Si.prototype[vr]);var wi,vr,mr;function ge(t){if(!(this instanceof ge))return new ge(t);ms.call(this,t),Si.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",wf)))}Object.defineProperty(ge.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(ge.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(ge.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function wf(){this._writableState.ended||process.nextTick(Sf,this)}function Sf(t){t.end()}Object.defineProperty(ge.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Ss=g((xi,ws)=>{"use strict";var br=require("buffer"),ye=br.Buffer;function bs(t,e){for(var r in t)e[r]=t[r]}ye.from&&ye.alloc&&ye.allocUnsafe&&ye.allocUnsafeSlow?ws.exports=br:(bs(br,xi),xi.Buffer=Ze);function Ze(t,e,r){return ye(t,e,r)}Ze.prototype=Object.create(ye.prototype);bs(ye,Ze);Ze.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ye(t,e,r)};Ze.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=ye(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};Ze.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ye(t)};Ze.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return br.SlowBuffer(t)}});var Pi=g(xs=>{"use strict";var Ci=Ss().Buffer,Es=Ci.isEncoding||function(t){switch(t=""+t,t&&t.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 Ef(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function xf(t){var e=Ef(t);if(typeof e!="string"&&(Ci.isEncoding===Es||!Es(t)))throw new Error("Unknown encoding: "+t);return e||t}xs.StringDecoder=Mt;function Mt(t){this.encoding=xf(t);var e;switch(this.encoding){case"utf16le":this.text=Rf,this.end=Af,e=4;break;case"utf8":this.fillLast=Pf,e=4;break;case"base64":this.text=Bf,this.end=kf,e=3;break;default:this.write=Lf,this.end=Mf;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ci.allocUnsafe(e)}Mt.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Mt.prototype.end=If;Mt.prototype.text=Of;Mt.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ti(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Tf(t,e,r){var i=e.length-1;if(i<r)return 0;var n=Ti(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=Ti(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=Ti(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}function Cf(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function Pf(t){var e=this.lastTotal-this.lastNeed,r=Cf(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function Of(t,e){var r=Tf(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}function If(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Rf(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Af(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function Bf(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function kf(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function Lf(t){return t.toString(this.encoding)}function Mf(t){return t&&t.length?this.write(t):""}});var wr=g((ly,Ps)=>{"use strict";var Ts=Be().codes.ERR_STREAM_PREMATURE_CLOSE;function qf(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}function Nf(){}function Df(t){return t.setHeader&&typeof t.abort=="function"}function Cs(t,e,r){if(typeof e=="function")return Cs(t,null,e);e||(e={}),r=qf(r||Nf);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,s=function(){t.writable||a()},o=t._writableState&&t._writableState.finished,a=function(){n=!1,o=!0,i||r.call(t)},u=t._readableState&&t._readableState.endEmitted,l=function(){i=!1,u=!0,n||r.call(t)},f=function(m){r.call(t,m)},h=function(){var m;if(i&&!u)return(!t._readableState||!t._readableState.ended)&&(m=new Ts),r.call(t,m);if(n&&!o)return(!t._writableState||!t._writableState.ended)&&(m=new Ts),r.call(t,m)},c=function(){t.req.on("finish",a)};return Df(t)?(t.on("complete",a),t.on("abort",h),t.req?c():t.on("request",c)):n&&!t._writableState&&(t.on("end",s),t.on("close",s)),t.on("end",l),t.on("finish",a),e.error!==!1&&t.on("error",f),t.on("close",h),function(){t.removeListener("complete",a),t.removeListener("abort",h),t.removeListener("request",c),t.req&&t.req.removeListener("finish",a),t.removeListener("end",s),t.removeListener("close",s),t.removeListener("finish",a),t.removeListener("end",l),t.removeListener("error",f),t.removeListener("close",h)}}Ps.exports=Cs});var Is=g((uy,Os)=>{"use strict";var Sr;function Le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Uf=wr(),Me=Symbol("lastResolve"),et=Symbol("lastReject"),qt=Symbol("error"),Er=Symbol("ended"),tt=Symbol("lastPromise"),Oi=Symbol("handlePromise"),rt=Symbol("stream");function qe(t,e){return{value:t,done:e}}function jf(t){var e=t[Me];if(e!==null){var r=t[rt].read();r!==null&&(t[tt]=null,t[Me]=null,t[et]=null,e(qe(r,!1)))}}function Ff(t){process.nextTick(jf,t)}function Wf(t,e){return function(r,i){t.then(function(){if(e[Er]){r(qe(void 0,!0));return}e[Oi](r,i)},i)}}var Vf=Object.getPrototypeOf(function(){}),Hf=Object.setPrototypeOf((Sr={get stream(){return this[rt]},next:function(){var e=this,r=this[qt];if(r!==null)return Promise.reject(r);if(this[Er])return Promise.resolve(qe(void 0,!0));if(this[rt].destroyed)return new Promise(function(o,a){process.nextTick(function(){e[qt]?a(e[qt]):o(qe(void 0,!0))})});var i=this[tt],n;if(i)n=new Promise(Wf(i,this));else{var s=this[rt].read();if(s!==null)return Promise.resolve(qe(s,!1));n=new Promise(this[Oi])}return this[tt]=n,n}},Le(Sr,Symbol.asyncIterator,function(){return this}),Le(Sr,"return",function(){var e=this;return new Promise(function(r,i){e[rt].destroy(null,function(n){if(n){i(n);return}r(qe(void 0,!0))})})}),Sr),Vf),Kf=function(e){var r,i=Object.create(Hf,(r={},Le(r,rt,{value:e,writable:!0}),Le(r,Me,{value:null,writable:!0}),Le(r,et,{value:null,writable:!0}),Le(r,qt,{value:null,writable:!0}),Le(r,Er,{value:e._readableState.endEmitted,writable:!0}),Le(r,Oi,{value:function(s,o){var a=i[rt].read();a?(i[tt]=null,i[Me]=null,i[et]=null,s(qe(a,!1))):(i[Me]=s,i[et]=o)},writable:!0}),r));return i[tt]=null,Uf(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var s=i[et];s!==null&&(i[tt]=null,i[Me]=null,i[et]=null,s(n)),i[qt]=n;return}var o=i[Me];o!==null&&(i[tt]=null,i[Me]=null,i[et]=null,o(qe(void 0,!0))),i[Er]=!0}),e.on("readable",Ff.bind(null,i)),i};Os.exports=Kf});var ks=g((fy,Bs)=>{"use strict";function Rs(t,e,r,i,n,s,o){try{var a=t[s](o),u=a.value}catch(l){r(l);return}a.done?e(u):Promise.resolve(u).then(i,n)}function zf(t){return function(){var e=this,r=arguments;return new Promise(function(i,n){var s=t.apply(e,r);function o(u){Rs(s,i,n,o,a,"next",u)}function a(u){Rs(s,i,n,o,a,"throw",u)}o(void 0)})}}function As(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function $f(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?As(Object(r),!0).forEach(function(i){Gf(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):As(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}function Gf(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Qf=Be().codes.ERR_INVALID_ARG_TYPE;function Yf(t,e,r){var i;if(e&&typeof e.next=="function")i=e;else if(e&&e[Symbol.asyncIterator])i=e[Symbol.asyncIterator]();else if(e&&e[Symbol.iterator])i=e[Symbol.iterator]();else throw new Qf("iterable",["Iterable"],e);var n=new t($f({objectMode:!0},r)),s=!1;n._read=function(){s||(s=!0,o())};function o(){return a.apply(this,arguments)}function a(){return a=zf(function*(){try{var u=yield i.next(),l=u.value,f=u.done;f?n.push(null):n.push(yield l)?o():s=!1}catch(h){n.destroy(h)}}),a.apply(this,arguments)}return n}Bs.exports=Yf});var Ei=g((hy,Vs)=>{"use strict";Vs.exports=P;var mt;P.ReadableState=Ns;var cy=require("events").EventEmitter,qs=function(e,r){return e.listeners(r).length},Dt=fi(),xr=require("buffer").Buffer,Xf=global.Uint8Array||function(){};function Jf(t){return xr.from(t)}function Zf(t){return xr.isBuffer(t)||t instanceof Xf}var Ii=require("util"),x;Ii&&Ii.debuglog?x=Ii.debuglog("stream"):x=function(){};var ec=rs(),qi=di(),tc=pi(),rc=tc.getHighWaterMark,Tr=Be().codes,ic=Tr.ERR_INVALID_ARG_TYPE,nc=Tr.ERR_STREAM_PUSH_AFTER_EOF,sc=Tr.ERR_METHOD_NOT_IMPLEMENTED,oc=Tr.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,vt,Ri,Ai;we()(P,Dt);var Nt=qi.errorOrDestroy,Bi=["error","close","destroy","pause","resume"];function ac(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}function Ns(t,e,r){mt=mt||Je(),t=t||{},typeof r!="boolean"&&(r=e instanceof mt),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=rc(this,t,"readableHighWaterMark",r),this.buffer=new ec,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(vt||(vt=Pi().StringDecoder),this.decoder=new vt(t.encoding),this.encoding=t.encoding)}function P(t){if(mt=mt||Je(),!(this instanceof P))return new P(t);var e=this instanceof mt;this._readableState=new Ns(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Dt.call(this)}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});P.prototype.destroy=qi.destroy;P.prototype._undestroy=qi.undestroy;P.prototype._destroy=function(t,e){e(t)};P.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=xr.from(t,e),e=""),i=!0),Ds(this,t,e,!1,i)};P.prototype.unshift=function(t){return Ds(this,t,null,!0,!1)};function Ds(t,e,r,i,n){x("readableAddChunk",e);var s=t._readableState;if(e===null)s.reading=!1,fc(t,s);else{var o;if(n||(o=lc(s,e)),o)Nt(t,o);else if(s.objectMode||e&&e.length>0)if(typeof e!="string"&&!s.objectMode&&Object.getPrototypeOf(e)!==xr.prototype&&(e=Jf(e)),i)s.endEmitted?Nt(t,new oc):ki(t,s,e,!0);else if(s.ended)Nt(t,new nc);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||e.length!==0?ki(t,s,e,!1):Mi(t,s)):ki(t,s,e,!1)}else i||(s.reading=!1,Mi(t,s))}return!s.ended&&(s.length<s.highWaterMark||s.length===0)}function ki(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&Cr(t)),Mi(t,e)}function lc(t,e){var r;return!Zf(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new ic("chunk",["string","Buffer","Uint8Array"],e)),r}P.prototype.isPaused=function(){return this._readableState.flowing===!1};P.prototype.setEncoding=function(t){vt||(vt=Pi().StringDecoder);var e=new vt(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var Ls=1073741824;function uc(t){return t>=Ls?t=Ls:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Ms(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=uc(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}P.prototype.read=function(t){x("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return x("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Li(this):Cr(this),null;if(t=Ms(t,e),t===0&&e.ended)return e.length===0&&Li(this),null;var i=e.needReadable;x("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,x("length less than watermark",i)),e.ended||e.reading?(i=!1,x("reading or ended",i)):i&&(x("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Ms(r,e)));var n;return t>0?n=Fs(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Li(this)),n!==null&&this.emit("data",n),n};function fc(t,e){if(x("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Cr(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Us(t)))}}function Cr(t){var e=t._readableState;x("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(x("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Us,t))}function Us(t){var e=t._readableState;x("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Ni(t)}function Mi(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(cc,t,e))}function cc(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(x("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}P.prototype._read=function(t){Nt(this,new sc("_read()"))};P.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,x("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,s=n?a:y;i.endEmitted?process.nextTick(s):r.once("end",s),t.on("unpipe",o);function o(v,b){x("onunpipe"),v===r&&b&&b.hasUnpiped===!1&&(b.hasUnpiped=!0,f())}function a(){x("onend"),t.end()}var u=hc(r);t.on("drain",u);var l=!1;function f(){x("cleanup"),t.removeListener("close",d),t.removeListener("finish",m),t.removeListener("drain",u),t.removeListener("error",c),t.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",h),l=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&u()}r.on("data",h);function h(v){x("ondata");var b=t.write(v);x("dest.write",b),b===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&Ws(i.pipes,t)!==-1)&&!l&&(x("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function c(v){x("onerror",v),y(),t.removeListener("error",c),qs(t,"error")===0&&Nt(t,v)}ac(t,"error",c);function d(){t.removeListener("finish",m),y()}t.once("close",d);function m(){x("onfinish"),t.removeListener("close",d),y()}t.once("finish",m);function y(){x("unpipe"),r.unpipe(t)}return t.emit("pipe",r),i.flowing||(x("pipe resume"),r.resume()),t};function hc(t){return function(){var r=t._readableState;x("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&qs(t,"data")&&(r.flowing=!0,Ni(t))}}P.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var s=0;s<n;s++)i[s].emit("unpipe",this,{hasUnpiped:!1});return this}var o=Ws(e.pipes,t);return o===-1?this:(e.pipes.splice(o,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};P.prototype.on=function(t,e){var r=Dt.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,x("on readable",i.length,i.reading),i.length?Cr(this):i.reading||process.nextTick(dc,this)),r};P.prototype.addListener=P.prototype.on;P.prototype.removeListener=function(t,e){var r=Dt.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(js,this),r};P.prototype.removeAllListeners=function(t){var e=Dt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(js,this),e};function js(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function dc(t){x("readable nexttick read 0"),t.read(0)}P.prototype.resume=function(){var t=this._readableState;return t.flowing||(x("resume"),t.flowing=!t.readableListening,pc(this,t)),t.paused=!1,this};function pc(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(gc,t,e))}function gc(t,e){x("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Ni(t),e.flowing&&!e.reading&&t.read(0)}P.prototype.pause=function(){return x("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(x("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ni(t){var e=t._readableState;for(x("flow",e.flowing);e.flowing&&t.read()!==null;);}P.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(x("wrapped end"),r.decoder&&!r.ended){var o=r.decoder.end();o&&o.length&&e.push(o)}e.push(null)}),t.on("data",function(o){if(x("wrapped data"),r.decoder&&(o=r.decoder.write(o)),!(r.objectMode&&o==null)&&!(!r.objectMode&&(!o||!o.length))){var a=e.push(o);a||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=(function(a){return function(){return t[a].apply(t,arguments)}})(n));for(var s=0;s<Bi.length;s++)t.on(Bi[s],this.emit.bind(this,Bi[s]));return this._read=function(o){x("wrapped _read",o),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(P.prototype[Symbol.asyncIterator]=function(){return Ri===void 0&&(Ri=Is()),Ri(this)});Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});P._fromList=Fs;Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function Fs(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function Li(t){var e=t._readableState;x("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(yc,e,t))}function yc(t,e){if(x("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}typeof Symbol=="function"&&(P.from=function(t,e){return Ai===void 0&&(Ai=ks()),Ai(P,t,e)});function Ws(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}});var Di=g((dy,Ks)=>{"use strict";Ks.exports=Se;var Pr=Be().codes,_c=Pr.ERR_METHOD_NOT_IMPLEMENTED,mc=Pr.ERR_MULTIPLE_CALLBACK,vc=Pr.ERR_TRANSFORM_ALREADY_TRANSFORMING,bc=Pr.ERR_TRANSFORM_WITH_LENGTH_0,Or=Je();we()(Se,Or);function wc(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new mc);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}function Se(t){if(!(this instanceof Se))return new Se(t);Or.call(this,t),this._transformState={afterTransform:wc.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Sc)}function Sc(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){Hs(t,e,r)}):Hs(this,null,null)}Se.prototype.push=function(t,e){return this._transformState.needTransform=!1,Or.prototype.push.call(this,t,e)};Se.prototype._transform=function(t,e,r){r(new _c("_transform()"))};Se.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};Se.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Se.prototype._destroy=function(t,e){Or.prototype._destroy.call(this,t,function(r){e(r)})};function Hs(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new bc;if(t._transformState.transforming)throw new vc;return t.push(null)}});var Gs=g((py,$s)=>{"use strict";$s.exports=Ut;var zs=Di();we()(Ut,zs);function Ut(t){if(!(this instanceof Ut))return new Ut(t);zs.call(this,t)}Ut.prototype._transform=function(t,e,r){r(null,t)}});var Zs=g((gy,Js)=>{"use strict";var Ui;function Ec(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var Xs=Be().codes,xc=Xs.ERR_MISSING_ARGS,Tc=Xs.ERR_STREAM_DESTROYED;function Qs(t){if(t)throw t}function Cc(t){return t.setHeader&&typeof t.abort=="function"}function Pc(t,e,r,i){i=Ec(i);var n=!1;t.on("close",function(){n=!0}),Ui===void 0&&(Ui=wr()),Ui(t,{readable:e,writable:r},function(o){if(o)return i(o);n=!0,i()});var s=!1;return function(o){if(!n&&!s){if(s=!0,Cc(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(o||new Tc("pipe"))}}}function Ys(t){t()}function Oc(t,e){return t.pipe(e)}function Ic(t){return!t.length||typeof t[t.length-1]!="function"?Qs:t.pop()}function Rc(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=Ic(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new xc("streams");var n,s=e.map(function(o,a){var u=a<e.length-1,l=a>0;return Pc(o,u,l,function(f){n||(n=f),f&&s.forEach(Ys),!u&&(s.forEach(Ys),i(n))})});return e.reduce(Oc)}Js.exports=Rc});var Ne=g((se,Ft)=>{"use strict";var jt=require("stream");process.env.READABLE_STREAM==="disable"&&jt?(Ft.exports=jt.Readable,Object.assign(Ft.exports,jt),Ft.exports.Stream=jt):(se=Ft.exports=Ei(),se.Stream=jt||se,se.Readable=se,se.Writable=bi(),se.Duplex=Je(),se.Transform=Di(),se.PassThrough=Gs(),se.finished=wr(),se.pipeline=Zs())});var Ir=g((yy,eo)=>{"use strict";var Ac=dr(),Bc=Ne().Readable,kc={objectMode:!0},Lc={clean:!0};function De(t){if(!(this instanceof De))return new De(t);this.options=t||{},this.options=Ac(Lc,t),this._inflights=new Map}De.prototype.put=function(t,e){return this._inflights.set(t.messageId,t),e&&e(),this};De.prototype.createStream=function(){let t=new Bc(kc),e=[],r=!1,i=0;return this._inflights.forEach(function(n,s){e.push(n)}),t._read=function(){!r&&i<e.length?this.push(e[i++]):this.push(null)},t.destroy=function(){if(r)return;let n=this;r=!0,setTimeout(function(){n.emit("close")},0)},t};De.prototype.del=function(t,e){return t=this._inflights.get(t.messageId),t?(this._inflights.delete(t.messageId),e(null,t)):e&&e(new Error("missing packet")),this};De.prototype.get=function(t,e){return t=this._inflights.get(t.messageId),t?e(null,t):e&&e(new Error("missing packet")),this};De.prototype.close=function(t){this.options.clean&&(this._inflights=null),t&&t()};eo.exports=De});var ro=g((_y,to)=>{"use strict";function bt(t){if(!(this instanceof bt))return new bt(t);this.aliasToTopic={},this.max=t}bt.prototype.put=function(t,e){return e===0||e>this.max?!1:(this.aliasToTopic[e]=t,this.length=Object.keys(this.aliasToTopic).length,!0)};bt.prototype.getTopicByAlias=function(t){return this.aliasToTopic[t]};bt.prototype.clear=function(){this.aliasToTopic={}};to.exports=bt});var no=g((my,io)=>{"use strict";io.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let e=this.head;e;e=e.next)yield e.value}}});var oo=g((vy,so)=>{"use strict";so.exports=O;O.Node=it;O.create=O;function O(t){var e=this;if(e instanceof O||(e=new O),e.tail=null,e.head=null,e.length=0,t&&typeof t.forEach=="function")t.forEach(function(n){e.push(n)});else if(arguments.length>0)for(var r=0,i=arguments.length;r<i;r++)e.push(arguments[r]);return e}O.prototype.removeNode=function(t){if(t.list!==this)throw new Error("removing node which does not belong to this list");var e=t.next,r=t.prev;return e&&(e.prev=r),r&&(r.next=e),t===this.head&&(this.head=e),t===this.tail&&(this.tail=r),t.list.length--,t.next=null,t.prev=null,t.list=null,e};O.prototype.unshiftNode=function(t){if(t!==this.head){t.list&&t.list.removeNode(t);var e=this.head;t.list=this,t.next=e,e&&(e.prev=t),this.head=t,this.tail||(this.tail=t),this.length++}};O.prototype.pushNode=function(t){if(t!==this.tail){t.list&&t.list.removeNode(t);var e=this.tail;t.list=this,t.prev=e,e&&(e.next=t),this.tail=t,this.head||(this.head=t),this.length++}};O.prototype.push=function(){for(var t=0,e=arguments.length;t<e;t++)qc(this,arguments[t]);return this.length};O.prototype.unshift=function(){for(var t=0,e=arguments.length;t<e;t++)Nc(this,arguments[t]);return this.length};O.prototype.pop=function(){if(this.tail){var t=this.tail.value;return this.tail=this.tail.prev,this.tail?this.tail.next=null:this.head=null,this.length--,t}};O.prototype.shift=function(){if(this.head){var t=this.head.value;return this.head=this.head.next,this.head?this.head.prev=null:this.tail=null,this.length--,t}};O.prototype.forEach=function(t,e){e=e||this;for(var r=this.head,i=0;r!==null;i++)t.call(e,r.value,i,this),r=r.next};O.prototype.forEachReverse=function(t,e){e=e||this;for(var r=this.tail,i=this.length-1;r!==null;i--)t.call(e,r.value,i,this),r=r.prev};O.prototype.get=function(t){for(var e=0,r=this.head;r!==null&&e<t;e++)r=r.next;if(e===t&&r!==null)return r.value};O.prototype.getReverse=function(t){for(var e=0,r=this.tail;r!==null&&e<t;e++)r=r.prev;if(e===t&&r!==null)return r.value};O.prototype.map=function(t,e){e=e||this;for(var r=new O,i=this.head;i!==null;)r.push(t.call(e,i.value,this)),i=i.next;return r};O.prototype.mapReverse=function(t,e){e=e||this;for(var r=new O,i=this.tail;i!==null;)r.push(t.call(e,i.value,this)),i=i.prev;return r};O.prototype.reduce=function(t,e){var r,i=this.head;if(arguments.length>1)r=e;else if(this.head)i=this.head.next,r=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=0;i!==null;n++)r=t(r,i.value,n),i=i.next;return r};O.prototype.reduceReverse=function(t,e){var r,i=this.tail;if(arguments.length>1)r=e;else if(this.tail)i=this.tail.prev,r=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var n=this.length-1;i!==null;n--)r=t(r,i.value,n),i=i.prev;return r};O.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;r!==null;e++)t[e]=r.value,r=r.next;return t};O.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;r!==null;e++)t[e]=r.value,r=r.prev;return t};O.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new O;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=0,n=this.head;n!==null&&i<t;i++)n=n.next;for(;n!==null&&i<e;i++,n=n.next)r.push(n.value);return r};O.prototype.sliceReverse=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new O;if(e<t||e<0)return r;t<0&&(t=0),e>this.length&&(e=this.length);for(var i=this.length,n=this.tail;n!==null&&i>e;i--)n=n.prev;for(;n!==null&&i>t;i--,n=n.prev)r.push(n.value);return r};O.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var i=0,n=this.head;n!==null&&i<t;i++)n=n.next;for(var s=[],i=0;n&&i<e;i++)s.push(n.value),n=this.removeNode(n);n===null&&(n=this.tail),n!==this.head&&n!==this.tail&&(n=n.prev);for(var i=0;i<r.length;i++)n=Mc(this,n,r[i]);return s};O.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;r!==null;r=r.prev){var i=r.prev;r.prev=r.next,r.next=i}return this.head=e,this.tail=t,this};function Mc(t,e,r){var i=e===t.head?new it(r,null,e,t):new it(r,e,e.next,t);return i.next===null&&(t.tail=i),i.prev===null&&(t.head=i),t.length++,i}function qc(t,e){t.tail=new it(e,t.tail,null,t),t.head||(t.head=t.tail),t.length++}function Nc(t,e){t.head=new it(e,null,t.head,t),t.tail||(t.tail=t.head),t.length++}function it(t,e,r,i){if(!(this instanceof it))return new it(t,e,r,i);this.list=i,this.value=t,e?(e.next=this,this.prev=e):this.prev=null,r?(r.prev=this,this.next=r):this.next=null}try{no()(O)}catch{}});var co=g((by,fo)=>{"use strict";var Dc=oo(),nt=Symbol("max"),xe=Symbol("length"),wt=Symbol("lengthCalculator"),Vt=Symbol("allowStale"),st=Symbol("maxAge"),Ee=Symbol("dispose"),ao=Symbol("noDisposeOnSet"),W=Symbol("lruList"),ue=Symbol("cache"),uo=Symbol("updateAgeOnGet"),ji=()=>1,Wi=class{constructor(e){if(typeof e=="number"&&(e={max:e}),e||(e={}),e.max&&(typeof e.max!="number"||e.max<0))throw new TypeError("max must be a non-negative number");let r=this[nt]=e.max||1/0,i=e.length||ji;if(this[wt]=typeof i!="function"?ji:i,this[Vt]=e.stale||!1,e.maxAge&&typeof e.maxAge!="number")throw new TypeError("maxAge must be a number");this[st]=e.maxAge||0,this[Ee]=e.dispose,this[ao]=e.noDisposeOnSet||!1,this[uo]=e.updateAgeOnGet||!1,this.reset()}set max(e){if(typeof e!="number"||e<0)throw new TypeError("max must be a non-negative number");this[nt]=e||1/0,Wt(this)}get max(){return this[nt]}set allowStale(e){this[Vt]=!!e}get allowStale(){return this[Vt]}set maxAge(e){if(typeof e!="number")throw new TypeError("maxAge must be a non-negative number");this[st]=e,Wt(this)}get maxAge(){return this[st]}set lengthCalculator(e){typeof e!="function"&&(e=ji),e!==this[wt]&&(this[wt]=e,this[xe]=0,this[W].forEach(r=>{r.length=this[wt](r.value,r.key),this[xe]+=r.length})),Wt(this)}get lengthCalculator(){return this[wt]}get length(){return this[xe]}get itemCount(){return this[W].length}rforEach(e,r){r=r||this;for(let i=this[W].tail;i!==null;){let n=i.prev;lo(this,e,i,r),i=n}}forEach(e,r){r=r||this;for(let i=this[W].head;i!==null;){let n=i.next;lo(this,e,i,r),i=n}}keys(){return this[W].toArray().map(e=>e.key)}values(){return this[W].toArray().map(e=>e.value)}reset(){this[Ee]&&this[W]&&this[W].length&&this[W].forEach(e=>this[Ee](e.key,e.value)),this[ue]=new Map,this[W]=new Dc,this[xe]=0}dump(){return this[W].map(e=>Rr(this,e)?!1:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)}).toArray().filter(e=>e)}dumpLru(){return this[W]}set(e,r,i){if(i=i||this[st],i&&typeof i!="number")throw new TypeError("maxAge must be a number");let n=i?Date.now():0,s=this[wt](r,e);if(this[ue].has(e)){if(s>this[nt])return St(this,this[ue].get(e)),!1;let u=this[ue].get(e).value;return this[Ee]&&(this[ao]||this[Ee](e,u.value)),u.now=n,u.maxAge=i,u.value=r,this[xe]+=s-u.length,u.length=s,this.get(e),Wt(this),!0}let o=new Vi(e,r,s,n,i);return o.length>this[nt]?(this[Ee]&&this[Ee](e,r),!1):(this[xe]+=o.length,this[W].unshift(o),this[ue].set(e,this[W].head),Wt(this),!0)}has(e){if(!this[ue].has(e))return!1;let r=this[ue].get(e).value;return!Rr(this,r)}get(e){return Fi(this,e,!0)}peek(e){return Fi(this,e,!1)}pop(){let e=this[W].tail;return e?(St(this,e),e.value):null}del(e){St(this,this[ue].get(e))}load(e){this.reset();let r=Date.now();for(let i=e.length-1;i>=0;i--){let n=e[i],s=n.e||0;if(s===0)this.set(n.k,n.v);else{let o=s-r;o>0&&this.set(n.k,n.v,o)}}}prune(){this[ue].forEach((e,r)=>Fi(this,r,!1))}},Fi=(t,e,r)=>{let i=t[ue].get(e);if(i){let n=i.value;if(Rr(t,n)){if(St(t,i),!t[Vt])return}else r&&(t[uo]&&(i.value.now=Date.now()),t[W].unshiftNode(i));return n.value}},Rr=(t,e)=>{if(!e||!e.maxAge&&!t[st])return!1;let r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[st]&&r>t[st]},Wt=t=>{if(t[xe]>t[nt])for(let e=t[W].tail;t[xe]>t[nt]&&e!==null;){let r=e.prev;St(t,e),e=r}},St=(t,e)=>{if(e){let r=e.value;t[Ee]&&t[Ee](r.key,r.value),t[xe]-=r.length,t[ue].delete(r.key),t[W].removeNode(e)}},Vi=class{constructor(e,r,i,n,s){this.key=e,this.value=r,this.length=i,this.now=n,this.maxAge=s||0}},lo=(t,e,r,i)=>{let n=r.value;Rr(t,n)&&(St(t,r),t[Vt]||(n=void 0)),n&&e.call(i,n.value,n.key,t)};fo.exports=Wi});var Uc,A,Te,Et,Y=U(()=>{"use strict";Uc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),A=(function(){function t(e){e===void 0&&(e=t.NORMAL),this.iteratorType=e}return t.NORMAL=!1,t.REVERSE=!0,t})(),Te=(function(){function t(){this.length=0}return t.prototype.size=function(){return this.length},t.prototype.empty=function(){return this.length===0},t})(),Et=(function(t){Uc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Te)});var jc,Fc,ho,po=U(()=>{"use strict";Y();jc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Fc=(function(t){jc(e,t);function e(r){r===void 0&&(r=[]);var i=t.call(this)||this;return i.stack=[],r.forEach(function(n){return i.push(n)}),i}return e.prototype.clear=function(){this.length=0,this.stack.length=0},e.prototype.push=function(r){this.stack.push(r),this.length+=1},e.prototype.pop=function(){this.stack.pop(),this.length>0&&(this.length-=1)},e.prototype.top=function(){return this.stack[this.length-1]},e})(Te),ho=Fc});var Wc,Vc,Ue,Ht=U(()=>{"use strict";Y();Wc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Vc=(function(t){Wc(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Et),Ue=Vc});function B(t,e,r){if(t<e||t>r)throw new RangeError}var je=U(()=>{"use strict"});var Hc,Ar,Hi=U(()=>{"use strict";je();Y();Hc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Ar=(function(t){Hc(e,t);function e(r,i,n,s,o){var a=t.call(this,o)||this;return a.node=r,a.size=i,a.getElementByPos=n,a.setElementByPos=s,a.iteratorType===A.NORMAL?(a.pre=function(){if(this.node===0)throw new RangeError("Deque iterator access denied!");return this.node-=1,this},a.next=function(){if(this.node===this.size())throw new RangeError("Deque Iterator access denied!");return this.node+=1,this}):(a.pre=function(){if(this.node===this.size()-1)throw new RangeError("Deque iterator access denied!");return this.node+=1,this},a.next=function(){if(this.node===-1)throw new RangeError("Deque iterator access denied!");return this.node-=1,this}),a}return Object.defineProperty(e.prototype,"pointer",{get:function(){return B(this.node,0,this.size()-1),this.getElementByPos(this.node)},set:function(r){B(this.node,0,this.size()-1),this.setElementByPos(this.node,r)},enumerable:!1,configurable:!0}),e.prototype.equals=function(r){return this.node===r.node},e})(A)});var go,Kc,zc,$c,ot,Gc,Br,Ki=U(()=>{"use strict";Ht();je();Y();Hi();go=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Kc=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},zc=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},$c=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},ot=(function(t){go(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.copy=function(){return new e(this.node,this.size,this.getElementByPos,this.setElementByPos,this.iteratorType)},e})(Ar),Gc=(function(t){go(e,t);function e(r,i){r===void 0&&(r=[]),i===void 0&&(i=4096);var n=t.call(this)||this;n.first=0,n.curFirst=0,n.last=0,n.curLast=0,n.bucketNum=0,n.map=[];var s;if("size"in r)typeof r.size=="number"?s=r.size:s=r.size();else if("length"in r)s=r.length;else throw new RangeError("Can't get container's size!");n.bucketSize=i,n.bucketNum=Math.max(Math.ceil(s/n.bucketSize),1);for(var o=0;o<n.bucketNum;++o)n.map.push(new Array(n.bucketSize));var a=Math.ceil(s/n.bucketSize);return n.first=n.last=(n.bucketNum>>1)-(a>>1),n.curFirst=n.curLast=n.bucketSize-s%n.bucketSize>>1,r.forEach(function(u){return n.pushBack(u)}),n.size=n.size.bind(n),n.getElementByPos=n.getElementByPos.bind(n),n.setElementByPos=n.setElementByPos.bind(n),n}return e.prototype.reAllocate=function(){for(var r=[],i=Math.max(this.bucketNum>>1,1),n=0;n<i;++n)r[n]=new Array(this.bucketSize);for(var n=this.first;n<this.bucketNum;++n)r[r.length]=this.map[n];for(var n=0;n<this.last;++n)r[r.length]=this.map[n];r[r.length]=$c([],zc(this.map[this.last]),!1),this.first=i,this.last=r.length-1;for(var n=0;n<i;++n)r[r.length]=new Array(this.bucketSize);this.map=r,this.bucketNum=r.length},e.prototype.getElementIndex=function(r){var i=this.curFirst+r+1,n=i%this.bucketSize,s=n-1,o=this.first+(i-n)/this.bucketSize;return n===0&&(o-=1),o%=this.bucketNum,s<0&&(s+=this.bucketSize),{curNodeBucketIndex:o,curNodePointerIndex:s}},e.prototype.clear=function(){this.map=[[]],this.bucketNum=1,this.first=this.last=this.length=0,this.curFirst=this.curLast=this.bucketSize>>1},e.prototype.front=function(){return this.map[this.first][this.curFirst]},e.prototype.back=function(){return this.map[this.last][this.curLast]},e.prototype.begin=function(){return new ot(0,this.size,this.getElementByPos,this.setElementByPos)},e.prototype.end=function(){return new ot(this.length,this.size,this.getElementByPos,this.setElementByPos)},e.prototype.rBegin=function(){return new ot(this.length-1,this.size,this.getElementByPos,this.setElementByPos,A.REVERSE)},e.prototype.rEnd=function(){return new ot(-1,this.size,this.getElementByPos,this.setElementByPos,A.REVERSE)},e.prototype.pushBack=function(r){this.length&&(this.curLast<this.bucketSize-1?this.curLast+=1:this.last<this.bucketNum-1?(this.last+=1,this.curLast=0):(this.last=0,this.curLast=0),this.last===this.first&&this.curLast===this.curFirst&&this.reAllocate()),this.length+=1,this.map[this.last][this.curLast]=r},e.prototype.popBack=function(){this.length&&(this.map[this.last][this.curLast]=void 0,this.length!==1&&(this.curLast>0?this.curLast-=1:this.last>0?(this.last-=1,this.curLast=this.bucketSize-1):(this.last=this.bucketNum-1,this.curLast=this.bucketSize-1)),this.length-=1)},e.prototype.pushFront=function(r){this.length&&(this.curFirst>0?this.curFirst-=1:this.first>0?(this.first-=1,this.curFirst=this.bucketSize-1):(this.first=this.bucketNum-1,this.curFirst=this.bucketSize-1),this.first===this.last&&this.curFirst===this.curLast&&this.reAllocate()),this.length+=1,this.map[this.first][this.curFirst]=r},e.prototype.popFront=function(){this.length&&(this.map[this.first][this.curFirst]=void 0,this.length!==1&&(this.curFirst<this.bucketSize-1?this.curFirst+=1:this.first<this.bucketNum-1?(this.first+=1,this.curFirst=0):(this.first=0,this.curFirst=0)),this.length-=1)},e.prototype.forEach=function(r){for(var i=0;i<this.length;++i)r(this.getElementByPos(i),i)},e.prototype.getElementByPos=function(r){B(r,0,this.length-1);var i=this.getElementIndex(r),n=i.curNodeBucketIndex,s=i.curNodePointerIndex;return this.map[n][s]},e.prototype.setElementByPos=function(r,i){B(r,0,this.length-1);var n=this.getElementIndex(r),s=n.curNodeBucketIndex,o=n.curNodePointerIndex;this.map[s][o]=i},e.prototype.insert=function(r,i,n){if(n===void 0&&(n=1),B(r,0,this.length),r===0)for(;n--;)this.pushFront(i);else if(r===this.length)for(;n--;)this.pushBack(i);else{for(var s=[],o=r;o<this.length;++o)s.push(this.getElementByPos(o));this.cut(r-1);for(var o=0;o<n;++o)this.pushBack(i);for(var o=0;o<s.length;++o)this.pushBack(s[o])}},e.prototype.cut=function(r){if(r<0){this.clear();return}var i=this.getElementIndex(r),n=i.curNodeBucketIndex,s=i.curNodePointerIndex;this.last=n,this.curLast=s,this.length=r+1},e.prototype.eraseElementByPos=function(r){var i=this;if(B(r,0,this.length-1),r===0)this.popFront();else if(r===this.length-1)this.popBack();else{for(var n=[],s=r+1;s<this.length;++s)n.push(this.getElementByPos(s));this.cut(r),this.popBack(),n.forEach(function(o){return i.pushBack(o)})}},e.prototype.eraseElementByValue=function(r){if(this.length){for(var i=[],n=0;n<this.length;++n){var s=this.getElementByPos(n);s!==r&&i.push(s)}for(var o=i.length,n=0;n<o;++n)this.setElementByPos(n,i[n]);this.cut(o-1)}},e.prototype.eraseElementByIterator=function(r){var i=r.node;return this.eraseElementByPos(i),r=r.next(),r},e.prototype.find=function(r){for(var i=0;i<this.length;++i)if(this.getElementByPos(i)===r)return new ot(i,this.size,this.getElementByPos,this.setElementByPos);return this.end()},e.prototype.reverse=function(){for(var r=0,i=this.length-1;r<i;){var n=this.getElementByPos(r);this.setElementByPos(r,this.getElementByPos(i)),this.setElementByPos(i,n),r+=1,i-=1}},e.prototype.unique=function(){if(!(this.length<=1)){for(var r=1,i=this.getElementByPos(0),n=1;n<this.length;++n){var s=this.getElementByPos(n);s!==i&&(i=s,this.setElementByPos(r++,s))}for(;this.length>r;)this.popBack()}},e.prototype.sort=function(r){for(var i=[],n=0;n<this.length;++n)i.push(this.getElementByPos(n));i.sort(r);for(var n=0;n<this.length;++n)this.setElementByPos(n,i[n])},e.prototype.shrinkToFit=function(){if(this.length){var r=[];this.forEach(function(n){return r.push(n)}),this.bucketNum=Math.max(Math.ceil(this.length/this.bucketSize),1),this.length=this.first=this.last=this.curFirst=this.curLast=0,this.map=[];for(var i=0;i<this.bucketNum;++i)this.map.push(new Array(this.bucketSize));for(var i=0;i<r.length;++i)this.pushBack(r[i])}},e.prototype[Symbol.iterator]=function(){return function(){var r;return Kc(this,function(i){switch(i.label){case 0:r=0,i.label=1;case 1:return r<this.length?[4,this.getElementByPos(r)]:[3,4];case 2:i.sent(),i.label=3;case 3:return++r,[3,1];case 4:return[2]}})}.bind(this)()},e})(Ue),Br=Gc});var Qc,Yc,yo,_o=U(()=>{"use strict";Ki();Y();Qc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Yc=(function(t){Qc(e,t);function e(r){r===void 0&&(r=[]);var i=t.call(this)||this;return i.queue=new Br(r),i.length=i.queue.size(),i}return e.prototype.clear=function(){this.queue.clear(),this.length=0},e.prototype.push=function(r){this.queue.pushBack(r),this.length+=1},e.prototype.pop=function(){this.queue.popFront(),this.length&&(this.length-=1)},e.prototype.front=function(){return this.queue.front()},e})(Te),yo=Yc});var Xc,kr,Jc,Zc,mo,vo=U(()=>{"use strict";Y();Xc=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),kr=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},Jc=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},Zc=(function(t){Xc(e,t);function e(r,i,n){var s;r===void 0&&(r=[]),i===void 0&&(i=function(d,m){return d>m?-1:d<m?1:0}),n===void 0&&(n=!0);var o=t.call(this)||this;o.cmp=i,Array.isArray(r)?o.priorityQueue=n?Jc([],kr(r),!1):r:(o.priorityQueue=[],r.forEach(function(d){return o.priorityQueue.push(d)})),o.length=o.priorityQueue.length;for(var a=o.length-1>>1;a>=0;--a)for(var u=a,l=u<<1|1;l<o.length;){var f=l,h=f+1,c=f;if(h<o.length&&o.cmp(o.priorityQueue[f],o.priorityQueue[h])>0&&(c=h),o.cmp(o.priorityQueue[u],o.priorityQueue[c])<=0)break;s=kr([o.priorityQueue[c],o.priorityQueue[u]],2),o.priorityQueue[u]=s[0],o.priorityQueue[c]=s[1],u=c,l=u<<1|1}return o}return e.prototype.adjust=function(r){var i,n,s=r<<1|1,o=(r<<1)+2;s<this.length&&this.cmp(this.priorityQueue[r],this.priorityQueue[s])>0&&(i=kr([this.priorityQueue[s],this.priorityQueue[r]],2),this.priorityQueue[r]=i[0],this.priorityQueue[s]=i[1]),o<this.length&&this.cmp(this.priorityQueue[r],this.priorityQueue[o])>0&&(n=kr([this.priorityQueue[o],this.priorityQueue[r]],2),this.priorityQueue[r]=n[0],this.priorityQueue[o]=n[1])},e.prototype.clear=function(){this.length=0,this.priorityQueue.length=0},e.prototype.push=function(r){if(this.priorityQueue.push(r),this.length+=1,this.length!==1)for(var i=this.length-1;i>0;){var n=i-1>>1;if(this.cmp(this.priorityQueue[n],r)<=0)break;this.adjust(n),i=n}},e.prototype.pop=function(){if(this.length){var r=this.priorityQueue[this.length-1];this.length-=1;for(var i=0;i<this.length;){var n=i<<1|1,s=(i<<1)+2;if(n>=this.length)break;var o=n;if(s<this.length&&this.cmp(this.priorityQueue[n],this.priorityQueue[s])>0&&(o=s),this.cmp(this.priorityQueue[o],r)>=0)break;this.priorityQueue[i]=this.priorityQueue[o],i=o}this.priorityQueue[i]=r,this.priorityQueue.pop()}},e.prototype.top=function(){return this.priorityQueue[0]},e})(Te),mo=Zc});var So,eh,bo,wo,th,at,rh,M,Lr=U(()=>{"use strict";Ht();je();Y();Hi();So=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),eh=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},bo=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},wo=function(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return t.concat(s||Array.prototype.slice.call(e))},th=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},at=(function(t){So(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.copy=function(){return new e(this.node,this.size,this.getElementByPos,this.setElementByPos,this.iteratorType)},e})(Ar),rh=(function(t){So(e,t);function e(r,i){r===void 0&&(r=[]),i===void 0&&(i=!0);var n=t.call(this)||this;return Array.isArray(r)?(n.vector=i?wo([],bo(r),!1):r,n.length=r.length):(n.vector=[],r.forEach(function(s){return n.pushBack(s)})),n.size=n.size.bind(n),n.getElementByPos=n.getElementByPos.bind(n),n.setElementByPos=n.setElementByPos.bind(n),n}return e.prototype.clear=function(){this.length=0,this.vector.length=0},e.prototype.begin=function(){return new at(0,this.size,this.getElementByPos,this.setElementByPos)},e.prototype.end=function(){return new at(this.length,this.size,this.getElementByPos,this.setElementByPos)},e.prototype.rBegin=function(){return new at(this.length-1,this.size,this.getElementByPos,this.setElementByPos,A.REVERSE)},e.prototype.rEnd=function(){return new at(-1,this.size,this.getElementByPos,this.setElementByPos,A.REVERSE)},e.prototype.front=function(){return this.vector[0]},e.prototype.back=function(){return this.vector[this.length-1]},e.prototype.forEach=function(r){for(var i=0;i<this.length;++i)r(this.vector[i],i)},e.prototype.getElementByPos=function(r){return B(r,0,this.length-1),this.vector[r]},e.prototype.eraseElementByPos=function(r){B(r,0,this.length-1),this.vector.splice(r,1),this.length-=1},e.prototype.eraseElementByValue=function(r){for(var i=0,n=0;n<this.length;++n)this.vector[n]!==r&&(this.vector[i++]=this.vector[n]);this.length=this.vector.length=i},e.prototype.eraseElementByIterator=function(r){var i=r.node;return r=r.next(),this.eraseElementByPos(i),r},e.prototype.pushBack=function(r){this.vector.push(r),this.length+=1},e.prototype.popBack=function(){this.length&&(this.vector.pop(),this.length-=1)},e.prototype.setElementByPos=function(r,i){B(r,0,this.length-1),this.vector[r]=i},e.prototype.insert=function(r,i,n){var s;n===void 0&&(n=1),B(r,0,this.length),(s=this.vector).splice.apply(s,wo([r,0],bo(new Array(n).fill(i)),!1)),this.length+=n},e.prototype.find=function(r){for(var i=0;i<this.length;++i)if(this.vector[i]===r)return new at(i,this.size,this.getElementByPos,this.getElementByPos);return this.end()},e.prototype.reverse=function(){this.vector.reverse()},e.prototype.unique=function(){for(var r=1,i=1;i<this.length;++i)this.vector[i]!==this.vector[i-1]&&(this.vector[r++]=this.vector[i]);this.length=this.vector.length=r},e.prototype.sort=function(r){this.vector.sort(r)},e.prototype[Symbol.iterator]=function(){return function(){return eh(this,function(r){switch(r.label){case 0:return[5,th(this.vector)];case 1:return[2,r.sent()]}})}.bind(this)()},e})(Ue),M=rh});var Eo,ih,Kt,lt,nh,xo,To=U(()=>{"use strict";Ht();je();Y();Eo=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),ih=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Kt=(function(){function t(e){this.value=void 0,this.pre=void 0,this.next=void 0,this.value=e}return t})(),lt=(function(t){Eo(e,t);function e(r,i,n){var s=t.call(this,n)||this;return s.node=r,s.header=i,s.iteratorType===A.NORMAL?(s.pre=function(){if(this.node.pre===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre,this},s.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next,this}):(s.pre=function(){if(this.node.next===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next,this},s.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre,this}),s}return Object.defineProperty(e.prototype,"pointer",{get:function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node.value},set:function(r){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");this.node.value=r},enumerable:!1,configurable:!0}),e.prototype.equals=function(r){return this.node===r.node},e.prototype.copy=function(){return new e(this.node,this.header,this.iteratorType)},e})(A),nh=(function(t){Eo(e,t);function e(r){r===void 0&&(r=[]);var i=t.call(this)||this;return i.header=new Kt,i.head=void 0,i.tail=void 0,r.forEach(function(n){return i.pushBack(n)}),i}return e.prototype.clear=function(){this.length=0,this.head=this.tail=void 0,this.header.pre=this.header.next=void 0},e.prototype.begin=function(){return new lt(this.head||this.header,this.header)},e.prototype.end=function(){return new lt(this.header,this.header)},e.prototype.rBegin=function(){return new lt(this.tail||this.header,this.header,A.REVERSE)},e.prototype.rEnd=function(){return new lt(this.header,this.header,A.REVERSE)},e.prototype.front=function(){return this.head?this.head.value:void 0},e.prototype.back=function(){return this.tail?this.tail.value:void 0},e.prototype.forEach=function(r){if(this.length)for(var i=this.head,n=0;i!==this.header;)r(i.value,n++),i=i.next},e.prototype.getElementByPos=function(r){B(r,0,this.length-1);for(var i=this.head;r--;)i=i.next;return i.value},e.prototype.eraseElementByPos=function(r){if(B(r,0,this.length-1),r===0)this.popFront();else if(r===this.length-1)this.popBack();else{for(var i=this.head;r--;)i=i.next;i=i;var n=i.pre,s=i.next;s.pre=n,n.next=s,this.length-=1}},e.prototype.eraseElementByValue=function(r){for(;this.head&&this.head.value===r;)this.popFront();for(;this.tail&&this.tail.value===r;)this.popBack();if(this.head)for(var i=this.head;i!==this.header;){if(i.value===r){var n=i.pre,s=i.next;s&&(s.pre=n),n&&(n.next=s),this.length-=1}i=i.next}},e.prototype.eraseElementByIterator=function(r){var i=r.node;if(i===this.header)throw new RangeError("Invalid iterator");if(r=r.next(),this.head===i)this.popFront();else if(this.tail===i)this.popBack();else{var n=i.pre,s=i.next;s&&(s.pre=n),n&&(n.next=s),this.length-=1}return r},e.prototype.pushBack=function(r){this.length+=1;var i=new Kt(r);this.tail?(this.tail.next=i,i.pre=this.tail,this.tail=i):(this.head=this.tail=i,this.header.next=this.head,this.head.pre=this.header),this.tail.next=this.header,this.header.pre=this.tail},e.prototype.popBack=function(){this.tail&&(this.length-=1,this.head===this.tail?(this.head=this.tail=void 0,this.header.next=void 0):(this.tail=this.tail.pre,this.tail&&(this.tail.next=void 0)),this.header.pre=this.tail,this.tail&&(this.tail.next=this.header))},e.prototype.setElementByPos=function(r,i){B(r,0,this.length-1);for(var n=this.head;r--;)n=n.next;n.value=i},e.prototype.insert=function(r,i,n){if(n===void 0&&(n=1),B(r,0,this.length),!(n<=0))if(r===0)for(;n--;)this.pushFront(i);else if(r===this.length)for(;n--;)this.pushBack(i);else{for(var s=this.head,o=1;o<r;++o)s=s.next;var a=s.next;for(this.length+=n;n--;)s.next=new Kt(i),s.next.pre=s,s=s.next;s.next=a,a&&(a.pre=s)}},e.prototype.find=function(r){if(!this.head)return this.end();for(var i=this.head;i!==this.header;){if(i.value===r)return new lt(i,this.header);i=i.next}return this.end()},e.prototype.reverse=function(){if(!(this.length<=1))for(var r=this.head,i=this.tail,n=0;n<<1<this.length;){var s=r.value;r.value=i.value,i.value=s,r=r.next,i=i.pre,n+=1}},e.prototype.unique=function(){if(!(this.length<=1))for(var r=this.head;r!==this.header;){for(var i=r;i.next&&i.value===i.next.value;)i=i.next,this.length-=1;r.next=i.next,r.next&&(r.next.pre=r),r=r.next}},e.prototype.sort=function(r){if(!(this.length<=1)){var i=[];this.forEach(function(s){return i.push(s)}),i.sort(r);var n=this.head;i.forEach(function(s){n.value=s,n=n.next})}},e.prototype.pushFront=function(r){this.length+=1;var i=new Kt(r);this.head?(i.next=this.head,this.head.pre=i,this.head=i):(this.head=this.tail=i,this.tail.next=this.header,this.header.pre=this.tail),this.header.next=this.head,this.head.pre=this.header},e.prototype.popFront=function(){this.head&&(this.length-=1,this.head===this.tail?(this.head=this.tail=void 0,this.header.pre=this.tail):(this.head=this.head.next,this.head&&(this.head.pre=this.header)),this.header.next=this.head)},e.prototype.merge=function(r){var i=this;if(!this.head){r.forEach(function(s){return i.pushBack(s)});return}var n=this.head;r.forEach(function(s){for(;n&&n!==i.header&&n.value<=s;)n=n.next;if(n===i.header)i.pushBack(s),n=i.tail;else if(n===i.head)i.pushFront(s),n=i.head;else{i.length+=1;var o=n.pre;o.next=new Kt(s),o.next.pre=o,o.next.next=n,n.pre=o.next}})},e.prototype[Symbol.iterator]=function(){return function(){var r;return ih(this,function(i){switch(i.label){case 0:if(!this.head)return[2];r=this.head,i.label=1;case 1:return r===this.header?[3,3]:[4,r.value];case 2:return i.sent(),r=r.next,[3,1];case 3:return[2]}})}.bind(this)()},e})(Ue),xo=nh});var sh,w,Co=U(()=>{"use strict";sh=(function(){function t(e,r){this.color=!0,this.key=void 0,this.value=void 0,this.left=void 0,this.right=void 0,this.parent=void 0,this.key=e,this.value=r}return t.prototype.pre=function(){var e=this;if(e.color===t.RED&&e.parent.parent===e)e=e.right;else if(e.left)for(e=e.left;e.right;)e=e.right;else{for(var r=e.parent;r.left===e;)e=r,r=e.parent;e=r}return e},t.prototype.next=function(){var e=this;if(e.right)for(e=e.right;e.left;)e=e.left;else{for(var r=e.parent;r.right===e;)e=r,r=e.parent;e.right!==r&&(e=r)}return e},t.prototype.rotateLeft=function(){var e=this.parent,r=this.right,i=r.left;return e.parent===this?e.parent=r:e.left===this?e.left=r:e.right=r,r.parent=e,r.left=this,this.parent=r,this.right=i,i&&(i.parent=this),r},t.prototype.rotateRight=function(){var e=this.parent,r=this.left,i=r.right;return e.parent===this?e.parent=r:e.left===this?e.left=r:e.right=r,r.parent=e,r.right=this,this.parent=r,this.left=i,i&&(i.parent=this),r},t.prototype.remove=function(){var e=this.parent;this===e.left?e.left=void 0:e.right=void 0},t.RED=!0,t.BLACK=!1,t})(),w=sh});var oh,Po,ah,xt,Mr=U(()=>{"use strict";Co();Y();je();oh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),Po=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},ah=(function(t){oh(e,t);function e(r){r===void 0&&(r=function(n,s){return n<s?-1:n>s?1:0});var i=t.call(this)||this;return i.root=void 0,i.header=new w,i.inOrderTraversal=function(n,s){if(n===void 0)return!1;var o=i.inOrderTraversal(n.left,s);return o||s(n)?!0:i.inOrderTraversal(n.right,s)},i.cmp=r,i}return e.prototype._lowerBound=function(r,i){for(var n;r;){var s=this.cmp(r.key,i);if(s<0)r=r.right;else if(s>0)n=r,r=r.left;else return r}return n===void 0?this.header:n},e.prototype._upperBound=function(r,i){for(var n;r;){var s=this.cmp(r.key,i);s<=0?r=r.right:s>0&&(n=r,r=r.left)}return n===void 0?this.header:n},e.prototype._reverseLowerBound=function(r,i){for(var n;r;){var s=this.cmp(r.key,i);if(s<0)n=r,r=r.right;else if(s>0)r=r.left;else return r}return n===void 0?this.header:n},e.prototype._reverseUpperBound=function(r,i){for(var n;r;){var s=this.cmp(r.key,i);s<0?(n=r,r=r.right):s>=0&&(r=r.left)}return n===void 0?this.header:n},e.prototype.eraseNodeSelfBalance=function(r){for(;;){var i=r.parent;if(i===this.header)return;if(r.color===w.RED){r.color=w.BLACK;return}if(r===i.left){var n=i.right;if(n.color===w.RED)n.color=w.BLACK,i.color=w.RED,i===this.root?this.root=i.rotateLeft():i.rotateLeft();else if(n.color===w.BLACK)if(n.right&&n.right.color===w.RED){n.color=i.color,i.color=w.BLACK,n.right.color=w.BLACK,i===this.root?this.root=i.rotateLeft():i.rotateLeft();return}else n.left&&n.left.color===w.RED?(n.color=w.RED,n.left.color=w.BLACK,n.rotateRight()):(n.color=w.RED,r=i)}else{var n=i.left;if(n.color===w.RED)n.color=w.BLACK,i.color=w.RED,i===this.root?this.root=i.rotateRight():i.rotateRight();else if(n.left&&n.left.color===w.RED){n.color=i.color,i.color=w.BLACK,n.left.color=w.BLACK,i===this.root?this.root=i.rotateRight():i.rotateRight();return}else n.right&&n.right.color===w.RED?(n.color=w.RED,n.right.color=w.BLACK,n.rotateLeft()):(n.color=w.RED,r=i)}}},e.prototype.eraseNode=function(r){var i,n;if(this.length===1){this.clear();return}for(var s=r;s.left||s.right;){if(s.right)for(s=s.right;s.left;)s=s.left;else s.left&&(s=s.left);i=Po([s.key,r.key],2),r.key=i[0],s.key=i[1],n=Po([s.value,r.value],2),r.value=n[0],s.value=n[1],r=s}this.header.left===s?this.header.left=s.parent:this.header.right===s&&(this.header.right=s.parent),this.eraseNodeSelfBalance(s),s.remove(),this.length-=1,this.root.color=w.BLACK},e.prototype.insertNodeSelfBalance=function(r){for(;;){var i=r.parent;if(i.color===w.BLACK)return;var n=i.parent;if(i===n.left){var s=n.right;if(s&&s.color===w.RED){if(s.color=i.color=w.BLACK,n===this.root)return;n.color=w.RED,r=n;continue}else if(r===i.right){if(r.color=w.BLACK,r.left&&(r.left.parent=i),r.right&&(r.right.parent=n),i.right=r.left,n.left=r.right,r.left=i,r.right=n,n===this.root)this.root=r,this.header.parent=r;else{var o=n.parent;o.left===n?o.left=r:o.right=r}r.parent=n.parent,i.parent=r,n.parent=r}else i.color=w.BLACK,n===this.root?this.root=n.rotateRight():n.rotateRight();n.color=w.RED}else{var s=n.left;if(s&&s.color===w.RED){if(s.color=i.color=w.BLACK,n===this.root)return;n.color=w.RED,r=n;continue}else if(r===i.left){if(r.color=w.BLACK,r.left&&(r.left.parent=n),r.right&&(r.right.parent=i),n.right=r.left,i.left=r.right,r.left=n,r.right=i,n===this.root)this.root=r,this.header.parent=r;else{var o=n.parent;o.left===n?o.left=r:o.right=r}r.parent=n.parent,i.parent=r,n.parent=r}else i.color=w.BLACK,n===this.root?this.root=n.rotateLeft():n.rotateLeft();n.color=w.RED}return}},e.prototype.findElementNode=function(r,i){for(;r;){var n=this.cmp(r.key,i);if(n<0)r=r.right;else if(n>0)r=r.left;else return r}return r},e.prototype.set=function(r,i,n){if(this.root===void 0){this.length+=1,this.root=new w(r,i),this.root.color=w.BLACK,this.root.parent=this.header,this.header.parent=this.root,this.header.left=this.root,this.header.right=this.root;return}var s,o=this.header.left,a=this.cmp(o.key,r);if(a===0){o.value=i;return}else if(a>0)o.left=new w(r,i),o.left.parent=o,s=o.left,this.header.left=s;else{var u=this.header.right,l=this.cmp(u.key,r);if(l===0){u.value=i;return}else if(l<0)u.right=new w(r,i),u.right.parent=u,s=u.right,this.header.right=s;else{if(n!==void 0){var f=n.node;if(f!==this.header){var h=this.cmp(f.key,r);if(h===0){f.value=i;return}else if(h>0){var c=f.pre(),d=this.cmp(c.key,r);if(d===0){c.value=i;return}else d<0&&(s=new w(r,i),c.right===void 0?(c.right=s,s.parent=c):(f.left=s,s.parent=f))}}}if(s===void 0)for(s=this.root;;){var m=this.cmp(s.key,r);if(m>0){if(s.left===void 0){s.left=new w(r,i),s.left.parent=s,s=s.left;break}s=s.left}else if(m<0){if(s.right===void 0){s.right=new w(r,i),s.right.parent=s,s=s.right;break}s=s.right}else{s.value=i;return}}}}this.length+=1,this.insertNodeSelfBalance(s)},e.prototype.clear=function(){this.length=0,this.root=void 0,this.header.parent=void 0,this.header.left=this.header.right=void 0},e.prototype.updateKeyByIterator=function(r,i){var n=r.node;if(n===this.header)throw new TypeError("Invalid iterator!");if(this.length===1)return n.key=i,!0;if(n===this.header.left)return this.cmp(n.next().key,i)>0?(n.key=i,!0):!1;if(n===this.header.right)return this.cmp(n.pre().key,i)<0?(n.key=i,!0):!1;var s=n.pre().key;if(this.cmp(s,i)>=0)return!1;var o=n.next().key;return this.cmp(o,i)<=0?!1:(n.key=i,!0)},e.prototype.eraseElementByPos=function(r){var i=this;B(r,0,this.length-1);var n=0;this.inOrderTraversal(this.root,function(s){return r===n?(i.eraseNode(s),!0):(n+=1,!1)})},e.prototype.eraseElementByKey=function(r){if(this.length){var i=this.findElementNode(this.root,r);i!==void 0&&this.eraseNode(i)}},e.prototype.eraseElementByIterator=function(r){var i=r.node;if(i===this.header)throw new RangeError("Invalid iterator");return i.right===void 0&&(r=r.next()),this.eraseNode(i),r},e.prototype.getHeight=function(){if(!this.length)return 0;var r=function(i){return i?Math.max(r(i.left),r(i.right))+1:0};return r(this.root)},e})(Et),xt=ah});var lh,uh,qr,zi=U(()=>{"use strict";Y();lh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),uh=(function(t){lh(e,t);function e(r,i,n){var s=t.call(this,n)||this;return s.node=r,s.header=i,s.iteratorType===A.NORMAL?(s.pre=function(){if(this.node===this.header.left)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre(),this},s.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next(),this}):(s.pre=function(){if(this.node===this.header.right)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.next(),this},s.next=function(){if(this.node===this.header)throw new RangeError("LinkList iterator access denied!");return this.node=this.node.pre(),this}),s}return e.prototype.equals=function(r){return this.node===r.node},e})(A),qr=uh});var Oo,fh,Nr,fe,ch,Ce,$i=U(()=>{"use strict";Mr();Y();je();zi();Oo=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),fh=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Nr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fe=(function(t){Oo(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"pointer",{get:function(){if(this.node===this.header)throw new RangeError("OrderedSet iterator access denied!");return this.node.key},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.node,this.header,this.iteratorType)},e})(qr),ch=(function(t){Oo(e,t);function e(r,i){r===void 0&&(r=[]);var n=t.call(this,i)||this;return n.iterationFunc=function(s){return fh(this,function(o){switch(o.label){case 0:return s===void 0?[2]:[5,Nr(this.iterationFunc(s.left))];case 1:return o.sent(),[4,s.key];case 2:return o.sent(),[5,Nr(this.iterationFunc(s.right))];case 3:return o.sent(),[2]}})},r.forEach(function(s){return n.insert(s)}),n.iterationFunc=n.iterationFunc.bind(n),n}return e.prototype.begin=function(){return new fe(this.header.left||this.header,this.header)},e.prototype.end=function(){return new fe(this.header,this.header)},e.prototype.rBegin=function(){return new fe(this.header.right||this.header,this.header,A.REVERSE)},e.prototype.rEnd=function(){return new fe(this.header,this.header,A.REVERSE)},e.prototype.front=function(){return this.header.left?this.header.left.key:void 0},e.prototype.back=function(){return this.header.right?this.header.right.key:void 0},e.prototype.forEach=function(r){var i,n,s=0;try{for(var o=Nr(this),a=o.next();!a.done;a=o.next()){var u=a.value;r(u,s++)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}},e.prototype.getElementByPos=function(r){var i,n;B(r,0,this.length-1);var s,o=0;try{for(var a=Nr(this),u=a.next();!u.done;u=a.next()){var l=u.value;o===r&&(s=l),o+=1}}catch(f){i={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s},e.prototype.insert=function(r,i){this.set(r,void 0,i)},e.prototype.find=function(r){var i=this.findElementNode(this.root,r);return i!==void 0?new fe(i,this.header):this.end()},e.prototype.lowerBound=function(r){var i=this._lowerBound(this.root,r);return new fe(i,this.header)},e.prototype.upperBound=function(r){var i=this._upperBound(this.root,r);return new fe(i,this.header)},e.prototype.reverseLowerBound=function(r){var i=this._reverseLowerBound(this.root,r);return new fe(i,this.header)},e.prototype.reverseUpperBound=function(r){var i=this._reverseUpperBound(this.root,r);return new fe(i,this.header)},e.prototype.union=function(r){var i=this;r.forEach(function(n){return i.insert(n)})},e.prototype[Symbol.iterator]=function(){return this.iterationFunc(this.root)},e})(xt),Ce=ch});var Ro,hh,Io,Dr,ce,dh,he,Gi=U(()=>{"use strict";Y();je();Mr();zi();Ro=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),hh=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},Io=function(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,s=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s},Dr=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ce=(function(t){Ro(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return Object.defineProperty(e.prototype,"pointer",{get:function(){var r=this;if(this.node===this.header)throw new RangeError("OrderedMap iterator access denied");return new Proxy([],{get:function(i,n){if(n==="0")return r.node.key;if(n==="1")return r.node.value},set:function(i,n,s){if(n!=="1")throw new TypeError("props must be 1");return r.node.value=s,!0}})},enumerable:!1,configurable:!0}),e.prototype.copy=function(){return new e(this.node,this.header,this.iteratorType)},e})(qr),dh=(function(t){Ro(e,t);function e(r,i){r===void 0&&(r=[]);var n=t.call(this,i)||this;return n.iterationFunc=function(s){return hh(this,function(o){switch(o.label){case 0:return s===void 0?[2]:[5,Dr(this.iterationFunc(s.left))];case 1:return o.sent(),[4,[s.key,s.value]];case 2:return o.sent(),[5,Dr(this.iterationFunc(s.right))];case 3:return o.sent(),[2]}})},n.iterationFunc=n.iterationFunc.bind(n),r.forEach(function(s){var o=Io(s,2),a=o[0],u=o[1];return n.setElement(a,u)}),n}return e.prototype.begin=function(){return new ce(this.header.left||this.header,this.header)},e.prototype.end=function(){return new ce(this.header,this.header)},e.prototype.rBegin=function(){return new ce(this.header.right||this.header,this.header,A.REVERSE)},e.prototype.rEnd=function(){return new ce(this.header,this.header,A.REVERSE)},e.prototype.front=function(){if(this.length){var r=this.header.left;return[r.key,r.value]}},e.prototype.back=function(){if(this.length){var r=this.header.right;return[r.key,r.value]}},e.prototype.forEach=function(r){var i,n,s=0;try{for(var o=Dr(this),a=o.next();!a.done;a=o.next()){var u=a.value;r(u,s++)}}catch(l){i={error:l}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}},e.prototype.lowerBound=function(r){var i=this._lowerBound(this.root,r);return new ce(i,this.header)},e.prototype.upperBound=function(r){var i=this._upperBound(this.root,r);return new ce(i,this.header)},e.prototype.reverseLowerBound=function(r){var i=this._reverseLowerBound(this.root,r);return new ce(i,this.header)},e.prototype.reverseUpperBound=function(r){var i=this._reverseUpperBound(this.root,r);return new ce(i,this.header)},e.prototype.setElement=function(r,i,n){this.set(r,i,n)},e.prototype.find=function(r){var i=this.findElementNode(this.root,r);return i!==void 0?new ce(i,this.header):this.end()},e.prototype.getElementByKey=function(r){var i=this.findElementNode(this.root,r);return i?i.value:void 0},e.prototype.getElementByPos=function(r){var i,n;B(r,0,this.length-1);var s,o=0;try{for(var a=Dr(this),u=a.next();!u.done;u=a.next()){var l=u.value;if(o===r){s=l;break}o+=1}}catch(f){i={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return s},e.prototype.union=function(r){var i=this;r.forEach(function(n){var s=Io(n,2),o=s[0],a=s[1];return i.setElement(o,a)})},e.prototype[Symbol.iterator]=function(){return this.iterationFunc(this.root)},e})(xt),he=dh});var ph,gh,q,Ur=U(()=>{"use strict";Y();ph=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),gh=(function(t){ph(e,t);function e(r,i){r===void 0&&(r=16),i===void 0&&(i=function(s){var o;typeof s!="string"?o=JSON.stringify(s):o=s;for(var a=0,u=o.length,l=0;l<u;l++){var f=o.charCodeAt(l);a=(a<<5)-a+f,a|=0}return a>>>0});var n=t.call(this)||this;if(r<16||(r&r-1)!==0)throw new RangeError("InitBucketNum range error");return n.bucketNum=n.initBucketNum=r,n.hashFunc=i,n}return e.prototype.clear=function(){this.length=0,this.bucketNum=this.initBucketNum,this.hashTable=[]},e.sigma=.75,e.treeifyThreshold=8,e.untreeifyThreshold=6,e.minTreeifySize=64,e.maxBucketNum=1<<30,e})(Te),q=gh});var yh,_h,mh,vh,Ao,Bo=U(()=>{"use strict";Ur();Lr();$i();yh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),_h=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},mh=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vh=(function(t){yh(e,t);function e(r,i,n){r===void 0&&(r=[]);var s=t.call(this,i,n)||this;return s.hashTable=[],r.forEach(function(o){return s.insert(o)}),s}return e.prototype.reAllocate=function(){var r=this;if(!(this.bucketNum>=q.maxBucketNum)){var i=[],n=this.bucketNum;this.bucketNum<<=1;for(var s=Object.keys(this.hashTable),o=s.length,a=function(f){var h=parseInt(s[f]),c=u.hashTable[h],d=c.size();if(d===0)return"continue";if(d===1){var m=c.front();return i[u.hashFunc(m)&u.bucketNum-1]=new M([m],!1),"continue"}var y=[],v=[];c.forEach(function(b){var C=r.hashFunc(b);(C&n)===0?y.push(b):v.push(b)}),c instanceof Ce?(y.length>q.untreeifyThreshold?i[h]=new Ce(y):y.length&&(i[h]=new M(y,!1)),v.length>q.untreeifyThreshold?i[h+n]=new Ce(v):v.length&&(i[h+n]=new M(v,!1))):(y.length>=q.treeifyThreshold?i[h]=new Ce(y):y.length&&(i[h]=new M(y,!1)),v.length>=q.treeifyThreshold?i[h+n]=new Ce(v):v.length&&(i[h+n]=new M(v,!1)))},u=this,l=0;l<o;++l)a(l);this.hashTable=i}},e.prototype.forEach=function(r){for(var i=Object.values(this.hashTable),n=i.length,s=0,o=0;o<n;++o)i[o].forEach(function(a){return r(a,s++)})},e.prototype.insert=function(r){var i=this.hashFunc(r)&this.bucketNum-1,n=this.hashTable[i];if(!n)this.hashTable[i]=new M([r],!1),this.length+=1;else{var s=n.size();if(n instanceof M){if(!n.find(r).equals(n.end()))return;if(n.pushBack(r),s+1>=q.treeifyThreshold){if(this.bucketNum<=q.minTreeifySize){this.length+=1,this.reAllocate();return}this.hashTable[i]=new Ce(n)}this.length+=1}else{n.insert(r);var o=n.size();this.length+=o-s}}this.length>this.bucketNum*q.sigma&&this.reAllocate()},e.prototype.eraseElementByKey=function(r){var i=this.hashFunc(r)&this.bucketNum-1,n=this.hashTable[i];if(n){var s=n.size();if(s!==0)if(n instanceof M){n.eraseElementByValue(r);var o=n.size();this.length+=o-s}else{n.eraseElementByKey(r);var o=n.size();this.length+=o-s,o<=q.untreeifyThreshold&&(this.hashTable[i]=new M(n))}}},e.prototype.find=function(r){var i=this.hashFunc(r)&this.bucketNum-1,n=this.hashTable[i];return n?!n.find(r).equals(n.end()):!1},e.prototype[Symbol.iterator]=function(){return function(){var r,i,n,s,o,a,u,l,f,h;return _h(this,function(c){switch(c.label){case 0:r=Object.values(this.hashTable),i=r.length,n=0,c.label=1;case 1:if(!(n<i))return[3,10];s=r[n],c.label=2;case 2:c.trys.push([2,7,8,9]),o=(f=void 0,mh(s)),a=o.next(),c.label=3;case 3:return a.done?[3,6]:(u=a.value,[4,u]);case 4:c.sent(),c.label=5;case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return l=c.sent(),f={error:l},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(f)throw f.error}return[7];case 9:return++n,[3,1];case 10:return[2]}})}.bind(this)()},e})(q),Ao=vh});var bh,wh,zt,Sh,ko,Lo=U(()=>{"use strict";Ur();Lr();Gi();bh=(function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,n){i.__proto__=n}||function(i,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(i[s]=n[s])},t(e,r)};return function(e,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");t(e,r);function i(){this.constructor=e}e.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}})(),wh=function(t,e){var r={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,n,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(l){return function(f){return u([l,f])}}function u(l){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,n&&(s=l[0]&2?n.return:l[0]?n.throw||((s=n.return)&&s.call(n),0):n.next)&&!(s=s.call(n,l[1])).done)return s;switch(n=0,s&&(l=[l[0]&2,s.value]),l[0]){case 0:case 1:s=l;break;case 4:return r.label++,{value:l[1],done:!1};case 5:r.label++,n=l[1],l=[0];continue;case 7:l=r.ops.pop(),r.trys.pop();continue;default:if(s=r.trys,!(s=s.length>0&&s[s.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!s||l[1]>s[0]&&l[1]<s[3])){r.label=l[1];break}if(l[0]===6&&r.label<s[1]){r.label=s[1],s=l;break}if(s&&r.label<s[2]){r.label=s[2],r.ops.push(l);break}s[2]&&r.ops.pop(),r.trys.pop();continue}l=e.call(t,r)}catch(f){l=[6,f],n=0}finally{i=s=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}},zt=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Sh=(function(t){bh(e,t);function e(r,i,n){r===void 0&&(r=[]);var s=t.call(this,i,n)||this;return s.hashTable=[],r.forEach(function(o){return s.setElement(o[0],o[1])}),s}return e.prototype.reAllocate=function(){var r=this;if(!(this.bucketNum>=q.maxBucketNum)){var i=[],n=this.bucketNum;this.bucketNum<<=1;for(var s=Object.keys(this.hashTable),o=s.length,a=function(f){var h=parseInt(s[f]),c=u.hashTable[h],d=c.size();if(d===0)return"continue";if(d===1){var m=c.front();return i[u.hashFunc(m[0])&u.bucketNum-1]=new M([m],!1),"continue"}var y=[],v=[];c.forEach(function(b){var C=r.hashFunc(b[0]);(C&n)===0?y.push(b):v.push(b)}),c instanceof he?(y.length>q.untreeifyThreshold?i[h]=new he(y):y.length&&(i[h]=new M(y,!1)),v.length>q.untreeifyThreshold?i[h+n]=new he(v):v.length&&(i[h+n]=new M(v,!1))):(y.length>=q.treeifyThreshold?i[h]=new he(y):y.length&&(i[h]=new M(y,!1)),v.length>=q.treeifyThreshold?i[h+n]=new he(v):v.length&&(i[h+n]=new M(v,!1)))},u=this,l=0;l<o;++l)a(l);this.hashTable=i}},e.prototype.forEach=function(r){for(var i=Object.values(this.hashTable),n=i.length,s=0,o=0;o<n;++o)i[o].forEach(function(a){return r(a,s++)})},e.prototype.setElement=function(r,i){var n,s,o=this.hashFunc(r)&this.bucketNum-1,a=this.hashTable[o];if(!a)this.length+=1,this.hashTable[o]=new M([[r,i]],!1);else{var u=a.size();if(a instanceof M){try{for(var l=zt(a),f=l.next();!f.done;f=l.next()){var h=f.value;if(h[0]===r){h[1]=i;return}}}catch(d){n={error:d}}finally{try{f&&!f.done&&(s=l.return)&&s.call(l)}finally{if(n)throw n.error}}if(a.pushBack([r,i]),u+1>=e.treeifyThreshold){if(this.bucketNum<=e.minTreeifySize){this.length+=1,this.reAllocate();return}this.hashTable[o]=new he(this.hashTable[o])}this.length+=1}else{a.setElement(r,i);var c=a.size();this.length+=c-u}}this.length>this.bucketNum*e.sigma&&this.reAllocate()},e.prototype.getElementByKey=function(r){var i,n,s=this.hashFunc(r)&this.bucketNum-1,o=this.hashTable[s];if(o){if(o instanceof he)return o.getElementByKey(r);try{for(var a=zt(o),u=a.next();!u.done;u=a.next()){var l=u.value;if(l[0]===r)return l[1]}}catch(f){i={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}}},e.prototype.eraseElementByKey=function(r){var i,n,s=this.hashFunc(r)&this.bucketNum-1,o=this.hashTable[s];if(o)if(o instanceof M){var a=0;try{for(var u=zt(o),l=u.next();!l.done;l=u.next()){var f=l.value;if(f[0]===r){o.eraseElementByPos(a),this.length-=1;return}a+=1}}catch(d){i={error:d}}finally{try{l&&!l.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.error}}}else{var h=o.size();o.eraseElementByKey(r);var c=o.size();this.length+=c-h,c<=q.untreeifyThreshold&&(this.hashTable[s]=new M(o))}},e.prototype.find=function(r){var i,n,s=this.hashFunc(r)&this.bucketNum-1,o=this.hashTable[s];if(!o)return!1;if(o instanceof he)return!o.find(r).equals(o.end());try{for(var a=zt(o),u=a.next();!u.done;u=a.next()){var l=u.value;if(l[0]===r)return!0}}catch(f){i={error:f}}finally{try{u&&!u.done&&(n=a.return)&&n.call(a)}finally{if(i)throw i.error}}return!1},e.prototype[Symbol.iterator]=function(){return function(){var r,i,n,s,o,a,u,l,f,h;return wh(this,function(c){switch(c.label){case 0:r=Object.values(this.hashTable),i=r.length,n=0,c.label=1;case 1:if(!(n<i))return[3,10];s=r[n],c.label=2;case 2:c.trys.push([2,7,8,9]),o=(f=void 0,zt(s)),a=o.next(),c.label=3;case 3:return a.done?[3,6]:(u=a.value,[4,u]);case 4:c.sent(),c.label=5;case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return l=c.sent(),f={error:l},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(f)throw f.error}return[7];case 9:return++n,[3,1];case 10:return[2]}})}.bind(this)()},e})(q),ko=Sh});var Mo={};Gn(Mo,{Container:()=>Et,ContainerIterator:()=>A,Deque:()=>Br,DequeIterator:()=>ot,HashContainer:()=>q,HashMap:()=>ko,HashSet:()=>Ao,LinkList:()=>xo,LinkListIterator:()=>lt,OrderedMap:()=>he,OrderedMapIterator:()=>ce,OrderedSet:()=>Ce,OrderedSetIterator:()=>fe,PriorityQueue:()=>mo,Queue:()=>yo,SequentialContainer:()=>Ue,Stack:()=>ho,TreeContainer:()=>xt,Vector:()=>M,VectorIterator:()=>at});var qo=U(()=>{"use strict";po();_o();vo();Lr();To();Ki();$i();Gi();Bo();Lo();Y();Ht();Mr();Ur()});var Do=g((q_,No)=>{"use strict";var Tt=1e3,Ct=Tt*60,Pt=Ct*60,ut=Pt*24,Eh=ut*7,xh=ut*365.25;No.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return Th(t);if(r==="number"&&isFinite(t))return e.long?Ph(t):Ch(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Th(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*xh;case"weeks":case"week":case"w":return r*Eh;case"days":case"day":case"d":return r*ut;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Pt;case"minutes":case"minute":case"mins":case"min":case"m":return r*Ct;case"seconds":case"second":case"secs":case"sec":case"s":return r*Tt;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function Ch(t){var e=Math.abs(t);return e>=ut?Math.round(t/ut)+"d":e>=Pt?Math.round(t/Pt)+"h":e>=Ct?Math.round(t/Ct)+"m":e>=Tt?Math.round(t/Tt)+"s":t+"ms"}function Ph(t){var e=Math.abs(t);return e>=ut?jr(t,e,ut,"day"):e>=Pt?jr(t,e,Pt,"hour"):e>=Ct?jr(t,e,Ct,"minute"):e>=Tt?jr(t,e,Tt,"second"):t+" ms"}function jr(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var Qi=g((N_,Uo)=>{"use strict";function Oh(t){r.debug=r,r.default=r,r.coerce=u,r.disable=o,r.enable=n,r.enabled=a,r.humanize=Do(),r.destroy=l,Object.keys(t).forEach(f=>{r[f]=t[f]}),r.names=[],r.skips=[],r.formatters={};function e(f){let h=0;for(let c=0;c<f.length;c++)h=(h<<5)-h+f.charCodeAt(c),h|=0;return r.colors[Math.abs(h)%r.colors.length]}r.selectColor=e;function r(f){let h,c=null,d,m;function y(...v){if(!y.enabled)return;let b=y,C=Number(new Date),D=C-(h||C);b.diff=D,b.prev=h,b.curr=C,h=C,v[0]=r.coerce(v[0]),typeof v[0]!="string"&&v.unshift("%O");let K=0;v[0]=v[0].replace(/%([a-zA-Z%])/g,(Xe,Bt)=>{if(Xe==="%%")return"%";K++;let cr=r.formatters[Bt];if(typeof cr=="function"){let wu=v[K];Xe=cr.call(b,wu),v.splice(K,1),K--}return Xe}),r.formatArgs.call(b,v),(b.log||r.log).apply(b,v)}return y.namespace=f,y.useColors=r.useColors(),y.color=r.selectColor(f),y.extend=i,y.destroy=r.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>c!==null?c:(d!==r.namespaces&&(d=r.namespaces,m=r.enabled(f)),m),set:v=>{c=v}}),typeof r.init=="function"&&r.init(y),y}function i(f,h){let c=r(this.namespace+(typeof h>"u"?":":h)+f);return c.log=this.log,c}function n(f){r.save(f),r.namespaces=f,r.names=[],r.skips=[];let h=(typeof f=="string"?f:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let c of h)c[0]==="-"?r.skips.push(c.slice(1)):r.names.push(c)}function s(f,h){let c=0,d=0,m=-1,y=0;for(;c<f.length;)if(d<h.length&&(h[d]===f[c]||h[d]==="*"))h[d]==="*"?(m=d,y=c,d++):(c++,d++);else if(m!==-1)d=m+1,y++,c=y;else return!1;for(;d<h.length&&h[d]==="*";)d++;return d===h.length}function o(){let f=[...r.names,...r.skips.map(h=>"-"+h)].join(",");return r.enable(""),f}function a(f){for(let h of r.skips)if(s(f,h))return!1;for(let h of r.names)if(s(f,h))return!0;return!1}function u(f){return f instanceof Error?f.stack||f.message:f}function l(){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 r.enable(r.load()),r}Uo.exports=Oh});var jo=g((Z,Fr)=>{"use strict";Z.formatArgs=Rh;Z.save=Ah;Z.load=Bh;Z.useColors=Ih;Z.storage=kh();Z.destroy=(()=>{let t=!1;return()=>{t||(t=!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`."))}})();Z.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 Ih(){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 t;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&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Rh(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Fr.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,n=>{n!=="%%"&&(r++,n==="%c"&&(i=r))}),t.splice(i,0,e)}Z.log=console.debug||console.log||(()=>{});function Ah(t){try{t?Z.storage.setItem("debug",t):Z.storage.removeItem("debug")}catch{}}function Bh(){let t;try{t=Z.storage.getItem("debug")||Z.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function kh(){try{return localStorage}catch{}}Fr.exports=Qi()(Z);var{formatters:Lh}=Fr.exports;Lh.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Wo=g((D_,Fo)=>{"use strict";Fo.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}});var Ko=g((U_,Ho)=>{"use strict";var Mh=require("os"),Vo=require("tty"),oe=Wo(),{env:V}=process,Fe;oe("no-color")||oe("no-colors")||oe("color=false")||oe("color=never")?Fe=0:(oe("color")||oe("colors")||oe("color=true")||oe("color=always"))&&(Fe=1);"FORCE_COLOR"in V&&(V.FORCE_COLOR==="true"?Fe=1:V.FORCE_COLOR==="false"?Fe=0:Fe=V.FORCE_COLOR.length===0?1:Math.min(parseInt(V.FORCE_COLOR,10),3));function Yi(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Xi(t,e){if(Fe===0)return 0;if(oe("color=16m")||oe("color=full")||oe("color=truecolor"))return 3;if(oe("color=256"))return 2;if(t&&!e&&Fe===void 0)return 0;let r=Fe||0;if(V.TERM==="dumb")return r;if(process.platform==="win32"){let i=Mh.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in V)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in V)||V.CI_NAME==="codeship"?1:r;if("TEAMCITY_VERSION"in V)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(V.TEAMCITY_VERSION)?1:0;if(V.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in V){let i=parseInt((V.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(V.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(V.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(V.TERM)||"COLORTERM"in V?1:r}function qh(t){let e=Xi(t,t&&t.isTTY);return Yi(e)}Ho.exports={supportsColor:qh,stdout:Yi(Xi(!0,Vo.isatty(1))),stderr:Yi(Xi(!0,Vo.isatty(2)))}});var $o=g((H,Vr)=>{"use strict";var Nh=require("tty"),Wr=require("util");H.init=Hh;H.log=Fh;H.formatArgs=Uh;H.save=Wh;H.load=Vh;H.useColors=Dh;H.destroy=Wr.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");H.colors=[6,2,3,4,5,1];try{let t=Ko();t&&(t.stderr||t).level>=2&&(H.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}H.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let r=e.substring(6).toLowerCase().replace(/_([a-z])/g,(n,s)=>s.toUpperCase()),i=process.env[e];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),t[r]=i,t},{});function Dh(){return"colors"in H.inspectOpts?!!H.inspectOpts.colors:Nh.isatty(process.stderr.fd)}function Uh(t){let{namespace:e,useColors:r}=this;if(r){let i=this.color,n="\x1B[3"+(i<8?i:"8;5;"+i),s=` ${n};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
|
|
2
2
|
`).join(`
|
|
3
3
|
`+s),t.push(n+"m+"+Vr.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=jh()+e+" "+t[0]}function jh(){return H.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Fh(...t){return process.stderr.write(Wr.formatWithOptions(H.inspectOpts,...t)+`
|
|
4
4
|
`)}function Wh(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function Vh(){return process.env.DEBUG}function Hh(t){t.inspectOpts={};let e=Object.keys(H.inspectOpts);for(let r=0;r<e.length;r++)t.inspectOpts[e[r]]=H.inspectOpts[e[r]]}Vr.exports=Qi()(H);var{formatters:zo}=Vr.exports;zo.o=function(t){return this.inspectOpts.colors=this.useColors,Wr.inspect(t,this.inspectOpts).split(`
|
|
@@ -8,11 +8,11 @@
|
|
|
8
8
|
`+Object.keys(i).map(n=>`${n}: ${i[n]}`).join(`\r
|
|
9
9
|
`)+`\r
|
|
10
10
|
\r
|
|
11
|
-
`+r)),t.removeListener("error",Kn),t.destroy()}function Cg(t){return t.trim()}});var tu=g((km,eu)=>{"use strict";var nr=Wn();nr.createWebSocketStream=Gl();nr.Server=Zl();nr.Receiver=In();nr.Sender=An();eu.exports=nr});var $n=g((Lm,zn)=>{"use strict";var{Buffer:sr}=require("buffer"),ru=tu(),or=_e()("mqttjs:ws"),Pg=ei(),Og=Ne().Transform,Ig=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],iu=typeof process<"u"&&process.title==="browser"||typeof __webpack_require__=="function";function nu(t,e){let r=t.protocol+"://"+t.hostname+":"+t.port+t.path;return typeof t.transformWsUrl=="function"&&(r=t.transformWsUrl(r,t,e)),r}function su(t){let e=t;return t.hostname||(e.hostname="localhost"),t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!iu&&t.protocol==="wss"&&Ig.forEach(function(r){Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r])}),e}function Rg(t){let e=su(t);if(e.hostname||(e.hostname=e.host),!e.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let r=new URL(document.URL);e.hostname=r.hostname,e.port||(e.port=r.port)}return e.objectMode===void 0&&(e.objectMode=!(e.binary===!0||e.binary===void 0)),e}function Ag(t,e,r){or("createWebSocket"),or("protocol: "+r.protocolId+" "+r.protocolVersion);let i=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";return or("creating new Websocket for url: "+e+" and protocol: "+i),new ru(e,[i],r.wsOptions)}function Bg(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",i=nu(e,t),n=new WebSocket(i,[r]);return n.binaryType="arraybuffer",n}function kg(t,e){or("streamBuilder");let r=su(e),i=nu(r,t),n=Ag(t,i,r),s=ru.createWebSocketStream(n,r.wsOptions);return s.url=i,n.on("close",()=>{s.destroy()}),s}function Lg(t,e){or("browserStreamBuilder");let r,n=Rg(e).browserBufferSize||1024*512,s=e.browserBufferTimeout||1e3,o=!e.objectMode,a=Bg(t,e),u=f(e,v,b);e.objectMode||(u._writev=y),u.on("close",()=>{a.close()});let l=typeof a.addEventListener<"u";a.readyState===a.OPEN?r=u:(r=r=Pg(void 0,void 0,e),e.objectMode||(r._writev=y),l?a.addEventListener("open",h):a.onopen=h),r.socket=a,l?(a.addEventListener("close",c),a.addEventListener("error",d),a.addEventListener("message",m)):(a.onclose=c,a.onerror=d,a.onmessage=m);function f(C,D,K){let F=new Og({objectModeMode:C.objectMode});return F._write=D,F._flush=K,F}function h(){r.setReadable(u),r.setWritable(u),r.emit("connect")}function c(){r.end(),r.destroy()}function d(C){r.destroy(C)}function m(C){let D=C.data;D instanceof ArrayBuffer?D=sr.from(D):D=sr.from(D,"utf8"),u.push(D)}function y(C,D){let K=new Array(C.length);for(let F=0;F<C.length;F++)typeof C[F].chunk=="string"?K[F]=sr.from(C[F],"utf8"):K[F]=C[F].chunk;this._write(sr.concat(K),"binary",D)}function v(C,D,K){a.bufferedAmount>n&&setTimeout(v,s,C,D,K),o&&typeof C=="string"&&(C=sr.from(C,"utf8"));try{a.send(C)}catch(F){return K(F)}K()}function b(C){a.close(),C()}return r}iu?zn.exports=Lg:zn.exports=kg});var uu=g((Mm,ar)=>{"use strict";var au=dn(),Mg=Ir(),qg=require("url"),Ng=dr(),ou=_e()("mqttjs"),Z={};typeof process<"u"&&process.title!=="browser"||typeof __webpack_require__!="function"?(Z.mqtt=pn(),Z.tcp=pn(),Z.ssl=Xr(),Z.tls=Xr(),Z.mqtts=Xr()):(Z.wx=_n(),Z.wxs=_n(),Z.ali=vn(),Z.alis=vn());Z.ws=$n();Z.wss=$n();function Dg(t){let e;t.auth&&(e=t.auth.match(/^(.+):(.+)$/),e?(t.username=e[1],t.password=e[2]):t.username=t.auth)}function lu(t,e){if(ou("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=null),e=e||{},t){let n=qg.parse(t,!0);if(n.port!=null&&(n.port=Number(n.port)),e=Ng(n,e),e.protocol===null)throw new Error("Missing protocol");e.protocol=e.protocol.replace(/:$/,"")}if(Dg(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),e.cert&&e.key)if(e.protocol){if(["mqtts","wss","wxs","alis"].indexOf(e.protocol)===-1)switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;case"ali":e.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+e.protocol+'"!')}}else throw new Error("Missing secure protocol key");if(!Z[e.protocol]){let n=["mqtts","wss"].indexOf(e.protocol)!==-1;e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(s,o){return n&&o%2===0?!1:typeof Z[s]=="function"})[0]}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function r(n){return e.servers&&((!n._reconnectCount||n._reconnectCount===e.servers.length)&&(n._reconnectCount=0),e.host=e.servers[n._reconnectCount].host,e.port=e.servers[n._reconnectCount].port,e.protocol=e.servers[n._reconnectCount].protocol?e.servers[n._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,n._reconnectCount++),ou("calling streambuilder for",e.protocol),Z[e.protocol](n,e)}let i=new au(r,e);return i.on("error",function(){}),i}ar.exports=lu;ar.exports.connect=lu;ar.exports.MqttClient=au;ar.exports.Store=Mg});var cu=g((qm,fu)=>{"use strict";var Ug=Zi().NumberAllocator;function Ye(){if(!(this instanceof Ye))return new Ye;this.numberAllocator=new Ug(1,65535)}Ye.prototype.allocate=function(){return this.lastId=this.numberAllocator.alloc(),this.lastId};Ye.prototype.getLastAllocated=function(){return this.lastId};Ye.prototype.register=function(t){return this.numberAllocator.use(t)};Ye.prototype.deallocate=function(t){this.numberAllocator.free(t)};Ye.prototype.clear=function(){this.numberAllocator.clear()};fu.exports=Ye});var du=g((Nm,pt)=>{"use strict";var hu=dn(),jg=uu(),Fg=Ir(),Wg=fn(),Vg=cu();pt.exports.connect=jg;pt.exports.MqttClient=hu;pt.exports.Client=hu;pt.exports.Store=Fg;pt.exports.DefaultMessageIdProvider=Wg;pt.exports.UniqueMessageIdProvider=Vg});var Gg={};Gn(Gg,{default:()=>li});module.exports=Yn(Gg);var vu=ui(require("async-mqtt"),1),pv=ui(du(),1),bu=require("vestaboard-api");var pu=require("fs"),gu=require("fs"),yu=require("path"),{readFile:Hg,writeFile:Kg}=gu.promises,ee=class t{static currentData={};static currentFetch;static file=(0,yu.join)(process.env.HOME||"~",".vestaboard2mqtt");namespace;constructor(e){this.namespace=e}static async fetch(){if(this.currentFetch)return this.currentFetch;let e=this.fetchFromFile();return this.currentFetch=e,e}static async fetchFromFile(){if((0,pu.existsSync)(this.file))try{let e=await Hg(this.file,{encoding:"utf8"});this.currentData=JSON.parse(e)}catch(e){console.warn(`Unable to parse cache file: ${e}`)}}static isCacheItemObject(e){return e!==null&&typeof e=="object"&&"updated"in e&&typeof e.updated=="number"&&"value"in e&&typeof e.value<"u"}static async save(){await Kg(this.file,JSON.stringify(this.currentData,null," "))}async delete(e){!t.currentData||!t.currentData[this.namespace]||(delete t.currentData[this.namespace][e],Object.keys(t.currentData[this.namespace]).length===0&&delete t.currentData[this.namespace],await t.save().catch(r=>{console.warn(`Unable to update cache: ${r}`)}))}async get(e,r=0){if(await t.fetch(),!t.currentData||!t.currentData[this.namespace]||!t.currentData[this.namespace][e])return null;let i=t.currentData[this.namespace][e];return!t.isCacheItemObject(i)&&r>0?null:t.isCacheItemObject(i)?r>0&&new Date().getTime()-i.updated>r?null:i.value:i}async set(e,r){if(await t.fetch(),!t.currentData)throw new Error("Unable to set value: currentData is empty!");t.currentData[this.namespace]=t.currentData[this.namespace]||{},t.currentData[this.namespace][e]={updated:new Date().getTime(),value:r},await t.save().catch(i=>{console.warn(`Unable to update cache: ${i}`)})}};var k=class{static get board(){if(this.loaded&&this.data?.board)return this.data.board;throw new Error("Unable to access board config, is config loaded?")}static get calendar(){if(this.loaded&&this.data?.calendar)return this.data.calendar;throw new Error("Unable to access calendar config, is config loaded?")}static get loaded(){return!!this.data&&!!this.cache}static get mqtt(){if(this.loaded&&this.data?.mqtt)return this.data.mqtt;throw new Error("Unable to access mqtt config, is config loaded?")}static cache=new ee("config");static data;static async load(){let e=await this.cache.get("default");if(!e)throw new Error("Unable to load configuration, try to run the setup script\u2026");this.data=e}static async save(e){this.data=e,await this.cache.set("default",e)}static async updateDisabled(e){e===this.data?.board.disabled||!this.loaded||!this.data?.mqtt||(this.data.board.disabled=e,await this.save(this.data))}};var Ae=require("vestaboard-api/lib/cjs/values.js");var zg=[["\xE4",[1,5]],["\xC4",[1,5]],["\xF6",[15,5]],["\xD6",[15,5]],["\xFC",[21,5]],["\xDC",[21,5]],["\xDF",[19,19]],["\u{1F7E5}",[63]],["\u{1F7E7}",[64]],["\u{1F7E8}",[65]],["\u{1F7E9}",[66]],["\u{1F7E6}",[67]],["\u{1F7EA}",[68]],["\u2B1C\uFE0F",[69]],["\u2B1C",[69]],["\u2B1B\uFE0F",[0]],["\u2B1B",[0]],["\uFE6B",[38]],["\uFF20",[38]],["0\uFE0F\u20E3",[36]],["1\uFE0F\u20E3",[27]],["2\uFE0F\u20E3",[28]],["3\uFE0F\u20E3",[29]],["4\uFE0F\u20E3",[30]],["5\uFE0F\u20E3",[31]],["6\uFE0F\u20E3",[32]],["7\uFE0F\u20E3",[33]],["8\uFE0F\u20E3",[34]],["9\uFE0F\u20E3",[35]],["\u2755",[37]],["\u203C\uFE0F",[37,37]],["\u2757\uFE0F",[37]],["\u2049\uFE0F",[37,60]],["\u26A0\uFE0F",[65]],["#\uFE0F\u20E3",[39]],["\u{1F4B8}",[40]],["\u{1F4B2}",[40]],["\u{1F4B5}",[40]],["\u{1F4B0}",[40]],["$",[40]],["\uFE69",[40]],["\uFF04",[40]],["\u2190",[44]],["\u2192",[44]],["\u27A1",[44]],["\u2B05",[44]],["\u2794",[44]],["\u2194",[44]],["\u2013",[44]],["\u2795",[46]],["+",[46]],["\uFE6A",[54]],["\uFF05",[54]],["\u2753",[60]],["\u2754",[60]],["\u2103",[62,3]],["\u2109",[62,6]]],pe=class t{board;currentLine=null;isFilled=!1;constructor(e=t.newBoardCharArray()){this.board=e}static char2char(e){let r=Object.entries(Ae.characterCode).find(([n])=>e===n);if(r)return[r[1]];let i=zg.find(([n])=>e===n);return i&&Array.isArray(i[1])?i[1]:[60]}static charToString(e){let r=Object.entries(Ae.characterCode).filter(([i])=>i.length<=2).find(([,i])=>i===e);if(r)return r[0].toUpperCase()+" ";switch(e){case 63:return"\u{1F7E5}";case 64:return"\u{1F7E7}";case 65:return"\u{1F7E8}";case 66:return"\u{1F7E9}";case 67:return"\u{1F7E6}";case 68:return"\u{1F7EA}";case 69:return"\u2B1C\uFE0F";default:return" "}}static newBoardCharArray(){return JSON.parse(JSON.stringify(Ae.emptyBoard))}static word2chars(e){let r=[];for(let i of e)r.push(...this.char2char(i));return r}center(){let e=[this.board.findIndex(i=>i.find(n=>n!==0)),Math.min(...this.board.map(i=>i.find(n=>n!==0)?i.slice().reverse().findIndex(n=>n!==0):i.length)),this.board.slice().reverse().findIndex(i=>i.find(n=>n!==0)),Math.min(...this.board.map(i=>i.find(n=>n!==0)?i.findIndex(n=>n!==0):i.length))],r=[Math.floor((e[0]+e[2])/2),Math.floor((e[1]+e[3])/2)];if(e[0]!==r[0]){let i=r[0]-e[0];this.board.splice(e[0]<r[0]?0:this.board.length-i,0,...this.board.splice(this.board.length-i,i))}if(e[3]!==r[1]){let i=r[1]-e[3];this.board.forEach(n=>{n.splice(e[3]<r[1]?0:n.length-i,0,...n.splice(n.length-i,i))})}}centerLines(){this.board.forEach(e=>{let r=[e.findIndex(s=>s!==0),e.slice().reverse().findIndex(s=>s!==0)];if(r[0]===-1||r[1]===-1)return;let i=e.slice(r[0],e.length-r[1]),n=Math.floor((r[0]+r[1])/2);e.fill(0,0,n),e.splice(n,i.length,...i),e.fill(0,n+i.length)})}export(){return this.board}isEmpty(){return!this.board.find(e=>e.find(r=>r!==0))}repeat(e,r={}){this.board[r.line||0].fill(t.char2char(e)[0])}toString(){return"#="+"=".repeat(Ae.LINE_LENGTH*2)+`=#
|
|
11
|
+
`+r)),t.removeListener("error",Kn),t.destroy()}function Cg(t){return t.trim()}});var tu=g((km,eu)=>{"use strict";var nr=Wn();nr.createWebSocketStream=Gl();nr.Server=Zl();nr.Receiver=In();nr.Sender=An();eu.exports=nr});var $n=g((Lm,zn)=>{"use strict";var{Buffer:sr}=require("buffer"),ru=tu(),or=_e()("mqttjs:ws"),Pg=ei(),Og=Ne().Transform,Ig=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],iu=typeof process<"u"&&process.title==="browser"||typeof __webpack_require__=="function";function nu(t,e){let r=t.protocol+"://"+t.hostname+":"+t.port+t.path;return typeof t.transformWsUrl=="function"&&(r=t.transformWsUrl(r,t,e)),r}function su(t){let e=t;return t.hostname||(e.hostname="localhost"),t.port||(t.protocol==="wss"?e.port=443:e.port=80),t.path||(e.path="/"),t.wsOptions||(e.wsOptions={}),!iu&&t.protocol==="wss"&&Ig.forEach(function(r){Object.prototype.hasOwnProperty.call(t,r)&&!Object.prototype.hasOwnProperty.call(t.wsOptions,r)&&(e.wsOptions[r]=t[r])}),e}function Rg(t){let e=su(t);if(e.hostname||(e.hostname=e.host),!e.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let r=new URL(document.URL);e.hostname=r.hostname,e.port||(e.port=r.port)}return e.objectMode===void 0&&(e.objectMode=!(e.binary===!0||e.binary===void 0)),e}function Ag(t,e,r){or("createWebSocket"),or("protocol: "+r.protocolId+" "+r.protocolVersion);let i=r.protocolId==="MQIsdp"&&r.protocolVersion===3?"mqttv3.1":"mqtt";return or("creating new Websocket for url: "+e+" and protocol: "+i),new ru(e,[i],r.wsOptions)}function Bg(t,e){let r=e.protocolId==="MQIsdp"&&e.protocolVersion===3?"mqttv3.1":"mqtt",i=nu(e,t),n=new WebSocket(i,[r]);return n.binaryType="arraybuffer",n}function kg(t,e){or("streamBuilder");let r=su(e),i=nu(r,t),n=Ag(t,i,r),s=ru.createWebSocketStream(n,r.wsOptions);return s.url=i,n.on("close",()=>{s.destroy()}),s}function Lg(t,e){or("browserStreamBuilder");let r,n=Rg(e).browserBufferSize||1024*512,s=e.browserBufferTimeout||1e3,o=!e.objectMode,a=Bg(t,e),u=f(e,v,b);e.objectMode||(u._writev=y),u.on("close",()=>{a.close()});let l=typeof a.addEventListener<"u";a.readyState===a.OPEN?r=u:(r=r=Pg(void 0,void 0,e),e.objectMode||(r._writev=y),l?a.addEventListener("open",h):a.onopen=h),r.socket=a,l?(a.addEventListener("close",c),a.addEventListener("error",d),a.addEventListener("message",m)):(a.onclose=c,a.onerror=d,a.onmessage=m);function f(C,D,K){let F=new Og({objectModeMode:C.objectMode});return F._write=D,F._flush=K,F}function h(){r.setReadable(u),r.setWritable(u),r.emit("connect")}function c(){r.end(),r.destroy()}function d(C){r.destroy(C)}function m(C){let D=C.data;D instanceof ArrayBuffer?D=sr.from(D):D=sr.from(D,"utf8"),u.push(D)}function y(C,D){let K=new Array(C.length);for(let F=0;F<C.length;F++)typeof C[F].chunk=="string"?K[F]=sr.from(C[F],"utf8"):K[F]=C[F].chunk;this._write(sr.concat(K),"binary",D)}function v(C,D,K){a.bufferedAmount>n&&setTimeout(v,s,C,D,K),o&&typeof C=="string"&&(C=sr.from(C,"utf8"));try{a.send(C)}catch(F){return K(F)}K()}function b(C){a.close(),C()}return r}iu?zn.exports=Lg:zn.exports=kg});var uu=g((Mm,ar)=>{"use strict";var au=dn(),Mg=Ir(),qg=require("url"),Ng=dr(),ou=_e()("mqttjs"),ee={};typeof process<"u"&&process.title!=="browser"||typeof __webpack_require__!="function"?(ee.mqtt=pn(),ee.tcp=pn(),ee.ssl=Xr(),ee.tls=Xr(),ee.mqtts=Xr()):(ee.wx=_n(),ee.wxs=_n(),ee.ali=vn(),ee.alis=vn());ee.ws=$n();ee.wss=$n();function Dg(t){let e;t.auth&&(e=t.auth.match(/^(.+):(.+)$/),e?(t.username=e[1],t.password=e[2]):t.username=t.auth)}function lu(t,e){if(ou("connecting to an MQTT broker..."),typeof t=="object"&&!e&&(e=t,t=null),e=e||{},t){let n=qg.parse(t,!0);if(n.port!=null&&(n.port=Number(n.port)),e=Ng(n,e),e.protocol===null)throw new Error("Missing protocol");e.protocol=e.protocol.replace(/:$/,"")}if(Dg(e),e.query&&typeof e.query.clientId=="string"&&(e.clientId=e.query.clientId),e.cert&&e.key)if(e.protocol){if(["mqtts","wss","wxs","alis"].indexOf(e.protocol)===-1)switch(e.protocol){case"mqtt":e.protocol="mqtts";break;case"ws":e.protocol="wss";break;case"wx":e.protocol="wxs";break;case"ali":e.protocol="alis";break;default:throw new Error('Unknown protocol for secure connection: "'+e.protocol+'"!')}}else throw new Error("Missing secure protocol key");if(!ee[e.protocol]){let n=["mqtts","wss"].indexOf(e.protocol)!==-1;e.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter(function(s,o){return n&&o%2===0?!1:typeof ee[s]=="function"})[0]}if(e.clean===!1&&!e.clientId)throw new Error("Missing clientId for unclean clients");e.protocol&&(e.defaultProtocol=e.protocol);function r(n){return e.servers&&((!n._reconnectCount||n._reconnectCount===e.servers.length)&&(n._reconnectCount=0),e.host=e.servers[n._reconnectCount].host,e.port=e.servers[n._reconnectCount].port,e.protocol=e.servers[n._reconnectCount].protocol?e.servers[n._reconnectCount].protocol:e.defaultProtocol,e.hostname=e.host,n._reconnectCount++),ou("calling streambuilder for",e.protocol),ee[e.protocol](n,e)}let i=new au(r,e);return i.on("error",function(){}),i}ar.exports=lu;ar.exports.connect=lu;ar.exports.MqttClient=au;ar.exports.Store=Mg});var cu=g((qm,fu)=>{"use strict";var Ug=Zi().NumberAllocator;function Ye(){if(!(this instanceof Ye))return new Ye;this.numberAllocator=new Ug(1,65535)}Ye.prototype.allocate=function(){return this.lastId=this.numberAllocator.alloc(),this.lastId};Ye.prototype.getLastAllocated=function(){return this.lastId};Ye.prototype.register=function(t){return this.numberAllocator.use(t)};Ye.prototype.deallocate=function(t){this.numberAllocator.free(t)};Ye.prototype.clear=function(){this.numberAllocator.clear()};fu.exports=Ye});var du=g((Nm,pt)=>{"use strict";var hu=dn(),jg=uu(),Fg=Ir(),Wg=fn(),Vg=cu();pt.exports.connect=jg;pt.exports.MqttClient=hu;pt.exports.Client=hu;pt.exports.Store=Fg;pt.exports.DefaultMessageIdProvider=Wg;pt.exports.UniqueMessageIdProvider=Vg});var Gg={};Gn(Gg,{default:()=>li});module.exports=Yn(Gg);var vu=ui(require("async-mqtt"),1),pv=ui(du(),1),bu=require("vestaboard-api");var pu=require("fs"),gu=require("fs"),yu=require("path"),{readFile:Hg,writeFile:Kg}=gu.promises,te=class t{static currentData={};static currentFetch;static file=(0,yu.join)(process.env.HOME||"~",".vestaboard2mqtt");namespace;constructor(e){this.namespace=e}static async fetch(){if(this.currentFetch)return this.currentFetch;let e=this.fetchFromFile();return this.currentFetch=e,e}static async fetchFromFile(){if((0,pu.existsSync)(this.file))try{let e=await Hg(this.file,{encoding:"utf8"});this.currentData=JSON.parse(e)}catch(e){console.warn(`Unable to parse cache file: ${e}`)}}static isCacheItemObject(e){return e!==null&&typeof e=="object"&&"updated"in e&&typeof e.updated=="number"&&"value"in e&&typeof e.value<"u"}static async save(){await Kg(this.file,JSON.stringify(this.currentData,null," "))}async delete(e){!t.currentData||!t.currentData[this.namespace]||(delete t.currentData[this.namespace][e],Object.keys(t.currentData[this.namespace]).length===0&&delete t.currentData[this.namespace],await t.save().catch(r=>{console.warn(`Unable to update cache: ${r}`)}))}async get(e,r=0){if(await t.fetch(),!t.currentData||!t.currentData[this.namespace]||!t.currentData[this.namespace][e])return null;let i=t.currentData[this.namespace][e];return!t.isCacheItemObject(i)&&r>0?null:t.isCacheItemObject(i)?r>0&&new Date().getTime()-i.updated>r?null:i.value:i}async set(e,r){if(await t.fetch(),!t.currentData)throw new Error("Unable to set value: currentData is empty!");t.currentData[this.namespace]=t.currentData[this.namespace]||{},t.currentData[this.namespace][e]={updated:new Date().getTime(),value:r},await t.save().catch(i=>{console.warn(`Unable to update cache: ${i}`)})}};var k=class{static get board(){if(this.loaded&&this.data?.board)return this.data.board;throw new Error("Unable to access board config, is config loaded?")}static get calendar(){if(this.loaded&&this.data?.calendar)return this.data.calendar;throw new Error("Unable to access calendar config, is config loaded?")}static get loaded(){return!!this.data&&!!this.cache}static get mqtt(){if(this.loaded&&this.data?.mqtt)return this.data.mqtt;throw new Error("Unable to access mqtt config, is config loaded?")}static cache=new te("config");static data;static async load(){let e=await this.cache.get("default");if(!e)throw new Error("Unable to load configuration, try to run the setup script\u2026");this.data=e}static async save(e){this.data=e,await this.cache.set("default",e)}static async updateDisabled(e){e===this.data?.board.disabled||!this.loaded||!this.data?.mqtt||(this.data.board.disabled=e,await this.save(this.data))}};var Ae=require("vestaboard-api/lib/cjs/values.js");var zg=[["\xE4",[1,5]],["\xC4",[1,5]],["\xF6",[15,5]],["\xD6",[15,5]],["\xFC",[21,5]],["\xDC",[21,5]],["\xDF",[19,19]],["\u{1F7E5}",[63]],["\u{1F7E7}",[64]],["\u{1F7E8}",[65]],["\u{1F7E9}",[66]],["\u{1F7E6}",[67]],["\u{1F7EA}",[68]],["\u2B1C\uFE0F",[69]],["\u2B1C",[69]],["\u2B1B\uFE0F",[0]],["\u2B1B",[0]],["\uFE6B",[38]],["\uFF20",[38]],["0\uFE0F\u20E3",[36]],["1\uFE0F\u20E3",[27]],["2\uFE0F\u20E3",[28]],["3\uFE0F\u20E3",[29]],["4\uFE0F\u20E3",[30]],["5\uFE0F\u20E3",[31]],["6\uFE0F\u20E3",[32]],["7\uFE0F\u20E3",[33]],["8\uFE0F\u20E3",[34]],["9\uFE0F\u20E3",[35]],["\u2755",[37]],["\u203C\uFE0F",[37,37]],["\u2757\uFE0F",[37]],["\u2049\uFE0F",[37,60]],["\u26A0\uFE0F",[65]],["#\uFE0F\u20E3",[39]],["\u{1F4B8}",[40]],["\u{1F4B2}",[40]],["\u{1F4B5}",[40]],["\u{1F4B0}",[40]],["$",[40]],["\uFE69",[40]],["\uFF04",[40]],["\u2190",[44]],["\u2192",[44]],["\u27A1",[44]],["\u2B05",[44]],["\u2794",[44]],["\u2194",[44]],["\u2013",[44]],["\u2795",[46]],["+",[46]],["\uFE6A",[54]],["\uFF05",[54]],["\u2753",[60]],["\u2754",[60]],["\u2103",[62,3]],["\u2109",[62,6]]],pe=class t{board;currentLine=null;isFilled=!1;constructor(e=t.newBoardCharArray()){this.board=e}static char2char(e){let r=Object.entries(Ae.characterCode).find(([n])=>e===n);if(r)return[r[1]];let i=zg.find(([n])=>e===n);return i&&Array.isArray(i[1])?i[1]:[60]}static charToString(e){let r=Object.entries(Ae.characterCode).filter(([i])=>i.length<=2).find(([,i])=>i===e);if(r)return r[0].toUpperCase()+" ";switch(e){case 63:return"\u{1F7E5}";case 64:return"\u{1F7E7}";case 65:return"\u{1F7E8}";case 66:return"\u{1F7E9}";case 67:return"\u{1F7E6}";case 68:return"\u{1F7EA}";case 69:return"\u2B1C\uFE0F";default:return" "}}static newBoardCharArray(){return JSON.parse(JSON.stringify(Ae.emptyBoard))}static word2chars(e){let r=[];for(let i of e)r.push(...this.char2char(i));return r}center(){let e=[this.board.findIndex(i=>i.find(n=>n!==0)),Math.min(...this.board.map(i=>i.find(n=>n!==0)?i.slice().reverse().findIndex(n=>n!==0):i.length)),this.board.slice().reverse().findIndex(i=>i.find(n=>n!==0)),Math.min(...this.board.map(i=>i.find(n=>n!==0)?i.findIndex(n=>n!==0):i.length))],r=[Math.floor((e[0]+e[2])/2),Math.floor((e[1]+e[3])/2)];if(e[0]!==r[0]){let i=r[0]-e[0];this.board.splice(e[0]<r[0]?0:this.board.length-i,0,...this.board.splice(this.board.length-i,i))}if(e[3]!==r[1]){let i=r[1]-e[3];this.board.forEach(n=>{n.splice(e[3]<r[1]?0:n.length-i,0,...n.splice(n.length-i,i))})}}centerLines(){this.board.forEach(e=>{let r=[e.findIndex(s=>s!==0),e.slice().reverse().findIndex(s=>s!==0)];if(r[0]===-1||r[1]===-1)return;let i=e.slice(r[0],e.length-r[1]),n=Math.floor((r[0]+r[1])/2);e.fill(0,0,n),e.splice(n,i.length,...i),e.fill(0,n+i.length)})}export(){return this.board}isEmpty(){return!this.board.find(e=>e.find(r=>r!==0))}repeat(e,r={}){this.board[r.line||0].fill(t.char2char(e)[0])}toString(){return"#="+"=".repeat(Ae.LINE_LENGTH*2)+`=#
|
|
12
12
|
`+this.board.map(e=>"# "+e.map(r=>t.charToString(r)).join("")+` #
|
|
13
13
|
`).join("")+"#="+"=".repeat(Ae.LINE_LENGTH*2)+`=#
|
|
14
|
-
`}write(e,r={}){let i=0;if(this.isFilled)return;if(r.line==="CURRENT")i=this.currentLine||0;else if(r.line==="NEXT"&&this.currentLine===null)this.currentLine=0,i=this.currentLine;else if(r.line==="NEXT"&&typeof this.currentLine=="number"&&this.currentLine<this.board.length-1)this.currentLine++,i=this.currentLine;else if(r.line==="NEXT"){this.isFilled=!0;return}else r.line!==void 0&&(i=r.line);let n={firstLine:i,firstRow:r.row||0,lastLine:this.board.length-1,lastRow:Ae.LINE_LENGTH-1},s=[n.firstRow,n.firstLine];e.split(/\s+/).forEach((a,u)=>{u!==0&&s[0]!==n.firstRow&&(this.board[s[1]][s[0]]=0,s[0]++);let l=n.lastRow-s[0]+1,f=t.word2chars(a);f.filter(h=>h===60).length===f.length&&f.length>0||(f.length>l&&f.length<=n.lastRow-n.firstRow+1&&s[1]<n.lastLine&&(s[0]=n.firstRow,s[1]++,l=n.lastRow-s[0]),f.length<=l?(this.board[s[1]].splice(s[0],f.length,...f),s[0]+=f.length):f.length>l&&l>5&&(this.board[s[1]].splice(s[0],l,...f.slice(0,l)),s[0]+=l))}),this.currentLine=s[1]}};var mu=ui(require("node-ical"),1);var gt=class{static cache=new
|
|
15
|
-
`).forEach(i=>{r.write(i,{line:"NEXT"})}),r.centerLines(),r.center(),{message:r}}};var $g={calendar:new lr,message:new ur,today:new gt},fr=$g;var li=class t{board;currentMessage;currentTimer;mqtt;pageConfig=new
|
|
14
|
+
`}write(e,r={}){let i=0;if(this.isFilled)return;if(r.line==="CURRENT")i=this.currentLine||0;else if(r.line==="NEXT"&&this.currentLine===null)this.currentLine=0,i=this.currentLine;else if(r.line==="NEXT"&&typeof this.currentLine=="number"&&this.currentLine<this.board.length-1)this.currentLine++,i=this.currentLine;else if(r.line==="NEXT"){this.isFilled=!0;return}else r.line!==void 0&&(i=r.line);let n={firstLine:i,firstRow:r.row||0,lastLine:this.board.length-1,lastRow:Ae.LINE_LENGTH-1},s=[n.firstRow,n.firstLine];e.split(/\s+/).forEach((a,u)=>{u!==0&&s[0]!==n.firstRow&&(this.board[s[1]][s[0]]=0,s[0]++);let l=n.lastRow-s[0]+1,f=t.word2chars(a);f.filter(h=>h===60).length===f.length&&f.length>0||(f.length>l&&f.length<=n.lastRow-n.firstRow+1&&s[1]<n.lastLine&&(s[0]=n.firstRow,s[1]++,l=n.lastRow-s[0]),f.length<=l?(this.board[s[1]].splice(s[0],f.length,...f),s[0]+=f.length):f.length>l&&l>5&&(this.board[s[1]].splice(s[0],l,...f.slice(0,l)),s[0]+=l))}),this.currentLine=s[1]}};var mu=ui(require("node-ical"),1);var gt=class{static cache=new te("calendar");parseConfig(e,r,i){let n={};return console.log("parseConfig",i),e==="min-temp"&&Array.isArray(i.temp)?n.temp=[parseInt(r||""),Math.max(...i.temp)]:e==="min-temp"?n.temp=[parseInt(r||""),parseInt(r||"")]:e==="max-temp"&&Array.isArray(i.temp)?n.temp=[Math.min(...i.temp),parseInt(r||"")]:e==="max-temp"?n.temp=[parseInt(r||""),parseInt(r||"")]:e==="precip"?n.precip=parseInt(r||"",10):e==="locale"&&(n.locale=String(r)),n}parsePayload(e){try{return JSON.parse(e||"")}catch{return{}}}async render(e,r){let i=new pe,n=new Date,s=Object.assign({locale:"en",precip:void 0,temp:void 0},r,e);i.write(n.toLocaleString(s.locale,{weekday:"long"})),i.write(n.toLocaleString(s.locale,{day:"numeric",month:"long"}),{line:"NEXT"}),i.write("",{line:"NEXT"});let o=[];Array.isArray(s.temp)&&o.push(`${Math.min(...s.temp)}-${Math.max(...s.temp)}\xB0C`),typeof s.precip=="number"&&s.precip>0&&o.push(`${s.precip}%`),o.length&&i.write(o.join(", "),{line:"NEXT"}),i.center();let a=new Date;return a.setHours(24,0,0,0),{message:i,validTill:a}}};var lr=class t{static cache=new te("calendar");static getTimeStr(e,r=!1){return this.isMidnight(e.start)&&this.isMidnight(e.end)&&this.isSameDay(new Date,e.start)?"Heute":this.isMidnight(e.start)&&this.isMidnight(e.end)&&this.isSameDay(new Date(new Date().getTime()+1e3*60*60*24),e.start)?r?"Morgen":"Morgn":e.start.getHours().toString().padStart(2,"\u2B1B\uFE0F")+":"+e.start.getMinutes().toString().padStart(2,"0")}static isMidnight(e){return!e.getHours()&&!e.getMinutes()&&!e.getSeconds()&&!e.getMilliseconds()}static isSameDay(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}async fetchURL(e){let r=await t.cache.get(e,6e5);if(!r){let i=await mu.default.async.fromURL(e);r=Object.values(i).filter(s=>s.type==="VEVENT"&&s.start&&s.end&&s.summary).map(s=>({end:new Date(String(s.end)),start:new Date(String(s.start)),summary:String(s.summary).trim()})).filter(s=>s.end>new Date).sort((s,o)=>s.end.getTime()-o.end.getTime()).slice(0,6),await t.cache.set(e,r)}return r.map(i=>({end:new Date(String(i.end)),start:new Date(String(i.start)),summary:String(i.summary)})).filter(i=>i.end>new Date)}async fetchURLs(e){let r=await Promise.all(e.map(i=>this.fetchURL(i)));return[].concat(...r).filter(i=>i.end>new Date).sort((i,n)=>i.end.getTime()-n.end.getTime())}parseConfig(){return{}}parsePayload(e){return{calendars:(e||"").split(",")}}async render(e){let r=new pe,i=e.calendars.map(o=>k.calendar.urls[o]).filter(Boolean),n=await this.fetchURLs(i).then(o=>o.filter(a=>t.isMidnight(a.start)&&t.isMidnight(a.end)?t.isSameDay(new Date,a.start)||new Date().getHours()>=20&&t.isSameDay(new Date(new Date().getTime()+1e3*60*60*24),a.start):a.start<new Date(new Date().getTime()+1e3*60*60*12)));if(!n.length){let o=new gt,u=await new te("page-config").get("today");return o.render({},u||{})}let s=new Date(new Date().getTime()+1e3*60*10);return n.forEach(o=>{r.write(t.getTimeStr(o,n.length===1),{line:"NEXT"}),r.write(o.summary,{line:"CURRENT",row:6}),r.write("",{line:"NEXT"}),o.end<s&&(s=o.end)}),r.center(),{message:r,validTill:s}}};var ur=class{static cache=new te("calendar");parseConfig(){return{}}parsePayload(e){return e||""}async render(e){let r=new pe;return e.split(`
|
|
15
|
+
`).forEach(i=>{r.write(i,{line:"NEXT"})}),r.centerLines(),r.center(),{message:r}}};var $g={calendar:new lr,message:new ur,today:new gt},fr=$g;var li=class t{board;currentMessage;currentTimer;mqtt;pageConfig=new te("page-config");subscriptionIds;constructor(){this.board=new bu.Vesta({apiKey:k.board.key,apiSecret:k.board.secret}),this.mqtt=vu.default.connect(k.mqtt.url,{will:{payload:"offline",qos:0,retain:!0,topic:k.mqtt.prefix+"/status"}}),this.mqtt.on("connect",()=>{this.mqtt.publish(k.mqtt.prefix+"/status","online",{retain:!0}),this.setupBrokerSubscriptions().catch(e=>{console.error(new Error(`Unable to setup mqtt subscriptions: ${e.stack}`)),process.exit(1)})}),this.mqtt.on("message",(e,r)=>{this.handleMessage(e,r.toString()).catch(i=>{this.debug(`Unable to handle message: ${i.stack}`)})})}static async run(){return await k.load(),new t}debug(e){let r=String(e);this.mqtt.publish(k.mqtt.prefix+"/debug",r),console.log(r)}async handleMessage(e,r){if(![k.mqtt.prefix+"/debug",k.mqtt.prefix+"/status"].includes(e))if(e===k.mqtt.prefix+"/disabled"){let i=["1","true","TRUE"].includes(r);await k.updateDisabled(i),i||(this.debug("Board not disabled anymore, update with latest message"),await this.updateCurrentMessage())}else if(Object.keys(fr).map(i=>k.mqtt.prefix+"/"+i).includes(e)){let i=fr[e.substr(k.mqtt.prefix.length+1)];await this.renderMessage(i,r)}else{let i=Object.entries(fr).find(([u])=>e.startsWith(k.mqtt.prefix+"/"+u+"/"));if(!i){this.debug(`Unknown topic ${e}, I'm sorry`);return}let n=e.substr((k.mqtt.prefix+"/"+i[0]+"/").length),s=await this.pageConfig.get(i[0]),o=i[1].parseConfig(n,r,s||{}),a=Object.assign(s||{},o);await this.pageConfig.set(i[0],a),await this.updateCurrentMessage(),this.debug(`Update config for page module ${i[0]}: ${JSON.stringify(a,null," ")}`)}}async renderMessage(e,r){this.currentMessage={page:e,payload:r};let i=Object.entries(fr).find(([,a])=>a===e);if(k.board.disabled||!i)return;let n=await e.parsePayload(r),s=await this.pageConfig.get(i[0]),o=await e.render(n,s||{});o.message&&await this.sendMessage(o.message),this.currentTimer&&(clearTimeout(this.currentTimer),delete this.currentTimer),o.validTill&&(this.debug(`Set timer for ${o.validTill.toString()} to update message`),this.currentTimer=setTimeout(()=>{this.debug("Here I am again, updating the message now\u2026"),this.renderMessage(e,r).catch(a=>{this.debug(`Unable to update page: ${a}`)})},o.validTill.getTime()-new Date().getTime()))}async sendMessage(e=new pe){let r=e.export();if(!this.subscriptionIds){let i=await this.board.getSubscriptions();this.subscriptionIds=i.map(n=>n._id)}this.debug(`Sending Message:
|
|
16
16
|
|
|
17
17
|
`+e.toString()),await Promise.all(this.subscriptionIds.map(i=>this.board.postMessage(i,r)))}async setupBrokerSubscriptions(){if(!this.mqtt)throw new Error("Unable to setup subscriptions: client not set.");await this.mqtt.subscribe(k.mqtt.prefix+"/#")}async updateCurrentMessage(){this.currentMessage&&await this.renderMessage(this.currentMessage.page,this.currentMessage.payload)}};
|
|
18
18
|
/*! Bundled license information:
|