@blackglory/structures 0.10.18 → 0.10.20

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/README.md CHANGED
@@ -277,6 +277,7 @@ class SparseMap<T> {
277
277
  ```ts
278
278
  class DynamicTypedArray<T extends TypedArrayConstructor> {
279
279
  get [Symbol.toStringTag](): string
280
+ get BYTES_PER_ELEMENT(): number
280
281
  get capacity(): number
281
282
  get length(): number
282
283
  readonly growthFactor: number
@@ -1,4 +1,4 @@
1
- class t{constructor(t){this.value=t}get[Symbol.toStringTag](){return this.constructor.name}set(t){this.value=t}get(){return this.value}}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n={},r={};function i(t){return Array.isArray(t)}r.isntEmptyArray=r.isEmptyArray=r.isntArray=r.isArray=void 0,r.isArray=i,r.isntArray=function(t){return!i(t)},r.isEmptyArray=function(t){return 0===t.length},r.isntEmptyArray=function(t){return 0!==t.length};var o={},s={};function a(t){return null===t}s.isntNull=s.isNull=void 0,s.isNull=a,s.isntNull=function(t){return!a(t)};var u={};function c(t){return void 0===t}u.isntUndefined=u.isUndefined=void 0,u.isUndefined=c,u.isntUndefined=function(t){return!c(t)};var l={};function h(t){return"function"==typeof t}l.isntFunction=l.isFunction=void 0,l.isFunction=h,l.isntFunction=function(t){return!h(t)},o.isntAsyncIterable=o.isAsyncIterable=void 0;const f=s,d=u,y=l;function p(t){return(0,f.isntNull)(t)&&(0,d.isntUndefined)(t)&&(0,y.isFunction)(t[Symbol.asyncIterator])}o.isAsyncIterable=p,o.isntAsyncIterable=function(t){return!p(t)};var v={};function m(t){return"bigint"==typeof t}v.isntBigInt=v.isBigInt=void 0,v.isBigInt=m,v.isntBigInt=function(t){return!m(t)};var b={};function g(t){return"boolean"==typeof t}b.isntBoolean=b.isBoolean=void 0,b.isBoolean=g,b.isntBoolean=function(t){return!g(t)};var w={},x={};function T(t){return"string"==typeof t}x.isntString=x.isString=void 0,x.isString=T,x.isntString=function(t){return!T(t)},w.isntChar=w.isChar=void 0;const _=x;function A(t){return(0,_.isString)(t)&&1===t.length}w.isChar=A,w.isntChar=function(t){return!A(t)};var S={};function I(t){return t instanceof Date}S.isntDate=S.isDate=void 0,S.isDate=I,S.isntDate=function(t){return!I(t)};var E={};E.inEnum=void 0,E.inEnum=function(t,e){return Object.values(e).includes(t)};var O={};function P(t){return t instanceof Error}O.isntError=O.isError=void 0,O.isError=P,O.isntError=function(t){return!P(t)};var j={};function k(t){return!t}j.isntFalsy=j.isFalsy=void 0,j.isFalsy=k,j.isntFalsy=function(t){return!k(t)};var N={};N.isntIterable=N.isIterable=void 0;const M=s,B=u,C=l;function z(t){return(0,M.isntNull)(t)&&(0,B.isntUndefined)(t)&&(0,C.isFunction)(t[Symbol.iterator])}N.isIterable=z,N.isntIterable=function(t){return!z(t)};var F={},q={};function V(t){return"number"==typeof t}function D(t){return Number.isNaN(t)}q.isntNaN=q.isNaN=q.isNegativeInfinity=q.isPositiveInfinity=q.isFinite=q.isntNumber=q.isNumber=void 0,q.isNumber=V,q.isntNumber=function(t){return!V(t)},q.isFinite=function(t){return Number.isFinite(t)},q.isPositiveInfinity=function(t){return t===1/0},q.isNegativeInfinity=function(t){return t===-1/0},q.isNaN=D,q.isntNaN=function(t){return!D(t)};var U={},R="object"==typeof e&&e&&e.Object===Object&&e,K="object"==typeof self&&self&&self.Object===Object&&self,L=(R||K||Function("return this")()).Symbol,J=L,W=Object.prototype,Y=W.hasOwnProperty,$=W.toString,H=J?J.toStringTag:void 0;var X=function(t){var e=Y.call(t,H),n=t[H];try{t[H]=void 0;var r=!0}catch(t){}var i=$.call(t);return r&&(e?t[H]=n:delete t[H]),i},G=Object.prototype.toString;var Q=X,Z=function(t){return G.call(t)},tt=L?L.toStringTag:void 0;var et=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":tt&&tt in Object(t)?Q(t):Z(t)};var nt=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var rt=et,it=nt,ot=function(t){return null!=t&&"object"==typeof t},st=Function.prototype,at=Object.prototype,ut=st.toString,ct=at.hasOwnProperty,lt=ut.call(Object);var ht=function(t){if(!ot(t)||"[object Object]"!=rt(t))return!1;var e=it(t);if(null===e)return!0;var n=ct.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ut.call(n)==lt},ft=e&&e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};U.isntEmptyObject=U.isEmptyObject=U.isntPlainObject=U.isPlainObject=U.isntObject=U.isObject=void 0;const dt=ft(ht);function yt(t){return null!==t&&"object"==typeof t}function pt(t){return(0,dt.default)(t)}U.isObject=yt,U.isntObject=function(t){return!yt(t)},U.isPlainObject=pt,U.isntPlainObject=function(t){return!pt(t)},U.isEmptyObject=function(t){return 0===Object.keys(t).length},U.isntEmptyObject=function(t){return 0!==Object.keys(t).length},F.isntJsonable=F.isJsonable=F.isntJson=F.isJson=void 0;const vt=s,mt=b,bt=x,gt=q,wt=r,xt=U;function Tt(t){return(0,vt.isNull)(t)||(0,mt.isBoolean)(t)||(0,bt.isString)(t)||(0,gt.isNumber)(t)||(0,wt.isArray)(t)&&t.every(Tt)||(0,xt.isPlainObject)(t)&&Object.values(t).every(Tt)}F.isJson=Tt,F.isntJson=function(t){return!Tt(t)},F.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},F.isntJsonable=function t(e){return!t()};var _t={};_t.isPromiseLike=_t.isntPromiseLike=_t.isntPromise=_t.isPromise=void 0;const At=U,St=l;function It(t){return t instanceof Promise}function Et(t){return(0,At.isObject)(t)&&(0,St.isFunction)(t.then)}_t.isPromise=It,_t.isntPromise=function(t){return!It(t)},_t.isntPromiseLike=function(t){return!Et(t)},_t.isPromiseLike=Et;var Ot={};Ot.isAbsoluteURL=void 0,Ot.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var Pt={};function jt(t){return t instanceof RegExp}Pt.isntRegExp=Pt.isRegExp=void 0,Pt.isRegExp=jt,Pt.isntRegExp=function(t){return!jt(t)};var kt,Nt,Mt,Bt={};function Ct(t){return"symbol"==typeof t}function zt([t,e]){return n.isNull(e)?[t]:[t,...zt(e)]}function Ft([t,...e]){return[t,e.length?Ft(e):null]}function qt(t,e){return t.slice(0,e)}function Vt(t,e){const n=t.length-e;return t.slice(n>=0?n:0)}function Dt(t,e){t.length>e&&(t.length=e)}function Ut(t,e){const n=t.length-e;t.splice(0,n)}Bt.isntSymbol=Bt.isSymbol=void 0,Bt.isSymbol=Ct,Bt.isntSymbol=function(t){return!Ct(t)},kt=n,Nt=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),(Mt=e&&e.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||Nt(e,t,n)})(r,kt),Mt(o,kt),Mt(v,kt),Mt(b,kt),Mt(w,kt),Mt(S,kt),Mt(E,kt),Mt(O,kt),Mt(j,kt),Mt(l,kt),Mt(N,kt),Mt(F,kt),Mt(s,kt),Mt(q,kt),Mt(U,kt),Mt(_t,kt),Mt(x,kt),Mt(u,kt),Mt(Ot,kt),Mt(Pt,kt),Mt(Bt,kt);class Rt{constructor(){this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}on(t,e){this.map.has(t)||this.map.set(t,new Set);return this.map.get(t).add(n),()=>{if(!this.map.has(t))return;const e=this.map.get(t);e.delete(n),0===e.size&&this.map.delete(t)};function n(...t){e(...t)}}once(t,e){const n=this.on(t,((...t)=>{e(...t),n()}));return n}emit(t,...e){this.map.has(t)&&this.map.get(t).forEach((t=>t(...e)))}}class Kt{constructor(t){this.hash=t,this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e){return this.map.set(this.hash(t),e),this}has(t){return this.map.has(this.hash(t))}get(t){return this.map.get(this.hash(t))}delete(t){return this.map.delete(this.hash(t))}clear(){this.map.clear()}}class Lt{constructor(t){this.hash=t,this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}[Symbol.iterator](){return this.map.values()}add(t){return this.map.set(this.hash(t),t),this}delete(t){return this.map.delete(this.hash(t))}has(t){return this.map.has(this.hash(t))}clear(){this.map.clear()}values(){return this.map.values()}}class Jt{constructor(){this.items=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.items.length}empty(){this.items.length=0}enqueue(...t){this.items.push(...t)}dequeue(){return this.items.shift()}remove(t){let e;for(;(e=this.items.indexOf(t))>=0;)this.items.splice(e,1)}}var Wt={},Yt={},$t={},Ht={},Xt={},Gt={},Qt={};Qt.go=void 0,Qt.go=function(t){return t()};var Zt={};Zt.goMicrotask=void 0,Zt.goMicrotask=function(t){return new Promise(((e,n)=>{queueMicrotask((async()=>{try{e(await t())}catch(t){n(t)}}))}))};var te={},ee={},ne={},re={},ie={};ie.random=void 0,ie.random=function(t,e){return Math.random()*(e-t)+t};var oe={};oe.randomInt=void 0,oe.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var se={};se.randomIntInclusive=void 0,se.randomIntInclusive=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(ie,t),r(oe,t),r(se,t)}(re),ne.calculateExponentialBackoffTimeout=void 0;const ae=re;ne.calculateExponentialBackoffTimeout=function({baseTimeout:t,retries:e,maxTimeout:n=1/0,factor:r=2,jitter:i=!0}){const o=Math.min(r**e*t,n);return i?(0,ae.randomIntInclusive)(0,o):o};var ue={};ue.setTimeout=void 0,ue.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var ce={setSchedule:void 0};const le=ue;ce.setSchedule=function(t,e){const n=t-Date.now();return(0,le.setTimeout)(n,e)};var he={};he.setInterval=void 0,he.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var fe={setImmediate:void 0};const de=ue;fe.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,de.setTimeout)(0,t)};var ye={setTimeoutLoop:void 0};const pe=ue;ye.setTimeoutLoop=function(t,e){let n=!1,r=(0,pe.setTimeout)(t,(async function i(){await e(),n||(r=(0,pe.setTimeout)(t,i))}));return()=>{n=!0,r()}};var ve={setDynamicTimeoutLoop:void 0};const me=ue;ve.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,me.setTimeout)(t,(async function i(){const o=Date.now();await e();const s=Date.now()-o;n||(r=(0,me.setTimeout)(Math.max(t-s,0),i))}));return()=>{n=!0,r()}},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(ne,t),r(ue,t),r(ce,t),r(he,t),r(fe,t),r(ye,t),r(ve,t)}(ee),te.goMacrotask=void 0;const be=ee;var ge;te.goMacrotask=function(t){return new Promise(((e,n)=>{(0,be.setImmediate)((async()=>{try{e(await t())}catch(t){n(t)}}))}))},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(Qt,t),r(Zt,t),r(te,t)}(Gt);var we={},xe={},Te={};function _e(t){return Array.isArray(t)}Te.isntEmptyArray=Te.isEmptyArray=Te.isntArray=Te.isArray=void 0,Te.isArray=_e,Te.isntArray=function(t){return!_e(t)},Te.isEmptyArray=function(t){return 0===t.length},Te.isntEmptyArray=function(t){return 0!==t.length};var Ae={},Se={};function Ie(t){return null===t}Se.isntNull=Se.isNull=void 0,Se.isNull=Ie,Se.isntNull=function(t){return!Ie(t)};var Ee={};function Oe(t){return void 0===t}Ee.isntUndefined=Ee.isUndefined=void 0,Ee.isUndefined=Oe,Ee.isntUndefined=function(t){return!Oe(t)};var Pe={};function je(t){return"function"==typeof t}Pe.isntFunction=Pe.isFunction=void 0,Pe.isFunction=je,Pe.isntFunction=function(t){return!je(t)},Ae.isntAsyncIterable=Ae.isAsyncIterable=void 0;const ke=Se,Ne=Ee,Me=Pe;function Be(t){return(0,ke.isntNull)(t)&&(0,Ne.isntUndefined)(t)&&(0,Me.isFunction)(t[Symbol.asyncIterator])}Ae.isAsyncIterable=Be,Ae.isntAsyncIterable=function(t){return!Be(t)};var Ce={};function ze(t){return"bigint"==typeof t}Ce.isntBigInt=Ce.isBigInt=void 0,Ce.isBigInt=ze,Ce.isntBigInt=function(t){return!ze(t)};var Fe={};function qe(t){return"boolean"==typeof t}Fe.isntBoolean=Fe.isBoolean=void 0,Fe.isBoolean=qe,Fe.isntBoolean=function(t){return!qe(t)};var Ve={},De={};function Ue(t){return"string"==typeof t}De.isntString=De.isString=void 0,De.isString=Ue,De.isntString=function(t){return!Ue(t)},Ve.isntChar=Ve.isChar=void 0;const Re=De;function Ke(t){return(0,Re.isString)(t)&&1===t.length}Ve.isChar=Ke,Ve.isntChar=function(t){return!Ke(t)};var Le={};function Je(t){return t instanceof Date}Le.isntDate=Le.isDate=void 0,Le.isDate=Je,Le.isntDate=function(t){return!Je(t)};var We={};We.inEnum=void 0,We.inEnum=function(t,e){return Object.values(e).includes(t)};var Ye={};function $e(t){return t instanceof Error}Ye.isntError=Ye.isError=void 0,Ye.isError=$e,Ye.isntError=function(t){return!$e(t)};var He={};function Xe(t){return!t}He.isntFalsy=He.isFalsy=void 0,He.isFalsy=Xe,He.isntFalsy=function(t){return!Xe(t)};var Ge={};Ge.isntIterable=Ge.isIterable=void 0;const Qe=Se,Ze=Ee,tn=Pe;function en(t){return(0,Qe.isntNull)(t)&&(0,Ze.isntUndefined)(t)&&(0,tn.isFunction)(t[Symbol.iterator])}Ge.isIterable=en,Ge.isntIterable=function(t){return!en(t)};var nn={},rn={};function on(t){return"number"==typeof t}function sn(t){return Number.isNaN(t)}rn.isntNaN=rn.isNaN=rn.isNegativeInfinity=rn.isPositiveInfinity=rn.isFinite=rn.isntNumber=rn.isNumber=void 0,rn.isNumber=on,rn.isntNumber=function(t){return!on(t)},rn.isFinite=function(t){return Number.isFinite(t)},rn.isPositiveInfinity=function(t){return t===1/0},rn.isNegativeInfinity=function(t){return t===-1/0},rn.isNaN=sn,rn.isntNaN=function(t){return!sn(t)};var an={},un=e&&e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};an.isntEmptyObject=an.isEmptyObject=an.isntPlainObject=an.isPlainObject=an.isntObject=an.isObject=void 0;const cn=un(ht);function ln(t){return null!==t&&"object"==typeof t}function hn(t){return(0,cn.default)(t)}an.isObject=ln,an.isntObject=function(t){return!ln(t)},an.isPlainObject=hn,an.isntPlainObject=function(t){return!hn(t)},an.isEmptyObject=function(t){return 0===Object.keys(t).length},an.isntEmptyObject=function(t){return 0!==Object.keys(t).length},nn.isntJsonable=nn.isJsonable=nn.isntJson=nn.isJson=void 0;const fn=Se,dn=Fe,yn=De,pn=rn,vn=Te,mn=an;function bn(t){return(0,fn.isNull)(t)||(0,dn.isBoolean)(t)||(0,yn.isString)(t)||(0,pn.isNumber)(t)||(0,vn.isArray)(t)&&t.every(bn)||(0,mn.isPlainObject)(t)&&Object.values(t).every(bn)}nn.isJson=bn,nn.isntJson=function(t){return!bn(t)},nn.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},nn.isntJsonable=function t(e){return!t()};var gn={};gn.isPromiseLike=gn.isntPromiseLike=gn.isntPromise=gn.isPromise=void 0;const wn=an,xn=Pe;function Tn(t){return t instanceof Promise}function _n(t){return(0,wn.isObject)(t)&&(0,xn.isFunction)(t.then)}gn.isPromise=Tn,gn.isntPromise=function(t){return!Tn(t)},gn.isntPromiseLike=function(t){return!_n(t)},gn.isPromiseLike=_n;var An={};An.isAbsoluteURL=void 0,An.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var Sn={};function In(t){return t instanceof RegExp}Sn.isntRegExp=Sn.isRegExp=void 0,Sn.isRegExp=In,Sn.isntRegExp=function(t){return!In(t)},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(Te,t),r(Ae,t),r(Ce,t),r(Fe,t),r(Ve,t),r(Le,t),r(We,t),r(Ye,t),r(He,t),r(Pe,t),r(Ge,t),r(nn,t),r(Se,t),r(rn,t),r(an,t),r(gn,t),r(De,t),r(Ee,t),r(An,t),r(Sn,t)}(xe),we.chunkByAsync=void 0;const En=xe;we.chunkByAsync=function(t,e){return(0,En.isAsyncIterable)(t)?async function*(t,e){let n=[],r=0;for await(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t,e):async function*(t,e){let n=[],r=0;for(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t,e)};var On={};On.chunkBy=void 0,On.chunkBy=function*(t,e){let n=[],r=0;for(const i of t)n.push(i),e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)};var Pn,jn={};var kn={concatAsync:void 0};const Nn=xe,Mn=Gt;kn.concatAsync=function(t,...e){return(0,Mn.go)((async function*(){for(const n of[t,...e])if((0,Nn.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var Bn={concat:void 0};const Cn=Gt;Bn.concat=function(t,...e){return(0,Cn.go)((function*(){for(const n of[t,...e])yield*n}))};var zn,Fn={},qn={};qn.copyIterable=qn.copyAsyncIterable=void 0,qn.copyAsyncIterable=async function*(t){for await(const e of t)yield e},qn.copyIterable=function*(t){for(const e of t)yield e};var Vn,Dn={};var Un,Rn={};var Kn={dropUntilAsync:void 0};const Ln=xe;Kn.dropUntilAsync=function(t,e){return(0,Ln.isAsyncIterable)(t)?async function*(t,e){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=await r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}(t,e):async function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}(t,e)};var Jn={};Jn.dropUntil=void 0,Jn.dropUntil=function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}};var Wn,Yn={};var $n={filterAsync:void 0};const Hn=xe;$n.filterAsync=function(t,e){return(0,Hn.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)await e(r,n)&&(yield r),n++}(t,e):async function*(t,e){let n=0;for(const r of t)await e(r,n)&&(yield r),n++}(t,e)};var Xn={};Xn.filter=void 0,Xn.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var Gn={},Qn={},Zn={flattenByAsync:void 0};const tr=xe;async function*er(t,e,n){for(const r of t)nr(r)&&await e(r,n)?yield*er(r,e,n+1):yield r}function nr(t){return(0,tr.isIterable)(t)&&(0,tr.isntChar)(t)}var rr,ir;function or(){if(rr)return Qn;rr=1,Qn.flattenDeepAsync=void 0;const t=Zn,e=mo();return Qn.flattenDeepAsync=function(n,r=1/0){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter depth must be an integer"),(0,e.assert)(r>=0,"The parameter depth must be greater than or equal to 0"),(0,t.flattenByAsync)(n,((t,e)=>e<=r))},Qn}Zn.flattenByAsync=function(t,e){return(0,tr.isAsyncIterable)(t)?async function*(t,e){const n=1;for await(const r of t)nr(r)&&await e(r,n)?yield*er(r,e,n+1):yield r}(t,e):function(t,e){return er(t,e,1)}(t,e)};var sr={flattenBy:void 0};const ar=xe;function*ur(t,e,n){for(const i of t)(0,ar.isIterable)(r=i)&&(0,ar.isntChar)(r)&&e(i,n)?yield*ur(i,e,n+1):yield i;var r}sr.flattenBy=function(t,e){return ur(t,e,1)};var cr,lr={};function hr(){if(cr)return lr;cr=1,lr.flattenDeep=void 0;const t=sr,e=mo();return lr.flattenDeep=function(n,r=1/0){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter depth must be an integer"),(0,e.assert)(r>=0,"The parameter depth must be greater than or equal to 0"),(0,t.flattenBy)(n,((t,e)=>e<=r))},lr}var fr,dr={};var yr={mapAsync:void 0};const pr=xe;yr.mapAsync=function(t,e){return(0,pr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)yield await e(r,n),n++}(t,e):async function*(t,e){let n=0;for(const r of t)yield await e(r,n),n++}(t,e)};var vr={};vr.map=void 0,vr.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var mr,br={};function gr(){if(mr)return br;mr=1,br.repeatAsync=void 0;const t=Gt,e=mo();return br.repeatAsync=function(n,r){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter times must be an integer"),(0,e.assert)(r>=0,"The parameter times must be greater than or equal to 0"),r===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,t.go)((async function*(){const t=[];if(r>0){for await(const e of n)yield e,t.push(e);r--}for(;r>0;)yield*t,r--}))},br}var wr,xr={};function Tr(){if(wr)return xr;wr=1,xr.repeat=void 0;const t=Gt,e=mo();return xr.repeat=function(n,r){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter times must be an integer"),(0,e.assert)(r>=0,"The parameter times must be greater than or equal to 0"),r===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,t.go)((function*(){const t=[];if(r>0){for(const e of n)yield e,t.push(e);r--}for(;r>0;)yield*t,r--}))},xr}var _r,Ar={};var Sr,Ir={};var Er={};Er.splitAsync=void 0,Er.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Or={splitByAsync:void 0};const Pr=xe;Or.splitByAsync=function(t,e){return(0,Pr.isAsyncIterable)(t)?async function*(t,e){let n=[],r=0;for await(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t,e):async function*(t,e){let n=[],r=0;for(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t,e)};var jr={};jr.splitBy=void 0,jr.splitBy=function*(t,e){let n=[],r=0;for(const i of t)e(i,r)?(yield n,n=[]):n.push(i),r++;yield n};var kr={};kr.split=void 0,kr.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Nr,Mr={};var Br,Cr={};var zr,Fr={};var qr={takeUntilAsync:void 0};const Vr=xe;qr.takeUntilAsync=function(t,e){return(0,Vr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t){if(await e(r,n))break;yield r,n++}}(t,e):async function*(t,e){let n=0;for(const r of t){if(await e(r,n))break;yield r,n++}}(t,e)};var Dr={};Dr.takeUntil=void 0,Dr.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var Ur,Rr={};var Kr={tapAsync:void 0};const Lr=xe;Kr.tapAsync=function(t,e){return(0,Lr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)await e(r,n),yield r,n++}(t,e):async function*(t,e){let n=0;for(const r of t)await e(r,n),yield r,n++}(t,e)};var Jr={};Jr.tap=void 0,Jr.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var Wr={};Wr.toAsyncIterable=void 0,Wr.toAsyncIterable=async function*(t){for(const e of t)yield e};var Yr={};Yr.transformAsync=void 0,Yr.transformAsync=async function*(t,e){yield*e(t)};var $r={};$r.transform=void 0,$r.transform=function*(t,e){yield*e(t)};var Hr={};Hr.uniqAsync=void 0,Hr.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var Xr={uniqByAsync:void 0};const Gr=xe;Xr.uniqByAsync=function(t,e){return(0,Gr.isAsyncIterable)(t)?async function*(t,e){const n=new Set;let r=0;for await(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t,e):async function*(t,e){const n=new Set;let r=0;for(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t,e)};var Qr={};Qr.uniqBy=void 0,Qr.uniqBy=function*(t,e){const n=new Set;let r=0;for(const i of t){const t=e(i,r);n.has(t)||(yield i,n.add(t)),r++}};var Zr={};Zr.uniq=void 0,Zr.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var ti={zipAsync:void 0};const ei=xe;var ni;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(ni||(ni={})),ti.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,s=t.map((t=>(0,ei.isAsyncIterable)(t)?[ni.Async,t[Symbol.asyncIterator]()]:[ni.Sync,t[Symbol.iterator]()])),a=s.map((()=>!1));try{for(;;){const t=new Array(o);for(let e=0;e<o;e++){const[n,r]=s[e];let i;if(i=n===ni.Async?await r.next():r.next(),i.done)return void(a[e]=!0);t[e]=i.value}yield t}}finally{const t=s.filter(((t,e)=>!a[e]));for(const[o,s]of t)o===ni.Async?await(null===(n=(e=s).return)||void 0===n?void 0:n.call(e)):null===(i=(r=s).return)||void 0===i||i.call(r)}}(t,...e)};var ri,ii={};function oi(){return ri||(ri=1,function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(function(){if(ge)return Xt;ge=1,Xt.chunkAsync=void 0;const t=Gt,e=mo();return Xt.chunkAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter size must be an integer"),(0,e.assert)(r>0,"The parameter size must be greater than 0"),(0,t.go)((async function*(){let t=[];for await(const e of n)t.push(e),t.length>=r&&(yield t,t=[]);t.length&&(yield t)}))},Xt}(),t),r(we,t),r(On,t),r(function(){if(Pn)return jn;Pn=1,jn.chunk=void 0;const t=Gt,e=mo();return jn.chunk=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter size must be an integer"),(0,e.assert)(r>0,"The parameter size must be greater than 0"),(0,t.go)((function*(){let t=[];for(const e of n)t.push(e),t.length>=r&&(yield t,t=[]);t.length&&(yield t)}))},jn}(),t),r(kn,t),r(Bn,t),r(function(){if(zn)return Fn;zn=1,Fn.dropAsync=void 0;const t=Gt,e=qn,n=mo();return Fn.dropAsync=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyAsyncIterable)(r):(0,t.go)((async function*(){var t;const e=r[Symbol.asyncIterator]();let n;try{let r;for(;({value:r,done:n}=await e.next()),!(n||i<=0);)i--;for(;!n;)yield r,({value:r,done:n}=await e.next())}finally{n||await(null===(t=e.return)||void 0===t?void 0:t.call(e))}}))},Fn}(),t),r(function(){if(Vn)return Dn;Vn=1,Dn.dropRightAsync=void 0;const t=Gt,e=qn,n=mo();return Dn.dropRightAsync=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyAsyncIterable)(r):(0,t.go)((async function*(){const t=(await async function(t){const e=[];for await(const n of t)e.push(n);return e}(r)).slice(0,-i);for(const e of t)yield e}))},Dn}(),t),r(function(){if(Un)return Rn;Un=1,Rn.dropRight=void 0;const t=Gt,e=qn,n=mo();return Rn.dropRight=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyIterable)(r):(0,t.go)((function*(){const t=Array.from(r);yield*t.slice(0,-i)}))},Rn}(),t),r(Kn,t),r(Jn,t),r(function(){if(Wn)return Yn;Wn=1,Yn.drop=void 0;const t=Gt,e=qn,n=mo();return Yn.drop=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyIterable)(r):(0,t.go)((function*(){var t;const e=r[Symbol.iterator]();let n;try{let r;for(;({value:r,done:n}=e.next()),!(n||i<=0);)i--;for(;!n;)yield r,({value:r,done:n}=e.next())}finally{n||null===(t=e.return)||void 0===t||t.call(e)}}))},Yn}(),t),r($n,t),r(Xn,t),r(function(){if(ir)return Gn;ir=1,Gn.flattenAsync=void 0;const t=or();return Gn.flattenAsync=function(e){return(0,t.flattenDeepAsync)(e,1)},Gn}(),t),r(Zn,t),r(sr,t),r(or(),t),r(hr(),t),r(function(){if(fr)return dr;fr=1,dr.flatten=void 0;const t=hr();return dr.flatten=function(e){return(0,t.flattenDeep)(e,1)},dr}(),t),r(yr,t),r(vr,t),r(gr(),t),r(Tr(),t),r(function(){if(_r)return Ar;_r=1,Ar.sliceAsync=void 0;const t=Gt,e=mo();return Ar.sliceAsync=function(n,r,i=1/0){return(0,e.assert)(Number.isInteger(r),"The parameter start must be an integer"),(0,e.assert)(r>=0,"The parameter start must be greater than or equal to 0"),(0,e.assert)(Number.isInteger(i),"The parameter end must be an integer"),(0,e.assert)(i>=r,"The parameter end must be greater than or equal to start"),(0,t.go)((async function*(){let t=0;for await(const e of n){if(t>=i)break;t>=r&&(yield e),t++}}))},Ar}(),t),r(function(){if(Sr)return Ir;Sr=1,Ir.slice=void 0;const t=Gt,e=mo();return Ir.slice=function(n,r,i=1/0){return(0,e.assert)(Number.isInteger(r),"The parameter start must be an integer"),(0,e.assert)(r>=0,"The parameter start must be greater than or equal to 0"),(0,e.assert)(Number.isInteger(i),"The parameter end must be an integer"),(0,e.assert)(i>=r,"The parameter end must be greater than or equal to start"),(0,t.go)((function*(){let t=0;for(const e of n){if(t>=i)break;t>=r&&(yield e),t++}}))},Ir}(),t),r(Er,t),r(Or,t),r(jr,t),r(kr,t),r(function(){if(Nr)return Mr;Nr=1,Mr.takeAsync=void 0;const t=Gt,e=mo();return Mr.takeAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((async function*(){if(0!==r)for await(const t of n)if(yield t,0==--r)break}))},Mr}(),t),r(function(){if(Br)return Cr;Br=1,Cr.takeRightAsync=void 0;const t=Gt,e=mo();return Cr.takeRightAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((async function*(){var t;const e=n[Symbol.asyncIterator]();let i;try{const n=[];let o;for(;({value:o,done:i}=await e.next()),!i;)n.push(o),n.length>r&&n.shift();yield*n}finally{i||await(null===(t=e.return)||void 0===t?void 0:t.call(e))}}))},Cr}(),t),r(function(){if(zr)return Fr;zr=1,Fr.takeRight=void 0;const t=Gt,e=mo();return Fr.takeRight=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((function*(){var t;const e=n[Symbol.iterator]();let i;try{const n=[];let o;for(;({value:o,done:i}=e.next()),!i;)n.push(o),n.length>r&&n.shift();yield*n}finally{i||null===(t=e.return)||void 0===t||t.call(e)}}))},Fr}(),t),r(qr,t),r(Dr,t),r(function(){if(Ur)return Rr;Ur=1,Rr.take=void 0;const t=Gt,e=mo();return Rr.take=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((function*(){if(0!==r)for(const t of n)if(yield t,0==--r)break}))},Rr}(),t),r(Kr,t),r(Jr,t),r(Wr,t),r(Yr,t),r($r,t),r(Hr,t),r(Xr,t),r(Qr,t),r(Zr,t),r(ti,t),r(ii,t)}(Ht)),Ht}ii.zip=void 0,ii.zip=function(t,...e){return function*(...t){const e=t.length,n=t.map((t=>t[Symbol.iterator]())),r=n.map((()=>!1));try{for(;;){const t=new Array(e);for(let i=0;i<e;i++){const{value:e,done:o}=n[i].next();if(o)return void(r[i]=!0);t[i]=e}yield t}}finally{n.filter(((t,e)=>!r[e])).forEach((t=>{var e;return null===(e=t.return)||void 0===e?void 0:e.call(t)}))}}(t,...e)};var si={},ai={};ai.consume=void 0,ai.consume=function(t,e){return e(t)};var ui={eachAsync:void 0};const ci=xe;ui.eachAsync=function(t,e){return(0,ci.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t)await e(r,n),n++}(t,e):async function(t,e){let n=0;for(const r of t)await e(r,n),n++}(t,e)};var li={};li.each=void 0,li.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var hi={everyAsync:void 0};const fi=xe;hi.everyAsync=function(t,e){return(0,fi.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(!await e(r,n))return!1;n++}return!0}(t,e):async function(t,e){let n=0;for(const r of t){if(!await e(r,n))return!1;n++}return!0}(t,e)};var di={};di.every=void 0,di.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var yi={findAsync:void 0};const pi=xe;yi.findAsync=function(t,e){return(0,pi.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(await e(r,n))return r;n++}return}(t,e):async function(t,e){let n=0;for(const r of t){if(await e(r,n))return r;n++}return}(t,e)};var vi={};vi.find=void 0,vi.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var mi={};mi.firstAsync=void 0,mi.firstAsync=async function(t){for await(const e of t)return e};var bi={};bi.first=void 0,bi.first=function(t){for(const e of t)return e};var gi={};gi.includesAsync=void 0,gi.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var wi={};wi.includes=void 0,wi.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var xi={};xi.matchAsync=void 0,xi.matchAsync=async function(t,e){const n=e.length;let r=0;for await(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var Ti={};Ti.match=void 0,Ti.match=function(t,e){const n=e.length;let r=0;for(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var _i={reduceAsync:void 0};const Ai=xe;_i.reduceAsync=function(t,e,n){return(0,Ai.isUndefined)(n)?function(t,e){return(0,Ai.isAsyncIterable)(t)?n(t):r(t);async function n(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,s=await o(r),a=1;for(;({value:t,done:i}=await r.next()),!i;)s=await e(s,t,a++);return s}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}async function o(t){const e=await t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}async function r(t){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=await e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}}(t,e):function(t,e,n){return(0,Ai.isAsyncIterable)(t)?i(t):r(t);async function r(t){let r=n,i=0;for(const n of t)r=await e(r,n,i++);return r}async function i(t){let r=n,i=0;for await(const n of t)r=await e(r,n,i++);return r}}(t,e,n)};var Si={reduce:void 0};const Ii=xe;Si.reduce=function(t,e,n){return(0,Ii.isUndefined)(n)?function(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}(t,e):function(t,e,n){let r=n,i=0;for(const n of t)r=e(r,n,i++);return r}(t,e,n)};var Ei={someAsync:void 0};const Oi=xe;Ei.someAsync=function(t,e){return(0,Oi.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(await e(r,n))return!0;n++}return!1}(t,e):async function(t,e){let n=0;for(const r of t){if(await e(r,n))return!0;n++}return!1}(t,e)};var Pi={};Pi.some=void 0,Pi.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var ji={};ji.lastAsync=void 0,ji.lastAsync=async function(t){var e;const n=t[Symbol.asyncIterator]();let r;try{let t,i;for(;({value:t,done:r}=await n.next()),!r;)i=t;return i}finally{r||await(null===(e=n.return)||void 0===e?void 0:e.call(n))}};var ki={};ki.last=void 0,ki.last=function(t){var e;const n=t[Symbol.iterator]();let r;try{let t,i;for(;({value:t,done:r}=n.next()),!r;)i=t;return i}finally{r||null===(e=n.return)||void 0===e||e.call(n)}};var Ni={toArrayAsync:void 0};const Mi=ai;Ni.toArrayAsync=function(t){return(0,Mi.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var Bi={toArray:void 0};const Ci=ai;Bi.toArray=function(t){return(0,Ci.consume)(t,(t=>Array.from(t)))};var zi={toSetAsync:void 0};const Fi=ai;zi.toSetAsync=function(t){return(0,Fi.consume)(t,(async t=>{const e=new Set;for await(const n of t)e.add(n);return e}))};var qi={toSet:void 0};const Vi=ai;qi.toSet=function(t){return(0,Vi.consume)(t,(t=>new Set(t)))};var Di={};Di.count=void 0,Di.count=function(t){let e=0;for(const n of t)e++;return e};var Ui={};Ui.countAsync=void 0,Ui.countAsync=async function(t){let e=0;for await(const n of t)e++;return e};var Ri={groupBy:void 0};const Ki=li;Ri.groupBy=function(t,e){const n=new Map;return(0,Ki.each)(t,((t,r)=>{const i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)})),n};var Li={groupByAsync:void 0};const Ji=ui;var Wi;function Yi(){return Wi||(Wi=1,function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(oi(),t),r(si,t)}($t)),$t}Li.groupByAsync=async function(t,e){const n=new Map;return await(0,Ji.eachAsync)(t,(async(t,r)=>{const i=await e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)})),n},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(ai,t),r(ui,t),r(li,t),r(hi,t),r(di,t),r(yi,t),r(vi,t),r(mi,t),r(bi,t),r(gi,t),r(wi,t),r(xi,t),r(Ti,t),r(_i,t),r(Si,t),r(Ei,t),r(Pi,t),r(ji,t),r(ki,t),r(Ni,t),r(Bi,t),r(zi,t),r(qi,t),r(Di,t),r(Ui,t),r(Ri,t),r(Li,t)}(si);var $i={},Hi={};Hi.traverseErrorPrototypeChain=void 0,Hi.traverseErrorPrototypeChain=function*(t){let e=t;for(;(e=Object.getPrototypeOf(e))&&(yield e,e!==Error.prototype););},$i.getErrorNames=void 0;const Xi=n,Gi=Hi;$i.getErrorNames=function*(t){var e;if((0,Xi.isError)(t))for(const n of(0,Gi.traverseErrorPrototypeChain)(t))(null===(e=n.constructor)||void 0===e?void 0:e.name)&&(yield n.constructor.name);else yield t.name,yield*t.ancestors};var Qi={isSerializableError:void 0};const Zi=n;var to;function eo(){if(to)return Yt;to=1,Yt.CustomError=void 0;const t=Yi(),e=$i,r=n,i=Qi;class o extends Error{get name(){var n,r;return null!==(r=null!==(n=(0,t.first)((0,e.getErrorNames)(this)))&&void 0!==n?n:o.name)&&void 0!==r?r:"CustomError"}static[Symbol.hasInstance](n){var o;if((0,r.isError)(n)||(0,i.isSerializableError)(n)){const r=[null!==(o=this.prototype.constructor.name)&&void 0!==o?o:this.name,...(0,e.getErrorNames)(this.prototype)].reverse(),i=(0,t.toArray)((0,e.getErrorNames)(n)).reverse();return r.every(((t,e)=>t===i[e]))}return!1}}return Yt.CustomError=o,Yt}Qi.isSerializableError=function(t){return(0,Zi.isObject)(t)&&(0,Zi.isString)(t.name)&&(0,Zi.isString)(t.message)&&((0,Zi.isString)(t.stack)||(0,Zi.isNull)(t.stack))&&(0,Zi.isArray)(t.ancestors)&&t.ancestors.every(Zi.isString)};var no,ro={};function io(){if(no)return ro;no=1,ro.AssertionError=void 0;const t=eo();class e extends t.CustomError{}return ro.AssertionError=e,ro}var oo,so={};var ao={},uo={},co={};co.pass=void 0,co.pass=function(){};var lo={};lo.passAsync=void 0,lo.passAsync=async function(){},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(co,t),r(lo,t)}(uo),ao.hydrate=void 0;const ho=uo;function fo(t,e){const n=function(){(0,ho.pass)()};return(n.prototype=Object.create(t.prototype)).constructor=n,Object.defineProperty(n,"name",{value:e}),n}ao.hydrate=function(t){var e;const n=[t.name,...t.ancestors].slice(0,-1).reverse();let r=Error;for(const t of n)r=fo(r,t);const i=new r;return i.name=t.name,i.message=t.message,i.stack=null!==(e=t.stack)&&void 0!==e?e:void 0,i};var yo,po,vo={};function mo(){return po||(po=1,function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(eo(),t),r(io(),t),r(Qi,t),r(function(){if(oo)return so;oo=1,so.normalize=void 0;const t=$i,e=Yi();return so.normalize=function(n){var r;const[i,...o]=(0,e.toArray)((0,t.getErrorNames)(n));return{name:i,ancestors:o,message:n.message,stack:null!==(r=n.stack)&&void 0!==r?r:null}},so}(),t),r(ao,t),r(function(){if(yo)return vo;yo=1,vo.assert=void 0;const t=io();return vo.assert=function(e,n){if(!e)throw new t.AssertionError(n)},vo}(),t),r($i,t),r(Hi,t)}(Wt)),Wt}var bo=mo(),go=Yi();class wo{constructor(t){this.map=new Map,bo.assert(Number.isInteger(t),"The parameter limit must be an integer"),bo.assert(t>0,"The parameter limit must be a positive value"),this.limit=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e){return this.map.has(t)?this.updateItem(t,e):(this.map.size===this.limit&&this.map.delete(this.getColdestKey()),this.map.set(t,e)),this}has(t){return this.map.has(t)}get(t){if(!this.has(t))return;const e=this.map.get(t);return this.updateItem(t,e),e}delete(t){return this.map.delete(t)}clear(){this.map.clear()}updateItem(t,e){this.map.delete(t),this.map.set(t,e)}getColdestKey(){return go.first(this.map.keys())}}class xo{constructor(){this.map=new Map,this.itemMetadataSortedByExpirationTime=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e,n){return this.map.set(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n),this}has(t){return this.map.has(t)}get(t){return this.map.get(t)}delete(t){const e=this.map.delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;this.map.clear(),null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>this.map.delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=ee.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));this.cancelClearTimeout=()=>{e(),this.cancelClearTimeout=void 0}}}}}class To{constructor(t){this.map=new Map,this.itemMetadataSortedByExpirationTime=[],bo.assert(Number.isInteger(t),"The parameter limit must be an integer"),bo.assert(t>0,"The parameter limit must be a positive value"),this.limit=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e,n){return this.map.has(t)?(this.updateItem(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n)):(this.map.size===this.limit&&this.map.delete(this.getColdestKey()),this.map.set(t,e),this.addItemMetadata(t,Date.now()+n)),this}has(t){return this.map.has(t)}get(t){if(this.has(t)){const e=this.map.get(t);return this.updateItem(t,e),e}}delete(t){const e=this.map.delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;this.map.clear(),null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(t,e){this.map.delete(t),this.map.set(t,e)}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>this.map.delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=ee.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));this.cancelClearTimeout=()=>{e(),this.cancelClearTimeout=void 0}}}}getColdestKey(){return go.first(this.map.keys())}}class _o{constructor(t){this.value=t,this.children=new Map}}class Ao{constructor(){this.root=new _o}get[Symbol.toStringTag](){return this.constructor.name}*entries(){yield*function*t(e,r){for(const[i,o]of e.children){const e=[...r,i];n.isntUndefined(o.value)&&(yield[e,o.value]),yield*t(o,e)}}(this.root,[])}keys(){return go.map(this.entries(),(([t])=>t))}values(){return go.map(this.entries(),(([t,e])=>e))}set(t,e){let n=this.root;for(const e of t)n.children.has(e)||n.children.set(e,new _o),n=n.children.get(e);return n.value=e,this}has(t){let e=this.root;for(const n of t){if(!e.children.has(n))return!1;e=e.children.get(n)}return void 0!==e.value}get(t){let e=this.root;for(const n of t){if(!e.children.has(n))return;e=e.children.get(n)}return e.value}delete(t){const e=[];let n=this.root;for(const r of t){if(!n.children.has(r))return!1;e.push(n),n=n.children.get(r)}if(delete n.value,0===n.children.size)for(const[n,r]of go.toArray(go.zip(t,e)).reverse())if(r.children.delete(n),0!==r.children.size)break;return!0}}class So{constructor(t,e){this.schema=t,this._state=e}get[Symbol.toStringTag](){return this.constructor.name}get state(){return this._state}matches(t){return this._state===t}can(t){return t in this.schema[this.state]}send(t){if(!this.can(t))throw new Io(this.state,t);this._state=this.schema[this.state][t]}}class Io extends bo.CustomError{constructor(t,e){super(`State ${t} cannot react to event ${e}`)}}
1
+ class t{constructor(t){this.value=t}get[Symbol.toStringTag](){return this.constructor.name}set(t){this.value=t}get(){return this.value}}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n={},r={};function i(t){return Array.isArray(t)}r.isntEmptyArray=r.isEmptyArray=r.isntArray=r.isArray=void 0,r.isArray=i,r.isntArray=function(t){return!i(t)},r.isEmptyArray=function(t){return 0===t.length},r.isntEmptyArray=function(t){return 0!==t.length};var o={},s={};function a(t){return null===t}s.isntNull=s.isNull=void 0,s.isNull=a,s.isntNull=function(t){return!a(t)};var u={};function c(t){return void 0===t}u.isntUndefined=u.isUndefined=void 0,u.isUndefined=c,u.isntUndefined=function(t){return!c(t)};var l={};function h(t){return"function"==typeof t}l.isntFunction=l.isFunction=void 0,l.isFunction=h,l.isntFunction=function(t){return!h(t)},o.isntAsyncIterable=o.isAsyncIterable=void 0;const f=s,d=u,y=l;function p(t){return(0,f.isntNull)(t)&&(0,d.isntUndefined)(t)&&(0,y.isFunction)(t[Symbol.asyncIterator])}o.isAsyncIterable=p,o.isntAsyncIterable=function(t){return!p(t)};var v={};function m(t){return"bigint"==typeof t}v.isntBigInt=v.isBigInt=void 0,v.isBigInt=m,v.isntBigInt=function(t){return!m(t)};var b={};function g(t){return"boolean"==typeof t}b.isntBoolean=b.isBoolean=void 0,b.isBoolean=g,b.isntBoolean=function(t){return!g(t)};var w={},x={};function T(t){return"string"==typeof t}x.isntString=x.isString=void 0,x.isString=T,x.isntString=function(t){return!T(t)},w.isntChar=w.isChar=void 0;const _=x;function S(t){return(0,_.isString)(t)&&1===t.length}w.isChar=S,w.isntChar=function(t){return!S(t)};var A={};function I(t){return t instanceof Date}A.isntDate=A.isDate=void 0,A.isDate=I,A.isntDate=function(t){return!I(t)};var E={};E.inEnum=void 0,E.inEnum=function(t,e){return Object.values(e).includes(t)};var O={};function P(t){return t instanceof Error}O.isntError=O.isError=void 0,O.isError=P,O.isntError=function(t){return!P(t)};var j={};function k(t){return!t}j.isntFalsy=j.isFalsy=void 0,j.isFalsy=k,j.isntFalsy=function(t){return!k(t)};var N={};N.isntIterable=N.isIterable=void 0;const M=s,B=u,C=l;function z(t){return(0,M.isntNull)(t)&&(0,B.isntUndefined)(t)&&(0,C.isFunction)(t[Symbol.iterator])}N.isIterable=z,N.isntIterable=function(t){return!z(t)};var F={},q={};function V(t){return"number"==typeof t}function D(t){return Number.isNaN(t)}q.isntNaN=q.isNaN=q.isNegativeInfinity=q.isPositiveInfinity=q.isFinite=q.isntNumber=q.isNumber=void 0,q.isNumber=V,q.isntNumber=function(t){return!V(t)},q.isFinite=function(t){return Number.isFinite(t)},q.isPositiveInfinity=function(t){return t===1/0},q.isNegativeInfinity=function(t){return t===-1/0},q.isNaN=D,q.isntNaN=function(t){return!D(t)};var U={},R="object"==typeof e&&e&&e.Object===Object&&e,K="object"==typeof self&&self&&self.Object===Object&&self,L=(R||K||Function("return this")()).Symbol,J=L,W=Object.prototype,Y=W.hasOwnProperty,$=W.toString,H=J?J.toStringTag:void 0;var X=function(t){var e=Y.call(t,H),n=t[H];try{t[H]=void 0;var r=!0}catch(t){}var i=$.call(t);return r&&(e?t[H]=n:delete t[H]),i},G=Object.prototype.toString;var Q=X,Z=function(t){return G.call(t)},tt=L?L.toStringTag:void 0;var et=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":tt&&tt in Object(t)?Q(t):Z(t)};var nt=function(t,e){return function(n){return t(e(n))}}(Object.getPrototypeOf,Object);var rt=et,it=nt,ot=function(t){return null!=t&&"object"==typeof t},st=Function.prototype,at=Object.prototype,ut=st.toString,ct=at.hasOwnProperty,lt=ut.call(Object);var ht=function(t){if(!ot(t)||"[object Object]"!=rt(t))return!1;var e=it(t);if(null===e)return!0;var n=ct.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ut.call(n)==lt},ft=e&&e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};U.isntEmptyObject=U.isEmptyObject=U.isntPlainObject=U.isPlainObject=U.isntObject=U.isObject=void 0;const dt=ft(ht);function yt(t){return null!==t&&"object"==typeof t}function pt(t){return(0,dt.default)(t)}U.isObject=yt,U.isntObject=function(t){return!yt(t)},U.isPlainObject=pt,U.isntPlainObject=function(t){return!pt(t)},U.isEmptyObject=function(t){return 0===Object.keys(t).length},U.isntEmptyObject=function(t){return 0!==Object.keys(t).length},F.isntJsonable=F.isJsonable=F.isntJson=F.isJson=void 0;const vt=s,mt=b,bt=x,gt=q,wt=r,xt=U;function Tt(t){return(0,vt.isNull)(t)||(0,mt.isBoolean)(t)||(0,bt.isString)(t)||(0,gt.isNumber)(t)||(0,wt.isArray)(t)&&t.every(Tt)||(0,xt.isPlainObject)(t)&&Object.values(t).every(Tt)}F.isJson=Tt,F.isntJson=function(t){return!Tt(t)},F.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},F.isntJsonable=function t(e){return!t()};var _t={};_t.isPromiseLike=_t.isntPromiseLike=_t.isntPromise=_t.isPromise=void 0;const St=U,At=l;function It(t){return t instanceof Promise}function Et(t){return(0,St.isObject)(t)&&(0,At.isFunction)(t.then)}_t.isPromise=It,_t.isntPromise=function(t){return!It(t)},_t.isntPromiseLike=function(t){return!Et(t)},_t.isPromiseLike=Et;var Ot={};Ot.isAbsoluteURL=void 0,Ot.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var Pt={};function jt(t){return t instanceof RegExp}Pt.isntRegExp=Pt.isRegExp=void 0,Pt.isRegExp=jt,Pt.isntRegExp=function(t){return!jt(t)};var kt,Nt,Mt,Bt={};function Ct(t){return"symbol"==typeof t}function zt([t,e]){return n.isNull(e)?[t]:[t,...zt(e)]}function Ft([t,...e]){return[t,e.length?Ft(e):null]}function qt(t,e){return t.slice(0,e)}function Vt(t,e){const n=t.length-e;return t.slice(n>=0?n:0)}function Dt(t,e){t.length>e&&(t.length=e)}function Ut(t,e){const n=t.length-e;t.splice(0,n)}Bt.isntSymbol=Bt.isSymbol=void 0,Bt.isSymbol=Ct,Bt.isntSymbol=function(t){return!Ct(t)},kt=n,Nt=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),(Mt=e&&e.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||Nt(e,t,n)})(r,kt),Mt(o,kt),Mt(v,kt),Mt(b,kt),Mt(w,kt),Mt(A,kt),Mt(E,kt),Mt(O,kt),Mt(j,kt),Mt(l,kt),Mt(N,kt),Mt(F,kt),Mt(s,kt),Mt(q,kt),Mt(U,kt),Mt(_t,kt),Mt(x,kt),Mt(u,kt),Mt(Ot,kt),Mt(Pt,kt),Mt(Bt,kt);class Rt{constructor(){this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}on(t,e){this.map.has(t)||this.map.set(t,new Set);return this.map.get(t).add(n),()=>{if(!this.map.has(t))return;const e=this.map.get(t);e.delete(n),0===e.size&&this.map.delete(t)};function n(...t){e(...t)}}once(t,e){const n=this.on(t,((...t)=>{e(...t),n()}));return n}emit(t,...e){this.map.has(t)&&this.map.get(t).forEach((t=>t(...e)))}}class Kt{constructor(t){this.hash=t,this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e){return this.map.set(this.hash(t),e),this}has(t){return this.map.has(this.hash(t))}get(t){return this.map.get(this.hash(t))}delete(t){return this.map.delete(this.hash(t))}clear(){this.map.clear()}}class Lt{constructor(t){this.hash=t,this.map=new Map}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}[Symbol.iterator](){return this.map.values()}add(t){return this.map.set(this.hash(t),t),this}delete(t){return this.map.delete(this.hash(t))}has(t){return this.map.has(this.hash(t))}clear(){this.map.clear()}values(){return this.map.values()}}class Jt{constructor(){this.items=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.items.length}empty(){this.items.length=0}enqueue(...t){this.items.push(...t)}dequeue(){return this.items.shift()}remove(t){let e;for(;(e=this.items.indexOf(t))>=0;)this.items.splice(e,1)}}var Wt={},Yt={},$t={},Ht={},Xt={},Gt={},Qt={};Qt.go=void 0,Qt.go=function(t){return t()};var Zt={};Zt.goMicrotask=void 0,Zt.goMicrotask=function(t){return new Promise(((e,n)=>{queueMicrotask((async()=>{try{e(await t())}catch(t){n(t)}}))}))};var te={},ee={},ne={},re={},ie={};ie.random=void 0,ie.random=function(t,e){return Math.random()*(e-t)+t};var oe={};oe.randomInt=void 0,oe.randomInt=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t))+t};var se={};se.randomIntInclusive=void 0,se.randomIntInclusive=function(t,e){return t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(ie,t),r(oe,t),r(se,t)}(re),ne.calculateExponentialBackoffTimeout=void 0;const ae=re;ne.calculateExponentialBackoffTimeout=function({baseTimeout:t,retries:e,maxTimeout:n=1/0,factor:r=2,jitter:i=!0}){const o=Math.min(r**e*t,n);return i?(0,ae.randomIntInclusive)(0,o):o};var ue={};ue.setTimeout=void 0,ue.setTimeout=function(t,e){const n=globalThis.setTimeout(e,t);return()=>clearTimeout(n)};var ce={setSchedule:void 0};const le=ue;ce.setSchedule=function(t,e){const n=t-Date.now();return(0,le.setTimeout)(n,e)};var he={};he.setInterval=void 0,he.setInterval=function(t,e){const n=globalThis.setInterval(e,t);return()=>clearInterval(n)};var fe={setImmediate:void 0};const de=ue;fe.setImmediate=function(t){if(globalThis.setImmediate){const e=globalThis.setImmediate(t);return()=>clearImmediate(e)}return(0,de.setTimeout)(0,t)};var ye={setTimeoutLoop:void 0};const pe=ue;ye.setTimeoutLoop=function(t,e){let n=!1,r=(0,pe.setTimeout)(t,(async function i(){await e(),n||(r=(0,pe.setTimeout)(t,i))}));return()=>{n=!0,r()}};var ve={setDynamicTimeoutLoop:void 0};const me=ue;ve.setDynamicTimeoutLoop=function(t,e){let n=!1,r=(0,me.setTimeout)(t,(async function i(){const o=Date.now();await e();const s=Date.now()-o;n||(r=(0,me.setTimeout)(Math.max(t-s,0),i))}));return()=>{n=!0,r()}},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(ne,t),r(ue,t),r(ce,t),r(he,t),r(fe,t),r(ye,t),r(ve,t)}(ee),te.goMacrotask=void 0;const be=ee;var ge;te.goMacrotask=function(t){return new Promise(((e,n)=>{(0,be.setImmediate)((async()=>{try{e(await t())}catch(t){n(t)}}))}))},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(Qt,t),r(Zt,t),r(te,t)}(Gt);var we={},xe={},Te={};function _e(t){return Array.isArray(t)}Te.isntEmptyArray=Te.isEmptyArray=Te.isntArray=Te.isArray=void 0,Te.isArray=_e,Te.isntArray=function(t){return!_e(t)},Te.isEmptyArray=function(t){return 0===t.length},Te.isntEmptyArray=function(t){return 0!==t.length};var Se={},Ae={};function Ie(t){return null===t}Ae.isntNull=Ae.isNull=void 0,Ae.isNull=Ie,Ae.isntNull=function(t){return!Ie(t)};var Ee={};function Oe(t){return void 0===t}Ee.isntUndefined=Ee.isUndefined=void 0,Ee.isUndefined=Oe,Ee.isntUndefined=function(t){return!Oe(t)};var Pe={};function je(t){return"function"==typeof t}Pe.isntFunction=Pe.isFunction=void 0,Pe.isFunction=je,Pe.isntFunction=function(t){return!je(t)},Se.isntAsyncIterable=Se.isAsyncIterable=void 0;const ke=Ae,Ne=Ee,Me=Pe;function Be(t){return(0,ke.isntNull)(t)&&(0,Ne.isntUndefined)(t)&&(0,Me.isFunction)(t[Symbol.asyncIterator])}Se.isAsyncIterable=Be,Se.isntAsyncIterable=function(t){return!Be(t)};var Ce={};function ze(t){return"bigint"==typeof t}Ce.isntBigInt=Ce.isBigInt=void 0,Ce.isBigInt=ze,Ce.isntBigInt=function(t){return!ze(t)};var Fe={};function qe(t){return"boolean"==typeof t}Fe.isntBoolean=Fe.isBoolean=void 0,Fe.isBoolean=qe,Fe.isntBoolean=function(t){return!qe(t)};var Ve={},De={};function Ue(t){return"string"==typeof t}De.isntString=De.isString=void 0,De.isString=Ue,De.isntString=function(t){return!Ue(t)},Ve.isntChar=Ve.isChar=void 0;const Re=De;function Ke(t){return(0,Re.isString)(t)&&1===t.length}Ve.isChar=Ke,Ve.isntChar=function(t){return!Ke(t)};var Le={};function Je(t){return t instanceof Date}Le.isntDate=Le.isDate=void 0,Le.isDate=Je,Le.isntDate=function(t){return!Je(t)};var We={};We.inEnum=void 0,We.inEnum=function(t,e){return Object.values(e).includes(t)};var Ye={};function $e(t){return t instanceof Error}Ye.isntError=Ye.isError=void 0,Ye.isError=$e,Ye.isntError=function(t){return!$e(t)};var He={};function Xe(t){return!t}He.isntFalsy=He.isFalsy=void 0,He.isFalsy=Xe,He.isntFalsy=function(t){return!Xe(t)};var Ge={};Ge.isntIterable=Ge.isIterable=void 0;const Qe=Ae,Ze=Ee,tn=Pe;function en(t){return(0,Qe.isntNull)(t)&&(0,Ze.isntUndefined)(t)&&(0,tn.isFunction)(t[Symbol.iterator])}Ge.isIterable=en,Ge.isntIterable=function(t){return!en(t)};var nn={},rn={};function on(t){return"number"==typeof t}function sn(t){return Number.isNaN(t)}rn.isntNaN=rn.isNaN=rn.isNegativeInfinity=rn.isPositiveInfinity=rn.isFinite=rn.isntNumber=rn.isNumber=void 0,rn.isNumber=on,rn.isntNumber=function(t){return!on(t)},rn.isFinite=function(t){return Number.isFinite(t)},rn.isPositiveInfinity=function(t){return t===1/0},rn.isNegativeInfinity=function(t){return t===-1/0},rn.isNaN=sn,rn.isntNaN=function(t){return!sn(t)};var an={},un=e&&e.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};an.isntEmptyObject=an.isEmptyObject=an.isntPlainObject=an.isPlainObject=an.isntObject=an.isObject=void 0;const cn=un(ht);function ln(t){return null!==t&&"object"==typeof t}function hn(t){return(0,cn.default)(t)}an.isObject=ln,an.isntObject=function(t){return!ln(t)},an.isPlainObject=hn,an.isntPlainObject=function(t){return!hn(t)},an.isEmptyObject=function(t){return 0===Object.keys(t).length},an.isntEmptyObject=function(t){return 0!==Object.keys(t).length},nn.isntJsonable=nn.isJsonable=nn.isntJson=nn.isJson=void 0;const fn=Ae,dn=Fe,yn=De,pn=rn,vn=Te,mn=an;function bn(t){return(0,fn.isNull)(t)||(0,dn.isBoolean)(t)||(0,yn.isString)(t)||(0,pn.isNumber)(t)||(0,vn.isArray)(t)&&t.every(bn)||(0,mn.isPlainObject)(t)&&Object.values(t).every(bn)}nn.isJson=bn,nn.isntJson=function(t){return!bn(t)},nn.isJsonable=function(t){try{return JSON.stringify(t),!0}catch(t){return!1}},nn.isntJsonable=function t(e){return!t()};var gn={};gn.isPromiseLike=gn.isntPromiseLike=gn.isntPromise=gn.isPromise=void 0;const wn=an,xn=Pe;function Tn(t){return t instanceof Promise}function _n(t){return(0,wn.isObject)(t)&&(0,xn.isFunction)(t.then)}gn.isPromise=Tn,gn.isntPromise=function(t){return!Tn(t)},gn.isntPromiseLike=function(t){return!_n(t)},gn.isPromiseLike=_n;var Sn={};Sn.isAbsoluteURL=void 0,Sn.isAbsoluteURL=function(t){try{return new URL(t),!0}catch(t){return!1}};var An={};function In(t){return t instanceof RegExp}An.isntRegExp=An.isRegExp=void 0,An.isRegExp=In,An.isntRegExp=function(t){return!In(t)},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(Te,t),r(Se,t),r(Ce,t),r(Fe,t),r(Ve,t),r(Le,t),r(We,t),r(Ye,t),r(He,t),r(Pe,t),r(Ge,t),r(nn,t),r(Ae,t),r(rn,t),r(an,t),r(gn,t),r(De,t),r(Ee,t),r(Sn,t),r(An,t)}(xe),we.chunkByAsync=void 0;const En=xe;we.chunkByAsync=function(t,e){return(0,En.isAsyncIterable)(t)?async function*(t,e){let n=[],r=0;for await(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t,e):async function*(t,e){let n=[],r=0;for(const i of t)n.push(i),await e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)}(t,e)};var On={};On.chunkBy=void 0,On.chunkBy=function*(t,e){let n=[],r=0;for(const i of t)n.push(i),e(i,r)&&(yield n,n=[]),r++;n.length&&(yield n)};var Pn,jn={};var kn={concatAsync:void 0};const Nn=xe,Mn=Gt;kn.concatAsync=function(t,...e){return(0,Mn.go)((async function*(){for(const n of[t,...e])if((0,Nn.isAsyncIterable)(n))for await(const t of n)yield t;else for(const t of n)yield t}))};var Bn={concat:void 0};const Cn=Gt;Bn.concat=function(t,...e){return(0,Cn.go)((function*(){for(const n of[t,...e])yield*n}))};var zn,Fn={},qn={};qn.copyIterable=qn.copyAsyncIterable=void 0,qn.copyAsyncIterable=async function*(t){for await(const e of t)yield e},qn.copyIterable=function*(t){for(const e of t)yield e};var Vn,Dn={};var Un,Rn={};var Kn={dropUntilAsync:void 0};const Ln=xe;Kn.dropUntilAsync=function(t,e){return(0,Ln.isAsyncIterable)(t)?async function*(t,e){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=await r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=await r.next())}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}}(t,e):async function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||await e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}}(t,e)};var Jn={};Jn.dropUntil=void 0,Jn.dropUntil=function*(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,o=0;for(;!(({value:t,done:i}=r.next()),i||e(t,o++)););for(;!i;)yield t,({value:t,done:i}=r.next())}finally{i||null===(n=r.return)||void 0===n||n.call(r)}};var Wn,Yn={};var $n={filterAsync:void 0};const Hn=xe;$n.filterAsync=function(t,e){return(0,Hn.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)await e(r,n)&&(yield r),n++}(t,e):async function*(t,e){let n=0;for(const r of t)await e(r,n)&&(yield r),n++}(t,e)};var Xn={};Xn.filter=void 0,Xn.filter=function*(t,e){let n=0;for(const r of t)e(r,n)&&(yield r),n++};var Gn={},Qn={},Zn={flattenByAsync:void 0};const tr=xe;async function*er(t,e,n){for(const r of t)nr(r)&&await e(r,n)?yield*er(r,e,n+1):yield r}function nr(t){return(0,tr.isIterable)(t)&&(0,tr.isntChar)(t)}var rr,ir;function or(){if(rr)return Qn;rr=1,Qn.flattenDeepAsync=void 0;const t=Zn,e=mo();return Qn.flattenDeepAsync=function(n,r=1/0){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter depth must be an integer"),(0,e.assert)(r>=0,"The parameter depth must be greater than or equal to 0"),(0,t.flattenByAsync)(n,((t,e)=>e<=r))},Qn}Zn.flattenByAsync=function(t,e){return(0,tr.isAsyncIterable)(t)?async function*(t,e){const n=1;for await(const r of t)nr(r)&&await e(r,n)?yield*er(r,e,n+1):yield r}(t,e):function(t,e){return er(t,e,1)}(t,e)};var sr={flattenBy:void 0};const ar=xe;function*ur(t,e,n){for(const i of t)(0,ar.isIterable)(r=i)&&(0,ar.isntChar)(r)&&e(i,n)?yield*ur(i,e,n+1):yield i;var r}sr.flattenBy=function(t,e){return ur(t,e,1)};var cr,lr={};function hr(){if(cr)return lr;cr=1,lr.flattenDeep=void 0;const t=sr,e=mo();return lr.flattenDeep=function(n,r=1/0){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter depth must be an integer"),(0,e.assert)(r>=0,"The parameter depth must be greater than or equal to 0"),(0,t.flattenBy)(n,((t,e)=>e<=r))},lr}var fr,dr={};var yr={mapAsync:void 0};const pr=xe;yr.mapAsync=function(t,e){return(0,pr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)yield await e(r,n),n++}(t,e):async function*(t,e){let n=0;for(const r of t)yield await e(r,n),n++}(t,e)};var vr={};vr.map=void 0,vr.map=function*(t,e){let n=0;for(const r of t)yield e(r,n),n++};var mr,br={};function gr(){if(mr)return br;mr=1,br.repeatAsync=void 0;const t=Gt,e=mo();return br.repeatAsync=function(n,r){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter times must be an integer"),(0,e.assert)(r>=0,"The parameter times must be greater than or equal to 0"),r===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,t.go)((async function*(){const t=[];if(r>0){for await(const e of n)yield e,t.push(e);r--}for(;r>0;)yield*t,r--}))},br}var wr,xr={};function Tr(){if(wr)return xr;wr=1,xr.repeat=void 0;const t=Gt,e=mo();return xr.repeat=function(n,r){return(0,e.assert)(r===1/0||Number.isInteger(r),"The parameter times must be an integer"),(0,e.assert)(r>=0,"The parameter times must be greater than or equal to 0"),r===1/0&&function(){if("production"===process.env.NODE_ENV)return;console.warn("When iterable has no elements and times is Infinity, repeat() will be in dead loop")}(),(0,t.go)((function*(){const t=[];if(r>0){for(const e of n)yield e,t.push(e);r--}for(;r>0;)yield*t,r--}))},xr}var _r,Sr={};var Ar,Ir={};var Er={};Er.splitAsync=void 0,Er.splitAsync=async function*(t,e){let n=[];for await(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Or={splitByAsync:void 0};const Pr=xe;Or.splitByAsync=function(t,e){return(0,Pr.isAsyncIterable)(t)?async function*(t,e){let n=[],r=0;for await(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t,e):async function*(t,e){let n=[],r=0;for(const i of t)await e(i,r)?(yield n,n=[]):n.push(i),r++;yield n}(t,e)};var jr={};jr.splitBy=void 0,jr.splitBy=function*(t,e){let n=[],r=0;for(const i of t)e(i,r)?(yield n,n=[]):n.push(i),r++;yield n};var kr={};kr.split=void 0,kr.split=function*(t,e){let n=[];for(const r of t)r===e?(yield n,n=[]):n.push(r);yield n};var Nr,Mr={};var Br,Cr={};var zr,Fr={};var qr={takeUntilAsync:void 0};const Vr=xe;qr.takeUntilAsync=function(t,e){return(0,Vr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t){if(await e(r,n))break;yield r,n++}}(t,e):async function*(t,e){let n=0;for(const r of t){if(await e(r,n))break;yield r,n++}}(t,e)};var Dr={};Dr.takeUntil=void 0,Dr.takeUntil=function*(t,e){let n=0;for(const r of t){if(e(r,n))break;yield r,n++}};var Ur,Rr={};var Kr={tapAsync:void 0};const Lr=xe;Kr.tapAsync=function(t,e){return(0,Lr.isAsyncIterable)(t)?async function*(t,e){let n=0;for await(const r of t)await e(r,n),yield r,n++}(t,e):async function*(t,e){let n=0;for(const r of t)await e(r,n),yield r,n++}(t,e)};var Jr={};Jr.tap=void 0,Jr.tap=function*(t,e){let n=0;for(const r of t)e(r,n),yield r,n++};var Wr={};Wr.toAsyncIterable=void 0,Wr.toAsyncIterable=async function*(t){for(const e of t)yield e};var Yr={};Yr.transformAsync=void 0,Yr.transformAsync=async function*(t,e){yield*e(t)};var $r={};$r.transform=void 0,$r.transform=function*(t,e){yield*e(t)};var Hr={};Hr.uniqAsync=void 0,Hr.uniqAsync=async function*(t){const e=new Set;for await(const n of t)e.has(n)||(yield n,e.add(n))};var Xr={uniqByAsync:void 0};const Gr=xe;Xr.uniqByAsync=function(t,e){return(0,Gr.isAsyncIterable)(t)?async function*(t,e){const n=new Set;let r=0;for await(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t,e):async function*(t,e){const n=new Set;let r=0;for(const i of t){const t=await e(i,r);n.has(t)||(yield i,n.add(t)),r++}}(t,e)};var Qr={};Qr.uniqBy=void 0,Qr.uniqBy=function*(t,e){const n=new Set;let r=0;for(const i of t){const t=e(i,r);n.has(t)||(yield i,n.add(t)),r++}};var Zr={};Zr.uniq=void 0,Zr.uniq=function*(t){const e=new Set;for(const n of t)e.has(n)||(yield n,e.add(n))};var ti={zipAsync:void 0};const ei=xe;var ni;!function(t){t[t.Sync=0]="Sync",t[t.Async=1]="Async"}(ni||(ni={})),ti.zipAsync=function(t,...e){return async function*(...t){var e,n,r,i;const o=t.length,s=t.map((t=>(0,ei.isAsyncIterable)(t)?[ni.Async,t[Symbol.asyncIterator]()]:[ni.Sync,t[Symbol.iterator]()])),a=s.map((()=>!1));try{for(;;){const t=new Array(o);for(let e=0;e<o;e++){const[n,r]=s[e];let i;if(i=n===ni.Async?await r.next():r.next(),i.done)return void(a[e]=!0);t[e]=i.value}yield t}}finally{const t=s.filter(((t,e)=>!a[e]));for(const[o,s]of t)o===ni.Async?await(null===(n=(e=s).return)||void 0===n?void 0:n.call(e)):null===(i=(r=s).return)||void 0===i||i.call(r)}}(t,...e)};var ri,ii={};function oi(){return ri||(ri=1,function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(function(){if(ge)return Xt;ge=1,Xt.chunkAsync=void 0;const t=Gt,e=mo();return Xt.chunkAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter size must be an integer"),(0,e.assert)(r>0,"The parameter size must be greater than 0"),(0,t.go)((async function*(){let t=[];for await(const e of n)t.push(e),t.length>=r&&(yield t,t=[]);t.length&&(yield t)}))},Xt}(),t),r(we,t),r(On,t),r(function(){if(Pn)return jn;Pn=1,jn.chunk=void 0;const t=Gt,e=mo();return jn.chunk=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter size must be an integer"),(0,e.assert)(r>0,"The parameter size must be greater than 0"),(0,t.go)((function*(){let t=[];for(const e of n)t.push(e),t.length>=r&&(yield t,t=[]);t.length&&(yield t)}))},jn}(),t),r(kn,t),r(Bn,t),r(function(){if(zn)return Fn;zn=1,Fn.dropAsync=void 0;const t=Gt,e=qn,n=mo();return Fn.dropAsync=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyAsyncIterable)(r):(0,t.go)((async function*(){var t;const e=r[Symbol.asyncIterator]();let n;try{let r;for(;({value:r,done:n}=await e.next()),!(n||i<=0);)i--;for(;!n;)yield r,({value:r,done:n}=await e.next())}finally{n||await(null===(t=e.return)||void 0===t?void 0:t.call(e))}}))},Fn}(),t),r(function(){if(Vn)return Dn;Vn=1,Dn.dropRightAsync=void 0;const t=Gt,e=qn,n=mo();return Dn.dropRightAsync=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyAsyncIterable)(r):(0,t.go)((async function*(){const t=(await async function(t){const e=[];for await(const n of t)e.push(n);return e}(r)).slice(0,-i);for(const e of t)yield e}))},Dn}(),t),r(function(){if(Un)return Rn;Un=1,Rn.dropRight=void 0;const t=Gt,e=qn,n=mo();return Rn.dropRight=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyIterable)(r):(0,t.go)((function*(){const t=Array.from(r);yield*t.slice(0,-i)}))},Rn}(),t),r(Kn,t),r(Jn,t),r(function(){if(Wn)return Yn;Wn=1,Yn.drop=void 0;const t=Gt,e=qn,n=mo();return Yn.drop=function(r,i){return(0,n.assert)(Number.isInteger(i),"The parameter count must be an integer"),(0,n.assert)(i>=0,"The parameter count must be greater than or equal to 0"),0===i?(0,e.copyIterable)(r):(0,t.go)((function*(){var t;const e=r[Symbol.iterator]();let n;try{let r;for(;({value:r,done:n}=e.next()),!(n||i<=0);)i--;for(;!n;)yield r,({value:r,done:n}=e.next())}finally{n||null===(t=e.return)||void 0===t||t.call(e)}}))},Yn}(),t),r($n,t),r(Xn,t),r(function(){if(ir)return Gn;ir=1,Gn.flattenAsync=void 0;const t=or();return Gn.flattenAsync=function(e){return(0,t.flattenDeepAsync)(e,1)},Gn}(),t),r(Zn,t),r(sr,t),r(or(),t),r(hr(),t),r(function(){if(fr)return dr;fr=1,dr.flatten=void 0;const t=hr();return dr.flatten=function(e){return(0,t.flattenDeep)(e,1)},dr}(),t),r(yr,t),r(vr,t),r(gr(),t),r(Tr(),t),r(function(){if(_r)return Sr;_r=1,Sr.sliceAsync=void 0;const t=Gt,e=mo();return Sr.sliceAsync=function(n,r,i=1/0){return(0,e.assert)(Number.isInteger(r),"The parameter start must be an integer"),(0,e.assert)(r>=0,"The parameter start must be greater than or equal to 0"),(0,e.assert)(Number.isInteger(i),"The parameter end must be an integer"),(0,e.assert)(i>=r,"The parameter end must be greater than or equal to start"),(0,t.go)((async function*(){let t=0;for await(const e of n){if(t>=i)break;t>=r&&(yield e),t++}}))},Sr}(),t),r(function(){if(Ar)return Ir;Ar=1,Ir.slice=void 0;const t=Gt,e=mo();return Ir.slice=function(n,r,i=1/0){return(0,e.assert)(Number.isInteger(r),"The parameter start must be an integer"),(0,e.assert)(r>=0,"The parameter start must be greater than or equal to 0"),(0,e.assert)(Number.isInteger(i),"The parameter end must be an integer"),(0,e.assert)(i>=r,"The parameter end must be greater than or equal to start"),(0,t.go)((function*(){let t=0;for(const e of n){if(t>=i)break;t>=r&&(yield e),t++}}))},Ir}(),t),r(Er,t),r(Or,t),r(jr,t),r(kr,t),r(function(){if(Nr)return Mr;Nr=1,Mr.takeAsync=void 0;const t=Gt,e=mo();return Mr.takeAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((async function*(){if(0!==r)for await(const t of n)if(yield t,0==--r)break}))},Mr}(),t),r(function(){if(Br)return Cr;Br=1,Cr.takeRightAsync=void 0;const t=Gt,e=mo();return Cr.takeRightAsync=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((async function*(){var t;const e=n[Symbol.asyncIterator]();let i;try{const n=[];let o;for(;({value:o,done:i}=await e.next()),!i;)n.push(o),n.length>r&&n.shift();yield*n}finally{i||await(null===(t=e.return)||void 0===t?void 0:t.call(e))}}))},Cr}(),t),r(function(){if(zr)return Fr;zr=1,Fr.takeRight=void 0;const t=Gt,e=mo();return Fr.takeRight=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((function*(){var t;const e=n[Symbol.iterator]();let i;try{const n=[];let o;for(;({value:o,done:i}=e.next()),!i;)n.push(o),n.length>r&&n.shift();yield*n}finally{i||null===(t=e.return)||void 0===t||t.call(e)}}))},Fr}(),t),r(qr,t),r(Dr,t),r(function(){if(Ur)return Rr;Ur=1,Rr.take=void 0;const t=Gt,e=mo();return Rr.take=function(n,r){return(0,e.assert)(Number.isInteger(r),"The parameter count must be an integer"),(0,e.assert)(r>=0,"The parameter count must be greater than or equal to 0"),(0,t.go)((function*(){if(0!==r)for(const t of n)if(yield t,0==--r)break}))},Rr}(),t),r(Kr,t),r(Jr,t),r(Wr,t),r(Yr,t),r($r,t),r(Hr,t),r(Xr,t),r(Qr,t),r(Zr,t),r(ti,t),r(ii,t)}(Ht)),Ht}ii.zip=void 0,ii.zip=function(t,...e){return function*(...t){const e=t.length,n=t.map((t=>t[Symbol.iterator]())),r=n.map((()=>!1));try{for(;;){const t=new Array(e);for(let i=0;i<e;i++){const{value:e,done:o}=n[i].next();if(o)return void(r[i]=!0);t[i]=e}yield t}}finally{n.filter(((t,e)=>!r[e])).forEach((t=>{var e;return null===(e=t.return)||void 0===e?void 0:e.call(t)}))}}(t,...e)};var si={},ai={};ai.consume=void 0,ai.consume=function(t,e){return e(t)};var ui={eachAsync:void 0};const ci=xe;ui.eachAsync=function(t,e){return(0,ci.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t)await e(r,n),n++}(t,e):async function(t,e){let n=0;for(const r of t)await e(r,n),n++}(t,e)};var li={};li.each=void 0,li.each=function(t,e){let n=0;for(const r of t)e(r,n),n++};var hi={everyAsync:void 0};const fi=xe;hi.everyAsync=function(t,e){return(0,fi.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(!await e(r,n))return!1;n++}return!0}(t,e):async function(t,e){let n=0;for(const r of t){if(!await e(r,n))return!1;n++}return!0}(t,e)};var di={};di.every=void 0,di.every=function(t,e){let n=0;for(const r of t){if(!e(r,n))return!1;n++}return!0};var yi={findAsync:void 0};const pi=xe;yi.findAsync=function(t,e){return(0,pi.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(await e(r,n))return r;n++}return}(t,e):async function(t,e){let n=0;for(const r of t){if(await e(r,n))return r;n++}return}(t,e)};var vi={};vi.find=void 0,vi.find=function(t,e){let n=0;for(const r of t){if(e(r,n))return r;n++}};var mi={};mi.firstAsync=void 0,mi.firstAsync=async function(t){for await(const e of t)return e};var bi={};bi.first=void 0,bi.first=function(t){for(const e of t)return e};var gi={};gi.includesAsync=void 0,gi.includesAsync=async function(t,e){for await(const n of t)if(n===e)return!0;return!1};var wi={};wi.includes=void 0,wi.includes=function(t,e){for(const n of t)if(n===e)return!0;return!1};var xi={};xi.matchAsync=void 0,xi.matchAsync=async function(t,e){const n=e.length;let r=0;for await(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var Ti={};Ti.match=void 0,Ti.match=function(t,e){const n=e.length;let r=0;for(const i of t)if(i===e[r]&&r++,r===n)return!0;return!1};var _i={reduceAsync:void 0};const Si=xe;_i.reduceAsync=function(t,e,n){return(0,Si.isUndefined)(n)?function(t,e){return(0,Si.isAsyncIterable)(t)?n(t):r(t);async function n(t){var n;const r=t[Symbol.asyncIterator]();let i;try{let t,s=await o(r),a=1;for(;({value:t,done:i}=await r.next()),!i;)s=await e(s,t,a++);return s}finally{i||await(null===(n=r.return)||void 0===n?void 0:n.call(r))}async function o(t){const e=await t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}async function r(t){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=await e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}}(t,e):function(t,e,n){return(0,Si.isAsyncIterable)(t)?i(t):r(t);async function r(t){let r=n,i=0;for(const n of t)r=await e(r,n,i++);return r}async function i(t){let r=n,i=0;for await(const n of t)r=await e(r,n,i++);return r}}(t,e,n)};var Ai={reduce:void 0};const Ii=xe;Ai.reduce=function(t,e,n){return(0,Ii.isUndefined)(n)?function(t,e){var n;const r=t[Symbol.iterator]();let i;try{let t,s=o(r),a=1;for(;({value:t,done:i}=r.next()),!i;)s=e(s,t,a++);return s}finally{i||null===(n=r.return)||void 0===n||n.call(r)}function o(t){const e=t.next();if(e.done)throw i=!0,new Error("Reduce of empty iterable with no initial value");return e.value}}(t,e):function(t,e,n){let r=n,i=0;for(const n of t)r=e(r,n,i++);return r}(t,e,n)};var Ei={someAsync:void 0};const Oi=xe;Ei.someAsync=function(t,e){return(0,Oi.isAsyncIterable)(t)?async function(t,e){let n=0;for await(const r of t){if(await e(r,n))return!0;n++}return!1}(t,e):async function(t,e){let n=0;for(const r of t){if(await e(r,n))return!0;n++}return!1}(t,e)};var Pi={};Pi.some=void 0,Pi.some=function(t,e){let n=0;for(const r of t){if(e(r,n))return!0;n++}return!1};var ji={};ji.lastAsync=void 0,ji.lastAsync=async function(t){var e;const n=t[Symbol.asyncIterator]();let r;try{let t,i;for(;({value:t,done:r}=await n.next()),!r;)i=t;return i}finally{r||await(null===(e=n.return)||void 0===e?void 0:e.call(n))}};var ki={};ki.last=void 0,ki.last=function(t){var e;const n=t[Symbol.iterator]();let r;try{let t,i;for(;({value:t,done:r}=n.next()),!r;)i=t;return i}finally{r||null===(e=n.return)||void 0===e||e.call(n)}};var Ni={toArrayAsync:void 0};const Mi=ai;Ni.toArrayAsync=function(t){return(0,Mi.consume)(t,(async t=>{const e=[];for await(const n of t)e.push(n);return e}))};var Bi={toArray:void 0};const Ci=ai;Bi.toArray=function(t){return(0,Ci.consume)(t,(t=>Array.from(t)))};var zi={toSetAsync:void 0};const Fi=ai;zi.toSetAsync=function(t){return(0,Fi.consume)(t,(async t=>{const e=new Set;for await(const n of t)e.add(n);return e}))};var qi={toSet:void 0};const Vi=ai;qi.toSet=function(t){return(0,Vi.consume)(t,(t=>new Set(t)))};var Di={};Di.count=void 0,Di.count=function(t){let e=0;for(const n of t)e++;return e};var Ui={};Ui.countAsync=void 0,Ui.countAsync=async function(t){let e=0;for await(const n of t)e++;return e};var Ri={groupBy:void 0};const Ki=li;Ri.groupBy=function(t,e){const n=new Map;return(0,Ki.each)(t,((t,r)=>{const i=e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)})),n};var Li={groupByAsync:void 0};const Ji=ui;var Wi;function Yi(){return Wi||(Wi=1,function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(oi(),t),r(si,t)}($t)),$t}Li.groupByAsync=async function(t,e){const n=new Map;return await(0,Ji.eachAsync)(t,(async(t,r)=>{const i=await e(t,r);n.has(i)||n.set(i,[]),n.get(i).push(t)})),n},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(ai,t),r(ui,t),r(li,t),r(hi,t),r(di,t),r(yi,t),r(vi,t),r(mi,t),r(bi,t),r(gi,t),r(wi,t),r(xi,t),r(Ti,t),r(_i,t),r(Ai,t),r(Ei,t),r(Pi,t),r(ji,t),r(ki,t),r(Ni,t),r(Bi,t),r(zi,t),r(qi,t),r(Di,t),r(Ui,t),r(Ri,t),r(Li,t)}(si);var $i={},Hi={};Hi.traverseErrorPrototypeChain=void 0,Hi.traverseErrorPrototypeChain=function*(t){let e=t;for(;(e=Object.getPrototypeOf(e))&&(yield e,e!==Error.prototype););},$i.getErrorNames=void 0;const Xi=n,Gi=Hi;$i.getErrorNames=function*(t){var e;if((0,Xi.isError)(t))for(const n of(0,Gi.traverseErrorPrototypeChain)(t))(null===(e=n.constructor)||void 0===e?void 0:e.name)&&(yield n.constructor.name);else yield t.name,yield*t.ancestors};var Qi={isSerializableError:void 0};const Zi=n;var to;function eo(){if(to)return Yt;to=1,Yt.CustomError=void 0;const t=Yi(),e=$i,r=n,i=Qi;class o extends Error{get name(){var n,r;return null!==(r=null!==(n=(0,t.first)((0,e.getErrorNames)(this)))&&void 0!==n?n:o.name)&&void 0!==r?r:"CustomError"}static[Symbol.hasInstance](n){var o;if((0,r.isError)(n)||(0,i.isSerializableError)(n)){const r=[null!==(o=this.prototype.constructor.name)&&void 0!==o?o:this.name,...(0,e.getErrorNames)(this.prototype)].reverse(),i=(0,t.toArray)((0,e.getErrorNames)(n)).reverse();return r.every(((t,e)=>t===i[e]))}return!1}}return Yt.CustomError=o,Yt}Qi.isSerializableError=function(t){return(0,Zi.isObject)(t)&&(0,Zi.isString)(t.name)&&(0,Zi.isString)(t.message)&&((0,Zi.isString)(t.stack)||(0,Zi.isNull)(t.stack))&&(0,Zi.isArray)(t.ancestors)&&t.ancestors.every(Zi.isString)};var no,ro={};function io(){if(no)return ro;no=1,ro.AssertionError=void 0;const t=eo();class e extends t.CustomError{}return ro.AssertionError=e,ro}var oo,so={};var ao={},uo={},co={};co.pass=void 0,co.pass=function(){};var lo={};lo.passAsync=void 0,lo.passAsync=async function(){},function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(co,t),r(lo,t)}(uo),ao.hydrate=void 0;const ho=uo;function fo(t,e){const n=function(){(0,ho.pass)()};return(n.prototype=Object.create(t.prototype)).constructor=n,Object.defineProperty(n,"name",{value:e}),n}ao.hydrate=function(t){var e;const n=[t.name,...t.ancestors].slice(0,-1).reverse();let r=Error;for(const t of n)r=fo(r,t);const i=new r;return i.name=t.name,i.message=t.message,i.stack=null!==(e=t.stack)&&void 0!==e?e:void 0,i};var yo,po,vo={};function mo(){return po||(po=1,function(t){var n=e&&e.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(e,n);i&&!("get"in i?!e.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,r,i)}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),r=e&&e.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};r(eo(),t),r(io(),t),r(Qi,t),r(function(){if(oo)return so;oo=1,so.normalize=void 0;const t=$i,e=Yi();return so.normalize=function(n){var r;const[i,...o]=(0,e.toArray)((0,t.getErrorNames)(n));return{name:i,ancestors:o,message:n.message,stack:null!==(r=n.stack)&&void 0!==r?r:null}},so}(),t),r(ao,t),r(function(){if(yo)return vo;yo=1,vo.assert=void 0;const t=io();return vo.assert=function(e,n){if(!e)throw new t.AssertionError(n)},vo}(),t),r($i,t),r(Hi,t)}(Wt)),Wt}var bo=mo(),go=Yi();class wo{constructor(t){this.map=new Map,bo.assert(Number.isInteger(t),"The parameter limit must be an integer"),bo.assert(t>0,"The parameter limit must be a positive value"),this.limit=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e){return this.map.has(t)?this.updateItem(t,e):(this.map.size===this.limit&&this.map.delete(this.getColdestKey()),this.map.set(t,e)),this}has(t){return this.map.has(t)}get(t){if(!this.has(t))return;const e=this.map.get(t);return this.updateItem(t,e),e}delete(t){return this.map.delete(t)}clear(){this.map.clear()}updateItem(t,e){this.map.delete(t),this.map.set(t,e)}getColdestKey(){return go.first(this.map.keys())}}class xo{constructor(){this.map=new Map,this.itemMetadataSortedByExpirationTime=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e,n){return this.map.set(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n),this}has(t){return this.map.has(t)}get(t){return this.map.get(t)}delete(t){const e=this.map.delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;this.map.clear(),null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>this.map.delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=ee.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));this.cancelClearTimeout=()=>{e(),this.cancelClearTimeout=void 0}}}}}class To{constructor(t){this.map=new Map,this.itemMetadataSortedByExpirationTime=[],bo.assert(Number.isInteger(t),"The parameter limit must be an integer"),bo.assert(t>0,"The parameter limit must be a positive value"),this.limit=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.map.size}set(t,e,n){return this.map.has(t)?(this.updateItem(t,e),this.removeItemMetadata(t),this.addItemMetadata(t,Date.now()+n)):(this.map.size===this.limit&&this.map.delete(this.getColdestKey()),this.map.set(t,e),this.addItemMetadata(t,Date.now()+n)),this}has(t){return this.map.has(t)}get(t){if(this.has(t)){const e=this.map.get(t);return this.updateItem(t,e),e}}delete(t){const e=this.map.delete(t);if(e){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout()}return e}clear(){var t;this.map.clear(),null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime=[]}updateItem(t,e){this.map.delete(t),this.map.set(t,e)}addItemMetadata(t,e){for(let n=0;n<this.itemMetadataSortedByExpirationTime.length;n++){if(e<this.itemMetadataSortedByExpirationTime[n].expirationTime)return this.itemMetadataSortedByExpirationTime.splice(n,0,{key:t,expirationTime:e}),void(0===n&&this.rescheduleClearTimeout())}this.itemMetadataSortedByExpirationTime.push({key:t,expirationTime:e}),1===this.itemMetadataSortedByExpirationTime.length&&this.rescheduleClearTimeout()}removeItemMetadata(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.key===t));e>=0&&(this.itemMetadataSortedByExpirationTime.splice(e,1),0===e&&this.rescheduleClearTimeout())}clearExpiredItems(t){const e=this.itemMetadataSortedByExpirationTime.findIndex((e=>e.expirationTime>t));(e>=0?this.itemMetadataSortedByExpirationTime.splice(0,e):this.itemMetadataSortedByExpirationTime.splice(0,this.itemMetadataSortedByExpirationTime.length)).forEach((t=>this.map.delete(t.key)))}rescheduleClearTimeout(){var t;if(null===(t=this.cancelClearTimeout)||void 0===t||t.call(this),this.itemMetadataSortedByExpirationTime.length>0){const t=this.itemMetadataSortedByExpirationTime[0];if(Number.isFinite(t.expirationTime)){const e=ee.setSchedule(t.expirationTime,(()=>{this.clearExpiredItems(Date.now()),this.rescheduleClearTimeout()}));this.cancelClearTimeout=()=>{e(),this.cancelClearTimeout=void 0}}}}getColdestKey(){return go.first(this.map.keys())}}class _o{constructor(t){this.value=t,this.children=new Map}}class So{constructor(){this.root=new _o}get[Symbol.toStringTag](){return this.constructor.name}*entries(){yield*function*t(e,r){for(const[i,o]of e.children){const e=[...r,i];n.isntUndefined(o.value)&&(yield[e,o.value]),yield*t(o,e)}}(this.root,[])}keys(){return go.map(this.entries(),(([t])=>t))}values(){return go.map(this.entries(),(([t,e])=>e))}set(t,e){let n=this.root;for(const e of t)n.children.has(e)||n.children.set(e,new _o),n=n.children.get(e);return n.value=e,this}has(t){let e=this.root;for(const n of t){if(!e.children.has(n))return!1;e=e.children.get(n)}return void 0!==e.value}get(t){let e=this.root;for(const n of t){if(!e.children.has(n))return;e=e.children.get(n)}return e.value}delete(t){const e=[];let n=this.root;for(const r of t){if(!n.children.has(r))return!1;e.push(n),n=n.children.get(r)}if(delete n.value,0===n.children.size)for(const[n,r]of go.toArray(go.zip(t,e)).reverse())if(r.children.delete(n),0!==r.children.size)break;return!0}}class Ao{constructor(t,e){this.schema=t,this._state=e}get[Symbol.toStringTag](){return this.constructor.name}get state(){return this._state}matches(t){return this._state===t}can(t){return t in this.schema[this.state]}send(t){if(!this.can(t))throw new Io(this.state,t);this._state=this.schema[this.state][t]}}class Io extends bo.CustomError{constructor(t,e){super(`State ${t} cannot react to event ${e}`)}}
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -12,5 +12,5 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var Eo=function(t,e){return(Eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function Oo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Eo(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Po(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function jo(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function ko(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function No(t){return"function"==typeof t}function Mo(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Bo=Mo((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Co(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var zo=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Po(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(No(u))try{u()}catch(t){i=t instanceof Bo?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=Po(c),h=l.next();!h.done;h=l.next()){var f=h.value;try{Vo(f)}catch(t){i=null!=i?i:[],t instanceof Bo?i=ko(ko([],jo(i)),jo(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new Bo(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Vo(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Co(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&Co(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Fo=zo.EMPTY;function qo(t){return t instanceof zo||t&&"closed"in t&&No(t.remove)&&No(t.add)&&No(t.unsubscribe)}function Vo(t){No(t)?t():t.unsubscribe()}var Do={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Uo=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,ko([t,e],jo(n)))};function Ro(){}function Ko(t){t()}var Lo=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,qo(e)&&e.add(n)):n.destination=Xo,n}return Oo(e,t),e.create=function(t,e,n){return new $o(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(zo),Jo=Function.prototype.bind;function Wo(t,e){return Jo.call(t,e)}var Yo=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Ho(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Ho(t)}else Ho(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Ho(t)}},t}(),$o=function(t){function e(e,n,r){var i,o,s=t.call(this)||this;No(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Do.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},i={next:e.next&&Wo(e.next,o),error:e.error&&Wo(e.error,o),complete:e.complete&&Wo(e.complete,o)}):i=e;return s.destination=new Yo(i),s}return Oo(e,t),e}(Lo);function Ho(t){var e;e=t,Uo((function(){throw e}))}var Xo={closed:!0,next:Ro,error:function(t){throw t},complete:Ro},Go="function"==typeof Symbol&&Symbol.observable||"@@observable";function Qo(t){return t}function Zo(t){return 0===t.length?Qo:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ts=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Lo||function(t){return t&&No(t.next)&&No(t.error)&&No(t.complete)}(r)&&qo(r)?t:new $o(t,e,n);return Ko((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=es(e))((function(e,r){var i=new $o({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Go]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Zo(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=es(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function es(t){var e;return null!==(e=null!=t?t:Do.Promise)&&void 0!==e?e:Promise}function ns(t){return No(null==t?void 0:t.lift)}function rs(t,e,n,r,i){return new is(t,e,n,r,i)}var is=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return Oo(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(Lo);function os(){return t=function(t,e){var n=null;t._refCount++;var r=rs(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())},function(e){if(ns(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")};var t}!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,ns(e)&&(r.lift=e.lift),r}Oo(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new zo;var n=this.getSubject();e.add(this.source.subscribe(rs(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=zo.EMPTY)}return e},e.prototype.refCount=function(){return os()(this)}}(ts);var ss,as,us={now:function(){return(us.delegate||performance).now()},delegate:void 0},cs={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new zo((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=cs.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,ko([],jo(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,ko([],jo(t)))},delegate:void 0};as=cs.schedule,new ts((function(t){var e=new zo,n=ss||us,r=n.now(),i=function(o){var s=n.now();t.next({timestamp:ss?s:o,elapsed:s-r}),t.closed||e.add(as(i))};return e.add(as(i)),e}));var ls=Mo((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),hs=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Oo(e,t),e.prototype.lift=function(t){var e=new fs(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new ls},e.prototype.next=function(t){var e=this;Ko((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=Po(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Ko((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Ko((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?Fo:(this.currentObservers=null,o.push(t),new zo((function(){e.currentObservers=null,Co(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new ts;return t.source=this,t},e.create=function(t,e){return new fs(t,e)},e}(ts),fs=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Oo(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:Fo},e}(hs);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}Oo(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(hs);var ds={now:function(){return(ds.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=ds);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}Oo(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}}}(hs),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}Oo(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,s=e.isStopped,a=e._isComplete;n?t.error(o):(s||a)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(hs);var ys,ps=function(t){function e(e,n){return t.call(this)||this}return Oo(e,t),e.prototype.schedule=function(t,e){return this},e}(zo),vs=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,ko([t,e],jo(n)))},ms=function(t){return clearInterval(t)},bs=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return Oo(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),vs(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;ms(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Co(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(ps),gs=1,ws={};function xs(t){return t in ws&&(delete ws[t],!0)}var Ts=function(t){var e=gs++;return ws[e]=!0,ys||(ys=Promise.resolve()),ys.then((function(){return xs(e)&&t()})),e},_s=function(t){xs(t)},As={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=As.delegate;return((null==n?void 0:n.setImmediate)||Ts).apply(void 0,ko([],jo(t)))},clearImmediate:function(t){return _s(t)},delegate:void 0},Ss=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=As.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(As.clearImmediate(n),e._scheduled=void 0)},e}(bs),Is=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=ds.now,t}(),Es=function(t){function e(e,n){void 0===n&&(n=Is.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return Oo(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(Is);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Es))(Ss),new Es(bs);var Os=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e}(Es))(Os);var Ps=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=cs.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(cs.cancelAnimationFrame(n),e._scheduled=void 0)},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Es))(Ps),function(t){function e(e,n){void 0===e&&(e=ks),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}Oo(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(Es);var js,ks=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return Oo(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return zo.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(bs);new ts((function(t){return t.complete()})),function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(js||(js={})),Mo((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),Mo((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),Mo((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),Mo((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}})),Mo((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}})),new ts(Ro);class Ns extends So{constructor(){super(...arguments),this.stateChanges=new hs}get[Symbol.toStringTag](){return this.constructor.name}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const r=this.state;this.stateChanges.next({event:t,oldState:e,newState:r}),n.isEmptyObject(this.schema[r])&&this.stateChanges.complete()}}class Ms{constructor(t=[]){this.indexToValue=[];const e=[];if(t.length>0)for(const[n,r]of t.entries())e[r]=n;this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.indexToValue[Symbol.iterator]()}values(){return this.indexToValue[Symbol.iterator]()}has(t){return t in this.valueToIndex}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){if(this.has(t)){const e=this.indexToValue.pop();if(t===e)delete this.valueToIndex[t];else{const n=this.valueToIndex[t];this.indexToValue[n]=e,this.valueToIndex[e]=n,delete this.valueToIndex[t]}return!0}return!1}}class Bs{constructor(){this.keyToIndex=[],this.indexToKey=[],this.indexToValue=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalArray(){return this.indexToValue}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue[t]]}keys(){return this.indexToKey.values()}values(){return this.indexToValue.values()}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){return t in this.keyToIndex}get(t){if(this.has(t)){const e=this.keyToIndex[t];return this.indexToValue[e]}}set(t,e){if(this.has(t)){const n=this.keyToIndex[t];this.indexToValue[n]=e}else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){if(this.has(t)){const e=this.indexToKey.pop(),n=this.indexToValue.pop();if(t===e)delete this.keyToIndex[t];else{const r=this.keyToIndex[t];this.indexToKey[r]=e,this.indexToValue[r]=n,this.keyToIndex[e]=r,delete this.keyToIndex[t]}}}}class Cs{constructor(t){this.keyToIndex=[],this.indexToKey=[],bo.assert(0===t.length,"array should be empty"),this.indexToValue=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalTypedArray(){return this.indexToValue.internalTypedArray}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue.internalTypedArray[t]]}keys(){return this.indexToKey.values()}*values(){for(let t=0;t<this.indexToKey.length;t++)yield this.indexToValue.internalTypedArray[t]}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t}get(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t?this.indexToValue.internalTypedArray[e]:void 0}set(t,e){const n=this.keyToIndex[t];if(this.indexToKey[n]===t)this.indexToValue.internalTypedArray[n]=e;else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){const e=this.keyToIndex[t];if(this.indexToKey[e]===t){const n=this.indexToKey.pop(),r=this.indexToValue.pop();t!==n&&(this.indexToKey[e]=n,this.indexToValue.internalTypedArray[e]=r,this.keyToIndex[n]=e)}}}class zs{constructor(t){const e=[];if(t.length>0)for(const[n,r]of t.internalTypedArray.entries())e[r]=n;this.indexToValue=t,this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}*values(){for(let t=0;t<this.indexToValue.length;t++)yield this.indexToValue.internalTypedArray[t]}has(t){const e=this.valueToIndex[t];return this.indexToValue.internalTypedArray[e]===t}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){const e=this.valueToIndex[t];if(this.indexToValue.internalTypedArray[e]===t){const n=this.indexToValue.pop();return t!==n&&(this.indexToValue.internalTypedArray[e]=n,this.valueToIndex[n]=e),!0}return!1}}class Fs{constructor(t,{capacity:e=0,growthFactor:n=1.5}={}){this.typedArrayConstructor=t,this._length=0,bo.assert(Number.isInteger(e),"capacity must be an integer"),bo.assert(e>=0,"capacity must be greater than or equal to 0"),bo.assert(n>=1,"growthFactory must be greater than or equal to 1"),this.array=new t(e),this.growthFactor=n}get internalTypedArray(){return this.array}get[Symbol.toStringTag](){return this.constructor.name}get capacity(){return this.array.length}get length(){return this._length}set(t,e){if(t>=this.capacity){const e=qs(this.capacity,t+1,this.growthFactor);this.resize(e)}t>=this._length&&(this._length=t+1),this.array[t]=e}get(t){return t<this._length?this.array[t]:void 0}push(...t){const e=this._length+t.length;if(e>this.capacity){const t=qs(this.capacity,e,this.growthFactor);this.resize(t)}for(const e of t)this.array[this._length++]=e}pop(){if(this._length>0){const t=this.array[this._length-1];this._length--;const e=qs(this.capacity,this.length,this.growthFactor);return this.resize(e),t}}sort(t){const e=this.capacity;this.resize(this.length),this.array.sort(t),this.resize(e)}resize(t){if(this.array.length!==t)if(this.array.length<t){const e=new this.typedArrayConstructor(t);e.set(this.array),this.array=e}else if(this.array.length>t){const e=new this.typedArrayConstructor(t);for(let n=t;n--;)e[n]=this.array[n];this.array=e}}}function qs(t,e,n){if(1===n)return e;if(t===e)return e;if(t<e){let r=Math.max(t,1);for(;r<e;)r*=n;return Math.floor(r)}if(0===e)return 0;{let r=t;for(;;){const t=r/n;if(t<e)break;r=t}return Math.floor(r)}}class Vs{constructor(t){this.value=t,this.previous=null,this.next=null,this.up=null,this.down=null}}class Ds{constructor(t){this.compare=t,this.head=new Vs(null),this.tail=new Vs(null),this.height=0,this._size=0,this.head.next=this.tail,this.tail.previous=this.head}get size(){return this._size}*elements(){let t=this.head;for(;t.down;)t=t.down;for(;t.next&&n.isntNull(t.next.value);)t=t.next,yield t}dumpList(){const t=[];let e=this.head;do{t.push([]);let n=e;do{t[t.length-1].push(n.value),n=n.next}while(n)}while(e=e.down);return t}delete(t){let e=this.findNode(t);for(;e;)e.previous.next=e.next,e.next.previous=e.previous,e=e.down;this._size--}has(t){return n.isntNull(this.findNode(t))}findNode(t){let e=this.head;for(;;){for(;e.next&&n.isntNull(e.next.value);){const n=this.compare(e.next.value,t);if(0===n)return e.next;if(!(n<0))break;e=e.next}if(!e.down)return null;e=e.down}}add(t){let e=this.findPreviousNode(t);if(e.next&&n.isntNull(e.next.value)&&0===this.compare(e.next.value,t))return;let r=new Vs(t);e.next&&(r.next=e.next,e.next.previous=r),e.next=r,r.previous=e;let i=0;for(;Math.random()<.5;){if(i===this.height){const t=new Vs(null),e=new Vs(null);t.next=e,t.down=this.head,e.previous=t,e.down=this.tail,this.head.up=t,this.tail.up=e,this.head=t,this.tail=e,this.height++}for(;!e.up;)e=e.previous;e=e.up;const n=new Vs(t);e.next&&(n.next=e.next,e.next.previous=n),e.next=n,n.previous=e,n.down=r,r.up=n,r=n,i++}this._size++}findPreviousNode(t){let e=this.head;for(;;){for(;e.next&&n.isntNull(e.next.value);){if(this.compare(e.next.value,t)>=0)break;e=e.next}if(!e.down)return e;e=e.down}}}class Us{constructor(t){this.skipList=new Ds(t)}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}values(){return go.map(this.skipList.elements(),(t=>t.value))}has(t){return this.skipList.has(t)}add(t){this.skipList.add(t)}delete(t){this.skipList.delete(t)}}class Rs{constructor(t=8){this.bitsPerElement=t,this.array=[],this.length=0,this._size=0}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this._size}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){const e=this.array[t];for(let n=0;n<this.bitsPerElement;n++){const r=this.getMask(n);(e&r)===r&&(yield t*this.bitsPerElement+n)}}const r=this.array[t-1];for(let t=0;t<e;t++){const e=this.getMask(t);(r&e)===e&&(yield n*this.bitsPerElement+t)}}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array[n])&&void 0!==e?e:0)&r)===r}add(t){var e;bo.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;this.array[n]=i|r;(i&r)!==r&&this._size++}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;this.array[n]=i&~r;const o=(i&r)===r;return o&&this._size--,o}clear(){for(let t=this.array.length;t--;)this.array[t]=0}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}class Ks{constructor(t){this.array=t,this.bitsPerElement=8*this.array.internalTypedArray.BYTES_PER_ELEMENT,this.length=0,this._size=0}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this._size}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){const e=this.array.internalTypedArray[t];for(let n=0;n<this.bitsPerElement;n++){const r=this.getMask(n);(e&r)===r&&(yield t*this.bitsPerElement+n)}}const r=this.array.internalTypedArray[t-1];for(let t=0;t<e;t++){const e=this.getMask(t);(r&e)===e&&(yield n*this.bitsPerElement+t)}}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array.internalTypedArray[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array.get(n))&&void 0!==e?e:0)&r)===r}add(t){var e;bo.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;this.array.set(n,i|r);(i&r)!==r&&this._size++}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;this.array.set(n,i&~r);const o=(i&r)===r;return o&&this._size--,o}clear(){for(let t=this.array.length;t--;)this.array.set(t,0)}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}export{Io as BadEventError,Rs as BitSet,t as Box,Fs as DynamicTypedArray,Rt as Emitter,xo as ExpirableMap,So as FiniteStateMachine,Kt as HashMap,Lt as HashSet,wo as LRUMap,Ns as ObservableFiniteStateMachine,Jt as Queue,Us as SortedSet,Bs as SparseMap,Ms as SparseSet,To as TLRUMap,Ao as TrieMap,Ks as TypedBitSet,Cs as TypedSparseMap,zs as TypedSparseSet,Ft as convertArrayToCons,zt as convertConsToArray,qt as sliceArrayLeft,Vt as sliceArrayRight,Dt as truncateArrayLeft,Ut as truncateArrayRight};
15
+ ***************************************************************************** */var Eo=function(t,e){return(Eo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)};function Oo(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}Eo(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function Po(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function jo(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function ko(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function No(t){return"function"==typeof t}function Mo(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Bo=Mo((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Co(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var zo=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Po(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var u=this.initialTeardown;if(No(u))try{u()}catch(t){i=t instanceof Bo?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var l=Po(c),h=l.next();!h.done;h=l.next()){var f=h.value;try{Vo(f)}catch(t){i=null!=i?i:[],t instanceof Bo?i=ko(ko([],jo(i)),jo(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{h&&!h.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}if(i)throw new Bo(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)Vo(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Co(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&Co(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Fo=zo.EMPTY;function qo(t){return t instanceof zo||t&&"closed"in t&&No(t.remove)&&No(t.add)&&No(t.unsubscribe)}function Vo(t){No(t)?t():t.unsubscribe()}var Do={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Uo=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,ko([t,e],jo(n)))};function Ro(){}function Ko(t){t()}var Lo=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,qo(e)&&e.add(n)):n.destination=Xo,n}return Oo(e,t),e.create=function(t,e,n){return new $o(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(zo),Jo=Function.prototype.bind;function Wo(t,e){return Jo.call(t,e)}var Yo=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){Ho(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){Ho(t)}else Ho(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){Ho(t)}},t}(),$o=function(t){function e(e,n,r){var i,o,s=t.call(this)||this;No(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:s&&Do.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},i={next:e.next&&Wo(e.next,o),error:e.error&&Wo(e.error,o),complete:e.complete&&Wo(e.complete,o)}):i=e;return s.destination=new Yo(i),s}return Oo(e,t),e}(Lo);function Ho(t){var e;e=t,Uo((function(){throw e}))}var Xo={closed:!0,next:Ro,error:function(t){throw t},complete:Ro},Go="function"==typeof Symbol&&Symbol.observable||"@@observable";function Qo(t){return t}function Zo(t){return 0===t.length?Qo:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var ts=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof Lo||function(t){return t&&No(t.next)&&No(t.error)&&No(t.complete)}(r)&&qo(r)?t:new $o(t,e,n);return Ko((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=es(e))((function(e,r){var i=new $o({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Go]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Zo(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=es(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function es(t){var e;return null!==(e=null!=t?t:Do.Promise)&&void 0!==e?e:Promise}function ns(t){return No(null==t?void 0:t.lift)}function rs(t,e,n,r,i){return new is(t,e,n,r,i)}var is=function(t){function e(e,n,r,i,o,s){var a=t.call(this,e)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,a._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,a._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,a}return Oo(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(Lo);function os(){return t=function(t,e){var n=null;t._refCount++;var r=rs(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())},function(e){if(ns(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")};var t}!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,ns(e)&&(r.lift=e.lift),r}Oo(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new zo;var n=this.getSubject();e.add(this.source.subscribe(rs(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=zo.EMPTY)}return e},e.prototype.refCount=function(){return os()(this)}}(ts);var ss,as,us={now:function(){return(us.delegate||performance).now()},delegate:void 0},cs={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new zo((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=cs.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,ko([],jo(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,ko([],jo(t)))},delegate:void 0};as=cs.schedule,new ts((function(t){var e=new zo,n=ss||us,r=n.now(),i=function(o){var s=n.now();t.next({timestamp:ss?s:o,elapsed:s-r}),t.closed||e.add(as(i))};return e.add(as(i)),e}));var ls=Mo((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),hs=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return Oo(e,t),e.prototype.lift=function(t){var e=new fs(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new ls},e.prototype.next=function(t){var e=this;Ko((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=Po(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;Ko((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Ko((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?Fo:(this.currentObservers=null,o.push(t),new zo((function(){e.currentObservers=null,Co(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new ts;return t.source=this,t},e.create=function(t,e){return new fs(t,e)},e}(ts),fs=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return Oo(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:Fo},e}(hs);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}Oo(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(hs);var ds={now:function(){return(ds.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=ds);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}Oo(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,s=n._timestampProvider,a=n._windowTime;r||(i.push(e),!o&&i.push(s.now()+a)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var s=n.now(),a=0,u=1;u<r.length&&r[u]<=s;u+=2)a=u;a&&r.splice(0,a+1)}}}(hs),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}Oo(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,s=e.isStopped,a=e._isComplete;n?t.error(o):(s||a)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(hs);var ys,ps=function(t){function e(e,n){return t.call(this)||this}return Oo(e,t),e.prototype.schedule=function(t,e){return this},e}(zo),vs=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,ko([t,e],jo(n)))},ms=function(t){return clearInterval(t)},bs=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return Oo(e,t),e.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t;var n=this.id,r=this.scheduler;return null!=n&&(this.id=this.recycleAsyncId(r,n,e)),this.pending=!0,this.delay=e,this.id=this.id||this.requestAsyncId(r,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),vs(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;ms(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,Co(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(ps),gs=1,ws={};function xs(t){return t in ws&&(delete ws[t],!0)}var Ts=function(t){var e=gs++;return ws[e]=!0,ys||(ys=Promise.resolve()),ys.then((function(){return xs(e)&&t()})),e},_s=function(t){xs(t)},Ss={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ss.delegate;return((null==n?void 0:n.setImmediate)||Ts).apply(void 0,ko([],jo(t)))},clearImmediate:function(t){return _s(t)},delegate:void 0},As=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Ss.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(Ss.clearImmediate(n),e._scheduled=void 0)},e}(bs),Is=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=ds.now,t}(),Es=function(t){function e(e,n){void 0===n&&(n=Is.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r._scheduled=void 0,r}return Oo(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(Is);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Es))(As),new Es(bs);var Os=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e}(Es))(Os);var Ps=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return Oo(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=cs.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);e.actions.some((function(t){return t.id===n}))||(cs.cancelAnimationFrame(n),e._scheduled=void 0)},e}(bs);new(function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Oo(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(Es))(Ps),function(t){function e(e,n){void 0===e&&(e=ks),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}Oo(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(Es);var js,ks=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return Oo(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return zo.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),!0},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(bs);new ts((function(t){return t.complete()})),function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(js||(js={})),Mo((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),Mo((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),Mo((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),Mo((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}})),Mo((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}})),new ts(Ro);class Ns extends Ao{constructor(){super(...arguments),this.stateChanges=new hs}get[Symbol.toStringTag](){return this.constructor.name}observeStateChanges(){return this.stateChanges}send(t){const e=this.state;super.send(t);const r=this.state;this.stateChanges.next({event:t,oldState:e,newState:r}),n.isEmptyObject(this.schema[r])&&this.stateChanges.complete()}}class Ms{constructor(t=[]){this.indexToValue=[];const e=[];if(t.length>0)for(const[n,r]of t.entries())e[r]=n;this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.indexToValue[Symbol.iterator]()}values(){return this.indexToValue[Symbol.iterator]()}has(t){return t in this.valueToIndex}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){if(this.has(t)){const e=this.indexToValue.pop();if(t===e)delete this.valueToIndex[t];else{const n=this.valueToIndex[t];this.indexToValue[n]=e,this.valueToIndex[e]=n,delete this.valueToIndex[t]}return!0}return!1}}class Bs{constructor(){this.keyToIndex=[],this.indexToKey=[],this.indexToValue=[]}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalArray(){return this.indexToValue}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue[t]]}keys(){return this.indexToKey.values()}values(){return this.indexToValue.values()}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){return t in this.keyToIndex}get(t){if(this.has(t)){const e=this.keyToIndex[t];return this.indexToValue[e]}}set(t,e){if(this.has(t)){const n=this.keyToIndex[t];this.indexToValue[n]=e}else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){if(this.has(t)){const e=this.indexToKey.pop(),n=this.indexToValue.pop();if(t===e)delete this.keyToIndex[t];else{const r=this.keyToIndex[t];this.indexToKey[r]=e,this.indexToValue[r]=n,this.keyToIndex[e]=r,delete this.keyToIndex[t]}}}}class Cs{constructor(t){this.keyToIndex=[],this.indexToKey=[],bo.assert(0===t.length,"array should be empty"),this.indexToValue=t}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this.indexToKey.length}get internalTypedArray(){return this.indexToValue.internalTypedArray}*entries(){for(let t=0;t<this.indexToKey.length;t++)yield[this.indexToKey[t],this.indexToValue.internalTypedArray[t]]}keys(){return this.indexToKey.values()}*values(){for(let t=0;t<this.indexToKey.length;t++)yield this.indexToValue.internalTypedArray[t]}getInternalIndexOfKey(t){return this.keyToIndex[t]}has(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t}get(t){const e=this.keyToIndex[t];return this.indexToKey[e]===t?this.indexToValue.internalTypedArray[e]:void 0}set(t,e){const n=this.keyToIndex[t];if(this.indexToKey[n]===t)this.indexToValue.internalTypedArray[n]=e;else{const n=this.indexToKey.length;this.indexToKey.push(t),this.indexToValue.push(e),this.keyToIndex[t]=n}}delete(t){const e=this.keyToIndex[t];if(this.indexToKey[e]===t){const n=this.indexToKey.pop(),r=this.indexToValue.pop();t!==n&&(this.indexToKey[e]=n,this.indexToValue.internalTypedArray[e]=r,this.keyToIndex[n]=e)}}}class zs{constructor(t){const e=[];if(t.length>0)for(const[n,r]of t.internalTypedArray.entries())e[r]=n;this.indexToValue=t,this.valueToIndex=e}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}*values(){for(let t=0;t<this.indexToValue.length;t++)yield this.indexToValue.internalTypedArray[t]}has(t){const e=this.valueToIndex[t];return this.indexToValue.internalTypedArray[e]===t}add(t){if(!this.has(t)){const e=this.indexToValue.length;this.indexToValue.push(t),this.valueToIndex[t]=e}}delete(t){const e=this.valueToIndex[t];if(this.indexToValue.internalTypedArray[e]===t){const n=this.indexToValue.pop();return t!==n&&(this.indexToValue.internalTypedArray[e]=n,this.valueToIndex[n]=e),!0}return!1}}class Fs{constructor(t,{capacity:e=0,growthFactor:n=1.5}={}){this.typedArrayConstructor=t,this._length=0,bo.assert(Number.isInteger(e),"capacity must be an integer"),bo.assert(e>=0,"capacity must be greater than or equal to 0"),bo.assert(n>=1,"growthFactory must be greater than or equal to 1"),this.array=new t(e),this.growthFactor=n}get internalTypedArray(){return this.array}get[Symbol.toStringTag](){return this.constructor.name}get BYTES_PER_ELEMENT(){return this.typedArrayConstructor.BYTES_PER_ELEMENT}get capacity(){return this.array.length}get length(){return this._length}set(t,e){if(t>=this.capacity){const e=qs(this.capacity,t+1,this.growthFactor);this.resize(e)}t>=this._length&&(this._length=t+1),this.array[t]=e}get(t){return t<this._length?this.array[t]:void 0}push(...t){const e=this._length+t.length;if(e>this.capacity){const t=qs(this.capacity,e,this.growthFactor);this.resize(t)}for(const e of t)this.array[this._length++]=e}pop(){if(this._length>0){const t=this.array[this._length-1];this._length--;const e=qs(this.capacity,this.length,this.growthFactor);return this.resize(e),t}}sort(t){const e=this.capacity;this.resize(this.length),this.array.sort(t),this.resize(e)}resize(t){if(this.array.length!==t)if(this.array.length<t){const e=new this.typedArrayConstructor(t);e.set(this.array),this.array=e}else if(this.array.length>t){const e=new this.typedArrayConstructor(t);for(let n=t;n--;)e[n]=this.array[n];this.array=e}}}function qs(t,e,n){if(1===n)return e;if(t===e)return e;if(t<e){let r=Math.max(t,1);for(;r<e;)r*=n;return Math.floor(r)}if(0===e)return 0;{let r=t;for(;;){const t=r/n;if(t<e)break;r=t}return Math.floor(r)}}class Vs{constructor(t){this.value=t,this.previous=null,this.next=null,this.up=null,this.down=null}}class Ds{constructor(t){this.compare=t,this.head=new Vs(null),this.tail=new Vs(null),this.height=0,this._size=0,this.head.next=this.tail,this.tail.previous=this.head}get size(){return this._size}*elements(){let t=this.head;for(;t.down;)t=t.down;for(;t.next&&n.isntNull(t.next.value);)t=t.next,yield t}dumpList(){const t=[];let e=this.head;do{t.push([]);let n=e;do{t[t.length-1].push(n.value),n=n.next}while(n)}while(e=e.down);return t}delete(t){let e=this.findNode(t);for(;e;)e.previous.next=e.next,e.next.previous=e.previous,e=e.down;this._size--}has(t){return n.isntNull(this.findNode(t))}findNode(t){let e=this.head;for(;;){for(;e.next&&n.isntNull(e.next.value);){const n=this.compare(e.next.value,t);if(0===n)return e.next;if(!(n<0))break;e=e.next}if(!e.down)return null;e=e.down}}add(t){let e=this.findPreviousNode(t);if(e.next&&n.isntNull(e.next.value)&&0===this.compare(e.next.value,t))return;let r=new Vs(t);e.next&&(r.next=e.next,e.next.previous=r),e.next=r,r.previous=e;let i=0;for(;Math.random()<.5;){if(i===this.height){const t=new Vs(null),e=new Vs(null);t.next=e,t.down=this.head,e.previous=t,e.down=this.tail,this.head.up=t,this.tail.up=e,this.head=t,this.tail=e,this.height++}for(;!e.up;)e=e.previous;e=e.up;const n=new Vs(t);e.next&&(n.next=e.next,e.next.previous=n),e.next=n,n.previous=e,n.down=r,r.up=n,r=n,i++}this._size++}findPreviousNode(t){let e=this.head;for(;;){for(;e.next&&n.isntNull(e.next.value);){if(this.compare(e.next.value,t)>=0)break;e=e.next}if(!e.down)return e;e=e.down}}}class Us{constructor(t){this.skipList=new Ds(t)}get[Symbol.toStringTag](){return this.constructor.name}[Symbol.iterator](){return this.values()}values(){return go.map(this.skipList.elements(),(t=>t.value))}has(t){return this.skipList.has(t)}add(t){this.skipList.add(t)}delete(t){this.skipList.delete(t)}}class Rs{constructor(t=32){this.bitsPerElement=t,this.array=[],this.length=0,this._size=0,bo.assert(Number.isInteger(t),"The parameter bitsPerElement must be an integer"),bo.assert(t>0,"The parameter bitsPerElement must be greater than 0"),bo.assert(t<=32,"The mask of bitsPerElement must be less than or equal to 32")}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this._size}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){let e=this.array[t];for(let n=0;n<this.bitsPerElement;n++)1&e&&(yield t*this.bitsPerElement+n),e>>=1}let r=this.array[t-1];for(let t=0;t<e;t++)1&r&&(yield n*this.bitsPerElement+t),r>>=1}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array[n])&&void 0!==e?e:0)&r)===r}add(t){var e;bo.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;this.array[n]=i|r;(i&r)!==r&&this._size++}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array[n])&&void 0!==e?e:0;this.array[n]=i&~r;const o=(i&r)===r;return o&&this._size--,o}clear(){for(let t=this.array.length;t--;)this.array[t]=0}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}class Ks{constructor(t){this.array=t,this.length=0,this._size=0;const e=8*t.BYTES_PER_ELEMENT;bo.assert(Number.isInteger(e),"The parameter bitsPerElement must be an integer"),bo.assert(e>0,"The parameter bitsPerElement must be greater than 0"),bo.assert(e<=32,"The mask of bitsPerElement must be less than or equal to 32"),this.bitsPerElement=e}get[Symbol.toStringTag](){return this.constructor.name}get size(){return this._size}[Symbol.iterator](){return this.values()}*values(){if(this.length>0){const t=Math.ceil(this.length/this.bitsPerElement),e=this.bitsPerElement-(t*this.bitsPerElement-this.length),n=t-1;for(let t=0;t<n;t++){let e=this.array.internalTypedArray[t];for(let n=0;n<this.bitsPerElement;n++)1&e&&(yield t*this.bitsPerElement+n),e>>=1}let r=this.array.internalTypedArray[t-1];for(let t=0;t<e;t++)1&r&&(yield n*this.bitsPerElement+t),r>>=1}}_dumpBinaryStrings(){const t=[];for(let e=0;e<this.array.length;e++){const n=this.array.internalTypedArray[e].toString(2);n.length<this.bitsPerElement?t.push("0".repeat(this.bitsPerElement-n.length)+n):t.push(n)}return t}has(t){var e;const[n,r]=this.getPosition(t);return((null!==(e=this.array.get(n))&&void 0!==e?e:0)&r)===r}add(t){var e;bo.assert(t>=0,"value must be greater than or equal to 0"),t>=this.length&&(this.length=t+1);const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;this.array.set(n,i|r);(i&r)!==r&&this._size++}delete(t){var e;const[n,r]=this.getPosition(t),i=null!==(e=this.array.get(n))&&void 0!==e?e:0;this.array.set(n,i&~r);const o=(i&r)===r;return o&&this._size--,o}clear(){for(let t=this.array.length;t--;)this.array.set(t,0)}getPosition(t){const e=t%this.bitsPerElement;return[(t-e)/this.bitsPerElement,this.getMask(e)]}getMask(t){return 1<<t}}export{Io as BadEventError,Rs as BitSet,t as Box,Fs as DynamicTypedArray,Rt as Emitter,xo as ExpirableMap,Ao as FiniteStateMachine,Kt as HashMap,Lt as HashSet,wo as LRUMap,Ns as ObservableFiniteStateMachine,Jt as Queue,Us as SortedSet,Bs as SparseMap,Ms as SparseSet,To as TLRUMap,So as TrieMap,Ks as TypedBitSet,Cs as TypedSparseMap,zs as TypedSparseSet,Ft as convertArrayToCons,zt as convertConsToArray,qt as sliceArrayLeft,Vt as sliceArrayRight,Dt as truncateArrayLeft,Ut as truncateArrayRight};
16
16
  //# sourceMappingURL=index.min.mjs.map