diff --git a/dist/search-index-5.0.0.js b/dist/search-index-5.1.1.js similarity index 99% rename from dist/search-index-5.0.0.js rename to dist/search-index-5.1.1.js index cd41cc7b..2210b933 100644 --- a/dist/search-index-5.0.0.js +++ b/dist/search-index-5.1.1.js @@ -1,2 +1,2 @@ -/*! For license information please see search-index-5.0.0.js.LICENSE.txt */ -var SearchIndex;(()=>{var t={796:(t,e,r)=>{"use strict";const{fromCallback:n}=r(8100),i=r(266),{getCallback:o,getOptions:s}=r(1343),a=Symbol("promise"),c=Symbol("status"),u=Symbol("operations"),l=Symbol("finishClose"),h=Symbol("closeCallbacks");e.AbstractChainedBatch=class{constructor(t){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));this[u]=[],this[h]=[],this[c]="open",this[l]=this[l].bind(this),this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get length(){return this[u].length}put(t,e,r){if("open"!==this[c])throw new i("Batch is not open: cannot call put() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const n=this.db._checkKey(t)||this.db._checkValue(e);if(n)throw n;const o=r&&null!=r.sublevel?r.sublevel:this.db,s=r,a=o.keyEncoding(r&&r.keyEncoding),l=o.valueEncoding(r&&r.valueEncoding),h=a.format;r={...r,keyEncoding:h,valueEncoding:l.format},o!==this.db&&(r.sublevel=null);const f=o.prefixKey(a.encode(t),h),p=l.encode(e);return this._put(f,p,r),this[u].push({...s,type:"put",key:t,value:e}),this}_put(t,e,r){}del(t,e){if("open"!==this[c])throw new i("Batch is not open: cannot call del() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const r=this.db._checkKey(t);if(r)throw r;const n=e&&null!=e.sublevel?e.sublevel:this.db,o=e,s=n.keyEncoding(e&&e.keyEncoding),a=s.format;return e={...e,keyEncoding:a},n!==this.db&&(e.sublevel=null),this._del(n.prefixKey(s.encode(t),a),e),this[u].push({...o,type:"del",key:t}),this}_del(t,e){}clear(){if("open"!==this[c])throw new i("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[u]=[],this}_clear(){}write(t,e){return e=o(t,e),e=n(e,a),t=s(t),"open"!==this[c]?this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):0===this.length?this.close(e):(this[c]="writing",this._write(t,(t=>{this[c]="closing",this[h].push((()=>e(t))),t||this.db.emit("batch",this[u]),this._close(this[l])}))),e[a]}_write(t,e){}close(t){return t=n(t,a),"closing"===this[c]?this[h].push(t):"closed"===this[c]?this.nextTick(t):(this[h].push(t),"writing"!==this[c]&&(this[c]="closing",this._close(this[l]))),t[a]}_close(t){this.nextTick(t)}[l](){this[c]="closed",this.db.detachResource(this);const t=this[h];this[h]=[];for(const e of t)e()}}},3527:(t,e,r)=>{"use strict";const{fromCallback:n}=r(8100),i=r(266),{getOptions:o,getCallback:s}=r(1343),a=Symbol("promise"),c=Symbol("callback"),u=Symbol("working"),l=Symbol("handleOne"),h=Symbol("handleMany"),f=Symbol("autoClose"),p=Symbol("finishWork"),d=Symbol("returnMany"),y=Symbol("closing"),g=Symbol("handleClose"),m=Symbol("closed"),b=Symbol("closeCallbacks"),v=Symbol("keyEncoding"),E=Symbol("valueEncoding"),w=Symbol("abortOnClose"),T=Symbol("legacy"),A=Symbol("keys"),S=Symbol("values"),O=Symbol("limit"),I=Symbol("count"),_=Object.freeze({}),L=()=>{};let x=!1;class N{constructor(t,e,r){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e)throw new TypeError("The second argument must be an options object");this[m]=!1,this[b]=[],this[u]=!1,this[y]=!1,this[f]=!1,this[c]=null,this[l]=this[l].bind(this),this[h]=this[h].bind(this),this[g]=this[g].bind(this),this[v]=e[v],this[E]=e[E],this[T]=r,this[O]=Number.isInteger(e.limit)&&e.limit>=0?e.limit:1/0,this[I]=0,this[w]=!!e.abortOnClose,this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get count(){return this[I]}get limit(){return this[O]}next(t){let e;if(void 0===t)e=new Promise(((e,r)=>{t=(t,n,i)=>{t?r(t):this[T]?void 0===n&&void 0===i?e():e([n,i]):e(n)}}));else if("function"!=typeof t)throw new TypeError("Callback must be a function");return this[y]?this.nextTick(t,new i("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(t,new i("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=t,this[I]>=this[O]?this.nextTick(this[l],null):this._next(this[l])),e}_next(t){this.nextTick(t)}nextv(t,e,r){return r=s(e,r),r=n(r,a),e=o(e,_),Number.isInteger(t)?(this[y]?this.nextTick(r,new i("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(r,new i("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(t<1&&(t=1),this[O]<1/0&&(t=Math.min(t,this[O]-this[I])),this[u]=!0,this[c]=r,t<=0?this.nextTick(this[h],null,[]):this._nextv(t,e,this[h])),r[a]):(this.nextTick(r,new TypeError("The first argument 'size' must be an integer")),r[a])}_nextv(t,e,r){const n=[],i=(e,o,s)=>e?r(e):(this[T]?void 0===o&&void 0===s:void 0===o)?r(null,n):(n.push(this[T]?[o,s]:o),void(n.length===t?r(null,n):this._next(i)));this._next(i)}all(t,e){return e=s(t,e),e=n(e,a),t=o(t,_),this[y]?this.nextTick(e,new i("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(e,new i("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=e,this[f]=!0,this[I]>=this[O]?this.nextTick(this[h],null,[]):this._all(t,this[h])),e[a]}_all(t,e){let r=this[I];const n=[],i=()=>{const t=this[O]<1/0?Math.min(1e3,this[O]-r):1e3;t<=0?this.nextTick(e,null,n):this._nextv(t,_,o)},o=(t,o)=>{t?e(t):0===o.length?e(null,n):(n.push.apply(n,o),r+=o.length,i())};i()}[p](){const t=this[c];return this[w]&&null===t?L:(this[u]=!1,this[c]=null,this[y]&&this._close(this[g]),t)}[d](t,e,r){this[f]?this.close(t.bind(null,e,r)):t(e,r)}seek(t,e){if(e=o(e,_),this[y]);else{if(this[u])throw new i("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{const r=this.db.keyEncoding(e.keyEncoding||this[v]),n=r.format;e.keyEncoding!==n&&(e={...e,keyEncoding:n});const i=this.db.prefixKey(r.encode(t),n);this._seek(i,e)}}}_seek(t,e){throw new i("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(t){return t=n(t,a),this[m]?this.nextTick(t):this[y]?this[b].push(t):(this[y]=!0,this[b].push(t),this[u]?this[w]&&this[p]()(new i("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[g])),t[a]}_close(t){this.nextTick(t)}[g](){this[m]=!0,this.db.detachResource(this);const t=this[b];this[b]=[];for(const e of t)e()}async*[Symbol.asyncIterator](){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this[m]||await this.close()}}}class U extends N{constructor(t,e){super(t,e,!0),this[A]=!1!==e.keys,this[S]=!1!==e.values}[l](t,e,r){const n=this[p]();if(t)return n(t);try{e=this[A]&&void 0!==e?this[v].decode(e):void 0,r=this[S]&&void 0!==r?this[E].decode(r):void 0}catch(t){return n(new C("entry",t))}void 0===e&&void 0===r||this[I]++,n(null,e,r)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(const t of e){const e=t[0],r=t[1];t[0]=this[A]&&void 0!==e?this[v].decode(e):void 0,t[1]=this[S]&&void 0!==r?this[E].decode(r):void 0}}catch(t){return this[d](r,new C("entries",t))}this[I]+=e.length,this[d](r,null,e)}end(t){return x||"undefined"==typeof console||(x=!0,console.warn(new i("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(t)}}class C extends i{constructor(t,e){super(`Iterator could not decode ${t}`,{code:"LEVEL_DECODE_ERROR",cause:e})}}for(const t of["_ended property","_nexting property","_end method"])Object.defineProperty(U.prototype,t.split(" ")[0],{get(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});U.keyEncoding=v,U.valueEncoding=E,e.AbstractIterator=U,e.AbstractKeyIterator=class extends N{constructor(t,e){super(t,e,!1)}[l](t,e){const r=this[p]();if(t)return r(t);try{e=void 0!==e?this[v].decode(e):void 0}catch(t){return r(new C("key",t))}void 0!==e&&this[I]++,r(null,e)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(let t=0;t{"use strict";const{supports:n}=r(5356),{Transcoder:i}=r(6035),{EventEmitter:o}=r(7007),{fromCallback:s}=r(8100),a=r(266),{AbstractIterator:c}=r(3527),{DefaultKeyIterator:u,DefaultValueIterator:l}=r(5682),{DeferredIterator:h,DeferredKeyIterator:f,DeferredValueIterator:p}=r(4416),{DefaultChainedBatch:d}=r(4669),{getCallback:y,getOptions:g}=r(1343),m=r(386),b=Symbol("promise"),v=Symbol("landed"),E=Symbol("resources"),w=Symbol("closeResources"),T=Symbol("operations"),A=Symbol("undefer"),S=Symbol("deferOpen"),O=Symbol("options"),I=Symbol("status"),_=Symbol("defaultOptions"),L=Symbol("transcoder"),x=Symbol("keyEncoding"),N=Symbol("valueEncoding"),U=()=>{};class C extends o{constructor(t,e){if(super(),"object"!=typeof t||null===t)throw new TypeError("The first argument 'manifest' must be an object");e=g(e);const{keyEncoding:r,valueEncoding:o,passive:s,...a}=e;this[E]=new Set,this[T]=[],this[S]=!0,this[O]=a,this[I]="opening",this.supports=n(t,{status:!0,promises:!0,clear:!0,getMany:!0,deferredOpen:!0,snapshots:!1!==t.snapshots,permanence:!1!==t.permanence,keyIterator:!0,valueIterator:!0,iteratorNextv:!0,iteratorAll:!0,encodings:t.encodings||{},events:Object.assign({},t.events,{opening:!0,open:!0,closing:!0,closed:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[L]=new i(R(this)),this[x]=this[L].encoding(r||"utf8"),this[N]=this[L].encoding(o||"utf8");for(const t of this[L].encodings())this.supports.encodings[t.commonName]||(this.supports.encodings[t.commonName]=!0);this[_]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[x].commonName,valueEncoding:this[N].commonName}),key:Object.freeze({keyEncoding:this[x].commonName})},this.nextTick((()=>{this[S]&&this.open({passive:!1},U)}))}get status(){return this[I]}keyEncoding(t){return this[L].encoding(null!=t?t:this[x])}valueEncoding(t){return this[L].encoding(null!=t?t:this[N])}open(t,e){e=y(t,e),e=s(e,b),(t={...this[O],...g(t)}).createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists;const r=t=>{"closing"===this[I]||"opening"===this[I]?this.once(v,t?()=>r(t):r):"open"!==this[I]?e(new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:t})):e()};return t.passive?"opening"===this[I]?this.once(v,r):this.nextTick(r):"closed"===this[I]||this[S]?(this[S]=!1,this[I]="opening",this.emit("opening"),this._open(t,(t=>{if(t)return this[I]="closed",this[w]((()=>{this.emit(v),r(t)})),void this[A]();this[I]="open",this[A](),this.emit(v),"open"===this[I]&&this.emit("open"),"open"===this[I]&&this.emit("ready"),r()}))):"open"===this[I]?this.nextTick(r):this.once(v,(()=>this.open(t,e))),e[b]}_open(t,e){this.nextTick(e)}close(t){t=s(t,b);const e=r=>{"opening"===this[I]||"closing"===this[I]?this.once(v,r?e(r):e):"closed"!==this[I]?t(new a("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:r})):t()};if("open"===this[I]){this[I]="closing",this.emit("closing");const t=t=>{this[I]="open",this[A](),this.emit(v),e(t)};this[w]((()=>{this._close((r=>{if(r)return t(r);this[I]="closed",this[A](),this.emit(v),"closed"===this[I]&&this.emit("closed"),e()}))}))}else"closed"===this[I]?this.nextTick(e):this.once(v,(()=>this.close(t)));return t[b]}[w](t){if(0===this[E].size)return this.nextTick(t);let e=this[E].size,r=!0;const n=()=>{0==--e&&(r?this.nextTick(t):t())};for(const t of this[E])t.close(n);r=!1,this[E].clear()}_close(t){this.nextTick(t)}get(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.get(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=this.valueEncoding(e.valueEncoding),c=i.format,u=o.format;return e.keyEncoding===c&&e.valueEncoding===u||(e=Object.assign({},e,{keyEncoding:c,valueEncoding:u})),this._get(this.prefixKey(i.encode(t),c),e,((t,e)=>{if(t)return("LEVEL_NOT_FOUND"===t.code||t.notFound||/NotFound/i.test(t))&&(t.code||(t.code="LEVEL_NOT_FOUND"),t.notFound||(t.notFound=!0),t.status||(t.status=404)),r(t);try{e=o.decode(e)}catch(t){return r(new a("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:t}))}r(null,e)})),r[b]}_get(t,e,r){this.nextTick(r,new Error("NotFound"))}getMany(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.getMany(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'keys' must be an array")),r[b];if(0===t.length)return this.nextTick(r,null,[]),r[b];const n=this.keyEncoding(e.keyEncoding),i=this.valueEncoding(e.valueEncoding),o=n.format,c=i.format;e.keyEncoding===o&&e.valueEncoding===c||(e=Object.assign({},e,{keyEncoding:o,valueEncoding:c}));const u=new Array(t.length);for(let e=0;e{if(t)return r(t);try{for(let t=0;tthis.put(t,e,r,n))),n[b];if(D(this,n))return n[b];const i=this._checkKey(t)||this._checkValue(e);if(i)return this.nextTick(n,i),n[b];const o=this.keyEncoding(r.keyEncoding),a=this.valueEncoding(r.valueEncoding),c=o.format,u=a.format;r.keyEncoding===c&&r.valueEncoding===u||(r=Object.assign({},r,{keyEncoding:c,valueEncoding:u}));const l=this.prefixKey(o.encode(t),c),h=a.encode(e);return this._put(l,h,r,(r=>{if(r)return n(r);this.emit("put",t,e),n()})),n[b]}_put(t,e,r,n){this.nextTick(n)}del(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].key),"opening"===this[I])return this.defer((()=>this.del(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=i.format;return e.keyEncoding!==o&&(e=Object.assign({},e,{keyEncoding:o})),this._del(this.prefixKey(i.encode(t),o),e,(e=>{if(e)return r(e);this.emit("del",t),r()})),r[b]}_del(t,e,r){this.nextTick(r)}batch(t,e,r){if(!arguments.length){if("opening"===this[I])return new d(this);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(r="function"==typeof t?t:y(e,r),r=s(r,b),e=g(e,this[_].empty),"opening"===this[I])return this.defer((()=>this.batch(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'operations' must be an array")),r[b];if(0===t.length)return this.nextTick(r),r[b];const n=new Array(t.length),{keyEncoding:i,valueEncoding:o,...c}=e;for(let e=0;e{if(e)return r(e);this.emit("batch",t),r()})),r[b]}_batch(t,e,r){this.nextTick(r)}sublevel(t,e){return this._sublevel(t,k.defaults(e))}_sublevel(t,e){return new k(this,t,e)}prefixKey(t,e){return t}clear(t,e){if(e=y(t,e),e=s(e,b),t=g(t,this[_].empty),"opening"===this[I])return this.defer((()=>this.clear(t,e))),e[b];if(D(this,e))return e[b];const r=t,n=this.keyEncoding(t.keyEncoding);return(t=m(t,n)).keyEncoding=n.format,0===t.limit?this.nextTick(e):this._clear(t,(t=>{if(t)return e(t);this.emit("clear",r),e()})),e[b]}_clear(t,e){this.nextTick(e)}iterator(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e)).keys=!1!==t.keys,t.values=!1!==t.values,t[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new h(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(t)}_iterator(t){return new c(this,t)}keys(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new f(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(t)}_keys(t){return new u(this,t)}values(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new p(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(t)}_values(t){return new l(this,t)}defer(t){if("function"!=typeof t)throw new TypeError("The first argument must be a function");this[T].push(t)}[A](){if(0===this[T].length)return;const t=this[T];this[T]=[];for(const e of t)e()}attachResource(t){if("object"!=typeof t||null===t||"function"!=typeof t.close)throw new TypeError("The first argument must be a resource object");this[E].add(t)}detachResource(t){this[E].delete(t)}_chainedBatch(){return new d(this)}_checkKey(t){if(null==t)return new a("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(t){if(null==t)return new a("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}}C.prototype.nextTick=r(28);const{AbstractSublevel:k}=r(9933)({AbstractLevel:C});e.AbstractLevel=C,e.AbstractSublevel=k;const D=function(t,e){return"open"!==t[I]&&(t.nextTick(e,new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0)},R=function(t){return Object.keys(t.supports.encodings).filter((e=>!!t.supports.encodings[e]))}},5e3:(t,e,r)=>{"use strict";e.AbstractLevel=r(1983).AbstractLevel,e.AbstractSublevel=r(1983).AbstractSublevel,e.AbstractIterator=r(3527).AbstractIterator,e.AbstractKeyIterator=r(3527).AbstractKeyIterator,e.AbstractValueIterator=r(3527).AbstractValueIterator,e.AbstractChainedBatch=r(796).AbstractChainedBatch},4716:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=Symbol("unfix"),a=Symbol("iterator"),c=Symbol("handleOne"),u=Symbol("handleMany"),l=Symbol("callback");class h extends n{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e,r){const n=this[l];if(t)return n(t);void 0!==e&&(e=this[s](e)),n(t,e,r)}[u](t,e){const r=this[l];if(t)return r(t);for(const t of e){const e=t[0];void 0!==e&&(t[0]=this[s](e))}r(t,e)}}class f extends i{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e){const r=this[l];if(t)return r(t);void 0!==e&&(e=this[s](e)),r(t,e)}[u](t,e){const r=this[l];if(t)return r(t);for(let t=0;t{"use strict";const n=r(266),{Buffer:i}=r(8287)||{},{AbstractSublevelIterator:o,AbstractSublevelKeyIterator:s,AbstractSublevelValueIterator:a}=r(4716),c=Symbol("prefix"),u=Symbol("upperBound"),l=Symbol("prefixRange"),h=Symbol("parent"),f=Symbol("unfix"),p=new TextEncoder,d={separator:"!"};t.exports=function({AbstractLevel:t}){class e extends t{static defaults(t){if("string"==typeof t)throw new n("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(t&&t.open)throw new n("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return null==t?d:t.separator?t:{...t,separator:"!"}}constructor(t,r,i){const{separator:o,manifest:s,...a}=e.defaults(i);r=v(r,o);const l=o.charCodeAt(0)+1,d=t[h]||t;if(!p.encode(r).every((t=>t>l&&t<127)))throw new n(`Prefix must use bytes > ${l} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(y(d,s),a);const g=(t.prefix||"")+o+r+o,E=g.slice(0,-1)+String.fromCharCode(l);this[h]=d,this[c]=new m(g),this[u]=new m(E),this[f]=new b,this.nextTick=d.nextTick}prefixKey(t,e){if("utf8"===e)return this[c].utf8+t;if(0===t.byteLength)return this[c][e];if("view"===e){const e=this[c].view,r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}{const e=this[c].buffer;return i.concat([e,t],e.byteLength+t.byteLength)}}[l](t,e){void 0!==t.gte?t.gte=this.prefixKey(t.gte,e):void 0!==t.gt?t.gt=this.prefixKey(t.gt,e):t.gte=this[c][e],void 0!==t.lte?t.lte=this.prefixKey(t.lte,e):void 0!==t.lt?t.lt=this.prefixKey(t.lt,e):t.lte=this[u][e]}get prefix(){return this[c].utf8}get db(){return this[h]}_open(t,e){this[h].open({passive:!0},e)}_put(t,e,r,n){this[h].put(t,e,r,n)}_get(t,e,r){this[h].get(t,e,r)}_getMany(t,e,r){this[h].getMany(t,e,r)}_del(t,e,r){this[h].del(t,e,r)}_batch(t,e,r){this[h].batch(t,e,r)}_clear(t,e){this[l](t,t.keyEncoding),this[h].clear(t,e)}_iterator(t){this[l](t,t.keyEncoding);const e=this[h].iterator(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new o(this,t,e,r)}_keys(t){this[l](t,t.keyEncoding);const e=this[h].keys(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new s(this,t,e,r)}_values(t){this[l](t,t.keyEncoding);const e=this[h].values(t);return new a(this,t,e)}}return{AbstractSublevel:e}};const y=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:g(t,"utf8"),buffer:g(t,"buffer"),view:g(t,"view")}}},g=function(t,e){return!!t.supports.encodings[e]&&t.keyEncoding(e).name===e};class m{constructor(t){this.utf8=t,this.view=p.encode(t),this.buffer=i?i.from(this.view.buffer,0,this.view.byteLength):{}}}class b{constructor(){this.cache=new Map}get(t,e){let r=this.cache.get(e);return void 0===r&&(r="view"===e?function(t,e){return e.subarray(t)}.bind(null,t):function(t,e){return e.slice(t)}.bind(null,t),this.cache.set(e,r)),r}}const v=function(t,e){let r=0,n=t.length;for(;rr&&t[n-1]===e;)n--;return t.slice(r,n)}},1343:(t,e)=>{"use strict";e.getCallback=function(t,e){return"function"==typeof t?t:e},e.getOptions=function(t,e){return"object"==typeof t&&null!==t?t:void 0!==e?e:{}}},4669:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(796),i=r(266),o=Symbol("encoded");e.DefaultChainedBatch=class extends n{constructor(t){super(t),this[o]=[]}_put(t,e,r){this[o].push({...r,type:"put",key:t,value:e})}_del(t,e){this[o].push({...e,type:"del",key:t})}_clear(){this[o]=[]}_write(t,e){"opening"===this.db.status?this.db.defer((()=>this._write(t,e))):"open"===this.db.status?0===this[o].length?this.nextTick(e):this.db._batch(this[o],t,e):this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}}},5682:(t,e,r)=>{"use strict";const{AbstractKeyIterator:n,AbstractValueIterator:i}=r(3527),o=Symbol("iterator"),s=Symbol("callback"),a=Symbol("handleOne"),c=Symbol("handleMany");class u extends n{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!0,values:!1}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}class l extends i{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!1,values:!0}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}for(const t of[u,l]){const e=t===u,r=e?t=>t[0]:t=>t[1];t.prototype._next=function(t){this[s]=t,this[o].next(this[a])},t.prototype[a]=function(t,r,n){const i=this[s];t?i(t):i(null,e?r:n)},t.prototype._nextv=function(t,e,r){this[s]=r,this[o].nextv(t,e,this[c])},t.prototype._all=function(t,e){this[s]=e,this[o].all(t,this[c])},t.prototype[c]=function(t,e){const n=this[s];t?n(t):n(null,e.map(r))},t.prototype._seek=function(t,e){this[o].seek(t,e)},t.prototype._close=function(t){this[o].close(t)}}e.DefaultKeyIterator=u,e.DefaultValueIterator=l},4416:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=r(266),a=Symbol("nut"),c=Symbol("undefer"),u=Symbol("factory");class l extends n{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.iterator(e),this.db.defer((()=>this[c]()))}}class h extends i{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.keys(e),this.db.defer((()=>this[c]()))}}class f extends o{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.values(e),this.db.defer((()=>this[c]()))}}for(const t of[l,h,f])t.prototype[c]=function(){"open"===this.db.status&&(this[a]=this[u]())},t.prototype._next=function(t){null!==this[a]?this[a].next(t):"opening"===this.db.status?this.db.defer((()=>this._next(t))):this.nextTick(t,new s("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(t,e,r){null!==this[a]?this[a].nextv(t,e,r):"opening"===this.db.status?this.db.defer((()=>this._nextv(t,e,r))):this.nextTick(r,new s("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(t,e){null!==this[a]?this[a].all(e):"opening"===this.db.status?this.db.defer((()=>this._all(t,e))):this.nextTick(e,new s("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(t,e){null!==this[a]?this[a]._seek(t,e):"opening"===this.db.status&&this.db.defer((()=>this._seek(t,e)))},t.prototype._close=function(t){null!==this[a]?this[a].close(t):"opening"===this.db.status?this.db.defer((()=>this._close(t))):this.nextTick(t)};e.DeferredIterator=l,e.DeferredKeyIterator=h,e.DeferredValueIterator=f},28:(t,e,r)=>{"use strict";const n=r(9596);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},386:(t,e,r)=>{"use strict";const n=r(266),i=Object.prototype.hasOwnProperty,o=new Set(["lt","lte","gt","gte"]);t.exports=function(t,e){const r={};for(const s in t)if(i.call(t,s)&&"keyEncoding"!==s&&"valueEncoding"!==s){if("start"===s||"end"===s)throw new n(`The legacy range option '${s}' has been removed`,{code:"LEVEL_LEGACY"});if("encoding"===s)throw new n("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead",{code:"LEVEL_LEGACY"});o.has(s)?r[s]=e.encode(t[s]):r[s]=t[s]}return r.reverse=!!r.reverse,r.limit=Number.isInteger(r.limit)&&r.limit>=0?r.limit:-1,r}},9511:(t,e,r)=>{"use strict";var n=r(8075)("ArrayBuffer.prototype.byteLength",!0),i=r(4670);t.exports=function(t){return i(t)?n?n(t):t.byteLength:NaN}},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),l=0,h=c>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9148:(t,e,r)=>{"use strict";const{AbstractLevel:n}=r(5e3),i=r(266),o=r(5372),{fromCallback:s}=r(8100),{Iterator:a}=r(6296),c=r(5222),u=r(3452),l=r(7766),h="level-js-",f=Symbol("idb"),p=Symbol("namePrefix"),d=Symbol("location"),y=Symbol("version"),g=Symbol("store"),m=Symbol("onComplete"),b=Symbol("promise");class v extends n{constructor(t,e,r){if("function"==typeof e||"function"==typeof r)throw new i("The levelup-style callback argument has been removed",{code:"LEVEL_LEGACY"});const{prefix:n,version:o,...s}=e||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},s),"string"!=typeof t)throw new Error("constructor requires a location string argument");this[d]=t,this[p]=null==n?h:n,this[y]=parseInt(o||1,10),this[f]=null}get location(){return this[d]}get namePrefix(){return this[p]}get version(){return this[y]}get db(){return this[f]}get type(){return"browser-level"}_open(t,e){const r=indexedDB.open(this[p]+this[d],this[y]);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this[f]=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this[d])||e.createObjectStore(this[d])}}[g](t){return this[f].transaction([this[d]],t).objectStore(this[d])}[m](t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}}_get(t,e,r){const n=this[g]("readonly");let o;try{o=n.get(t)}catch(t){return this.nextTick(r,t)}this[m](o,(function(t,e){return t?r(t):void 0===e?r(new i("Entry not found",{code:"LEVEL_NOT_FOUND"})):void r(null,c(e))}))}_getMany(t,e,r){const n=this[g]("readonly"),i=t.map((t=>e=>{let r;try{r=n.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:c(t))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(i,16,r)}_del(t,e,r){const n=this[g]("readwrite");let i;try{i=n.delete(t)}catch(t){return this.nextTick(r,t)}this[m](i,r)}_put(t,e,r,n){const i=this[g]("readwrite");let o;try{o=i.put(e,t)}catch(t){return this.nextTick(n,t)}this[m](o,n)}_iterator(t){return new a(this,this[d],t)}_batch(t,e,r){const n=this[g]("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let c;try{c="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return u(this,this[d],r,t,e);try{const t=this[g]("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this.nextTick(e,t)}this[m](n,e)}_close(t){this[f].close(),this.nextTick(t)}}v.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h),r=s(r,b);const n=indexedDB.deleteDatabase(e+t);return n.onsuccess=function(){r()},n.onerror=function(t){r(t)},r[b]},e.Z=v},6296:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(5e3),i=r(7766),o=r(5222),s=Symbol("cache"),a=Symbol("finished"),c=Symbol("options"),u=Symbol("currentOptions"),l=Symbol("position"),h=Symbol("location"),f=Symbol("first"),p={};function d(t){"function"==typeof t.commit&&t.commit()}e.Iterator=class extends n{constructor(t,e,r){super(t,r),this[s]=[],this[a]=0===this.limit,this[c]=r,this[u]={...r},this[l]=void 0,this[h]=e,this[f]=!0}_nextv(t,e,r){if(this[f]=!1,this[a])return this.nextTick(r,null,[]);if(this[s].length>0)return t=Math.min(t,this[s].length),this.nextTick(r,null,this[s].splice(0,t));let n;void 0!==this[l]&&(this[c].reverse?(this[u].lt=this[l],this[u].lte=void 0):(this[u].gt=this[l],this[u].gte=void 0));try{n=i(this[u])}catch(t){return this[a]=!0,this.nextTick(r,null,[])}const p=this.db.db.transaction([this[h]],"readonly"),y=p.objectStore(this[h]),g=[];if(this[c].reverse)y[!this[c].values&&y.openKeyCursor?"openKeyCursor":"openCursor"](n,"prev").onsuccess=e=>{const r=e.target.result;if(r){const{key:e,value:n}=r;this[l]=e,g.push([this[c].keys&&void 0!==e?o(e):void 0,this[c].values&&void 0!==n?o(n):void 0]),g.length{if(void 0===e||void 0===r)return;const n=Math.max(e.length,r.length);0===n||t===1/0?this[a]=!0:this[l]=e[n-1],g.length=n;for(let t=0;t{e=t.target.result,i()}:(e=[],this.nextTick(i)),this[c].values?y.getAll(n,t<1/0?t:void 0).onsuccess=t=>{r=t.target.result,i()}:(r=[],this.nextTick(i))}p.onabort=()=>{r(p.error||new Error("aborted by user")),r=null},p.oncomplete=()=>{r(null,g),r=null}}_next(t){if(this[s].length>0){const[e,r]=this[s].shift();this.nextTick(t,null,e,r)}else if(this[a])this.nextTick(t);else{let e=Math.min(100,this.limit-this.count);this[f]&&(this[f]=!1,e=1),this._nextv(e,p,((e,r)=>{if(e)return t(e);this[s]=r,this._next(t)}))}}_all(t,e){this[f]=!1;const r=this[s].splice(0,this[s].length),n=this.limit-this.count-r.length;if(n<=0)return this.nextTick(e,null,r);this._nextv(n,p,((t,n)=>{if(t)return e(t);r.length>0&&(n=r.concat(n)),e(null,n)}))}_seek(t,e){let r;this[f]=!0,this[s]=[],this[a]=!1,this[l]=void 0,this[u]={...this[c]};try{r=i(this[c])}catch(t){return void(this[a]=!0)}null===r||r.includes(t)?this[c].reverse?this[u].lte=t:this[u].gte=t:this[a]=!0}}},3452:t=>{"use strict";t.exports=function(t,e,r,n,i){if(0===n.limit)return t.nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const c=s.openKeyCursor?"openKeyCursor":"openCursor",u=n.reverse?"prev":"next";s[c](r,u).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const e=new TextEncoder;t.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):e.encode(t)}},7766:t=>{"use strict";t.exports=function(t){const e=void 0!==t.gte?t.gte:void 0!==t.gt?t.gt:void 0,r=void 0!==t.lte?t.lte:void 0!==t.lt?t.lt:void 0,n=void 0===t.gte,i=void 0===t.lte;return void 0!==e&&void 0!==r?IDBKeyRange.bound(e,r,n,i):void 0!==e?IDBKeyRange.lowerBound(e,n):void 0!==r?IDBKeyRange.upperBound(r,i):null}},8287:(t,e,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||X(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),a(t<0?0:0|d(t))}function f(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},8075:(t,e,r)=>{"use strict";var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},487:(t,e,r)=>{"use strict";var n=r(6743),i=r(453),o=r(6897),s=r(9675),a=i("%Function.prototype.apply%"),c=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||n.call(c,a),l=r(655),h=i("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new s("a function is required");var e=u(n,c,arguments);return o(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(n,a,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},8100:(t,e,r)=>{"use strict";var n=r(844);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},844:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},9743:(t,e)=>{function r(t){for(var e="",r=0;r0?"F"+s:"D"+r(s)},e.decode=function(t){if("DaN"===t)return NaN;if("FF"===t)return 1/0;if("DD"===t)return-1/0;var e="D"===t[0],n=(e?r(t):t).slice(2).split("M");return Number((e?"-":"")+n[1]+"e"+String(Number(n[0])-500))}},3381:(t,e)=>{var r={"?":"?@","!":"??",'"':"?%"},n={"?@":"?","??":"!","?%":'"'};e.factory=function(t){return{encode:e,decode:function(e){if("A"===e)return null;if("K!"===e)return[];for(var r,i=e.split('"'),o=[[]],s=0,a=i.length,c=0;c{var n=r(9743),i=r(3381);e.flip=function(t){var e=t.toString(),r="";for(var n in e)r+="."==e[n]?".":9-+e[n];return r},e.number=n,e.string={encode:function(t){return/\x00|\x01/.test(t)?"J"+t.replace(/\x01/g,"").replace(/\x00/g,""):"J"+t},decode:function(t){if("J"===t[0])return t.substring(1)}},e.encode=function(t){return e[typeof t].encode(t)},e.decode=function(t){if(""===t)return t;if(!o[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return o[t[0]](t)},e.object=i.factory(e),e.boolean={encode:function(t){return t?"C":"B"},decode:function(t){return"C"===t}},e.undefined={encode:function(t){return"L"},decode:function(){}};var o={A:e.object.decode,B:e.boolean.decode,C:e.boolean.decode,D:e.number.decode,F:e.number.decode,J:e.string.decode,K:e.object.decode,L:e.undefined.decode};e.buffer=!1,e.type="charwise"},41:(t,e,r)=>{"use strict";var n=r(655),i=r(8068),o=r(9675),s=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new o("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!s&&s(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8452:(t,e,r)=>{"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),c=r(592)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;c?a(t,e,r,!0):a(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";var n=r(453)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},1237:t=>{"use strict";t.exports=EvalError},9383:t=>{"use strict";t.exports=Error},9290:t=>{"use strict";t.exports=RangeError},9538:t=>{"use strict";t.exports=ReferenceError},8068:t=>{"use strict";t.exports=SyntaxError},9675:t=>{"use strict";t.exports=TypeError},5345:t=>{"use strict";t.exports=URIError},5388:(t,e,r)=>{"use strict";var n=r(9675);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},5437:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(162),o=r(9600),s=r(2120),a=r(3612);t.exports=function(t){if(i(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!o(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(i(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,l=d(c,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},2682:(t,e,r)=>{"use strict";var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(9353);t.exports=Function.prototype.bind||n},453:(t,e,r)=>{"use strict";var n,i=r(9383),o=r(1237),s=r(9290),a=r(9538),c=r(8068),u=r(9675),l=r(5345),h=Function,f=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(t){p=null}var d=function(){throw new u},y=p?function(){try{return d}catch(t){try{return p(arguments,"callee").get}catch(t){return d}}}():d,g=r(4039)(),m=r(24)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},E="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,w={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":y,"%TypedArray%":E,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var T=b(b(t));w["%Error.prototype%"]=T}var A=function t(e){var r;if("%AsyncFunction%"===e)r=f("async function () {}");else if("%GeneratorFunction%"===e)r=f("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=f("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return w[e]=r,r},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(6743),I=r(9957),_=O.call(Function.call,Array.prototype.concat),L=O.call(Function.apply,Array.prototype.splice),x=O.call(Function.call,String.prototype.replace),N=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,D=function(t,e){var r,n=t;if(I(S,n)&&(n="%"+(r=S[n])[0]+"%"),I(w,n)){var i=w[n];if(i===v&&(i=A(n)),void 0===i&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=N(t,0,1),r=N(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return x(t,C,(function(t,e,r,i){n[n.length]=r?x(i,k,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=D("%"+n+"%",e),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],L(r,_([0,1],l)));for(var h=1,f=!0;h=r.length){var m=p(s,d);s=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:s[d]}else f=I(s,d),s=s[d];f&&!a&&(w[o]=s)}}return s}},5795:(t,e,r)=>{"use strict";var n=r(453)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},592:(t,e,r)=>{"use strict";var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},24:t=>{"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof r)}},4039:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092:(t,e,r)=>{"use strict";var n=r(1333);t.exports=function(){return n()&&!!Symbol.toStringTag}},9957:(t,e,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);t.exports=o.call(n,i)},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*y}},4670:(t,e,r)=>{"use strict";var n=r(487),i=r(8075),o=r(453)("%ArrayBuffer%",!0),s=i("ArrayBuffer.prototype.byteLength",!0),a=i("Object.prototype.toString"),c=!!o&&!s&&new o(0).slice,u=!!c&&n(c);t.exports=s||u?function(t){if(!t||"object"!=typeof t)return!1;try{return s?s(t):u(t,0),!0}catch(t){return!1}}:o?function(t){return"[object ArrayBuffer]"===a(t)}:function(t){return!1}},9600:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(s(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},2120:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(9092)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},4035:(t,e,r)=>{"use strict";var n,i,o,s,a=r(8075),c=r(9092)();if(c){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var l=a("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{i(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7070:(t,e,r)=>{"use strict";var n=r(8075)("SharedArrayBuffer.prototype.byteLength",!0);t.exports=n?function(t){if(!t||"object"!=typeof t)return!1;try{return n(t),!0}catch(t){return!1}}:function(t){return!1}},3612:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(4039)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},5680:(t,e,r)=>{"use strict";var n=r(5767);t.exports=function(t){return!!n(t)}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},5356:(t,e)=>{"use strict";e.supports=function(...t){const e=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(e,{snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,getMany:e.getMany||!1,keyIterator:e.keyIterator||!1,valueIterator:e.valueIterator||!1,iteratorNextv:e.iteratorNextv||!1,iteratorAll:e.iteratorAll||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:Object.assign({},e.encodings),events:Object.assign({},e.events),additionalMethods:Object.assign({},e.additionalMethods)})}},6035:(t,e,r)=>{"use strict";const n=r(266),i=r(4341),{Encoding:o}=r(8110),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=Symbol("formats"),l=Symbol("encodings"),h=new Set(["buffer","view","utf8"]);e.Transcoder=class{constructor(t){if(!Array.isArray(t))throw new TypeError("The first argument 'formats' must be an array");if(!t.every((t=>h.has(t))))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'");this[l]=new Map,this[u]=new Set(t);for(const t in i)try{this.encoding(t)}catch(t){if("LEVEL_ENCODING_NOT_SUPPORTED"!==t.code)throw t}}encodings(){return Array.from(new Set(this[l].values()))}encoding(t){let e=this[l].get(t);if(void 0===e){if("string"==typeof t&&""!==t){if(e=p[t],!e)throw new n(`Encoding '${t}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if("object"!=typeof t||null===t)throw new TypeError("First argument 'encoding' must be a string or object");e=function(t){if(t instanceof o)return t;const e="type"in t&&"string"==typeof t.type?t.type:void 0,r=t.name||e||"anonymous-"+d++;switch(function(t){return"format"in t&&void 0!==t.format?t.format:"buffer"in t&&"boolean"==typeof t.buffer?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}(t)){case"view":return new a({...t,name:r});case"utf8":return new c({...t,name:r});case"buffer":return new s({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}(t)}const{name:r,format:i}=e;if(!this[u].has(i))if(this[u].has("view"))e=e.createViewTranscoder();else if(this[u].has("buffer"))e=e.createBufferTranscoder();else{if(!this[u].has("utf8"))throw new n(`Encoding '${r}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});e=e.createUTF8Transcoder()}for(const n of[t,r,e.name,e.commonName])this[l].set(n,e)}return e}};const f={binary:i.buffer,"utf-8":i.utf8},p={...i,...f};let d=0},8110:(t,e,r)=>{"use strict";const n=r(266),i=new Set(["buffer","view","utf8"]);e.Encoding=class{constructor(t){if(this.encode=t.encode||this.encode,this.decode=t.decode||this.decode,this.name=t.name||this.name,this.format=t.format||this.format,"function"!=typeof this.encode)throw new TypeError("The 'encode' property must be a function");if("function"!=typeof this.decode)throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),"string"!=typeof this.name||""===this.name)throw new TypeError("The 'name' property must be a string");if("string"!=typeof this.format||!i.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");t.createViewTranscoder&&(this.createViewTranscoder=t.createViewTranscoder),t.createBufferTranscoder&&(this.createBufferTranscoder=t.createBufferTranscoder),t.createUTF8Transcoder&&(this.createUTF8Transcoder=t.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}}},4341:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{Buffer:{isBuffer:()=>!1}},{textEncoder:i,textDecoder:o}=r(7200)(),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=t=>t;e.utf8=new c({encode:function(t){return n.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?o.decode(t):String(t)},decode:u,name:"utf8",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:function(t){return o.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}}),e.json=new c({encode:JSON.stringify,decode:JSON.parse,name:"json"}),e.buffer=new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:"buffer",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:n.from(String(t),"utf8")},decode:function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}}),e.view=new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:u,name:"view",createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:`${this.name}+buffer`})}}),e.hex=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"}),e.base64=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})},8343:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{},{Encoding:i}=r(8110),o=r(7200);class s extends i{constructor(t){super({...t,format:"buffer"})}createViewTranscoder(){return new a({encode:this.encode,decode:t=>this.decode(n.from(t.buffer,t.byteOffset,t.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}}class a extends i{constructor(t){super({...t,format:"view"})}createBufferTranscoder(){return new s({encode:t=>{const e=this.encode(t);return n.from(e.buffer,e.byteOffset,e.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}}e.BufferFormat=s,e.ViewFormat=a,e.UTF8Format=class extends i{constructor(t){super({...t,format:"utf8"})}createBufferTranscoder(){return new s({encode:t=>n.from(this.encode(t),"utf8"),decode:t=>this.decode(t.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){const{textEncoder:t,textDecoder:e}=o();return new a({encode:e=>t.encode(this.encode(e)),decode:t=>this.decode(e.decode(t)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}}},7200:t=>{"use strict";let e=null;t.exports=function(){return null===e&&(e={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),e}},266:t=>{"use strict";t.exports=class extends Error{constructor(t,e){super(t||""),"object"==typeof e&&null!==e&&(e.code&&(this.code=String(e.code)),e.expected&&(this.expected=!0),e.transient&&(this.transient=!0),e.cause&&(this.cause=e.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},8508:function(t,e){!function(t){"use strict";const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.ngraminator=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()},Object.defineProperty(t,"__esModule",{value:!0})}(e)},8859:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,E=String.prototype.toUpperCase,w=String.prototype.toLowerCase,T=RegExp.prototype.test,A=Array.prototype.concat,S=Array.prototype.join,O=Array.prototype.slice,I=Math.floor,_="function"==typeof BigInt?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,N="function"==typeof Symbol&&"object"==typeof Symbol.iterator,U="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||T.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-I(-t):I(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var R=r(2634),B=R.custom,F=$(B)?B:null;function P(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function j(t){return v.call(String(t),/"/g,""")}function M(t){return!("[object Array]"!==W(t)||U&&"object"==typeof t&&U in t)}function V(t){return!("[object RegExp]"!==W(t)||U&&"object"==typeof t&&U in t)}function $(t){if(N)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,i,a){var c=n||{};if(z(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!z(c,"customInspect")||c.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var T=String(e);return E?D(e,T):T}if("bigint"==typeof e){var I=String(e)+"n";return E?D(e,I):I}var L=void 0===c.depth?5:c.depth;if(void 0===i&&(i=0),i>=L&&L>0&&"object"==typeof e)return M(e)?"[Array]":"[Object]";var B,G=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=S.call(Array(t.indent+1)," ")}return{base:r,prev:S.call(Array(e+1),r)}}(c,i);if(void 0===a)a=[];else if(K(a,e)>=0)return"[Circular]";function H(e,r,n){if(r&&(a=O.call(a)).push(r),n){var o={depth:c.depth};return z(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),t(e,o,i+1,a)}return t(e,c,i+1,a)}if("function"==typeof e&&!V(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,H);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+S.call(et,", ")+" }":"")}if($(e)){var rt=N?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(e);return"object"!=typeof e||N?rt:Y(rt)}if((B=e)&&"object"==typeof B&&("undefined"!=typeof HTMLElement&&B instanceof HTMLElement||"string"==typeof B.nodeName&&"function"==typeof B.getAttribute)){for(var nt="<"+w.call(String(e.nodeName)),it=e.attributes||[],ot=0;ot"}if(M(e)){if(0===e.length)return"[]";var st=Z(e,H);return G&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+Q(st,G)+"]":"[ "+S.call(st,", ")+" ]"}if(function(t){return!("[object Error]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)){var at=Z(e,H);return"cause"in Error.prototype||!("cause"in e)||C.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+S.call(at,", ")+" }":"{ ["+String(e)+"] "+S.call(A.call("[cause]: "+H(e.cause),at),", ")+" }"}if("object"==typeof e&&y){if(F&&"function"==typeof e[F]&&R)return R(e,{depth:L-i});if("symbol"!==y&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return s&&s.call(e,(function(t,r){ct.push(H(r,e,!0)+" => "+H(t,e))})),J("Map",o.call(e),ct,G)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(H(t,e))})),J("Set",u.call(e),ut,G)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(Number(e)));if(function(t){if(!t||"object"!=typeof t||!_)return!1;try{return _.call(t),!0}catch(t){}return!1}(e))return Y(H(_.call(e)));if(function(t){return!("[object Boolean]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(d.call(e));if(function(t){return!("[object String]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)&&!V(e)){var lt=Z(e,H),ht=k?k(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!ht&&U&&Object(e)===e&&U in e?b.call(W(e),8,-1):ft?"Object":"",dt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+S.call(A.call([],pt||[],ft||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":G?dt+"{"+Q(lt,G)+"}":dt+"{ "+S.call(lt,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return G.call(t,e)}function W(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return P(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,H),"single",e)}function H(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+E.call(e.toString(16))}function Y(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):S.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+S.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=M(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(3474),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y0)for(var g=0;g{"use strict";var n=Array.prototype.slice,i=r(3474),o=Object.keys,s=o?function(t){return o(t)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},3474:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6578:t=>{"use strict";t.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},5372:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,c,u,l=!0;function h(t){function e(){r&&r(t,i),r=null}l?n(e):e()}function f(e,r,n){if(i[e]=n,r&&(c=!0),0==--s||r)h(r);else if(!c&&u{"use strict";var n=r(453)("%Array.prototype.concat%"),i=r(487),o=r(8075)("Array.prototype.slice"),s=r(1333)()&&Symbol.isConcatSpreadable,a=[],c=s?i.apply(n,a):null,u=s?r(4634):null;t.exports=s?function(t){for(var e=0;e{"use strict";var n=r(8075),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==o(t,e)}}},6897:(t,e,r)=>{"use strict";var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&s){var l=s(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},8206:(t,e,r)=>{"use strict";var n=r(5388),i=r(4810),o=r(8075)("String.prototype.replace"),s=/^\s$/.test("᠎"),a=s?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=s?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=i(n(this));return o(o(t,a,""),c,"")}},214:(t,e,r)=>{"use strict";var n=r(487),i=r(8452),o=r(5388),s=r(8206),a=r(4895),c=r(9377),u=n(a()),l=function(t){return o(t),u(t)};i(l,{getPolyfill:a,implementation:s,shim:c}),t.exports=l},4895:(t,e,r)=>{"use strict";var n=r(8206);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9377:(t,e,r)=>{"use strict";var n=r(8452),i=r(4895);t.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1093:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var o=i.slice(n,n+e);o.length===e&&(r=JSON.stringify(o),t[r]=t[r]||[],t[r].push(n))})),t)),{});return Object.keys(r).map((t=>({term:JSON.parse(t),positions:r[t]}))).sort(((t,e)=>t.term[0]>e.term[0]))}},6623:(t,e,r)=>{"use strict";var n=r(5767),i=r(3432),o=r(5795);function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function c(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r2?arguments[2]:y,l=s.includeSymbols?f:u,h=!!s.immutable;return function t(u){var f=h?d(u,s):u,y={},g=!0,m={node:f,node_:u,path:[].concat(r),parent:n[n.length-1],parents:n,key:r[r.length-1],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(g=!1)},delete:function(t){delete m.parent.node[m.key],t&&(g=!1)},remove:function(t){a(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(g=!1)},keys:null,before:function(t){y.before=t},after:function(t){y.after=t},pre:function(t){y.pre=t},post:function(t){y.post=t},stop:function(){i=!1},block:function(){g=!1}};if(!i)return m;function b(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=l(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t1?arguments[1]:y,this.value=t}function b(t){return new m(t,arguments.length>1?arguments[1]:y)}m.prototype.get=function(t){for(var e=this.value,r=0;e&&r{"use strict";var n=r(9675),i=r(8075)("TypedArray.prototype.buffer",!0),o=r(5680);t.exports=i||function(t){if(!o(t))throw new n("Not a Typed Array");return t.buffer}},2308:(t,e,r)=>{"use strict";var n=r(2682),i=r(487),o=r(9209)(),s={},a=r(24)(),c=r(5795),u=Object.defineProperty;if(c){var l=function(t){return t.byteOffset};n(o,(function(t){if("function"==typeof r.g[t]||"object"==typeof r.g[t]){var e=r.g[t].prototype,n=c(e,"byteOffset");if(!n&&a){var o=e.__proto__;n=c(o,"byteOffset")}if(n&&n.get)s[t]=i(n.get);else if(u){var h=new r.g[t](2);(n=c(h,"byteOffset"))&&n.configurable&&u(h,"length",{value:3}),2===h.length&&(s[t]=l)}}}))}var h=r(5680);t.exports=function(t){return!!h(t)&&function(t){var e;return n(s,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},6058:(t,e,r)=>{"use strict";var n=r(487),i=r(2682),o=r(5795),s=r(24)(),a=r(5680),c=r(6578),u={__proto__:null},l=Object.defineProperty;if(o){var h=function(t){return t.length};i(c,(function(t){var e=r.g[t];if("function"==typeof e||"object"==typeof e){var i=e.prototype,a=o(i,"length");if(!a&&s){var c=i.__proto__;a=o(c,"length")}if(a&&a.get)u["$"+t]=n(a.get);else if(l){var f=new r.g[t](2);(a=o(f,"length"))&&a.configurable&&l(f,"length",{value:3}),2===f.length&&(u["$"+t]=h)}}}))}t.exports=function(t){return!!a(t)&&function(t){var e;return i(u,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},8268:(t,e,r)=>{"use strict";var n=r(9675),i=r(280),o=r(2282),s=r(5910),a=r(4470),c=r(1752),u=r(2076),l=r(2138),h=r(7196),f=r(4810),p=r(4742),d=r(6419),y=r(7057),g=r(1509),m=r(4372),b=r(2308);t.exports=function(t,e){var r=this;g(r,"SEQ-CST");var v,E=r.length,w=h(t);v=w===-1/0?0:w<0?a(E+w,0):c(w,E);var T,A=void 0===e?E:h(e);T=A===-1/0?0:A<0?a(E+A,0):c(A,E);var S=a(T-v,0),O=y(r,[S]);if(S>0){if(s(m(r)))throw new n("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");if(d(r)===d(O))for(var I=m(r),_=m(O),L=p(r),x=v*L+b(r),N=b(O),U=N+S*L;N{"use strict";var n=r(8452),i=r(487),o=r(8268),s=r(2521),a=r(8599),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},2521:(t,e,r)=>{"use strict";var n=r(8268);t.exports=function(){return"function"==typeof Uint8Array&&Uint8Array.prototype.slice||n}},8599:(t,e,r)=>{"use strict";var n=r(8452),i=r(6763),o=r(2521);t.exports=function(){if("function"==typeof Uint8Array){var t=o(),e=i(Uint8Array.prototype);n(e,{slice:t},{slice:function(){return e.slice!==t}})}return t}},5767:(t,e,r)=>{"use strict";var n=r(2682),i=r(9209),o=r(487),s=r(8075),a=r(5795),c=s("Object.prototype.toString"),u=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),f=s("String.prototype.slice"),p=Object.getPrototypeOf,d=s("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(y,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(y,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},2634:()=>{},9209:(t,e,r)=>{"use strict";var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(9675),i=r(5910),o=r(4670),s=r(7070),a=r(9511);t.exports=function(t,e){var r=s(t);if(!o(t)&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(i(t))throw new n("Assertion failed: `arrayBuffer` must not be detached");return a(t)}},9969:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9290),o=r(9675),s=n&&n(0);t.exports=function(t,e){if("bigint"!=typeof t||"bigint"!=typeof e)throw new o("Assertion failed: `n` and `d` arguments must be BigInts");if(e===s)throw new i("Division by zero");return t===s?s:t%e}},893:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(4769),s=r(7030),a=r(8131),c=r(3400),u=r(2875),l=r(259),h=r(7730);t.exports=function(t,e,r){if("Object"!==h(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var f=i(r)?r:l(r);if(!i(f))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(a,u,s,t,e,f)}},7030:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(2997);t.exports=function(t){if(void 0!==t&&!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return o(t)}},280:(t,e,r)=>{"use strict";var n=r(9675),i=r(8859),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!o(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+i(e));return t[e]}},2282:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(8075)("Array.prototype.slice"),c=r(1087),u=r(5910),l=r(6167),h=r(4670),f=r(7070),p=r(4399),d=r(4097),y=r(5100);t.exports=function(t,e,r,n,g){var m=f(t);if(!h(t)&&!m)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!c(e))throw new o("Assertion failed: `byteIndex` must be an integer");if("string"!=typeof r||"number"!=typeof d.size["$"+r])throw new o("Assertion failed: `type` must be a Typed Array element type");if("boolean"!=typeof n)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==g&&"UNORDERED"!==g)throw new o("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&"boolean"!=typeof arguments[5])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: `arrayBuffer` is detached");if(e<0)throw new o("Assertion failed: `byteIndex` must be non-negative");var b,v=d.size["$"+r];if(!v)throw new o('Assertion failed: `type` must be one of "INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"');if(m)throw new i("SharedArrayBuffer is not supported by this implementation");b=a(new s(t,e),0,v);var E=arguments.length>5?arguments[5]:"little"===y,w=E?a(p([0,0,0,0,0,0,0,0],b),-v):a(p(b,[0,0,0,0,0,0,0,0]),0,v);return l(r,w,E)}},2491:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");return i(t,e)}},533:(t,e,r)=>{"use strict";t.exports=r(1412)},7881:t=>{"use strict";t.exports=function(t){return"BIGUINT64"===t||"BIGINT64"===t}},6966:(t,e,r)=>{"use strict";t.exports=r(9600)},4528:(t,e,r)=>{"use strict";var n=r(1376)("%Reflect.construct%",!0),i=r(893);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},8131:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(5701);t.exports=function(t){if(void 0===t)return!1;if(!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!i(t,"[[Value]]")&&!i(t,"[[Writable]]"))}},5910:(t,e,r)=>{"use strict";var n=r(9675),i=r(9511),o=r(9209)(),s=r(8075),a=r(4670),c=r(7070),u=s("SharedArrayBuffer.prototype.byteLength",!0);t.exports=function(t){var e=c(t);if(!a(t)&&!e)throw new n("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if(0===(e?u:i)(t))try{new r.g[o[0]](t)}catch(t){return!!t&&"TypeError"===t.name}return!1}},6575:(t,e,r)=>{"use strict";var n=r(9675),i=r(8075),o=i("%ArrayBuffer.prototype.resizable%",!0),s=i("%SharedArrayBuffer.prototype.growable%",!0),a=r(4670),c=r(7070);t.exports=function(t){var e=a(t),r=c(t);if(!e&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return e&&o?!o(t):!r||!s||!s(t)}},3400:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},5291:(t,e,r)=>{"use strict";var n=r(9675),i=r(5910),o=r(4742),s=r(9346),a=r(4372),c=r(2308),u=r(6058);t.exports=function(t){if(!s(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var e=t["[[Object]]"],r=t["[[CachedBufferByteLength]]"];if(i(a(e))&&"DETACHED"!==r)throw new n("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if("DETACHED"===r)return!0;var l,h=c(e),f=u(e);return l="AUTO"===f?r:h+f*o(e),h>r||l>r}},9373:t=>{"use strict";t.exports=function(t){return"UINT8"===t||"UINT8C"===t||"UINT16"===t||"UINT32"===t||"BIGUINT64"===t}},6681:(t,e,r)=>{"use strict";var n=r(9675),i=r(7149),o=r(5910),s=r(5680),a=r(4372);t.exports=function(t,e){if(!s(t))throw new n("Assertion failed: `obj` must be a Typed Array");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var r=a(t);return{"[[Object]]":t,"[[CachedBufferByteLength]]":o(r)?"DETACHED":i(r,e)}}},5015:(t,e,r)=>{"use strict";var n=r(9675),i=r(2491),o=r(3446),s=r(9887),a=r(3557),c=r(2475),u=r(7088),l=r(172),h=r(4770),f=r(6039),p=r(9308),d=r(2779),y=r(8894),g=r(4751),m=r(1189),b={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8},v={__proto__:null,INT8:u,UINT8:f,UINT8C:p,INT16:a,UINT16:l,INT32:c,UINT32:h,BIGINT64:o,BIGUINT64:s};t.exports=function(t,e,r){if("string"!=typeof t||!i(b,t))throw new n("Assertion failed: `type` must be a TypedArray element type: "+m(b));if("number"!=typeof e&&"bigint"!=typeof e)throw new n("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof r)throw new n("Assertion failed: `isLittleEndian` must be a Boolean");if("FLOAT32"===t)return d(e,r);if("FLOAT64"===t)return y(e,r);var o=b[t],s=(0,v[t])(e);return g(s,o,r)}},6167:(t,e,r)=>{"use strict";var n=r(453),i=r(8075),o=r(9290),s=r(8068),a=r(9675),c=n("%BigInt%",!0),u=r(2491),l=r(533),h=r(7881),f=r(9373),p=r(4915),d=r(8968),y=r(6570),g=r(4138),m=r(2158),b=i("Array.prototype.reverse"),v=i("Array.prototype.slice"),E=r(1189),w={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8};t.exports=function(t,e,r){if(!u(w,t))throw new a("Assertion failed: `type` must be a TypedArray element type: "+E(w));if(!l(e)||!g(e,m))throw new a("Assertion failed: `rawBytes` must be an Array of bytes");if("boolean"!=typeof r)throw new a("Assertion failed: `isLittleEndian` must be a Boolean");var n=w[t];if(e.length!==n)throw new o("Assertion failed: `rawBytes` must have a length of "+n+" for type "+t);var i=h(t);if(i&&!c)throw new s("this environment does not support BigInts");return e=v(e,0,n),r||b(e),"FLOAT32"===t?p(e):"FLOAT64"===t?d(e):y(e,n,f(t),i)}},2875:(t,e,r)=>{"use strict";var n=r(8756);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},2076:(t,e,r)=>{"use strict";var n=r(9675),i=r(3400),o=r(2875),s=r(7730),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof c)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},2138:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(1087),c=r(7881),u=r(5910),l=r(5015),h=r(4670),f=r(7070),p=r(9957),d=r(4097),y=r(5100),g=r(3795);t.exports=function(t,e,r,n,m,b){var v=f(t);if(!h(t)&&!v)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!a(e)||e<0)throw new o("Assertion failed: `byteIndex` must be a non-negative integer");if("string"!=typeof r||!p(d.size,"$"+r))throw new o("Assertion failed: `type` must be a Typed Array Element Type");if("number"!=typeof n&&"bigint"!=typeof n)throw new o("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof m)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==b&&"UNORDERED"!==b&&"INIT"!==b)throw new o('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: ArrayBuffer is detached");if(c(r)?"bigint"!=typeof n:"number"!=typeof n)throw new o("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var E=d.size["$"+r],w=l(r,n,arguments.length>6?arguments[6]:"little"===y);if(v)throw new i("SharedArrayBuffer is not supported by this implementation");var T=new s(t,e,E);g(w,(function(t,e){T[e]=t}))}},7732:(t,e,r)=>{"use strict";var n=r(453)("%Symbol.species%",!0),i=r(9675),o=r(4528),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var a=n?r[n]:void 0;if(null==a)return e;if(o(a))return a;throw new i("no constructor found")}},9693:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9675),o=r(8068);t.exports=function(t){if("string"!=typeof t)throw new i("`argument` must be a string");if(!n)throw new o("BigInts are not supported in this environment");try{return n(t)}catch(t){return}}},8679:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%RegExp%"),s=r(9675),a=n("%parseInt%"),c=r(8075),u=r(9721),l=c("String.prototype.slice"),h=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),y=r(214);t.exports=function t(e){if("string"!=typeof e)throw new s("Assertion failed: `argument` is not a String");if(h(e))return i(a(l(e,2),2));if(f(e))return i(a(l(e,2),8));if(d(e)||p(e))return NaN;var r=y(e);return r!==e?t(r):i(e)}},2964:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Number%"),s=r(9675),a=r(8068),c=r(9693),u=r(866);t.exports=function(t){if(!i)throw new a("BigInts are not supported in this environment");var e=u(t,o);if(null==e)throw new s("Cannot convert null or undefined to a BigInt");if("boolean"==typeof e)return i(e?1:0);if("number"==typeof e)throw new s("Cannot convert a Number value to a BigInt");if("string"==typeof e){var r=c(e);if(void 0===r)throw new s("Failed to parse String to BigInt");return r}if("symbol"==typeof e)throw new s("Cannot convert a Symbol value to a BigInt");if("bigint"!=typeof e)throw new a("Assertion failed: unknown primitive type");return e}},3446:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,31)),l=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t),r=c(a,e,l);return r>=u?r-l:r}},9887:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t);return c(a,e,u)}},4323:t=>{"use strict";t.exports=function(t){return!!t}},3557:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return a>=32768?a-65536:a}},2475:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046),a=4294967296;t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),c=n(r,a),u=c>=2147483648?c-a:c;return 0===u?0:u}},7088:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,256);return a>=128?a-256:a}},7196:(t,e,r)=>{"use strict";var n=r(8410),i=r(3384),o=r(8756),s=r(5046);t.exports=function(t){var e=n(t);return o(e)||0===e?0:s(e)?i(e):e}},8410:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Number%"),s=r(6600),a=r(866),c=r(8679);t.exports=function(t){var e=s(t)?t:a(t,o);if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):o(e)}},866:(t,e,r)=>{"use strict";var n=r(5437);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},259:(t,e,r)=>{"use strict";var n=r(9957),i=r(9675),o=r(7730),s=r(4323),a=r(6966);t.exports=function(t){if("Object"!==o(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!a(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},4810:(t,e,r)=>{"use strict";var n=r(453)("%String%"),i=r(9675);t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return n(t)}},172:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return 0===a?0:a}},4770:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,4294967296);return 0===a?0:a}},6039:(t,e,r)=>{"use strict";var n=r(5046),i=r(4224),o=r(8410),s=r(3384);t.exports=function(t){var e=o(t);if(!n(e)||0===e)return 0;var r=s(e);return i(r,256)}},9308:(t,e,r)=>{"use strict";var n=r(9719),i=r(8410),o=r(5986),s=r(8756);t.exports=function(t){var e=i(t);if(s(e))return 0;var r=n(e,0,255),a=o(r);return ra+.5?a+1:a%2==0?a:a+1}},7730:(t,e,r)=>{"use strict";var n=r(2439);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},9531:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(533),s=r(4528),a=r(5291),c=r(9271),u=r(1509),l=r(9209)();t.exports=function(t,e){if(!s(t))throw new i("Assertion failed: `constructor` must be a constructor");if(!o(e))throw new i("Assertion failed: `argumentList` must be a List");if(0===l.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r;r=0===e.length?new t:1===e.length?new t(e[0]):2===e.length?new t(e[0],e[1]):new t(e[0],e[1],e[2]);var h=u(r,"SEQ-CST");if(1===e.length&&"number"==typeof e[0]){if(a(h))throw new i("new Typed Array is out of bounds");if(c(h){"use strict";var n=r(8068),i=r(9675),o=r(1087),s=r(5767),a=r(4097);t.exports=function(t){var e=s(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=a.size["$"+a.name["$"+e]];if(!o(r)||r<0)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},6419:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(4097);t.exports=function(t){var e=o(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=s.name["$"+e];if("string"!=typeof r)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},9271:(t,e,r)=>{"use strict";var n=r(9675),i=r(5986),o=r(6575),s=r(5291),a=r(4742),c=r(9346),u=r(4372),l=r(2308),h=r(6058);t.exports=function(t){if(!c(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(s(t))throw new n("Assertion failed: `taRecord` is out of bounds");var e=t["[[Object]]"],r=h(e);if("AUTO"!==r)return r;if(o(u(e)))throw new n("Assertion failed: array buffer is not fixed length");var f=l(e),p=a(e),d=t["[[CachedBufferByteLength]]"];if("DETACHED"===d)throw new n("Assertion failed: typed array is detached");return i((d-f)/p)}},7057:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(9209)(),a=r(533),c=r(7732),u=r(9531),l=r(2697);t.exports=function(t,e){if(0===s.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r=o(t);if(!r)throw new i("Assertion failed: exemplar must be a TypedArray");if(!a(e))throw new i("Assertion failed: `argumentList` must be a List");var h=l(r);if("function"!=typeof h)throw new n("Assertion failed: `constructor` of `exemplar` ("+r+") must exist. Please report this!");var f=c(t,h);return u(f,e)}},1509:(t,e,r)=>{"use strict";var n=r(9675),i=r(5291),o=r(6681),s=r(7730),a=r(5680);t.exports=function(t,e){if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!a(t))throw new n("Assertion failed: `O` must be a Typed Array");var r=o(t,e);if(i(r))throw new n("`O` must be in-bounds and backed by a non-detached buffer");return r}},9719:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Math.max%"),s=n("%Math.min%");t.exports=function(t,e,r){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof r||!(e<=r))throw new i("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return s(o(e,t),r)}},5986:t=>{"use strict";var e=Math.floor;t.exports=function(t){return"bigint"==typeof t?t:e(t)}},4470:(t,e,r)=>{"use strict";var n=r(453);t.exports=n("%Math.max%")},1752:(t,e,r)=>{"use strict";var n=r(453);t.exports=n("%Math.min%")},4224:(t,e,r)=>{"use strict";var n=r(113);t.exports=function(t,e){return n(t,e)}},4097:t=>{"use strict";t.exports={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8}}},3384:(t,e,r)=>{"use strict";var n=r(5986),i=r(9675);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2439:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},1376:(t,e,r)=>{"use strict";t.exports=r(453)},4769:(t,e,r)=>{"use strict";var n=r(592),i=r(655),o=n.hasArrayLengthDefineBug(),s=o&&r(1412),a=r(8075)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,c,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(c in n&&a(n,c)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[c]=l,e(n[c],l)}return o&&"length"===c&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,c,r(u)),!0)}},1412:(t,e,r)=>{"use strict";var n=r(453)("%Array%"),i=!n.isArray&&r(8075)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4915:(t,e,r)=>{"use strict";var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[3]?-1:1,r=(127&t[3])<<1|t[2]>>7,i=(127&t[2])<<16|t[1]<<8|t[0];return 0===r&&0===i?1===e?0:-0:255===r&&0===i?1===e?1/0:-1/0:255===r&&0!==i?NaN:-127==(r-=127)?e*i*n(2,-149):e*(1+i*n(2,-23))*n(2,r)}},8968:(t,e,r)=>{"use strict";var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[7]?-1:1,r=(127&t[7])<<4|(240&t[6])>>4,i=281474976710656*(15&t[6])+1099511627776*t[5]+4294967296*t[4]+16777216*t[3]+65536*t[2]+256*t[1]+t[0];return 0===r&&0===i?0*e:2047===r&&0!==i?NaN:2047===r&&0===i?e*(1/0):-1023==(r-=1023)?e*i*5e-324:e*(1+i/4503599627370496)*n(2,r)}},6570:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.pow%"),o=n("%Number%"),s=n("%BigInt%",!0);t.exports=function(t,e,r,n){for(var a=n?s:o,c=a(0),u=0;u{"use strict";var n=r(453),i=n("%Uint8Array%",!0),o=n("%Uint32Array%",!0),s=r(4372),a=o&&new o([305419896]),c=a&&new i(s(a));t.exports=c?120===c[0]?"little":18===c[0]?"big":52===c[0]?"mixed":"unknown":"indeterminate"},4138:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";var e=1075;t.exports=function(t){var r="";if(0===t)return r;for(var n,i=e,o=0;o=1?(t=n-1,r+="1",i===e&&(i=o)):(t=n,r+="0"),1===n||o-i>54)return r;return r}},2997:t=>{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},6763:(t,e,r)=>{"use strict";var n=r(453)("%Object.getPrototypeOf%",!0),i=r(24)();t.exports=n||(i?function(t){return t.__proto__}:null)},8213:(t,e,r)=>{"use strict";var n=r(453)("%Math.floor%");t.exports=function(t){for(var e,r="";t>0;)r=(e=t/2)===(t=n(e))?"0"+r:"1"+r;return r}},4751:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%BigInt%",!0);t.exports=function(t,e,r){var n="bigint"==typeof t?o:i;t<0&&(t>>>=0);for(var s=[],a=0;a>=n(8);return s}},2158:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=0&&t<=255&&(0|t)===t}},5046:(t,e,r)=>{"use strict";var n=r(8756);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1087:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=r(8756),a=r(5046);t.exports=function(t){if("number"!=typeof t||s(t)||!a(t))return!1;var e=i(t);return o(e)===e}},8756:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},3508:t=>{"use strict";t.exports=function(t){return 0===t&&1/t==-1/0}},6600:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},113:t=>{"use strict";var e=Math.floor;t.exports=function(t,r){var n=t%r;return e(n>=0?n:n+r)}},122:t=>{"use strict";t.exports=function(t,e,r){var n=t(e,r);return n>=0?n:n+r}},5701:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(i(t,e)&&!o[e])return!1;var r=i(t,"[[Value]]")||i(t,"[[Writable]]"),s=i(t,"[[Get]]")||i(t,"[[Set]]");if(r&&s)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}},9346:(t,e,r)=>{"use strict";var n=r(9957),i=r(5680),o=r(1087);t.exports=function(t){return!!t&&"object"==typeof t&&n(t,"[[Object]]")&&n(t,"[[CachedBufferByteLength]]")&&(o(t["[[CachedBufferByteLength]]"])&&t["[[CachedBufferByteLength]]"]>=0||"DETACHED"===t["[[CachedBufferByteLength]]"])&&i(t["[[Object]]"])}},2697:(t,e,r)=>{"use strict";var n=r(453),i={__proto__:null,$Int8Array:n("%Int8Array%",!0),$Uint8Array:n("%Uint8Array%",!0),$Uint8ClampedArray:n("%Uint8ClampedArray%",!0),$Int16Array:n("%Int16Array%",!0),$Uint16Array:n("%Uint16Array%",!0),$Int32Array:n("%Int32Array%",!0),$Uint32Array:n("%Uint32Array%",!0),$BigInt64Array:n("%BigInt64Array%",!0),$BigUint64Array:n("%BigUint64Array%",!0),$Float32Array:n("%Float32Array%",!0),$Float64Array:n("%Float64Array%",!0)};t.exports=function(t){return i["$"+t]}},2779:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=n("%Math.pow%"),a=r(5046),c=r(8756),u=r(3508);t.exports=function(t,e){if(c(t))return e?[0,0,192,127]:[127,192,0,0];var r;if(0===t)return r=u(t)?128:0,e?[0,0,0,r]:[r,0,0,0];if(i(t)>34028234663852886e22||!a(t))return r=t<0?255:127,e?[0,0,128,r]:[r,128,0,0];var n=t<0?1:0;t=i(t);for(var l=0;t>=2;)l+=1,t/=2;for(;t<1;)l-=1,t*=2;var h=t-1;h*=s(2,23)+.5,l+=127;var f=n<<31|(l<<=23)|(h=o(h)),p=255&f,d=255&(f>>=8),y=255&(f>>=8),g=255&(f>>=8);return e?[p,d,y,g]:[g,y,d,p]}},8894:(t,e,r)=>{"use strict";var n=r(453),i=n("%parseInt%"),o=n("%Math.abs%"),s=n("%Math.floor%"),a=r(8075),c=a("String.prototype.indexOf"),u=a("String.prototype.slice"),l=r(9154),h=r(8213),f=r(3508),p="11111111111",d="00000000000",y=d+d+d+d+"0000000";t.exports=function(t,e){var r,n,a=t<0||f(t)?"1":"0";if(isNaN(t))r=p,n="1"+y;else if(isFinite(t))if(0===t)r=d,n="0"+y;else{t=o(t);var g,m=s(t),b=h(m),v=l(t-m);if(b)r=b.length-1;else{var E=c(v,"1");E>-1&&(g=E+1),r=-g}n=b+v,r<0?(r<=-1023&&(g=1022),n=u(n,g)):n=u(n,1),r=u(d+h(r+1023),-11),n=u(n+y+"0",0,52)}else r=p,n="0"+y;for(var w=a+r+n,T=[],A=0;A<8;A++)T[e?8-A-1:A]=i(u(w,8*A,8*(A+1)),2);return T}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{SearchIndex:()=>Q,UI:()=>Z});var t=r(1093),e=r(8508);const i=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),o=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],s=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),a=([t,e,r])=>{const{fields:n,values:i}=r.replace,o=()=>t.reduce(((t,e)=>[e,...t,...i[e]||[]]),[]);return i?n?n.includes(e)?Promise.resolve([o(),e,r]):Promise.resolve([t,e,r]):Promise.resolve([o(),e,r]):Promise.resolve([t,e,r])},c=([t,r,n])=>{let{fields:i,lengths:o,join:s=" "}=n.ngrams;return i||(i=[r]),o&&i.includes(r)?[(0,e.ngraminator)(t.filter((t=>null!==t)),o).map((t=>t.join(s))),r,n]:Promise.resolve([t,r,n])},u=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([e,r,n])=>{const i=t(e),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>[t.term[0],(t.positions.length/o).toFixed(2)])).sort(),r,n])},h={SPLIT:i,SKIP:o,LOWCASE:s,REPLACE:a,NGRAMS:c,STOPWORDS:u,SCORE_TERM_FREQUENCY:l,SPY:([t,e,r])=>(console.log("----------------"),console.log("field ->"),console.log(e),console.log("tokens ->"),console.log(t),console.log("----------------"),Promise.resolve([t,e,r]))},f=(t,e,r)=>i([t,e,r]).then(o).then(s).then(a).then(c).then(u).then(l).then((([t,e,r])=>t));var p=r(9148),d=r(7007),y=r(9901);function g(t,e){const r=t=>"string"==typeof t,n=async(r,n=t=>new Promise((e=>e(t))))=>new Promise((async(o,a)=>{const c=t=>void 0===t?o(void 0):t instanceof Promise?o(t):void 0;try{c(r),r=e.parse(r),r=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(r),c(r=await(e=>void 0===e?s(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?i(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(r)),c(r=await n(r))}catch(t){return a(t)}return Array.isArray(r)?o(r):o(s(r))})),i=async(t,e)=>Promise.all(t.map((t=>n(t,e)))).then((t=>{const e=t.flat(1/0).reduce(((t,e)=>(e&&t.set(e._id,[...t.get(e._id)||[],e._match]),t)),new Map);return{sumTokensMinusStopwords:t.filter((t=>t)).length,union:Array.from(e.keys()).map((t=>({_id:t,_match:e.get(t)})))}})),o=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(y.HI),["IDX",t,n]},s=t=>new Promise((e=>{if(void 0===t)return e(void 0);const r=new Map;Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0),limit:t.LIMIT,reverse:t.REVERSE}).then((t=>t.forEach((t=>t.value.forEach((e=>r.set(e,[...r.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})])))))))))).then((()=>e(Array.from(r.keys()).map((t=>({_id:t,_match:r.get(t)}))))))})),a=(t,e,r=!0)=>e?0===e.length?[]:(e=new Set(e.map((t=>t._id))),t.map((t=>Object.assign(t,{_id:[...new Set([...t._id].filter((t=>e.has(t))))]}))).filter((t=>!r||t._id.length))):t,c=t=>(t=e.parse(t),n(t).then((e=>({_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE,...t})))),u=e=>t.db.iterator(e).all().then((t=>t.map((([t,e])=>({key:t,value:e}))))),l=(t,r)=>s({...e.parse(t),LIMIT:1,REVERSE:r}).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),h=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>{let r=t.VALUE.LTE;void 0!==t.VALUE.LTE&&"number"!=typeof t.VALUE.LTE&&(r+="○");let n=t.VALUE.GTE;return t.VALUE.GTE&&"number"!=typeof t.VALUE.GTE&&(n+=" "),u({gte:o(e,n),lte:o(e,r,!0),keys:!0,values:!1}).then((t=>t.map((({key:t})=>({FIELD:t[1],VALUE:t[2][0]})))))}))).then((t=>t.flat()))),f=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0)}).then((t=>t.map((t=>({FIELD:t.key[1],VALUE:t.key[2][0],_id:t.value})))))))).then((t=>t.flat()))),p=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});return{AGGREGATE:({BUCKETS:t,FACETS:e,QUERY:r})=>Promise.all([t,e,r]).then((([t=[],e=[],r=[]])=>({BUCKETS:a(t.flat(),r),FACETS:a(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:a,BUCKET:c,BUCKETS:(...t)=>Promise.all(t.map(c)),CREATED:()=>t.db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(h):[h({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),EXIST:(...e)=>Promise.all(e.map((e=>t.db.get([t.docExistsSpace,e]).catch((t=>null))))).then((t=>t.reduce(((t,r,n)=>(null!=r&&t.push(e[n]),t)),[]))),EXPORT:u,FACETS:(...t)=>Promise.all(t.length?t.map(f):[f({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:()=>u({gte:["FIELD",y.LO],lte:["FIELD",y.HI]}).then((t=>t.map((t=>t.key[1])))),GET:n,INTERSECTION:(t,e)=>i(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t.db.get(["~LAST_UPDATED"]),MAX:t=>l(t,!0),MIN:l,OBJECT:e=>Promise.all(e.map((e=>t.db.get(["DOC",e._id]).catch((t=>null))))).then((t=>e.map(((e,r)=>(e._object=t[r],e))))),SET_SUBTRACTION:(t,e)=>Promise.all([r(t)?n(t):t,r(e)?n(e):e]).then((([t,e])=>t.filter((t=>-1===e.map((t=>t._id)).indexOf(t._id))))),SORT:t=>new Promise((e=>e(t.sort(((t,e)=>p.compare(t._id,e._id)))))),UNION:i}}y.LO=null,y.HI=void 0;var m=r(6623);const b=null,v=void 0;class E{availableFields=[];#t;constructor(t){this.#t=t}setAvailableFields=t=>{this.availableFields=t};#e=t=>{const e=t=>this.#t||"string"!=typeof t?t:t.toLowerCase();return{FIELD:t.FIELD.map(e),VALUE:{GTE:e(t.VALUE.GTE),LTE:e(t.VALUE.LTE)}}};parse(t){if(Array.isArray(t))throw new Error("token cannot be Array");if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return this.#e({FIELD:this.availableFields,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return this.#e({FIELD:[e],VALUE:{GTE:r.join(":"),LTE:r.join(":")}})}return"number"==typeof t&&(t={VALUE:{GTE:t,LTE:t}}),null===t.VALUE&&(t.VALUE={GTE:null,LTE:null}),"string"!=typeof t.VALUE&&"number"!=typeof t.VALUE||(t.VALUE={GTE:t.VALUE,LTE:t.VALUE}),void 0!==t.VALUE&&Object.keys(t.VALUE).length||(t.VALUE={GTE:b,LTE:v}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=b),void 0===t.VALUE.LTE&&(t.VALUE.LTE=v),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?this.#e({FIELD:this.availableFields,...t}):(t.FIELD=[t.FIELD].flat(),this.#e(t))}}class w{constructor(t={}){t={caseSensitive:!0,isLeaf:t=>"string"==typeof t||"number"==typeof t,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC",db:new t.Level(t.name,{keyEncoding:y,valueEncoding:"json"}),...t};const e=new E(t.caseSensitive),r=new d,n=g(t,e),i=function(t,e,r){let n=0;const i=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const n=[];return m(e._object).forEach((function(e){const i=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"!==i&&!r.doNotIndexField.filter((t=>i.startsWith(t))).length&&t.isLeaf(this.node)){if(!t.stopwords.includes(this.node)){const e=JSON.stringify([i,[this.node].flat(1/0).map((e=>"string"!=typeof e||t.caseSensitive?e:e.toLowerCase()))]);n.push(t.caseSensitive?e:e.toLowerCase())}this.update(this.node,!0)}})),{_id:e._id,keys:n}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(e,r,s,a,c)=>new Promise((u=>{e=e.map((t=>{var e;return t._id=void 0===(e=t._id)?++n:"string"==typeof e||"number"==typeof e?e:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),g(t).EXIST(...e.map((t=>t._id))).then((t=>((t,e,r)=>{const n=Object.keys(t);return Promise.all(n.map((t=>["IDX",...JSON.parse(t)])).map((t=>new Promise(((r,n)=>e.get(t).then(r).catch((t=>r([])))))))).then((e=>e.map(((e,i)=>{const o=new Set(e),s=new Set(t[n[i]]);if("put"===r)return{key:["IDX",...JSON.parse(n[i])],type:r,value:[...new Set([...o,...s])].sort()};if("del"===r){const t=[...new Set([...o].filter((t=>!s.has(t))))];return{key:["IDX",...JSON.parse(n[i])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>i(t,e))).reduce(o,{}))(e,c),r,s).then((n=>r.batch(n.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(e,s):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(n)),(r=>u(e.map((e=>{let r;return"put"===s?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===s&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:a,status:r}})))))))))})),a=()=>(new Date).toISOString(),c=e=>t.db.put(["~LAST_UPDATED"],a()).then((()=>e));return{DELETE:e=>g(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t.db,"del","DELETE",{}))).then(c),IMPORT:r=>t.db.clear().then((()=>t.db.batch(r.map((t=>Object.assign(t,{type:"put"})))))).then((()=>g(t).FIELDS())).then((t=>e.setAvailableFields(t))),PUT:(r,n={})=>s(r.map((t=>({_id:t._id,_object:t}))),t.db,"put","PUT",n).then(c).then((async r=>(e.setAvailableFields(await g(t).FIELDS()),r))),TIMESTAMP:()=>t.db.get(["~CREATED"]).then().catch((e=>t.db.put(["~CREATED"],a()).then(c).then((()=>r.emit("ready"))))),TIMESTAMP_LAST_UPDATED:c}}(t,e,r);i.TIMESTAMP(),this.AGGREGATION_FILTER=n.AGGREGATION_FILTER,this.AND=(t,e)=>n.INTERSECTION(t,e).then(this.flattenMatchArrayInResults),this.BUCKET=n.BUCKET,this.BUCKETS=n.BUCKETS,this.CREATED=n.CREATED,this.DELETE=i.DELETE,this.DISTINCT=n.DISTINCT,this.EVENTS=r,this.EXIST=n.EXIST,this.EXPORT=n.EXPORT,this.FACETS=n.FACETS,this.FIELDS=n.FIELDS,this.GET=(t,e)=>n.GET(t,e).then(this.flattenMatchArrayInResults),this.IMPORT=i.IMPORT,this.LAST_UPDATED=n.LAST_UPDATED,this.MAX=n.MAX,this.MIN=n.MIN,this.NOT=(...t)=>n.SET_SUBTRACTION(...t).then(this.flattenMatchArrayInResults),this.OBJECT=n.OBJECT,this.OR=(t,e)=>n.UNION(t,e).then((t=>t.union)).then(this.flattenMatchArrayInResults),this.PUT=i.PUT,this.SORT=n.SORT,this.STORE=t.db,this.TIMESTAMP_LAST_UPDATED=i.TIMESTAMP_LAST_UPDATED,this.TOKEN_PARSER=e}flattenMatchArrayInResults(t){return void 0===t?void 0:t.map((t=>(t._match=t._match.flat(1/0).map((t=>"string"==typeof t?JSON.parse(t):t)).sort(((t,e)=>t.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t)))}}class T{constructor(t={}){return new w({Level:p.Z,...t})}}var A=r(5606);const S="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,O=new Set,I="object"==typeof A&&A?A:{},_=(t,e,r,n)=>{"function"==typeof I.emitWarning?I.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)};let L=globalThis.AbortController,x=globalThis.AbortSignal;if(void 0===L){x=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},L=class{constructor(){e()}signal=new x;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==I.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,_("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const N=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),U=t=>N(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?C:null:null;class C extends Array{constructor(t){super(t),this.fill(0)}}class k{heap;length;static#r=!1;static create(t){const e=U(t);if(!e)return[];k.#r=!0;const r=new k(t,e);return k.#r=!1,r}constructor(t,e){if(!k.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class D{#n;#i;#o;#s;#a;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#l;#h;#f;#p;#d;#y;#g;#m;#b;#v;#E;#w;#T;#A;#S;#O;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#T,sizes:t.#E,keyMap:t.#h,keyList:t.#f,valList:t.#p,next:t.#d,prev:t.#y,get head(){return t.#g},get tail(){return t.#m},free:t.#b,isBackgroundFetch:e=>t.#I(e),backgroundFetch:(e,r,n,i)=>t.#_(e,r,n,i),moveToTail:e=>t.#L(e),indexes:e=>t.#x(e),rindexes:e=>t.#N(e),isStale:e=>t.#U(e)}}get max(){return this.#n}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#c}get dispose(){return this.#o}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:l,noUpdateTTL:h,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:d,fetchMethod:y,memoMethod:g,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=t;if(0!==e&&!N(e))throw new TypeError("max option must be a nonnegative integer");const T=e?U(e):Array;if(!T)throw new Error("invalid max value: "+e);if(this.#n=e,this.#i=f,this.maxEntrySize=p||this.#i,this.sizeCalculation=d,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("memoMethod must be a function if defined");if(this.#c=g,void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(this.#a=y,this.#S=!!y,this.#h=new Map,this.#f=new Array(e).fill(void 0),this.#p=new Array(e).fill(void 0),this.#d=new T(e),this.#y=new T(e),this.#g=0,this.#m=0,this.#b=k.create(e),this.#u=0,this.#l=0,"function"==typeof c&&(this.#o=c),"function"==typeof u?(this.#s=u,this.#v=[]):(this.#s=void 0,this.#v=void 0),this.#A=!!this.#o,this.#O=!!this.#s,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!N(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!N(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=N(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!N(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(0===this.#n&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!O.has(t))(t)&&(O.add(t),_("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,D))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#k(){const t=new C(this.#n),e=new C(this.#n);this.#T=t,this.#w=e,this.#D=(r,n,i=S.now())=>{if(e[r]=0!==n?i:0,t[r]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.#U(r)&&this.#R(this.#f[r],"expire")}),n+1);t.unref&&t.unref()}},this.#B=r=>{e[r]=0!==t[r]?S.now():0},this.#F=(i,o)=>{if(t[o]){const s=t[o],a=e[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const c=i.now-a;i.remainingTTL=s-c}};let r=0;const n=()=>{const t=S.now();if(this.ttlResolution>0){r=t;const e=setTimeout((()=>r=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const o=this.#h.get(i);if(void 0===o)return 0;const s=t[o],a=e[o];return s&&a?s-((r||n())-a):1/0},this.#U=i=>{const o=e[i],s=t[i];return!!s&&!!o&&(r||n())-o>s}}#B=()=>{};#F=()=>{};#D=()=>{};#U=()=>!1;#C(){const t=new C(this.#n);this.#l=0,this.#E=t,this.#P=e=>{this.#l-=t[e],t[e]=0},this.#j=(t,e,r,n)=>{if(this.#I(e))return 0;if(!N(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!N(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#M=(e,r,n)=>{if(t[e]=r,this.#i){const r=this.#i-t[e];for(;this.#l>r;)this.#V(!0)}this.#l+=t[e],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#P=t=>{};#M=(t,e,r)=>{};#j=(t,e,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#m;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#g);)e=this.#y[e]}*#N({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#g;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#m);)e=this.#d[e]}#$(t){return void 0!==t&&this.#h.get(this.#f[t])===t}*entries(){for(const t of this.#x())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*rentries(){for(const t of this.#N())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*keys(){for(const t of this.#x()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*rkeys(){for(const t of this.#N()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*values(){for(const t of this.#x())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}*rvalues(){for(const t of this.#N())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0!==i&&t(i,this.#f[r],this))return this.get(this.#f[r],e)}}forEach(t,e=this){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}rforEach(t,e=this){for(const r of this.#N()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}purgeStale(){let t=!1;for(const e of this.#N({allowStale:!0}))this.#U(e)&&(this.#R(this.#f[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const r=this.#p[e],n=this.#I(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#T&&this.#w){const t=this.#T[e],r=this.#w[e];if(t&&r){const e=t-(S.now()-r);i.ttl=e,i.start=Date.now()}}return this.#E&&(i.size=this.#E[e]),i}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const r=this.#f[e],n=this.#p[e],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const o={value:i};if(this.#T&&this.#w){o.ttl=this.#T[e];const t=S.now()-this.#w[e];o.start=Math.floor(Date.now()-t)}this.#E&&(o.size=this.#E[e]),t.unshift([r,o])}return t}load(t){this.clear();for(const[e,r]of t){if(r.start){const t=Date.now()-r.start;r.start=S.now()-t}this.set(e,r.value,r)}}set(t,e,r={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#j(t,e,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#R(t,"set"),this;let l=0===this.#u?void 0:this.#h.get(t);if(void 0===l)l=0===this.#u?this.#m:0!==this.#b.length?this.#b.pop():this.#u===this.#n?this.#V(!1):this.#u,this.#f[l]=t,this.#p[l]=e,this.#h.set(t,l),this.#d[this.#m]=l,this.#y[l]=this.#m,this.#m=l,this.#u++,this.#M(l,u,a),a&&(a.set="add"),c=!1;else{this.#L(l);const r=this.#p[l];if(e!==r){if(this.#S&&this.#I(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=r;void 0===e||o||(this.#A&&this.#o?.(e,t,"set"),this.#O&&this.#v?.push([e,t,"set"]))}else o||(this.#A&&this.#o?.(r,t,"set"),this.#O&&this.#v?.push([r,t,"set"]));if(this.#P(l),this.#M(l,u,a),this.#p[l]=e,a){a.set="replace";const t=r&&this.#I(r)?r.__staleWhileFetching:r;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#T||this.#k(),this.#T&&(c||this.#D(l,n,i),a&&this.#F(a,l)),!o&&this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#u;){const t=this.#p[this.#g];if(this.#V(!0),this.#I(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#V(t){const e=this.#g,r=this.#f[e],n=this.#p[e];return this.#S&&this.#I(n)?n.__abortController.abort(new Error("evicted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(n,r,"evict"),this.#O&&this.#v?.push([n,r,"evict"])),this.#P(e),t&&(this.#f[e]=void 0,this.#p[e]=void 0,this.#b.push(e)),1===this.#u?(this.#g=this.#m=0,this.#b.length=0):this.#g=this.#d[e],this.#h.delete(r),this.#u--,e}has(t,e={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=e,i=this.#h.get(t);if(void 0!==i){const t=this.#p[i];if(this.#I(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#U(i))return r&&this.#B(i),n&&(n.has="hit",this.#F(n,i)),!0;n&&(n.has="stale",this.#F(n,i))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:r=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!r&&this.#U(n))return;const i=this.#p[n];return this.#I(i)?i.__staleWhileFetching:i}#_(t,e,r,n){const i=void 0===e?void 0:this.#p[e];if(this.#I(i))return i;const o=new L,{signal:s}=r;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,c=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,c&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!c&&!i)return u(o.signal.reason);const h=l;return this.#p[e]===l&&(void 0===n?h.__staleWhileFetching?this.#p[e]=h.__staleWhileFetching:this.#R(t,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(t,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,u=l;if(this.#p[e]===l&&(c&&void 0!==u.__staleWhileFetching?s||(this.#p[e]=u.__staleWhileFetching):this.#R(t,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);const l=new Promise(((e,n)=>{const s=this.#a?.(t,i,a);s&&s instanceof Promise&&s.then((t=>e(void 0===t?void 0:t)),n),o.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(e(void 0),r.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=t),u(t)))),h=Object.assign(l,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,h,{...a.options,status:void 0}),e=this.#h.get(t)):this.#p[e]=h,h}#I(t){if(!this.#S)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof L}async fetch(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:y=!1,status:g,signal:m}=e;if(!this.#S)return g&&(g.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:m};let v=this.#h.get(t);if(void 0===v){g&&(g.fetch="miss");const e=this.#_(t,v,b,d);return e.__returned=e}{const e=this.#p[v];if(this.#I(e)){const t=r&&void 0!==e.__staleWhileFetching;return g&&(g.fetch="inflight",t&&(g.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#U(v);if(!y&&!i)return g&&(g.fetch="hit"),this.#L(v),n&&this.#B(v),g&&this.#F(g,v),e;const o=this.#_(t,v,b,d),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",s&&i&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(t,e={}){const r=await this.fetch(t,e);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(t,e={}){const r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=e,s=this.get(t,o);if(!i&&void 0!==s)return s;const a=r(t,s,{options:o,context:n});return this.set(t,a,o),a}get(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=e,s=this.#h.get(t);if(void 0!==s){const e=this.#p[s],a=this.#I(e);return o&&this.#F(o,s),this.#U(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==e.__staleWhileFetching&&(o.returnedStale=!0),r?e.__staleWhileFetching:void 0):(i||this.#R(t,"expire"),o&&r&&(o.returnedStale=!0),r?e:void 0)):(o&&(o.get="hit"),a?e.__staleWhileFetching:(this.#L(s),n&&this.#B(s),e))}o&&(o.get="miss")}#G(t,e){this.#y[e]=t,this.#d[t]=e}#L(t){t!==this.#m&&(t===this.#g?this.#g=this.#d[t]:this.#G(this.#y[t],this.#d[t]),this.#G(this.#m,t),this.#m=t)}delete(t){return this.#R(t,"delete")}#R(t,e){let r=!1;if(0!==this.#u){const n=this.#h.get(t);if(void 0!==n)if(r=!0,1===this.#u)this.#z(e);else{this.#P(n);const r=this.#p[n];if(this.#I(r)?r.__abortController.abort(new Error("deleted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(r,t,e),this.#O&&this.#v?.push([r,t,e])),this.#h.delete(t),this.#f[n]=void 0,this.#p[n]=void 0,n===this.#m)this.#m=this.#y[n];else if(n===this.#g)this.#g=this.#d[n];else{const t=this.#y[n];this.#d[t]=this.#d[n];const e=this.#d[n];this.#y[e]=this.#y[n]}this.#u--,this.#b.push(n)}}if(this.#O&&this.#v?.length){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return r}clear(){return this.#z("delete")}#z(t){for(const e of this.#N({allowStale:!0})){const r=this.#p[e];if(this.#I(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#f[e];this.#A&&this.#o?.(r,n,t),this.#O&&this.#v?.push([r,n,t])}}if(this.#h.clear(),this.#p.fill(void 0),this.#f.fill(void 0),this.#T&&this.#w&&(this.#T.fill(0),this.#w.fill(0)),this.#E&&this.#E.fill(0),this.#g=0,this.#m=0,this.#b.length=0,this.#l=0,this.#u=0,this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}class R{#W;#K;#q;constructor(t,e,r){this.#K=t.docExistsSpace,this.#q=r,this.#W=e}#H=(t,e={})=>{const r=t=>"string"==typeof t||"number"==typeof t?this.#q.GET(t,e.PIPELINE):t.FIELD||t.VALUE?this.#q.GET(t):t.AND?this.#q.AND(t.AND.map(r),e.PIPELINE):t.GET?this.#q.GET(t.GET,e.PIPELINE):t.NOT?this.#q.NOT(r(t.NOT.INCLUDE),r(t.NOT.EXCLUDE)):t.OR?this.#q.OR(t.OR.map(r),e.PIPELINE):t.ALL_DOCUMENTS?this.ALL_DOCUMENTS(t.ALL_DOCUMENTS):void 0;return r(t).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((t=>e.BUCKETS?this.#q.BUCKETS(...e.BUCKETS).then((e=>Object.assign(t,{BUCKETS:this.#q.AGGREGATION_FILTER(e,t.RESULT,!1)}))):t)).then((r=>e.FACETS?r.RESULT.length?t.ALL_DOCUMENTS?this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:t}))):this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:this.#q.AGGREGATION_FILTER(t,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>e.WEIGHT?Object.assign({RESULT:this.WEIGHT(t.RESULT,e.WEIGHT)},t):t)).then((t=>e.SCORE?this.SCORE(t.RESULT,e.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,e.SORT?{RESULT:this.SORT(t.RESULT,e.SORT)}:{}))).then((t=>{let r;return Object.assign(t,{RESULT:this.PAGE(t.RESULT,e.PAGE,(t=>{r=t}))},{PAGING:r})})).then((t=>e.DOCUMENTS?this.DOCUMENTS(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))};#Y=t=>this.DISTINCT(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"})))));#X=(...t)=>t.length?Promise.all(t.map((t=>this.#q.STORE.get([this.#K,t]).catch((t=>null))))):this.ALL_DOCUMENTS();#J=(t,e)=>this.#H({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e));ALL_DOCUMENTS=t=>this.#q.STORE.iterator({gte:[this.#K,null],lte:[this.#K,void 0],limit:t}).all().then((t=>t.map((([t,e])=>({_id:e._id,_doc:e})))));cachePipeline=(t,e,...r)=>{const n=JSON.stringify({funcLabel:e,params:r});return this.#W.has(n)?Promise.resolve(this.#W.get(n)):t(...r).then((t=>(this.#W.set(n,t),t)))};DICTIONARY=t=>this.cachePipeline(this.#Y,"#DICTIONARY",t);DISTINCT=(...t)=>this.#q.DISTINCT(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));DOCUMENTS=(...t)=>this.cachePipeline(this.#X,"#DOCUMENTS",...t);DOCUMENT_COUNT=()=>this.#q.STORE.get(["DOCUMENT_COUNT"]);DOCUMENT_VECTORS=(...t)=>Promise.all(t.map((t=>this.#q.STORE.get(["DOC",t]).catch((t=>null)))));FACETS=(...t)=>this.#q.FACETS(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));PAGE=(t,e={},r=()=>null)=>((e={NUMBER:0,SIZE:20,...e}).TOTAL=Math.ceil(t.length/e.SIZE),e.DOC_OFFSET=e.NUMBER*e.SIZE,r(e),t.slice(e.DOC_OFFSET,e.DOC_OFFSET+e.SIZE||void 0));QUERY=(t,e)=>this.cachePipeline(this.#H,"#parseJsonQuery",t,e);SCORE=(t,e={})=>{e=Object.assign({TYPE:"TFIDF"},e);const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD),n=t=>(t||[]).filter(r);return new Promise((i=>i("TFIDF"===e.TYPE?this.DOCUMENT_COUNT().then((e=>t.map(((t,n,i)=>{const o=Math.log((e+1)/i.length);return t._score=+(t._match||[]).filter(r).reduce(((t,e)=>t+o*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2)}))):"CONCAT"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.SCORE),"")}))):"SUM"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2)}))):"VALUE"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.VALUE),"")}))):null)))};SEARCH=(t,e)=>this.cachePipeline(this.#J,"#SEARCH",t,e);SORT=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION]));WEIGHT=(t,e)=>t.map((t=>(t._match=t._match.map((t=>(e.forEach((e=>{let r=!1;e.FIELD&&e.VALUE?e.FIELD===t.FIELD&&e.VALUE===t.VALUE&&(r=!0):e.FIELD?e.FIELD===t.FIELD&&(r=!0):e.VALUE&&e.VALUE===t.VALUE&&(r=!0),r&&(t.SCORE=(e.WEIGHT*+t.SCORE).toFixed(2))})),t))),t)))}var B=r(228);class F extends Error{constructor(t){super(t),this.name="TimeoutError"}}class P extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const j=t=>void 0===globalThis.DOMException?new P(t):new DOMException(t),M=t=>{const e=void 0===t.reason?j("This operation was aborted."):t.reason;return e instanceof Error?e:j(e)};class V{#Q=[];enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&this.#Q[this.size-1].priority>=e.priority)return void this.#Q.push(r);const n=function(t,e){let r=0,n=t.length;for(;n>0;){const o=Math.trunc(n/2);let s=r+o;i=t[s],e.priority-i.priority<=0?(r=++s,n-=o+1):n=o}var i;return r}(this.#Q,r);this.#Q.splice(n,0,r)}dequeue(){const t=this.#Q.shift();return t?.run}filter(t){return this.#Q.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this.#Q.length}}class $ extends B{#Z;#tt;#et=0;#rt;#nt;#it=0;#ot;#st;#Q;#at;#ct=0;#ut;#lt;#ht;timeout;constructor(t){if(super(),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:V,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#Z=t.carryoverConcurrencyCount,this.#tt=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this.#rt=t.intervalCap,this.#nt=t.interval,this.#Q=new t.queueClass,this.#at=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#ht=!0===t.throwOnTimeout,this.#lt=!1===t.autoStart}get#ft(){return this.#tt||this.#et{this.#yt()}),e)),!0;this.#et=this.#Z?this.#ct:0}return!1}#dt(){if(0===this.#Q.size)return this.#ot&&clearInterval(this.#ot),this.#ot=void 0,this.emit("empty"),0===this.#ct&&this.emit("idle"),!1;if(!this.#lt){const t=!this.#bt;if(this.#ft&&this.#pt){const e=this.#Q.dequeue();return!!e&&(this.emit("active"),e(),t&&this.#mt(),!0)}}return!1}#mt(){this.#tt||void 0!==this.#ot||(this.#ot=setInterval((()=>{this.#gt()}),this.#nt),this.#it=Date.now()+this.#nt)}#gt(){0===this.#et&&0===this.#ct&&this.#ot&&(clearInterval(this.#ot),this.#ot=void 0),this.#et=this.#Z?this.#ct:0,this.#vt()}#vt(){for(;this.#dt(););}get concurrency(){return this.#ut}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#ut=t,this.#vt()}async#Et(t){return new Promise(((e,r)=>{t.addEventListener("abort",(()=>{r(t.reason)}),{once:!0})}))}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:this.#ht,...e},new Promise(((r,n)=>{this.#Q.enqueue((async()=>{this.#ct++,this.#et++;try{e.signal?.throwIfAborted();let n=t({signal:e.signal});e.timeout&&(n=function(t,e){const{milliseconds:r,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e;let s;const a=new Promise(((a,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){const{signal:t}=e;t.aborted&&c(M(t)),t.addEventListener("abort",(()=>{c(M(t))}))}if(r===Number.POSITIVE_INFINITY)return void t.then(a,c);const u=new F;s=o.setTimeout.call(void 0,(()=>{if(n)try{a(n())}catch(t){c(t)}else"function"==typeof t.cancel&&t.cancel(),!1===i?a():i instanceof Error?c(i):(u.message=i??`Promise timed out after ${r} milliseconds`,c(u))}),r),(async()=>{try{a(await t)}catch(t){c(t)}})()})).finally((()=>{a.clear()}));return a.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},a}(Promise.resolve(n),{milliseconds:e.timeout})),e.signal&&(n=Promise.race([n,this.#Et(e.signal)]));const i=await n;r(i),this.emit("completed",i)}catch(t){if(t instanceof F&&!e.throwOnTimeout)return void r();n(t),this.emit("error",t)}finally{this.#d()}}),e),this.emit("add"),this.#dt()}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this.#lt?(this.#lt=!1,this.#vt(),this):this}pause(){this.#lt=!0}clear(){this.#Q=new this.#at}async onEmpty(){0!==this.#Q.size&&await this.#wt("empty")}async onSizeLessThan(t){this.#Q.sizethis.#Q.size{const n=()=>{e&&!e()||(this.off(t,n),r())};this.on(t,n)}))}get size(){return this.#Q.size}sizeBy(t){return this.#Q.filter(t).length}get pending(){return this.#ct}get isPaused(){return this.#lt}}class G{#W;#q;#Tt;#Q;constructor(t,e,r){this.#W=e,this.#q=r,this.#Tt=t,this.#Q=new $({concurrency:1}),this.#At(0)}#At=t=>this.#q.STORE.get(["DOCUMENT_COUNT"]).then((e=>this.#q.STORE.put(["DOCUMENT_COUNT"],+e+(+t||0)))).catch((t=>this.#q.STORE.put(["DOCUMENT_COUNT"],0)));#St=(t,e)=>{this.#W.clear();const r={...this.#Tt,...e};return((t,e)=>{const r=t=>"string"==typeof t||t instanceof String,n=(t,i)=>new Promise((async o=>{return null===t?o([null,"1.00"]):(s=t)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o([[],"1.00"]):Number.isInteger(t)?o([t,t]):r(t)?o(e.tokenizer(t,i,e)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(t)?o((a=t,new Promise((async t=>{const r={};for(const t in a)r[t]=await n(a[t],t,e);return t(r)})))):(t=>Array.isArray(t))(t)?o((c=t,Promise.all(c.map(n)))):o(t);var s,a,c}));return Promise.all(t.map((async t=>new Promise((async i=>{r(t)&&(t={body:t}),Object.prototype.hasOwnProperty.call(t,"_id")||(t._id=e.idGenerator.next().value);const o={};for(const e in t)o[e]="_id"!==e?await n(t[e],e):t[e];return i(o)})))))})(t,r).then((t=>this.#q.PUT(t,e))).then((e=>this.PUT_RAW(t,e.map((t=>t._id)),!r.storeRawDocs).then((()=>this.#At(e.filter((t=>"CREATED"===t.status)).length))).then((()=>e))))};#Ot=t=>this.#q.DELETE(t).then((e=>this.DELETE_RAW(...t).then((()=>this.#At(-e.filter((t=>"DELETED"===t.status)).length))).then((()=>this.#W.clear())).then((()=>e))));DELETE=(...t)=>this.#Ot(t);DELETE_RAW=(...t)=>Promise.all(t.map((t=>this.#q.STORE.del([this.#Tt.docExistsSpace,t]))));FLUSH=()=>this.#q.STORE.clear().then((()=>{this.#W.clear();const t=(new Date).toISOString();return this.#q.STORE.batch([{type:"put",key:["~CREATED"],value:t},{type:"put",key:["~LAST_UPDATED"],value:t},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0));IMPORT=t=>(this.#W.clear(),Promise.resolve(this.#q.IMPORT(t)));PUT=(t,e)=>this.#Q.add((()=>this.#St(t,e)));PUT_RAW=(t,e,r)=>Promise.all(t.map(((t,n)=>this.#q.STORE.put([this.#Tt.docExistsSpace,e[n]],r?{}:t)))).then((r=>(this.#W.clear(),t.map(((t,r)=>({_id:e[r],status:"OK",operation:"_PUT_RAW"}))))))}class z{constructor(t={}){var e;t={cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],name:"index",ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:f,...t},this.INDEX=new T({...t,isLeaf:t=>Array.isArray(t)&&2===t.length&&t.every((t=>"string"==typeof t||"number"==typeof t||null===t))}),this.EVENTS=this.INDEX.EVENTS,this._CACHE=new D({max:t.cacheLength}),this.r=new R(t,this._CACHE,this.INDEX),this.w=new G(t,this._CACHE,this.INDEX),e=this.INDEX,new Promise(((t,r)=>{const n=["CREATED_WITH"],i="search-index@5.0.0";return e.STORE.get(n).then((e=>i===e?t():r(new Error("This index was created with "+e+", you are running "+i)))).catch((r=>e.STORE.put(n,i).then(t)))}))}ALL_DOCUMENTS=t=>this.r.ALL_DOCUMENTS(t);BUCKETS=(...t)=>this.INDEX.BUCKETS(...t);CREATED=()=>this.INDEX.CREATED();DELETE=(...t)=>this.w.DELETE(...t);DELETE_RAW=(...t)=>this.w.DELETE_RAW(...t);DICTIONARY=t=>this.r.DICTIONARY(t);DISTINCT=(...t)=>this.r.DISTINCT(...t);DOCUMENTS=(...t)=>this.r.DOCUMENTS(...t);DOCUMENT_COUNT=()=>this.r.DOCUMENT_COUNT();DOCUMENT_VECTORS=(...t)=>this.r.DOCUMENT_VECTORS(...t);EXPORT=()=>this.INDEX.EXPORT();FACETS=(...t)=>this.r.FACETS(...t);FIELDS=()=>this.INDEX.FIELDS();FLUSH=()=>this.w.FLUSH();IMPORT=t=>this.INDEX.IMPORT(t);LAST_UPDATED=()=>this.INDEX.LAST_UPDATED();MAX=t=>this.INDEX.MAX(t);MIN=t=>this.INDEX.MIN(t);PUT=(t,e)=>this.w.PUT(t,e);PUT_RAW=(t,e,r)=>this.w.PUT_RAW(t,e,r);QUERY=(t,e)=>this.r.QUERY(t,e);SEARCH=(t,e)=>this.r.SEARCH(t,e);TOKENIZATION_PIPELINE_STAGES=h;_AND=(t,e)=>this.INDEX.AND(t,e);_BUCKET=t=>this.INDEX.BUCKET(t);_GET=(t,e)=>this.INDEX.GET(t,e);_NOT=(t,e)=>this.INDEX.NOT(t,e);_OR=(t,e)=>this.INDEX.OR(t,e);_PAGE=(t,e)=>this.r.PAGE(t,e);_SORT=(t,e)=>this.r.SORT(t,e)}class W{constructor({template:t=t=>`${t} hits`,elementId:e="count"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=this.template(t)}class K{constructor({template:t=t=>`

${JSON.stringify(t)}

`,elementId:e="hits"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=t.map((({_doc:t})=>this.template(t))).join("\n")}class q{constructor({pageLinkTemplate:t=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,navLinkTemplate:e=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,elementId:r="paging"},n){this.pageLinkTemplate=t,this.navLinkTemplate=e,this.el=document.getElementById(r),this.search=n,this.page={NUMBER:0,SIZE:10}}template=t=>{let e=0,r=t.TOTAL;return t.TOTAL>7&&(e=t.NUMBER>3?t.NUMBER-3:0,r=7+e),r>t.TOTAL&&(e=t.TOTAL-6-1,r=t.TOTAL),`\n
      \n ${this.navLinkTemplate("First",0,0===t.NUMBER)}\n ${this.navLinkTemplate("‹",t.NUMBER-1,0===t.NUMBER)}\n ${(()=>{let n="";for(let i=e;i=t.TOTAL-1)}\n ${this.navLinkTemplate("Last",t.TOTAL-1,t.NUMBER>=t.TOTAL-1)}\n
    `};update=t=>{if(console.log(t),t.TOTAL<=1)return void(this.el.innerHTML="");this.el.innerHTML=this.template(t);const e=document.getElementsByClassName("page-link");for(let t=0;t{console.log("AYO!"),console.log(this.search()),this.page.NUMBER=+t.target.attributes["data-page"].value,this.search()}))}}class H{constructor({elementId:t="",facetOptionTemplate:e=(t,e)=>`\n \n \n
    `,field:r=null,mode:n="OR",sort:i=(t,e)=>{t.VALUE.localeCompare(e.VALUE)},title:o="

    "+r.toUpperCase()+"

    "},s){this.activeFilters=[],this.el=document.getElementById(t),this.elementId=t,this.facetOptionTemplate=e,this.field=r,this.mode=n,this.search=s,this.sort=i,this.title=o}getActiveFilters=()=>this.activeFilters.length?[{[this.mode]:this.activeFilters}]:[];update=(t,e)=>{if("facet"===e&&"OR"===this.mode)return;const r=t.filter((t=>t.FIELD===this.field));this.el.innerHTML=r.length?this.title+r.sort(this.sort).reduce(((t,e)=>t+this.facetOptionTemplate(e,this.activeFilters.includes(e.FIELD+":"+e.VALUE))),""):"",this.activeFilters.forEach((t=>{if(!document.getElementById(t)){const[e,r]=t.split(":");this.el.innerHTML+=this.facetOptionTemplate({FIELD:e,VALUE:r,_id:[]},!0)}}));for(const t of document.querySelectorAll("#"+this.elementId+" > .filter-select"))t.addEventListener("input",(t=>{console.log(this.elementId),console.log(this.mode);const e=t.target.attributes["data-field"].value+":"+t.target.attributes["data-value"].value;t.target.checked?this.activeFilters.push(e):this.activeFilters=this.activeFilters.filter((t=>t!==e)),this.search("facet")}))}}class Y{constructor(t,e,r={}){this.autoCompleteFunction=r.autoCompleteFunction,this.currentFocus=-1,this.searchboxEl=t,this.search=e,this.limit=r.limit||20,this.threshold=r.threshold||2,this.autocompleteListId=t.id+"-autocomplete-list",this.suggestionsElementId=r.elementId,t.addEventListener("input",this.searchBoxInputListener),t.addEventListener("keydown",this.searchBoxKeydownListener),document.addEventListener("click",(t=>{this.closeAllLists(t.target)}))}closeAllLists=t=>{for(const e of document.getElementsByClassName("autocomplete-items"))t!==e&&t!==this.searchboxEl&&e.parentNode.removeChild(e)};searchBoxKeydownListener=t=>{let e=document.getElementById(this.autocompleteListId);e&&(e=e.getElementsByTagName("div")),40===t.keyCode?(this.currentFocus++,this.addActive(e)):38===t.keyCode?(this.currentFocus--,this.addActive(e)):13===t.keyCode||9===t.keyCode?(t.preventDefault(),this.currentFocus>-1?e&&e[this.currentFocus].click():this.closeAllLists()):27===t.keyCode&&this.closeAllLists()};searchBoxInputListener=async t=>{const e=(await this.autoCompleteFunction(t.target.value)).slice(0,this.limit);let r;const n=t.target.value;if(this.closeAllLists(),!n)return!1;if(n.length{r=document.createElement("DIV"),r.innerHTML=""+t.substr(0,n.length)+"",r.innerHTML+=t.substr(n.length),r.innerHTML+="",r.addEventListener("click",(t=>{this.searchboxEl.value=t.target.getElementsByTagName("input")[0].value,this.closeAllLists(),this.search()})),i.appendChild(r)}))};addActive=t=>{if(!t)return!1;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1),t[this.currentFocus].classList.add("autocomplete-active")};removeActive=t=>{for(let e=0;e{n.page.NUMBER=0,r("searchInput")})),this.autocomplete=new Y(this.el,r,e)}}class J{constructor({index:t=null,count:e={},hits:r={},facets:n=[],searchInput:i={},paging:o={},suggestions:s={}}){this.index=t,this.count=new W(e),this.paging=new q(o,this.search),this.hits=new K(r),this.searchInput=new X({...i,suggestions:{autoCompleteFunction:this.index.DICTIONARY,...i.suggestions}},this.search,this.paging),this.facets=n.map((t=>new H(t,this.search))),this.search()}queryOptions=()=>({FACETS:this.facets.map((t=>({FIELD:t.field}))),DOCUMENTS:!0,PAGE:this.paging.page});emptySearchQuery=()=>[{ALL_DOCUMENTS:!0},this.queryOptions()];searchQuery=()=>[[...this.searchInput.el.value.split(/\s+/).filter((t=>t)),...this.facets.map((t=>t.getActiveFilters())).flat(1/0)],this.queryOptions()];search=t=>(this.searchInput.el.value.length+this.facets.map((t=>t.getActiveFilters())).flat(1/0).length?this.index.SEARCH(...this.searchQuery()):this.index.QUERY(...this.emptySearchQuery())).then((e=>{this.hits.update(e.RESULT),this.count.update(e.RESULT_LENGTH),this.facets.forEach((r=>r.update(e.FACETS,t))),this.paging.update(e.PAGING)}))}class Q{constructor(t={}){return new z({Level:p.Z,...t})}}class Z{constructor(t={}){return new J(t)}}})(),SearchIndex=n})(); \ No newline at end of file +/*! For license information please see search-index-5.1.1.js.LICENSE.txt */ +var SearchIndex;(()=>{var t={796:(t,e,r)=>{"use strict";const{fromCallback:n}=r(8100),i=r(266),{getCallback:o,getOptions:s}=r(1343),a=Symbol("promise"),c=Symbol("status"),u=Symbol("operations"),l=Symbol("finishClose"),h=Symbol("closeCallbacks");e.AbstractChainedBatch=class{constructor(t){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));this[u]=[],this[h]=[],this[c]="open",this[l]=this[l].bind(this),this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get length(){return this[u].length}put(t,e,r){if("open"!==this[c])throw new i("Batch is not open: cannot call put() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const n=this.db._checkKey(t)||this.db._checkValue(e);if(n)throw n;const o=r&&null!=r.sublevel?r.sublevel:this.db,s=r,a=o.keyEncoding(r&&r.keyEncoding),l=o.valueEncoding(r&&r.valueEncoding),h=a.format;r={...r,keyEncoding:h,valueEncoding:l.format},o!==this.db&&(r.sublevel=null);const f=o.prefixKey(a.encode(t),h),p=l.encode(e);return this._put(f,p,r),this[u].push({...s,type:"put",key:t,value:e}),this}_put(t,e,r){}del(t,e){if("open"!==this[c])throw new i("Batch is not open: cannot call del() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const r=this.db._checkKey(t);if(r)throw r;const n=e&&null!=e.sublevel?e.sublevel:this.db,o=e,s=n.keyEncoding(e&&e.keyEncoding),a=s.format;return e={...e,keyEncoding:a},n!==this.db&&(e.sublevel=null),this._del(n.prefixKey(s.encode(t),a),e),this[u].push({...o,type:"del",key:t}),this}_del(t,e){}clear(){if("open"!==this[c])throw new i("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[u]=[],this}_clear(){}write(t,e){return e=o(t,e),e=n(e,a),t=s(t),"open"!==this[c]?this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):0===this.length?this.close(e):(this[c]="writing",this._write(t,(t=>{this[c]="closing",this[h].push((()=>e(t))),t||this.db.emit("batch",this[u]),this._close(this[l])}))),e[a]}_write(t,e){}close(t){return t=n(t,a),"closing"===this[c]?this[h].push(t):"closed"===this[c]?this.nextTick(t):(this[h].push(t),"writing"!==this[c]&&(this[c]="closing",this._close(this[l]))),t[a]}_close(t){this.nextTick(t)}[l](){this[c]="closed",this.db.detachResource(this);const t=this[h];this[h]=[];for(const e of t)e()}}},3527:(t,e,r)=>{"use strict";const{fromCallback:n}=r(8100),i=r(266),{getOptions:o,getCallback:s}=r(1343),a=Symbol("promise"),c=Symbol("callback"),u=Symbol("working"),l=Symbol("handleOne"),h=Symbol("handleMany"),f=Symbol("autoClose"),p=Symbol("finishWork"),d=Symbol("returnMany"),y=Symbol("closing"),g=Symbol("handleClose"),m=Symbol("closed"),b=Symbol("closeCallbacks"),v=Symbol("keyEncoding"),E=Symbol("valueEncoding"),w=Symbol("abortOnClose"),T=Symbol("legacy"),A=Symbol("keys"),S=Symbol("values"),O=Symbol("limit"),I=Symbol("count"),_=Object.freeze({}),L=()=>{};let x=!1;class N{constructor(t,e,r){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e)throw new TypeError("The second argument must be an options object");this[m]=!1,this[b]=[],this[u]=!1,this[y]=!1,this[f]=!1,this[c]=null,this[l]=this[l].bind(this),this[h]=this[h].bind(this),this[g]=this[g].bind(this),this[v]=e[v],this[E]=e[E],this[T]=r,this[O]=Number.isInteger(e.limit)&&e.limit>=0?e.limit:1/0,this[I]=0,this[w]=!!e.abortOnClose,this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get count(){return this[I]}get limit(){return this[O]}next(t){let e;if(void 0===t)e=new Promise(((e,r)=>{t=(t,n,i)=>{t?r(t):this[T]?void 0===n&&void 0===i?e():e([n,i]):e(n)}}));else if("function"!=typeof t)throw new TypeError("Callback must be a function");return this[y]?this.nextTick(t,new i("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(t,new i("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=t,this[I]>=this[O]?this.nextTick(this[l],null):this._next(this[l])),e}_next(t){this.nextTick(t)}nextv(t,e,r){return r=s(e,r),r=n(r,a),e=o(e,_),Number.isInteger(t)?(this[y]?this.nextTick(r,new i("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(r,new i("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(t<1&&(t=1),this[O]<1/0&&(t=Math.min(t,this[O]-this[I])),this[u]=!0,this[c]=r,t<=0?this.nextTick(this[h],null,[]):this._nextv(t,e,this[h])),r[a]):(this.nextTick(r,new TypeError("The first argument 'size' must be an integer")),r[a])}_nextv(t,e,r){const n=[],i=(e,o,s)=>e?r(e):(this[T]?void 0===o&&void 0===s:void 0===o)?r(null,n):(n.push(this[T]?[o,s]:o),void(n.length===t?r(null,n):this._next(i)));this._next(i)}all(t,e){return e=s(t,e),e=n(e,a),t=o(t,_),this[y]?this.nextTick(e,new i("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(e,new i("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=e,this[f]=!0,this[I]>=this[O]?this.nextTick(this[h],null,[]):this._all(t,this[h])),e[a]}_all(t,e){let r=this[I];const n=[],i=()=>{const t=this[O]<1/0?Math.min(1e3,this[O]-r):1e3;t<=0?this.nextTick(e,null,n):this._nextv(t,_,o)},o=(t,o)=>{t?e(t):0===o.length?e(null,n):(n.push.apply(n,o),r+=o.length,i())};i()}[p](){const t=this[c];return this[w]&&null===t?L:(this[u]=!1,this[c]=null,this[y]&&this._close(this[g]),t)}[d](t,e,r){this[f]?this.close(t.bind(null,e,r)):t(e,r)}seek(t,e){if(e=o(e,_),this[y]);else{if(this[u])throw new i("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{const r=this.db.keyEncoding(e.keyEncoding||this[v]),n=r.format;e.keyEncoding!==n&&(e={...e,keyEncoding:n});const i=this.db.prefixKey(r.encode(t),n);this._seek(i,e)}}}_seek(t,e){throw new i("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(t){return t=n(t,a),this[m]?this.nextTick(t):this[y]?this[b].push(t):(this[y]=!0,this[b].push(t),this[u]?this[w]&&this[p]()(new i("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[g])),t[a]}_close(t){this.nextTick(t)}[g](){this[m]=!0,this.db.detachResource(this);const t=this[b];this[b]=[];for(const e of t)e()}async*[Symbol.asyncIterator](){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this[m]||await this.close()}}}class U extends N{constructor(t,e){super(t,e,!0),this[A]=!1!==e.keys,this[S]=!1!==e.values}[l](t,e,r){const n=this[p]();if(t)return n(t);try{e=this[A]&&void 0!==e?this[v].decode(e):void 0,r=this[S]&&void 0!==r?this[E].decode(r):void 0}catch(t){return n(new C("entry",t))}void 0===e&&void 0===r||this[I]++,n(null,e,r)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(const t of e){const e=t[0],r=t[1];t[0]=this[A]&&void 0!==e?this[v].decode(e):void 0,t[1]=this[S]&&void 0!==r?this[E].decode(r):void 0}}catch(t){return this[d](r,new C("entries",t))}this[I]+=e.length,this[d](r,null,e)}end(t){return x||"undefined"==typeof console||(x=!0,console.warn(new i("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(t)}}class C extends i{constructor(t,e){super(`Iterator could not decode ${t}`,{code:"LEVEL_DECODE_ERROR",cause:e})}}for(const t of["_ended property","_nexting property","_end method"])Object.defineProperty(U.prototype,t.split(" ")[0],{get(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});U.keyEncoding=v,U.valueEncoding=E,e.AbstractIterator=U,e.AbstractKeyIterator=class extends N{constructor(t,e){super(t,e,!1)}[l](t,e){const r=this[p]();if(t)return r(t);try{e=void 0!==e?this[v].decode(e):void 0}catch(t){return r(new C("key",t))}void 0!==e&&this[I]++,r(null,e)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(let t=0;t{"use strict";const{supports:n}=r(5356),{Transcoder:i}=r(6035),{EventEmitter:o}=r(7007),{fromCallback:s}=r(8100),a=r(266),{AbstractIterator:c}=r(3527),{DefaultKeyIterator:u,DefaultValueIterator:l}=r(5682),{DeferredIterator:h,DeferredKeyIterator:f,DeferredValueIterator:p}=r(4416),{DefaultChainedBatch:d}=r(4669),{getCallback:y,getOptions:g}=r(1343),m=r(386),b=Symbol("promise"),v=Symbol("landed"),E=Symbol("resources"),w=Symbol("closeResources"),T=Symbol("operations"),A=Symbol("undefer"),S=Symbol("deferOpen"),O=Symbol("options"),I=Symbol("status"),_=Symbol("defaultOptions"),L=Symbol("transcoder"),x=Symbol("keyEncoding"),N=Symbol("valueEncoding"),U=()=>{};class C extends o{constructor(t,e){if(super(),"object"!=typeof t||null===t)throw new TypeError("The first argument 'manifest' must be an object");e=g(e);const{keyEncoding:r,valueEncoding:o,passive:s,...a}=e;this[E]=new Set,this[T]=[],this[S]=!0,this[O]=a,this[I]="opening",this.supports=n(t,{status:!0,promises:!0,clear:!0,getMany:!0,deferredOpen:!0,snapshots:!1!==t.snapshots,permanence:!1!==t.permanence,keyIterator:!0,valueIterator:!0,iteratorNextv:!0,iteratorAll:!0,encodings:t.encodings||{},events:Object.assign({},t.events,{opening:!0,open:!0,closing:!0,closed:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[L]=new i(R(this)),this[x]=this[L].encoding(r||"utf8"),this[N]=this[L].encoding(o||"utf8");for(const t of this[L].encodings())this.supports.encodings[t.commonName]||(this.supports.encodings[t.commonName]=!0);this[_]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[x].commonName,valueEncoding:this[N].commonName}),key:Object.freeze({keyEncoding:this[x].commonName})},this.nextTick((()=>{this[S]&&this.open({passive:!1},U)}))}get status(){return this[I]}keyEncoding(t){return this[L].encoding(null!=t?t:this[x])}valueEncoding(t){return this[L].encoding(null!=t?t:this[N])}open(t,e){e=y(t,e),e=s(e,b),(t={...this[O],...g(t)}).createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists;const r=t=>{"closing"===this[I]||"opening"===this[I]?this.once(v,t?()=>r(t):r):"open"!==this[I]?e(new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:t})):e()};return t.passive?"opening"===this[I]?this.once(v,r):this.nextTick(r):"closed"===this[I]||this[S]?(this[S]=!1,this[I]="opening",this.emit("opening"),this._open(t,(t=>{if(t)return this[I]="closed",this[w]((()=>{this.emit(v),r(t)})),void this[A]();this[I]="open",this[A](),this.emit(v),"open"===this[I]&&this.emit("open"),"open"===this[I]&&this.emit("ready"),r()}))):"open"===this[I]?this.nextTick(r):this.once(v,(()=>this.open(t,e))),e[b]}_open(t,e){this.nextTick(e)}close(t){t=s(t,b);const e=r=>{"opening"===this[I]||"closing"===this[I]?this.once(v,r?e(r):e):"closed"!==this[I]?t(new a("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:r})):t()};if("open"===this[I]){this[I]="closing",this.emit("closing");const t=t=>{this[I]="open",this[A](),this.emit(v),e(t)};this[w]((()=>{this._close((r=>{if(r)return t(r);this[I]="closed",this[A](),this.emit(v),"closed"===this[I]&&this.emit("closed"),e()}))}))}else"closed"===this[I]?this.nextTick(e):this.once(v,(()=>this.close(t)));return t[b]}[w](t){if(0===this[E].size)return this.nextTick(t);let e=this[E].size,r=!0;const n=()=>{0==--e&&(r?this.nextTick(t):t())};for(const t of this[E])t.close(n);r=!1,this[E].clear()}_close(t){this.nextTick(t)}get(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.get(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=this.valueEncoding(e.valueEncoding),c=i.format,u=o.format;return e.keyEncoding===c&&e.valueEncoding===u||(e=Object.assign({},e,{keyEncoding:c,valueEncoding:u})),this._get(this.prefixKey(i.encode(t),c),e,((t,e)=>{if(t)return("LEVEL_NOT_FOUND"===t.code||t.notFound||/NotFound/i.test(t))&&(t.code||(t.code="LEVEL_NOT_FOUND"),t.notFound||(t.notFound=!0),t.status||(t.status=404)),r(t);try{e=o.decode(e)}catch(t){return r(new a("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:t}))}r(null,e)})),r[b]}_get(t,e,r){this.nextTick(r,new Error("NotFound"))}getMany(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.getMany(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'keys' must be an array")),r[b];if(0===t.length)return this.nextTick(r,null,[]),r[b];const n=this.keyEncoding(e.keyEncoding),i=this.valueEncoding(e.valueEncoding),o=n.format,c=i.format;e.keyEncoding===o&&e.valueEncoding===c||(e=Object.assign({},e,{keyEncoding:o,valueEncoding:c}));const u=new Array(t.length);for(let e=0;e{if(t)return r(t);try{for(let t=0;tthis.put(t,e,r,n))),n[b];if(D(this,n))return n[b];const i=this._checkKey(t)||this._checkValue(e);if(i)return this.nextTick(n,i),n[b];const o=this.keyEncoding(r.keyEncoding),a=this.valueEncoding(r.valueEncoding),c=o.format,u=a.format;r.keyEncoding===c&&r.valueEncoding===u||(r=Object.assign({},r,{keyEncoding:c,valueEncoding:u}));const l=this.prefixKey(o.encode(t),c),h=a.encode(e);return this._put(l,h,r,(r=>{if(r)return n(r);this.emit("put",t,e),n()})),n[b]}_put(t,e,r,n){this.nextTick(n)}del(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].key),"opening"===this[I])return this.defer((()=>this.del(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=i.format;return e.keyEncoding!==o&&(e=Object.assign({},e,{keyEncoding:o})),this._del(this.prefixKey(i.encode(t),o),e,(e=>{if(e)return r(e);this.emit("del",t),r()})),r[b]}_del(t,e,r){this.nextTick(r)}batch(t,e,r){if(!arguments.length){if("opening"===this[I])return new d(this);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(r="function"==typeof t?t:y(e,r),r=s(r,b),e=g(e,this[_].empty),"opening"===this[I])return this.defer((()=>this.batch(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'operations' must be an array")),r[b];if(0===t.length)return this.nextTick(r),r[b];const n=new Array(t.length),{keyEncoding:i,valueEncoding:o,...c}=e;for(let e=0;e{if(e)return r(e);this.emit("batch",t),r()})),r[b]}_batch(t,e,r){this.nextTick(r)}sublevel(t,e){return this._sublevel(t,k.defaults(e))}_sublevel(t,e){return new k(this,t,e)}prefixKey(t,e){return t}clear(t,e){if(e=y(t,e),e=s(e,b),t=g(t,this[_].empty),"opening"===this[I])return this.defer((()=>this.clear(t,e))),e[b];if(D(this,e))return e[b];const r=t,n=this.keyEncoding(t.keyEncoding);return(t=m(t,n)).keyEncoding=n.format,0===t.limit?this.nextTick(e):this._clear(t,(t=>{if(t)return e(t);this.emit("clear",r),e()})),e[b]}_clear(t,e){this.nextTick(e)}iterator(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e)).keys=!1!==t.keys,t.values=!1!==t.values,t[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new h(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(t)}_iterator(t){return new c(this,t)}keys(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new f(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(t)}_keys(t){return new u(this,t)}values(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new p(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(t)}_values(t){return new l(this,t)}defer(t){if("function"!=typeof t)throw new TypeError("The first argument must be a function");this[T].push(t)}[A](){if(0===this[T].length)return;const t=this[T];this[T]=[];for(const e of t)e()}attachResource(t){if("object"!=typeof t||null===t||"function"!=typeof t.close)throw new TypeError("The first argument must be a resource object");this[E].add(t)}detachResource(t){this[E].delete(t)}_chainedBatch(){return new d(this)}_checkKey(t){if(null==t)return new a("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(t){if(null==t)return new a("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}}C.prototype.nextTick=r(28);const{AbstractSublevel:k}=r(9933)({AbstractLevel:C});e.AbstractLevel=C,e.AbstractSublevel=k;const D=function(t,e){return"open"!==t[I]&&(t.nextTick(e,new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0)},R=function(t){return Object.keys(t.supports.encodings).filter((e=>!!t.supports.encodings[e]))}},5e3:(t,e,r)=>{"use strict";e.AbstractLevel=r(1983).AbstractLevel,e.AbstractSublevel=r(1983).AbstractSublevel,e.AbstractIterator=r(3527).AbstractIterator,e.AbstractKeyIterator=r(3527).AbstractKeyIterator,e.AbstractValueIterator=r(3527).AbstractValueIterator,e.AbstractChainedBatch=r(796).AbstractChainedBatch},4716:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=Symbol("unfix"),a=Symbol("iterator"),c=Symbol("handleOne"),u=Symbol("handleMany"),l=Symbol("callback");class h extends n{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e,r){const n=this[l];if(t)return n(t);void 0!==e&&(e=this[s](e)),n(t,e,r)}[u](t,e){const r=this[l];if(t)return r(t);for(const t of e){const e=t[0];void 0!==e&&(t[0]=this[s](e))}r(t,e)}}class f extends i{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e){const r=this[l];if(t)return r(t);void 0!==e&&(e=this[s](e)),r(t,e)}[u](t,e){const r=this[l];if(t)return r(t);for(let t=0;t{"use strict";const n=r(266),{Buffer:i}=r(8287)||{},{AbstractSublevelIterator:o,AbstractSublevelKeyIterator:s,AbstractSublevelValueIterator:a}=r(4716),c=Symbol("prefix"),u=Symbol("upperBound"),l=Symbol("prefixRange"),h=Symbol("parent"),f=Symbol("unfix"),p=new TextEncoder,d={separator:"!"};t.exports=function({AbstractLevel:t}){class e extends t{static defaults(t){if("string"==typeof t)throw new n("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(t&&t.open)throw new n("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return null==t?d:t.separator?t:{...t,separator:"!"}}constructor(t,r,i){const{separator:o,manifest:s,...a}=e.defaults(i);r=v(r,o);const l=o.charCodeAt(0)+1,d=t[h]||t;if(!p.encode(r).every((t=>t>l&&t<127)))throw new n(`Prefix must use bytes > ${l} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(y(d,s),a);const g=(t.prefix||"")+o+r+o,E=g.slice(0,-1)+String.fromCharCode(l);this[h]=d,this[c]=new m(g),this[u]=new m(E),this[f]=new b,this.nextTick=d.nextTick}prefixKey(t,e){if("utf8"===e)return this[c].utf8+t;if(0===t.byteLength)return this[c][e];if("view"===e){const e=this[c].view,r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}{const e=this[c].buffer;return i.concat([e,t],e.byteLength+t.byteLength)}}[l](t,e){void 0!==t.gte?t.gte=this.prefixKey(t.gte,e):void 0!==t.gt?t.gt=this.prefixKey(t.gt,e):t.gte=this[c][e],void 0!==t.lte?t.lte=this.prefixKey(t.lte,e):void 0!==t.lt?t.lt=this.prefixKey(t.lt,e):t.lte=this[u][e]}get prefix(){return this[c].utf8}get db(){return this[h]}_open(t,e){this[h].open({passive:!0},e)}_put(t,e,r,n){this[h].put(t,e,r,n)}_get(t,e,r){this[h].get(t,e,r)}_getMany(t,e,r){this[h].getMany(t,e,r)}_del(t,e,r){this[h].del(t,e,r)}_batch(t,e,r){this[h].batch(t,e,r)}_clear(t,e){this[l](t,t.keyEncoding),this[h].clear(t,e)}_iterator(t){this[l](t,t.keyEncoding);const e=this[h].iterator(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new o(this,t,e,r)}_keys(t){this[l](t,t.keyEncoding);const e=this[h].keys(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new s(this,t,e,r)}_values(t){this[l](t,t.keyEncoding);const e=this[h].values(t);return new a(this,t,e)}}return{AbstractSublevel:e}};const y=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:g(t,"utf8"),buffer:g(t,"buffer"),view:g(t,"view")}}},g=function(t,e){return!!t.supports.encodings[e]&&t.keyEncoding(e).name===e};class m{constructor(t){this.utf8=t,this.view=p.encode(t),this.buffer=i?i.from(this.view.buffer,0,this.view.byteLength):{}}}class b{constructor(){this.cache=new Map}get(t,e){let r=this.cache.get(e);return void 0===r&&(r="view"===e?function(t,e){return e.subarray(t)}.bind(null,t):function(t,e){return e.slice(t)}.bind(null,t),this.cache.set(e,r)),r}}const v=function(t,e){let r=0,n=t.length;for(;rr&&t[n-1]===e;)n--;return t.slice(r,n)}},1343:(t,e)=>{"use strict";e.getCallback=function(t,e){return"function"==typeof t?t:e},e.getOptions=function(t,e){return"object"==typeof t&&null!==t?t:void 0!==e?e:{}}},4669:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(796),i=r(266),o=Symbol("encoded");e.DefaultChainedBatch=class extends n{constructor(t){super(t),this[o]=[]}_put(t,e,r){this[o].push({...r,type:"put",key:t,value:e})}_del(t,e){this[o].push({...e,type:"del",key:t})}_clear(){this[o]=[]}_write(t,e){"opening"===this.db.status?this.db.defer((()=>this._write(t,e))):"open"===this.db.status?0===this[o].length?this.nextTick(e):this.db._batch(this[o],t,e):this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}}},5682:(t,e,r)=>{"use strict";const{AbstractKeyIterator:n,AbstractValueIterator:i}=r(3527),o=Symbol("iterator"),s=Symbol("callback"),a=Symbol("handleOne"),c=Symbol("handleMany");class u extends n{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!0,values:!1}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}class l extends i{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!1,values:!0}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}for(const t of[u,l]){const e=t===u,r=e?t=>t[0]:t=>t[1];t.prototype._next=function(t){this[s]=t,this[o].next(this[a])},t.prototype[a]=function(t,r,n){const i=this[s];t?i(t):i(null,e?r:n)},t.prototype._nextv=function(t,e,r){this[s]=r,this[o].nextv(t,e,this[c])},t.prototype._all=function(t,e){this[s]=e,this[o].all(t,this[c])},t.prototype[c]=function(t,e){const n=this[s];t?n(t):n(null,e.map(r))},t.prototype._seek=function(t,e){this[o].seek(t,e)},t.prototype._close=function(t){this[o].close(t)}}e.DefaultKeyIterator=u,e.DefaultValueIterator=l},4416:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=r(266),a=Symbol("nut"),c=Symbol("undefer"),u=Symbol("factory");class l extends n{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.iterator(e),this.db.defer((()=>this[c]()))}}class h extends i{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.keys(e),this.db.defer((()=>this[c]()))}}class f extends o{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.values(e),this.db.defer((()=>this[c]()))}}for(const t of[l,h,f])t.prototype[c]=function(){"open"===this.db.status&&(this[a]=this[u]())},t.prototype._next=function(t){null!==this[a]?this[a].next(t):"opening"===this.db.status?this.db.defer((()=>this._next(t))):this.nextTick(t,new s("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(t,e,r){null!==this[a]?this[a].nextv(t,e,r):"opening"===this.db.status?this.db.defer((()=>this._nextv(t,e,r))):this.nextTick(r,new s("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(t,e){null!==this[a]?this[a].all(e):"opening"===this.db.status?this.db.defer((()=>this._all(t,e))):this.nextTick(e,new s("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(t,e){null!==this[a]?this[a]._seek(t,e):"opening"===this.db.status&&this.db.defer((()=>this._seek(t,e)))},t.prototype._close=function(t){null!==this[a]?this[a].close(t):"opening"===this.db.status?this.db.defer((()=>this._close(t))):this.nextTick(t)};e.DeferredIterator=l,e.DeferredKeyIterator=h,e.DeferredValueIterator=f},28:(t,e,r)=>{"use strict";const n=r(9596);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},386:(t,e,r)=>{"use strict";const n=r(266),i=Object.prototype.hasOwnProperty,o=new Set(["lt","lte","gt","gte"]);t.exports=function(t,e){const r={};for(const s in t)if(i.call(t,s)&&"keyEncoding"!==s&&"valueEncoding"!==s){if("start"===s||"end"===s)throw new n(`The legacy range option '${s}' has been removed`,{code:"LEVEL_LEGACY"});if("encoding"===s)throw new n("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead",{code:"LEVEL_LEGACY"});o.has(s)?r[s]=e.encode(t[s]):r[s]=t[s]}return r.reverse=!!r.reverse,r.limit=Number.isInteger(r.limit)&&r.limit>=0?r.limit:-1,r}},9511:(t,e,r)=>{"use strict";var n=r(8075)("ArrayBuffer.prototype.byteLength",!0),i=r(4670);t.exports=function(t){return i(t)?n?n(t):t.byteLength:NaN}},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),l=0,h=c>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9148:(t,e,r)=>{"use strict";const{AbstractLevel:n}=r(5e3),i=r(266),o=r(5372),{fromCallback:s}=r(8100),{Iterator:a}=r(6296),c=r(5222),u=r(3452),l=r(7766),h="level-js-",f=Symbol("idb"),p=Symbol("namePrefix"),d=Symbol("location"),y=Symbol("version"),g=Symbol("store"),m=Symbol("onComplete"),b=Symbol("promise");class v extends n{constructor(t,e,r){if("function"==typeof e||"function"==typeof r)throw new i("The levelup-style callback argument has been removed",{code:"LEVEL_LEGACY"});const{prefix:n,version:o,...s}=e||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},s),"string"!=typeof t)throw new Error("constructor requires a location string argument");this[d]=t,this[p]=null==n?h:n,this[y]=parseInt(o||1,10),this[f]=null}get location(){return this[d]}get namePrefix(){return this[p]}get version(){return this[y]}get db(){return this[f]}get type(){return"browser-level"}_open(t,e){const r=indexedDB.open(this[p]+this[d],this[y]);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this[f]=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this[d])||e.createObjectStore(this[d])}}[g](t){return this[f].transaction([this[d]],t).objectStore(this[d])}[m](t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}}_get(t,e,r){const n=this[g]("readonly");let o;try{o=n.get(t)}catch(t){return this.nextTick(r,t)}this[m](o,(function(t,e){return t?r(t):void 0===e?r(new i("Entry not found",{code:"LEVEL_NOT_FOUND"})):void r(null,c(e))}))}_getMany(t,e,r){const n=this[g]("readonly"),i=t.map((t=>e=>{let r;try{r=n.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:c(t))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(i,16,r)}_del(t,e,r){const n=this[g]("readwrite");let i;try{i=n.delete(t)}catch(t){return this.nextTick(r,t)}this[m](i,r)}_put(t,e,r,n){const i=this[g]("readwrite");let o;try{o=i.put(e,t)}catch(t){return this.nextTick(n,t)}this[m](o,n)}_iterator(t){return new a(this,this[d],t)}_batch(t,e,r){const n=this[g]("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let c;try{c="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return u(this,this[d],r,t,e);try{const t=this[g]("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this.nextTick(e,t)}this[m](n,e)}_close(t){this[f].close(),this.nextTick(t)}}v.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h),r=s(r,b);const n=indexedDB.deleteDatabase(e+t);return n.onsuccess=function(){r()},n.onerror=function(t){r(t)},r[b]},e.Z=v},6296:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(5e3),i=r(7766),o=r(5222),s=Symbol("cache"),a=Symbol("finished"),c=Symbol("options"),u=Symbol("currentOptions"),l=Symbol("position"),h=Symbol("location"),f=Symbol("first"),p={};function d(t){"function"==typeof t.commit&&t.commit()}e.Iterator=class extends n{constructor(t,e,r){super(t,r),this[s]=[],this[a]=0===this.limit,this[c]=r,this[u]={...r},this[l]=void 0,this[h]=e,this[f]=!0}_nextv(t,e,r){if(this[f]=!1,this[a])return this.nextTick(r,null,[]);if(this[s].length>0)return t=Math.min(t,this[s].length),this.nextTick(r,null,this[s].splice(0,t));let n;void 0!==this[l]&&(this[c].reverse?(this[u].lt=this[l],this[u].lte=void 0):(this[u].gt=this[l],this[u].gte=void 0));try{n=i(this[u])}catch(t){return this[a]=!0,this.nextTick(r,null,[])}const p=this.db.db.transaction([this[h]],"readonly"),y=p.objectStore(this[h]),g=[];if(this[c].reverse)y[!this[c].values&&y.openKeyCursor?"openKeyCursor":"openCursor"](n,"prev").onsuccess=e=>{const r=e.target.result;if(r){const{key:e,value:n}=r;this[l]=e,g.push([this[c].keys&&void 0!==e?o(e):void 0,this[c].values&&void 0!==n?o(n):void 0]),g.length{if(void 0===e||void 0===r)return;const n=Math.max(e.length,r.length);0===n||t===1/0?this[a]=!0:this[l]=e[n-1],g.length=n;for(let t=0;t{e=t.target.result,i()}:(e=[],this.nextTick(i)),this[c].values?y.getAll(n,t<1/0?t:void 0).onsuccess=t=>{r=t.target.result,i()}:(r=[],this.nextTick(i))}p.onabort=()=>{r(p.error||new Error("aborted by user")),r=null},p.oncomplete=()=>{r(null,g),r=null}}_next(t){if(this[s].length>0){const[e,r]=this[s].shift();this.nextTick(t,null,e,r)}else if(this[a])this.nextTick(t);else{let e=Math.min(100,this.limit-this.count);this[f]&&(this[f]=!1,e=1),this._nextv(e,p,((e,r)=>{if(e)return t(e);this[s]=r,this._next(t)}))}}_all(t,e){this[f]=!1;const r=this[s].splice(0,this[s].length),n=this.limit-this.count-r.length;if(n<=0)return this.nextTick(e,null,r);this._nextv(n,p,((t,n)=>{if(t)return e(t);r.length>0&&(n=r.concat(n)),e(null,n)}))}_seek(t,e){let r;this[f]=!0,this[s]=[],this[a]=!1,this[l]=void 0,this[u]={...this[c]};try{r=i(this[c])}catch(t){return void(this[a]=!0)}null===r||r.includes(t)?this[c].reverse?this[u].lte=t:this[u].gte=t:this[a]=!0}}},3452:t=>{"use strict";t.exports=function(t,e,r,n,i){if(0===n.limit)return t.nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const c=s.openKeyCursor?"openKeyCursor":"openCursor",u=n.reverse?"prev":"next";s[c](r,u).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const e=new TextEncoder;t.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):e.encode(t)}},7766:t=>{"use strict";t.exports=function(t){const e=void 0!==t.gte?t.gte:void 0!==t.gt?t.gt:void 0,r=void 0!==t.lte?t.lte:void 0!==t.lt?t.lt:void 0,n=void 0===t.gte,i=void 0===t.lte;return void 0!==e&&void 0!==r?IDBKeyRange.bound(e,r,n,i):void 0!==e?IDBKeyRange.lowerBound(e,n):void 0!==r?IDBKeyRange.upperBound(r,i):null}},8287:(t,e,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||X(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),a(t<0?0:0|d(t))}function f(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},8075:(t,e,r)=>{"use strict";var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},487:(t,e,r)=>{"use strict";var n=r(6743),i=r(453),o=r(6897),s=r(9675),a=i("%Function.prototype.apply%"),c=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||n.call(c,a),l=r(655),h=i("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new s("a function is required");var e=u(n,c,arguments);return o(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(n,a,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},8100:(t,e,r)=>{"use strict";var n=r(844);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},844:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},9743:(t,e)=>{function r(t){for(var e="",r=0;r0?"F"+s:"D"+r(s)},e.decode=function(t){if("DaN"===t)return NaN;if("FF"===t)return 1/0;if("DD"===t)return-1/0;var e="D"===t[0],n=(e?r(t):t).slice(2).split("M");return Number((e?"-":"")+n[1]+"e"+String(Number(n[0])-500))}},3381:(t,e)=>{var r={"?":"?@","!":"??",'"':"?%"},n={"?@":"?","??":"!","?%":'"'};e.factory=function(t){return{encode:e,decode:function(e){if("A"===e)return null;if("K!"===e)return[];for(var r,i=e.split('"'),o=[[]],s=0,a=i.length,c=0;c{var n=r(9743),i=r(3381);e.flip=function(t){var e=t.toString(),r="";for(var n in e)r+="."==e[n]?".":9-+e[n];return r},e.number=n,e.string={encode:function(t){return/\x00|\x01/.test(t)?"J"+t.replace(/\x01/g,"").replace(/\x00/g,""):"J"+t},decode:function(t){if("J"===t[0])return t.substring(1)}},e.encode=function(t){return e[typeof t].encode(t)},e.decode=function(t){if(""===t)return t;if(!o[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return o[t[0]](t)},e.object=i.factory(e),e.boolean={encode:function(t){return t?"C":"B"},decode:function(t){return"C"===t}},e.undefined={encode:function(t){return"L"},decode:function(){}};var o={A:e.object.decode,B:e.boolean.decode,C:e.boolean.decode,D:e.number.decode,F:e.number.decode,J:e.string.decode,K:e.object.decode,L:e.undefined.decode};e.buffer=!1,e.type="charwise"},41:(t,e,r)=>{"use strict";var n=r(655),i=r(8068),o=r(9675),s=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new o("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!s&&s(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8452:(t,e,r)=>{"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),c=r(592)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;c?a(t,e,r,!0):a(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";var n=r(453)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},1237:t=>{"use strict";t.exports=EvalError},9383:t=>{"use strict";t.exports=Error},9290:t=>{"use strict";t.exports=RangeError},9538:t=>{"use strict";t.exports=ReferenceError},8068:t=>{"use strict";t.exports=SyntaxError},9675:t=>{"use strict";t.exports=TypeError},5345:t=>{"use strict";t.exports=URIError},5388:(t,e,r)=>{"use strict";var n=r(9675);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},5437:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(162),o=r(9600),s=r(2120),a=r(3612);t.exports=function(t){if(i(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!o(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(i(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,l=d(c,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},2682:(t,e,r)=>{"use strict";var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(9353);t.exports=Function.prototype.bind||n},453:(t,e,r)=>{"use strict";var n,i=r(9383),o=r(1237),s=r(9290),a=r(9538),c=r(8068),u=r(9675),l=r(5345),h=Function,f=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(t){p=null}var d=function(){throw new u},y=p?function(){try{return d}catch(t){try{return p(arguments,"callee").get}catch(t){return d}}}():d,g=r(4039)(),m=r(24)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},E="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,w={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":y,"%TypedArray%":E,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var T=b(b(t));w["%Error.prototype%"]=T}var A=function t(e){var r;if("%AsyncFunction%"===e)r=f("async function () {}");else if("%GeneratorFunction%"===e)r=f("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=f("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return w[e]=r,r},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(6743),I=r(9957),_=O.call(Function.call,Array.prototype.concat),L=O.call(Function.apply,Array.prototype.splice),x=O.call(Function.call,String.prototype.replace),N=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,D=function(t,e){var r,n=t;if(I(S,n)&&(n="%"+(r=S[n])[0]+"%"),I(w,n)){var i=w[n];if(i===v&&(i=A(n)),void 0===i&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=N(t,0,1),r=N(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return x(t,C,(function(t,e,r,i){n[n.length]=r?x(i,k,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=D("%"+n+"%",e),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],L(r,_([0,1],l)));for(var h=1,f=!0;h=r.length){var m=p(s,d);s=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:s[d]}else f=I(s,d),s=s[d];f&&!a&&(w[o]=s)}}return s}},5795:(t,e,r)=>{"use strict";var n=r(453)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},592:(t,e,r)=>{"use strict";var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},24:t=>{"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof r)}},4039:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092:(t,e,r)=>{"use strict";var n=r(1333);t.exports=function(){return n()&&!!Symbol.toStringTag}},9957:(t,e,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);t.exports=o.call(n,i)},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*y}},4670:(t,e,r)=>{"use strict";var n=r(487),i=r(8075),o=r(453)("%ArrayBuffer%",!0),s=i("ArrayBuffer.prototype.byteLength",!0),a=i("Object.prototype.toString"),c=!!o&&!s&&new o(0).slice,u=!!c&&n(c);t.exports=s||u?function(t){if(!t||"object"!=typeof t)return!1;try{return s?s(t):u(t,0),!0}catch(t){return!1}}:o?function(t){return"[object ArrayBuffer]"===a(t)}:function(t){return!1}},9600:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(s(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},2120:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(9092)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},4035:(t,e,r)=>{"use strict";var n,i,o,s,a=r(8075),c=r(9092)();if(c){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var l=a("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{i(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7070:(t,e,r)=>{"use strict";var n=r(8075)("SharedArrayBuffer.prototype.byteLength",!0);t.exports=n?function(t){if(!t||"object"!=typeof t)return!1;try{return n(t),!0}catch(t){return!1}}:function(t){return!1}},3612:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(4039)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},5680:(t,e,r)=>{"use strict";var n=r(5767);t.exports=function(t){return!!n(t)}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},5356:(t,e)=>{"use strict";e.supports=function(...t){const e=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(e,{snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,getMany:e.getMany||!1,keyIterator:e.keyIterator||!1,valueIterator:e.valueIterator||!1,iteratorNextv:e.iteratorNextv||!1,iteratorAll:e.iteratorAll||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:Object.assign({},e.encodings),events:Object.assign({},e.events),additionalMethods:Object.assign({},e.additionalMethods)})}},6035:(t,e,r)=>{"use strict";const n=r(266),i=r(4341),{Encoding:o}=r(8110),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=Symbol("formats"),l=Symbol("encodings"),h=new Set(["buffer","view","utf8"]);e.Transcoder=class{constructor(t){if(!Array.isArray(t))throw new TypeError("The first argument 'formats' must be an array");if(!t.every((t=>h.has(t))))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'");this[l]=new Map,this[u]=new Set(t);for(const t in i)try{this.encoding(t)}catch(t){if("LEVEL_ENCODING_NOT_SUPPORTED"!==t.code)throw t}}encodings(){return Array.from(new Set(this[l].values()))}encoding(t){let e=this[l].get(t);if(void 0===e){if("string"==typeof t&&""!==t){if(e=p[t],!e)throw new n(`Encoding '${t}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if("object"!=typeof t||null===t)throw new TypeError("First argument 'encoding' must be a string or object");e=function(t){if(t instanceof o)return t;const e="type"in t&&"string"==typeof t.type?t.type:void 0,r=t.name||e||"anonymous-"+d++;switch(function(t){return"format"in t&&void 0!==t.format?t.format:"buffer"in t&&"boolean"==typeof t.buffer?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}(t)){case"view":return new a({...t,name:r});case"utf8":return new c({...t,name:r});case"buffer":return new s({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}(t)}const{name:r,format:i}=e;if(!this[u].has(i))if(this[u].has("view"))e=e.createViewTranscoder();else if(this[u].has("buffer"))e=e.createBufferTranscoder();else{if(!this[u].has("utf8"))throw new n(`Encoding '${r}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});e=e.createUTF8Transcoder()}for(const n of[t,r,e.name,e.commonName])this[l].set(n,e)}return e}};const f={binary:i.buffer,"utf-8":i.utf8},p={...i,...f};let d=0},8110:(t,e,r)=>{"use strict";const n=r(266),i=new Set(["buffer","view","utf8"]);e.Encoding=class{constructor(t){if(this.encode=t.encode||this.encode,this.decode=t.decode||this.decode,this.name=t.name||this.name,this.format=t.format||this.format,"function"!=typeof this.encode)throw new TypeError("The 'encode' property must be a function");if("function"!=typeof this.decode)throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),"string"!=typeof this.name||""===this.name)throw new TypeError("The 'name' property must be a string");if("string"!=typeof this.format||!i.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");t.createViewTranscoder&&(this.createViewTranscoder=t.createViewTranscoder),t.createBufferTranscoder&&(this.createBufferTranscoder=t.createBufferTranscoder),t.createUTF8Transcoder&&(this.createUTF8Transcoder=t.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}}},4341:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{Buffer:{isBuffer:()=>!1}},{textEncoder:i,textDecoder:o}=r(7200)(),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=t=>t;e.utf8=new c({encode:function(t){return n.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?o.decode(t):String(t)},decode:u,name:"utf8",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:function(t){return o.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}}),e.json=new c({encode:JSON.stringify,decode:JSON.parse,name:"json"}),e.buffer=new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:"buffer",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:n.from(String(t),"utf8")},decode:function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}}),e.view=new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:u,name:"view",createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:`${this.name}+buffer`})}}),e.hex=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"}),e.base64=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})},8343:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{},{Encoding:i}=r(8110),o=r(7200);class s extends i{constructor(t){super({...t,format:"buffer"})}createViewTranscoder(){return new a({encode:this.encode,decode:t=>this.decode(n.from(t.buffer,t.byteOffset,t.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}}class a extends i{constructor(t){super({...t,format:"view"})}createBufferTranscoder(){return new s({encode:t=>{const e=this.encode(t);return n.from(e.buffer,e.byteOffset,e.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}}e.BufferFormat=s,e.ViewFormat=a,e.UTF8Format=class extends i{constructor(t){super({...t,format:"utf8"})}createBufferTranscoder(){return new s({encode:t=>n.from(this.encode(t),"utf8"),decode:t=>this.decode(t.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){const{textEncoder:t,textDecoder:e}=o();return new a({encode:e=>t.encode(this.encode(e)),decode:t=>this.decode(e.decode(t)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}}},7200:t=>{"use strict";let e=null;t.exports=function(){return null===e&&(e={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),e}},266:t=>{"use strict";t.exports=class extends Error{constructor(t,e){super(t||""),"object"==typeof e&&null!==e&&(e.code&&(this.code=String(e.code)),e.expected&&(this.expected=!0),e.transient&&(this.transient=!0),e.cause&&(this.cause=e.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},8508:function(t,e){!function(t){"use strict";const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.ngraminator=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()},Object.defineProperty(t,"__esModule",{value:!0})}(e)},8859:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,E=String.prototype.toUpperCase,w=String.prototype.toLowerCase,T=RegExp.prototype.test,A=Array.prototype.concat,S=Array.prototype.join,O=Array.prototype.slice,I=Math.floor,_="function"==typeof BigInt?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,N="function"==typeof Symbol&&"object"==typeof Symbol.iterator,U="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||T.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-I(-t):I(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var R=r(2634),B=R.custom,F=$(B)?B:null;function P(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function j(t){return v.call(String(t),/"/g,""")}function M(t){return!("[object Array]"!==W(t)||U&&"object"==typeof t&&U in t)}function V(t){return!("[object RegExp]"!==W(t)||U&&"object"==typeof t&&U in t)}function $(t){if(N)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,i,a){var c=n||{};if(z(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!z(c,"customInspect")||c.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var T=String(e);return E?D(e,T):T}if("bigint"==typeof e){var I=String(e)+"n";return E?D(e,I):I}var L=void 0===c.depth?5:c.depth;if(void 0===i&&(i=0),i>=L&&L>0&&"object"==typeof e)return M(e)?"[Array]":"[Object]";var B,G=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=S.call(Array(t.indent+1)," ")}return{base:r,prev:S.call(Array(e+1),r)}}(c,i);if(void 0===a)a=[];else if(K(a,e)>=0)return"[Circular]";function H(e,r,n){if(r&&(a=O.call(a)).push(r),n){var o={depth:c.depth};return z(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),t(e,o,i+1,a)}return t(e,c,i+1,a)}if("function"==typeof e&&!V(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,H);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+S.call(et,", ")+" }":"")}if($(e)){var rt=N?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(e);return"object"!=typeof e||N?rt:Y(rt)}if((B=e)&&"object"==typeof B&&("undefined"!=typeof HTMLElement&&B instanceof HTMLElement||"string"==typeof B.nodeName&&"function"==typeof B.getAttribute)){for(var nt="<"+w.call(String(e.nodeName)),it=e.attributes||[],ot=0;ot"}if(M(e)){if(0===e.length)return"[]";var st=Z(e,H);return G&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+Q(st,G)+"]":"[ "+S.call(st,", ")+" ]"}if(function(t){return!("[object Error]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)){var at=Z(e,H);return"cause"in Error.prototype||!("cause"in e)||C.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+S.call(at,", ")+" }":"{ ["+String(e)+"] "+S.call(A.call("[cause]: "+H(e.cause),at),", ")+" }"}if("object"==typeof e&&y){if(F&&"function"==typeof e[F]&&R)return R(e,{depth:L-i});if("symbol"!==y&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return s&&s.call(e,(function(t,r){ct.push(H(r,e,!0)+" => "+H(t,e))})),J("Map",o.call(e),ct,G)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(H(t,e))})),J("Set",u.call(e),ut,G)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(Number(e)));if(function(t){if(!t||"object"!=typeof t||!_)return!1;try{return _.call(t),!0}catch(t){}return!1}(e))return Y(H(_.call(e)));if(function(t){return!("[object Boolean]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(d.call(e));if(function(t){return!("[object String]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)&&!V(e)){var lt=Z(e,H),ht=k?k(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!ht&&U&&Object(e)===e&&U in e?b.call(W(e),8,-1):ft?"Object":"",dt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+S.call(A.call([],pt||[],ft||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":G?dt+"{"+Q(lt,G)+"}":dt+"{ "+S.call(lt,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return G.call(t,e)}function W(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return P(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,H),"single",e)}function H(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+E.call(e.toString(16))}function Y(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):S.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+S.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=M(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(3474),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y0)for(var g=0;g{"use strict";var n=Array.prototype.slice,i=r(3474),o=Object.keys,s=o?function(t){return o(t)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},3474:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6578:t=>{"use strict";t.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},5372:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,c,u,l=!0;function h(t){function e(){r&&r(t,i),r=null}l?n(e):e()}function f(e,r,n){if(i[e]=n,r&&(c=!0),0==--s||r)h(r);else if(!c&&u{"use strict";var n=r(453)("%Array.prototype.concat%"),i=r(487),o=r(8075)("Array.prototype.slice"),s=r(1333)()&&Symbol.isConcatSpreadable,a=[],c=s?i.apply(n,a):null,u=s?r(4634):null;t.exports=s?function(t){for(var e=0;e{"use strict";var n=r(8075),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==o(t,e)}}},6897:(t,e,r)=>{"use strict";var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&s){var l=s(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},8206:(t,e,r)=>{"use strict";var n=r(5388),i=r(4810),o=r(8075)("String.prototype.replace"),s=/^\s$/.test("᠎"),a=s?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=s?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=i(n(this));return o(o(t,a,""),c,"")}},214:(t,e,r)=>{"use strict";var n=r(487),i=r(8452),o=r(5388),s=r(8206),a=r(4895),c=r(9377),u=n(a()),l=function(t){return o(t),u(t)};i(l,{getPolyfill:a,implementation:s,shim:c}),t.exports=l},4895:(t,e,r)=>{"use strict";var n=r(8206);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9377:(t,e,r)=>{"use strict";var n=r(8452),i=r(4895);t.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1093:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var o=i.slice(n,n+e);o.length===e&&(r=JSON.stringify(o),t[r]=t[r]||[],t[r].push(n))})),t)),{});return Object.keys(r).map((t=>({term:JSON.parse(t),positions:r[t]}))).sort(((t,e)=>t.term[0]>e.term[0]))}},6623:(t,e,r)=>{"use strict";var n=r(5767),i=r(3432),o=r(5795);function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function c(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r2?arguments[2]:y,l=s.includeSymbols?f:u,h=!!s.immutable;return function t(u){var f=h?d(u,s):u,y={},g=!0,m={node:f,node_:u,path:[].concat(r),parent:n[n.length-1],parents:n,key:r[r.length-1],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(g=!1)},delete:function(t){delete m.parent.node[m.key],t&&(g=!1)},remove:function(t){a(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(g=!1)},keys:null,before:function(t){y.before=t},after:function(t){y.after=t},pre:function(t){y.pre=t},post:function(t){y.post=t},stop:function(){i=!1},block:function(){g=!1}};if(!i)return m;function b(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=l(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t1?arguments[1]:y,this.value=t}function b(t){return new m(t,arguments.length>1?arguments[1]:y)}m.prototype.get=function(t){for(var e=this.value,r=0;e&&r{"use strict";var n=r(9675),i=r(8075)("TypedArray.prototype.buffer",!0),o=r(5680);t.exports=i||function(t){if(!o(t))throw new n("Not a Typed Array");return t.buffer}},2308:(t,e,r)=>{"use strict";var n=r(2682),i=r(487),o=r(9209)(),s={},a=r(24)(),c=r(5795),u=Object.defineProperty;if(c){var l=function(t){return t.byteOffset};n(o,(function(t){if("function"==typeof r.g[t]||"object"==typeof r.g[t]){var e=r.g[t].prototype,n=c(e,"byteOffset");if(!n&&a){var o=e.__proto__;n=c(o,"byteOffset")}if(n&&n.get)s[t]=i(n.get);else if(u){var h=new r.g[t](2);(n=c(h,"byteOffset"))&&n.configurable&&u(h,"length",{value:3}),2===h.length&&(s[t]=l)}}}))}var h=r(5680);t.exports=function(t){return!!h(t)&&function(t){var e;return n(s,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},6058:(t,e,r)=>{"use strict";var n=r(487),i=r(2682),o=r(5795),s=r(24)(),a=r(5680),c=r(6578),u={__proto__:null},l=Object.defineProperty;if(o){var h=function(t){return t.length};i(c,(function(t){var e=r.g[t];if("function"==typeof e||"object"==typeof e){var i=e.prototype,a=o(i,"length");if(!a&&s){var c=i.__proto__;a=o(c,"length")}if(a&&a.get)u["$"+t]=n(a.get);else if(l){var f=new r.g[t](2);(a=o(f,"length"))&&a.configurable&&l(f,"length",{value:3}),2===f.length&&(u["$"+t]=h)}}}))}t.exports=function(t){return!!a(t)&&function(t){var e;return i(u,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},8268:(t,e,r)=>{"use strict";var n=r(9675),i=r(280),o=r(2282),s=r(5910),a=r(4470),c=r(1752),u=r(2076),l=r(2138),h=r(7196),f=r(4810),p=r(4742),d=r(6419),y=r(7057),g=r(1509),m=r(4372),b=r(2308);t.exports=function(t,e){var r=this;g(r,"SEQ-CST");var v,E=r.length,w=h(t);v=w===-1/0?0:w<0?a(E+w,0):c(w,E);var T,A=void 0===e?E:h(e);T=A===-1/0?0:A<0?a(E+A,0):c(A,E);var S=a(T-v,0),O=y(r,[S]);if(S>0){if(s(m(r)))throw new n("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");if(d(r)===d(O))for(var I=m(r),_=m(O),L=p(r),x=v*L+b(r),N=b(O),U=N+S*L;N{"use strict";var n=r(8452),i=r(487),o=r(8268),s=r(2521),a=r(8599),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},2521:(t,e,r)=>{"use strict";var n=r(8268);t.exports=function(){return"function"==typeof Uint8Array&&Uint8Array.prototype.slice||n}},8599:(t,e,r)=>{"use strict";var n=r(8452),i=r(6763),o=r(2521);t.exports=function(){if("function"==typeof Uint8Array){var t=o(),e=i(Uint8Array.prototype);n(e,{slice:t},{slice:function(){return e.slice!==t}})}return t}},5767:(t,e,r)=>{"use strict";var n=r(2682),i=r(9209),o=r(487),s=r(8075),a=r(5795),c=s("Object.prototype.toString"),u=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),f=s("String.prototype.slice"),p=Object.getPrototypeOf,d=s("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(y,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(y,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},2634:()=>{},9209:(t,e,r)=>{"use strict";var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(9675),i=r(5910),o=r(4670),s=r(7070),a=r(9511);t.exports=function(t,e){var r=s(t);if(!o(t)&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(i(t))throw new n("Assertion failed: `arrayBuffer` must not be detached");return a(t)}},9969:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9290),o=r(9675),s=n&&n(0);t.exports=function(t,e){if("bigint"!=typeof t||"bigint"!=typeof e)throw new o("Assertion failed: `n` and `d` arguments must be BigInts");if(e===s)throw new i("Division by zero");return t===s?s:t%e}},893:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(4769),s=r(7030),a=r(8131),c=r(3400),u=r(2875),l=r(259),h=r(7730);t.exports=function(t,e,r){if("Object"!==h(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var f=i(r)?r:l(r);if(!i(f))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(a,u,s,t,e,f)}},7030:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(2997);t.exports=function(t){if(void 0!==t&&!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return o(t)}},280:(t,e,r)=>{"use strict";var n=r(9675),i=r(8859),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!o(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+i(e));return t[e]}},2282:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(8075)("Array.prototype.slice"),c=r(1087),u=r(5910),l=r(6167),h=r(4670),f=r(7070),p=r(4399),d=r(4097),y=r(5100);t.exports=function(t,e,r,n,g){var m=f(t);if(!h(t)&&!m)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!c(e))throw new o("Assertion failed: `byteIndex` must be an integer");if("string"!=typeof r||"number"!=typeof d.size["$"+r])throw new o("Assertion failed: `type` must be a Typed Array element type");if("boolean"!=typeof n)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==g&&"UNORDERED"!==g)throw new o("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&"boolean"!=typeof arguments[5])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: `arrayBuffer` is detached");if(e<0)throw new o("Assertion failed: `byteIndex` must be non-negative");var b,v=d.size["$"+r];if(!v)throw new o('Assertion failed: `type` must be one of "INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"');if(m)throw new i("SharedArrayBuffer is not supported by this implementation");b=a(new s(t,e),0,v);var E=arguments.length>5?arguments[5]:"little"===y,w=E?a(p([0,0,0,0,0,0,0,0],b),-v):a(p(b,[0,0,0,0,0,0,0,0]),0,v);return l(r,w,E)}},2491:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");return i(t,e)}},533:(t,e,r)=>{"use strict";t.exports=r(1412)},7881:t=>{"use strict";t.exports=function(t){return"BIGUINT64"===t||"BIGINT64"===t}},6966:(t,e,r)=>{"use strict";t.exports=r(9600)},4528:(t,e,r)=>{"use strict";var n=r(1376)("%Reflect.construct%",!0),i=r(893);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},8131:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(5701);t.exports=function(t){if(void 0===t)return!1;if(!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!i(t,"[[Value]]")&&!i(t,"[[Writable]]"))}},5910:(t,e,r)=>{"use strict";var n=r(9675),i=r(9511),o=r(9209)(),s=r(8075),a=r(4670),c=r(7070),u=s("SharedArrayBuffer.prototype.byteLength",!0);t.exports=function(t){var e=c(t);if(!a(t)&&!e)throw new n("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if(0===(e?u:i)(t))try{new r.g[o[0]](t)}catch(t){return!!t&&"TypeError"===t.name}return!1}},6575:(t,e,r)=>{"use strict";var n=r(9675),i=r(8075),o=i("%ArrayBuffer.prototype.resizable%",!0),s=i("%SharedArrayBuffer.prototype.growable%",!0),a=r(4670),c=r(7070);t.exports=function(t){var e=a(t),r=c(t);if(!e&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return e&&o?!o(t):!r||!s||!s(t)}},3400:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},5291:(t,e,r)=>{"use strict";var n=r(9675),i=r(5910),o=r(4742),s=r(9346),a=r(4372),c=r(2308),u=r(6058);t.exports=function(t){if(!s(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var e=t["[[Object]]"],r=t["[[CachedBufferByteLength]]"];if(i(a(e))&&"DETACHED"!==r)throw new n("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if("DETACHED"===r)return!0;var l,h=c(e),f=u(e);return l="AUTO"===f?r:h+f*o(e),h>r||l>r}},9373:t=>{"use strict";t.exports=function(t){return"UINT8"===t||"UINT8C"===t||"UINT16"===t||"UINT32"===t||"BIGUINT64"===t}},6681:(t,e,r)=>{"use strict";var n=r(9675),i=r(7149),o=r(5910),s=r(5680),a=r(4372);t.exports=function(t,e){if(!s(t))throw new n("Assertion failed: `obj` must be a Typed Array");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var r=a(t);return{"[[Object]]":t,"[[CachedBufferByteLength]]":o(r)?"DETACHED":i(r,e)}}},5015:(t,e,r)=>{"use strict";var n=r(9675),i=r(2491),o=r(3446),s=r(9887),a=r(3557),c=r(2475),u=r(7088),l=r(172),h=r(4770),f=r(6039),p=r(9308),d=r(2779),y=r(8894),g=r(4751),m=r(1189),b={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8},v={__proto__:null,INT8:u,UINT8:f,UINT8C:p,INT16:a,UINT16:l,INT32:c,UINT32:h,BIGINT64:o,BIGUINT64:s};t.exports=function(t,e,r){if("string"!=typeof t||!i(b,t))throw new n("Assertion failed: `type` must be a TypedArray element type: "+m(b));if("number"!=typeof e&&"bigint"!=typeof e)throw new n("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof r)throw new n("Assertion failed: `isLittleEndian` must be a Boolean");if("FLOAT32"===t)return d(e,r);if("FLOAT64"===t)return y(e,r);var o=b[t],s=(0,v[t])(e);return g(s,o,r)}},6167:(t,e,r)=>{"use strict";var n=r(453),i=r(8075),o=r(9290),s=r(8068),a=r(9675),c=n("%BigInt%",!0),u=r(2491),l=r(533),h=r(7881),f=r(9373),p=r(4915),d=r(8968),y=r(6570),g=r(4138),m=r(2158),b=i("Array.prototype.reverse"),v=i("Array.prototype.slice"),E=r(1189),w={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8};t.exports=function(t,e,r){if(!u(w,t))throw new a("Assertion failed: `type` must be a TypedArray element type: "+E(w));if(!l(e)||!g(e,m))throw new a("Assertion failed: `rawBytes` must be an Array of bytes");if("boolean"!=typeof r)throw new a("Assertion failed: `isLittleEndian` must be a Boolean");var n=w[t];if(e.length!==n)throw new o("Assertion failed: `rawBytes` must have a length of "+n+" for type "+t);var i=h(t);if(i&&!c)throw new s("this environment does not support BigInts");return e=v(e,0,n),r||b(e),"FLOAT32"===t?p(e):"FLOAT64"===t?d(e):y(e,n,f(t),i)}},2875:(t,e,r)=>{"use strict";var n=r(8756);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},2076:(t,e,r)=>{"use strict";var n=r(9675),i=r(3400),o=r(2875),s=r(7730),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof c)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},2138:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(1087),c=r(7881),u=r(5910),l=r(5015),h=r(4670),f=r(7070),p=r(9957),d=r(4097),y=r(5100),g=r(3795);t.exports=function(t,e,r,n,m,b){var v=f(t);if(!h(t)&&!v)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!a(e)||e<0)throw new o("Assertion failed: `byteIndex` must be a non-negative integer");if("string"!=typeof r||!p(d.size,"$"+r))throw new o("Assertion failed: `type` must be a Typed Array Element Type");if("number"!=typeof n&&"bigint"!=typeof n)throw new o("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof m)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==b&&"UNORDERED"!==b&&"INIT"!==b)throw new o('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: ArrayBuffer is detached");if(c(r)?"bigint"!=typeof n:"number"!=typeof n)throw new o("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var E=d.size["$"+r],w=l(r,n,arguments.length>6?arguments[6]:"little"===y);if(v)throw new i("SharedArrayBuffer is not supported by this implementation");var T=new s(t,e,E);g(w,(function(t,e){T[e]=t}))}},7732:(t,e,r)=>{"use strict";var n=r(453)("%Symbol.species%",!0),i=r(9675),o=r(4528),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var a=n?r[n]:void 0;if(null==a)return e;if(o(a))return a;throw new i("no constructor found")}},9693:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9675),o=r(8068);t.exports=function(t){if("string"!=typeof t)throw new i("`argument` must be a string");if(!n)throw new o("BigInts are not supported in this environment");try{return n(t)}catch(t){return}}},8679:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%RegExp%"),s=r(9675),a=n("%parseInt%"),c=r(8075),u=r(9721),l=c("String.prototype.slice"),h=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),y=r(214);t.exports=function t(e){if("string"!=typeof e)throw new s("Assertion failed: `argument` is not a String");if(h(e))return i(a(l(e,2),2));if(f(e))return i(a(l(e,2),8));if(d(e)||p(e))return NaN;var r=y(e);return r!==e?t(r):i(e)}},2964:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Number%"),s=r(9675),a=r(8068),c=r(9693),u=r(866);t.exports=function(t){if(!i)throw new a("BigInts are not supported in this environment");var e=u(t,o);if(null==e)throw new s("Cannot convert null or undefined to a BigInt");if("boolean"==typeof e)return i(e?1:0);if("number"==typeof e)throw new s("Cannot convert a Number value to a BigInt");if("string"==typeof e){var r=c(e);if(void 0===r)throw new s("Failed to parse String to BigInt");return r}if("symbol"==typeof e)throw new s("Cannot convert a Symbol value to a BigInt");if("bigint"!=typeof e)throw new a("Assertion failed: unknown primitive type");return e}},3446:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,31)),l=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t),r=c(a,e,l);return r>=u?r-l:r}},9887:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t);return c(a,e,u)}},4323:t=>{"use strict";t.exports=function(t){return!!t}},3557:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return a>=32768?a-65536:a}},2475:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046),a=4294967296;t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),c=n(r,a),u=c>=2147483648?c-a:c;return 0===u?0:u}},7088:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,256);return a>=128?a-256:a}},7196:(t,e,r)=>{"use strict";var n=r(8410),i=r(3384),o=r(8756),s=r(5046);t.exports=function(t){var e=n(t);return o(e)||0===e?0:s(e)?i(e):e}},8410:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Number%"),s=r(6600),a=r(866),c=r(8679);t.exports=function(t){var e=s(t)?t:a(t,o);if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):o(e)}},866:(t,e,r)=>{"use strict";var n=r(5437);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},259:(t,e,r)=>{"use strict";var n=r(9957),i=r(9675),o=r(7730),s=r(4323),a=r(6966);t.exports=function(t){if("Object"!==o(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!a(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},4810:(t,e,r)=>{"use strict";var n=r(453)("%String%"),i=r(9675);t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return n(t)}},172:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return 0===a?0:a}},4770:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,4294967296);return 0===a?0:a}},6039:(t,e,r)=>{"use strict";var n=r(5046),i=r(4224),o=r(8410),s=r(3384);t.exports=function(t){var e=o(t);if(!n(e)||0===e)return 0;var r=s(e);return i(r,256)}},9308:(t,e,r)=>{"use strict";var n=r(9719),i=r(8410),o=r(5986),s=r(8756);t.exports=function(t){var e=i(t);if(s(e))return 0;var r=n(e,0,255),a=o(r);return ra+.5?a+1:a%2==0?a:a+1}},7730:(t,e,r)=>{"use strict";var n=r(2439);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},9531:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(533),s=r(4528),a=r(5291),c=r(9271),u=r(1509),l=r(9209)();t.exports=function(t,e){if(!s(t))throw new i("Assertion failed: `constructor` must be a constructor");if(!o(e))throw new i("Assertion failed: `argumentList` must be a List");if(0===l.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r;r=0===e.length?new t:1===e.length?new t(e[0]):2===e.length?new t(e[0],e[1]):new t(e[0],e[1],e[2]);var h=u(r,"SEQ-CST");if(1===e.length&&"number"==typeof e[0]){if(a(h))throw new i("new Typed Array is out of bounds");if(c(h){"use strict";var n=r(8068),i=r(9675),o=r(1087),s=r(5767),a=r(4097);t.exports=function(t){var e=s(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=a.size["$"+a.name["$"+e]];if(!o(r)||r<0)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},6419:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(4097);t.exports=function(t){var e=o(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=s.name["$"+e];if("string"!=typeof r)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},9271:(t,e,r)=>{"use strict";var n=r(9675),i=r(5986),o=r(6575),s=r(5291),a=r(4742),c=r(9346),u=r(4372),l=r(2308),h=r(6058);t.exports=function(t){if(!c(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(s(t))throw new n("Assertion failed: `taRecord` is out of bounds");var e=t["[[Object]]"],r=h(e);if("AUTO"!==r)return r;if(o(u(e)))throw new n("Assertion failed: array buffer is not fixed length");var f=l(e),p=a(e),d=t["[[CachedBufferByteLength]]"];if("DETACHED"===d)throw new n("Assertion failed: typed array is detached");return i((d-f)/p)}},7057:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(9209)(),a=r(533),c=r(7732),u=r(9531),l=r(2697);t.exports=function(t,e){if(0===s.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r=o(t);if(!r)throw new i("Assertion failed: exemplar must be a TypedArray");if(!a(e))throw new i("Assertion failed: `argumentList` must be a List");var h=l(r);if("function"!=typeof h)throw new n("Assertion failed: `constructor` of `exemplar` ("+r+") must exist. Please report this!");var f=c(t,h);return u(f,e)}},1509:(t,e,r)=>{"use strict";var n=r(9675),i=r(5291),o=r(6681),s=r(7730),a=r(5680);t.exports=function(t,e){if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!a(t))throw new n("Assertion failed: `O` must be a Typed Array");var r=o(t,e);if(i(r))throw new n("`O` must be in-bounds and backed by a non-detached buffer");return r}},9719:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Math.max%"),s=n("%Math.min%");t.exports=function(t,e,r){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof r||!(e<=r))throw new i("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return s(o(e,t),r)}},5986:t=>{"use strict";var e=Math.floor;t.exports=function(t){return"bigint"==typeof t?t:e(t)}},4470:(t,e,r)=>{"use strict";var n=r(453);t.exports=n("%Math.max%")},1752:(t,e,r)=>{"use strict";var n=r(453);t.exports=n("%Math.min%")},4224:(t,e,r)=>{"use strict";var n=r(113);t.exports=function(t,e){return n(t,e)}},4097:t=>{"use strict";t.exports={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8}}},3384:(t,e,r)=>{"use strict";var n=r(5986),i=r(9675);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2439:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},1376:(t,e,r)=>{"use strict";t.exports=r(453)},4769:(t,e,r)=>{"use strict";var n=r(592),i=r(655),o=n.hasArrayLengthDefineBug(),s=o&&r(1412),a=r(8075)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,c,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(c in n&&a(n,c)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[c]=l,e(n[c],l)}return o&&"length"===c&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,c,r(u)),!0)}},1412:(t,e,r)=>{"use strict";var n=r(453)("%Array%"),i=!n.isArray&&r(8075)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4915:(t,e,r)=>{"use strict";var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[3]?-1:1,r=(127&t[3])<<1|t[2]>>7,i=(127&t[2])<<16|t[1]<<8|t[0];return 0===r&&0===i?1===e?0:-0:255===r&&0===i?1===e?1/0:-1/0:255===r&&0!==i?NaN:-127==(r-=127)?e*i*n(2,-149):e*(1+i*n(2,-23))*n(2,r)}},8968:(t,e,r)=>{"use strict";var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[7]?-1:1,r=(127&t[7])<<4|(240&t[6])>>4,i=281474976710656*(15&t[6])+1099511627776*t[5]+4294967296*t[4]+16777216*t[3]+65536*t[2]+256*t[1]+t[0];return 0===r&&0===i?0*e:2047===r&&0!==i?NaN:2047===r&&0===i?e*(1/0):-1023==(r-=1023)?e*i*5e-324:e*(1+i/4503599627370496)*n(2,r)}},6570:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.pow%"),o=n("%Number%"),s=n("%BigInt%",!0);t.exports=function(t,e,r,n){for(var a=n?s:o,c=a(0),u=0;u{"use strict";var n=r(453),i=n("%Uint8Array%",!0),o=n("%Uint32Array%",!0),s=r(4372),a=o&&new o([305419896]),c=a&&new i(s(a));t.exports=c?120===c[0]?"little":18===c[0]?"big":52===c[0]?"mixed":"unknown":"indeterminate"},4138:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";var e=1075;t.exports=function(t){var r="";if(0===t)return r;for(var n,i=e,o=0;o=1?(t=n-1,r+="1",i===e&&(i=o)):(t=n,r+="0"),1===n||o-i>54)return r;return r}},2997:t=>{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},6763:(t,e,r)=>{"use strict";var n=r(453)("%Object.getPrototypeOf%",!0),i=r(24)();t.exports=n||(i?function(t){return t.__proto__}:null)},8213:(t,e,r)=>{"use strict";var n=r(453)("%Math.floor%");t.exports=function(t){for(var e,r="";t>0;)r=(e=t/2)===(t=n(e))?"0"+r:"1"+r;return r}},4751:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%BigInt%",!0);t.exports=function(t,e,r){var n="bigint"==typeof t?o:i;t<0&&(t>>>=0);for(var s=[],a=0;a>=n(8);return s}},2158:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=0&&t<=255&&(0|t)===t}},5046:(t,e,r)=>{"use strict";var n=r(8756);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1087:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=r(8756),a=r(5046);t.exports=function(t){if("number"!=typeof t||s(t)||!a(t))return!1;var e=i(t);return o(e)===e}},8756:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},3508:t=>{"use strict";t.exports=function(t){return 0===t&&1/t==-1/0}},6600:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},113:t=>{"use strict";var e=Math.floor;t.exports=function(t,r){var n=t%r;return e(n>=0?n:n+r)}},122:t=>{"use strict";t.exports=function(t,e,r){var n=t(e,r);return n>=0?n:n+r}},5701:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(i(t,e)&&!o[e])return!1;var r=i(t,"[[Value]]")||i(t,"[[Writable]]"),s=i(t,"[[Get]]")||i(t,"[[Set]]");if(r&&s)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}},9346:(t,e,r)=>{"use strict";var n=r(9957),i=r(5680),o=r(1087);t.exports=function(t){return!!t&&"object"==typeof t&&n(t,"[[Object]]")&&n(t,"[[CachedBufferByteLength]]")&&(o(t["[[CachedBufferByteLength]]"])&&t["[[CachedBufferByteLength]]"]>=0||"DETACHED"===t["[[CachedBufferByteLength]]"])&&i(t["[[Object]]"])}},2697:(t,e,r)=>{"use strict";var n=r(453),i={__proto__:null,$Int8Array:n("%Int8Array%",!0),$Uint8Array:n("%Uint8Array%",!0),$Uint8ClampedArray:n("%Uint8ClampedArray%",!0),$Int16Array:n("%Int16Array%",!0),$Uint16Array:n("%Uint16Array%",!0),$Int32Array:n("%Int32Array%",!0),$Uint32Array:n("%Uint32Array%",!0),$BigInt64Array:n("%BigInt64Array%",!0),$BigUint64Array:n("%BigUint64Array%",!0),$Float32Array:n("%Float32Array%",!0),$Float64Array:n("%Float64Array%",!0)};t.exports=function(t){return i["$"+t]}},2779:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=n("%Math.pow%"),a=r(5046),c=r(8756),u=r(3508);t.exports=function(t,e){if(c(t))return e?[0,0,192,127]:[127,192,0,0];var r;if(0===t)return r=u(t)?128:0,e?[0,0,0,r]:[r,0,0,0];if(i(t)>34028234663852886e22||!a(t))return r=t<0?255:127,e?[0,0,128,r]:[r,128,0,0];var n=t<0?1:0;t=i(t);for(var l=0;t>=2;)l+=1,t/=2;for(;t<1;)l-=1,t*=2;var h=t-1;h*=s(2,23)+.5,l+=127;var f=n<<31|(l<<=23)|(h=o(h)),p=255&f,d=255&(f>>=8),y=255&(f>>=8),g=255&(f>>=8);return e?[p,d,y,g]:[g,y,d,p]}},8894:(t,e,r)=>{"use strict";var n=r(453),i=n("%parseInt%"),o=n("%Math.abs%"),s=n("%Math.floor%"),a=r(8075),c=a("String.prototype.indexOf"),u=a("String.prototype.slice"),l=r(9154),h=r(8213),f=r(3508),p="11111111111",d="00000000000",y=d+d+d+d+"0000000";t.exports=function(t,e){var r,n,a=t<0||f(t)?"1":"0";if(isNaN(t))r=p,n="1"+y;else if(isFinite(t))if(0===t)r=d,n="0"+y;else{t=o(t);var g,m=s(t),b=h(m),v=l(t-m);if(b)r=b.length-1;else{var E=c(v,"1");E>-1&&(g=E+1),r=-g}n=b+v,r<0?(r<=-1023&&(g=1022),n=u(n,g)):n=u(n,1),r=u(d+h(r+1023),-11),n=u(n+y+"0",0,52)}else r=p,n="0"+y;for(var w=a+r+n,T=[],A=0;A<8;A++)T[e?8-A-1:A]=i(u(w,8*A,8*(A+1)),2);return T}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{SearchIndex:()=>Q,UI:()=>Z});var t=r(1093),e=r(8508);const i=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),o=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],s=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),a=([t,e,r])=>{const{fields:n,values:i}=r.replace,o=()=>t.reduce(((t,e)=>[e,...t,...i[e]||[]]),[]);return i?n?n.includes(e)?Promise.resolve([o(),e,r]):Promise.resolve([t,e,r]):Promise.resolve([o(),e,r]):Promise.resolve([t,e,r])},c=([t,r,n])=>{let{fields:i,lengths:o,join:s=" "}=n.ngrams;return i||(i=[r]),o&&i.includes(r)?[(0,e.ngraminator)(t.filter((t=>null!==t)),o).map((t=>t.join(s))),r,n]:Promise.resolve([t,r,n])},u=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([e,r,n])=>{const i=t(e),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>[t.term[0],(t.positions.length/o).toFixed(2)])).sort(),r,n])},h={SPLIT:i,SKIP:o,LOWCASE:s,REPLACE:a,NGRAMS:c,STOPWORDS:u,SCORE_TERM_FREQUENCY:l,SPY:([t,e,r])=>(console.log("----------------"),console.log("field ->"),console.log(e),console.log("tokens ->"),console.log(t),console.log("----------------"),Promise.resolve([t,e,r]))},f=(t,e,r)=>i([t,e,r]).then(o).then(s).then(a).then(c).then(u).then(l).then((([t,e,r])=>t));var p=r(9148),d=r(7007),y=r(9901);function g(t,e){const r=t=>"string"==typeof t,n=async(r,n=t=>new Promise((e=>e(t))))=>new Promise((async(o,a)=>{const c=t=>void 0===t?o(void 0):t instanceof Promise?o(t):void 0;try{c(r),r=e.parse(r),r=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(r),c(r=await(e=>void 0===e?s(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?i(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(r)),c(r=await n(r))}catch(t){return a(t)}return Array.isArray(r)?o(r):o(s(r))})),i=async(t,e)=>Promise.all(t.map((t=>n(t,e)))).then((t=>{const e=t.flat(1/0).reduce(((t,e)=>(e&&t.set(e._id,[...t.get(e._id)||[],e._match]),t)),new Map);return{sumTokensMinusStopwords:t.filter((t=>t)).length,union:Array.from(e.keys()).map((t=>({_id:t,_match:e.get(t)})))}})),o=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(y.HI),["IDX",t,n]},s=t=>new Promise((e=>{if(void 0===t)return e(void 0);const r=new Map;Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0),limit:t.LIMIT,reverse:t.REVERSE}).then((t=>t.forEach((t=>t.value.forEach((e=>r.set(e,[...r.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})])))))))))).then((()=>e(Array.from(r.keys()).map((t=>({_id:t,_match:r.get(t)}))))))})),a=(t,e,r=!0)=>e?0===e.length?[]:(e=new Set(e.map((t=>t._id))),t.map((t=>Object.assign(t,{_id:[...new Set([...t._id].filter((t=>e.has(t))))]}))).filter((t=>!r||t._id.length))):t,c=t=>(t=e.parse(t),n(t).then((e=>({_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE,...t})))),u=e=>t.db.iterator(e).all().then((t=>t.map((([t,e])=>({key:t,value:e}))))),l=(t,r)=>s({...e.parse(t),LIMIT:1,REVERSE:r}).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),h=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>{let r=t.VALUE.LTE;void 0!==t.VALUE.LTE&&"number"!=typeof t.VALUE.LTE&&(r+="○");let n=t.VALUE.GTE;return t.VALUE.GTE&&"number"!=typeof t.VALUE.GTE&&(n+=" "),u({gte:o(e,n),lte:o(e,r,!0),keys:!0,values:!1}).then((t=>t.map((({key:t})=>({FIELD:t[1],VALUE:t[2][0]})))))}))).then((t=>t.flat()))),f=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0)}).then((t=>t.map((t=>({FIELD:t.key[1],VALUE:t.key[2][0],_id:t.value})))))))).then((t=>t.flat()))),p=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});return{AGGREGATE:({BUCKETS:t,FACETS:e,QUERY:r})=>Promise.all([t,e,r]).then((([t=[],e=[],r=[]])=>({BUCKETS:a(t.flat(),r),FACETS:a(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:a,BUCKET:c,BUCKETS:(...t)=>Promise.all(t.map(c)),CREATED:()=>t.db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(h):[h({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),EXIST:(...e)=>Promise.all(e.map((e=>t.db.get([t.docExistsSpace,e]).catch((t=>null))))).then((t=>t.reduce(((t,r,n)=>(null!=r&&t.push(e[n]),t)),[]))),EXPORT:u,FACETS:(...t)=>Promise.all(t.length?t.map(f):[f({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:()=>u({gte:["FIELD",y.LO],lte:["FIELD",y.HI]}).then((t=>t.map((t=>t.key[1])))),GET:n,INTERSECTION:(t,e)=>i(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t.db.get(["~LAST_UPDATED"]),MAX:t=>l(t,!0),MIN:l,OBJECT:e=>Promise.all(e.map((e=>t.db.get(["DOC",e._id]).catch((t=>null))))).then((t=>e.map(((e,r)=>(e._object=t[r],e))))),SET_SUBTRACTION:(t,e)=>Promise.all([r(t)?n(t):t,r(e)?n(e):e]).then((([t,e])=>t.filter((t=>-1===e.map((t=>t._id)).indexOf(t._id))))),SORT:t=>new Promise((e=>e(t.sort(((t,e)=>p.compare(t._id,e._id)))))),UNION:i}}y.LO=null,y.HI=void 0;var m=r(6623);const b=null,v=void 0;class E{availableFields=[];#t;constructor(t){this.#t=t}setAvailableFields=t=>{this.availableFields=t};#e=t=>{const e=t=>this.#t||"string"!=typeof t?t:t.toLowerCase();return{FIELD:t.FIELD.map(e),VALUE:{GTE:e(t.VALUE.GTE),LTE:e(t.VALUE.LTE)}}};parse(t){if(Array.isArray(t))throw new Error("token cannot be Array");if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return this.#e({FIELD:this.availableFields,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return this.#e({FIELD:[e],VALUE:{GTE:r.join(":"),LTE:r.join(":")}})}return"number"==typeof t&&(t={VALUE:{GTE:t,LTE:t}}),null===t.VALUE&&(t.VALUE={GTE:null,LTE:null}),"string"!=typeof t.VALUE&&"number"!=typeof t.VALUE||(t.VALUE={GTE:t.VALUE,LTE:t.VALUE}),void 0!==t.VALUE&&Object.keys(t.VALUE).length||(t.VALUE={GTE:b,LTE:v}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=b),void 0===t.VALUE.LTE&&(t.VALUE.LTE=v),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?this.#e({FIELD:this.availableFields,...t}):(t.FIELD=[t.FIELD].flat(),this.#e(t))}}class w{constructor(t={}){t={caseSensitive:!0,isLeaf:t=>"string"==typeof t||"number"==typeof t,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC",db:new t.Level(t.name,{keyEncoding:y,valueEncoding:"json"}),...t};const e=new E(t.caseSensitive),r=new d,n=g(t,e),i=function(t,e,r){let n=0;const i=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const n=[];return m(e._object).forEach((function(e){const i=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"!==i&&!r.doNotIndexField.filter((t=>i.startsWith(t))).length&&t.isLeaf(this.node)){if(!t.stopwords.includes(this.node)){const e=JSON.stringify([i,[this.node].flat(1/0).map((e=>"string"!=typeof e||t.caseSensitive?e:e.toLowerCase()))]);n.push(t.caseSensitive?e:e.toLowerCase())}this.update(this.node,!0)}})),{_id:e._id,keys:n}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(e,r,s,a,c)=>new Promise((u=>{e=e.map((t=>{var e;return t._id=void 0===(e=t._id)?++n:"string"==typeof e||"number"==typeof e?e:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),g(t).EXIST(...e.map((t=>t._id))).then((t=>((t,e,r)=>{const n=Object.keys(t);return Promise.all(n.map((t=>["IDX",...JSON.parse(t)])).map((t=>new Promise(((r,n)=>e.get(t).then(r).catch((t=>r([])))))))).then((e=>e.map(((e,i)=>{const o=new Set(e),s=new Set(t[n[i]]);if("put"===r)return{key:["IDX",...JSON.parse(n[i])],type:r,value:[...new Set([...o,...s])].sort()};if("del"===r){const t=[...new Set([...o].filter((t=>!s.has(t))))];return{key:["IDX",...JSON.parse(n[i])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>i(t,e))).reduce(o,{}))(e,c),r,s).then((n=>r.batch(n.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(e,s):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(n)),(r=>u(e.map((e=>{let r;return"put"===s?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===s&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:a,status:r}})))))))))})),a=()=>(new Date).toISOString(),c=e=>t.db.put(["~LAST_UPDATED"],a()).then((()=>e));return{DELETE:e=>g(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t.db,"del","DELETE",{}))).then(c),IMPORT:r=>t.db.clear().then((()=>t.db.batch(r.map((t=>Object.assign(t,{type:"put"})))))).then((()=>g(t).FIELDS())).then((t=>e.setAvailableFields(t))),PUT:(r,n={})=>s(r.map((t=>({_id:t._id,_object:t}))),t.db,"put","PUT",n).then(c).then((async r=>(e.setAvailableFields(await g(t).FIELDS()),r))),TIMESTAMP:()=>t.db.get(["~CREATED"]).then().catch((e=>t.db.put(["~CREATED"],a()).then(c).then((()=>r.emit("ready"))))),TIMESTAMP_LAST_UPDATED:c}}(t,e,r);i.TIMESTAMP(),this.AGGREGATION_FILTER=n.AGGREGATION_FILTER,this.AND=(t,e)=>n.INTERSECTION(t,e).then(this.flattenMatchArrayInResults),this.BUCKET=n.BUCKET,this.BUCKETS=n.BUCKETS,this.CREATED=n.CREATED,this.DELETE=i.DELETE,this.DISTINCT=n.DISTINCT,this.EVENTS=r,this.EXIST=n.EXIST,this.EXPORT=n.EXPORT,this.FACETS=n.FACETS,this.FIELDS=n.FIELDS,this.GET=(t,e)=>n.GET(t,e).then(this.flattenMatchArrayInResults),this.IMPORT=i.IMPORT,this.LAST_UPDATED=n.LAST_UPDATED,this.MAX=n.MAX,this.MIN=n.MIN,this.NOT=(...t)=>n.SET_SUBTRACTION(...t).then(this.flattenMatchArrayInResults),this.OBJECT=n.OBJECT,this.OR=(t,e)=>n.UNION(t,e).then((t=>t.union)).then(this.flattenMatchArrayInResults),this.PUT=i.PUT,this.SORT=n.SORT,this.STORE=t.db,this.TIMESTAMP_LAST_UPDATED=i.TIMESTAMP_LAST_UPDATED,this.TOKEN_PARSER=e}flattenMatchArrayInResults(t){return void 0===t?void 0:t.map((t=>(t._match=t._match.flat(1/0).map((t=>"string"==typeof t?JSON.parse(t):t)).sort(((t,e)=>t.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t)))}}class T{constructor(t={}){return new w({Level:p.Z,...t})}}var A=r(5606);const S="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,O=new Set,I="object"==typeof A&&A?A:{},_=(t,e,r,n)=>{"function"==typeof I.emitWarning?I.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)};let L=globalThis.AbortController,x=globalThis.AbortSignal;if(void 0===L){x=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},L=class{constructor(){e()}signal=new x;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==I.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,_("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const N=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),U=t=>N(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?C:null:null;class C extends Array{constructor(t){super(t),this.fill(0)}}class k{heap;length;static#r=!1;static create(t){const e=U(t);if(!e)return[];k.#r=!0;const r=new k(t,e);return k.#r=!1,r}constructor(t,e){if(!k.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class D{#n;#i;#o;#s;#a;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#l;#h;#f;#p;#d;#y;#g;#m;#b;#v;#E;#w;#T;#A;#S;#O;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#T,sizes:t.#E,keyMap:t.#h,keyList:t.#f,valList:t.#p,next:t.#d,prev:t.#y,get head(){return t.#g},get tail(){return t.#m},free:t.#b,isBackgroundFetch:e=>t.#I(e),backgroundFetch:(e,r,n,i)=>t.#_(e,r,n,i),moveToTail:e=>t.#L(e),indexes:e=>t.#x(e),rindexes:e=>t.#N(e),isStale:e=>t.#U(e)}}get max(){return this.#n}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#c}get dispose(){return this.#o}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:l,noUpdateTTL:h,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:d,fetchMethod:y,memoMethod:g,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=t;if(0!==e&&!N(e))throw new TypeError("max option must be a nonnegative integer");const T=e?U(e):Array;if(!T)throw new Error("invalid max value: "+e);if(this.#n=e,this.#i=f,this.maxEntrySize=p||this.#i,this.sizeCalculation=d,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("memoMethod must be a function if defined");if(this.#c=g,void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(this.#a=y,this.#S=!!y,this.#h=new Map,this.#f=new Array(e).fill(void 0),this.#p=new Array(e).fill(void 0),this.#d=new T(e),this.#y=new T(e),this.#g=0,this.#m=0,this.#b=k.create(e),this.#u=0,this.#l=0,"function"==typeof c&&(this.#o=c),"function"==typeof u?(this.#s=u,this.#v=[]):(this.#s=void 0,this.#v=void 0),this.#A=!!this.#o,this.#O=!!this.#s,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!N(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!N(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=N(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!N(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(0===this.#n&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!O.has(t))(t)&&(O.add(t),_("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,D))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#k(){const t=new C(this.#n),e=new C(this.#n);this.#T=t,this.#w=e,this.#D=(r,n,i=S.now())=>{if(e[r]=0!==n?i:0,t[r]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.#U(r)&&this.#R(this.#f[r],"expire")}),n+1);t.unref&&t.unref()}},this.#B=r=>{e[r]=0!==t[r]?S.now():0},this.#F=(i,o)=>{if(t[o]){const s=t[o],a=e[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const c=i.now-a;i.remainingTTL=s-c}};let r=0;const n=()=>{const t=S.now();if(this.ttlResolution>0){r=t;const e=setTimeout((()=>r=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const o=this.#h.get(i);if(void 0===o)return 0;const s=t[o],a=e[o];return s&&a?s-((r||n())-a):1/0},this.#U=i=>{const o=e[i],s=t[i];return!!s&&!!o&&(r||n())-o>s}}#B=()=>{};#F=()=>{};#D=()=>{};#U=()=>!1;#C(){const t=new C(this.#n);this.#l=0,this.#E=t,this.#P=e=>{this.#l-=t[e],t[e]=0},this.#j=(t,e,r,n)=>{if(this.#I(e))return 0;if(!N(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!N(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#M=(e,r,n)=>{if(t[e]=r,this.#i){const r=this.#i-t[e];for(;this.#l>r;)this.#V(!0)}this.#l+=t[e],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#P=t=>{};#M=(t,e,r)=>{};#j=(t,e,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#m;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#g);)e=this.#y[e]}*#N({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#g;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#m);)e=this.#d[e]}#$(t){return void 0!==t&&this.#h.get(this.#f[t])===t}*entries(){for(const t of this.#x())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*rentries(){for(const t of this.#N())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*keys(){for(const t of this.#x()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*rkeys(){for(const t of this.#N()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*values(){for(const t of this.#x())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}*rvalues(){for(const t of this.#N())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0!==i&&t(i,this.#f[r],this))return this.get(this.#f[r],e)}}forEach(t,e=this){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}rforEach(t,e=this){for(const r of this.#N()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}purgeStale(){let t=!1;for(const e of this.#N({allowStale:!0}))this.#U(e)&&(this.#R(this.#f[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const r=this.#p[e],n=this.#I(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#T&&this.#w){const t=this.#T[e],r=this.#w[e];if(t&&r){const e=t-(S.now()-r);i.ttl=e,i.start=Date.now()}}return this.#E&&(i.size=this.#E[e]),i}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const r=this.#f[e],n=this.#p[e],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const o={value:i};if(this.#T&&this.#w){o.ttl=this.#T[e];const t=S.now()-this.#w[e];o.start=Math.floor(Date.now()-t)}this.#E&&(o.size=this.#E[e]),t.unshift([r,o])}return t}load(t){this.clear();for(const[e,r]of t){if(r.start){const t=Date.now()-r.start;r.start=S.now()-t}this.set(e,r.value,r)}}set(t,e,r={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#j(t,e,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#R(t,"set"),this;let l=0===this.#u?void 0:this.#h.get(t);if(void 0===l)l=0===this.#u?this.#m:0!==this.#b.length?this.#b.pop():this.#u===this.#n?this.#V(!1):this.#u,this.#f[l]=t,this.#p[l]=e,this.#h.set(t,l),this.#d[this.#m]=l,this.#y[l]=this.#m,this.#m=l,this.#u++,this.#M(l,u,a),a&&(a.set="add"),c=!1;else{this.#L(l);const r=this.#p[l];if(e!==r){if(this.#S&&this.#I(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=r;void 0===e||o||(this.#A&&this.#o?.(e,t,"set"),this.#O&&this.#v?.push([e,t,"set"]))}else o||(this.#A&&this.#o?.(r,t,"set"),this.#O&&this.#v?.push([r,t,"set"]));if(this.#P(l),this.#M(l,u,a),this.#p[l]=e,a){a.set="replace";const t=r&&this.#I(r)?r.__staleWhileFetching:r;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#T||this.#k(),this.#T&&(c||this.#D(l,n,i),a&&this.#F(a,l)),!o&&this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#u;){const t=this.#p[this.#g];if(this.#V(!0),this.#I(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#V(t){const e=this.#g,r=this.#f[e],n=this.#p[e];return this.#S&&this.#I(n)?n.__abortController.abort(new Error("evicted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(n,r,"evict"),this.#O&&this.#v?.push([n,r,"evict"])),this.#P(e),t&&(this.#f[e]=void 0,this.#p[e]=void 0,this.#b.push(e)),1===this.#u?(this.#g=this.#m=0,this.#b.length=0):this.#g=this.#d[e],this.#h.delete(r),this.#u--,e}has(t,e={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=e,i=this.#h.get(t);if(void 0!==i){const t=this.#p[i];if(this.#I(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#U(i))return r&&this.#B(i),n&&(n.has="hit",this.#F(n,i)),!0;n&&(n.has="stale",this.#F(n,i))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:r=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!r&&this.#U(n))return;const i=this.#p[n];return this.#I(i)?i.__staleWhileFetching:i}#_(t,e,r,n){const i=void 0===e?void 0:this.#p[e];if(this.#I(i))return i;const o=new L,{signal:s}=r;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,c=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,c&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!c&&!i)return u(o.signal.reason);const h=l;return this.#p[e]===l&&(void 0===n?h.__staleWhileFetching?this.#p[e]=h.__staleWhileFetching:this.#R(t,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(t,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,u=l;if(this.#p[e]===l&&(c&&void 0!==u.__staleWhileFetching?s||(this.#p[e]=u.__staleWhileFetching):this.#R(t,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);const l=new Promise(((e,n)=>{const s=this.#a?.(t,i,a);s&&s instanceof Promise&&s.then((t=>e(void 0===t?void 0:t)),n),o.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(e(void 0),r.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=t),u(t)))),h=Object.assign(l,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,h,{...a.options,status:void 0}),e=this.#h.get(t)):this.#p[e]=h,h}#I(t){if(!this.#S)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof L}async fetch(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:y=!1,status:g,signal:m}=e;if(!this.#S)return g&&(g.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:m};let v=this.#h.get(t);if(void 0===v){g&&(g.fetch="miss");const e=this.#_(t,v,b,d);return e.__returned=e}{const e=this.#p[v];if(this.#I(e)){const t=r&&void 0!==e.__staleWhileFetching;return g&&(g.fetch="inflight",t&&(g.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#U(v);if(!y&&!i)return g&&(g.fetch="hit"),this.#L(v),n&&this.#B(v),g&&this.#F(g,v),e;const o=this.#_(t,v,b,d),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",s&&i&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(t,e={}){const r=await this.fetch(t,e);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(t,e={}){const r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=e,s=this.get(t,o);if(!i&&void 0!==s)return s;const a=r(t,s,{options:o,context:n});return this.set(t,a,o),a}get(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=e,s=this.#h.get(t);if(void 0!==s){const e=this.#p[s],a=this.#I(e);return o&&this.#F(o,s),this.#U(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==e.__staleWhileFetching&&(o.returnedStale=!0),r?e.__staleWhileFetching:void 0):(i||this.#R(t,"expire"),o&&r&&(o.returnedStale=!0),r?e:void 0)):(o&&(o.get="hit"),a?e.__staleWhileFetching:(this.#L(s),n&&this.#B(s),e))}o&&(o.get="miss")}#G(t,e){this.#y[e]=t,this.#d[t]=e}#L(t){t!==this.#m&&(t===this.#g?this.#g=this.#d[t]:this.#G(this.#y[t],this.#d[t]),this.#G(this.#m,t),this.#m=t)}delete(t){return this.#R(t,"delete")}#R(t,e){let r=!1;if(0!==this.#u){const n=this.#h.get(t);if(void 0!==n)if(r=!0,1===this.#u)this.#z(e);else{this.#P(n);const r=this.#p[n];if(this.#I(r)?r.__abortController.abort(new Error("deleted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(r,t,e),this.#O&&this.#v?.push([r,t,e])),this.#h.delete(t),this.#f[n]=void 0,this.#p[n]=void 0,n===this.#m)this.#m=this.#y[n];else if(n===this.#g)this.#g=this.#d[n];else{const t=this.#y[n];this.#d[t]=this.#d[n];const e=this.#d[n];this.#y[e]=this.#y[n]}this.#u--,this.#b.push(n)}}if(this.#O&&this.#v?.length){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return r}clear(){return this.#z("delete")}#z(t){for(const e of this.#N({allowStale:!0})){const r=this.#p[e];if(this.#I(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#f[e];this.#A&&this.#o?.(r,n,t),this.#O&&this.#v?.push([r,n,t])}}if(this.#h.clear(),this.#p.fill(void 0),this.#f.fill(void 0),this.#T&&this.#w&&(this.#T.fill(0),this.#w.fill(0)),this.#E&&this.#E.fill(0),this.#g=0,this.#m=0,this.#b.length=0,this.#l=0,this.#u=0,this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}class R{#W;#K;#q;constructor(t,e,r){this.#K=t.docExistsSpace,this.#q=r,this.#W=e}#H=(t,e={})=>{const r=t=>"string"==typeof t||"number"==typeof t?this.#q.GET(t,e.PIPELINE):t.FIELD||t.VALUE?this.#q.GET(t):t.AND?this.#q.AND(t.AND.map(r),e.PIPELINE):t.GET?this.#q.GET(t.GET,e.PIPELINE):t.NOT?this.#q.NOT(r(t.NOT.INCLUDE),r(t.NOT.EXCLUDE)):t.OR?this.#q.OR(t.OR.map(r),e.PIPELINE):t.ALL_DOCUMENTS?this.ALL_DOCUMENTS(t.ALL_DOCUMENTS):void 0;return r(t).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((t=>e.BUCKETS?this.#q.BUCKETS(...e.BUCKETS).then((e=>Object.assign(t,{BUCKETS:this.#q.AGGREGATION_FILTER(e,t.RESULT,!1)}))):t)).then((r=>e.FACETS?r.RESULT.length?t.ALL_DOCUMENTS?this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:t}))):this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:this.#q.AGGREGATION_FILTER(t,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>e.WEIGHT?Object.assign({RESULT:this.WEIGHT(t.RESULT,e.WEIGHT)},t):t)).then((t=>e.SCORE?this.SCORE(t.RESULT,e.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,e.SORT?{RESULT:this.SORT(t.RESULT,e.SORT)}:{}))).then((t=>{let r;return Object.assign(t,{RESULT:this.PAGE(t.RESULT,e.PAGE,(t=>{r=t}))},{PAGING:r})})).then((t=>e.DOCUMENTS?this.DOCUMENTS(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))};#Y=t=>this.DISTINCT(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"})))));#X=(...t)=>t.length?Promise.all(t.map((t=>this.#q.STORE.get([this.#K,t]).catch((t=>null))))):this.ALL_DOCUMENTS();#J=(t,e)=>this.#H({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e));ALL_DOCUMENTS=t=>this.#q.STORE.iterator({gte:[this.#K,null],lte:[this.#K,void 0],limit:t}).all().then((t=>t.map((([t,e])=>({_id:e._id,_doc:e})))));cachePipeline=(t,e,...r)=>{const n=JSON.stringify({funcLabel:e,params:r});return this.#W.has(n)?Promise.resolve(this.#W.get(n)):t(...r).then((t=>(this.#W.set(n,t),t)))};DICTIONARY=t=>this.cachePipeline(this.#Y,"#DICTIONARY",t);DISTINCT=(...t)=>this.#q.DISTINCT(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));DOCUMENTS=(...t)=>this.cachePipeline(this.#X,"#DOCUMENTS",...t);DOCUMENT_COUNT=()=>this.#q.STORE.get(["DOCUMENT_COUNT"]);DOCUMENT_VECTORS=(...t)=>Promise.all(t.map((t=>this.#q.STORE.get(["DOC",t]).catch((t=>null)))));FACETS=(...t)=>this.#q.FACETS(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));PAGE=(t,e={},r=()=>null)=>((e={NUMBER:0,SIZE:20,...e}).TOTAL=Math.ceil(t.length/e.SIZE),e.DOC_OFFSET=e.NUMBER*e.SIZE,r(e),t.slice(e.DOC_OFFSET,e.DOC_OFFSET+e.SIZE||void 0));QUERY=(t,e)=>this.cachePipeline(this.#H,"#parseJsonQuery",t,e);SCORE=(t,e={})=>{e=Object.assign({TYPE:"TFIDF"},e);const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD),n=t=>(t||[]).filter(r);return new Promise((i=>i("TFIDF"===e.TYPE?this.DOCUMENT_COUNT().then((e=>t.map(((t,n,i)=>{const o=Math.log((e+1)/i.length);return t._score=+(t._match||[]).filter(r).reduce(((t,e)=>t+o*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2)}))):"CONCAT"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.SCORE),"")}))):"SUM"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2)}))):"VALUE"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.VALUE),"")}))):null)))};SEARCH=(t,e)=>this.cachePipeline(this.#J,"#SEARCH",t,e);SORT=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION]));WEIGHT=(t,e)=>t.map((t=>(t._match=t._match.map((t=>(e.forEach((e=>{let r=!1;e.FIELD&&e.VALUE?e.FIELD===t.FIELD&&e.VALUE===t.VALUE&&(r=!0):e.FIELD?e.FIELD===t.FIELD&&(r=!0):e.VALUE&&e.VALUE===t.VALUE&&(r=!0),r&&(t.SCORE=(e.WEIGHT*+t.SCORE).toFixed(2))})),t))),t)))}var B=r(228);class F extends Error{constructor(t){super(t),this.name="TimeoutError"}}class P extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const j=t=>void 0===globalThis.DOMException?new P(t):new DOMException(t),M=t=>{const e=void 0===t.reason?j("This operation was aborted."):t.reason;return e instanceof Error?e:j(e)};class V{#Q=[];enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&this.#Q[this.size-1].priority>=e.priority)return void this.#Q.push(r);const n=function(t,e){let r=0,n=t.length;for(;n>0;){const o=Math.trunc(n/2);let s=r+o;i=t[s],e.priority-i.priority<=0?(r=++s,n-=o+1):n=o}var i;return r}(this.#Q,r);this.#Q.splice(n,0,r)}dequeue(){const t=this.#Q.shift();return t?.run}filter(t){return this.#Q.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this.#Q.length}}class $ extends B{#Z;#tt;#et=0;#rt;#nt;#it=0;#ot;#st;#Q;#at;#ct=0;#ut;#lt;#ht;timeout;constructor(t){if(super(),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:V,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#Z=t.carryoverConcurrencyCount,this.#tt=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this.#rt=t.intervalCap,this.#nt=t.interval,this.#Q=new t.queueClass,this.#at=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#ht=!0===t.throwOnTimeout,this.#lt=!1===t.autoStart}get#ft(){return this.#tt||this.#et{this.#yt()}),e)),!0;this.#et=this.#Z?this.#ct:0}return!1}#dt(){if(0===this.#Q.size)return this.#ot&&clearInterval(this.#ot),this.#ot=void 0,this.emit("empty"),0===this.#ct&&this.emit("idle"),!1;if(!this.#lt){const t=!this.#bt;if(this.#ft&&this.#pt){const e=this.#Q.dequeue();return!!e&&(this.emit("active"),e(),t&&this.#mt(),!0)}}return!1}#mt(){this.#tt||void 0!==this.#ot||(this.#ot=setInterval((()=>{this.#gt()}),this.#nt),this.#it=Date.now()+this.#nt)}#gt(){0===this.#et&&0===this.#ct&&this.#ot&&(clearInterval(this.#ot),this.#ot=void 0),this.#et=this.#Z?this.#ct:0,this.#vt()}#vt(){for(;this.#dt(););}get concurrency(){return this.#ut}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#ut=t,this.#vt()}async#Et(t){return new Promise(((e,r)=>{t.addEventListener("abort",(()=>{r(t.reason)}),{once:!0})}))}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:this.#ht,...e},new Promise(((r,n)=>{this.#Q.enqueue((async()=>{this.#ct++,this.#et++;try{e.signal?.throwIfAborted();let n=t({signal:e.signal});e.timeout&&(n=function(t,e){const{milliseconds:r,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e;let s;const a=new Promise(((a,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){const{signal:t}=e;t.aborted&&c(M(t)),t.addEventListener("abort",(()=>{c(M(t))}))}if(r===Number.POSITIVE_INFINITY)return void t.then(a,c);const u=new F;s=o.setTimeout.call(void 0,(()=>{if(n)try{a(n())}catch(t){c(t)}else"function"==typeof t.cancel&&t.cancel(),!1===i?a():i instanceof Error?c(i):(u.message=i??`Promise timed out after ${r} milliseconds`,c(u))}),r),(async()=>{try{a(await t)}catch(t){c(t)}})()})).finally((()=>{a.clear()}));return a.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},a}(Promise.resolve(n),{milliseconds:e.timeout})),e.signal&&(n=Promise.race([n,this.#Et(e.signal)]));const i=await n;r(i),this.emit("completed",i)}catch(t){if(t instanceof F&&!e.throwOnTimeout)return void r();n(t),this.emit("error",t)}finally{this.#d()}}),e),this.emit("add"),this.#dt()}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this.#lt?(this.#lt=!1,this.#vt(),this):this}pause(){this.#lt=!0}clear(){this.#Q=new this.#at}async onEmpty(){0!==this.#Q.size&&await this.#wt("empty")}async onSizeLessThan(t){this.#Q.sizethis.#Q.size{const n=()=>{e&&!e()||(this.off(t,n),r())};this.on(t,n)}))}get size(){return this.#Q.size}sizeBy(t){return this.#Q.filter(t).length}get pending(){return this.#ct}get isPaused(){return this.#lt}}class G{#W;#q;#Tt;#Q;constructor(t,e,r){this.#W=e,this.#q=r,this.#Tt=t,this.#Q=new $({concurrency:1}),this.#At(0)}#At=t=>this.#q.STORE.get(["DOCUMENT_COUNT"]).then((e=>this.#q.STORE.put(["DOCUMENT_COUNT"],+e+(+t||0)))).catch((t=>this.#q.STORE.put(["DOCUMENT_COUNT"],0)));#St=(t,e)=>{this.#W.clear();const r={...this.#Tt,...e};return((t,e)=>{const r=t=>"string"==typeof t||t instanceof String,n=(t,i)=>new Promise((async o=>{return null===t?o([null,"1.00"]):(s=t)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o([[],"1.00"]):Number.isInteger(t)?o([t,t]):r(t)?o(e.tokenizer(t,i,e)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(t)?o((a=t,new Promise((async t=>{const r={};for(const t in a)r[t]=await n(a[t],t,e);return t(r)})))):(t=>Array.isArray(t))(t)?o((c=t,Promise.all(c.map(n)))):o(t);var s,a,c}));return Promise.all(t.map((async t=>new Promise((async i=>{r(t)&&(t={body:t}),Object.prototype.hasOwnProperty.call(t,"_id")||(t._id=e.idGenerator.next().value);const o={};for(const e in t)o[e]="_id"!==e?await n(t[e],e):t[e];return i(o)})))))})(t,r).then((t=>this.#q.PUT(t,e))).then((e=>this.PUT_RAW(t,e.map((t=>t._id)),!r.storeRawDocs).then((()=>this.#At(e.filter((t=>"CREATED"===t.status)).length))).then((()=>e))))};#Ot=t=>this.#q.DELETE(t).then((e=>this.DELETE_RAW(...t).then((()=>this.#At(-e.filter((t=>"DELETED"===t.status)).length))).then((()=>this.#W.clear())).then((()=>e))));DELETE=(...t)=>this.#Ot(t);DELETE_RAW=(...t)=>Promise.all(t.map((t=>this.#q.STORE.del([this.#Tt.docExistsSpace,t]))));FLUSH=()=>this.#q.STORE.clear().then((()=>{this.#W.clear();const t=(new Date).toISOString();return this.#q.STORE.batch([{type:"put",key:["~CREATED"],value:t},{type:"put",key:["~LAST_UPDATED"],value:t},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0));IMPORT=t=>(this.#W.clear(),Promise.resolve(this.#q.IMPORT(t)));PUT=(t,e)=>this.#Q.add((()=>this.#St(t,e)));PUT_RAW=(t,e,r)=>Promise.all(t.map(((t,n)=>this.#q.STORE.put([this.#Tt.docExistsSpace,e[n]],r?{}:t)))).then((r=>(this.#W.clear(),t.map(((t,r)=>({_id:e[r],status:"OK",operation:"_PUT_RAW"}))))))}class z{constructor(t={}){var e;t={cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],name:"index",ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:f,...t},this.INDEX=new T({...t,isLeaf:t=>Array.isArray(t)&&2===t.length&&t.every((t=>"string"==typeof t||"number"==typeof t||null===t))}),this.EVENTS=this.INDEX.EVENTS,this._CACHE=new D({max:t.cacheLength}),this.r=new R(t,this._CACHE,this.INDEX),this.w=new G(t,this._CACHE,this.INDEX),e=this.INDEX,new Promise(((t,r)=>{const n=["CREATED_WITH"],i="search-index@5.1.1";return e.STORE.get(n).then((e=>i===e?t():r(new Error("This index was created with "+e+", you are running "+i)))).catch((r=>e.STORE.put(n,i).then(t)))}))}ALL_DOCUMENTS=t=>this.r.ALL_DOCUMENTS(t);BUCKETS=(...t)=>this.INDEX.BUCKETS(...t);CREATED=()=>this.INDEX.CREATED();DELETE=(...t)=>this.w.DELETE(...t);DELETE_RAW=(...t)=>this.w.DELETE_RAW(...t);DICTIONARY=t=>this.r.DICTIONARY(t);DISTINCT=(...t)=>this.r.DISTINCT(...t);DOCUMENTS=(...t)=>this.r.DOCUMENTS(...t);DOCUMENT_COUNT=()=>this.r.DOCUMENT_COUNT();DOCUMENT_VECTORS=(...t)=>this.r.DOCUMENT_VECTORS(...t);EXPORT=()=>this.INDEX.EXPORT();FACETS=(...t)=>this.r.FACETS(...t);FIELDS=()=>this.INDEX.FIELDS();FLUSH=()=>this.w.FLUSH();IMPORT=t=>this.INDEX.IMPORT(t);LAST_UPDATED=()=>this.INDEX.LAST_UPDATED();MAX=t=>this.INDEX.MAX(t);MIN=t=>this.INDEX.MIN(t);PUT=(t,e)=>this.w.PUT(t,e);PUT_RAW=(t,e,r)=>this.w.PUT_RAW(t,e,r);QUERY=(t,e)=>this.r.QUERY(t,e);SEARCH=(t,e)=>this.r.SEARCH(t,e);TOKENIZATION_PIPELINE_STAGES=h;_AND=(t,e)=>this.INDEX.AND(t,e);_BUCKET=t=>this.INDEX.BUCKET(t);_GET=(t,e)=>this.INDEX.GET(t,e);_NOT=(t,e)=>this.INDEX.NOT(t,e);_OR=(t,e)=>this.INDEX.OR(t,e);_PAGE=(t,e)=>this.r.PAGE(t,e);_SORT=(t,e)=>this.r.SORT(t,e)}class W{constructor({template:t=t=>`${t} hits`,elementId:e="count"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=this.template(t)}class K{constructor({template:t=t=>`

    ${JSON.stringify(t)}

    `,elementId:e="hits"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=t.map((({_doc:t})=>this.template(t))).join("\n")}class q{constructor({pageLinkTemplate:t=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,navLinkTemplate:e=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,elementId:r="paging"},n){this.pageLinkTemplate=t,this.navLinkTemplate=e,this.el=document.getElementById(r),this.search=n,this.page={NUMBER:0,SIZE:10}}template=t=>{let e=0,r=t.TOTAL;return t.TOTAL>7&&(e=t.NUMBER>3?t.NUMBER-3:0,r=7+e),r>t.TOTAL&&(e=t.TOTAL-6-1,r=t.TOTAL),`\n
      \n ${this.navLinkTemplate("First",0,0===t.NUMBER)}\n ${this.navLinkTemplate("‹",t.NUMBER-1,0===t.NUMBER)}\n ${(()=>{let n="";for(let i=e;i=t.TOTAL-1)}\n ${this.navLinkTemplate("Last",t.TOTAL-1,t.NUMBER>=t.TOTAL-1)}\n
    `};update=t=>{if(console.log(t),t.TOTAL<=1)return void(this.el.innerHTML="");this.el.innerHTML=this.template(t);const e=document.getElementsByClassName("page-link");for(let t=0;t{console.log("AYO!"),console.log(this.search()),this.page.NUMBER=+t.target.attributes["data-page"].value,this.search()}))}}class H{constructor({elementId:t="",facetOptionTemplate:e=(t,e)=>`\n \n \n
    `,field:r=null,mode:n="OR",sort:i=(t,e)=>{t.VALUE.localeCompare(e.VALUE)},title:o="

    "+r.toUpperCase()+"

    "},s){this.activeFilters=[],this.el=document.getElementById(t),this.elementId=t,this.facetOptionTemplate=e,this.field=r,this.mode=n,this.search=s,this.sort=i,this.title=o}getActiveFilters=()=>this.activeFilters.length?[{[this.mode]:this.activeFilters}]:[];update=(t,e)=>{if("facet"===e&&"OR"===this.mode)return;const r=t.filter((t=>t.FIELD===this.field));this.el.innerHTML=r.length?this.title+r.sort(this.sort).reduce(((t,e)=>t+this.facetOptionTemplate(e,this.activeFilters.includes(e.FIELD+":"+e.VALUE))),""):"",this.activeFilters.forEach((t=>{if(!document.getElementById(t)){const[e,r]=t.split(":");this.el.innerHTML+=this.facetOptionTemplate({FIELD:e,VALUE:r,_id:[]},!0)}}));for(const t of document.querySelectorAll("#"+this.elementId+" > .filter-select"))t.addEventListener("input",(t=>{console.log(this.elementId),console.log(this.mode);const e=t.target.attributes["data-field"].value+":"+t.target.attributes["data-value"].value;t.target.checked?this.activeFilters.push(e):this.activeFilters=this.activeFilters.filter((t=>t!==e)),this.search("facet")}))}}class Y{constructor(t,e,r={}){this.autoCompleteFunction=r.autoCompleteFunction,this.currentFocus=-1,this.searchboxEl=t,this.search=e,this.limit=r.limit||20,this.threshold=r.threshold||2,this.autocompleteListId=t.id+"-autocomplete-list",this.suggestionsElementId=r.elementId,t.addEventListener("input",this.searchBoxInputListener),t.addEventListener("keydown",this.searchBoxKeydownListener),document.addEventListener("click",(t=>{this.closeAllLists(t.target)}))}closeAllLists=t=>{for(const e of document.getElementsByClassName("autocomplete-items"))t!==e&&t!==this.searchboxEl&&e.parentNode.removeChild(e)};searchBoxKeydownListener=t=>{let e=document.getElementById(this.autocompleteListId);e&&(e=e.getElementsByTagName("div")),40===t.keyCode?(this.currentFocus++,this.addActive(e)):38===t.keyCode?(this.currentFocus--,this.addActive(e)):13===t.keyCode||9===t.keyCode?(t.preventDefault(),this.currentFocus>-1?e&&e[this.currentFocus].click():this.closeAllLists()):27===t.keyCode&&this.closeAllLists()};searchBoxInputListener=async t=>{const e=(await this.autoCompleteFunction(t.target.value)).slice(0,this.limit);let r;const n=t.target.value;if(this.closeAllLists(),!n)return!1;if(n.length{r=document.createElement("DIV"),r.innerHTML=""+t.substr(0,n.length)+"",r.innerHTML+=t.substr(n.length),r.innerHTML+="",r.addEventListener("click",(t=>{this.searchboxEl.value=t.target.getElementsByTagName("input")[0].value,this.closeAllLists(),this.search()})),i.appendChild(r)}))};addActive=t=>{if(!t)return!1;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1),t[this.currentFocus].classList.add("autocomplete-active")};removeActive=t=>{for(let e=0;e{n.page.NUMBER=0,r("searchInput")})),this.autocomplete=new Y(this.el,r,e)}}class J{constructor({index:t=null,count:e={},hits:r={},facets:n=[],searchInput:i={},paging:o={},suggestions:s={}}){this.index=t,this.count=new W(e),this.paging=new q(o,this.search),this.hits=new K(r),this.searchInput=new X({...i,suggestions:{autoCompleteFunction:this.index.DICTIONARY,...i.suggestions}},this.search,this.paging),this.facets=n.map((t=>new H(t,this.search))),this.search()}queryOptions=()=>({FACETS:this.facets.map((t=>({FIELD:t.field}))),DOCUMENTS:!0,PAGE:this.paging.page});emptySearchQuery=()=>[{ALL_DOCUMENTS:!0},this.queryOptions()];searchQuery=()=>[[...this.searchInput.el.value.split(/\s+/).filter((t=>t)),...this.facets.map((t=>t.getActiveFilters())).flat(1/0)],this.queryOptions()];search=t=>(this.searchInput.el.value.length+this.facets.map((t=>t.getActiveFilters())).flat(1/0).length?this.index.SEARCH(...this.searchQuery()):this.index.QUERY(...this.emptySearchQuery())).then((e=>{this.hits.update(e.RESULT),this.count.update(e.RESULT_LENGTH),this.facets.forEach((r=>r.update(e.FACETS,t))),this.paging.update(e.PAGING)}))}class Q{constructor(t={}){return new z({Level:p.Z,...t})}}class Z{constructor(t={}){return new J(t)}}})(),SearchIndex=n})(); \ No newline at end of file diff --git a/dist/search-index-5.0.0.js.LICENSE.txt b/dist/search-index-5.1.1.js.LICENSE.txt similarity index 100% rename from dist/search-index-5.0.0.js.LICENSE.txt rename to dist/search-index-5.1.1.js.LICENSE.txt diff --git a/dist/search-index-esm-5.0.0.js b/dist/search-index-esm-5.1.1.js similarity index 99% rename from dist/search-index-esm-5.0.0.js rename to dist/search-index-esm-5.1.1.js index 9f46ced9..c37c4ae9 100644 --- a/dist/search-index-esm-5.0.0.js +++ b/dist/search-index-esm-5.1.1.js @@ -1,2 +1,2 @@ -/*! For license information please see search-index-esm-5.0.0.js.LICENSE.txt */ -var t={796:(t,e,r)=>{const{fromCallback:n}=r(8100),i=r(266),{getCallback:o,getOptions:s}=r(1343),a=Symbol("promise"),c=Symbol("status"),u=Symbol("operations"),l=Symbol("finishClose"),h=Symbol("closeCallbacks");e.AbstractChainedBatch=class{constructor(t){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));this[u]=[],this[h]=[],this[c]="open",this[l]=this[l].bind(this),this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get length(){return this[u].length}put(t,e,r){if("open"!==this[c])throw new i("Batch is not open: cannot call put() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const n=this.db._checkKey(t)||this.db._checkValue(e);if(n)throw n;const o=r&&null!=r.sublevel?r.sublevel:this.db,s=r,a=o.keyEncoding(r&&r.keyEncoding),l=o.valueEncoding(r&&r.valueEncoding),h=a.format;r={...r,keyEncoding:h,valueEncoding:l.format},o!==this.db&&(r.sublevel=null);const f=o.prefixKey(a.encode(t),h),p=l.encode(e);return this._put(f,p,r),this[u].push({...s,type:"put",key:t,value:e}),this}_put(t,e,r){}del(t,e){if("open"!==this[c])throw new i("Batch is not open: cannot call del() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const r=this.db._checkKey(t);if(r)throw r;const n=e&&null!=e.sublevel?e.sublevel:this.db,o=e,s=n.keyEncoding(e&&e.keyEncoding),a=s.format;return e={...e,keyEncoding:a},n!==this.db&&(e.sublevel=null),this._del(n.prefixKey(s.encode(t),a),e),this[u].push({...o,type:"del",key:t}),this}_del(t,e){}clear(){if("open"!==this[c])throw new i("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[u]=[],this}_clear(){}write(t,e){return e=o(t,e),e=n(e,a),t=s(t),"open"!==this[c]?this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):0===this.length?this.close(e):(this[c]="writing",this._write(t,(t=>{this[c]="closing",this[h].push((()=>e(t))),t||this.db.emit("batch",this[u]),this._close(this[l])}))),e[a]}_write(t,e){}close(t){return t=n(t,a),"closing"===this[c]?this[h].push(t):"closed"===this[c]?this.nextTick(t):(this[h].push(t),"writing"!==this[c]&&(this[c]="closing",this._close(this[l]))),t[a]}_close(t){this.nextTick(t)}[l](){this[c]="closed",this.db.detachResource(this);const t=this[h];this[h]=[];for(const e of t)e()}}},3527:(t,e,r)=>{const{fromCallback:n}=r(8100),i=r(266),{getOptions:o,getCallback:s}=r(1343),a=Symbol("promise"),c=Symbol("callback"),u=Symbol("working"),l=Symbol("handleOne"),h=Symbol("handleMany"),f=Symbol("autoClose"),p=Symbol("finishWork"),d=Symbol("returnMany"),y=Symbol("closing"),g=Symbol("handleClose"),m=Symbol("closed"),b=Symbol("closeCallbacks"),v=Symbol("keyEncoding"),E=Symbol("valueEncoding"),w=Symbol("abortOnClose"),T=Symbol("legacy"),A=Symbol("keys"),S=Symbol("values"),O=Symbol("limit"),I=Symbol("count"),_=Object.freeze({}),L=()=>{};let x=!1;class N{constructor(t,e,r){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e)throw new TypeError("The second argument must be an options object");this[m]=!1,this[b]=[],this[u]=!1,this[y]=!1,this[f]=!1,this[c]=null,this[l]=this[l].bind(this),this[h]=this[h].bind(this),this[g]=this[g].bind(this),this[v]=e[v],this[E]=e[E],this[T]=r,this[O]=Number.isInteger(e.limit)&&e.limit>=0?e.limit:1/0,this[I]=0,this[w]=!!e.abortOnClose,this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get count(){return this[I]}get limit(){return this[O]}next(t){let e;if(void 0===t)e=new Promise(((e,r)=>{t=(t,n,i)=>{t?r(t):this[T]?void 0===n&&void 0===i?e():e([n,i]):e(n)}}));else if("function"!=typeof t)throw new TypeError("Callback must be a function");return this[y]?this.nextTick(t,new i("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(t,new i("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=t,this[I]>=this[O]?this.nextTick(this[l],null):this._next(this[l])),e}_next(t){this.nextTick(t)}nextv(t,e,r){return r=s(e,r),r=n(r,a),e=o(e,_),Number.isInteger(t)?(this[y]?this.nextTick(r,new i("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(r,new i("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(t<1&&(t=1),this[O]<1/0&&(t=Math.min(t,this[O]-this[I])),this[u]=!0,this[c]=r,t<=0?this.nextTick(this[h],null,[]):this._nextv(t,e,this[h])),r[a]):(this.nextTick(r,new TypeError("The first argument 'size' must be an integer")),r[a])}_nextv(t,e,r){const n=[],i=(e,o,s)=>e?r(e):(this[T]?void 0===o&&void 0===s:void 0===o)?r(null,n):(n.push(this[T]?[o,s]:o),void(n.length===t?r(null,n):this._next(i)));this._next(i)}all(t,e){return e=s(t,e),e=n(e,a),t=o(t,_),this[y]?this.nextTick(e,new i("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(e,new i("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=e,this[f]=!0,this[I]>=this[O]?this.nextTick(this[h],null,[]):this._all(t,this[h])),e[a]}_all(t,e){let r=this[I];const n=[],i=()=>{const t=this[O]<1/0?Math.min(1e3,this[O]-r):1e3;t<=0?this.nextTick(e,null,n):this._nextv(t,_,o)},o=(t,o)=>{t?e(t):0===o.length?e(null,n):(n.push.apply(n,o),r+=o.length,i())};i()}[p](){const t=this[c];return this[w]&&null===t?L:(this[u]=!1,this[c]=null,this[y]&&this._close(this[g]),t)}[d](t,e,r){this[f]?this.close(t.bind(null,e,r)):t(e,r)}seek(t,e){if(e=o(e,_),this[y]);else{if(this[u])throw new i("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{const r=this.db.keyEncoding(e.keyEncoding||this[v]),n=r.format;e.keyEncoding!==n&&(e={...e,keyEncoding:n});const i=this.db.prefixKey(r.encode(t),n);this._seek(i,e)}}}_seek(t,e){throw new i("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(t){return t=n(t,a),this[m]?this.nextTick(t):this[y]?this[b].push(t):(this[y]=!0,this[b].push(t),this[u]?this[w]&&this[p]()(new i("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[g])),t[a]}_close(t){this.nextTick(t)}[g](){this[m]=!0,this.db.detachResource(this);const t=this[b];this[b]=[];for(const e of t)e()}async*[Symbol.asyncIterator](){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this[m]||await this.close()}}}class U extends N{constructor(t,e){super(t,e,!0),this[A]=!1!==e.keys,this[S]=!1!==e.values}[l](t,e,r){const n=this[p]();if(t)return n(t);try{e=this[A]&&void 0!==e?this[v].decode(e):void 0,r=this[S]&&void 0!==r?this[E].decode(r):void 0}catch(t){return n(new C("entry",t))}void 0===e&&void 0===r||this[I]++,n(null,e,r)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(const t of e){const e=t[0],r=t[1];t[0]=this[A]&&void 0!==e?this[v].decode(e):void 0,t[1]=this[S]&&void 0!==r?this[E].decode(r):void 0}}catch(t){return this[d](r,new C("entries",t))}this[I]+=e.length,this[d](r,null,e)}end(t){return x||"undefined"==typeof console||(x=!0,console.warn(new i("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(t)}}class C extends i{constructor(t,e){super(`Iterator could not decode ${t}`,{code:"LEVEL_DECODE_ERROR",cause:e})}}for(const t of["_ended property","_nexting property","_end method"])Object.defineProperty(U.prototype,t.split(" ")[0],{get(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});U.keyEncoding=v,U.valueEncoding=E,e.AbstractIterator=U,e.AbstractKeyIterator=class extends N{constructor(t,e){super(t,e,!1)}[l](t,e){const r=this[p]();if(t)return r(t);try{e=void 0!==e?this[v].decode(e):void 0}catch(t){return r(new C("key",t))}void 0!==e&&this[I]++,r(null,e)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(let t=0;t{const{supports:n}=r(5356),{Transcoder:i}=r(6035),{EventEmitter:o}=r(7007),{fromCallback:s}=r(8100),a=r(266),{AbstractIterator:c}=r(3527),{DefaultKeyIterator:u,DefaultValueIterator:l}=r(5682),{DeferredIterator:h,DeferredKeyIterator:f,DeferredValueIterator:p}=r(4416),{DefaultChainedBatch:d}=r(4669),{getCallback:y,getOptions:g}=r(1343),m=r(386),b=Symbol("promise"),v=Symbol("landed"),E=Symbol("resources"),w=Symbol("closeResources"),T=Symbol("operations"),A=Symbol("undefer"),S=Symbol("deferOpen"),O=Symbol("options"),I=Symbol("status"),_=Symbol("defaultOptions"),L=Symbol("transcoder"),x=Symbol("keyEncoding"),N=Symbol("valueEncoding"),U=()=>{};class C extends o{constructor(t,e){if(super(),"object"!=typeof t||null===t)throw new TypeError("The first argument 'manifest' must be an object");e=g(e);const{keyEncoding:r,valueEncoding:o,passive:s,...a}=e;this[E]=new Set,this[T]=[],this[S]=!0,this[O]=a,this[I]="opening",this.supports=n(t,{status:!0,promises:!0,clear:!0,getMany:!0,deferredOpen:!0,snapshots:!1!==t.snapshots,permanence:!1!==t.permanence,keyIterator:!0,valueIterator:!0,iteratorNextv:!0,iteratorAll:!0,encodings:t.encodings||{},events:Object.assign({},t.events,{opening:!0,open:!0,closing:!0,closed:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[L]=new i(R(this)),this[x]=this[L].encoding(r||"utf8"),this[N]=this[L].encoding(o||"utf8");for(const t of this[L].encodings())this.supports.encodings[t.commonName]||(this.supports.encodings[t.commonName]=!0);this[_]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[x].commonName,valueEncoding:this[N].commonName}),key:Object.freeze({keyEncoding:this[x].commonName})},this.nextTick((()=>{this[S]&&this.open({passive:!1},U)}))}get status(){return this[I]}keyEncoding(t){return this[L].encoding(null!=t?t:this[x])}valueEncoding(t){return this[L].encoding(null!=t?t:this[N])}open(t,e){e=y(t,e),e=s(e,b),(t={...this[O],...g(t)}).createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists;const r=t=>{"closing"===this[I]||"opening"===this[I]?this.once(v,t?()=>r(t):r):"open"!==this[I]?e(new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:t})):e()};return t.passive?"opening"===this[I]?this.once(v,r):this.nextTick(r):"closed"===this[I]||this[S]?(this[S]=!1,this[I]="opening",this.emit("opening"),this._open(t,(t=>{if(t)return this[I]="closed",this[w]((()=>{this.emit(v),r(t)})),void this[A]();this[I]="open",this[A](),this.emit(v),"open"===this[I]&&this.emit("open"),"open"===this[I]&&this.emit("ready"),r()}))):"open"===this[I]?this.nextTick(r):this.once(v,(()=>this.open(t,e))),e[b]}_open(t,e){this.nextTick(e)}close(t){t=s(t,b);const e=r=>{"opening"===this[I]||"closing"===this[I]?this.once(v,r?e(r):e):"closed"!==this[I]?t(new a("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:r})):t()};if("open"===this[I]){this[I]="closing",this.emit("closing");const t=t=>{this[I]="open",this[A](),this.emit(v),e(t)};this[w]((()=>{this._close((r=>{if(r)return t(r);this[I]="closed",this[A](),this.emit(v),"closed"===this[I]&&this.emit("closed"),e()}))}))}else"closed"===this[I]?this.nextTick(e):this.once(v,(()=>this.close(t)));return t[b]}[w](t){if(0===this[E].size)return this.nextTick(t);let e=this[E].size,r=!0;const n=()=>{0==--e&&(r?this.nextTick(t):t())};for(const t of this[E])t.close(n);r=!1,this[E].clear()}_close(t){this.nextTick(t)}get(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.get(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=this.valueEncoding(e.valueEncoding),c=i.format,u=o.format;return e.keyEncoding===c&&e.valueEncoding===u||(e=Object.assign({},e,{keyEncoding:c,valueEncoding:u})),this._get(this.prefixKey(i.encode(t),c),e,((t,e)=>{if(t)return("LEVEL_NOT_FOUND"===t.code||t.notFound||/NotFound/i.test(t))&&(t.code||(t.code="LEVEL_NOT_FOUND"),t.notFound||(t.notFound=!0),t.status||(t.status=404)),r(t);try{e=o.decode(e)}catch(t){return r(new a("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:t}))}r(null,e)})),r[b]}_get(t,e,r){this.nextTick(r,new Error("NotFound"))}getMany(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.getMany(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'keys' must be an array")),r[b];if(0===t.length)return this.nextTick(r,null,[]),r[b];const n=this.keyEncoding(e.keyEncoding),i=this.valueEncoding(e.valueEncoding),o=n.format,c=i.format;e.keyEncoding===o&&e.valueEncoding===c||(e=Object.assign({},e,{keyEncoding:o,valueEncoding:c}));const u=new Array(t.length);for(let e=0;e{if(t)return r(t);try{for(let t=0;tthis.put(t,e,r,n))),n[b];if(D(this,n))return n[b];const i=this._checkKey(t)||this._checkValue(e);if(i)return this.nextTick(n,i),n[b];const o=this.keyEncoding(r.keyEncoding),a=this.valueEncoding(r.valueEncoding),c=o.format,u=a.format;r.keyEncoding===c&&r.valueEncoding===u||(r=Object.assign({},r,{keyEncoding:c,valueEncoding:u}));const l=this.prefixKey(o.encode(t),c),h=a.encode(e);return this._put(l,h,r,(r=>{if(r)return n(r);this.emit("put",t,e),n()})),n[b]}_put(t,e,r,n){this.nextTick(n)}del(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].key),"opening"===this[I])return this.defer((()=>this.del(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=i.format;return e.keyEncoding!==o&&(e=Object.assign({},e,{keyEncoding:o})),this._del(this.prefixKey(i.encode(t),o),e,(e=>{if(e)return r(e);this.emit("del",t),r()})),r[b]}_del(t,e,r){this.nextTick(r)}batch(t,e,r){if(!arguments.length){if("opening"===this[I])return new d(this);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(r="function"==typeof t?t:y(e,r),r=s(r,b),e=g(e,this[_].empty),"opening"===this[I])return this.defer((()=>this.batch(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'operations' must be an array")),r[b];if(0===t.length)return this.nextTick(r),r[b];const n=new Array(t.length),{keyEncoding:i,valueEncoding:o,...c}=e;for(let e=0;e{if(e)return r(e);this.emit("batch",t),r()})),r[b]}_batch(t,e,r){this.nextTick(r)}sublevel(t,e){return this._sublevel(t,k.defaults(e))}_sublevel(t,e){return new k(this,t,e)}prefixKey(t,e){return t}clear(t,e){if(e=y(t,e),e=s(e,b),t=g(t,this[_].empty),"opening"===this[I])return this.defer((()=>this.clear(t,e))),e[b];if(D(this,e))return e[b];const r=t,n=this.keyEncoding(t.keyEncoding);return(t=m(t,n)).keyEncoding=n.format,0===t.limit?this.nextTick(e):this._clear(t,(t=>{if(t)return e(t);this.emit("clear",r),e()})),e[b]}_clear(t,e){this.nextTick(e)}iterator(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e)).keys=!1!==t.keys,t.values=!1!==t.values,t[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new h(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(t)}_iterator(t){return new c(this,t)}keys(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new f(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(t)}_keys(t){return new u(this,t)}values(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new p(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(t)}_values(t){return new l(this,t)}defer(t){if("function"!=typeof t)throw new TypeError("The first argument must be a function");this[T].push(t)}[A](){if(0===this[T].length)return;const t=this[T];this[T]=[];for(const e of t)e()}attachResource(t){if("object"!=typeof t||null===t||"function"!=typeof t.close)throw new TypeError("The first argument must be a resource object");this[E].add(t)}detachResource(t){this[E].delete(t)}_chainedBatch(){return new d(this)}_checkKey(t){if(null==t)return new a("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(t){if(null==t)return new a("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}}C.prototype.nextTick=r(28);const{AbstractSublevel:k}=r(9933)({AbstractLevel:C});e.AbstractLevel=C,e.AbstractSublevel=k;const D=function(t,e){return"open"!==t[I]&&(t.nextTick(e,new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0)},R=function(t){return Object.keys(t.supports.encodings).filter((e=>!!t.supports.encodings[e]))}},5e3:(t,e,r)=>{e.AbstractLevel=r(1983).AbstractLevel,e.AbstractSublevel=r(1983).AbstractSublevel,e.AbstractIterator=r(3527).AbstractIterator,e.AbstractKeyIterator=r(3527).AbstractKeyIterator,e.AbstractValueIterator=r(3527).AbstractValueIterator,e.AbstractChainedBatch=r(796).AbstractChainedBatch},4716:(t,e,r)=>{const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=Symbol("unfix"),a=Symbol("iterator"),c=Symbol("handleOne"),u=Symbol("handleMany"),l=Symbol("callback");class h extends n{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e,r){const n=this[l];if(t)return n(t);void 0!==e&&(e=this[s](e)),n(t,e,r)}[u](t,e){const r=this[l];if(t)return r(t);for(const t of e){const e=t[0];void 0!==e&&(t[0]=this[s](e))}r(t,e)}}class f extends i{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e){const r=this[l];if(t)return r(t);void 0!==e&&(e=this[s](e)),r(t,e)}[u](t,e){const r=this[l];if(t)return r(t);for(let t=0;t{const n=r(266),{Buffer:i}=r(8287)||{},{AbstractSublevelIterator:o,AbstractSublevelKeyIterator:s,AbstractSublevelValueIterator:a}=r(4716),c=Symbol("prefix"),u=Symbol("upperBound"),l=Symbol("prefixRange"),h=Symbol("parent"),f=Symbol("unfix"),p=new TextEncoder,d={separator:"!"};t.exports=function({AbstractLevel:t}){class e extends t{static defaults(t){if("string"==typeof t)throw new n("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(t&&t.open)throw new n("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return null==t?d:t.separator?t:{...t,separator:"!"}}constructor(t,r,i){const{separator:o,manifest:s,...a}=e.defaults(i);r=v(r,o);const l=o.charCodeAt(0)+1,d=t[h]||t;if(!p.encode(r).every((t=>t>l&&t<127)))throw new n(`Prefix must use bytes > ${l} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(y(d,s),a);const g=(t.prefix||"")+o+r+o,E=g.slice(0,-1)+String.fromCharCode(l);this[h]=d,this[c]=new m(g),this[u]=new m(E),this[f]=new b,this.nextTick=d.nextTick}prefixKey(t,e){if("utf8"===e)return this[c].utf8+t;if(0===t.byteLength)return this[c][e];if("view"===e){const e=this[c].view,r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}{const e=this[c].buffer;return i.concat([e,t],e.byteLength+t.byteLength)}}[l](t,e){void 0!==t.gte?t.gte=this.prefixKey(t.gte,e):void 0!==t.gt?t.gt=this.prefixKey(t.gt,e):t.gte=this[c][e],void 0!==t.lte?t.lte=this.prefixKey(t.lte,e):void 0!==t.lt?t.lt=this.prefixKey(t.lt,e):t.lte=this[u][e]}get prefix(){return this[c].utf8}get db(){return this[h]}_open(t,e){this[h].open({passive:!0},e)}_put(t,e,r,n){this[h].put(t,e,r,n)}_get(t,e,r){this[h].get(t,e,r)}_getMany(t,e,r){this[h].getMany(t,e,r)}_del(t,e,r){this[h].del(t,e,r)}_batch(t,e,r){this[h].batch(t,e,r)}_clear(t,e){this[l](t,t.keyEncoding),this[h].clear(t,e)}_iterator(t){this[l](t,t.keyEncoding);const e=this[h].iterator(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new o(this,t,e,r)}_keys(t){this[l](t,t.keyEncoding);const e=this[h].keys(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new s(this,t,e,r)}_values(t){this[l](t,t.keyEncoding);const e=this[h].values(t);return new a(this,t,e)}}return{AbstractSublevel:e}};const y=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:g(t,"utf8"),buffer:g(t,"buffer"),view:g(t,"view")}}},g=function(t,e){return!!t.supports.encodings[e]&&t.keyEncoding(e).name===e};class m{constructor(t){this.utf8=t,this.view=p.encode(t),this.buffer=i?i.from(this.view.buffer,0,this.view.byteLength):{}}}class b{constructor(){this.cache=new Map}get(t,e){let r=this.cache.get(e);return void 0===r&&(r="view"===e?function(t,e){return e.subarray(t)}.bind(null,t):function(t,e){return e.slice(t)}.bind(null,t),this.cache.set(e,r)),r}}const v=function(t,e){let r=0,n=t.length;for(;rr&&t[n-1]===e;)n--;return t.slice(r,n)}},1343:(t,e)=>{e.getCallback=function(t,e){return"function"==typeof t?t:e},e.getOptions=function(t,e){return"object"==typeof t&&null!==t?t:void 0!==e?e:{}}},4669:(t,e,r)=>{const{AbstractChainedBatch:n}=r(796),i=r(266),o=Symbol("encoded");e.DefaultChainedBatch=class extends n{constructor(t){super(t),this[o]=[]}_put(t,e,r){this[o].push({...r,type:"put",key:t,value:e})}_del(t,e){this[o].push({...e,type:"del",key:t})}_clear(){this[o]=[]}_write(t,e){"opening"===this.db.status?this.db.defer((()=>this._write(t,e))):"open"===this.db.status?0===this[o].length?this.nextTick(e):this.db._batch(this[o],t,e):this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}}},5682:(t,e,r)=>{const{AbstractKeyIterator:n,AbstractValueIterator:i}=r(3527),o=Symbol("iterator"),s=Symbol("callback"),a=Symbol("handleOne"),c=Symbol("handleMany");class u extends n{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!0,values:!1}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}class l extends i{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!1,values:!0}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}for(const t of[u,l]){const e=t===u,r=e?t=>t[0]:t=>t[1];t.prototype._next=function(t){this[s]=t,this[o].next(this[a])},t.prototype[a]=function(t,r,n){const i=this[s];t?i(t):i(null,e?r:n)},t.prototype._nextv=function(t,e,r){this[s]=r,this[o].nextv(t,e,this[c])},t.prototype._all=function(t,e){this[s]=e,this[o].all(t,this[c])},t.prototype[c]=function(t,e){const n=this[s];t?n(t):n(null,e.map(r))},t.prototype._seek=function(t,e){this[o].seek(t,e)},t.prototype._close=function(t){this[o].close(t)}}e.DefaultKeyIterator=u,e.DefaultValueIterator=l},4416:(t,e,r)=>{const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=r(266),a=Symbol("nut"),c=Symbol("undefer"),u=Symbol("factory");class l extends n{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.iterator(e),this.db.defer((()=>this[c]()))}}class h extends i{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.keys(e),this.db.defer((()=>this[c]()))}}class f extends o{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.values(e),this.db.defer((()=>this[c]()))}}for(const t of[l,h,f])t.prototype[c]=function(){"open"===this.db.status&&(this[a]=this[u]())},t.prototype._next=function(t){null!==this[a]?this[a].next(t):"opening"===this.db.status?this.db.defer((()=>this._next(t))):this.nextTick(t,new s("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(t,e,r){null!==this[a]?this[a].nextv(t,e,r):"opening"===this.db.status?this.db.defer((()=>this._nextv(t,e,r))):this.nextTick(r,new s("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(t,e){null!==this[a]?this[a].all(e):"opening"===this.db.status?this.db.defer((()=>this._all(t,e))):this.nextTick(e,new s("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(t,e){null!==this[a]?this[a]._seek(t,e):"opening"===this.db.status&&this.db.defer((()=>this._seek(t,e)))},t.prototype._close=function(t){null!==this[a]?this[a].close(t):"opening"===this.db.status?this.db.defer((()=>this._close(t))):this.nextTick(t)};e.DeferredIterator=l,e.DeferredKeyIterator=h,e.DeferredValueIterator=f},28:(t,e,r)=>{const n=r(9596);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},386:(t,e,r)=>{const n=r(266),i=Object.prototype.hasOwnProperty,o=new Set(["lt","lte","gt","gte"]);t.exports=function(t,e){const r={};for(const s in t)if(i.call(t,s)&&"keyEncoding"!==s&&"valueEncoding"!==s){if("start"===s||"end"===s)throw new n(`The legacy range option '${s}' has been removed`,{code:"LEVEL_LEGACY"});if("encoding"===s)throw new n("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead",{code:"LEVEL_LEGACY"});o.has(s)?r[s]=e.encode(t[s]):r[s]=t[s]}return r.reverse=!!r.reverse,r.limit=Number.isInteger(r.limit)&&r.limit>=0?r.limit:-1,r}},9511:(t,e,r)=>{var n=r(8075)("ArrayBuffer.prototype.byteLength",!0),i=r(4670);t.exports=function(t){return i(t)?n?n(t):t.byteLength:NaN}},7526:(t,e)=>{e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),l=0,h=c>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9148:(t,e,r)=>{const{AbstractLevel:n}=r(5e3),i=r(266),o=r(5372),{fromCallback:s}=r(8100),{Iterator:a}=r(6296),c=r(5222),u=r(3452),l=r(7766),h="level-js-",f=Symbol("idb"),p=Symbol("namePrefix"),d=Symbol("location"),y=Symbol("version"),g=Symbol("store"),m=Symbol("onComplete"),b=Symbol("promise");class v extends n{constructor(t,e,r){if("function"==typeof e||"function"==typeof r)throw new i("The levelup-style callback argument has been removed",{code:"LEVEL_LEGACY"});const{prefix:n,version:o,...s}=e||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},s),"string"!=typeof t)throw new Error("constructor requires a location string argument");this[d]=t,this[p]=null==n?h:n,this[y]=parseInt(o||1,10),this[f]=null}get location(){return this[d]}get namePrefix(){return this[p]}get version(){return this[y]}get db(){return this[f]}get type(){return"browser-level"}_open(t,e){const r=indexedDB.open(this[p]+this[d],this[y]);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this[f]=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this[d])||e.createObjectStore(this[d])}}[g](t){return this[f].transaction([this[d]],t).objectStore(this[d])}[m](t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}}_get(t,e,r){const n=this[g]("readonly");let o;try{o=n.get(t)}catch(t){return this.nextTick(r,t)}this[m](o,(function(t,e){return t?r(t):void 0===e?r(new i("Entry not found",{code:"LEVEL_NOT_FOUND"})):void r(null,c(e))}))}_getMany(t,e,r){const n=this[g]("readonly"),i=t.map((t=>e=>{let r;try{r=n.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:c(t))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(i,16,r)}_del(t,e,r){const n=this[g]("readwrite");let i;try{i=n.delete(t)}catch(t){return this.nextTick(r,t)}this[m](i,r)}_put(t,e,r,n){const i=this[g]("readwrite");let o;try{o=i.put(e,t)}catch(t){return this.nextTick(n,t)}this[m](o,n)}_iterator(t){return new a(this,this[d],t)}_batch(t,e,r){const n=this[g]("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let c;try{c="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return u(this,this[d],r,t,e);try{const t=this[g]("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this.nextTick(e,t)}this[m](n,e)}_close(t){this[f].close(),this.nextTick(t)}}v.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h),r=s(r,b);const n=indexedDB.deleteDatabase(e+t);return n.onsuccess=function(){r()},n.onerror=function(t){r(t)},r[b]},e.Z=v},6296:(t,e,r)=>{const{AbstractIterator:n}=r(5e3),i=r(7766),o=r(5222),s=Symbol("cache"),a=Symbol("finished"),c=Symbol("options"),u=Symbol("currentOptions"),l=Symbol("position"),h=Symbol("location"),f=Symbol("first"),p={};function d(t){"function"==typeof t.commit&&t.commit()}e.Iterator=class extends n{constructor(t,e,r){super(t,r),this[s]=[],this[a]=0===this.limit,this[c]=r,this[u]={...r},this[l]=void 0,this[h]=e,this[f]=!0}_nextv(t,e,r){if(this[f]=!1,this[a])return this.nextTick(r,null,[]);if(this[s].length>0)return t=Math.min(t,this[s].length),this.nextTick(r,null,this[s].splice(0,t));let n;void 0!==this[l]&&(this[c].reverse?(this[u].lt=this[l],this[u].lte=void 0):(this[u].gt=this[l],this[u].gte=void 0));try{n=i(this[u])}catch(t){return this[a]=!0,this.nextTick(r,null,[])}const p=this.db.db.transaction([this[h]],"readonly"),y=p.objectStore(this[h]),g=[];if(this[c].reverse)y[!this[c].values&&y.openKeyCursor?"openKeyCursor":"openCursor"](n,"prev").onsuccess=e=>{const r=e.target.result;if(r){const{key:e,value:n}=r;this[l]=e,g.push([this[c].keys&&void 0!==e?o(e):void 0,this[c].values&&void 0!==n?o(n):void 0]),g.length{if(void 0===e||void 0===r)return;const n=Math.max(e.length,r.length);0===n||t===1/0?this[a]=!0:this[l]=e[n-1],g.length=n;for(let t=0;t{e=t.target.result,i()}:(e=[],this.nextTick(i)),this[c].values?y.getAll(n,t<1/0?t:void 0).onsuccess=t=>{r=t.target.result,i()}:(r=[],this.nextTick(i))}p.onabort=()=>{r(p.error||new Error("aborted by user")),r=null},p.oncomplete=()=>{r(null,g),r=null}}_next(t){if(this[s].length>0){const[e,r]=this[s].shift();this.nextTick(t,null,e,r)}else if(this[a])this.nextTick(t);else{let e=Math.min(100,this.limit-this.count);this[f]&&(this[f]=!1,e=1),this._nextv(e,p,((e,r)=>{if(e)return t(e);this[s]=r,this._next(t)}))}}_all(t,e){this[f]=!1;const r=this[s].splice(0,this[s].length),n=this.limit-this.count-r.length;if(n<=0)return this.nextTick(e,null,r);this._nextv(n,p,((t,n)=>{if(t)return e(t);r.length>0&&(n=r.concat(n)),e(null,n)}))}_seek(t,e){let r;this[f]=!0,this[s]=[],this[a]=!1,this[l]=void 0,this[u]={...this[c]};try{r=i(this[c])}catch(t){return void(this[a]=!0)}null===r||r.includes(t)?this[c].reverse?this[u].lte=t:this[u].gte=t:this[a]=!0}}},3452:t=>{t.exports=function(t,e,r,n,i){if(0===n.limit)return t.nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const c=s.openKeyCursor?"openKeyCursor":"openCursor",u=n.reverse?"prev":"next";s[c](r,u).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{const e=new TextEncoder;t.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):e.encode(t)}},7766:t=>{t.exports=function(t){const e=void 0!==t.gte?t.gte:void 0!==t.gt?t.gt:void 0,r=void 0!==t.lte?t.lte:void 0!==t.lt?t.lt:void 0,n=void 0===t.gte,i=void 0===t.lte;return void 0!==e&&void 0!==r?IDBKeyRange.bound(e,r,n,i):void 0!==e?IDBKeyRange.lowerBound(e,n):void 0!==r?IDBKeyRange.upperBound(r,i):null}},8287:(t,e,r)=>{const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||X(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),a(t<0?0:0|d(t))}function f(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},8075:(t,e,r)=>{var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},487:(t,e,r)=>{var n=r(6743),i=r(453),o=r(6897),s=r(9675),a=i("%Function.prototype.apply%"),c=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||n.call(c,a),l=r(655),h=i("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new s("a function is required");var e=u(n,c,arguments);return o(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(n,a,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},8100:(t,e,r)=>{var n=r(844);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},844:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},9743:(t,e)=>{function r(t){for(var e="",r=0;r0?"F"+s:"D"+r(s)},e.decode=function(t){if("DaN"===t)return NaN;if("FF"===t)return 1/0;if("DD"===t)return-1/0;var e="D"===t[0],n=(e?r(t):t).slice(2).split("M");return Number((e?"-":"")+n[1]+"e"+String(Number(n[0])-500))}},3381:(t,e)=>{var r={"?":"?@","!":"??",'"':"?%"},n={"?@":"?","??":"!","?%":'"'};e.factory=function(t){return{encode:e,decode:function(e){if("A"===e)return null;if("K!"===e)return[];for(var r,i=e.split('"'),o=[[]],s=0,a=i.length,c=0;c{var n=r(9743),i=r(3381);e.flip=function(t){var e=t.toString(),r="";for(var n in e)r+="."==e[n]?".":9-+e[n];return r},e.number=n,e.string={encode:function(t){return/\x00|\x01/.test(t)?"J"+t.replace(/\x01/g,"").replace(/\x00/g,""):"J"+t},decode:function(t){if("J"===t[0])return t.substring(1)}},e.encode=function(t){return e[typeof t].encode(t)},e.decode=function(t){if(""===t)return t;if(!o[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return o[t[0]](t)},e.object=i.factory(e),e.boolean={encode:function(t){return t?"C":"B"},decode:function(t){return"C"===t}},e.undefined={encode:function(t){return"L"},decode:function(){}};var o={A:e.object.decode,B:e.boolean.decode,C:e.boolean.decode,D:e.number.decode,F:e.number.decode,J:e.string.decode,K:e.object.decode,L:e.undefined.decode};e.buffer=!1,e.type="charwise"},41:(t,e,r)=>{var n=r(655),i=r(8068),o=r(9675),s=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new o("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!s&&s(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8452:(t,e,r)=>{var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),c=r(592)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;c?a(t,e,r,!0):a(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{var n=r(453)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},1237:t=>{t.exports=EvalError},9383:t=>{t.exports=Error},9290:t=>{t.exports=RangeError},9538:t=>{t.exports=ReferenceError},8068:t=>{t.exports=SyntaxError},9675:t=>{t.exports=TypeError},5345:t=>{t.exports=URIError},5388:(t,e,r)=>{var n=r(9675);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},5437:(t,e,r)=>{var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(162),o=r(9600),s=r(2120),a=r(3612);t.exports=function(t){if(i(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!o(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(i(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s{t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},228:t=>{var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i{var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,l=d(c,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},2682:(t,e,r)=>{var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n{var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{var n=r(9353);t.exports=Function.prototype.bind||n},453:(t,e,r)=>{var n,i=r(9383),o=r(1237),s=r(9290),a=r(9538),c=r(8068),u=r(9675),l=r(5345),h=Function,f=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(t){p=null}var d=function(){throw new u},y=p?function(){try{return d}catch(t){try{return p(arguments,"callee").get}catch(t){return d}}}():d,g=r(4039)(),m=r(24)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},E="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,w={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":y,"%TypedArray%":E,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var T=b(b(t));w["%Error.prototype%"]=T}var A=function t(e){var r;if("%AsyncFunction%"===e)r=f("async function () {}");else if("%GeneratorFunction%"===e)r=f("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=f("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return w[e]=r,r},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(6743),I=r(9957),_=O.call(Function.call,Array.prototype.concat),L=O.call(Function.apply,Array.prototype.splice),x=O.call(Function.call,String.prototype.replace),N=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,D=function(t,e){var r,n=t;if(I(S,n)&&(n="%"+(r=S[n])[0]+"%"),I(w,n)){var i=w[n];if(i===v&&(i=A(n)),void 0===i&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=N(t,0,1),r=N(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return x(t,C,(function(t,e,r,i){n[n.length]=r?x(i,k,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=D("%"+n+"%",e),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],L(r,_([0,1],l)));for(var h=1,f=!0;h=r.length){var m=p(s,d);s=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:s[d]}else f=I(s,d),s=s[d];f&&!a&&(w[o]=s)}}return s}},5795:(t,e,r)=>{var n=r(453)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},592:(t,e,r)=>{var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},24:t=>{var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof r)}},4039:(t,e,r)=>{var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333:t=>{t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092:(t,e,r)=>{var n=r(1333);t.exports=function(){return n()&&!!Symbol.toStringTag}},9957:(t,e,r)=>{var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);t.exports=o.call(n,i)},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*y}},4670:(t,e,r)=>{var n=r(487),i=r(8075),o=r(453)("%ArrayBuffer%",!0),s=i("ArrayBuffer.prototype.byteLength",!0),a=i("Object.prototype.toString"),c=!!o&&!s&&new o(0).slice,u=!!c&&n(c);t.exports=s||u?function(t){if(!t||"object"!=typeof t)return!1;try{return s?s(t):u(t,0),!0}catch(t){return!1}}:o?function(t){return"[object ArrayBuffer]"===a(t)}:function(t){return!1}},9600:t=>{var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(s(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},2120:(t,e,r)=>{var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(9092)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},4035:(t,e,r)=>{var n,i,o,s,a=r(8075),c=r(9092)();if(c){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var l=a("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{i(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7070:(t,e,r)=>{var n=r(8075)("SharedArrayBuffer.prototype.byteLength",!0);t.exports=n?function(t){if(!t||"object"!=typeof t)return!1;try{return n(t),!0}catch(t){return!1}}:function(t){return!1}},3612:(t,e,r)=>{var n=Object.prototype.toString;if(r(4039)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},5680:(t,e,r)=>{var n=r(5767);t.exports=function(t){return!!n(t)}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},5356:(t,e)=>{e.supports=function(...t){const e=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(e,{snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,getMany:e.getMany||!1,keyIterator:e.keyIterator||!1,valueIterator:e.valueIterator||!1,iteratorNextv:e.iteratorNextv||!1,iteratorAll:e.iteratorAll||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:Object.assign({},e.encodings),events:Object.assign({},e.events),additionalMethods:Object.assign({},e.additionalMethods)})}},6035:(t,e,r)=>{const n=r(266),i=r(4341),{Encoding:o}=r(8110),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=Symbol("formats"),l=Symbol("encodings"),h=new Set(["buffer","view","utf8"]);e.Transcoder=class{constructor(t){if(!Array.isArray(t))throw new TypeError("The first argument 'formats' must be an array");if(!t.every((t=>h.has(t))))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'");this[l]=new Map,this[u]=new Set(t);for(const t in i)try{this.encoding(t)}catch(t){if("LEVEL_ENCODING_NOT_SUPPORTED"!==t.code)throw t}}encodings(){return Array.from(new Set(this[l].values()))}encoding(t){let e=this[l].get(t);if(void 0===e){if("string"==typeof t&&""!==t){if(e=p[t],!e)throw new n(`Encoding '${t}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if("object"!=typeof t||null===t)throw new TypeError("First argument 'encoding' must be a string or object");e=function(t){if(t instanceof o)return t;const e="type"in t&&"string"==typeof t.type?t.type:void 0,r=t.name||e||"anonymous-"+d++;switch(function(t){return"format"in t&&void 0!==t.format?t.format:"buffer"in t&&"boolean"==typeof t.buffer?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}(t)){case"view":return new a({...t,name:r});case"utf8":return new c({...t,name:r});case"buffer":return new s({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}(t)}const{name:r,format:i}=e;if(!this[u].has(i))if(this[u].has("view"))e=e.createViewTranscoder();else if(this[u].has("buffer"))e=e.createBufferTranscoder();else{if(!this[u].has("utf8"))throw new n(`Encoding '${r}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});e=e.createUTF8Transcoder()}for(const n of[t,r,e.name,e.commonName])this[l].set(n,e)}return e}};const f={binary:i.buffer,"utf-8":i.utf8},p={...i,...f};let d=0},8110:(t,e,r)=>{const n=r(266),i=new Set(["buffer","view","utf8"]);e.Encoding=class{constructor(t){if(this.encode=t.encode||this.encode,this.decode=t.decode||this.decode,this.name=t.name||this.name,this.format=t.format||this.format,"function"!=typeof this.encode)throw new TypeError("The 'encode' property must be a function");if("function"!=typeof this.decode)throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),"string"!=typeof this.name||""===this.name)throw new TypeError("The 'name' property must be a string");if("string"!=typeof this.format||!i.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");t.createViewTranscoder&&(this.createViewTranscoder=t.createViewTranscoder),t.createBufferTranscoder&&(this.createBufferTranscoder=t.createBufferTranscoder),t.createUTF8Transcoder&&(this.createUTF8Transcoder=t.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}}},4341:(t,e,r)=>{const{Buffer:n}=r(8287)||{Buffer:{isBuffer:()=>!1}},{textEncoder:i,textDecoder:o}=r(7200)(),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=t=>t;e.utf8=new c({encode:function(t){return n.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?o.decode(t):String(t)},decode:u,name:"utf8",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:function(t){return o.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}}),e.json=new c({encode:JSON.stringify,decode:JSON.parse,name:"json"}),e.buffer=new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:"buffer",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:n.from(String(t),"utf8")},decode:function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}}),e.view=new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:u,name:"view",createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:`${this.name}+buffer`})}}),e.hex=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"}),e.base64=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})},8343:(t,e,r)=>{const{Buffer:n}=r(8287)||{},{Encoding:i}=r(8110),o=r(7200);class s extends i{constructor(t){super({...t,format:"buffer"})}createViewTranscoder(){return new a({encode:this.encode,decode:t=>this.decode(n.from(t.buffer,t.byteOffset,t.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}}class a extends i{constructor(t){super({...t,format:"view"})}createBufferTranscoder(){return new s({encode:t=>{const e=this.encode(t);return n.from(e.buffer,e.byteOffset,e.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}}e.BufferFormat=s,e.ViewFormat=a,e.UTF8Format=class extends i{constructor(t){super({...t,format:"utf8"})}createBufferTranscoder(){return new s({encode:t=>n.from(this.encode(t),"utf8"),decode:t=>this.decode(t.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){const{textEncoder:t,textDecoder:e}=o();return new a({encode:e=>t.encode(this.encode(e)),decode:t=>this.decode(e.decode(t)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}}},7200:t=>{let e=null;t.exports=function(){return null===e&&(e={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),e}},266:t=>{t.exports=class extends Error{constructor(t,e){super(t||""),"object"==typeof e&&null!==e&&(e.code&&(this.code=String(e.code)),e.expected&&(this.expected=!0),e.transient&&(this.transient=!0),e.cause&&(this.cause=e.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},8508:function(t,e){!function(t){const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.ngraminator=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()},Object.defineProperty(t,"__esModule",{value:!0})}(e)},8859:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,E=String.prototype.toUpperCase,w=String.prototype.toLowerCase,T=RegExp.prototype.test,A=Array.prototype.concat,S=Array.prototype.join,O=Array.prototype.slice,I=Math.floor,_="function"==typeof BigInt?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,N="function"==typeof Symbol&&"object"==typeof Symbol.iterator,U="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||T.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-I(-t):I(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var R=r(2634),B=R.custom,F=$(B)?B:null;function P(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function j(t){return v.call(String(t),/"/g,""")}function M(t){return!("[object Array]"!==W(t)||U&&"object"==typeof t&&U in t)}function V(t){return!("[object RegExp]"!==W(t)||U&&"object"==typeof t&&U in t)}function $(t){if(N)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,i,a){var c=n||{};if(z(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!z(c,"customInspect")||c.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var T=String(e);return E?D(e,T):T}if("bigint"==typeof e){var I=String(e)+"n";return E?D(e,I):I}var L=void 0===c.depth?5:c.depth;if(void 0===i&&(i=0),i>=L&&L>0&&"object"==typeof e)return M(e)?"[Array]":"[Object]";var B,G=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=S.call(Array(t.indent+1)," ")}return{base:r,prev:S.call(Array(e+1),r)}}(c,i);if(void 0===a)a=[];else if(K(a,e)>=0)return"[Circular]";function H(e,r,n){if(r&&(a=O.call(a)).push(r),n){var o={depth:c.depth};return z(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),t(e,o,i+1,a)}return t(e,c,i+1,a)}if("function"==typeof e&&!V(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,H);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+S.call(et,", ")+" }":"")}if($(e)){var rt=N?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(e);return"object"!=typeof e||N?rt:Y(rt)}if((B=e)&&"object"==typeof B&&("undefined"!=typeof HTMLElement&&B instanceof HTMLElement||"string"==typeof B.nodeName&&"function"==typeof B.getAttribute)){for(var nt="<"+w.call(String(e.nodeName)),it=e.attributes||[],ot=0;ot"}if(M(e)){if(0===e.length)return"[]";var st=Z(e,H);return G&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+Q(st,G)+"]":"[ "+S.call(st,", ")+" ]"}if(function(t){return!("[object Error]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)){var at=Z(e,H);return"cause"in Error.prototype||!("cause"in e)||C.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+S.call(at,", ")+" }":"{ ["+String(e)+"] "+S.call(A.call("[cause]: "+H(e.cause),at),", ")+" }"}if("object"==typeof e&&y){if(F&&"function"==typeof e[F]&&R)return R(e,{depth:L-i});if("symbol"!==y&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return s&&s.call(e,(function(t,r){ct.push(H(r,e,!0)+" => "+H(t,e))})),J("Map",o.call(e),ct,G)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(H(t,e))})),J("Set",u.call(e),ut,G)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(Number(e)));if(function(t){if(!t||"object"!=typeof t||!_)return!1;try{return _.call(t),!0}catch(t){}return!1}(e))return Y(H(_.call(e)));if(function(t){return!("[object Boolean]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(d.call(e));if(function(t){return!("[object String]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)&&!V(e)){var lt=Z(e,H),ht=k?k(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!ht&&U&&Object(e)===e&&U in e?b.call(W(e),8,-1):ft?"Object":"",dt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+S.call(A.call([],pt||[],ft||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":G?dt+"{"+Q(lt,G)+"}":dt+"{ "+S.call(lt,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return G.call(t,e)}function W(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return P(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,H),"single",e)}function H(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+E.call(e.toString(16))}function Y(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):S.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+S.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=M(t),n=[];if(r){n.length=t.length;for(var i=0;i{var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(3474),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y0)for(var g=0;g{var n=Array.prototype.slice,i=r(3474),o=Object.keys,s=o?function(t){return o(t)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},3474:t=>{var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6578:t=>{t.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},5372:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,c,u,l=!0;function h(t){function e(){r&&r(t,i),r=null}l?n(e):e()}function f(e,r,n){if(i[e]=n,r&&(c=!0),0==--s||r)h(r);else if(!c&&u{var n=r(453)("%Array.prototype.concat%"),i=r(487),o=r(8075)("Array.prototype.slice"),s=r(1333)()&&Symbol.isConcatSpreadable,a=[],c=s?i.apply(n,a):null,u=s?r(4634):null;t.exports=s?function(t){for(var e=0;e{var n=r(8075),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==o(t,e)}}},6897:(t,e,r)=>{var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&s){var l=s(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},8206:(t,e,r)=>{var n=r(5388),i=r(4810),o=r(8075)("String.prototype.replace"),s=/^\s$/.test("᠎"),a=s?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=s?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=i(n(this));return o(o(t,a,""),c,"")}},214:(t,e,r)=>{var n=r(487),i=r(8452),o=r(5388),s=r(8206),a=r(4895),c=r(9377),u=n(a()),l=function(t){return o(t),u(t)};i(l,{getPolyfill:a,implementation:s,shim:c}),t.exports=l},4895:(t,e,r)=>{var n=r(8206);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9377:(t,e,r)=>{var n=r(8452),i=r(4895);t.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1093:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var o=i.slice(n,n+e);o.length===e&&(r=JSON.stringify(o),t[r]=t[r]||[],t[r].push(n))})),t)),{});return Object.keys(r).map((t=>({term:JSON.parse(t),positions:r[t]}))).sort(((t,e)=>t.term[0]>e.term[0]))}},6623:(t,e,r)=>{var n=r(5767),i=r(3432),o=r(5795);function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function c(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r2?arguments[2]:y,l=s.includeSymbols?f:u,h=!!s.immutable;return function t(u){var f=h?d(u,s):u,y={},g=!0,m={node:f,node_:u,path:[].concat(r),parent:n[n.length-1],parents:n,key:r[r.length-1],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(g=!1)},delete:function(t){delete m.parent.node[m.key],t&&(g=!1)},remove:function(t){a(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(g=!1)},keys:null,before:function(t){y.before=t},after:function(t){y.after=t},pre:function(t){y.pre=t},post:function(t){y.post=t},stop:function(){i=!1},block:function(){g=!1}};if(!i)return m;function b(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=l(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t1?arguments[1]:y,this.value=t}function b(t){return new m(t,arguments.length>1?arguments[1]:y)}m.prototype.get=function(t){for(var e=this.value,r=0;e&&r{var n=r(9675),i=r(8075)("TypedArray.prototype.buffer",!0),o=r(5680);t.exports=i||function(t){if(!o(t))throw new n("Not a Typed Array");return t.buffer}},2308:(t,e,r)=>{var n=r(2682),i=r(487),o=r(9209)(),s={},a=r(24)(),c=r(5795),u=Object.defineProperty;if(c){var l=function(t){return t.byteOffset};n(o,(function(t){if("function"==typeof r.g[t]||"object"==typeof r.g[t]){var e=r.g[t].prototype,n=c(e,"byteOffset");if(!n&&a){var o=e.__proto__;n=c(o,"byteOffset")}if(n&&n.get)s[t]=i(n.get);else if(u){var h=new r.g[t](2);(n=c(h,"byteOffset"))&&n.configurable&&u(h,"length",{value:3}),2===h.length&&(s[t]=l)}}}))}var h=r(5680);t.exports=function(t){return!!h(t)&&function(t){var e;return n(s,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},6058:(t,e,r)=>{var n=r(487),i=r(2682),o=r(5795),s=r(24)(),a=r(5680),c=r(6578),u={__proto__:null},l=Object.defineProperty;if(o){var h=function(t){return t.length};i(c,(function(t){var e=r.g[t];if("function"==typeof e||"object"==typeof e){var i=e.prototype,a=o(i,"length");if(!a&&s){var c=i.__proto__;a=o(c,"length")}if(a&&a.get)u["$"+t]=n(a.get);else if(l){var f=new r.g[t](2);(a=o(f,"length"))&&a.configurable&&l(f,"length",{value:3}),2===f.length&&(u["$"+t]=h)}}}))}t.exports=function(t){return!!a(t)&&function(t){var e;return i(u,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},8268:(t,e,r)=>{var n=r(9675),i=r(280),o=r(2282),s=r(5910),a=r(4470),c=r(1752),u=r(2076),l=r(2138),h=r(7196),f=r(4810),p=r(4742),d=r(6419),y=r(7057),g=r(1509),m=r(4372),b=r(2308);t.exports=function(t,e){var r=this;g(r,"SEQ-CST");var v,E=r.length,w=h(t);v=w===-1/0?0:w<0?a(E+w,0):c(w,E);var T,A=void 0===e?E:h(e);T=A===-1/0?0:A<0?a(E+A,0):c(A,E);var S=a(T-v,0),O=y(r,[S]);if(S>0){if(s(m(r)))throw new n("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");if(d(r)===d(O))for(var I=m(r),_=m(O),L=p(r),x=v*L+b(r),N=b(O),U=N+S*L;N{var n=r(8452),i=r(487),o=r(8268),s=r(2521),a=r(8599),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},2521:(t,e,r)=>{var n=r(8268);t.exports=function(){return"function"==typeof Uint8Array&&Uint8Array.prototype.slice||n}},8599:(t,e,r)=>{var n=r(8452),i=r(6763),o=r(2521);t.exports=function(){if("function"==typeof Uint8Array){var t=o(),e=i(Uint8Array.prototype);n(e,{slice:t},{slice:function(){return e.slice!==t}})}return t}},5767:(t,e,r)=>{var n=r(2682),i=r(9209),o=r(487),s=r(8075),a=r(5795),c=s("Object.prototype.toString"),u=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),f=s("String.prototype.slice"),p=Object.getPrototypeOf,d=s("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(y,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(y,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},2634:()=>{},9209:(t,e,r)=>{var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{var n=r(9675),i=r(5910),o=r(4670),s=r(7070),a=r(9511);t.exports=function(t,e){var r=s(t);if(!o(t)&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(i(t))throw new n("Assertion failed: `arrayBuffer` must not be detached");return a(t)}},9969:(t,e,r)=>{var n=r(453)("%BigInt%",!0),i=r(9290),o=r(9675),s=n&&n(0);t.exports=function(t,e){if("bigint"!=typeof t||"bigint"!=typeof e)throw new o("Assertion failed: `n` and `d` arguments must be BigInts");if(e===s)throw new i("Division by zero");return t===s?s:t%e}},893:(t,e,r)=>{var n=r(9675),i=r(5701),o=r(4769),s=r(7030),a=r(8131),c=r(3400),u=r(2875),l=r(259),h=r(7730);t.exports=function(t,e,r){if("Object"!==h(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var f=i(r)?r:l(r);if(!i(f))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(a,u,s,t,e,f)}},7030:(t,e,r)=>{var n=r(9675),i=r(5701),o=r(2997);t.exports=function(t){if(void 0!==t&&!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return o(t)}},280:(t,e,r)=>{var n=r(9675),i=r(8859),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!o(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+i(e));return t[e]}},2282:(t,e,r)=>{var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(8075)("Array.prototype.slice"),c=r(1087),u=r(5910),l=r(6167),h=r(4670),f=r(7070),p=r(4399),d=r(4097),y=r(5100);t.exports=function(t,e,r,n,g){var m=f(t);if(!h(t)&&!m)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!c(e))throw new o("Assertion failed: `byteIndex` must be an integer");if("string"!=typeof r||"number"!=typeof d.size["$"+r])throw new o("Assertion failed: `type` must be a Typed Array element type");if("boolean"!=typeof n)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==g&&"UNORDERED"!==g)throw new o("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&"boolean"!=typeof arguments[5])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: `arrayBuffer` is detached");if(e<0)throw new o("Assertion failed: `byteIndex` must be non-negative");var b,v=d.size["$"+r];if(!v)throw new o('Assertion failed: `type` must be one of "INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"');if(m)throw new i("SharedArrayBuffer is not supported by this implementation");b=a(new s(t,e),0,v);var E=arguments.length>5?arguments[5]:"little"===y,w=E?a(p([0,0,0,0,0,0,0,0],b),-v):a(p(b,[0,0,0,0,0,0,0,0]),0,v);return l(r,w,E)}},2491:(t,e,r)=>{var n=r(9675),i=r(9957),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");return i(t,e)}},533:(t,e,r)=>{t.exports=r(1412)},7881:t=>{t.exports=function(t){return"BIGUINT64"===t||"BIGINT64"===t}},6966:(t,e,r)=>{t.exports=r(9600)},4528:(t,e,r)=>{var n=r(1376)("%Reflect.construct%",!0),i=r(893);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},8131:(t,e,r)=>{var n=r(9675),i=r(9957),o=r(5701);t.exports=function(t){if(void 0===t)return!1;if(!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!i(t,"[[Value]]")&&!i(t,"[[Writable]]"))}},5910:(t,e,r)=>{var n=r(9675),i=r(9511),o=r(9209)(),s=r(8075),a=r(4670),c=r(7070),u=s("SharedArrayBuffer.prototype.byteLength",!0);t.exports=function(t){var e=c(t);if(!a(t)&&!e)throw new n("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if(0===(e?u:i)(t))try{new r.g[o[0]](t)}catch(t){return!!t&&"TypeError"===t.name}return!1}},6575:(t,e,r)=>{var n=r(9675),i=r(8075),o=i("%ArrayBuffer.prototype.resizable%",!0),s=i("%SharedArrayBuffer.prototype.growable%",!0),a=r(4670),c=r(7070);t.exports=function(t){var e=a(t),r=c(t);if(!e&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return e&&o?!o(t):!r||!s||!s(t)}},3400:t=>{t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},5291:(t,e,r)=>{var n=r(9675),i=r(5910),o=r(4742),s=r(9346),a=r(4372),c=r(2308),u=r(6058);t.exports=function(t){if(!s(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var e=t["[[Object]]"],r=t["[[CachedBufferByteLength]]"];if(i(a(e))&&"DETACHED"!==r)throw new n("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if("DETACHED"===r)return!0;var l,h=c(e),f=u(e);return l="AUTO"===f?r:h+f*o(e),h>r||l>r}},9373:t=>{t.exports=function(t){return"UINT8"===t||"UINT8C"===t||"UINT16"===t||"UINT32"===t||"BIGUINT64"===t}},6681:(t,e,r)=>{var n=r(9675),i=r(7149),o=r(5910),s=r(5680),a=r(4372);t.exports=function(t,e){if(!s(t))throw new n("Assertion failed: `obj` must be a Typed Array");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var r=a(t);return{"[[Object]]":t,"[[CachedBufferByteLength]]":o(r)?"DETACHED":i(r,e)}}},5015:(t,e,r)=>{var n=r(9675),i=r(2491),o=r(3446),s=r(9887),a=r(3557),c=r(2475),u=r(7088),l=r(172),h=r(4770),f=r(6039),p=r(9308),d=r(2779),y=r(8894),g=r(4751),m=r(1189),b={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8},v={__proto__:null,INT8:u,UINT8:f,UINT8C:p,INT16:a,UINT16:l,INT32:c,UINT32:h,BIGINT64:o,BIGUINT64:s};t.exports=function(t,e,r){if("string"!=typeof t||!i(b,t))throw new n("Assertion failed: `type` must be a TypedArray element type: "+m(b));if("number"!=typeof e&&"bigint"!=typeof e)throw new n("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof r)throw new n("Assertion failed: `isLittleEndian` must be a Boolean");if("FLOAT32"===t)return d(e,r);if("FLOAT64"===t)return y(e,r);var o=b[t],s=(0,v[t])(e);return g(s,o,r)}},6167:(t,e,r)=>{var n=r(453),i=r(8075),o=r(9290),s=r(8068),a=r(9675),c=n("%BigInt%",!0),u=r(2491),l=r(533),h=r(7881),f=r(9373),p=r(4915),d=r(8968),y=r(6570),g=r(4138),m=r(2158),b=i("Array.prototype.reverse"),v=i("Array.prototype.slice"),E=r(1189),w={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8};t.exports=function(t,e,r){if(!u(w,t))throw new a("Assertion failed: `type` must be a TypedArray element type: "+E(w));if(!l(e)||!g(e,m))throw new a("Assertion failed: `rawBytes` must be an Array of bytes");if("boolean"!=typeof r)throw new a("Assertion failed: `isLittleEndian` must be a Boolean");var n=w[t];if(e.length!==n)throw new o("Assertion failed: `rawBytes` must have a length of "+n+" for type "+t);var i=h(t);if(i&&!c)throw new s("this environment does not support BigInts");return e=v(e,0,n),r||b(e),"FLOAT32"===t?p(e):"FLOAT64"===t?d(e):y(e,n,f(t),i)}},2875:(t,e,r)=>{var n=r(8756);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},2076:(t,e,r)=>{var n=r(9675),i=r(3400),o=r(2875),s=r(7730),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof c)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},2138:(t,e,r)=>{var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(1087),c=r(7881),u=r(5910),l=r(5015),h=r(4670),f=r(7070),p=r(9957),d=r(4097),y=r(5100),g=r(3795);t.exports=function(t,e,r,n,m,b){var v=f(t);if(!h(t)&&!v)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!a(e)||e<0)throw new o("Assertion failed: `byteIndex` must be a non-negative integer");if("string"!=typeof r||!p(d.size,"$"+r))throw new o("Assertion failed: `type` must be a Typed Array Element Type");if("number"!=typeof n&&"bigint"!=typeof n)throw new o("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof m)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==b&&"UNORDERED"!==b&&"INIT"!==b)throw new o('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: ArrayBuffer is detached");if(c(r)?"bigint"!=typeof n:"number"!=typeof n)throw new o("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var E=d.size["$"+r],w=l(r,n,arguments.length>6?arguments[6]:"little"===y);if(v)throw new i("SharedArrayBuffer is not supported by this implementation");var T=new s(t,e,E);g(w,(function(t,e){T[e]=t}))}},7732:(t,e,r)=>{var n=r(453)("%Symbol.species%",!0),i=r(9675),o=r(4528),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var a=n?r[n]:void 0;if(null==a)return e;if(o(a))return a;throw new i("no constructor found")}},9693:(t,e,r)=>{var n=r(453)("%BigInt%",!0),i=r(9675),o=r(8068);t.exports=function(t){if("string"!=typeof t)throw new i("`argument` must be a string");if(!n)throw new o("BigInts are not supported in this environment");try{return n(t)}catch(t){return}}},8679:(t,e,r)=>{var n=r(453),i=n("%Number%"),o=n("%RegExp%"),s=r(9675),a=n("%parseInt%"),c=r(8075),u=r(9721),l=c("String.prototype.slice"),h=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),y=r(214);t.exports=function t(e){if("string"!=typeof e)throw new s("Assertion failed: `argument` is not a String");if(h(e))return i(a(l(e,2),2));if(f(e))return i(a(l(e,2),8));if(d(e)||p(e))return NaN;var r=y(e);return r!==e?t(r):i(e)}},2964:(t,e,r)=>{var n=r(453),i=n("%BigInt%",!0),o=n("%Number%"),s=r(9675),a=r(8068),c=r(9693),u=r(866);t.exports=function(t){if(!i)throw new a("BigInts are not supported in this environment");var e=u(t,o);if(null==e)throw new s("Cannot convert null or undefined to a BigInt");if("boolean"==typeof e)return i(e?1:0);if("number"==typeof e)throw new s("Cannot convert a Number value to a BigInt");if("string"==typeof e){var r=c(e);if(void 0===r)throw new s("Failed to parse String to BigInt");return r}if("symbol"==typeof e)throw new s("Cannot convert a Symbol value to a BigInt");if("bigint"!=typeof e)throw new a("Assertion failed: unknown primitive type");return e}},3446:(t,e,r)=>{var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,31)),l=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t),r=c(a,e,l);return r>=u?r-l:r}},9887:(t,e,r)=>{var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t);return c(a,e,u)}},4323:t=>{t.exports=function(t){return!!t}},3557:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return a>=32768?a-65536:a}},2475:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046),a=4294967296;t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),c=n(r,a),u=c>=2147483648?c-a:c;return 0===u?0:u}},7088:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,256);return a>=128?a-256:a}},7196:(t,e,r)=>{var n=r(8410),i=r(3384),o=r(8756),s=r(5046);t.exports=function(t){var e=n(t);return o(e)||0===e?0:s(e)?i(e):e}},8410:(t,e,r)=>{var n=r(453),i=r(9675),o=n("%Number%"),s=r(6600),a=r(866),c=r(8679);t.exports=function(t){var e=s(t)?t:a(t,o);if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):o(e)}},866:(t,e,r)=>{var n=r(5437);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},259:(t,e,r)=>{var n=r(9957),i=r(9675),o=r(7730),s=r(4323),a=r(6966);t.exports=function(t){if("Object"!==o(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!a(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},4810:(t,e,r)=>{var n=r(453)("%String%"),i=r(9675);t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return n(t)}},172:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return 0===a?0:a}},4770:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,4294967296);return 0===a?0:a}},6039:(t,e,r)=>{var n=r(5046),i=r(4224),o=r(8410),s=r(3384);t.exports=function(t){var e=o(t);if(!n(e)||0===e)return 0;var r=s(e);return i(r,256)}},9308:(t,e,r)=>{var n=r(9719),i=r(8410),o=r(5986),s=r(8756);t.exports=function(t){var e=i(t);if(s(e))return 0;var r=n(e,0,255),a=o(r);return ra+.5?a+1:a%2==0?a:a+1}},7730:(t,e,r)=>{var n=r(2439);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},9531:(t,e,r)=>{var n=r(8068),i=r(9675),o=r(533),s=r(4528),a=r(5291),c=r(9271),u=r(1509),l=r(9209)();t.exports=function(t,e){if(!s(t))throw new i("Assertion failed: `constructor` must be a constructor");if(!o(e))throw new i("Assertion failed: `argumentList` must be a List");if(0===l.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r;r=0===e.length?new t:1===e.length?new t(e[0]):2===e.length?new t(e[0],e[1]):new t(e[0],e[1],e[2]);var h=u(r,"SEQ-CST");if(1===e.length&&"number"==typeof e[0]){if(a(h))throw new i("new Typed Array is out of bounds");if(c(h){var n=r(8068),i=r(9675),o=r(1087),s=r(5767),a=r(4097);t.exports=function(t){var e=s(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=a.size["$"+a.name["$"+e]];if(!o(r)||r<0)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},6419:(t,e,r)=>{var n=r(8068),i=r(9675),o=r(5767),s=r(4097);t.exports=function(t){var e=o(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=s.name["$"+e];if("string"!=typeof r)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},9271:(t,e,r)=>{var n=r(9675),i=r(5986),o=r(6575),s=r(5291),a=r(4742),c=r(9346),u=r(4372),l=r(2308),h=r(6058);t.exports=function(t){if(!c(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(s(t))throw new n("Assertion failed: `taRecord` is out of bounds");var e=t["[[Object]]"],r=h(e);if("AUTO"!==r)return r;if(o(u(e)))throw new n("Assertion failed: array buffer is not fixed length");var f=l(e),p=a(e),d=t["[[CachedBufferByteLength]]"];if("DETACHED"===d)throw new n("Assertion failed: typed array is detached");return i((d-f)/p)}},7057:(t,e,r)=>{var n=r(8068),i=r(9675),o=r(5767),s=r(9209)(),a=r(533),c=r(7732),u=r(9531),l=r(2697);t.exports=function(t,e){if(0===s.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r=o(t);if(!r)throw new i("Assertion failed: exemplar must be a TypedArray");if(!a(e))throw new i("Assertion failed: `argumentList` must be a List");var h=l(r);if("function"!=typeof h)throw new n("Assertion failed: `constructor` of `exemplar` ("+r+") must exist. Please report this!");var f=c(t,h);return u(f,e)}},1509:(t,e,r)=>{var n=r(9675),i=r(5291),o=r(6681),s=r(7730),a=r(5680);t.exports=function(t,e){if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!a(t))throw new n("Assertion failed: `O` must be a Typed Array");var r=o(t,e);if(i(r))throw new n("`O` must be in-bounds and backed by a non-detached buffer");return r}},9719:(t,e,r)=>{var n=r(453),i=r(9675),o=n("%Math.max%"),s=n("%Math.min%");t.exports=function(t,e,r){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof r||!(e<=r))throw new i("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return s(o(e,t),r)}},5986:t=>{var e=Math.floor;t.exports=function(t){return"bigint"==typeof t?t:e(t)}},4470:(t,e,r)=>{var n=r(453);t.exports=n("%Math.max%")},1752:(t,e,r)=>{var n=r(453);t.exports=n("%Math.min%")},4224:(t,e,r)=>{var n=r(113);t.exports=function(t,e){return n(t,e)}},4097:t=>{t.exports={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8}}},3384:(t,e,r)=>{var n=r(5986),i=r(9675);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2439:t=>{t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},1376:(t,e,r)=>{t.exports=r(453)},4769:(t,e,r)=>{var n=r(592),i=r(655),o=n.hasArrayLengthDefineBug(),s=o&&r(1412),a=r(8075)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,c,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(c in n&&a(n,c)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[c]=l,e(n[c],l)}return o&&"length"===c&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,c,r(u)),!0)}},1412:(t,e,r)=>{var n=r(453)("%Array%"),i=!n.isArray&&r(8075)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4915:(t,e,r)=>{var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[3]?-1:1,r=(127&t[3])<<1|t[2]>>7,i=(127&t[2])<<16|t[1]<<8|t[0];return 0===r&&0===i?1===e?0:-0:255===r&&0===i?1===e?1/0:-1/0:255===r&&0!==i?NaN:-127==(r-=127)?e*i*n(2,-149):e*(1+i*n(2,-23))*n(2,r)}},8968:(t,e,r)=>{var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[7]?-1:1,r=(127&t[7])<<4|(240&t[6])>>4,i=281474976710656*(15&t[6])+1099511627776*t[5]+4294967296*t[4]+16777216*t[3]+65536*t[2]+256*t[1]+t[0];return 0===r&&0===i?0*e:2047===r&&0!==i?NaN:2047===r&&0===i?e*(1/0):-1023==(r-=1023)?e*i*5e-324:e*(1+i/4503599627370496)*n(2,r)}},6570:(t,e,r)=>{var n=r(453),i=n("%Math.pow%"),o=n("%Number%"),s=n("%BigInt%",!0);t.exports=function(t,e,r,n){for(var a=n?s:o,c=a(0),u=0;u{var n=r(453),i=n("%Uint8Array%",!0),o=n("%Uint32Array%",!0),s=r(4372),a=o&&new o([305419896]),c=a&&new i(s(a));t.exports=c?120===c[0]?"little":18===c[0]?"big":52===c[0]?"mixed":"unknown":"indeterminate"},4138:t=>{t.exports=function(t,e){for(var r=0;r{t.exports=function(t,e){for(var r=0;r{var e=1075;t.exports=function(t){var r="";if(0===t)return r;for(var n,i=e,o=0;o=1?(t=n-1,r+="1",i===e&&(i=o)):(t=n,r+="0"),1===n||o-i>54)return r;return r}},2997:t=>{t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},6763:(t,e,r)=>{var n=r(453)("%Object.getPrototypeOf%",!0),i=r(24)();t.exports=n||(i?function(t){return t.__proto__}:null)},8213:(t,e,r)=>{var n=r(453)("%Math.floor%");t.exports=function(t){for(var e,r="";t>0;)r=(e=t/2)===(t=n(e))?"0"+r:"1"+r;return r}},4751:(t,e,r)=>{var n=r(453),i=n("%Number%"),o=n("%BigInt%",!0);t.exports=function(t,e,r){var n="bigint"==typeof t?o:i;t<0&&(t>>>=0);for(var s=[],a=0;a>=n(8);return s}},2158:t=>{t.exports=function(t){return"number"==typeof t&&t>=0&&t<=255&&(0|t)===t}},5046:(t,e,r)=>{var n=r(8756);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1087:(t,e,r)=>{var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=r(8756),a=r(5046);t.exports=function(t){if("number"!=typeof t||s(t)||!a(t))return!1;var e=i(t);return o(e)===e}},8756:t=>{t.exports=Number.isNaN||function(t){return t!=t}},3508:t=>{t.exports=function(t){return 0===t&&1/t==-1/0}},6600:t=>{t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},113:t=>{var e=Math.floor;t.exports=function(t,r){var n=t%r;return e(n>=0?n:n+r)}},122:t=>{t.exports=function(t,e,r){var n=t(e,r);return n>=0?n:n+r}},5701:(t,e,r)=>{var n=r(9675),i=r(9957),o={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(i(t,e)&&!o[e])return!1;var r=i(t,"[[Value]]")||i(t,"[[Writable]]"),s=i(t,"[[Get]]")||i(t,"[[Set]]");if(r&&s)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}},9346:(t,e,r)=>{var n=r(9957),i=r(5680),o=r(1087);t.exports=function(t){return!!t&&"object"==typeof t&&n(t,"[[Object]]")&&n(t,"[[CachedBufferByteLength]]")&&(o(t["[[CachedBufferByteLength]]"])&&t["[[CachedBufferByteLength]]"]>=0||"DETACHED"===t["[[CachedBufferByteLength]]"])&&i(t["[[Object]]"])}},2697:(t,e,r)=>{var n=r(453),i={__proto__:null,$Int8Array:n("%Int8Array%",!0),$Uint8Array:n("%Uint8Array%",!0),$Uint8ClampedArray:n("%Uint8ClampedArray%",!0),$Int16Array:n("%Int16Array%",!0),$Uint16Array:n("%Uint16Array%",!0),$Int32Array:n("%Int32Array%",!0),$Uint32Array:n("%Uint32Array%",!0),$BigInt64Array:n("%BigInt64Array%",!0),$BigUint64Array:n("%BigUint64Array%",!0),$Float32Array:n("%Float32Array%",!0),$Float64Array:n("%Float64Array%",!0)};t.exports=function(t){return i["$"+t]}},2779:(t,e,r)=>{var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=n("%Math.pow%"),a=r(5046),c=r(8756),u=r(3508);t.exports=function(t,e){if(c(t))return e?[0,0,192,127]:[127,192,0,0];var r;if(0===t)return r=u(t)?128:0,e?[0,0,0,r]:[r,0,0,0];if(i(t)>34028234663852886e22||!a(t))return r=t<0?255:127,e?[0,0,128,r]:[r,128,0,0];var n=t<0?1:0;t=i(t);for(var l=0;t>=2;)l+=1,t/=2;for(;t<1;)l-=1,t*=2;var h=t-1;h*=s(2,23)+.5,l+=127;var f=n<<31|(l<<=23)|(h=o(h)),p=255&f,d=255&(f>>=8),y=255&(f>>=8),g=255&(f>>=8);return e?[p,d,y,g]:[g,y,d,p]}},8894:(t,e,r)=>{var n=r(453),i=n("%parseInt%"),o=n("%Math.abs%"),s=n("%Math.floor%"),a=r(8075),c=a("String.prototype.indexOf"),u=a("String.prototype.slice"),l=r(9154),h=r(8213),f=r(3508),p="11111111111",d="00000000000",y=d+d+d+d+"0000000";t.exports=function(t,e){var r,n,a=t<0||f(t)?"1":"0";if(isNaN(t))r=p,n="1"+y;else if(isFinite(t))if(0===t)r=d,n="0"+y;else{t=o(t);var g,m=s(t),b=h(m),v=l(t-m);if(b)r=b.length-1;else{var E=c(v,"1");E>-1&&(g=E+1),r=-g}n=b+v,r<0?(r<=-1023&&(g=1022),n=u(n,g)):n=u(n,1),r=u(d+h(r+1023),-11),n=u(n+y+"0",0,52)}else r=p,n="0"+y;for(var w=a+r+n,T=[],A=0;A<8;A++)T[e?8-A-1:A]=i(u(w,8*A,8*(A+1)),2);return T}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};r.d(n,{d:()=>tt,UI:()=>et});var i=r(1093),o=r(8508);const s=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),a=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],c=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([t,e,r])=>{const{fields:n,values:i}=r.replace,o=()=>t.reduce(((t,e)=>[e,...t,...i[e]||[]]),[]);return i?n?n.includes(e)?Promise.resolve([o(),e,r]):Promise.resolve([t,e,r]):Promise.resolve([o(),e,r]):Promise.resolve([t,e,r])},l=([t,e,r])=>{let{fields:n,lengths:i,join:s=" "}=r.ngrams;return n||(n=[e]),i&&n.includes(e)?[(0,o.ngraminator)(t.filter((t=>null!==t)),i).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},h=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],f=([t,e,r])=>{const n=i(t),o=n.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([n.map((t=>[t.term[0],(t.positions.length/o).toFixed(2)])).sort(),e,r])},p={SPLIT:s,SKIP:a,LOWCASE:c,REPLACE:u,NGRAMS:l,STOPWORDS:h,SCORE_TERM_FREQUENCY:f,SPY:([t,e,r])=>(console.log("----------------"),console.log("field ->"),console.log(e),console.log("tokens ->"),console.log(t),console.log("----------------"),Promise.resolve([t,e,r]))},d=(t,e,r)=>s([t,e,r]).then(a).then(c).then(u).then(l).then(h).then(f).then((([t,e,r])=>t));var y=r(9148),g=r(7007),m=r(9901);function b(t,e){const r=t=>"string"==typeof t,n=async(r,n=t=>new Promise((e=>e(t))))=>new Promise((async(o,a)=>{const c=t=>void 0===t?o(void 0):t instanceof Promise?o(t):void 0;try{c(r),r=e.parse(r),r=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(r),c(r=await(e=>void 0===e?s(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?i(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(r)),c(r=await n(r))}catch(t){return a(t)}return Array.isArray(r)?o(r):o(s(r))})),i=async(t,e)=>Promise.all(t.map((t=>n(t,e)))).then((t=>{const e=t.flat(1/0).reduce(((t,e)=>(e&&t.set(e._id,[...t.get(e._id)||[],e._match]),t)),new Map);return{sumTokensMinusStopwords:t.filter((t=>t)).length,union:Array.from(e.keys()).map((t=>({_id:t,_match:e.get(t)})))}})),o=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(m.HI),["IDX",t,n]},s=t=>new Promise((e=>{if(void 0===t)return e(void 0);const r=new Map;Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0),limit:t.LIMIT,reverse:t.REVERSE}).then((t=>t.forEach((t=>t.value.forEach((e=>r.set(e,[...r.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})])))))))))).then((()=>e(Array.from(r.keys()).map((t=>({_id:t,_match:r.get(t)}))))))})),a=(t,e,r=!0)=>e?0===e.length?[]:(e=new Set(e.map((t=>t._id))),t.map((t=>Object.assign(t,{_id:[...new Set([...t._id].filter((t=>e.has(t))))]}))).filter((t=>!r||t._id.length))):t,c=t=>(t=e.parse(t),n(t).then((e=>({_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE,...t})))),u=e=>t.db.iterator(e).all().then((t=>t.map((([t,e])=>({key:t,value:e}))))),l=(t,r)=>s({...e.parse(t),LIMIT:1,REVERSE:r}).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),h=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>{let r=t.VALUE.LTE;void 0!==t.VALUE.LTE&&"number"!=typeof t.VALUE.LTE&&(r+="○");let n=t.VALUE.GTE;return t.VALUE.GTE&&"number"!=typeof t.VALUE.GTE&&(n+=" "),u({gte:o(e,n),lte:o(e,r,!0),keys:!0,values:!1}).then((t=>t.map((({key:t})=>({FIELD:t[1],VALUE:t[2][0]})))))}))).then((t=>t.flat()))),f=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0)}).then((t=>t.map((t=>({FIELD:t.key[1],VALUE:t.key[2][0],_id:t.value})))))))).then((t=>t.flat()))),p=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});return{AGGREGATE:({BUCKETS:t,FACETS:e,QUERY:r})=>Promise.all([t,e,r]).then((([t=[],e=[],r=[]])=>({BUCKETS:a(t.flat(),r),FACETS:a(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:a,BUCKET:c,BUCKETS:(...t)=>Promise.all(t.map(c)),CREATED:()=>t.db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(h):[h({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),EXIST:(...e)=>Promise.all(e.map((e=>t.db.get([t.docExistsSpace,e]).catch((t=>null))))).then((t=>t.reduce(((t,r,n)=>(null!=r&&t.push(e[n]),t)),[]))),EXPORT:u,FACETS:(...t)=>Promise.all(t.length?t.map(f):[f({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:()=>u({gte:["FIELD",m.LO],lte:["FIELD",m.HI]}).then((t=>t.map((t=>t.key[1])))),GET:n,INTERSECTION:(t,e)=>i(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t.db.get(["~LAST_UPDATED"]),MAX:t=>l(t,!0),MIN:l,OBJECT:e=>Promise.all(e.map((e=>t.db.get(["DOC",e._id]).catch((t=>null))))).then((t=>e.map(((e,r)=>(e._object=t[r],e))))),SET_SUBTRACTION:(t,e)=>Promise.all([r(t)?n(t):t,r(e)?n(e):e]).then((([t,e])=>t.filter((t=>-1===e.map((t=>t._id)).indexOf(t._id))))),SORT:t=>new Promise((e=>e(t.sort(((t,e)=>p.compare(t._id,e._id)))))),UNION:i}}m.LO=null,m.HI=void 0;var v=r(6623);const E=null,w=void 0;class T{availableFields=[];#t;constructor(t){this.#t=t}setAvailableFields=t=>{this.availableFields=t};#e=t=>{const e=t=>this.#t||"string"!=typeof t?t:t.toLowerCase();return{FIELD:t.FIELD.map(e),VALUE:{GTE:e(t.VALUE.GTE),LTE:e(t.VALUE.LTE)}}};parse(t){if(Array.isArray(t))throw new Error("token cannot be Array");if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return this.#e({FIELD:this.availableFields,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return this.#e({FIELD:[e],VALUE:{GTE:r.join(":"),LTE:r.join(":")}})}return"number"==typeof t&&(t={VALUE:{GTE:t,LTE:t}}),null===t.VALUE&&(t.VALUE={GTE:null,LTE:null}),"string"!=typeof t.VALUE&&"number"!=typeof t.VALUE||(t.VALUE={GTE:t.VALUE,LTE:t.VALUE}),void 0!==t.VALUE&&Object.keys(t.VALUE).length||(t.VALUE={GTE:E,LTE:w}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=E),void 0===t.VALUE.LTE&&(t.VALUE.LTE=w),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?this.#e({FIELD:this.availableFields,...t}):(t.FIELD=[t.FIELD].flat(),this.#e(t))}}class A{constructor(t={}){t={caseSensitive:!0,isLeaf:t=>"string"==typeof t||"number"==typeof t,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC",db:new t.Level(t.name,{keyEncoding:m,valueEncoding:"json"}),...t};const e=new T(t.caseSensitive),r=new g,n=b(t,e),i=function(t,e,r){let n=0;const i=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const n=[];return v(e._object).forEach((function(e){const i=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"!==i&&!r.doNotIndexField.filter((t=>i.startsWith(t))).length&&t.isLeaf(this.node)){if(!t.stopwords.includes(this.node)){const e=JSON.stringify([i,[this.node].flat(1/0).map((e=>"string"!=typeof e||t.caseSensitive?e:e.toLowerCase()))]);n.push(t.caseSensitive?e:e.toLowerCase())}this.update(this.node,!0)}})),{_id:e._id,keys:n}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(e,r,s,a,c)=>new Promise((u=>{e=e.map((t=>{var e;return t._id=void 0===(e=t._id)?++n:"string"==typeof e||"number"==typeof e?e:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),b(t).EXIST(...e.map((t=>t._id))).then((t=>((t,e,r)=>{const n=Object.keys(t);return Promise.all(n.map((t=>["IDX",...JSON.parse(t)])).map((t=>new Promise(((r,n)=>e.get(t).then(r).catch((t=>r([])))))))).then((e=>e.map(((e,i)=>{const o=new Set(e),s=new Set(t[n[i]]);if("put"===r)return{key:["IDX",...JSON.parse(n[i])],type:r,value:[...new Set([...o,...s])].sort()};if("del"===r){const t=[...new Set([...o].filter((t=>!s.has(t))))];return{key:["IDX",...JSON.parse(n[i])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>i(t,e))).reduce(o,{}))(e,c),r,s).then((n=>r.batch(n.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(e,s):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(n)),(r=>u(e.map((e=>{let r;return"put"===s?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===s&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:a,status:r}})))))))))})),a=()=>(new Date).toISOString(),c=e=>t.db.put(["~LAST_UPDATED"],a()).then((()=>e));return{DELETE:e=>b(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t.db,"del","DELETE",{}))).then(c),IMPORT:r=>t.db.clear().then((()=>t.db.batch(r.map((t=>Object.assign(t,{type:"put"})))))).then((()=>b(t).FIELDS())).then((t=>e.setAvailableFields(t))),PUT:(r,n={})=>s(r.map((t=>({_id:t._id,_object:t}))),t.db,"put","PUT",n).then(c).then((async r=>(e.setAvailableFields(await b(t).FIELDS()),r))),TIMESTAMP:()=>t.db.get(["~CREATED"]).then().catch((e=>t.db.put(["~CREATED"],a()).then(c).then((()=>r.emit("ready"))))),TIMESTAMP_LAST_UPDATED:c}}(t,e,r);i.TIMESTAMP(),this.AGGREGATION_FILTER=n.AGGREGATION_FILTER,this.AND=(t,e)=>n.INTERSECTION(t,e).then(this.flattenMatchArrayInResults),this.BUCKET=n.BUCKET,this.BUCKETS=n.BUCKETS,this.CREATED=n.CREATED,this.DELETE=i.DELETE,this.DISTINCT=n.DISTINCT,this.EVENTS=r,this.EXIST=n.EXIST,this.EXPORT=n.EXPORT,this.FACETS=n.FACETS,this.FIELDS=n.FIELDS,this.GET=(t,e)=>n.GET(t,e).then(this.flattenMatchArrayInResults),this.IMPORT=i.IMPORT,this.LAST_UPDATED=n.LAST_UPDATED,this.MAX=n.MAX,this.MIN=n.MIN,this.NOT=(...t)=>n.SET_SUBTRACTION(...t).then(this.flattenMatchArrayInResults),this.OBJECT=n.OBJECT,this.OR=(t,e)=>n.UNION(t,e).then((t=>t.union)).then(this.flattenMatchArrayInResults),this.PUT=i.PUT,this.SORT=n.SORT,this.STORE=t.db,this.TIMESTAMP_LAST_UPDATED=i.TIMESTAMP_LAST_UPDATED,this.TOKEN_PARSER=e}flattenMatchArrayInResults(t){return void 0===t?void 0:t.map((t=>(t._match=t._match.flat(1/0).map((t=>"string"==typeof t?JSON.parse(t):t)).sort(((t,e)=>t.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t)))}}class S{constructor(t={}){return new A({Level:y.Z,...t})}}var O=r(5606);const I="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,_=new Set,L="object"==typeof O&&O?O:{},x=(t,e,r,n)=>{"function"==typeof L.emitWarning?L.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)};let N=globalThis.AbortController,U=globalThis.AbortSignal;if(void 0===N){U=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},N=class{constructor(){e()}signal=new U;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==L.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,x("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const C=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),k=t=>C(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?D:null:null;class D extends Array{constructor(t){super(t),this.fill(0)}}class R{heap;length;static#r=!1;static create(t){const e=k(t);if(!e)return[];R.#r=!0;const r=new R(t,e);return R.#r=!1,r}constructor(t,e){if(!R.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class B{#n;#i;#o;#s;#a;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#l;#h;#f;#p;#d;#y;#g;#m;#b;#v;#E;#w;#T;#A;#S;#O;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#T,sizes:t.#E,keyMap:t.#h,keyList:t.#f,valList:t.#p,next:t.#d,prev:t.#y,get head(){return t.#g},get tail(){return t.#m},free:t.#b,isBackgroundFetch:e=>t.#I(e),backgroundFetch:(e,r,n,i)=>t.#_(e,r,n,i),moveToTail:e=>t.#L(e),indexes:e=>t.#x(e),rindexes:e=>t.#N(e),isStale:e=>t.#U(e)}}get max(){return this.#n}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#c}get dispose(){return this.#o}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:l,noUpdateTTL:h,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:d,fetchMethod:y,memoMethod:g,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=t;if(0!==e&&!C(e))throw new TypeError("max option must be a nonnegative integer");const T=e?k(e):Array;if(!T)throw new Error("invalid max value: "+e);if(this.#n=e,this.#i=f,this.maxEntrySize=p||this.#i,this.sizeCalculation=d,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("memoMethod must be a function if defined");if(this.#c=g,void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(this.#a=y,this.#S=!!y,this.#h=new Map,this.#f=new Array(e).fill(void 0),this.#p=new Array(e).fill(void 0),this.#d=new T(e),this.#y=new T(e),this.#g=0,this.#m=0,this.#b=R.create(e),this.#u=0,this.#l=0,"function"==typeof c&&(this.#o=c),"function"==typeof u?(this.#s=u,this.#v=[]):(this.#s=void 0,this.#v=void 0),this.#A=!!this.#o,this.#O=!!this.#s,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!C(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!C(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=C(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!C(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(0===this.#n&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!_.has(t))(t)&&(_.add(t),x("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,B))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#k(){const t=new D(this.#n),e=new D(this.#n);this.#T=t,this.#w=e,this.#D=(r,n,i=I.now())=>{if(e[r]=0!==n?i:0,t[r]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.#U(r)&&this.#R(this.#f[r],"expire")}),n+1);t.unref&&t.unref()}},this.#B=r=>{e[r]=0!==t[r]?I.now():0},this.#F=(i,o)=>{if(t[o]){const s=t[o],a=e[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const c=i.now-a;i.remainingTTL=s-c}};let r=0;const n=()=>{const t=I.now();if(this.ttlResolution>0){r=t;const e=setTimeout((()=>r=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const o=this.#h.get(i);if(void 0===o)return 0;const s=t[o],a=e[o];return s&&a?s-((r||n())-a):1/0},this.#U=i=>{const o=e[i],s=t[i];return!!s&&!!o&&(r||n())-o>s}}#B=()=>{};#F=()=>{};#D=()=>{};#U=()=>!1;#C(){const t=new D(this.#n);this.#l=0,this.#E=t,this.#P=e=>{this.#l-=t[e],t[e]=0},this.#j=(t,e,r,n)=>{if(this.#I(e))return 0;if(!C(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!C(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#M=(e,r,n)=>{if(t[e]=r,this.#i){const r=this.#i-t[e];for(;this.#l>r;)this.#V(!0)}this.#l+=t[e],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#P=t=>{};#M=(t,e,r)=>{};#j=(t,e,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#m;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#g);)e=this.#y[e]}*#N({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#g;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#m);)e=this.#d[e]}#$(t){return void 0!==t&&this.#h.get(this.#f[t])===t}*entries(){for(const t of this.#x())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*rentries(){for(const t of this.#N())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*keys(){for(const t of this.#x()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*rkeys(){for(const t of this.#N()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*values(){for(const t of this.#x())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}*rvalues(){for(const t of this.#N())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0!==i&&t(i,this.#f[r],this))return this.get(this.#f[r],e)}}forEach(t,e=this){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}rforEach(t,e=this){for(const r of this.#N()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}purgeStale(){let t=!1;for(const e of this.#N({allowStale:!0}))this.#U(e)&&(this.#R(this.#f[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const r=this.#p[e],n=this.#I(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#T&&this.#w){const t=this.#T[e],r=this.#w[e];if(t&&r){const e=t-(I.now()-r);i.ttl=e,i.start=Date.now()}}return this.#E&&(i.size=this.#E[e]),i}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const r=this.#f[e],n=this.#p[e],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const o={value:i};if(this.#T&&this.#w){o.ttl=this.#T[e];const t=I.now()-this.#w[e];o.start=Math.floor(Date.now()-t)}this.#E&&(o.size=this.#E[e]),t.unshift([r,o])}return t}load(t){this.clear();for(const[e,r]of t){if(r.start){const t=Date.now()-r.start;r.start=I.now()-t}this.set(e,r.value,r)}}set(t,e,r={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#j(t,e,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#R(t,"set"),this;let l=0===this.#u?void 0:this.#h.get(t);if(void 0===l)l=0===this.#u?this.#m:0!==this.#b.length?this.#b.pop():this.#u===this.#n?this.#V(!1):this.#u,this.#f[l]=t,this.#p[l]=e,this.#h.set(t,l),this.#d[this.#m]=l,this.#y[l]=this.#m,this.#m=l,this.#u++,this.#M(l,u,a),a&&(a.set="add"),c=!1;else{this.#L(l);const r=this.#p[l];if(e!==r){if(this.#S&&this.#I(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=r;void 0===e||o||(this.#A&&this.#o?.(e,t,"set"),this.#O&&this.#v?.push([e,t,"set"]))}else o||(this.#A&&this.#o?.(r,t,"set"),this.#O&&this.#v?.push([r,t,"set"]));if(this.#P(l),this.#M(l,u,a),this.#p[l]=e,a){a.set="replace";const t=r&&this.#I(r)?r.__staleWhileFetching:r;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#T||this.#k(),this.#T&&(c||this.#D(l,n,i),a&&this.#F(a,l)),!o&&this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#u;){const t=this.#p[this.#g];if(this.#V(!0),this.#I(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#V(t){const e=this.#g,r=this.#f[e],n=this.#p[e];return this.#S&&this.#I(n)?n.__abortController.abort(new Error("evicted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(n,r,"evict"),this.#O&&this.#v?.push([n,r,"evict"])),this.#P(e),t&&(this.#f[e]=void 0,this.#p[e]=void 0,this.#b.push(e)),1===this.#u?(this.#g=this.#m=0,this.#b.length=0):this.#g=this.#d[e],this.#h.delete(r),this.#u--,e}has(t,e={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=e,i=this.#h.get(t);if(void 0!==i){const t=this.#p[i];if(this.#I(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#U(i))return r&&this.#B(i),n&&(n.has="hit",this.#F(n,i)),!0;n&&(n.has="stale",this.#F(n,i))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:r=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!r&&this.#U(n))return;const i=this.#p[n];return this.#I(i)?i.__staleWhileFetching:i}#_(t,e,r,n){const i=void 0===e?void 0:this.#p[e];if(this.#I(i))return i;const o=new N,{signal:s}=r;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,c=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,c&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!c&&!i)return u(o.signal.reason);const h=l;return this.#p[e]===l&&(void 0===n?h.__staleWhileFetching?this.#p[e]=h.__staleWhileFetching:this.#R(t,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(t,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,u=l;if(this.#p[e]===l&&(c&&void 0!==u.__staleWhileFetching?s||(this.#p[e]=u.__staleWhileFetching):this.#R(t,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);const l=new Promise(((e,n)=>{const s=this.#a?.(t,i,a);s&&s instanceof Promise&&s.then((t=>e(void 0===t?void 0:t)),n),o.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(e(void 0),r.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=t),u(t)))),h=Object.assign(l,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,h,{...a.options,status:void 0}),e=this.#h.get(t)):this.#p[e]=h,h}#I(t){if(!this.#S)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof N}async fetch(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:y=!1,status:g,signal:m}=e;if(!this.#S)return g&&(g.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:m};let v=this.#h.get(t);if(void 0===v){g&&(g.fetch="miss");const e=this.#_(t,v,b,d);return e.__returned=e}{const e=this.#p[v];if(this.#I(e)){const t=r&&void 0!==e.__staleWhileFetching;return g&&(g.fetch="inflight",t&&(g.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#U(v);if(!y&&!i)return g&&(g.fetch="hit"),this.#L(v),n&&this.#B(v),g&&this.#F(g,v),e;const o=this.#_(t,v,b,d),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",s&&i&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(t,e={}){const r=await this.fetch(t,e);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(t,e={}){const r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=e,s=this.get(t,o);if(!i&&void 0!==s)return s;const a=r(t,s,{options:o,context:n});return this.set(t,a,o),a}get(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=e,s=this.#h.get(t);if(void 0!==s){const e=this.#p[s],a=this.#I(e);return o&&this.#F(o,s),this.#U(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==e.__staleWhileFetching&&(o.returnedStale=!0),r?e.__staleWhileFetching:void 0):(i||this.#R(t,"expire"),o&&r&&(o.returnedStale=!0),r?e:void 0)):(o&&(o.get="hit"),a?e.__staleWhileFetching:(this.#L(s),n&&this.#B(s),e))}o&&(o.get="miss")}#G(t,e){this.#y[e]=t,this.#d[t]=e}#L(t){t!==this.#m&&(t===this.#g?this.#g=this.#d[t]:this.#G(this.#y[t],this.#d[t]),this.#G(this.#m,t),this.#m=t)}delete(t){return this.#R(t,"delete")}#R(t,e){let r=!1;if(0!==this.#u){const n=this.#h.get(t);if(void 0!==n)if(r=!0,1===this.#u)this.#z(e);else{this.#P(n);const r=this.#p[n];if(this.#I(r)?r.__abortController.abort(new Error("deleted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(r,t,e),this.#O&&this.#v?.push([r,t,e])),this.#h.delete(t),this.#f[n]=void 0,this.#p[n]=void 0,n===this.#m)this.#m=this.#y[n];else if(n===this.#g)this.#g=this.#d[n];else{const t=this.#y[n];this.#d[t]=this.#d[n];const e=this.#d[n];this.#y[e]=this.#y[n]}this.#u--,this.#b.push(n)}}if(this.#O&&this.#v?.length){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return r}clear(){return this.#z("delete")}#z(t){for(const e of this.#N({allowStale:!0})){const r=this.#p[e];if(this.#I(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#f[e];this.#A&&this.#o?.(r,n,t),this.#O&&this.#v?.push([r,n,t])}}if(this.#h.clear(),this.#p.fill(void 0),this.#f.fill(void 0),this.#T&&this.#w&&(this.#T.fill(0),this.#w.fill(0)),this.#E&&this.#E.fill(0),this.#g=0,this.#m=0,this.#b.length=0,this.#l=0,this.#u=0,this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}class F{#W;#K;#q;constructor(t,e,r){this.#K=t.docExistsSpace,this.#q=r,this.#W=e}#H=(t,e={})=>{const r=t=>"string"==typeof t||"number"==typeof t?this.#q.GET(t,e.PIPELINE):t.FIELD||t.VALUE?this.#q.GET(t):t.AND?this.#q.AND(t.AND.map(r),e.PIPELINE):t.GET?this.#q.GET(t.GET,e.PIPELINE):t.NOT?this.#q.NOT(r(t.NOT.INCLUDE),r(t.NOT.EXCLUDE)):t.OR?this.#q.OR(t.OR.map(r),e.PIPELINE):t.ALL_DOCUMENTS?this.ALL_DOCUMENTS(t.ALL_DOCUMENTS):void 0;return r(t).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((t=>e.BUCKETS?this.#q.BUCKETS(...e.BUCKETS).then((e=>Object.assign(t,{BUCKETS:this.#q.AGGREGATION_FILTER(e,t.RESULT,!1)}))):t)).then((r=>e.FACETS?r.RESULT.length?t.ALL_DOCUMENTS?this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:t}))):this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:this.#q.AGGREGATION_FILTER(t,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>e.WEIGHT?Object.assign({RESULT:this.WEIGHT(t.RESULT,e.WEIGHT)},t):t)).then((t=>e.SCORE?this.SCORE(t.RESULT,e.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,e.SORT?{RESULT:this.SORT(t.RESULT,e.SORT)}:{}))).then((t=>{let r;return Object.assign(t,{RESULT:this.PAGE(t.RESULT,e.PAGE,(t=>{r=t}))},{PAGING:r})})).then((t=>e.DOCUMENTS?this.DOCUMENTS(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))};#Y=t=>this.DISTINCT(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"})))));#X=(...t)=>t.length?Promise.all(t.map((t=>this.#q.STORE.get([this.#K,t]).catch((t=>null))))):this.ALL_DOCUMENTS();#J=(t,e)=>this.#H({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e));ALL_DOCUMENTS=t=>this.#q.STORE.iterator({gte:[this.#K,null],lte:[this.#K,void 0],limit:t}).all().then((t=>t.map((([t,e])=>({_id:e._id,_doc:e})))));cachePipeline=(t,e,...r)=>{const n=JSON.stringify({funcLabel:e,params:r});return this.#W.has(n)?Promise.resolve(this.#W.get(n)):t(...r).then((t=>(this.#W.set(n,t),t)))};DICTIONARY=t=>this.cachePipeline(this.#Y,"#DICTIONARY",t);DISTINCT=(...t)=>this.#q.DISTINCT(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));DOCUMENTS=(...t)=>this.cachePipeline(this.#X,"#DOCUMENTS",...t);DOCUMENT_COUNT=()=>this.#q.STORE.get(["DOCUMENT_COUNT"]);DOCUMENT_VECTORS=(...t)=>Promise.all(t.map((t=>this.#q.STORE.get(["DOC",t]).catch((t=>null)))));FACETS=(...t)=>this.#q.FACETS(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));PAGE=(t,e={},r=()=>null)=>((e={NUMBER:0,SIZE:20,...e}).TOTAL=Math.ceil(t.length/e.SIZE),e.DOC_OFFSET=e.NUMBER*e.SIZE,r(e),t.slice(e.DOC_OFFSET,e.DOC_OFFSET+e.SIZE||void 0));QUERY=(t,e)=>this.cachePipeline(this.#H,"#parseJsonQuery",t,e);SCORE=(t,e={})=>{e=Object.assign({TYPE:"TFIDF"},e);const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD),n=t=>(t||[]).filter(r);return new Promise((i=>i("TFIDF"===e.TYPE?this.DOCUMENT_COUNT().then((e=>t.map(((t,n,i)=>{const o=Math.log((e+1)/i.length);return t._score=+(t._match||[]).filter(r).reduce(((t,e)=>t+o*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2)}))):"CONCAT"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.SCORE),"")}))):"SUM"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2)}))):"VALUE"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.VALUE),"")}))):null)))};SEARCH=(t,e)=>this.cachePipeline(this.#J,"#SEARCH",t,e);SORT=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION]));WEIGHT=(t,e)=>t.map((t=>(t._match=t._match.map((t=>(e.forEach((e=>{let r=!1;e.FIELD&&e.VALUE?e.FIELD===t.FIELD&&e.VALUE===t.VALUE&&(r=!0):e.FIELD?e.FIELD===t.FIELD&&(r=!0):e.VALUE&&e.VALUE===t.VALUE&&(r=!0),r&&(t.SCORE=(e.WEIGHT*+t.SCORE).toFixed(2))})),t))),t)))}var P=r(228);class j extends Error{constructor(t){super(t),this.name="TimeoutError"}}class M extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const V=t=>void 0===globalThis.DOMException?new M(t):new DOMException(t),$=t=>{const e=void 0===t.reason?V("This operation was aborted."):t.reason;return e instanceof Error?e:V(e)};class G{#Q=[];enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&this.#Q[this.size-1].priority>=e.priority)return void this.#Q.push(r);const n=function(t,e){let r=0,n=t.length;for(;n>0;){const o=Math.trunc(n/2);let s=r+o;i=t[s],e.priority-i.priority<=0?(r=++s,n-=o+1):n=o}var i;return r}(this.#Q,r);this.#Q.splice(n,0,r)}dequeue(){const t=this.#Q.shift();return t?.run}filter(t){return this.#Q.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this.#Q.length}}class z extends P{#Z;#tt;#et=0;#rt;#nt;#it=0;#ot;#st;#Q;#at;#ct=0;#ut;#lt;#ht;timeout;constructor(t){if(super(),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:G,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#Z=t.carryoverConcurrencyCount,this.#tt=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this.#rt=t.intervalCap,this.#nt=t.interval,this.#Q=new t.queueClass,this.#at=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#ht=!0===t.throwOnTimeout,this.#lt=!1===t.autoStart}get#ft(){return this.#tt||this.#et{this.#yt()}),e)),!0;this.#et=this.#Z?this.#ct:0}return!1}#dt(){if(0===this.#Q.size)return this.#ot&&clearInterval(this.#ot),this.#ot=void 0,this.emit("empty"),0===this.#ct&&this.emit("idle"),!1;if(!this.#lt){const t=!this.#bt;if(this.#ft&&this.#pt){const e=this.#Q.dequeue();return!!e&&(this.emit("active"),e(),t&&this.#mt(),!0)}}return!1}#mt(){this.#tt||void 0!==this.#ot||(this.#ot=setInterval((()=>{this.#gt()}),this.#nt),this.#it=Date.now()+this.#nt)}#gt(){0===this.#et&&0===this.#ct&&this.#ot&&(clearInterval(this.#ot),this.#ot=void 0),this.#et=this.#Z?this.#ct:0,this.#vt()}#vt(){for(;this.#dt(););}get concurrency(){return this.#ut}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#ut=t,this.#vt()}async#Et(t){return new Promise(((e,r)=>{t.addEventListener("abort",(()=>{r(t.reason)}),{once:!0})}))}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:this.#ht,...e},new Promise(((r,n)=>{this.#Q.enqueue((async()=>{this.#ct++,this.#et++;try{e.signal?.throwIfAborted();let n=t({signal:e.signal});e.timeout&&(n=function(t,e){const{milliseconds:r,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e;let s;const a=new Promise(((a,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){const{signal:t}=e;t.aborted&&c($(t)),t.addEventListener("abort",(()=>{c($(t))}))}if(r===Number.POSITIVE_INFINITY)return void t.then(a,c);const u=new j;s=o.setTimeout.call(void 0,(()=>{if(n)try{a(n())}catch(t){c(t)}else"function"==typeof t.cancel&&t.cancel(),!1===i?a():i instanceof Error?c(i):(u.message=i??`Promise timed out after ${r} milliseconds`,c(u))}),r),(async()=>{try{a(await t)}catch(t){c(t)}})()})).finally((()=>{a.clear()}));return a.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},a}(Promise.resolve(n),{milliseconds:e.timeout})),e.signal&&(n=Promise.race([n,this.#Et(e.signal)]));const i=await n;r(i),this.emit("completed",i)}catch(t){if(t instanceof j&&!e.throwOnTimeout)return void r();n(t),this.emit("error",t)}finally{this.#d()}}),e),this.emit("add"),this.#dt()}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this.#lt?(this.#lt=!1,this.#vt(),this):this}pause(){this.#lt=!0}clear(){this.#Q=new this.#at}async onEmpty(){0!==this.#Q.size&&await this.#wt("empty")}async onSizeLessThan(t){this.#Q.sizethis.#Q.size{const n=()=>{e&&!e()||(this.off(t,n),r())};this.on(t,n)}))}get size(){return this.#Q.size}sizeBy(t){return this.#Q.filter(t).length}get pending(){return this.#ct}get isPaused(){return this.#lt}}class W{#W;#q;#Tt;#Q;constructor(t,e,r){this.#W=e,this.#q=r,this.#Tt=t,this.#Q=new z({concurrency:1}),this.#At(0)}#At=t=>this.#q.STORE.get(["DOCUMENT_COUNT"]).then((e=>this.#q.STORE.put(["DOCUMENT_COUNT"],+e+(+t||0)))).catch((t=>this.#q.STORE.put(["DOCUMENT_COUNT"],0)));#St=(t,e)=>{this.#W.clear();const r={...this.#Tt,...e};return((t,e)=>{const r=t=>"string"==typeof t||t instanceof String,n=(t,i)=>new Promise((async o=>{return null===t?o([null,"1.00"]):(s=t)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o([[],"1.00"]):Number.isInteger(t)?o([t,t]):r(t)?o(e.tokenizer(t,i,e)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(t)?o((a=t,new Promise((async t=>{const r={};for(const t in a)r[t]=await n(a[t],t,e);return t(r)})))):(t=>Array.isArray(t))(t)?o((c=t,Promise.all(c.map(n)))):o(t);var s,a,c}));return Promise.all(t.map((async t=>new Promise((async i=>{r(t)&&(t={body:t}),Object.prototype.hasOwnProperty.call(t,"_id")||(t._id=e.idGenerator.next().value);const o={};for(const e in t)o[e]="_id"!==e?await n(t[e],e):t[e];return i(o)})))))})(t,r).then((t=>this.#q.PUT(t,e))).then((e=>this.PUT_RAW(t,e.map((t=>t._id)),!r.storeRawDocs).then((()=>this.#At(e.filter((t=>"CREATED"===t.status)).length))).then((()=>e))))};#Ot=t=>this.#q.DELETE(t).then((e=>this.DELETE_RAW(...t).then((()=>this.#At(-e.filter((t=>"DELETED"===t.status)).length))).then((()=>this.#W.clear())).then((()=>e))));DELETE=(...t)=>this.#Ot(t);DELETE_RAW=(...t)=>Promise.all(t.map((t=>this.#q.STORE.del([this.#Tt.docExistsSpace,t]))));FLUSH=()=>this.#q.STORE.clear().then((()=>{this.#W.clear();const t=(new Date).toISOString();return this.#q.STORE.batch([{type:"put",key:["~CREATED"],value:t},{type:"put",key:["~LAST_UPDATED"],value:t},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0));IMPORT=t=>(this.#W.clear(),Promise.resolve(this.#q.IMPORT(t)));PUT=(t,e)=>this.#Q.add((()=>this.#St(t,e)));PUT_RAW=(t,e,r)=>Promise.all(t.map(((t,n)=>this.#q.STORE.put([this.#Tt.docExistsSpace,e[n]],r?{}:t)))).then((r=>(this.#W.clear(),t.map(((t,r)=>({_id:e[r],status:"OK",operation:"_PUT_RAW"}))))))}class K{constructor(t={}){var e;t={cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],name:"index",ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:d,...t},this.INDEX=new S({...t,isLeaf:t=>Array.isArray(t)&&2===t.length&&t.every((t=>"string"==typeof t||"number"==typeof t||null===t))}),this.EVENTS=this.INDEX.EVENTS,this._CACHE=new B({max:t.cacheLength}),this.r=new F(t,this._CACHE,this.INDEX),this.w=new W(t,this._CACHE,this.INDEX),e=this.INDEX,new Promise(((t,r)=>{const n=["CREATED_WITH"],i="search-index@5.0.0";return e.STORE.get(n).then((e=>i===e?t():r(new Error("This index was created with "+e+", you are running "+i)))).catch((r=>e.STORE.put(n,i).then(t)))}))}ALL_DOCUMENTS=t=>this.r.ALL_DOCUMENTS(t);BUCKETS=(...t)=>this.INDEX.BUCKETS(...t);CREATED=()=>this.INDEX.CREATED();DELETE=(...t)=>this.w.DELETE(...t);DELETE_RAW=(...t)=>this.w.DELETE_RAW(...t);DICTIONARY=t=>this.r.DICTIONARY(t);DISTINCT=(...t)=>this.r.DISTINCT(...t);DOCUMENTS=(...t)=>this.r.DOCUMENTS(...t);DOCUMENT_COUNT=()=>this.r.DOCUMENT_COUNT();DOCUMENT_VECTORS=(...t)=>this.r.DOCUMENT_VECTORS(...t);EXPORT=()=>this.INDEX.EXPORT();FACETS=(...t)=>this.r.FACETS(...t);FIELDS=()=>this.INDEX.FIELDS();FLUSH=()=>this.w.FLUSH();IMPORT=t=>this.INDEX.IMPORT(t);LAST_UPDATED=()=>this.INDEX.LAST_UPDATED();MAX=t=>this.INDEX.MAX(t);MIN=t=>this.INDEX.MIN(t);PUT=(t,e)=>this.w.PUT(t,e);PUT_RAW=(t,e,r)=>this.w.PUT_RAW(t,e,r);QUERY=(t,e)=>this.r.QUERY(t,e);SEARCH=(t,e)=>this.r.SEARCH(t,e);TOKENIZATION_PIPELINE_STAGES=p;_AND=(t,e)=>this.INDEX.AND(t,e);_BUCKET=t=>this.INDEX.BUCKET(t);_GET=(t,e)=>this.INDEX.GET(t,e);_NOT=(t,e)=>this.INDEX.NOT(t,e);_OR=(t,e)=>this.INDEX.OR(t,e);_PAGE=(t,e)=>this.r.PAGE(t,e);_SORT=(t,e)=>this.r.SORT(t,e)}class q{constructor({template:t=t=>`${t} hits`,elementId:e="count"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=this.template(t)}class H{constructor({template:t=t=>`

    ${JSON.stringify(t)}

    `,elementId:e="hits"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=t.map((({_doc:t})=>this.template(t))).join("\n")}class Y{constructor({pageLinkTemplate:t=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,navLinkTemplate:e=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,elementId:r="paging"},n){this.pageLinkTemplate=t,this.navLinkTemplate=e,this.el=document.getElementById(r),this.search=n,this.page={NUMBER:0,SIZE:10}}template=t=>{let e=0,r=t.TOTAL;return t.TOTAL>7&&(e=t.NUMBER>3?t.NUMBER-3:0,r=7+e),r>t.TOTAL&&(e=t.TOTAL-6-1,r=t.TOTAL),`\n
      \n ${this.navLinkTemplate("First",0,0===t.NUMBER)}\n ${this.navLinkTemplate("‹",t.NUMBER-1,0===t.NUMBER)}\n ${(()=>{let n="";for(let i=e;i=t.TOTAL-1)}\n ${this.navLinkTemplate("Last",t.TOTAL-1,t.NUMBER>=t.TOTAL-1)}\n
    `};update=t=>{if(console.log(t),t.TOTAL<=1)return void(this.el.innerHTML="");this.el.innerHTML=this.template(t);const e=document.getElementsByClassName("page-link");for(let t=0;t{console.log("AYO!"),console.log(this.search()),this.page.NUMBER=+t.target.attributes["data-page"].value,this.search()}))}}class X{constructor({elementId:t="",facetOptionTemplate:e=(t,e)=>`\n \n \n
    `,field:r=null,mode:n="OR",sort:i=(t,e)=>{t.VALUE.localeCompare(e.VALUE)},title:o="

    "+r.toUpperCase()+"

    "},s){this.activeFilters=[],this.el=document.getElementById(t),this.elementId=t,this.facetOptionTemplate=e,this.field=r,this.mode=n,this.search=s,this.sort=i,this.title=o}getActiveFilters=()=>this.activeFilters.length?[{[this.mode]:this.activeFilters}]:[];update=(t,e)=>{if("facet"===e&&"OR"===this.mode)return;const r=t.filter((t=>t.FIELD===this.field));this.el.innerHTML=r.length?this.title+r.sort(this.sort).reduce(((t,e)=>t+this.facetOptionTemplate(e,this.activeFilters.includes(e.FIELD+":"+e.VALUE))),""):"",this.activeFilters.forEach((t=>{if(!document.getElementById(t)){const[e,r]=t.split(":");this.el.innerHTML+=this.facetOptionTemplate({FIELD:e,VALUE:r,_id:[]},!0)}}));for(const t of document.querySelectorAll("#"+this.elementId+" > .filter-select"))t.addEventListener("input",(t=>{console.log(this.elementId),console.log(this.mode);const e=t.target.attributes["data-field"].value+":"+t.target.attributes["data-value"].value;t.target.checked?this.activeFilters.push(e):this.activeFilters=this.activeFilters.filter((t=>t!==e)),this.search("facet")}))}}class J{constructor(t,e,r={}){this.autoCompleteFunction=r.autoCompleteFunction,this.currentFocus=-1,this.searchboxEl=t,this.search=e,this.limit=r.limit||20,this.threshold=r.threshold||2,this.autocompleteListId=t.id+"-autocomplete-list",this.suggestionsElementId=r.elementId,t.addEventListener("input",this.searchBoxInputListener),t.addEventListener("keydown",this.searchBoxKeydownListener),document.addEventListener("click",(t=>{this.closeAllLists(t.target)}))}closeAllLists=t=>{for(const e of document.getElementsByClassName("autocomplete-items"))t!==e&&t!==this.searchboxEl&&e.parentNode.removeChild(e)};searchBoxKeydownListener=t=>{let e=document.getElementById(this.autocompleteListId);e&&(e=e.getElementsByTagName("div")),40===t.keyCode?(this.currentFocus++,this.addActive(e)):38===t.keyCode?(this.currentFocus--,this.addActive(e)):13===t.keyCode||9===t.keyCode?(t.preventDefault(),this.currentFocus>-1?e&&e[this.currentFocus].click():this.closeAllLists()):27===t.keyCode&&this.closeAllLists()};searchBoxInputListener=async t=>{const e=(await this.autoCompleteFunction(t.target.value)).slice(0,this.limit);let r;const n=t.target.value;if(this.closeAllLists(),!n)return!1;if(n.length{r=document.createElement("DIV"),r.innerHTML=""+t.substr(0,n.length)+"",r.innerHTML+=t.substr(n.length),r.innerHTML+="",r.addEventListener("click",(t=>{this.searchboxEl.value=t.target.getElementsByTagName("input")[0].value,this.closeAllLists(),this.search()})),i.appendChild(r)}))};addActive=t=>{if(!t)return!1;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1),t[this.currentFocus].classList.add("autocomplete-active")};removeActive=t=>{for(let e=0;e{n.page.NUMBER=0,r("searchInput")})),this.autocomplete=new J(this.el,r,e)}}class Z{constructor({index:t=null,count:e={},hits:r={},facets:n=[],searchInput:i={},paging:o={},suggestions:s={}}){this.index=t,this.count=new q(e),this.paging=new Y(o,this.search),this.hits=new H(r),this.searchInput=new Q({...i,suggestions:{autoCompleteFunction:this.index.DICTIONARY,...i.suggestions}},this.search,this.paging),this.facets=n.map((t=>new X(t,this.search))),this.search()}queryOptions=()=>({FACETS:this.facets.map((t=>({FIELD:t.field}))),DOCUMENTS:!0,PAGE:this.paging.page});emptySearchQuery=()=>[{ALL_DOCUMENTS:!0},this.queryOptions()];searchQuery=()=>[[...this.searchInput.el.value.split(/\s+/).filter((t=>t)),...this.facets.map((t=>t.getActiveFilters())).flat(1/0)],this.queryOptions()];search=t=>(this.searchInput.el.value.length+this.facets.map((t=>t.getActiveFilters())).flat(1/0).length?this.index.SEARCH(...this.searchQuery()):this.index.QUERY(...this.emptySearchQuery())).then((e=>{this.hits.update(e.RESULT),this.count.update(e.RESULT_LENGTH),this.facets.forEach((r=>r.update(e.FACETS,t))),this.paging.update(e.PAGING)}))}class tt{constructor(t={}){return new K({Level:y.Z,...t})}}class et{constructor(t={}){return new Z(t)}}var rt=n.d,nt=n.UI;export{rt as SearchIndex,nt as UI}; \ No newline at end of file +/*! For license information please see search-index-esm-5.1.1.js.LICENSE.txt */ +var t={796:(t,e,r)=>{const{fromCallback:n}=r(8100),i=r(266),{getCallback:o,getOptions:s}=r(1343),a=Symbol("promise"),c=Symbol("status"),u=Symbol("operations"),l=Symbol("finishClose"),h=Symbol("closeCallbacks");e.AbstractChainedBatch=class{constructor(t){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));this[u]=[],this[h]=[],this[c]="open",this[l]=this[l].bind(this),this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get length(){return this[u].length}put(t,e,r){if("open"!==this[c])throw new i("Batch is not open: cannot call put() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const n=this.db._checkKey(t)||this.db._checkValue(e);if(n)throw n;const o=r&&null!=r.sublevel?r.sublevel:this.db,s=r,a=o.keyEncoding(r&&r.keyEncoding),l=o.valueEncoding(r&&r.valueEncoding),h=a.format;r={...r,keyEncoding:h,valueEncoding:l.format},o!==this.db&&(r.sublevel=null);const f=o.prefixKey(a.encode(t),h),p=l.encode(e);return this._put(f,p,r),this[u].push({...s,type:"put",key:t,value:e}),this}_put(t,e,r){}del(t,e){if("open"!==this[c])throw new i("Batch is not open: cannot call del() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const r=this.db._checkKey(t);if(r)throw r;const n=e&&null!=e.sublevel?e.sublevel:this.db,o=e,s=n.keyEncoding(e&&e.keyEncoding),a=s.format;return e={...e,keyEncoding:a},n!==this.db&&(e.sublevel=null),this._del(n.prefixKey(s.encode(t),a),e),this[u].push({...o,type:"del",key:t}),this}_del(t,e){}clear(){if("open"!==this[c])throw new i("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[u]=[],this}_clear(){}write(t,e){return e=o(t,e),e=n(e,a),t=s(t),"open"!==this[c]?this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):0===this.length?this.close(e):(this[c]="writing",this._write(t,(t=>{this[c]="closing",this[h].push((()=>e(t))),t||this.db.emit("batch",this[u]),this._close(this[l])}))),e[a]}_write(t,e){}close(t){return t=n(t,a),"closing"===this[c]?this[h].push(t):"closed"===this[c]?this.nextTick(t):(this[h].push(t),"writing"!==this[c]&&(this[c]="closing",this._close(this[l]))),t[a]}_close(t){this.nextTick(t)}[l](){this[c]="closed",this.db.detachResource(this);const t=this[h];this[h]=[];for(const e of t)e()}}},3527:(t,e,r)=>{const{fromCallback:n}=r(8100),i=r(266),{getOptions:o,getCallback:s}=r(1343),a=Symbol("promise"),c=Symbol("callback"),u=Symbol("working"),l=Symbol("handleOne"),h=Symbol("handleMany"),f=Symbol("autoClose"),p=Symbol("finishWork"),d=Symbol("returnMany"),y=Symbol("closing"),g=Symbol("handleClose"),m=Symbol("closed"),b=Symbol("closeCallbacks"),v=Symbol("keyEncoding"),E=Symbol("valueEncoding"),w=Symbol("abortOnClose"),T=Symbol("legacy"),A=Symbol("keys"),S=Symbol("values"),O=Symbol("limit"),I=Symbol("count"),_=Object.freeze({}),L=()=>{};let x=!1;class N{constructor(t,e,r){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e)throw new TypeError("The second argument must be an options object");this[m]=!1,this[b]=[],this[u]=!1,this[y]=!1,this[f]=!1,this[c]=null,this[l]=this[l].bind(this),this[h]=this[h].bind(this),this[g]=this[g].bind(this),this[v]=e[v],this[E]=e[E],this[T]=r,this[O]=Number.isInteger(e.limit)&&e.limit>=0?e.limit:1/0,this[I]=0,this[w]=!!e.abortOnClose,this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get count(){return this[I]}get limit(){return this[O]}next(t){let e;if(void 0===t)e=new Promise(((e,r)=>{t=(t,n,i)=>{t?r(t):this[T]?void 0===n&&void 0===i?e():e([n,i]):e(n)}}));else if("function"!=typeof t)throw new TypeError("Callback must be a function");return this[y]?this.nextTick(t,new i("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(t,new i("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=t,this[I]>=this[O]?this.nextTick(this[l],null):this._next(this[l])),e}_next(t){this.nextTick(t)}nextv(t,e,r){return r=s(e,r),r=n(r,a),e=o(e,_),Number.isInteger(t)?(this[y]?this.nextTick(r,new i("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(r,new i("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(t<1&&(t=1),this[O]<1/0&&(t=Math.min(t,this[O]-this[I])),this[u]=!0,this[c]=r,t<=0?this.nextTick(this[h],null,[]):this._nextv(t,e,this[h])),r[a]):(this.nextTick(r,new TypeError("The first argument 'size' must be an integer")),r[a])}_nextv(t,e,r){const n=[],i=(e,o,s)=>e?r(e):(this[T]?void 0===o&&void 0===s:void 0===o)?r(null,n):(n.push(this[T]?[o,s]:o),void(n.length===t?r(null,n):this._next(i)));this._next(i)}all(t,e){return e=s(t,e),e=n(e,a),t=o(t,_),this[y]?this.nextTick(e,new i("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(e,new i("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=e,this[f]=!0,this[I]>=this[O]?this.nextTick(this[h],null,[]):this._all(t,this[h])),e[a]}_all(t,e){let r=this[I];const n=[],i=()=>{const t=this[O]<1/0?Math.min(1e3,this[O]-r):1e3;t<=0?this.nextTick(e,null,n):this._nextv(t,_,o)},o=(t,o)=>{t?e(t):0===o.length?e(null,n):(n.push.apply(n,o),r+=o.length,i())};i()}[p](){const t=this[c];return this[w]&&null===t?L:(this[u]=!1,this[c]=null,this[y]&&this._close(this[g]),t)}[d](t,e,r){this[f]?this.close(t.bind(null,e,r)):t(e,r)}seek(t,e){if(e=o(e,_),this[y]);else{if(this[u])throw new i("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{const r=this.db.keyEncoding(e.keyEncoding||this[v]),n=r.format;e.keyEncoding!==n&&(e={...e,keyEncoding:n});const i=this.db.prefixKey(r.encode(t),n);this._seek(i,e)}}}_seek(t,e){throw new i("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(t){return t=n(t,a),this[m]?this.nextTick(t):this[y]?this[b].push(t):(this[y]=!0,this[b].push(t),this[u]?this[w]&&this[p]()(new i("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[g])),t[a]}_close(t){this.nextTick(t)}[g](){this[m]=!0,this.db.detachResource(this);const t=this[b];this[b]=[];for(const e of t)e()}async*[Symbol.asyncIterator](){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this[m]||await this.close()}}}class U extends N{constructor(t,e){super(t,e,!0),this[A]=!1!==e.keys,this[S]=!1!==e.values}[l](t,e,r){const n=this[p]();if(t)return n(t);try{e=this[A]&&void 0!==e?this[v].decode(e):void 0,r=this[S]&&void 0!==r?this[E].decode(r):void 0}catch(t){return n(new C("entry",t))}void 0===e&&void 0===r||this[I]++,n(null,e,r)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(const t of e){const e=t[0],r=t[1];t[0]=this[A]&&void 0!==e?this[v].decode(e):void 0,t[1]=this[S]&&void 0!==r?this[E].decode(r):void 0}}catch(t){return this[d](r,new C("entries",t))}this[I]+=e.length,this[d](r,null,e)}end(t){return x||"undefined"==typeof console||(x=!0,console.warn(new i("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(t)}}class C extends i{constructor(t,e){super(`Iterator could not decode ${t}`,{code:"LEVEL_DECODE_ERROR",cause:e})}}for(const t of["_ended property","_nexting property","_end method"])Object.defineProperty(U.prototype,t.split(" ")[0],{get(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});U.keyEncoding=v,U.valueEncoding=E,e.AbstractIterator=U,e.AbstractKeyIterator=class extends N{constructor(t,e){super(t,e,!1)}[l](t,e){const r=this[p]();if(t)return r(t);try{e=void 0!==e?this[v].decode(e):void 0}catch(t){return r(new C("key",t))}void 0!==e&&this[I]++,r(null,e)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(let t=0;t{const{supports:n}=r(5356),{Transcoder:i}=r(6035),{EventEmitter:o}=r(7007),{fromCallback:s}=r(8100),a=r(266),{AbstractIterator:c}=r(3527),{DefaultKeyIterator:u,DefaultValueIterator:l}=r(5682),{DeferredIterator:h,DeferredKeyIterator:f,DeferredValueIterator:p}=r(4416),{DefaultChainedBatch:d}=r(4669),{getCallback:y,getOptions:g}=r(1343),m=r(386),b=Symbol("promise"),v=Symbol("landed"),E=Symbol("resources"),w=Symbol("closeResources"),T=Symbol("operations"),A=Symbol("undefer"),S=Symbol("deferOpen"),O=Symbol("options"),I=Symbol("status"),_=Symbol("defaultOptions"),L=Symbol("transcoder"),x=Symbol("keyEncoding"),N=Symbol("valueEncoding"),U=()=>{};class C extends o{constructor(t,e){if(super(),"object"!=typeof t||null===t)throw new TypeError("The first argument 'manifest' must be an object");e=g(e);const{keyEncoding:r,valueEncoding:o,passive:s,...a}=e;this[E]=new Set,this[T]=[],this[S]=!0,this[O]=a,this[I]="opening",this.supports=n(t,{status:!0,promises:!0,clear:!0,getMany:!0,deferredOpen:!0,snapshots:!1!==t.snapshots,permanence:!1!==t.permanence,keyIterator:!0,valueIterator:!0,iteratorNextv:!0,iteratorAll:!0,encodings:t.encodings||{},events:Object.assign({},t.events,{opening:!0,open:!0,closing:!0,closed:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[L]=new i(R(this)),this[x]=this[L].encoding(r||"utf8"),this[N]=this[L].encoding(o||"utf8");for(const t of this[L].encodings())this.supports.encodings[t.commonName]||(this.supports.encodings[t.commonName]=!0);this[_]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[x].commonName,valueEncoding:this[N].commonName}),key:Object.freeze({keyEncoding:this[x].commonName})},this.nextTick((()=>{this[S]&&this.open({passive:!1},U)}))}get status(){return this[I]}keyEncoding(t){return this[L].encoding(null!=t?t:this[x])}valueEncoding(t){return this[L].encoding(null!=t?t:this[N])}open(t,e){e=y(t,e),e=s(e,b),(t={...this[O],...g(t)}).createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists;const r=t=>{"closing"===this[I]||"opening"===this[I]?this.once(v,t?()=>r(t):r):"open"!==this[I]?e(new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:t})):e()};return t.passive?"opening"===this[I]?this.once(v,r):this.nextTick(r):"closed"===this[I]||this[S]?(this[S]=!1,this[I]="opening",this.emit("opening"),this._open(t,(t=>{if(t)return this[I]="closed",this[w]((()=>{this.emit(v),r(t)})),void this[A]();this[I]="open",this[A](),this.emit(v),"open"===this[I]&&this.emit("open"),"open"===this[I]&&this.emit("ready"),r()}))):"open"===this[I]?this.nextTick(r):this.once(v,(()=>this.open(t,e))),e[b]}_open(t,e){this.nextTick(e)}close(t){t=s(t,b);const e=r=>{"opening"===this[I]||"closing"===this[I]?this.once(v,r?e(r):e):"closed"!==this[I]?t(new a("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:r})):t()};if("open"===this[I]){this[I]="closing",this.emit("closing");const t=t=>{this[I]="open",this[A](),this.emit(v),e(t)};this[w]((()=>{this._close((r=>{if(r)return t(r);this[I]="closed",this[A](),this.emit(v),"closed"===this[I]&&this.emit("closed"),e()}))}))}else"closed"===this[I]?this.nextTick(e):this.once(v,(()=>this.close(t)));return t[b]}[w](t){if(0===this[E].size)return this.nextTick(t);let e=this[E].size,r=!0;const n=()=>{0==--e&&(r?this.nextTick(t):t())};for(const t of this[E])t.close(n);r=!1,this[E].clear()}_close(t){this.nextTick(t)}get(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.get(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=this.valueEncoding(e.valueEncoding),c=i.format,u=o.format;return e.keyEncoding===c&&e.valueEncoding===u||(e=Object.assign({},e,{keyEncoding:c,valueEncoding:u})),this._get(this.prefixKey(i.encode(t),c),e,((t,e)=>{if(t)return("LEVEL_NOT_FOUND"===t.code||t.notFound||/NotFound/i.test(t))&&(t.code||(t.code="LEVEL_NOT_FOUND"),t.notFound||(t.notFound=!0),t.status||(t.status=404)),r(t);try{e=o.decode(e)}catch(t){return r(new a("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:t}))}r(null,e)})),r[b]}_get(t,e,r){this.nextTick(r,new Error("NotFound"))}getMany(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.getMany(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'keys' must be an array")),r[b];if(0===t.length)return this.nextTick(r,null,[]),r[b];const n=this.keyEncoding(e.keyEncoding),i=this.valueEncoding(e.valueEncoding),o=n.format,c=i.format;e.keyEncoding===o&&e.valueEncoding===c||(e=Object.assign({},e,{keyEncoding:o,valueEncoding:c}));const u=new Array(t.length);for(let e=0;e{if(t)return r(t);try{for(let t=0;tthis.put(t,e,r,n))),n[b];if(D(this,n))return n[b];const i=this._checkKey(t)||this._checkValue(e);if(i)return this.nextTick(n,i),n[b];const o=this.keyEncoding(r.keyEncoding),a=this.valueEncoding(r.valueEncoding),c=o.format,u=a.format;r.keyEncoding===c&&r.valueEncoding===u||(r=Object.assign({},r,{keyEncoding:c,valueEncoding:u}));const l=this.prefixKey(o.encode(t),c),h=a.encode(e);return this._put(l,h,r,(r=>{if(r)return n(r);this.emit("put",t,e),n()})),n[b]}_put(t,e,r,n){this.nextTick(n)}del(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].key),"opening"===this[I])return this.defer((()=>this.del(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=i.format;return e.keyEncoding!==o&&(e=Object.assign({},e,{keyEncoding:o})),this._del(this.prefixKey(i.encode(t),o),e,(e=>{if(e)return r(e);this.emit("del",t),r()})),r[b]}_del(t,e,r){this.nextTick(r)}batch(t,e,r){if(!arguments.length){if("opening"===this[I])return new d(this);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(r="function"==typeof t?t:y(e,r),r=s(r,b),e=g(e,this[_].empty),"opening"===this[I])return this.defer((()=>this.batch(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'operations' must be an array")),r[b];if(0===t.length)return this.nextTick(r),r[b];const n=new Array(t.length),{keyEncoding:i,valueEncoding:o,...c}=e;for(let e=0;e{if(e)return r(e);this.emit("batch",t),r()})),r[b]}_batch(t,e,r){this.nextTick(r)}sublevel(t,e){return this._sublevel(t,k.defaults(e))}_sublevel(t,e){return new k(this,t,e)}prefixKey(t,e){return t}clear(t,e){if(e=y(t,e),e=s(e,b),t=g(t,this[_].empty),"opening"===this[I])return this.defer((()=>this.clear(t,e))),e[b];if(D(this,e))return e[b];const r=t,n=this.keyEncoding(t.keyEncoding);return(t=m(t,n)).keyEncoding=n.format,0===t.limit?this.nextTick(e):this._clear(t,(t=>{if(t)return e(t);this.emit("clear",r),e()})),e[b]}_clear(t,e){this.nextTick(e)}iterator(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e)).keys=!1!==t.keys,t.values=!1!==t.values,t[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new h(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(t)}_iterator(t){return new c(this,t)}keys(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new f(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(t)}_keys(t){return new u(this,t)}values(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new p(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(t)}_values(t){return new l(this,t)}defer(t){if("function"!=typeof t)throw new TypeError("The first argument must be a function");this[T].push(t)}[A](){if(0===this[T].length)return;const t=this[T];this[T]=[];for(const e of t)e()}attachResource(t){if("object"!=typeof t||null===t||"function"!=typeof t.close)throw new TypeError("The first argument must be a resource object");this[E].add(t)}detachResource(t){this[E].delete(t)}_chainedBatch(){return new d(this)}_checkKey(t){if(null==t)return new a("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(t){if(null==t)return new a("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}}C.prototype.nextTick=r(28);const{AbstractSublevel:k}=r(9933)({AbstractLevel:C});e.AbstractLevel=C,e.AbstractSublevel=k;const D=function(t,e){return"open"!==t[I]&&(t.nextTick(e,new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0)},R=function(t){return Object.keys(t.supports.encodings).filter((e=>!!t.supports.encodings[e]))}},5e3:(t,e,r)=>{e.AbstractLevel=r(1983).AbstractLevel,e.AbstractSublevel=r(1983).AbstractSublevel,e.AbstractIterator=r(3527).AbstractIterator,e.AbstractKeyIterator=r(3527).AbstractKeyIterator,e.AbstractValueIterator=r(3527).AbstractValueIterator,e.AbstractChainedBatch=r(796).AbstractChainedBatch},4716:(t,e,r)=>{const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=Symbol("unfix"),a=Symbol("iterator"),c=Symbol("handleOne"),u=Symbol("handleMany"),l=Symbol("callback");class h extends n{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e,r){const n=this[l];if(t)return n(t);void 0!==e&&(e=this[s](e)),n(t,e,r)}[u](t,e){const r=this[l];if(t)return r(t);for(const t of e){const e=t[0];void 0!==e&&(t[0]=this[s](e))}r(t,e)}}class f extends i{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e){const r=this[l];if(t)return r(t);void 0!==e&&(e=this[s](e)),r(t,e)}[u](t,e){const r=this[l];if(t)return r(t);for(let t=0;t{const n=r(266),{Buffer:i}=r(8287)||{},{AbstractSublevelIterator:o,AbstractSublevelKeyIterator:s,AbstractSublevelValueIterator:a}=r(4716),c=Symbol("prefix"),u=Symbol("upperBound"),l=Symbol("prefixRange"),h=Symbol("parent"),f=Symbol("unfix"),p=new TextEncoder,d={separator:"!"};t.exports=function({AbstractLevel:t}){class e extends t{static defaults(t){if("string"==typeof t)throw new n("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(t&&t.open)throw new n("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return null==t?d:t.separator?t:{...t,separator:"!"}}constructor(t,r,i){const{separator:o,manifest:s,...a}=e.defaults(i);r=v(r,o);const l=o.charCodeAt(0)+1,d=t[h]||t;if(!p.encode(r).every((t=>t>l&&t<127)))throw new n(`Prefix must use bytes > ${l} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(y(d,s),a);const g=(t.prefix||"")+o+r+o,E=g.slice(0,-1)+String.fromCharCode(l);this[h]=d,this[c]=new m(g),this[u]=new m(E),this[f]=new b,this.nextTick=d.nextTick}prefixKey(t,e){if("utf8"===e)return this[c].utf8+t;if(0===t.byteLength)return this[c][e];if("view"===e){const e=this[c].view,r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}{const e=this[c].buffer;return i.concat([e,t],e.byteLength+t.byteLength)}}[l](t,e){void 0!==t.gte?t.gte=this.prefixKey(t.gte,e):void 0!==t.gt?t.gt=this.prefixKey(t.gt,e):t.gte=this[c][e],void 0!==t.lte?t.lte=this.prefixKey(t.lte,e):void 0!==t.lt?t.lt=this.prefixKey(t.lt,e):t.lte=this[u][e]}get prefix(){return this[c].utf8}get db(){return this[h]}_open(t,e){this[h].open({passive:!0},e)}_put(t,e,r,n){this[h].put(t,e,r,n)}_get(t,e,r){this[h].get(t,e,r)}_getMany(t,e,r){this[h].getMany(t,e,r)}_del(t,e,r){this[h].del(t,e,r)}_batch(t,e,r){this[h].batch(t,e,r)}_clear(t,e){this[l](t,t.keyEncoding),this[h].clear(t,e)}_iterator(t){this[l](t,t.keyEncoding);const e=this[h].iterator(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new o(this,t,e,r)}_keys(t){this[l](t,t.keyEncoding);const e=this[h].keys(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new s(this,t,e,r)}_values(t){this[l](t,t.keyEncoding);const e=this[h].values(t);return new a(this,t,e)}}return{AbstractSublevel:e}};const y=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:g(t,"utf8"),buffer:g(t,"buffer"),view:g(t,"view")}}},g=function(t,e){return!!t.supports.encodings[e]&&t.keyEncoding(e).name===e};class m{constructor(t){this.utf8=t,this.view=p.encode(t),this.buffer=i?i.from(this.view.buffer,0,this.view.byteLength):{}}}class b{constructor(){this.cache=new Map}get(t,e){let r=this.cache.get(e);return void 0===r&&(r="view"===e?function(t,e){return e.subarray(t)}.bind(null,t):function(t,e){return e.slice(t)}.bind(null,t),this.cache.set(e,r)),r}}const v=function(t,e){let r=0,n=t.length;for(;rr&&t[n-1]===e;)n--;return t.slice(r,n)}},1343:(t,e)=>{e.getCallback=function(t,e){return"function"==typeof t?t:e},e.getOptions=function(t,e){return"object"==typeof t&&null!==t?t:void 0!==e?e:{}}},4669:(t,e,r)=>{const{AbstractChainedBatch:n}=r(796),i=r(266),o=Symbol("encoded");e.DefaultChainedBatch=class extends n{constructor(t){super(t),this[o]=[]}_put(t,e,r){this[o].push({...r,type:"put",key:t,value:e})}_del(t,e){this[o].push({...e,type:"del",key:t})}_clear(){this[o]=[]}_write(t,e){"opening"===this.db.status?this.db.defer((()=>this._write(t,e))):"open"===this.db.status?0===this[o].length?this.nextTick(e):this.db._batch(this[o],t,e):this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}}},5682:(t,e,r)=>{const{AbstractKeyIterator:n,AbstractValueIterator:i}=r(3527),o=Symbol("iterator"),s=Symbol("callback"),a=Symbol("handleOne"),c=Symbol("handleMany");class u extends n{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!0,values:!1}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}class l extends i{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!1,values:!0}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}for(const t of[u,l]){const e=t===u,r=e?t=>t[0]:t=>t[1];t.prototype._next=function(t){this[s]=t,this[o].next(this[a])},t.prototype[a]=function(t,r,n){const i=this[s];t?i(t):i(null,e?r:n)},t.prototype._nextv=function(t,e,r){this[s]=r,this[o].nextv(t,e,this[c])},t.prototype._all=function(t,e){this[s]=e,this[o].all(t,this[c])},t.prototype[c]=function(t,e){const n=this[s];t?n(t):n(null,e.map(r))},t.prototype._seek=function(t,e){this[o].seek(t,e)},t.prototype._close=function(t){this[o].close(t)}}e.DefaultKeyIterator=u,e.DefaultValueIterator=l},4416:(t,e,r)=>{const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=r(266),a=Symbol("nut"),c=Symbol("undefer"),u=Symbol("factory");class l extends n{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.iterator(e),this.db.defer((()=>this[c]()))}}class h extends i{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.keys(e),this.db.defer((()=>this[c]()))}}class f extends o{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.values(e),this.db.defer((()=>this[c]()))}}for(const t of[l,h,f])t.prototype[c]=function(){"open"===this.db.status&&(this[a]=this[u]())},t.prototype._next=function(t){null!==this[a]?this[a].next(t):"opening"===this.db.status?this.db.defer((()=>this._next(t))):this.nextTick(t,new s("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(t,e,r){null!==this[a]?this[a].nextv(t,e,r):"opening"===this.db.status?this.db.defer((()=>this._nextv(t,e,r))):this.nextTick(r,new s("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(t,e){null!==this[a]?this[a].all(e):"opening"===this.db.status?this.db.defer((()=>this._all(t,e))):this.nextTick(e,new s("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(t,e){null!==this[a]?this[a]._seek(t,e):"opening"===this.db.status&&this.db.defer((()=>this._seek(t,e)))},t.prototype._close=function(t){null!==this[a]?this[a].close(t):"opening"===this.db.status?this.db.defer((()=>this._close(t))):this.nextTick(t)};e.DeferredIterator=l,e.DeferredKeyIterator=h,e.DeferredValueIterator=f},28:(t,e,r)=>{const n=r(9596);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},386:(t,e,r)=>{const n=r(266),i=Object.prototype.hasOwnProperty,o=new Set(["lt","lte","gt","gte"]);t.exports=function(t,e){const r={};for(const s in t)if(i.call(t,s)&&"keyEncoding"!==s&&"valueEncoding"!==s){if("start"===s||"end"===s)throw new n(`The legacy range option '${s}' has been removed`,{code:"LEVEL_LEGACY"});if("encoding"===s)throw new n("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead",{code:"LEVEL_LEGACY"});o.has(s)?r[s]=e.encode(t[s]):r[s]=t[s]}return r.reverse=!!r.reverse,r.limit=Number.isInteger(r.limit)&&r.limit>=0?r.limit:-1,r}},9511:(t,e,r)=>{var n=r(8075)("ArrayBuffer.prototype.byteLength",!0),i=r(4670);t.exports=function(t){return i(t)?n?n(t):t.byteLength:NaN}},7526:(t,e)=>{e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),l=0,h=c>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9148:(t,e,r)=>{const{AbstractLevel:n}=r(5e3),i=r(266),o=r(5372),{fromCallback:s}=r(8100),{Iterator:a}=r(6296),c=r(5222),u=r(3452),l=r(7766),h="level-js-",f=Symbol("idb"),p=Symbol("namePrefix"),d=Symbol("location"),y=Symbol("version"),g=Symbol("store"),m=Symbol("onComplete"),b=Symbol("promise");class v extends n{constructor(t,e,r){if("function"==typeof e||"function"==typeof r)throw new i("The levelup-style callback argument has been removed",{code:"LEVEL_LEGACY"});const{prefix:n,version:o,...s}=e||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},s),"string"!=typeof t)throw new Error("constructor requires a location string argument");this[d]=t,this[p]=null==n?h:n,this[y]=parseInt(o||1,10),this[f]=null}get location(){return this[d]}get namePrefix(){return this[p]}get version(){return this[y]}get db(){return this[f]}get type(){return"browser-level"}_open(t,e){const r=indexedDB.open(this[p]+this[d],this[y]);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this[f]=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this[d])||e.createObjectStore(this[d])}}[g](t){return this[f].transaction([this[d]],t).objectStore(this[d])}[m](t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}}_get(t,e,r){const n=this[g]("readonly");let o;try{o=n.get(t)}catch(t){return this.nextTick(r,t)}this[m](o,(function(t,e){return t?r(t):void 0===e?r(new i("Entry not found",{code:"LEVEL_NOT_FOUND"})):void r(null,c(e))}))}_getMany(t,e,r){const n=this[g]("readonly"),i=t.map((t=>e=>{let r;try{r=n.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:c(t))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(i,16,r)}_del(t,e,r){const n=this[g]("readwrite");let i;try{i=n.delete(t)}catch(t){return this.nextTick(r,t)}this[m](i,r)}_put(t,e,r,n){const i=this[g]("readwrite");let o;try{o=i.put(e,t)}catch(t){return this.nextTick(n,t)}this[m](o,n)}_iterator(t){return new a(this,this[d],t)}_batch(t,e,r){const n=this[g]("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let c;try{c="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return u(this,this[d],r,t,e);try{const t=this[g]("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this.nextTick(e,t)}this[m](n,e)}_close(t){this[f].close(),this.nextTick(t)}}v.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h),r=s(r,b);const n=indexedDB.deleteDatabase(e+t);return n.onsuccess=function(){r()},n.onerror=function(t){r(t)},r[b]},e.Z=v},6296:(t,e,r)=>{const{AbstractIterator:n}=r(5e3),i=r(7766),o=r(5222),s=Symbol("cache"),a=Symbol("finished"),c=Symbol("options"),u=Symbol("currentOptions"),l=Symbol("position"),h=Symbol("location"),f=Symbol("first"),p={};function d(t){"function"==typeof t.commit&&t.commit()}e.Iterator=class extends n{constructor(t,e,r){super(t,r),this[s]=[],this[a]=0===this.limit,this[c]=r,this[u]={...r},this[l]=void 0,this[h]=e,this[f]=!0}_nextv(t,e,r){if(this[f]=!1,this[a])return this.nextTick(r,null,[]);if(this[s].length>0)return t=Math.min(t,this[s].length),this.nextTick(r,null,this[s].splice(0,t));let n;void 0!==this[l]&&(this[c].reverse?(this[u].lt=this[l],this[u].lte=void 0):(this[u].gt=this[l],this[u].gte=void 0));try{n=i(this[u])}catch(t){return this[a]=!0,this.nextTick(r,null,[])}const p=this.db.db.transaction([this[h]],"readonly"),y=p.objectStore(this[h]),g=[];if(this[c].reverse)y[!this[c].values&&y.openKeyCursor?"openKeyCursor":"openCursor"](n,"prev").onsuccess=e=>{const r=e.target.result;if(r){const{key:e,value:n}=r;this[l]=e,g.push([this[c].keys&&void 0!==e?o(e):void 0,this[c].values&&void 0!==n?o(n):void 0]),g.length{if(void 0===e||void 0===r)return;const n=Math.max(e.length,r.length);0===n||t===1/0?this[a]=!0:this[l]=e[n-1],g.length=n;for(let t=0;t{e=t.target.result,i()}:(e=[],this.nextTick(i)),this[c].values?y.getAll(n,t<1/0?t:void 0).onsuccess=t=>{r=t.target.result,i()}:(r=[],this.nextTick(i))}p.onabort=()=>{r(p.error||new Error("aborted by user")),r=null},p.oncomplete=()=>{r(null,g),r=null}}_next(t){if(this[s].length>0){const[e,r]=this[s].shift();this.nextTick(t,null,e,r)}else if(this[a])this.nextTick(t);else{let e=Math.min(100,this.limit-this.count);this[f]&&(this[f]=!1,e=1),this._nextv(e,p,((e,r)=>{if(e)return t(e);this[s]=r,this._next(t)}))}}_all(t,e){this[f]=!1;const r=this[s].splice(0,this[s].length),n=this.limit-this.count-r.length;if(n<=0)return this.nextTick(e,null,r);this._nextv(n,p,((t,n)=>{if(t)return e(t);r.length>0&&(n=r.concat(n)),e(null,n)}))}_seek(t,e){let r;this[f]=!0,this[s]=[],this[a]=!1,this[l]=void 0,this[u]={...this[c]};try{r=i(this[c])}catch(t){return void(this[a]=!0)}null===r||r.includes(t)?this[c].reverse?this[u].lte=t:this[u].gte=t:this[a]=!0}}},3452:t=>{t.exports=function(t,e,r,n,i){if(0===n.limit)return t.nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const c=s.openKeyCursor?"openKeyCursor":"openCursor",u=n.reverse?"prev":"next";s[c](r,u).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{const e=new TextEncoder;t.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):e.encode(t)}},7766:t=>{t.exports=function(t){const e=void 0!==t.gte?t.gte:void 0!==t.gt?t.gt:void 0,r=void 0!==t.lte?t.lte:void 0!==t.lt?t.lt:void 0,n=void 0===t.gte,i=void 0===t.lte;return void 0!==e&&void 0!==r?IDBKeyRange.bound(e,r,n,i):void 0!==e?IDBKeyRange.lowerBound(e,n):void 0!==r?IDBKeyRange.upperBound(r,i):null}},8287:(t,e,r)=>{const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||X(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),a(t<0?0:0|d(t))}function f(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},8075:(t,e,r)=>{var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},487:(t,e,r)=>{var n=r(6743),i=r(453),o=r(6897),s=r(9675),a=i("%Function.prototype.apply%"),c=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||n.call(c,a),l=r(655),h=i("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new s("a function is required");var e=u(n,c,arguments);return o(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(n,a,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},8100:(t,e,r)=>{var n=r(844);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},844:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},9743:(t,e)=>{function r(t){for(var e="",r=0;r0?"F"+s:"D"+r(s)},e.decode=function(t){if("DaN"===t)return NaN;if("FF"===t)return 1/0;if("DD"===t)return-1/0;var e="D"===t[0],n=(e?r(t):t).slice(2).split("M");return Number((e?"-":"")+n[1]+"e"+String(Number(n[0])-500))}},3381:(t,e)=>{var r={"?":"?@","!":"??",'"':"?%"},n={"?@":"?","??":"!","?%":'"'};e.factory=function(t){return{encode:e,decode:function(e){if("A"===e)return null;if("K!"===e)return[];for(var r,i=e.split('"'),o=[[]],s=0,a=i.length,c=0;c{var n=r(9743),i=r(3381);e.flip=function(t){var e=t.toString(),r="";for(var n in e)r+="."==e[n]?".":9-+e[n];return r},e.number=n,e.string={encode:function(t){return/\x00|\x01/.test(t)?"J"+t.replace(/\x01/g,"").replace(/\x00/g,""):"J"+t},decode:function(t){if("J"===t[0])return t.substring(1)}},e.encode=function(t){return e[typeof t].encode(t)},e.decode=function(t){if(""===t)return t;if(!o[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return o[t[0]](t)},e.object=i.factory(e),e.boolean={encode:function(t){return t?"C":"B"},decode:function(t){return"C"===t}},e.undefined={encode:function(t){return"L"},decode:function(){}};var o={A:e.object.decode,B:e.boolean.decode,C:e.boolean.decode,D:e.number.decode,F:e.number.decode,J:e.string.decode,K:e.object.decode,L:e.undefined.decode};e.buffer=!1,e.type="charwise"},41:(t,e,r)=>{var n=r(655),i=r(8068),o=r(9675),s=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new o("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!s&&s(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8452:(t,e,r)=>{var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),c=r(592)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;c?a(t,e,r,!0):a(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{var n=r(453)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},1237:t=>{t.exports=EvalError},9383:t=>{t.exports=Error},9290:t=>{t.exports=RangeError},9538:t=>{t.exports=ReferenceError},8068:t=>{t.exports=SyntaxError},9675:t=>{t.exports=TypeError},5345:t=>{t.exports=URIError},5388:(t,e,r)=>{var n=r(9675);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},5437:(t,e,r)=>{var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(162),o=r(9600),s=r(2120),a=r(3612);t.exports=function(t){if(i(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!o(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(i(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s{t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},228:t=>{var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i{var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,l=d(c,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},2682:(t,e,r)=>{var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n{var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{var n=r(9353);t.exports=Function.prototype.bind||n},453:(t,e,r)=>{var n,i=r(9383),o=r(1237),s=r(9290),a=r(9538),c=r(8068),u=r(9675),l=r(5345),h=Function,f=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(t){p=null}var d=function(){throw new u},y=p?function(){try{return d}catch(t){try{return p(arguments,"callee").get}catch(t){return d}}}():d,g=r(4039)(),m=r(24)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},E="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,w={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":y,"%TypedArray%":E,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var T=b(b(t));w["%Error.prototype%"]=T}var A=function t(e){var r;if("%AsyncFunction%"===e)r=f("async function () {}");else if("%GeneratorFunction%"===e)r=f("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=f("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return w[e]=r,r},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(6743),I=r(9957),_=O.call(Function.call,Array.prototype.concat),L=O.call(Function.apply,Array.prototype.splice),x=O.call(Function.call,String.prototype.replace),N=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,D=function(t,e){var r,n=t;if(I(S,n)&&(n="%"+(r=S[n])[0]+"%"),I(w,n)){var i=w[n];if(i===v&&(i=A(n)),void 0===i&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=N(t,0,1),r=N(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return x(t,C,(function(t,e,r,i){n[n.length]=r?x(i,k,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=D("%"+n+"%",e),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],L(r,_([0,1],l)));for(var h=1,f=!0;h=r.length){var m=p(s,d);s=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:s[d]}else f=I(s,d),s=s[d];f&&!a&&(w[o]=s)}}return s}},5795:(t,e,r)=>{var n=r(453)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},592:(t,e,r)=>{var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},24:t=>{var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof r)}},4039:(t,e,r)=>{var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333:t=>{t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092:(t,e,r)=>{var n=r(1333);t.exports=function(){return n()&&!!Symbol.toStringTag}},9957:(t,e,r)=>{var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);t.exports=o.call(n,i)},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*y}},4670:(t,e,r)=>{var n=r(487),i=r(8075),o=r(453)("%ArrayBuffer%",!0),s=i("ArrayBuffer.prototype.byteLength",!0),a=i("Object.prototype.toString"),c=!!o&&!s&&new o(0).slice,u=!!c&&n(c);t.exports=s||u?function(t){if(!t||"object"!=typeof t)return!1;try{return s?s(t):u(t,0),!0}catch(t){return!1}}:o?function(t){return"[object ArrayBuffer]"===a(t)}:function(t){return!1}},9600:t=>{var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(s(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},2120:(t,e,r)=>{var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(9092)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},4035:(t,e,r)=>{var n,i,o,s,a=r(8075),c=r(9092)();if(c){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var l=a("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{i(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7070:(t,e,r)=>{var n=r(8075)("SharedArrayBuffer.prototype.byteLength",!0);t.exports=n?function(t){if(!t||"object"!=typeof t)return!1;try{return n(t),!0}catch(t){return!1}}:function(t){return!1}},3612:(t,e,r)=>{var n=Object.prototype.toString;if(r(4039)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},5680:(t,e,r)=>{var n=r(5767);t.exports=function(t){return!!n(t)}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},5356:(t,e)=>{e.supports=function(...t){const e=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(e,{snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,getMany:e.getMany||!1,keyIterator:e.keyIterator||!1,valueIterator:e.valueIterator||!1,iteratorNextv:e.iteratorNextv||!1,iteratorAll:e.iteratorAll||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:Object.assign({},e.encodings),events:Object.assign({},e.events),additionalMethods:Object.assign({},e.additionalMethods)})}},6035:(t,e,r)=>{const n=r(266),i=r(4341),{Encoding:o}=r(8110),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=Symbol("formats"),l=Symbol("encodings"),h=new Set(["buffer","view","utf8"]);e.Transcoder=class{constructor(t){if(!Array.isArray(t))throw new TypeError("The first argument 'formats' must be an array");if(!t.every((t=>h.has(t))))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'");this[l]=new Map,this[u]=new Set(t);for(const t in i)try{this.encoding(t)}catch(t){if("LEVEL_ENCODING_NOT_SUPPORTED"!==t.code)throw t}}encodings(){return Array.from(new Set(this[l].values()))}encoding(t){let e=this[l].get(t);if(void 0===e){if("string"==typeof t&&""!==t){if(e=p[t],!e)throw new n(`Encoding '${t}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if("object"!=typeof t||null===t)throw new TypeError("First argument 'encoding' must be a string or object");e=function(t){if(t instanceof o)return t;const e="type"in t&&"string"==typeof t.type?t.type:void 0,r=t.name||e||"anonymous-"+d++;switch(function(t){return"format"in t&&void 0!==t.format?t.format:"buffer"in t&&"boolean"==typeof t.buffer?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}(t)){case"view":return new a({...t,name:r});case"utf8":return new c({...t,name:r});case"buffer":return new s({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}(t)}const{name:r,format:i}=e;if(!this[u].has(i))if(this[u].has("view"))e=e.createViewTranscoder();else if(this[u].has("buffer"))e=e.createBufferTranscoder();else{if(!this[u].has("utf8"))throw new n(`Encoding '${r}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});e=e.createUTF8Transcoder()}for(const n of[t,r,e.name,e.commonName])this[l].set(n,e)}return e}};const f={binary:i.buffer,"utf-8":i.utf8},p={...i,...f};let d=0},8110:(t,e,r)=>{const n=r(266),i=new Set(["buffer","view","utf8"]);e.Encoding=class{constructor(t){if(this.encode=t.encode||this.encode,this.decode=t.decode||this.decode,this.name=t.name||this.name,this.format=t.format||this.format,"function"!=typeof this.encode)throw new TypeError("The 'encode' property must be a function");if("function"!=typeof this.decode)throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),"string"!=typeof this.name||""===this.name)throw new TypeError("The 'name' property must be a string");if("string"!=typeof this.format||!i.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");t.createViewTranscoder&&(this.createViewTranscoder=t.createViewTranscoder),t.createBufferTranscoder&&(this.createBufferTranscoder=t.createBufferTranscoder),t.createUTF8Transcoder&&(this.createUTF8Transcoder=t.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}}},4341:(t,e,r)=>{const{Buffer:n}=r(8287)||{Buffer:{isBuffer:()=>!1}},{textEncoder:i,textDecoder:o}=r(7200)(),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=t=>t;e.utf8=new c({encode:function(t){return n.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?o.decode(t):String(t)},decode:u,name:"utf8",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:function(t){return o.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}}),e.json=new c({encode:JSON.stringify,decode:JSON.parse,name:"json"}),e.buffer=new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:"buffer",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:n.from(String(t),"utf8")},decode:function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}}),e.view=new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:u,name:"view",createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:`${this.name}+buffer`})}}),e.hex=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"}),e.base64=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})},8343:(t,e,r)=>{const{Buffer:n}=r(8287)||{},{Encoding:i}=r(8110),o=r(7200);class s extends i{constructor(t){super({...t,format:"buffer"})}createViewTranscoder(){return new a({encode:this.encode,decode:t=>this.decode(n.from(t.buffer,t.byteOffset,t.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}}class a extends i{constructor(t){super({...t,format:"view"})}createBufferTranscoder(){return new s({encode:t=>{const e=this.encode(t);return n.from(e.buffer,e.byteOffset,e.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}}e.BufferFormat=s,e.ViewFormat=a,e.UTF8Format=class extends i{constructor(t){super({...t,format:"utf8"})}createBufferTranscoder(){return new s({encode:t=>n.from(this.encode(t),"utf8"),decode:t=>this.decode(t.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){const{textEncoder:t,textDecoder:e}=o();return new a({encode:e=>t.encode(this.encode(e)),decode:t=>this.decode(e.decode(t)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}}},7200:t=>{let e=null;t.exports=function(){return null===e&&(e={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),e}},266:t=>{t.exports=class extends Error{constructor(t,e){super(t||""),"object"==typeof e&&null!==e&&(e.code&&(this.code=String(e.code)),e.expected&&(this.expected=!0),e.transient&&(this.transient=!0),e.cause&&(this.cause=e.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},8508:function(t,e){!function(t){const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.ngraminator=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()},Object.defineProperty(t,"__esModule",{value:!0})}(e)},8859:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,E=String.prototype.toUpperCase,w=String.prototype.toLowerCase,T=RegExp.prototype.test,A=Array.prototype.concat,S=Array.prototype.join,O=Array.prototype.slice,I=Math.floor,_="function"==typeof BigInt?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,N="function"==typeof Symbol&&"object"==typeof Symbol.iterator,U="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||T.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-I(-t):I(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var R=r(2634),B=R.custom,F=$(B)?B:null;function P(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function j(t){return v.call(String(t),/"/g,""")}function M(t){return!("[object Array]"!==W(t)||U&&"object"==typeof t&&U in t)}function V(t){return!("[object RegExp]"!==W(t)||U&&"object"==typeof t&&U in t)}function $(t){if(N)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,i,a){var c=n||{};if(z(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!z(c,"customInspect")||c.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var T=String(e);return E?D(e,T):T}if("bigint"==typeof e){var I=String(e)+"n";return E?D(e,I):I}var L=void 0===c.depth?5:c.depth;if(void 0===i&&(i=0),i>=L&&L>0&&"object"==typeof e)return M(e)?"[Array]":"[Object]";var B,G=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=S.call(Array(t.indent+1)," ")}return{base:r,prev:S.call(Array(e+1),r)}}(c,i);if(void 0===a)a=[];else if(K(a,e)>=0)return"[Circular]";function H(e,r,n){if(r&&(a=O.call(a)).push(r),n){var o={depth:c.depth};return z(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),t(e,o,i+1,a)}return t(e,c,i+1,a)}if("function"==typeof e&&!V(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,H);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+S.call(et,", ")+" }":"")}if($(e)){var rt=N?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(e);return"object"!=typeof e||N?rt:Y(rt)}if((B=e)&&"object"==typeof B&&("undefined"!=typeof HTMLElement&&B instanceof HTMLElement||"string"==typeof B.nodeName&&"function"==typeof B.getAttribute)){for(var nt="<"+w.call(String(e.nodeName)),it=e.attributes||[],ot=0;ot"}if(M(e)){if(0===e.length)return"[]";var st=Z(e,H);return G&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+Q(st,G)+"]":"[ "+S.call(st,", ")+" ]"}if(function(t){return!("[object Error]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)){var at=Z(e,H);return"cause"in Error.prototype||!("cause"in e)||C.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+S.call(at,", ")+" }":"{ ["+String(e)+"] "+S.call(A.call("[cause]: "+H(e.cause),at),", ")+" }"}if("object"==typeof e&&y){if(F&&"function"==typeof e[F]&&R)return R(e,{depth:L-i});if("symbol"!==y&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return s&&s.call(e,(function(t,r){ct.push(H(r,e,!0)+" => "+H(t,e))})),J("Map",o.call(e),ct,G)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(H(t,e))})),J("Set",u.call(e),ut,G)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(Number(e)));if(function(t){if(!t||"object"!=typeof t||!_)return!1;try{return _.call(t),!0}catch(t){}return!1}(e))return Y(H(_.call(e)));if(function(t){return!("[object Boolean]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(d.call(e));if(function(t){return!("[object String]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)&&!V(e)){var lt=Z(e,H),ht=k?k(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!ht&&U&&Object(e)===e&&U in e?b.call(W(e),8,-1):ft?"Object":"",dt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+S.call(A.call([],pt||[],ft||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":G?dt+"{"+Q(lt,G)+"}":dt+"{ "+S.call(lt,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return G.call(t,e)}function W(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return P(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,H),"single",e)}function H(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+E.call(e.toString(16))}function Y(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):S.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+S.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=M(t),n=[];if(r){n.length=t.length;for(var i=0;i{var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(3474),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y0)for(var g=0;g{var n=Array.prototype.slice,i=r(3474),o=Object.keys,s=o?function(t){return o(t)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},3474:t=>{var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6578:t=>{t.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},5372:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,c,u,l=!0;function h(t){function e(){r&&r(t,i),r=null}l?n(e):e()}function f(e,r,n){if(i[e]=n,r&&(c=!0),0==--s||r)h(r);else if(!c&&u{var n=r(453)("%Array.prototype.concat%"),i=r(487),o=r(8075)("Array.prototype.slice"),s=r(1333)()&&Symbol.isConcatSpreadable,a=[],c=s?i.apply(n,a):null,u=s?r(4634):null;t.exports=s?function(t){for(var e=0;e{var n=r(8075),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==o(t,e)}}},6897:(t,e,r)=>{var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&s){var l=s(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},8206:(t,e,r)=>{var n=r(5388),i=r(4810),o=r(8075)("String.prototype.replace"),s=/^\s$/.test("᠎"),a=s?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=s?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=i(n(this));return o(o(t,a,""),c,"")}},214:(t,e,r)=>{var n=r(487),i=r(8452),o=r(5388),s=r(8206),a=r(4895),c=r(9377),u=n(a()),l=function(t){return o(t),u(t)};i(l,{getPolyfill:a,implementation:s,shim:c}),t.exports=l},4895:(t,e,r)=>{var n=r(8206);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9377:(t,e,r)=>{var n=r(8452),i=r(4895);t.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1093:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var o=i.slice(n,n+e);o.length===e&&(r=JSON.stringify(o),t[r]=t[r]||[],t[r].push(n))})),t)),{});return Object.keys(r).map((t=>({term:JSON.parse(t),positions:r[t]}))).sort(((t,e)=>t.term[0]>e.term[0]))}},6623:(t,e,r)=>{var n=r(5767),i=r(3432),o=r(5795);function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function c(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r2?arguments[2]:y,l=s.includeSymbols?f:u,h=!!s.immutable;return function t(u){var f=h?d(u,s):u,y={},g=!0,m={node:f,node_:u,path:[].concat(r),parent:n[n.length-1],parents:n,key:r[r.length-1],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(g=!1)},delete:function(t){delete m.parent.node[m.key],t&&(g=!1)},remove:function(t){a(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(g=!1)},keys:null,before:function(t){y.before=t},after:function(t){y.after=t},pre:function(t){y.pre=t},post:function(t){y.post=t},stop:function(){i=!1},block:function(){g=!1}};if(!i)return m;function b(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=l(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t1?arguments[1]:y,this.value=t}function b(t){return new m(t,arguments.length>1?arguments[1]:y)}m.prototype.get=function(t){for(var e=this.value,r=0;e&&r{var n=r(9675),i=r(8075)("TypedArray.prototype.buffer",!0),o=r(5680);t.exports=i||function(t){if(!o(t))throw new n("Not a Typed Array");return t.buffer}},2308:(t,e,r)=>{var n=r(2682),i=r(487),o=r(9209)(),s={},a=r(24)(),c=r(5795),u=Object.defineProperty;if(c){var l=function(t){return t.byteOffset};n(o,(function(t){if("function"==typeof r.g[t]||"object"==typeof r.g[t]){var e=r.g[t].prototype,n=c(e,"byteOffset");if(!n&&a){var o=e.__proto__;n=c(o,"byteOffset")}if(n&&n.get)s[t]=i(n.get);else if(u){var h=new r.g[t](2);(n=c(h,"byteOffset"))&&n.configurable&&u(h,"length",{value:3}),2===h.length&&(s[t]=l)}}}))}var h=r(5680);t.exports=function(t){return!!h(t)&&function(t){var e;return n(s,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},6058:(t,e,r)=>{var n=r(487),i=r(2682),o=r(5795),s=r(24)(),a=r(5680),c=r(6578),u={__proto__:null},l=Object.defineProperty;if(o){var h=function(t){return t.length};i(c,(function(t){var e=r.g[t];if("function"==typeof e||"object"==typeof e){var i=e.prototype,a=o(i,"length");if(!a&&s){var c=i.__proto__;a=o(c,"length")}if(a&&a.get)u["$"+t]=n(a.get);else if(l){var f=new r.g[t](2);(a=o(f,"length"))&&a.configurable&&l(f,"length",{value:3}),2===f.length&&(u["$"+t]=h)}}}))}t.exports=function(t){return!!a(t)&&function(t){var e;return i(u,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},8268:(t,e,r)=>{var n=r(9675),i=r(280),o=r(2282),s=r(5910),a=r(4470),c=r(1752),u=r(2076),l=r(2138),h=r(7196),f=r(4810),p=r(4742),d=r(6419),y=r(7057),g=r(1509),m=r(4372),b=r(2308);t.exports=function(t,e){var r=this;g(r,"SEQ-CST");var v,E=r.length,w=h(t);v=w===-1/0?0:w<0?a(E+w,0):c(w,E);var T,A=void 0===e?E:h(e);T=A===-1/0?0:A<0?a(E+A,0):c(A,E);var S=a(T-v,0),O=y(r,[S]);if(S>0){if(s(m(r)))throw new n("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");if(d(r)===d(O))for(var I=m(r),_=m(O),L=p(r),x=v*L+b(r),N=b(O),U=N+S*L;N{var n=r(8452),i=r(487),o=r(8268),s=r(2521),a=r(8599),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},2521:(t,e,r)=>{var n=r(8268);t.exports=function(){return"function"==typeof Uint8Array&&Uint8Array.prototype.slice||n}},8599:(t,e,r)=>{var n=r(8452),i=r(6763),o=r(2521);t.exports=function(){if("function"==typeof Uint8Array){var t=o(),e=i(Uint8Array.prototype);n(e,{slice:t},{slice:function(){return e.slice!==t}})}return t}},5767:(t,e,r)=>{var n=r(2682),i=r(9209),o=r(487),s=r(8075),a=r(5795),c=s("Object.prototype.toString"),u=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),f=s("String.prototype.slice"),p=Object.getPrototypeOf,d=s("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(y,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(y,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},2634:()=>{},9209:(t,e,r)=>{var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{var n=r(9675),i=r(5910),o=r(4670),s=r(7070),a=r(9511);t.exports=function(t,e){var r=s(t);if(!o(t)&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(i(t))throw new n("Assertion failed: `arrayBuffer` must not be detached");return a(t)}},9969:(t,e,r)=>{var n=r(453)("%BigInt%",!0),i=r(9290),o=r(9675),s=n&&n(0);t.exports=function(t,e){if("bigint"!=typeof t||"bigint"!=typeof e)throw new o("Assertion failed: `n` and `d` arguments must be BigInts");if(e===s)throw new i("Division by zero");return t===s?s:t%e}},893:(t,e,r)=>{var n=r(9675),i=r(5701),o=r(4769),s=r(7030),a=r(8131),c=r(3400),u=r(2875),l=r(259),h=r(7730);t.exports=function(t,e,r){if("Object"!==h(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var f=i(r)?r:l(r);if(!i(f))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(a,u,s,t,e,f)}},7030:(t,e,r)=>{var n=r(9675),i=r(5701),o=r(2997);t.exports=function(t){if(void 0!==t&&!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return o(t)}},280:(t,e,r)=>{var n=r(9675),i=r(8859),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!o(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+i(e));return t[e]}},2282:(t,e,r)=>{var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(8075)("Array.prototype.slice"),c=r(1087),u=r(5910),l=r(6167),h=r(4670),f=r(7070),p=r(4399),d=r(4097),y=r(5100);t.exports=function(t,e,r,n,g){var m=f(t);if(!h(t)&&!m)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!c(e))throw new o("Assertion failed: `byteIndex` must be an integer");if("string"!=typeof r||"number"!=typeof d.size["$"+r])throw new o("Assertion failed: `type` must be a Typed Array element type");if("boolean"!=typeof n)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==g&&"UNORDERED"!==g)throw new o("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&"boolean"!=typeof arguments[5])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: `arrayBuffer` is detached");if(e<0)throw new o("Assertion failed: `byteIndex` must be non-negative");var b,v=d.size["$"+r];if(!v)throw new o('Assertion failed: `type` must be one of "INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"');if(m)throw new i("SharedArrayBuffer is not supported by this implementation");b=a(new s(t,e),0,v);var E=arguments.length>5?arguments[5]:"little"===y,w=E?a(p([0,0,0,0,0,0,0,0],b),-v):a(p(b,[0,0,0,0,0,0,0,0]),0,v);return l(r,w,E)}},2491:(t,e,r)=>{var n=r(9675),i=r(9957),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");return i(t,e)}},533:(t,e,r)=>{t.exports=r(1412)},7881:t=>{t.exports=function(t){return"BIGUINT64"===t||"BIGINT64"===t}},6966:(t,e,r)=>{t.exports=r(9600)},4528:(t,e,r)=>{var n=r(1376)("%Reflect.construct%",!0),i=r(893);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},8131:(t,e,r)=>{var n=r(9675),i=r(9957),o=r(5701);t.exports=function(t){if(void 0===t)return!1;if(!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!i(t,"[[Value]]")&&!i(t,"[[Writable]]"))}},5910:(t,e,r)=>{var n=r(9675),i=r(9511),o=r(9209)(),s=r(8075),a=r(4670),c=r(7070),u=s("SharedArrayBuffer.prototype.byteLength",!0);t.exports=function(t){var e=c(t);if(!a(t)&&!e)throw new n("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if(0===(e?u:i)(t))try{new r.g[o[0]](t)}catch(t){return!!t&&"TypeError"===t.name}return!1}},6575:(t,e,r)=>{var n=r(9675),i=r(8075),o=i("%ArrayBuffer.prototype.resizable%",!0),s=i("%SharedArrayBuffer.prototype.growable%",!0),a=r(4670),c=r(7070);t.exports=function(t){var e=a(t),r=c(t);if(!e&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return e&&o?!o(t):!r||!s||!s(t)}},3400:t=>{t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},5291:(t,e,r)=>{var n=r(9675),i=r(5910),o=r(4742),s=r(9346),a=r(4372),c=r(2308),u=r(6058);t.exports=function(t){if(!s(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var e=t["[[Object]]"],r=t["[[CachedBufferByteLength]]"];if(i(a(e))&&"DETACHED"!==r)throw new n("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if("DETACHED"===r)return!0;var l,h=c(e),f=u(e);return l="AUTO"===f?r:h+f*o(e),h>r||l>r}},9373:t=>{t.exports=function(t){return"UINT8"===t||"UINT8C"===t||"UINT16"===t||"UINT32"===t||"BIGUINT64"===t}},6681:(t,e,r)=>{var n=r(9675),i=r(7149),o=r(5910),s=r(5680),a=r(4372);t.exports=function(t,e){if(!s(t))throw new n("Assertion failed: `obj` must be a Typed Array");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var r=a(t);return{"[[Object]]":t,"[[CachedBufferByteLength]]":o(r)?"DETACHED":i(r,e)}}},5015:(t,e,r)=>{var n=r(9675),i=r(2491),o=r(3446),s=r(9887),a=r(3557),c=r(2475),u=r(7088),l=r(172),h=r(4770),f=r(6039),p=r(9308),d=r(2779),y=r(8894),g=r(4751),m=r(1189),b={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8},v={__proto__:null,INT8:u,UINT8:f,UINT8C:p,INT16:a,UINT16:l,INT32:c,UINT32:h,BIGINT64:o,BIGUINT64:s};t.exports=function(t,e,r){if("string"!=typeof t||!i(b,t))throw new n("Assertion failed: `type` must be a TypedArray element type: "+m(b));if("number"!=typeof e&&"bigint"!=typeof e)throw new n("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof r)throw new n("Assertion failed: `isLittleEndian` must be a Boolean");if("FLOAT32"===t)return d(e,r);if("FLOAT64"===t)return y(e,r);var o=b[t],s=(0,v[t])(e);return g(s,o,r)}},6167:(t,e,r)=>{var n=r(453),i=r(8075),o=r(9290),s=r(8068),a=r(9675),c=n("%BigInt%",!0),u=r(2491),l=r(533),h=r(7881),f=r(9373),p=r(4915),d=r(8968),y=r(6570),g=r(4138),m=r(2158),b=i("Array.prototype.reverse"),v=i("Array.prototype.slice"),E=r(1189),w={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8};t.exports=function(t,e,r){if(!u(w,t))throw new a("Assertion failed: `type` must be a TypedArray element type: "+E(w));if(!l(e)||!g(e,m))throw new a("Assertion failed: `rawBytes` must be an Array of bytes");if("boolean"!=typeof r)throw new a("Assertion failed: `isLittleEndian` must be a Boolean");var n=w[t];if(e.length!==n)throw new o("Assertion failed: `rawBytes` must have a length of "+n+" for type "+t);var i=h(t);if(i&&!c)throw new s("this environment does not support BigInts");return e=v(e,0,n),r||b(e),"FLOAT32"===t?p(e):"FLOAT64"===t?d(e):y(e,n,f(t),i)}},2875:(t,e,r)=>{var n=r(8756);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},2076:(t,e,r)=>{var n=r(9675),i=r(3400),o=r(2875),s=r(7730),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof c)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},2138:(t,e,r)=>{var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(1087),c=r(7881),u=r(5910),l=r(5015),h=r(4670),f=r(7070),p=r(9957),d=r(4097),y=r(5100),g=r(3795);t.exports=function(t,e,r,n,m,b){var v=f(t);if(!h(t)&&!v)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!a(e)||e<0)throw new o("Assertion failed: `byteIndex` must be a non-negative integer");if("string"!=typeof r||!p(d.size,"$"+r))throw new o("Assertion failed: `type` must be a Typed Array Element Type");if("number"!=typeof n&&"bigint"!=typeof n)throw new o("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof m)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==b&&"UNORDERED"!==b&&"INIT"!==b)throw new o('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: ArrayBuffer is detached");if(c(r)?"bigint"!=typeof n:"number"!=typeof n)throw new o("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var E=d.size["$"+r],w=l(r,n,arguments.length>6?arguments[6]:"little"===y);if(v)throw new i("SharedArrayBuffer is not supported by this implementation");var T=new s(t,e,E);g(w,(function(t,e){T[e]=t}))}},7732:(t,e,r)=>{var n=r(453)("%Symbol.species%",!0),i=r(9675),o=r(4528),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var a=n?r[n]:void 0;if(null==a)return e;if(o(a))return a;throw new i("no constructor found")}},9693:(t,e,r)=>{var n=r(453)("%BigInt%",!0),i=r(9675),o=r(8068);t.exports=function(t){if("string"!=typeof t)throw new i("`argument` must be a string");if(!n)throw new o("BigInts are not supported in this environment");try{return n(t)}catch(t){return}}},8679:(t,e,r)=>{var n=r(453),i=n("%Number%"),o=n("%RegExp%"),s=r(9675),a=n("%parseInt%"),c=r(8075),u=r(9721),l=c("String.prototype.slice"),h=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),y=r(214);t.exports=function t(e){if("string"!=typeof e)throw new s("Assertion failed: `argument` is not a String");if(h(e))return i(a(l(e,2),2));if(f(e))return i(a(l(e,2),8));if(d(e)||p(e))return NaN;var r=y(e);return r!==e?t(r):i(e)}},2964:(t,e,r)=>{var n=r(453),i=n("%BigInt%",!0),o=n("%Number%"),s=r(9675),a=r(8068),c=r(9693),u=r(866);t.exports=function(t){if(!i)throw new a("BigInts are not supported in this environment");var e=u(t,o);if(null==e)throw new s("Cannot convert null or undefined to a BigInt");if("boolean"==typeof e)return i(e?1:0);if("number"==typeof e)throw new s("Cannot convert a Number value to a BigInt");if("string"==typeof e){var r=c(e);if(void 0===r)throw new s("Failed to parse String to BigInt");return r}if("symbol"==typeof e)throw new s("Cannot convert a Symbol value to a BigInt");if("bigint"!=typeof e)throw new a("Assertion failed: unknown primitive type");return e}},3446:(t,e,r)=>{var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,31)),l=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t),r=c(a,e,l);return r>=u?r-l:r}},9887:(t,e,r)=>{var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t);return c(a,e,u)}},4323:t=>{t.exports=function(t){return!!t}},3557:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return a>=32768?a-65536:a}},2475:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046),a=4294967296;t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),c=n(r,a),u=c>=2147483648?c-a:c;return 0===u?0:u}},7088:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,256);return a>=128?a-256:a}},7196:(t,e,r)=>{var n=r(8410),i=r(3384),o=r(8756),s=r(5046);t.exports=function(t){var e=n(t);return o(e)||0===e?0:s(e)?i(e):e}},8410:(t,e,r)=>{var n=r(453),i=r(9675),o=n("%Number%"),s=r(6600),a=r(866),c=r(8679);t.exports=function(t){var e=s(t)?t:a(t,o);if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):o(e)}},866:(t,e,r)=>{var n=r(5437);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},259:(t,e,r)=>{var n=r(9957),i=r(9675),o=r(7730),s=r(4323),a=r(6966);t.exports=function(t){if("Object"!==o(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!a(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},4810:(t,e,r)=>{var n=r(453)("%String%"),i=r(9675);t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return n(t)}},172:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return 0===a?0:a}},4770:(t,e,r)=>{var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,4294967296);return 0===a?0:a}},6039:(t,e,r)=>{var n=r(5046),i=r(4224),o=r(8410),s=r(3384);t.exports=function(t){var e=o(t);if(!n(e)||0===e)return 0;var r=s(e);return i(r,256)}},9308:(t,e,r)=>{var n=r(9719),i=r(8410),o=r(5986),s=r(8756);t.exports=function(t){var e=i(t);if(s(e))return 0;var r=n(e,0,255),a=o(r);return ra+.5?a+1:a%2==0?a:a+1}},7730:(t,e,r)=>{var n=r(2439);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},9531:(t,e,r)=>{var n=r(8068),i=r(9675),o=r(533),s=r(4528),a=r(5291),c=r(9271),u=r(1509),l=r(9209)();t.exports=function(t,e){if(!s(t))throw new i("Assertion failed: `constructor` must be a constructor");if(!o(e))throw new i("Assertion failed: `argumentList` must be a List");if(0===l.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r;r=0===e.length?new t:1===e.length?new t(e[0]):2===e.length?new t(e[0],e[1]):new t(e[0],e[1],e[2]);var h=u(r,"SEQ-CST");if(1===e.length&&"number"==typeof e[0]){if(a(h))throw new i("new Typed Array is out of bounds");if(c(h){var n=r(8068),i=r(9675),o=r(1087),s=r(5767),a=r(4097);t.exports=function(t){var e=s(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=a.size["$"+a.name["$"+e]];if(!o(r)||r<0)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},6419:(t,e,r)=>{var n=r(8068),i=r(9675),o=r(5767),s=r(4097);t.exports=function(t){var e=o(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=s.name["$"+e];if("string"!=typeof r)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},9271:(t,e,r)=>{var n=r(9675),i=r(5986),o=r(6575),s=r(5291),a=r(4742),c=r(9346),u=r(4372),l=r(2308),h=r(6058);t.exports=function(t){if(!c(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(s(t))throw new n("Assertion failed: `taRecord` is out of bounds");var e=t["[[Object]]"],r=h(e);if("AUTO"!==r)return r;if(o(u(e)))throw new n("Assertion failed: array buffer is not fixed length");var f=l(e),p=a(e),d=t["[[CachedBufferByteLength]]"];if("DETACHED"===d)throw new n("Assertion failed: typed array is detached");return i((d-f)/p)}},7057:(t,e,r)=>{var n=r(8068),i=r(9675),o=r(5767),s=r(9209)(),a=r(533),c=r(7732),u=r(9531),l=r(2697);t.exports=function(t,e){if(0===s.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r=o(t);if(!r)throw new i("Assertion failed: exemplar must be a TypedArray");if(!a(e))throw new i("Assertion failed: `argumentList` must be a List");var h=l(r);if("function"!=typeof h)throw new n("Assertion failed: `constructor` of `exemplar` ("+r+") must exist. Please report this!");var f=c(t,h);return u(f,e)}},1509:(t,e,r)=>{var n=r(9675),i=r(5291),o=r(6681),s=r(7730),a=r(5680);t.exports=function(t,e){if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!a(t))throw new n("Assertion failed: `O` must be a Typed Array");var r=o(t,e);if(i(r))throw new n("`O` must be in-bounds and backed by a non-detached buffer");return r}},9719:(t,e,r)=>{var n=r(453),i=r(9675),o=n("%Math.max%"),s=n("%Math.min%");t.exports=function(t,e,r){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof r||!(e<=r))throw new i("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return s(o(e,t),r)}},5986:t=>{var e=Math.floor;t.exports=function(t){return"bigint"==typeof t?t:e(t)}},4470:(t,e,r)=>{var n=r(453);t.exports=n("%Math.max%")},1752:(t,e,r)=>{var n=r(453);t.exports=n("%Math.min%")},4224:(t,e,r)=>{var n=r(113);t.exports=function(t,e){return n(t,e)}},4097:t=>{t.exports={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8}}},3384:(t,e,r)=>{var n=r(5986),i=r(9675);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2439:t=>{t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},1376:(t,e,r)=>{t.exports=r(453)},4769:(t,e,r)=>{var n=r(592),i=r(655),o=n.hasArrayLengthDefineBug(),s=o&&r(1412),a=r(8075)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,c,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(c in n&&a(n,c)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[c]=l,e(n[c],l)}return o&&"length"===c&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,c,r(u)),!0)}},1412:(t,e,r)=>{var n=r(453)("%Array%"),i=!n.isArray&&r(8075)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4915:(t,e,r)=>{var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[3]?-1:1,r=(127&t[3])<<1|t[2]>>7,i=(127&t[2])<<16|t[1]<<8|t[0];return 0===r&&0===i?1===e?0:-0:255===r&&0===i?1===e?1/0:-1/0:255===r&&0!==i?NaN:-127==(r-=127)?e*i*n(2,-149):e*(1+i*n(2,-23))*n(2,r)}},8968:(t,e,r)=>{var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[7]?-1:1,r=(127&t[7])<<4|(240&t[6])>>4,i=281474976710656*(15&t[6])+1099511627776*t[5]+4294967296*t[4]+16777216*t[3]+65536*t[2]+256*t[1]+t[0];return 0===r&&0===i?0*e:2047===r&&0!==i?NaN:2047===r&&0===i?e*(1/0):-1023==(r-=1023)?e*i*5e-324:e*(1+i/4503599627370496)*n(2,r)}},6570:(t,e,r)=>{var n=r(453),i=n("%Math.pow%"),o=n("%Number%"),s=n("%BigInt%",!0);t.exports=function(t,e,r,n){for(var a=n?s:o,c=a(0),u=0;u{var n=r(453),i=n("%Uint8Array%",!0),o=n("%Uint32Array%",!0),s=r(4372),a=o&&new o([305419896]),c=a&&new i(s(a));t.exports=c?120===c[0]?"little":18===c[0]?"big":52===c[0]?"mixed":"unknown":"indeterminate"},4138:t=>{t.exports=function(t,e){for(var r=0;r{t.exports=function(t,e){for(var r=0;r{var e=1075;t.exports=function(t){var r="";if(0===t)return r;for(var n,i=e,o=0;o=1?(t=n-1,r+="1",i===e&&(i=o)):(t=n,r+="0"),1===n||o-i>54)return r;return r}},2997:t=>{t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},6763:(t,e,r)=>{var n=r(453)("%Object.getPrototypeOf%",!0),i=r(24)();t.exports=n||(i?function(t){return t.__proto__}:null)},8213:(t,e,r)=>{var n=r(453)("%Math.floor%");t.exports=function(t){for(var e,r="";t>0;)r=(e=t/2)===(t=n(e))?"0"+r:"1"+r;return r}},4751:(t,e,r)=>{var n=r(453),i=n("%Number%"),o=n("%BigInt%",!0);t.exports=function(t,e,r){var n="bigint"==typeof t?o:i;t<0&&(t>>>=0);for(var s=[],a=0;a>=n(8);return s}},2158:t=>{t.exports=function(t){return"number"==typeof t&&t>=0&&t<=255&&(0|t)===t}},5046:(t,e,r)=>{var n=r(8756);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1087:(t,e,r)=>{var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=r(8756),a=r(5046);t.exports=function(t){if("number"!=typeof t||s(t)||!a(t))return!1;var e=i(t);return o(e)===e}},8756:t=>{t.exports=Number.isNaN||function(t){return t!=t}},3508:t=>{t.exports=function(t){return 0===t&&1/t==-1/0}},6600:t=>{t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},113:t=>{var e=Math.floor;t.exports=function(t,r){var n=t%r;return e(n>=0?n:n+r)}},122:t=>{t.exports=function(t,e,r){var n=t(e,r);return n>=0?n:n+r}},5701:(t,e,r)=>{var n=r(9675),i=r(9957),o={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(i(t,e)&&!o[e])return!1;var r=i(t,"[[Value]]")||i(t,"[[Writable]]"),s=i(t,"[[Get]]")||i(t,"[[Set]]");if(r&&s)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}},9346:(t,e,r)=>{var n=r(9957),i=r(5680),o=r(1087);t.exports=function(t){return!!t&&"object"==typeof t&&n(t,"[[Object]]")&&n(t,"[[CachedBufferByteLength]]")&&(o(t["[[CachedBufferByteLength]]"])&&t["[[CachedBufferByteLength]]"]>=0||"DETACHED"===t["[[CachedBufferByteLength]]"])&&i(t["[[Object]]"])}},2697:(t,e,r)=>{var n=r(453),i={__proto__:null,$Int8Array:n("%Int8Array%",!0),$Uint8Array:n("%Uint8Array%",!0),$Uint8ClampedArray:n("%Uint8ClampedArray%",!0),$Int16Array:n("%Int16Array%",!0),$Uint16Array:n("%Uint16Array%",!0),$Int32Array:n("%Int32Array%",!0),$Uint32Array:n("%Uint32Array%",!0),$BigInt64Array:n("%BigInt64Array%",!0),$BigUint64Array:n("%BigUint64Array%",!0),$Float32Array:n("%Float32Array%",!0),$Float64Array:n("%Float64Array%",!0)};t.exports=function(t){return i["$"+t]}},2779:(t,e,r)=>{var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=n("%Math.pow%"),a=r(5046),c=r(8756),u=r(3508);t.exports=function(t,e){if(c(t))return e?[0,0,192,127]:[127,192,0,0];var r;if(0===t)return r=u(t)?128:0,e?[0,0,0,r]:[r,0,0,0];if(i(t)>34028234663852886e22||!a(t))return r=t<0?255:127,e?[0,0,128,r]:[r,128,0,0];var n=t<0?1:0;t=i(t);for(var l=0;t>=2;)l+=1,t/=2;for(;t<1;)l-=1,t*=2;var h=t-1;h*=s(2,23)+.5,l+=127;var f=n<<31|(l<<=23)|(h=o(h)),p=255&f,d=255&(f>>=8),y=255&(f>>=8),g=255&(f>>=8);return e?[p,d,y,g]:[g,y,d,p]}},8894:(t,e,r)=>{var n=r(453),i=n("%parseInt%"),o=n("%Math.abs%"),s=n("%Math.floor%"),a=r(8075),c=a("String.prototype.indexOf"),u=a("String.prototype.slice"),l=r(9154),h=r(8213),f=r(3508),p="11111111111",d="00000000000",y=d+d+d+d+"0000000";t.exports=function(t,e){var r,n,a=t<0||f(t)?"1":"0";if(isNaN(t))r=p,n="1"+y;else if(isFinite(t))if(0===t)r=d,n="0"+y;else{t=o(t);var g,m=s(t),b=h(m),v=l(t-m);if(b)r=b.length-1;else{var E=c(v,"1");E>-1&&(g=E+1),r=-g}n=b+v,r<0?(r<=-1023&&(g=1022),n=u(n,g)):n=u(n,1),r=u(d+h(r+1023),-11),n=u(n+y+"0",0,52)}else r=p,n="0"+y;for(var w=a+r+n,T=[],A=0;A<8;A++)T[e?8-A-1:A]=i(u(w,8*A,8*(A+1)),2);return T}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};r.d(n,{d:()=>tt,UI:()=>et});var i=r(1093),o=r(8508);const s=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),a=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],c=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([t,e,r])=>{const{fields:n,values:i}=r.replace,o=()=>t.reduce(((t,e)=>[e,...t,...i[e]||[]]),[]);return i?n?n.includes(e)?Promise.resolve([o(),e,r]):Promise.resolve([t,e,r]):Promise.resolve([o(),e,r]):Promise.resolve([t,e,r])},l=([t,e,r])=>{let{fields:n,lengths:i,join:s=" "}=r.ngrams;return n||(n=[e]),i&&n.includes(e)?[(0,o.ngraminator)(t.filter((t=>null!==t)),i).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},h=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],f=([t,e,r])=>{const n=i(t),o=n.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([n.map((t=>[t.term[0],(t.positions.length/o).toFixed(2)])).sort(),e,r])},p={SPLIT:s,SKIP:a,LOWCASE:c,REPLACE:u,NGRAMS:l,STOPWORDS:h,SCORE_TERM_FREQUENCY:f,SPY:([t,e,r])=>(console.log("----------------"),console.log("field ->"),console.log(e),console.log("tokens ->"),console.log(t),console.log("----------------"),Promise.resolve([t,e,r]))},d=(t,e,r)=>s([t,e,r]).then(a).then(c).then(u).then(l).then(h).then(f).then((([t,e,r])=>t));var y=r(9148),g=r(7007),m=r(9901);function b(t,e){const r=t=>"string"==typeof t,n=async(r,n=t=>new Promise((e=>e(t))))=>new Promise((async(o,a)=>{const c=t=>void 0===t?o(void 0):t instanceof Promise?o(t):void 0;try{c(r),r=e.parse(r),r=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(r),c(r=await(e=>void 0===e?s(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?i(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(r)),c(r=await n(r))}catch(t){return a(t)}return Array.isArray(r)?o(r):o(s(r))})),i=async(t,e)=>Promise.all(t.map((t=>n(t,e)))).then((t=>{const e=t.flat(1/0).reduce(((t,e)=>(e&&t.set(e._id,[...t.get(e._id)||[],e._match]),t)),new Map);return{sumTokensMinusStopwords:t.filter((t=>t)).length,union:Array.from(e.keys()).map((t=>({_id:t,_match:e.get(t)})))}})),o=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(m.HI),["IDX",t,n]},s=t=>new Promise((e=>{if(void 0===t)return e(void 0);const r=new Map;Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0),limit:t.LIMIT,reverse:t.REVERSE}).then((t=>t.forEach((t=>t.value.forEach((e=>r.set(e,[...r.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})])))))))))).then((()=>e(Array.from(r.keys()).map((t=>({_id:t,_match:r.get(t)}))))))})),a=(t,e,r=!0)=>e?0===e.length?[]:(e=new Set(e.map((t=>t._id))),t.map((t=>Object.assign(t,{_id:[...new Set([...t._id].filter((t=>e.has(t))))]}))).filter((t=>!r||t._id.length))):t,c=t=>(t=e.parse(t),n(t).then((e=>({_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE,...t})))),u=e=>t.db.iterator(e).all().then((t=>t.map((([t,e])=>({key:t,value:e}))))),l=(t,r)=>s({...e.parse(t),LIMIT:1,REVERSE:r}).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),h=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>{let r=t.VALUE.LTE;void 0!==t.VALUE.LTE&&"number"!=typeof t.VALUE.LTE&&(r+="○");let n=t.VALUE.GTE;return t.VALUE.GTE&&"number"!=typeof t.VALUE.GTE&&(n+=" "),u({gte:o(e,n),lte:o(e,r,!0),keys:!0,values:!1}).then((t=>t.map((({key:t})=>({FIELD:t[1],VALUE:t[2][0]})))))}))).then((t=>t.flat()))),f=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0)}).then((t=>t.map((t=>({FIELD:t.key[1],VALUE:t.key[2][0],_id:t.value})))))))).then((t=>t.flat()))),p=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});return{AGGREGATE:({BUCKETS:t,FACETS:e,QUERY:r})=>Promise.all([t,e,r]).then((([t=[],e=[],r=[]])=>({BUCKETS:a(t.flat(),r),FACETS:a(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:a,BUCKET:c,BUCKETS:(...t)=>Promise.all(t.map(c)),CREATED:()=>t.db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(h):[h({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),EXIST:(...e)=>Promise.all(e.map((e=>t.db.get([t.docExistsSpace,e]).catch((t=>null))))).then((t=>t.reduce(((t,r,n)=>(null!=r&&t.push(e[n]),t)),[]))),EXPORT:u,FACETS:(...t)=>Promise.all(t.length?t.map(f):[f({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:()=>u({gte:["FIELD",m.LO],lte:["FIELD",m.HI]}).then((t=>t.map((t=>t.key[1])))),GET:n,INTERSECTION:(t,e)=>i(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t.db.get(["~LAST_UPDATED"]),MAX:t=>l(t,!0),MIN:l,OBJECT:e=>Promise.all(e.map((e=>t.db.get(["DOC",e._id]).catch((t=>null))))).then((t=>e.map(((e,r)=>(e._object=t[r],e))))),SET_SUBTRACTION:(t,e)=>Promise.all([r(t)?n(t):t,r(e)?n(e):e]).then((([t,e])=>t.filter((t=>-1===e.map((t=>t._id)).indexOf(t._id))))),SORT:t=>new Promise((e=>e(t.sort(((t,e)=>p.compare(t._id,e._id)))))),UNION:i}}m.LO=null,m.HI=void 0;var v=r(6623);const E=null,w=void 0;class T{availableFields=[];#t;constructor(t){this.#t=t}setAvailableFields=t=>{this.availableFields=t};#e=t=>{const e=t=>this.#t||"string"!=typeof t?t:t.toLowerCase();return{FIELD:t.FIELD.map(e),VALUE:{GTE:e(t.VALUE.GTE),LTE:e(t.VALUE.LTE)}}};parse(t){if(Array.isArray(t))throw new Error("token cannot be Array");if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return this.#e({FIELD:this.availableFields,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return this.#e({FIELD:[e],VALUE:{GTE:r.join(":"),LTE:r.join(":")}})}return"number"==typeof t&&(t={VALUE:{GTE:t,LTE:t}}),null===t.VALUE&&(t.VALUE={GTE:null,LTE:null}),"string"!=typeof t.VALUE&&"number"!=typeof t.VALUE||(t.VALUE={GTE:t.VALUE,LTE:t.VALUE}),void 0!==t.VALUE&&Object.keys(t.VALUE).length||(t.VALUE={GTE:E,LTE:w}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=E),void 0===t.VALUE.LTE&&(t.VALUE.LTE=w),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?this.#e({FIELD:this.availableFields,...t}):(t.FIELD=[t.FIELD].flat(),this.#e(t))}}class A{constructor(t={}){t={caseSensitive:!0,isLeaf:t=>"string"==typeof t||"number"==typeof t,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC",db:new t.Level(t.name,{keyEncoding:m,valueEncoding:"json"}),...t};const e=new T(t.caseSensitive),r=new g,n=b(t,e),i=function(t,e,r){let n=0;const i=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const n=[];return v(e._object).forEach((function(e){const i=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"!==i&&!r.doNotIndexField.filter((t=>i.startsWith(t))).length&&t.isLeaf(this.node)){if(!t.stopwords.includes(this.node)){const e=JSON.stringify([i,[this.node].flat(1/0).map((e=>"string"!=typeof e||t.caseSensitive?e:e.toLowerCase()))]);n.push(t.caseSensitive?e:e.toLowerCase())}this.update(this.node,!0)}})),{_id:e._id,keys:n}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(e,r,s,a,c)=>new Promise((u=>{e=e.map((t=>{var e;return t._id=void 0===(e=t._id)?++n:"string"==typeof e||"number"==typeof e?e:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),b(t).EXIST(...e.map((t=>t._id))).then((t=>((t,e,r)=>{const n=Object.keys(t);return Promise.all(n.map((t=>["IDX",...JSON.parse(t)])).map((t=>new Promise(((r,n)=>e.get(t).then(r).catch((t=>r([])))))))).then((e=>e.map(((e,i)=>{const o=new Set(e),s=new Set(t[n[i]]);if("put"===r)return{key:["IDX",...JSON.parse(n[i])],type:r,value:[...new Set([...o,...s])].sort()};if("del"===r){const t=[...new Set([...o].filter((t=>!s.has(t))))];return{key:["IDX",...JSON.parse(n[i])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>i(t,e))).reduce(o,{}))(e,c),r,s).then((n=>r.batch(n.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(e,s):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(n)),(r=>u(e.map((e=>{let r;return"put"===s?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===s&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:a,status:r}})))))))))})),a=()=>(new Date).toISOString(),c=e=>t.db.put(["~LAST_UPDATED"],a()).then((()=>e));return{DELETE:e=>b(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t.db,"del","DELETE",{}))).then(c),IMPORT:r=>t.db.clear().then((()=>t.db.batch(r.map((t=>Object.assign(t,{type:"put"})))))).then((()=>b(t).FIELDS())).then((t=>e.setAvailableFields(t))),PUT:(r,n={})=>s(r.map((t=>({_id:t._id,_object:t}))),t.db,"put","PUT",n).then(c).then((async r=>(e.setAvailableFields(await b(t).FIELDS()),r))),TIMESTAMP:()=>t.db.get(["~CREATED"]).then().catch((e=>t.db.put(["~CREATED"],a()).then(c).then((()=>r.emit("ready"))))),TIMESTAMP_LAST_UPDATED:c}}(t,e,r);i.TIMESTAMP(),this.AGGREGATION_FILTER=n.AGGREGATION_FILTER,this.AND=(t,e)=>n.INTERSECTION(t,e).then(this.flattenMatchArrayInResults),this.BUCKET=n.BUCKET,this.BUCKETS=n.BUCKETS,this.CREATED=n.CREATED,this.DELETE=i.DELETE,this.DISTINCT=n.DISTINCT,this.EVENTS=r,this.EXIST=n.EXIST,this.EXPORT=n.EXPORT,this.FACETS=n.FACETS,this.FIELDS=n.FIELDS,this.GET=(t,e)=>n.GET(t,e).then(this.flattenMatchArrayInResults),this.IMPORT=i.IMPORT,this.LAST_UPDATED=n.LAST_UPDATED,this.MAX=n.MAX,this.MIN=n.MIN,this.NOT=(...t)=>n.SET_SUBTRACTION(...t).then(this.flattenMatchArrayInResults),this.OBJECT=n.OBJECT,this.OR=(t,e)=>n.UNION(t,e).then((t=>t.union)).then(this.flattenMatchArrayInResults),this.PUT=i.PUT,this.SORT=n.SORT,this.STORE=t.db,this.TIMESTAMP_LAST_UPDATED=i.TIMESTAMP_LAST_UPDATED,this.TOKEN_PARSER=e}flattenMatchArrayInResults(t){return void 0===t?void 0:t.map((t=>(t._match=t._match.flat(1/0).map((t=>"string"==typeof t?JSON.parse(t):t)).sort(((t,e)=>t.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t)))}}class S{constructor(t={}){return new A({Level:y.Z,...t})}}var O=r(5606);const I="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,_=new Set,L="object"==typeof O&&O?O:{},x=(t,e,r,n)=>{"function"==typeof L.emitWarning?L.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)};let N=globalThis.AbortController,U=globalThis.AbortSignal;if(void 0===N){U=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},N=class{constructor(){e()}signal=new U;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==L.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,x("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const C=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),k=t=>C(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?D:null:null;class D extends Array{constructor(t){super(t),this.fill(0)}}class R{heap;length;static#r=!1;static create(t){const e=k(t);if(!e)return[];R.#r=!0;const r=new R(t,e);return R.#r=!1,r}constructor(t,e){if(!R.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class B{#n;#i;#o;#s;#a;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#l;#h;#f;#p;#d;#y;#g;#m;#b;#v;#E;#w;#T;#A;#S;#O;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#T,sizes:t.#E,keyMap:t.#h,keyList:t.#f,valList:t.#p,next:t.#d,prev:t.#y,get head(){return t.#g},get tail(){return t.#m},free:t.#b,isBackgroundFetch:e=>t.#I(e),backgroundFetch:(e,r,n,i)=>t.#_(e,r,n,i),moveToTail:e=>t.#L(e),indexes:e=>t.#x(e),rindexes:e=>t.#N(e),isStale:e=>t.#U(e)}}get max(){return this.#n}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#c}get dispose(){return this.#o}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:l,noUpdateTTL:h,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:d,fetchMethod:y,memoMethod:g,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=t;if(0!==e&&!C(e))throw new TypeError("max option must be a nonnegative integer");const T=e?k(e):Array;if(!T)throw new Error("invalid max value: "+e);if(this.#n=e,this.#i=f,this.maxEntrySize=p||this.#i,this.sizeCalculation=d,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("memoMethod must be a function if defined");if(this.#c=g,void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(this.#a=y,this.#S=!!y,this.#h=new Map,this.#f=new Array(e).fill(void 0),this.#p=new Array(e).fill(void 0),this.#d=new T(e),this.#y=new T(e),this.#g=0,this.#m=0,this.#b=R.create(e),this.#u=0,this.#l=0,"function"==typeof c&&(this.#o=c),"function"==typeof u?(this.#s=u,this.#v=[]):(this.#s=void 0,this.#v=void 0),this.#A=!!this.#o,this.#O=!!this.#s,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!C(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!C(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=C(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!C(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(0===this.#n&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!_.has(t))(t)&&(_.add(t),x("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,B))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#k(){const t=new D(this.#n),e=new D(this.#n);this.#T=t,this.#w=e,this.#D=(r,n,i=I.now())=>{if(e[r]=0!==n?i:0,t[r]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.#U(r)&&this.#R(this.#f[r],"expire")}),n+1);t.unref&&t.unref()}},this.#B=r=>{e[r]=0!==t[r]?I.now():0},this.#F=(i,o)=>{if(t[o]){const s=t[o],a=e[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const c=i.now-a;i.remainingTTL=s-c}};let r=0;const n=()=>{const t=I.now();if(this.ttlResolution>0){r=t;const e=setTimeout((()=>r=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const o=this.#h.get(i);if(void 0===o)return 0;const s=t[o],a=e[o];return s&&a?s-((r||n())-a):1/0},this.#U=i=>{const o=e[i],s=t[i];return!!s&&!!o&&(r||n())-o>s}}#B=()=>{};#F=()=>{};#D=()=>{};#U=()=>!1;#C(){const t=new D(this.#n);this.#l=0,this.#E=t,this.#P=e=>{this.#l-=t[e],t[e]=0},this.#j=(t,e,r,n)=>{if(this.#I(e))return 0;if(!C(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!C(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#M=(e,r,n)=>{if(t[e]=r,this.#i){const r=this.#i-t[e];for(;this.#l>r;)this.#V(!0)}this.#l+=t[e],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#P=t=>{};#M=(t,e,r)=>{};#j=(t,e,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#m;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#g);)e=this.#y[e]}*#N({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#g;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#m);)e=this.#d[e]}#$(t){return void 0!==t&&this.#h.get(this.#f[t])===t}*entries(){for(const t of this.#x())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*rentries(){for(const t of this.#N())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*keys(){for(const t of this.#x()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*rkeys(){for(const t of this.#N()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*values(){for(const t of this.#x())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}*rvalues(){for(const t of this.#N())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0!==i&&t(i,this.#f[r],this))return this.get(this.#f[r],e)}}forEach(t,e=this){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}rforEach(t,e=this){for(const r of this.#N()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}purgeStale(){let t=!1;for(const e of this.#N({allowStale:!0}))this.#U(e)&&(this.#R(this.#f[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const r=this.#p[e],n=this.#I(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#T&&this.#w){const t=this.#T[e],r=this.#w[e];if(t&&r){const e=t-(I.now()-r);i.ttl=e,i.start=Date.now()}}return this.#E&&(i.size=this.#E[e]),i}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const r=this.#f[e],n=this.#p[e],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const o={value:i};if(this.#T&&this.#w){o.ttl=this.#T[e];const t=I.now()-this.#w[e];o.start=Math.floor(Date.now()-t)}this.#E&&(o.size=this.#E[e]),t.unshift([r,o])}return t}load(t){this.clear();for(const[e,r]of t){if(r.start){const t=Date.now()-r.start;r.start=I.now()-t}this.set(e,r.value,r)}}set(t,e,r={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#j(t,e,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#R(t,"set"),this;let l=0===this.#u?void 0:this.#h.get(t);if(void 0===l)l=0===this.#u?this.#m:0!==this.#b.length?this.#b.pop():this.#u===this.#n?this.#V(!1):this.#u,this.#f[l]=t,this.#p[l]=e,this.#h.set(t,l),this.#d[this.#m]=l,this.#y[l]=this.#m,this.#m=l,this.#u++,this.#M(l,u,a),a&&(a.set="add"),c=!1;else{this.#L(l);const r=this.#p[l];if(e!==r){if(this.#S&&this.#I(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=r;void 0===e||o||(this.#A&&this.#o?.(e,t,"set"),this.#O&&this.#v?.push([e,t,"set"]))}else o||(this.#A&&this.#o?.(r,t,"set"),this.#O&&this.#v?.push([r,t,"set"]));if(this.#P(l),this.#M(l,u,a),this.#p[l]=e,a){a.set="replace";const t=r&&this.#I(r)?r.__staleWhileFetching:r;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#T||this.#k(),this.#T&&(c||this.#D(l,n,i),a&&this.#F(a,l)),!o&&this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#u;){const t=this.#p[this.#g];if(this.#V(!0),this.#I(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#V(t){const e=this.#g,r=this.#f[e],n=this.#p[e];return this.#S&&this.#I(n)?n.__abortController.abort(new Error("evicted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(n,r,"evict"),this.#O&&this.#v?.push([n,r,"evict"])),this.#P(e),t&&(this.#f[e]=void 0,this.#p[e]=void 0,this.#b.push(e)),1===this.#u?(this.#g=this.#m=0,this.#b.length=0):this.#g=this.#d[e],this.#h.delete(r),this.#u--,e}has(t,e={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=e,i=this.#h.get(t);if(void 0!==i){const t=this.#p[i];if(this.#I(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#U(i))return r&&this.#B(i),n&&(n.has="hit",this.#F(n,i)),!0;n&&(n.has="stale",this.#F(n,i))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:r=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!r&&this.#U(n))return;const i=this.#p[n];return this.#I(i)?i.__staleWhileFetching:i}#_(t,e,r,n){const i=void 0===e?void 0:this.#p[e];if(this.#I(i))return i;const o=new N,{signal:s}=r;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,c=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,c&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!c&&!i)return u(o.signal.reason);const h=l;return this.#p[e]===l&&(void 0===n?h.__staleWhileFetching?this.#p[e]=h.__staleWhileFetching:this.#R(t,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(t,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,u=l;if(this.#p[e]===l&&(c&&void 0!==u.__staleWhileFetching?s||(this.#p[e]=u.__staleWhileFetching):this.#R(t,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);const l=new Promise(((e,n)=>{const s=this.#a?.(t,i,a);s&&s instanceof Promise&&s.then((t=>e(void 0===t?void 0:t)),n),o.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(e(void 0),r.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=t),u(t)))),h=Object.assign(l,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,h,{...a.options,status:void 0}),e=this.#h.get(t)):this.#p[e]=h,h}#I(t){if(!this.#S)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof N}async fetch(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:y=!1,status:g,signal:m}=e;if(!this.#S)return g&&(g.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:m};let v=this.#h.get(t);if(void 0===v){g&&(g.fetch="miss");const e=this.#_(t,v,b,d);return e.__returned=e}{const e=this.#p[v];if(this.#I(e)){const t=r&&void 0!==e.__staleWhileFetching;return g&&(g.fetch="inflight",t&&(g.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#U(v);if(!y&&!i)return g&&(g.fetch="hit"),this.#L(v),n&&this.#B(v),g&&this.#F(g,v),e;const o=this.#_(t,v,b,d),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",s&&i&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(t,e={}){const r=await this.fetch(t,e);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(t,e={}){const r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=e,s=this.get(t,o);if(!i&&void 0!==s)return s;const a=r(t,s,{options:o,context:n});return this.set(t,a,o),a}get(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=e,s=this.#h.get(t);if(void 0!==s){const e=this.#p[s],a=this.#I(e);return o&&this.#F(o,s),this.#U(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==e.__staleWhileFetching&&(o.returnedStale=!0),r?e.__staleWhileFetching:void 0):(i||this.#R(t,"expire"),o&&r&&(o.returnedStale=!0),r?e:void 0)):(o&&(o.get="hit"),a?e.__staleWhileFetching:(this.#L(s),n&&this.#B(s),e))}o&&(o.get="miss")}#G(t,e){this.#y[e]=t,this.#d[t]=e}#L(t){t!==this.#m&&(t===this.#g?this.#g=this.#d[t]:this.#G(this.#y[t],this.#d[t]),this.#G(this.#m,t),this.#m=t)}delete(t){return this.#R(t,"delete")}#R(t,e){let r=!1;if(0!==this.#u){const n=this.#h.get(t);if(void 0!==n)if(r=!0,1===this.#u)this.#z(e);else{this.#P(n);const r=this.#p[n];if(this.#I(r)?r.__abortController.abort(new Error("deleted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(r,t,e),this.#O&&this.#v?.push([r,t,e])),this.#h.delete(t),this.#f[n]=void 0,this.#p[n]=void 0,n===this.#m)this.#m=this.#y[n];else if(n===this.#g)this.#g=this.#d[n];else{const t=this.#y[n];this.#d[t]=this.#d[n];const e=this.#d[n];this.#y[e]=this.#y[n]}this.#u--,this.#b.push(n)}}if(this.#O&&this.#v?.length){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return r}clear(){return this.#z("delete")}#z(t){for(const e of this.#N({allowStale:!0})){const r=this.#p[e];if(this.#I(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#f[e];this.#A&&this.#o?.(r,n,t),this.#O&&this.#v?.push([r,n,t])}}if(this.#h.clear(),this.#p.fill(void 0),this.#f.fill(void 0),this.#T&&this.#w&&(this.#T.fill(0),this.#w.fill(0)),this.#E&&this.#E.fill(0),this.#g=0,this.#m=0,this.#b.length=0,this.#l=0,this.#u=0,this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}class F{#W;#K;#q;constructor(t,e,r){this.#K=t.docExistsSpace,this.#q=r,this.#W=e}#H=(t,e={})=>{const r=t=>"string"==typeof t||"number"==typeof t?this.#q.GET(t,e.PIPELINE):t.FIELD||t.VALUE?this.#q.GET(t):t.AND?this.#q.AND(t.AND.map(r),e.PIPELINE):t.GET?this.#q.GET(t.GET,e.PIPELINE):t.NOT?this.#q.NOT(r(t.NOT.INCLUDE),r(t.NOT.EXCLUDE)):t.OR?this.#q.OR(t.OR.map(r),e.PIPELINE):t.ALL_DOCUMENTS?this.ALL_DOCUMENTS(t.ALL_DOCUMENTS):void 0;return r(t).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((t=>e.BUCKETS?this.#q.BUCKETS(...e.BUCKETS).then((e=>Object.assign(t,{BUCKETS:this.#q.AGGREGATION_FILTER(e,t.RESULT,!1)}))):t)).then((r=>e.FACETS?r.RESULT.length?t.ALL_DOCUMENTS?this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:t}))):this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:this.#q.AGGREGATION_FILTER(t,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>e.WEIGHT?Object.assign({RESULT:this.WEIGHT(t.RESULT,e.WEIGHT)},t):t)).then((t=>e.SCORE?this.SCORE(t.RESULT,e.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,e.SORT?{RESULT:this.SORT(t.RESULT,e.SORT)}:{}))).then((t=>{let r;return Object.assign(t,{RESULT:this.PAGE(t.RESULT,e.PAGE,(t=>{r=t}))},{PAGING:r})})).then((t=>e.DOCUMENTS?this.DOCUMENTS(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))};#Y=t=>this.DISTINCT(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"})))));#X=(...t)=>t.length?Promise.all(t.map((t=>this.#q.STORE.get([this.#K,t]).catch((t=>null))))):this.ALL_DOCUMENTS();#J=(t,e)=>this.#H({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e));ALL_DOCUMENTS=t=>this.#q.STORE.iterator({gte:[this.#K,null],lte:[this.#K,void 0],limit:t}).all().then((t=>t.map((([t,e])=>({_id:e._id,_doc:e})))));cachePipeline=(t,e,...r)=>{const n=JSON.stringify({funcLabel:e,params:r});return this.#W.has(n)?Promise.resolve(this.#W.get(n)):t(...r).then((t=>(this.#W.set(n,t),t)))};DICTIONARY=t=>this.cachePipeline(this.#Y,"#DICTIONARY",t);DISTINCT=(...t)=>this.#q.DISTINCT(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));DOCUMENTS=(...t)=>this.cachePipeline(this.#X,"#DOCUMENTS",...t);DOCUMENT_COUNT=()=>this.#q.STORE.get(["DOCUMENT_COUNT"]);DOCUMENT_VECTORS=(...t)=>Promise.all(t.map((t=>this.#q.STORE.get(["DOC",t]).catch((t=>null)))));FACETS=(...t)=>this.#q.FACETS(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));PAGE=(t,e={},r=()=>null)=>((e={NUMBER:0,SIZE:20,...e}).TOTAL=Math.ceil(t.length/e.SIZE),e.DOC_OFFSET=e.NUMBER*e.SIZE,r(e),t.slice(e.DOC_OFFSET,e.DOC_OFFSET+e.SIZE||void 0));QUERY=(t,e)=>this.cachePipeline(this.#H,"#parseJsonQuery",t,e);SCORE=(t,e={})=>{e=Object.assign({TYPE:"TFIDF"},e);const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD),n=t=>(t||[]).filter(r);return new Promise((i=>i("TFIDF"===e.TYPE?this.DOCUMENT_COUNT().then((e=>t.map(((t,n,i)=>{const o=Math.log((e+1)/i.length);return t._score=+(t._match||[]).filter(r).reduce(((t,e)=>t+o*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2)}))):"CONCAT"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.SCORE),"")}))):"SUM"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2)}))):"VALUE"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.VALUE),"")}))):null)))};SEARCH=(t,e)=>this.cachePipeline(this.#J,"#SEARCH",t,e);SORT=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION]));WEIGHT=(t,e)=>t.map((t=>(t._match=t._match.map((t=>(e.forEach((e=>{let r=!1;e.FIELD&&e.VALUE?e.FIELD===t.FIELD&&e.VALUE===t.VALUE&&(r=!0):e.FIELD?e.FIELD===t.FIELD&&(r=!0):e.VALUE&&e.VALUE===t.VALUE&&(r=!0),r&&(t.SCORE=(e.WEIGHT*+t.SCORE).toFixed(2))})),t))),t)))}var P=r(228);class j extends Error{constructor(t){super(t),this.name="TimeoutError"}}class M extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const V=t=>void 0===globalThis.DOMException?new M(t):new DOMException(t),$=t=>{const e=void 0===t.reason?V("This operation was aborted."):t.reason;return e instanceof Error?e:V(e)};class G{#Q=[];enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&this.#Q[this.size-1].priority>=e.priority)return void this.#Q.push(r);const n=function(t,e){let r=0,n=t.length;for(;n>0;){const o=Math.trunc(n/2);let s=r+o;i=t[s],e.priority-i.priority<=0?(r=++s,n-=o+1):n=o}var i;return r}(this.#Q,r);this.#Q.splice(n,0,r)}dequeue(){const t=this.#Q.shift();return t?.run}filter(t){return this.#Q.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this.#Q.length}}class z extends P{#Z;#tt;#et=0;#rt;#nt;#it=0;#ot;#st;#Q;#at;#ct=0;#ut;#lt;#ht;timeout;constructor(t){if(super(),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:G,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#Z=t.carryoverConcurrencyCount,this.#tt=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this.#rt=t.intervalCap,this.#nt=t.interval,this.#Q=new t.queueClass,this.#at=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#ht=!0===t.throwOnTimeout,this.#lt=!1===t.autoStart}get#ft(){return this.#tt||this.#et{this.#yt()}),e)),!0;this.#et=this.#Z?this.#ct:0}return!1}#dt(){if(0===this.#Q.size)return this.#ot&&clearInterval(this.#ot),this.#ot=void 0,this.emit("empty"),0===this.#ct&&this.emit("idle"),!1;if(!this.#lt){const t=!this.#bt;if(this.#ft&&this.#pt){const e=this.#Q.dequeue();return!!e&&(this.emit("active"),e(),t&&this.#mt(),!0)}}return!1}#mt(){this.#tt||void 0!==this.#ot||(this.#ot=setInterval((()=>{this.#gt()}),this.#nt),this.#it=Date.now()+this.#nt)}#gt(){0===this.#et&&0===this.#ct&&this.#ot&&(clearInterval(this.#ot),this.#ot=void 0),this.#et=this.#Z?this.#ct:0,this.#vt()}#vt(){for(;this.#dt(););}get concurrency(){return this.#ut}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#ut=t,this.#vt()}async#Et(t){return new Promise(((e,r)=>{t.addEventListener("abort",(()=>{r(t.reason)}),{once:!0})}))}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:this.#ht,...e},new Promise(((r,n)=>{this.#Q.enqueue((async()=>{this.#ct++,this.#et++;try{e.signal?.throwIfAborted();let n=t({signal:e.signal});e.timeout&&(n=function(t,e){const{milliseconds:r,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e;let s;const a=new Promise(((a,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){const{signal:t}=e;t.aborted&&c($(t)),t.addEventListener("abort",(()=>{c($(t))}))}if(r===Number.POSITIVE_INFINITY)return void t.then(a,c);const u=new j;s=o.setTimeout.call(void 0,(()=>{if(n)try{a(n())}catch(t){c(t)}else"function"==typeof t.cancel&&t.cancel(),!1===i?a():i instanceof Error?c(i):(u.message=i??`Promise timed out after ${r} milliseconds`,c(u))}),r),(async()=>{try{a(await t)}catch(t){c(t)}})()})).finally((()=>{a.clear()}));return a.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},a}(Promise.resolve(n),{milliseconds:e.timeout})),e.signal&&(n=Promise.race([n,this.#Et(e.signal)]));const i=await n;r(i),this.emit("completed",i)}catch(t){if(t instanceof j&&!e.throwOnTimeout)return void r();n(t),this.emit("error",t)}finally{this.#d()}}),e),this.emit("add"),this.#dt()}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this.#lt?(this.#lt=!1,this.#vt(),this):this}pause(){this.#lt=!0}clear(){this.#Q=new this.#at}async onEmpty(){0!==this.#Q.size&&await this.#wt("empty")}async onSizeLessThan(t){this.#Q.sizethis.#Q.size{const n=()=>{e&&!e()||(this.off(t,n),r())};this.on(t,n)}))}get size(){return this.#Q.size}sizeBy(t){return this.#Q.filter(t).length}get pending(){return this.#ct}get isPaused(){return this.#lt}}class W{#W;#q;#Tt;#Q;constructor(t,e,r){this.#W=e,this.#q=r,this.#Tt=t,this.#Q=new z({concurrency:1}),this.#At(0)}#At=t=>this.#q.STORE.get(["DOCUMENT_COUNT"]).then((e=>this.#q.STORE.put(["DOCUMENT_COUNT"],+e+(+t||0)))).catch((t=>this.#q.STORE.put(["DOCUMENT_COUNT"],0)));#St=(t,e)=>{this.#W.clear();const r={...this.#Tt,...e};return((t,e)=>{const r=t=>"string"==typeof t||t instanceof String,n=(t,i)=>new Promise((async o=>{return null===t?o([null,"1.00"]):(s=t)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o([[],"1.00"]):Number.isInteger(t)?o([t,t]):r(t)?o(e.tokenizer(t,i,e)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(t)?o((a=t,new Promise((async t=>{const r={};for(const t in a)r[t]=await n(a[t],t,e);return t(r)})))):(t=>Array.isArray(t))(t)?o((c=t,Promise.all(c.map(n)))):o(t);var s,a,c}));return Promise.all(t.map((async t=>new Promise((async i=>{r(t)&&(t={body:t}),Object.prototype.hasOwnProperty.call(t,"_id")||(t._id=e.idGenerator.next().value);const o={};for(const e in t)o[e]="_id"!==e?await n(t[e],e):t[e];return i(o)})))))})(t,r).then((t=>this.#q.PUT(t,e))).then((e=>this.PUT_RAW(t,e.map((t=>t._id)),!r.storeRawDocs).then((()=>this.#At(e.filter((t=>"CREATED"===t.status)).length))).then((()=>e))))};#Ot=t=>this.#q.DELETE(t).then((e=>this.DELETE_RAW(...t).then((()=>this.#At(-e.filter((t=>"DELETED"===t.status)).length))).then((()=>this.#W.clear())).then((()=>e))));DELETE=(...t)=>this.#Ot(t);DELETE_RAW=(...t)=>Promise.all(t.map((t=>this.#q.STORE.del([this.#Tt.docExistsSpace,t]))));FLUSH=()=>this.#q.STORE.clear().then((()=>{this.#W.clear();const t=(new Date).toISOString();return this.#q.STORE.batch([{type:"put",key:["~CREATED"],value:t},{type:"put",key:["~LAST_UPDATED"],value:t},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0));IMPORT=t=>(this.#W.clear(),Promise.resolve(this.#q.IMPORT(t)));PUT=(t,e)=>this.#Q.add((()=>this.#St(t,e)));PUT_RAW=(t,e,r)=>Promise.all(t.map(((t,n)=>this.#q.STORE.put([this.#Tt.docExistsSpace,e[n]],r?{}:t)))).then((r=>(this.#W.clear(),t.map(((t,r)=>({_id:e[r],status:"OK",operation:"_PUT_RAW"}))))))}class K{constructor(t={}){var e;t={cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],name:"index",ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:d,...t},this.INDEX=new S({...t,isLeaf:t=>Array.isArray(t)&&2===t.length&&t.every((t=>"string"==typeof t||"number"==typeof t||null===t))}),this.EVENTS=this.INDEX.EVENTS,this._CACHE=new B({max:t.cacheLength}),this.r=new F(t,this._CACHE,this.INDEX),this.w=new W(t,this._CACHE,this.INDEX),e=this.INDEX,new Promise(((t,r)=>{const n=["CREATED_WITH"],i="search-index@5.1.1";return e.STORE.get(n).then((e=>i===e?t():r(new Error("This index was created with "+e+", you are running "+i)))).catch((r=>e.STORE.put(n,i).then(t)))}))}ALL_DOCUMENTS=t=>this.r.ALL_DOCUMENTS(t);BUCKETS=(...t)=>this.INDEX.BUCKETS(...t);CREATED=()=>this.INDEX.CREATED();DELETE=(...t)=>this.w.DELETE(...t);DELETE_RAW=(...t)=>this.w.DELETE_RAW(...t);DICTIONARY=t=>this.r.DICTIONARY(t);DISTINCT=(...t)=>this.r.DISTINCT(...t);DOCUMENTS=(...t)=>this.r.DOCUMENTS(...t);DOCUMENT_COUNT=()=>this.r.DOCUMENT_COUNT();DOCUMENT_VECTORS=(...t)=>this.r.DOCUMENT_VECTORS(...t);EXPORT=()=>this.INDEX.EXPORT();FACETS=(...t)=>this.r.FACETS(...t);FIELDS=()=>this.INDEX.FIELDS();FLUSH=()=>this.w.FLUSH();IMPORT=t=>this.INDEX.IMPORT(t);LAST_UPDATED=()=>this.INDEX.LAST_UPDATED();MAX=t=>this.INDEX.MAX(t);MIN=t=>this.INDEX.MIN(t);PUT=(t,e)=>this.w.PUT(t,e);PUT_RAW=(t,e,r)=>this.w.PUT_RAW(t,e,r);QUERY=(t,e)=>this.r.QUERY(t,e);SEARCH=(t,e)=>this.r.SEARCH(t,e);TOKENIZATION_PIPELINE_STAGES=p;_AND=(t,e)=>this.INDEX.AND(t,e);_BUCKET=t=>this.INDEX.BUCKET(t);_GET=(t,e)=>this.INDEX.GET(t,e);_NOT=(t,e)=>this.INDEX.NOT(t,e);_OR=(t,e)=>this.INDEX.OR(t,e);_PAGE=(t,e)=>this.r.PAGE(t,e);_SORT=(t,e)=>this.r.SORT(t,e)}class q{constructor({template:t=t=>`${t} hits`,elementId:e="count"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=this.template(t)}class H{constructor({template:t=t=>`

    ${JSON.stringify(t)}

    `,elementId:e="hits"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=t.map((({_doc:t})=>this.template(t))).join("\n")}class Y{constructor({pageLinkTemplate:t=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,navLinkTemplate:e=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,elementId:r="paging"},n){this.pageLinkTemplate=t,this.navLinkTemplate=e,this.el=document.getElementById(r),this.search=n,this.page={NUMBER:0,SIZE:10}}template=t=>{let e=0,r=t.TOTAL;return t.TOTAL>7&&(e=t.NUMBER>3?t.NUMBER-3:0,r=7+e),r>t.TOTAL&&(e=t.TOTAL-6-1,r=t.TOTAL),`\n
      \n ${this.navLinkTemplate("First",0,0===t.NUMBER)}\n ${this.navLinkTemplate("‹",t.NUMBER-1,0===t.NUMBER)}\n ${(()=>{let n="";for(let i=e;i=t.TOTAL-1)}\n ${this.navLinkTemplate("Last",t.TOTAL-1,t.NUMBER>=t.TOTAL-1)}\n
    `};update=t=>{if(console.log(t),t.TOTAL<=1)return void(this.el.innerHTML="");this.el.innerHTML=this.template(t);const e=document.getElementsByClassName("page-link");for(let t=0;t{console.log("AYO!"),console.log(this.search()),this.page.NUMBER=+t.target.attributes["data-page"].value,this.search()}))}}class X{constructor({elementId:t="",facetOptionTemplate:e=(t,e)=>`\n \n \n
    `,field:r=null,mode:n="OR",sort:i=(t,e)=>{t.VALUE.localeCompare(e.VALUE)},title:o="

    "+r.toUpperCase()+"

    "},s){this.activeFilters=[],this.el=document.getElementById(t),this.elementId=t,this.facetOptionTemplate=e,this.field=r,this.mode=n,this.search=s,this.sort=i,this.title=o}getActiveFilters=()=>this.activeFilters.length?[{[this.mode]:this.activeFilters}]:[];update=(t,e)=>{if("facet"===e&&"OR"===this.mode)return;const r=t.filter((t=>t.FIELD===this.field));this.el.innerHTML=r.length?this.title+r.sort(this.sort).reduce(((t,e)=>t+this.facetOptionTemplate(e,this.activeFilters.includes(e.FIELD+":"+e.VALUE))),""):"",this.activeFilters.forEach((t=>{if(!document.getElementById(t)){const[e,r]=t.split(":");this.el.innerHTML+=this.facetOptionTemplate({FIELD:e,VALUE:r,_id:[]},!0)}}));for(const t of document.querySelectorAll("#"+this.elementId+" > .filter-select"))t.addEventListener("input",(t=>{console.log(this.elementId),console.log(this.mode);const e=t.target.attributes["data-field"].value+":"+t.target.attributes["data-value"].value;t.target.checked?this.activeFilters.push(e):this.activeFilters=this.activeFilters.filter((t=>t!==e)),this.search("facet")}))}}class J{constructor(t,e,r={}){this.autoCompleteFunction=r.autoCompleteFunction,this.currentFocus=-1,this.searchboxEl=t,this.search=e,this.limit=r.limit||20,this.threshold=r.threshold||2,this.autocompleteListId=t.id+"-autocomplete-list",this.suggestionsElementId=r.elementId,t.addEventListener("input",this.searchBoxInputListener),t.addEventListener("keydown",this.searchBoxKeydownListener),document.addEventListener("click",(t=>{this.closeAllLists(t.target)}))}closeAllLists=t=>{for(const e of document.getElementsByClassName("autocomplete-items"))t!==e&&t!==this.searchboxEl&&e.parentNode.removeChild(e)};searchBoxKeydownListener=t=>{let e=document.getElementById(this.autocompleteListId);e&&(e=e.getElementsByTagName("div")),40===t.keyCode?(this.currentFocus++,this.addActive(e)):38===t.keyCode?(this.currentFocus--,this.addActive(e)):13===t.keyCode||9===t.keyCode?(t.preventDefault(),this.currentFocus>-1?e&&e[this.currentFocus].click():this.closeAllLists()):27===t.keyCode&&this.closeAllLists()};searchBoxInputListener=async t=>{const e=(await this.autoCompleteFunction(t.target.value)).slice(0,this.limit);let r;const n=t.target.value;if(this.closeAllLists(),!n)return!1;if(n.length{r=document.createElement("DIV"),r.innerHTML=""+t.substr(0,n.length)+"",r.innerHTML+=t.substr(n.length),r.innerHTML+="",r.addEventListener("click",(t=>{this.searchboxEl.value=t.target.getElementsByTagName("input")[0].value,this.closeAllLists(),this.search()})),i.appendChild(r)}))};addActive=t=>{if(!t)return!1;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1),t[this.currentFocus].classList.add("autocomplete-active")};removeActive=t=>{for(let e=0;e{n.page.NUMBER=0,r("searchInput")})),this.autocomplete=new J(this.el,r,e)}}class Z{constructor({index:t=null,count:e={},hits:r={},facets:n=[],searchInput:i={},paging:o={},suggestions:s={}}){this.index=t,this.count=new q(e),this.paging=new Y(o,this.search),this.hits=new H(r),this.searchInput=new Q({...i,suggestions:{autoCompleteFunction:this.index.DICTIONARY,...i.suggestions}},this.search,this.paging),this.facets=n.map((t=>new X(t,this.search))),this.search()}queryOptions=()=>({FACETS:this.facets.map((t=>({FIELD:t.field}))),DOCUMENTS:!0,PAGE:this.paging.page});emptySearchQuery=()=>[{ALL_DOCUMENTS:!0},this.queryOptions()];searchQuery=()=>[[...this.searchInput.el.value.split(/\s+/).filter((t=>t)),...this.facets.map((t=>t.getActiveFilters())).flat(1/0)],this.queryOptions()];search=t=>(this.searchInput.el.value.length+this.facets.map((t=>t.getActiveFilters())).flat(1/0).length?this.index.SEARCH(...this.searchQuery()):this.index.QUERY(...this.emptySearchQuery())).then((e=>{this.hits.update(e.RESULT),this.count.update(e.RESULT_LENGTH),this.facets.forEach((r=>r.update(e.FACETS,t))),this.paging.update(e.PAGING)}))}class tt{constructor(t={}){return new K({Level:y.Z,...t})}}class et{constructor(t={}){return new Z(t)}}var rt=n.d,nt=n.UI;export{rt as SearchIndex,nt as UI}; \ No newline at end of file diff --git a/dist/search-index-esm-5.0.0.js.LICENSE.txt b/dist/search-index-esm-5.1.1.js.LICENSE.txt similarity index 100% rename from dist/search-index-esm-5.0.0.js.LICENSE.txt rename to dist/search-index-esm-5.1.1.js.LICENSE.txt diff --git a/dist/search-index.js b/dist/search-index.js index cd41cc7b..2210b933 100644 --- a/dist/search-index.js +++ b/dist/search-index.js @@ -1,2 +1,2 @@ -/*! For license information please see search-index-5.0.0.js.LICENSE.txt */ -var SearchIndex;(()=>{var t={796:(t,e,r)=>{"use strict";const{fromCallback:n}=r(8100),i=r(266),{getCallback:o,getOptions:s}=r(1343),a=Symbol("promise"),c=Symbol("status"),u=Symbol("operations"),l=Symbol("finishClose"),h=Symbol("closeCallbacks");e.AbstractChainedBatch=class{constructor(t){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));this[u]=[],this[h]=[],this[c]="open",this[l]=this[l].bind(this),this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get length(){return this[u].length}put(t,e,r){if("open"!==this[c])throw new i("Batch is not open: cannot call put() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const n=this.db._checkKey(t)||this.db._checkValue(e);if(n)throw n;const o=r&&null!=r.sublevel?r.sublevel:this.db,s=r,a=o.keyEncoding(r&&r.keyEncoding),l=o.valueEncoding(r&&r.valueEncoding),h=a.format;r={...r,keyEncoding:h,valueEncoding:l.format},o!==this.db&&(r.sublevel=null);const f=o.prefixKey(a.encode(t),h),p=l.encode(e);return this._put(f,p,r),this[u].push({...s,type:"put",key:t,value:e}),this}_put(t,e,r){}del(t,e){if("open"!==this[c])throw new i("Batch is not open: cannot call del() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const r=this.db._checkKey(t);if(r)throw r;const n=e&&null!=e.sublevel?e.sublevel:this.db,o=e,s=n.keyEncoding(e&&e.keyEncoding),a=s.format;return e={...e,keyEncoding:a},n!==this.db&&(e.sublevel=null),this._del(n.prefixKey(s.encode(t),a),e),this[u].push({...o,type:"del",key:t}),this}_del(t,e){}clear(){if("open"!==this[c])throw new i("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[u]=[],this}_clear(){}write(t,e){return e=o(t,e),e=n(e,a),t=s(t),"open"!==this[c]?this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):0===this.length?this.close(e):(this[c]="writing",this._write(t,(t=>{this[c]="closing",this[h].push((()=>e(t))),t||this.db.emit("batch",this[u]),this._close(this[l])}))),e[a]}_write(t,e){}close(t){return t=n(t,a),"closing"===this[c]?this[h].push(t):"closed"===this[c]?this.nextTick(t):(this[h].push(t),"writing"!==this[c]&&(this[c]="closing",this._close(this[l]))),t[a]}_close(t){this.nextTick(t)}[l](){this[c]="closed",this.db.detachResource(this);const t=this[h];this[h]=[];for(const e of t)e()}}},3527:(t,e,r)=>{"use strict";const{fromCallback:n}=r(8100),i=r(266),{getOptions:o,getCallback:s}=r(1343),a=Symbol("promise"),c=Symbol("callback"),u=Symbol("working"),l=Symbol("handleOne"),h=Symbol("handleMany"),f=Symbol("autoClose"),p=Symbol("finishWork"),d=Symbol("returnMany"),y=Symbol("closing"),g=Symbol("handleClose"),m=Symbol("closed"),b=Symbol("closeCallbacks"),v=Symbol("keyEncoding"),E=Symbol("valueEncoding"),w=Symbol("abortOnClose"),T=Symbol("legacy"),A=Symbol("keys"),S=Symbol("values"),O=Symbol("limit"),I=Symbol("count"),_=Object.freeze({}),L=()=>{};let x=!1;class N{constructor(t,e,r){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e)throw new TypeError("The second argument must be an options object");this[m]=!1,this[b]=[],this[u]=!1,this[y]=!1,this[f]=!1,this[c]=null,this[l]=this[l].bind(this),this[h]=this[h].bind(this),this[g]=this[g].bind(this),this[v]=e[v],this[E]=e[E],this[T]=r,this[O]=Number.isInteger(e.limit)&&e.limit>=0?e.limit:1/0,this[I]=0,this[w]=!!e.abortOnClose,this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get count(){return this[I]}get limit(){return this[O]}next(t){let e;if(void 0===t)e=new Promise(((e,r)=>{t=(t,n,i)=>{t?r(t):this[T]?void 0===n&&void 0===i?e():e([n,i]):e(n)}}));else if("function"!=typeof t)throw new TypeError("Callback must be a function");return this[y]?this.nextTick(t,new i("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(t,new i("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=t,this[I]>=this[O]?this.nextTick(this[l],null):this._next(this[l])),e}_next(t){this.nextTick(t)}nextv(t,e,r){return r=s(e,r),r=n(r,a),e=o(e,_),Number.isInteger(t)?(this[y]?this.nextTick(r,new i("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(r,new i("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(t<1&&(t=1),this[O]<1/0&&(t=Math.min(t,this[O]-this[I])),this[u]=!0,this[c]=r,t<=0?this.nextTick(this[h],null,[]):this._nextv(t,e,this[h])),r[a]):(this.nextTick(r,new TypeError("The first argument 'size' must be an integer")),r[a])}_nextv(t,e,r){const n=[],i=(e,o,s)=>e?r(e):(this[T]?void 0===o&&void 0===s:void 0===o)?r(null,n):(n.push(this[T]?[o,s]:o),void(n.length===t?r(null,n):this._next(i)));this._next(i)}all(t,e){return e=s(t,e),e=n(e,a),t=o(t,_),this[y]?this.nextTick(e,new i("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(e,new i("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=e,this[f]=!0,this[I]>=this[O]?this.nextTick(this[h],null,[]):this._all(t,this[h])),e[a]}_all(t,e){let r=this[I];const n=[],i=()=>{const t=this[O]<1/0?Math.min(1e3,this[O]-r):1e3;t<=0?this.nextTick(e,null,n):this._nextv(t,_,o)},o=(t,o)=>{t?e(t):0===o.length?e(null,n):(n.push.apply(n,o),r+=o.length,i())};i()}[p](){const t=this[c];return this[w]&&null===t?L:(this[u]=!1,this[c]=null,this[y]&&this._close(this[g]),t)}[d](t,e,r){this[f]?this.close(t.bind(null,e,r)):t(e,r)}seek(t,e){if(e=o(e,_),this[y]);else{if(this[u])throw new i("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{const r=this.db.keyEncoding(e.keyEncoding||this[v]),n=r.format;e.keyEncoding!==n&&(e={...e,keyEncoding:n});const i=this.db.prefixKey(r.encode(t),n);this._seek(i,e)}}}_seek(t,e){throw new i("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(t){return t=n(t,a),this[m]?this.nextTick(t):this[y]?this[b].push(t):(this[y]=!0,this[b].push(t),this[u]?this[w]&&this[p]()(new i("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[g])),t[a]}_close(t){this.nextTick(t)}[g](){this[m]=!0,this.db.detachResource(this);const t=this[b];this[b]=[];for(const e of t)e()}async*[Symbol.asyncIterator](){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this[m]||await this.close()}}}class U extends N{constructor(t,e){super(t,e,!0),this[A]=!1!==e.keys,this[S]=!1!==e.values}[l](t,e,r){const n=this[p]();if(t)return n(t);try{e=this[A]&&void 0!==e?this[v].decode(e):void 0,r=this[S]&&void 0!==r?this[E].decode(r):void 0}catch(t){return n(new C("entry",t))}void 0===e&&void 0===r||this[I]++,n(null,e,r)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(const t of e){const e=t[0],r=t[1];t[0]=this[A]&&void 0!==e?this[v].decode(e):void 0,t[1]=this[S]&&void 0!==r?this[E].decode(r):void 0}}catch(t){return this[d](r,new C("entries",t))}this[I]+=e.length,this[d](r,null,e)}end(t){return x||"undefined"==typeof console||(x=!0,console.warn(new i("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(t)}}class C extends i{constructor(t,e){super(`Iterator could not decode ${t}`,{code:"LEVEL_DECODE_ERROR",cause:e})}}for(const t of["_ended property","_nexting property","_end method"])Object.defineProperty(U.prototype,t.split(" ")[0],{get(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});U.keyEncoding=v,U.valueEncoding=E,e.AbstractIterator=U,e.AbstractKeyIterator=class extends N{constructor(t,e){super(t,e,!1)}[l](t,e){const r=this[p]();if(t)return r(t);try{e=void 0!==e?this[v].decode(e):void 0}catch(t){return r(new C("key",t))}void 0!==e&&this[I]++,r(null,e)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(let t=0;t{"use strict";const{supports:n}=r(5356),{Transcoder:i}=r(6035),{EventEmitter:o}=r(7007),{fromCallback:s}=r(8100),a=r(266),{AbstractIterator:c}=r(3527),{DefaultKeyIterator:u,DefaultValueIterator:l}=r(5682),{DeferredIterator:h,DeferredKeyIterator:f,DeferredValueIterator:p}=r(4416),{DefaultChainedBatch:d}=r(4669),{getCallback:y,getOptions:g}=r(1343),m=r(386),b=Symbol("promise"),v=Symbol("landed"),E=Symbol("resources"),w=Symbol("closeResources"),T=Symbol("operations"),A=Symbol("undefer"),S=Symbol("deferOpen"),O=Symbol("options"),I=Symbol("status"),_=Symbol("defaultOptions"),L=Symbol("transcoder"),x=Symbol("keyEncoding"),N=Symbol("valueEncoding"),U=()=>{};class C extends o{constructor(t,e){if(super(),"object"!=typeof t||null===t)throw new TypeError("The first argument 'manifest' must be an object");e=g(e);const{keyEncoding:r,valueEncoding:o,passive:s,...a}=e;this[E]=new Set,this[T]=[],this[S]=!0,this[O]=a,this[I]="opening",this.supports=n(t,{status:!0,promises:!0,clear:!0,getMany:!0,deferredOpen:!0,snapshots:!1!==t.snapshots,permanence:!1!==t.permanence,keyIterator:!0,valueIterator:!0,iteratorNextv:!0,iteratorAll:!0,encodings:t.encodings||{},events:Object.assign({},t.events,{opening:!0,open:!0,closing:!0,closed:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[L]=new i(R(this)),this[x]=this[L].encoding(r||"utf8"),this[N]=this[L].encoding(o||"utf8");for(const t of this[L].encodings())this.supports.encodings[t.commonName]||(this.supports.encodings[t.commonName]=!0);this[_]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[x].commonName,valueEncoding:this[N].commonName}),key:Object.freeze({keyEncoding:this[x].commonName})},this.nextTick((()=>{this[S]&&this.open({passive:!1},U)}))}get status(){return this[I]}keyEncoding(t){return this[L].encoding(null!=t?t:this[x])}valueEncoding(t){return this[L].encoding(null!=t?t:this[N])}open(t,e){e=y(t,e),e=s(e,b),(t={...this[O],...g(t)}).createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists;const r=t=>{"closing"===this[I]||"opening"===this[I]?this.once(v,t?()=>r(t):r):"open"!==this[I]?e(new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:t})):e()};return t.passive?"opening"===this[I]?this.once(v,r):this.nextTick(r):"closed"===this[I]||this[S]?(this[S]=!1,this[I]="opening",this.emit("opening"),this._open(t,(t=>{if(t)return this[I]="closed",this[w]((()=>{this.emit(v),r(t)})),void this[A]();this[I]="open",this[A](),this.emit(v),"open"===this[I]&&this.emit("open"),"open"===this[I]&&this.emit("ready"),r()}))):"open"===this[I]?this.nextTick(r):this.once(v,(()=>this.open(t,e))),e[b]}_open(t,e){this.nextTick(e)}close(t){t=s(t,b);const e=r=>{"opening"===this[I]||"closing"===this[I]?this.once(v,r?e(r):e):"closed"!==this[I]?t(new a("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:r})):t()};if("open"===this[I]){this[I]="closing",this.emit("closing");const t=t=>{this[I]="open",this[A](),this.emit(v),e(t)};this[w]((()=>{this._close((r=>{if(r)return t(r);this[I]="closed",this[A](),this.emit(v),"closed"===this[I]&&this.emit("closed"),e()}))}))}else"closed"===this[I]?this.nextTick(e):this.once(v,(()=>this.close(t)));return t[b]}[w](t){if(0===this[E].size)return this.nextTick(t);let e=this[E].size,r=!0;const n=()=>{0==--e&&(r?this.nextTick(t):t())};for(const t of this[E])t.close(n);r=!1,this[E].clear()}_close(t){this.nextTick(t)}get(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.get(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=this.valueEncoding(e.valueEncoding),c=i.format,u=o.format;return e.keyEncoding===c&&e.valueEncoding===u||(e=Object.assign({},e,{keyEncoding:c,valueEncoding:u})),this._get(this.prefixKey(i.encode(t),c),e,((t,e)=>{if(t)return("LEVEL_NOT_FOUND"===t.code||t.notFound||/NotFound/i.test(t))&&(t.code||(t.code="LEVEL_NOT_FOUND"),t.notFound||(t.notFound=!0),t.status||(t.status=404)),r(t);try{e=o.decode(e)}catch(t){return r(new a("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:t}))}r(null,e)})),r[b]}_get(t,e,r){this.nextTick(r,new Error("NotFound"))}getMany(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.getMany(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'keys' must be an array")),r[b];if(0===t.length)return this.nextTick(r,null,[]),r[b];const n=this.keyEncoding(e.keyEncoding),i=this.valueEncoding(e.valueEncoding),o=n.format,c=i.format;e.keyEncoding===o&&e.valueEncoding===c||(e=Object.assign({},e,{keyEncoding:o,valueEncoding:c}));const u=new Array(t.length);for(let e=0;e{if(t)return r(t);try{for(let t=0;tthis.put(t,e,r,n))),n[b];if(D(this,n))return n[b];const i=this._checkKey(t)||this._checkValue(e);if(i)return this.nextTick(n,i),n[b];const o=this.keyEncoding(r.keyEncoding),a=this.valueEncoding(r.valueEncoding),c=o.format,u=a.format;r.keyEncoding===c&&r.valueEncoding===u||(r=Object.assign({},r,{keyEncoding:c,valueEncoding:u}));const l=this.prefixKey(o.encode(t),c),h=a.encode(e);return this._put(l,h,r,(r=>{if(r)return n(r);this.emit("put",t,e),n()})),n[b]}_put(t,e,r,n){this.nextTick(n)}del(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].key),"opening"===this[I])return this.defer((()=>this.del(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=i.format;return e.keyEncoding!==o&&(e=Object.assign({},e,{keyEncoding:o})),this._del(this.prefixKey(i.encode(t),o),e,(e=>{if(e)return r(e);this.emit("del",t),r()})),r[b]}_del(t,e,r){this.nextTick(r)}batch(t,e,r){if(!arguments.length){if("opening"===this[I])return new d(this);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(r="function"==typeof t?t:y(e,r),r=s(r,b),e=g(e,this[_].empty),"opening"===this[I])return this.defer((()=>this.batch(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'operations' must be an array")),r[b];if(0===t.length)return this.nextTick(r),r[b];const n=new Array(t.length),{keyEncoding:i,valueEncoding:o,...c}=e;for(let e=0;e{if(e)return r(e);this.emit("batch",t),r()})),r[b]}_batch(t,e,r){this.nextTick(r)}sublevel(t,e){return this._sublevel(t,k.defaults(e))}_sublevel(t,e){return new k(this,t,e)}prefixKey(t,e){return t}clear(t,e){if(e=y(t,e),e=s(e,b),t=g(t,this[_].empty),"opening"===this[I])return this.defer((()=>this.clear(t,e))),e[b];if(D(this,e))return e[b];const r=t,n=this.keyEncoding(t.keyEncoding);return(t=m(t,n)).keyEncoding=n.format,0===t.limit?this.nextTick(e):this._clear(t,(t=>{if(t)return e(t);this.emit("clear",r),e()})),e[b]}_clear(t,e){this.nextTick(e)}iterator(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e)).keys=!1!==t.keys,t.values=!1!==t.values,t[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new h(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(t)}_iterator(t){return new c(this,t)}keys(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new f(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(t)}_keys(t){return new u(this,t)}values(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new p(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(t)}_values(t){return new l(this,t)}defer(t){if("function"!=typeof t)throw new TypeError("The first argument must be a function");this[T].push(t)}[A](){if(0===this[T].length)return;const t=this[T];this[T]=[];for(const e of t)e()}attachResource(t){if("object"!=typeof t||null===t||"function"!=typeof t.close)throw new TypeError("The first argument must be a resource object");this[E].add(t)}detachResource(t){this[E].delete(t)}_chainedBatch(){return new d(this)}_checkKey(t){if(null==t)return new a("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(t){if(null==t)return new a("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}}C.prototype.nextTick=r(28);const{AbstractSublevel:k}=r(9933)({AbstractLevel:C});e.AbstractLevel=C,e.AbstractSublevel=k;const D=function(t,e){return"open"!==t[I]&&(t.nextTick(e,new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0)},R=function(t){return Object.keys(t.supports.encodings).filter((e=>!!t.supports.encodings[e]))}},5e3:(t,e,r)=>{"use strict";e.AbstractLevel=r(1983).AbstractLevel,e.AbstractSublevel=r(1983).AbstractSublevel,e.AbstractIterator=r(3527).AbstractIterator,e.AbstractKeyIterator=r(3527).AbstractKeyIterator,e.AbstractValueIterator=r(3527).AbstractValueIterator,e.AbstractChainedBatch=r(796).AbstractChainedBatch},4716:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=Symbol("unfix"),a=Symbol("iterator"),c=Symbol("handleOne"),u=Symbol("handleMany"),l=Symbol("callback");class h extends n{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e,r){const n=this[l];if(t)return n(t);void 0!==e&&(e=this[s](e)),n(t,e,r)}[u](t,e){const r=this[l];if(t)return r(t);for(const t of e){const e=t[0];void 0!==e&&(t[0]=this[s](e))}r(t,e)}}class f extends i{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e){const r=this[l];if(t)return r(t);void 0!==e&&(e=this[s](e)),r(t,e)}[u](t,e){const r=this[l];if(t)return r(t);for(let t=0;t{"use strict";const n=r(266),{Buffer:i}=r(8287)||{},{AbstractSublevelIterator:o,AbstractSublevelKeyIterator:s,AbstractSublevelValueIterator:a}=r(4716),c=Symbol("prefix"),u=Symbol("upperBound"),l=Symbol("prefixRange"),h=Symbol("parent"),f=Symbol("unfix"),p=new TextEncoder,d={separator:"!"};t.exports=function({AbstractLevel:t}){class e extends t{static defaults(t){if("string"==typeof t)throw new n("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(t&&t.open)throw new n("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return null==t?d:t.separator?t:{...t,separator:"!"}}constructor(t,r,i){const{separator:o,manifest:s,...a}=e.defaults(i);r=v(r,o);const l=o.charCodeAt(0)+1,d=t[h]||t;if(!p.encode(r).every((t=>t>l&&t<127)))throw new n(`Prefix must use bytes > ${l} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(y(d,s),a);const g=(t.prefix||"")+o+r+o,E=g.slice(0,-1)+String.fromCharCode(l);this[h]=d,this[c]=new m(g),this[u]=new m(E),this[f]=new b,this.nextTick=d.nextTick}prefixKey(t,e){if("utf8"===e)return this[c].utf8+t;if(0===t.byteLength)return this[c][e];if("view"===e){const e=this[c].view,r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}{const e=this[c].buffer;return i.concat([e,t],e.byteLength+t.byteLength)}}[l](t,e){void 0!==t.gte?t.gte=this.prefixKey(t.gte,e):void 0!==t.gt?t.gt=this.prefixKey(t.gt,e):t.gte=this[c][e],void 0!==t.lte?t.lte=this.prefixKey(t.lte,e):void 0!==t.lt?t.lt=this.prefixKey(t.lt,e):t.lte=this[u][e]}get prefix(){return this[c].utf8}get db(){return this[h]}_open(t,e){this[h].open({passive:!0},e)}_put(t,e,r,n){this[h].put(t,e,r,n)}_get(t,e,r){this[h].get(t,e,r)}_getMany(t,e,r){this[h].getMany(t,e,r)}_del(t,e,r){this[h].del(t,e,r)}_batch(t,e,r){this[h].batch(t,e,r)}_clear(t,e){this[l](t,t.keyEncoding),this[h].clear(t,e)}_iterator(t){this[l](t,t.keyEncoding);const e=this[h].iterator(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new o(this,t,e,r)}_keys(t){this[l](t,t.keyEncoding);const e=this[h].keys(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new s(this,t,e,r)}_values(t){this[l](t,t.keyEncoding);const e=this[h].values(t);return new a(this,t,e)}}return{AbstractSublevel:e}};const y=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:g(t,"utf8"),buffer:g(t,"buffer"),view:g(t,"view")}}},g=function(t,e){return!!t.supports.encodings[e]&&t.keyEncoding(e).name===e};class m{constructor(t){this.utf8=t,this.view=p.encode(t),this.buffer=i?i.from(this.view.buffer,0,this.view.byteLength):{}}}class b{constructor(){this.cache=new Map}get(t,e){let r=this.cache.get(e);return void 0===r&&(r="view"===e?function(t,e){return e.subarray(t)}.bind(null,t):function(t,e){return e.slice(t)}.bind(null,t),this.cache.set(e,r)),r}}const v=function(t,e){let r=0,n=t.length;for(;rr&&t[n-1]===e;)n--;return t.slice(r,n)}},1343:(t,e)=>{"use strict";e.getCallback=function(t,e){return"function"==typeof t?t:e},e.getOptions=function(t,e){return"object"==typeof t&&null!==t?t:void 0!==e?e:{}}},4669:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(796),i=r(266),o=Symbol("encoded");e.DefaultChainedBatch=class extends n{constructor(t){super(t),this[o]=[]}_put(t,e,r){this[o].push({...r,type:"put",key:t,value:e})}_del(t,e){this[o].push({...e,type:"del",key:t})}_clear(){this[o]=[]}_write(t,e){"opening"===this.db.status?this.db.defer((()=>this._write(t,e))):"open"===this.db.status?0===this[o].length?this.nextTick(e):this.db._batch(this[o],t,e):this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}}},5682:(t,e,r)=>{"use strict";const{AbstractKeyIterator:n,AbstractValueIterator:i}=r(3527),o=Symbol("iterator"),s=Symbol("callback"),a=Symbol("handleOne"),c=Symbol("handleMany");class u extends n{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!0,values:!1}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}class l extends i{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!1,values:!0}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}for(const t of[u,l]){const e=t===u,r=e?t=>t[0]:t=>t[1];t.prototype._next=function(t){this[s]=t,this[o].next(this[a])},t.prototype[a]=function(t,r,n){const i=this[s];t?i(t):i(null,e?r:n)},t.prototype._nextv=function(t,e,r){this[s]=r,this[o].nextv(t,e,this[c])},t.prototype._all=function(t,e){this[s]=e,this[o].all(t,this[c])},t.prototype[c]=function(t,e){const n=this[s];t?n(t):n(null,e.map(r))},t.prototype._seek=function(t,e){this[o].seek(t,e)},t.prototype._close=function(t){this[o].close(t)}}e.DefaultKeyIterator=u,e.DefaultValueIterator=l},4416:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=r(266),a=Symbol("nut"),c=Symbol("undefer"),u=Symbol("factory");class l extends n{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.iterator(e),this.db.defer((()=>this[c]()))}}class h extends i{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.keys(e),this.db.defer((()=>this[c]()))}}class f extends o{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.values(e),this.db.defer((()=>this[c]()))}}for(const t of[l,h,f])t.prototype[c]=function(){"open"===this.db.status&&(this[a]=this[u]())},t.prototype._next=function(t){null!==this[a]?this[a].next(t):"opening"===this.db.status?this.db.defer((()=>this._next(t))):this.nextTick(t,new s("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(t,e,r){null!==this[a]?this[a].nextv(t,e,r):"opening"===this.db.status?this.db.defer((()=>this._nextv(t,e,r))):this.nextTick(r,new s("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(t,e){null!==this[a]?this[a].all(e):"opening"===this.db.status?this.db.defer((()=>this._all(t,e))):this.nextTick(e,new s("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(t,e){null!==this[a]?this[a]._seek(t,e):"opening"===this.db.status&&this.db.defer((()=>this._seek(t,e)))},t.prototype._close=function(t){null!==this[a]?this[a].close(t):"opening"===this.db.status?this.db.defer((()=>this._close(t))):this.nextTick(t)};e.DeferredIterator=l,e.DeferredKeyIterator=h,e.DeferredValueIterator=f},28:(t,e,r)=>{"use strict";const n=r(9596);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},386:(t,e,r)=>{"use strict";const n=r(266),i=Object.prototype.hasOwnProperty,o=new Set(["lt","lte","gt","gte"]);t.exports=function(t,e){const r={};for(const s in t)if(i.call(t,s)&&"keyEncoding"!==s&&"valueEncoding"!==s){if("start"===s||"end"===s)throw new n(`The legacy range option '${s}' has been removed`,{code:"LEVEL_LEGACY"});if("encoding"===s)throw new n("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead",{code:"LEVEL_LEGACY"});o.has(s)?r[s]=e.encode(t[s]):r[s]=t[s]}return r.reverse=!!r.reverse,r.limit=Number.isInteger(r.limit)&&r.limit>=0?r.limit:-1,r}},9511:(t,e,r)=>{"use strict";var n=r(8075)("ArrayBuffer.prototype.byteLength",!0),i=r(4670);t.exports=function(t){return i(t)?n?n(t):t.byteLength:NaN}},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),l=0,h=c>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9148:(t,e,r)=>{"use strict";const{AbstractLevel:n}=r(5e3),i=r(266),o=r(5372),{fromCallback:s}=r(8100),{Iterator:a}=r(6296),c=r(5222),u=r(3452),l=r(7766),h="level-js-",f=Symbol("idb"),p=Symbol("namePrefix"),d=Symbol("location"),y=Symbol("version"),g=Symbol("store"),m=Symbol("onComplete"),b=Symbol("promise");class v extends n{constructor(t,e,r){if("function"==typeof e||"function"==typeof r)throw new i("The levelup-style callback argument has been removed",{code:"LEVEL_LEGACY"});const{prefix:n,version:o,...s}=e||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},s),"string"!=typeof t)throw new Error("constructor requires a location string argument");this[d]=t,this[p]=null==n?h:n,this[y]=parseInt(o||1,10),this[f]=null}get location(){return this[d]}get namePrefix(){return this[p]}get version(){return this[y]}get db(){return this[f]}get type(){return"browser-level"}_open(t,e){const r=indexedDB.open(this[p]+this[d],this[y]);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this[f]=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this[d])||e.createObjectStore(this[d])}}[g](t){return this[f].transaction([this[d]],t).objectStore(this[d])}[m](t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}}_get(t,e,r){const n=this[g]("readonly");let o;try{o=n.get(t)}catch(t){return this.nextTick(r,t)}this[m](o,(function(t,e){return t?r(t):void 0===e?r(new i("Entry not found",{code:"LEVEL_NOT_FOUND"})):void r(null,c(e))}))}_getMany(t,e,r){const n=this[g]("readonly"),i=t.map((t=>e=>{let r;try{r=n.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:c(t))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(i,16,r)}_del(t,e,r){const n=this[g]("readwrite");let i;try{i=n.delete(t)}catch(t){return this.nextTick(r,t)}this[m](i,r)}_put(t,e,r,n){const i=this[g]("readwrite");let o;try{o=i.put(e,t)}catch(t){return this.nextTick(n,t)}this[m](o,n)}_iterator(t){return new a(this,this[d],t)}_batch(t,e,r){const n=this[g]("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let c;try{c="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return u(this,this[d],r,t,e);try{const t=this[g]("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this.nextTick(e,t)}this[m](n,e)}_close(t){this[f].close(),this.nextTick(t)}}v.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h),r=s(r,b);const n=indexedDB.deleteDatabase(e+t);return n.onsuccess=function(){r()},n.onerror=function(t){r(t)},r[b]},e.Z=v},6296:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(5e3),i=r(7766),o=r(5222),s=Symbol("cache"),a=Symbol("finished"),c=Symbol("options"),u=Symbol("currentOptions"),l=Symbol("position"),h=Symbol("location"),f=Symbol("first"),p={};function d(t){"function"==typeof t.commit&&t.commit()}e.Iterator=class extends n{constructor(t,e,r){super(t,r),this[s]=[],this[a]=0===this.limit,this[c]=r,this[u]={...r},this[l]=void 0,this[h]=e,this[f]=!0}_nextv(t,e,r){if(this[f]=!1,this[a])return this.nextTick(r,null,[]);if(this[s].length>0)return t=Math.min(t,this[s].length),this.nextTick(r,null,this[s].splice(0,t));let n;void 0!==this[l]&&(this[c].reverse?(this[u].lt=this[l],this[u].lte=void 0):(this[u].gt=this[l],this[u].gte=void 0));try{n=i(this[u])}catch(t){return this[a]=!0,this.nextTick(r,null,[])}const p=this.db.db.transaction([this[h]],"readonly"),y=p.objectStore(this[h]),g=[];if(this[c].reverse)y[!this[c].values&&y.openKeyCursor?"openKeyCursor":"openCursor"](n,"prev").onsuccess=e=>{const r=e.target.result;if(r){const{key:e,value:n}=r;this[l]=e,g.push([this[c].keys&&void 0!==e?o(e):void 0,this[c].values&&void 0!==n?o(n):void 0]),g.length{if(void 0===e||void 0===r)return;const n=Math.max(e.length,r.length);0===n||t===1/0?this[a]=!0:this[l]=e[n-1],g.length=n;for(let t=0;t{e=t.target.result,i()}:(e=[],this.nextTick(i)),this[c].values?y.getAll(n,t<1/0?t:void 0).onsuccess=t=>{r=t.target.result,i()}:(r=[],this.nextTick(i))}p.onabort=()=>{r(p.error||new Error("aborted by user")),r=null},p.oncomplete=()=>{r(null,g),r=null}}_next(t){if(this[s].length>0){const[e,r]=this[s].shift();this.nextTick(t,null,e,r)}else if(this[a])this.nextTick(t);else{let e=Math.min(100,this.limit-this.count);this[f]&&(this[f]=!1,e=1),this._nextv(e,p,((e,r)=>{if(e)return t(e);this[s]=r,this._next(t)}))}}_all(t,e){this[f]=!1;const r=this[s].splice(0,this[s].length),n=this.limit-this.count-r.length;if(n<=0)return this.nextTick(e,null,r);this._nextv(n,p,((t,n)=>{if(t)return e(t);r.length>0&&(n=r.concat(n)),e(null,n)}))}_seek(t,e){let r;this[f]=!0,this[s]=[],this[a]=!1,this[l]=void 0,this[u]={...this[c]};try{r=i(this[c])}catch(t){return void(this[a]=!0)}null===r||r.includes(t)?this[c].reverse?this[u].lte=t:this[u].gte=t:this[a]=!0}}},3452:t=>{"use strict";t.exports=function(t,e,r,n,i){if(0===n.limit)return t.nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const c=s.openKeyCursor?"openKeyCursor":"openCursor",u=n.reverse?"prev":"next";s[c](r,u).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const e=new TextEncoder;t.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):e.encode(t)}},7766:t=>{"use strict";t.exports=function(t){const e=void 0!==t.gte?t.gte:void 0!==t.gt?t.gt:void 0,r=void 0!==t.lte?t.lte:void 0!==t.lt?t.lt:void 0,n=void 0===t.gte,i=void 0===t.lte;return void 0!==e&&void 0!==r?IDBKeyRange.bound(e,r,n,i):void 0!==e?IDBKeyRange.lowerBound(e,n):void 0!==r?IDBKeyRange.upperBound(r,i):null}},8287:(t,e,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||X(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),a(t<0?0:0|d(t))}function f(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},8075:(t,e,r)=>{"use strict";var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},487:(t,e,r)=>{"use strict";var n=r(6743),i=r(453),o=r(6897),s=r(9675),a=i("%Function.prototype.apply%"),c=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||n.call(c,a),l=r(655),h=i("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new s("a function is required");var e=u(n,c,arguments);return o(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(n,a,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},8100:(t,e,r)=>{"use strict";var n=r(844);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},844:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},9743:(t,e)=>{function r(t){for(var e="",r=0;r0?"F"+s:"D"+r(s)},e.decode=function(t){if("DaN"===t)return NaN;if("FF"===t)return 1/0;if("DD"===t)return-1/0;var e="D"===t[0],n=(e?r(t):t).slice(2).split("M");return Number((e?"-":"")+n[1]+"e"+String(Number(n[0])-500))}},3381:(t,e)=>{var r={"?":"?@","!":"??",'"':"?%"},n={"?@":"?","??":"!","?%":'"'};e.factory=function(t){return{encode:e,decode:function(e){if("A"===e)return null;if("K!"===e)return[];for(var r,i=e.split('"'),o=[[]],s=0,a=i.length,c=0;c{var n=r(9743),i=r(3381);e.flip=function(t){var e=t.toString(),r="";for(var n in e)r+="."==e[n]?".":9-+e[n];return r},e.number=n,e.string={encode:function(t){return/\x00|\x01/.test(t)?"J"+t.replace(/\x01/g,"").replace(/\x00/g,""):"J"+t},decode:function(t){if("J"===t[0])return t.substring(1)}},e.encode=function(t){return e[typeof t].encode(t)},e.decode=function(t){if(""===t)return t;if(!o[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return o[t[0]](t)},e.object=i.factory(e),e.boolean={encode:function(t){return t?"C":"B"},decode:function(t){return"C"===t}},e.undefined={encode:function(t){return"L"},decode:function(){}};var o={A:e.object.decode,B:e.boolean.decode,C:e.boolean.decode,D:e.number.decode,F:e.number.decode,J:e.string.decode,K:e.object.decode,L:e.undefined.decode};e.buffer=!1,e.type="charwise"},41:(t,e,r)=>{"use strict";var n=r(655),i=r(8068),o=r(9675),s=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new o("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!s&&s(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8452:(t,e,r)=>{"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),c=r(592)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;c?a(t,e,r,!0):a(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";var n=r(453)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},1237:t=>{"use strict";t.exports=EvalError},9383:t=>{"use strict";t.exports=Error},9290:t=>{"use strict";t.exports=RangeError},9538:t=>{"use strict";t.exports=ReferenceError},8068:t=>{"use strict";t.exports=SyntaxError},9675:t=>{"use strict";t.exports=TypeError},5345:t=>{"use strict";t.exports=URIError},5388:(t,e,r)=>{"use strict";var n=r(9675);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},5437:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(162),o=r(9600),s=r(2120),a=r(3612);t.exports=function(t){if(i(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!o(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(i(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,l=d(c,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},2682:(t,e,r)=>{"use strict";var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(9353);t.exports=Function.prototype.bind||n},453:(t,e,r)=>{"use strict";var n,i=r(9383),o=r(1237),s=r(9290),a=r(9538),c=r(8068),u=r(9675),l=r(5345),h=Function,f=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(t){p=null}var d=function(){throw new u},y=p?function(){try{return d}catch(t){try{return p(arguments,"callee").get}catch(t){return d}}}():d,g=r(4039)(),m=r(24)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},E="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,w={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":y,"%TypedArray%":E,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var T=b(b(t));w["%Error.prototype%"]=T}var A=function t(e){var r;if("%AsyncFunction%"===e)r=f("async function () {}");else if("%GeneratorFunction%"===e)r=f("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=f("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return w[e]=r,r},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(6743),I=r(9957),_=O.call(Function.call,Array.prototype.concat),L=O.call(Function.apply,Array.prototype.splice),x=O.call(Function.call,String.prototype.replace),N=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,D=function(t,e){var r,n=t;if(I(S,n)&&(n="%"+(r=S[n])[0]+"%"),I(w,n)){var i=w[n];if(i===v&&(i=A(n)),void 0===i&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=N(t,0,1),r=N(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return x(t,C,(function(t,e,r,i){n[n.length]=r?x(i,k,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=D("%"+n+"%",e),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],L(r,_([0,1],l)));for(var h=1,f=!0;h=r.length){var m=p(s,d);s=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:s[d]}else f=I(s,d),s=s[d];f&&!a&&(w[o]=s)}}return s}},5795:(t,e,r)=>{"use strict";var n=r(453)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},592:(t,e,r)=>{"use strict";var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},24:t=>{"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof r)}},4039:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092:(t,e,r)=>{"use strict";var n=r(1333);t.exports=function(){return n()&&!!Symbol.toStringTag}},9957:(t,e,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);t.exports=o.call(n,i)},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*y}},4670:(t,e,r)=>{"use strict";var n=r(487),i=r(8075),o=r(453)("%ArrayBuffer%",!0),s=i("ArrayBuffer.prototype.byteLength",!0),a=i("Object.prototype.toString"),c=!!o&&!s&&new o(0).slice,u=!!c&&n(c);t.exports=s||u?function(t){if(!t||"object"!=typeof t)return!1;try{return s?s(t):u(t,0),!0}catch(t){return!1}}:o?function(t){return"[object ArrayBuffer]"===a(t)}:function(t){return!1}},9600:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(s(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},2120:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(9092)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},4035:(t,e,r)=>{"use strict";var n,i,o,s,a=r(8075),c=r(9092)();if(c){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var l=a("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{i(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7070:(t,e,r)=>{"use strict";var n=r(8075)("SharedArrayBuffer.prototype.byteLength",!0);t.exports=n?function(t){if(!t||"object"!=typeof t)return!1;try{return n(t),!0}catch(t){return!1}}:function(t){return!1}},3612:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(4039)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},5680:(t,e,r)=>{"use strict";var n=r(5767);t.exports=function(t){return!!n(t)}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},5356:(t,e)=>{"use strict";e.supports=function(...t){const e=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(e,{snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,getMany:e.getMany||!1,keyIterator:e.keyIterator||!1,valueIterator:e.valueIterator||!1,iteratorNextv:e.iteratorNextv||!1,iteratorAll:e.iteratorAll||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:Object.assign({},e.encodings),events:Object.assign({},e.events),additionalMethods:Object.assign({},e.additionalMethods)})}},6035:(t,e,r)=>{"use strict";const n=r(266),i=r(4341),{Encoding:o}=r(8110),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=Symbol("formats"),l=Symbol("encodings"),h=new Set(["buffer","view","utf8"]);e.Transcoder=class{constructor(t){if(!Array.isArray(t))throw new TypeError("The first argument 'formats' must be an array");if(!t.every((t=>h.has(t))))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'");this[l]=new Map,this[u]=new Set(t);for(const t in i)try{this.encoding(t)}catch(t){if("LEVEL_ENCODING_NOT_SUPPORTED"!==t.code)throw t}}encodings(){return Array.from(new Set(this[l].values()))}encoding(t){let e=this[l].get(t);if(void 0===e){if("string"==typeof t&&""!==t){if(e=p[t],!e)throw new n(`Encoding '${t}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if("object"!=typeof t||null===t)throw new TypeError("First argument 'encoding' must be a string or object");e=function(t){if(t instanceof o)return t;const e="type"in t&&"string"==typeof t.type?t.type:void 0,r=t.name||e||"anonymous-"+d++;switch(function(t){return"format"in t&&void 0!==t.format?t.format:"buffer"in t&&"boolean"==typeof t.buffer?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}(t)){case"view":return new a({...t,name:r});case"utf8":return new c({...t,name:r});case"buffer":return new s({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}(t)}const{name:r,format:i}=e;if(!this[u].has(i))if(this[u].has("view"))e=e.createViewTranscoder();else if(this[u].has("buffer"))e=e.createBufferTranscoder();else{if(!this[u].has("utf8"))throw new n(`Encoding '${r}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});e=e.createUTF8Transcoder()}for(const n of[t,r,e.name,e.commonName])this[l].set(n,e)}return e}};const f={binary:i.buffer,"utf-8":i.utf8},p={...i,...f};let d=0},8110:(t,e,r)=>{"use strict";const n=r(266),i=new Set(["buffer","view","utf8"]);e.Encoding=class{constructor(t){if(this.encode=t.encode||this.encode,this.decode=t.decode||this.decode,this.name=t.name||this.name,this.format=t.format||this.format,"function"!=typeof this.encode)throw new TypeError("The 'encode' property must be a function");if("function"!=typeof this.decode)throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),"string"!=typeof this.name||""===this.name)throw new TypeError("The 'name' property must be a string");if("string"!=typeof this.format||!i.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");t.createViewTranscoder&&(this.createViewTranscoder=t.createViewTranscoder),t.createBufferTranscoder&&(this.createBufferTranscoder=t.createBufferTranscoder),t.createUTF8Transcoder&&(this.createUTF8Transcoder=t.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}}},4341:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{Buffer:{isBuffer:()=>!1}},{textEncoder:i,textDecoder:o}=r(7200)(),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=t=>t;e.utf8=new c({encode:function(t){return n.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?o.decode(t):String(t)},decode:u,name:"utf8",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:function(t){return o.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}}),e.json=new c({encode:JSON.stringify,decode:JSON.parse,name:"json"}),e.buffer=new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:"buffer",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:n.from(String(t),"utf8")},decode:function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}}),e.view=new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:u,name:"view",createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:`${this.name}+buffer`})}}),e.hex=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"}),e.base64=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})},8343:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{},{Encoding:i}=r(8110),o=r(7200);class s extends i{constructor(t){super({...t,format:"buffer"})}createViewTranscoder(){return new a({encode:this.encode,decode:t=>this.decode(n.from(t.buffer,t.byteOffset,t.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}}class a extends i{constructor(t){super({...t,format:"view"})}createBufferTranscoder(){return new s({encode:t=>{const e=this.encode(t);return n.from(e.buffer,e.byteOffset,e.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}}e.BufferFormat=s,e.ViewFormat=a,e.UTF8Format=class extends i{constructor(t){super({...t,format:"utf8"})}createBufferTranscoder(){return new s({encode:t=>n.from(this.encode(t),"utf8"),decode:t=>this.decode(t.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){const{textEncoder:t,textDecoder:e}=o();return new a({encode:e=>t.encode(this.encode(e)),decode:t=>this.decode(e.decode(t)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}}},7200:t=>{"use strict";let e=null;t.exports=function(){return null===e&&(e={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),e}},266:t=>{"use strict";t.exports=class extends Error{constructor(t,e){super(t||""),"object"==typeof e&&null!==e&&(e.code&&(this.code=String(e.code)),e.expected&&(this.expected=!0),e.transient&&(this.transient=!0),e.cause&&(this.cause=e.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},8508:function(t,e){!function(t){"use strict";const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.ngraminator=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()},Object.defineProperty(t,"__esModule",{value:!0})}(e)},8859:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,E=String.prototype.toUpperCase,w=String.prototype.toLowerCase,T=RegExp.prototype.test,A=Array.prototype.concat,S=Array.prototype.join,O=Array.prototype.slice,I=Math.floor,_="function"==typeof BigInt?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,N="function"==typeof Symbol&&"object"==typeof Symbol.iterator,U="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||T.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-I(-t):I(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var R=r(2634),B=R.custom,F=$(B)?B:null;function P(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function j(t){return v.call(String(t),/"/g,""")}function M(t){return!("[object Array]"!==W(t)||U&&"object"==typeof t&&U in t)}function V(t){return!("[object RegExp]"!==W(t)||U&&"object"==typeof t&&U in t)}function $(t){if(N)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,i,a){var c=n||{};if(z(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!z(c,"customInspect")||c.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var T=String(e);return E?D(e,T):T}if("bigint"==typeof e){var I=String(e)+"n";return E?D(e,I):I}var L=void 0===c.depth?5:c.depth;if(void 0===i&&(i=0),i>=L&&L>0&&"object"==typeof e)return M(e)?"[Array]":"[Object]";var B,G=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=S.call(Array(t.indent+1)," ")}return{base:r,prev:S.call(Array(e+1),r)}}(c,i);if(void 0===a)a=[];else if(K(a,e)>=0)return"[Circular]";function H(e,r,n){if(r&&(a=O.call(a)).push(r),n){var o={depth:c.depth};return z(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),t(e,o,i+1,a)}return t(e,c,i+1,a)}if("function"==typeof e&&!V(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,H);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+S.call(et,", ")+" }":"")}if($(e)){var rt=N?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(e);return"object"!=typeof e||N?rt:Y(rt)}if((B=e)&&"object"==typeof B&&("undefined"!=typeof HTMLElement&&B instanceof HTMLElement||"string"==typeof B.nodeName&&"function"==typeof B.getAttribute)){for(var nt="<"+w.call(String(e.nodeName)),it=e.attributes||[],ot=0;ot"}if(M(e)){if(0===e.length)return"[]";var st=Z(e,H);return G&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+Q(st,G)+"]":"[ "+S.call(st,", ")+" ]"}if(function(t){return!("[object Error]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)){var at=Z(e,H);return"cause"in Error.prototype||!("cause"in e)||C.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+S.call(at,", ")+" }":"{ ["+String(e)+"] "+S.call(A.call("[cause]: "+H(e.cause),at),", ")+" }"}if("object"==typeof e&&y){if(F&&"function"==typeof e[F]&&R)return R(e,{depth:L-i});if("symbol"!==y&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return s&&s.call(e,(function(t,r){ct.push(H(r,e,!0)+" => "+H(t,e))})),J("Map",o.call(e),ct,G)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(H(t,e))})),J("Set",u.call(e),ut,G)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(Number(e)));if(function(t){if(!t||"object"!=typeof t||!_)return!1;try{return _.call(t),!0}catch(t){}return!1}(e))return Y(H(_.call(e)));if(function(t){return!("[object Boolean]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(d.call(e));if(function(t){return!("[object String]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)&&!V(e)){var lt=Z(e,H),ht=k?k(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!ht&&U&&Object(e)===e&&U in e?b.call(W(e),8,-1):ft?"Object":"",dt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+S.call(A.call([],pt||[],ft||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":G?dt+"{"+Q(lt,G)+"}":dt+"{ "+S.call(lt,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return G.call(t,e)}function W(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return P(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,H),"single",e)}function H(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+E.call(e.toString(16))}function Y(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):S.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+S.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=M(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(3474),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y0)for(var g=0;g{"use strict";var n=Array.prototype.slice,i=r(3474),o=Object.keys,s=o?function(t){return o(t)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},3474:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6578:t=>{"use strict";t.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},5372:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,c,u,l=!0;function h(t){function e(){r&&r(t,i),r=null}l?n(e):e()}function f(e,r,n){if(i[e]=n,r&&(c=!0),0==--s||r)h(r);else if(!c&&u{"use strict";var n=r(453)("%Array.prototype.concat%"),i=r(487),o=r(8075)("Array.prototype.slice"),s=r(1333)()&&Symbol.isConcatSpreadable,a=[],c=s?i.apply(n,a):null,u=s?r(4634):null;t.exports=s?function(t){for(var e=0;e{"use strict";var n=r(8075),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==o(t,e)}}},6897:(t,e,r)=>{"use strict";var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&s){var l=s(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},8206:(t,e,r)=>{"use strict";var n=r(5388),i=r(4810),o=r(8075)("String.prototype.replace"),s=/^\s$/.test("᠎"),a=s?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=s?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=i(n(this));return o(o(t,a,""),c,"")}},214:(t,e,r)=>{"use strict";var n=r(487),i=r(8452),o=r(5388),s=r(8206),a=r(4895),c=r(9377),u=n(a()),l=function(t){return o(t),u(t)};i(l,{getPolyfill:a,implementation:s,shim:c}),t.exports=l},4895:(t,e,r)=>{"use strict";var n=r(8206);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9377:(t,e,r)=>{"use strict";var n=r(8452),i=r(4895);t.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1093:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var o=i.slice(n,n+e);o.length===e&&(r=JSON.stringify(o),t[r]=t[r]||[],t[r].push(n))})),t)),{});return Object.keys(r).map((t=>({term:JSON.parse(t),positions:r[t]}))).sort(((t,e)=>t.term[0]>e.term[0]))}},6623:(t,e,r)=>{"use strict";var n=r(5767),i=r(3432),o=r(5795);function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function c(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r2?arguments[2]:y,l=s.includeSymbols?f:u,h=!!s.immutable;return function t(u){var f=h?d(u,s):u,y={},g=!0,m={node:f,node_:u,path:[].concat(r),parent:n[n.length-1],parents:n,key:r[r.length-1],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(g=!1)},delete:function(t){delete m.parent.node[m.key],t&&(g=!1)},remove:function(t){a(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(g=!1)},keys:null,before:function(t){y.before=t},after:function(t){y.after=t},pre:function(t){y.pre=t},post:function(t){y.post=t},stop:function(){i=!1},block:function(){g=!1}};if(!i)return m;function b(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=l(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t1?arguments[1]:y,this.value=t}function b(t){return new m(t,arguments.length>1?arguments[1]:y)}m.prototype.get=function(t){for(var e=this.value,r=0;e&&r{"use strict";var n=r(9675),i=r(8075)("TypedArray.prototype.buffer",!0),o=r(5680);t.exports=i||function(t){if(!o(t))throw new n("Not a Typed Array");return t.buffer}},2308:(t,e,r)=>{"use strict";var n=r(2682),i=r(487),o=r(9209)(),s={},a=r(24)(),c=r(5795),u=Object.defineProperty;if(c){var l=function(t){return t.byteOffset};n(o,(function(t){if("function"==typeof r.g[t]||"object"==typeof r.g[t]){var e=r.g[t].prototype,n=c(e,"byteOffset");if(!n&&a){var o=e.__proto__;n=c(o,"byteOffset")}if(n&&n.get)s[t]=i(n.get);else if(u){var h=new r.g[t](2);(n=c(h,"byteOffset"))&&n.configurable&&u(h,"length",{value:3}),2===h.length&&(s[t]=l)}}}))}var h=r(5680);t.exports=function(t){return!!h(t)&&function(t){var e;return n(s,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},6058:(t,e,r)=>{"use strict";var n=r(487),i=r(2682),o=r(5795),s=r(24)(),a=r(5680),c=r(6578),u={__proto__:null},l=Object.defineProperty;if(o){var h=function(t){return t.length};i(c,(function(t){var e=r.g[t];if("function"==typeof e||"object"==typeof e){var i=e.prototype,a=o(i,"length");if(!a&&s){var c=i.__proto__;a=o(c,"length")}if(a&&a.get)u["$"+t]=n(a.get);else if(l){var f=new r.g[t](2);(a=o(f,"length"))&&a.configurable&&l(f,"length",{value:3}),2===f.length&&(u["$"+t]=h)}}}))}t.exports=function(t){return!!a(t)&&function(t){var e;return i(u,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},8268:(t,e,r)=>{"use strict";var n=r(9675),i=r(280),o=r(2282),s=r(5910),a=r(4470),c=r(1752),u=r(2076),l=r(2138),h=r(7196),f=r(4810),p=r(4742),d=r(6419),y=r(7057),g=r(1509),m=r(4372),b=r(2308);t.exports=function(t,e){var r=this;g(r,"SEQ-CST");var v,E=r.length,w=h(t);v=w===-1/0?0:w<0?a(E+w,0):c(w,E);var T,A=void 0===e?E:h(e);T=A===-1/0?0:A<0?a(E+A,0):c(A,E);var S=a(T-v,0),O=y(r,[S]);if(S>0){if(s(m(r)))throw new n("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");if(d(r)===d(O))for(var I=m(r),_=m(O),L=p(r),x=v*L+b(r),N=b(O),U=N+S*L;N{"use strict";var n=r(8452),i=r(487),o=r(8268),s=r(2521),a=r(8599),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},2521:(t,e,r)=>{"use strict";var n=r(8268);t.exports=function(){return"function"==typeof Uint8Array&&Uint8Array.prototype.slice||n}},8599:(t,e,r)=>{"use strict";var n=r(8452),i=r(6763),o=r(2521);t.exports=function(){if("function"==typeof Uint8Array){var t=o(),e=i(Uint8Array.prototype);n(e,{slice:t},{slice:function(){return e.slice!==t}})}return t}},5767:(t,e,r)=>{"use strict";var n=r(2682),i=r(9209),o=r(487),s=r(8075),a=r(5795),c=s("Object.prototype.toString"),u=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),f=s("String.prototype.slice"),p=Object.getPrototypeOf,d=s("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(y,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(y,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},2634:()=>{},9209:(t,e,r)=>{"use strict";var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(9675),i=r(5910),o=r(4670),s=r(7070),a=r(9511);t.exports=function(t,e){var r=s(t);if(!o(t)&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(i(t))throw new n("Assertion failed: `arrayBuffer` must not be detached");return a(t)}},9969:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9290),o=r(9675),s=n&&n(0);t.exports=function(t,e){if("bigint"!=typeof t||"bigint"!=typeof e)throw new o("Assertion failed: `n` and `d` arguments must be BigInts");if(e===s)throw new i("Division by zero");return t===s?s:t%e}},893:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(4769),s=r(7030),a=r(8131),c=r(3400),u=r(2875),l=r(259),h=r(7730);t.exports=function(t,e,r){if("Object"!==h(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var f=i(r)?r:l(r);if(!i(f))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(a,u,s,t,e,f)}},7030:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(2997);t.exports=function(t){if(void 0!==t&&!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return o(t)}},280:(t,e,r)=>{"use strict";var n=r(9675),i=r(8859),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!o(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+i(e));return t[e]}},2282:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(8075)("Array.prototype.slice"),c=r(1087),u=r(5910),l=r(6167),h=r(4670),f=r(7070),p=r(4399),d=r(4097),y=r(5100);t.exports=function(t,e,r,n,g){var m=f(t);if(!h(t)&&!m)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!c(e))throw new o("Assertion failed: `byteIndex` must be an integer");if("string"!=typeof r||"number"!=typeof d.size["$"+r])throw new o("Assertion failed: `type` must be a Typed Array element type");if("boolean"!=typeof n)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==g&&"UNORDERED"!==g)throw new o("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&"boolean"!=typeof arguments[5])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: `arrayBuffer` is detached");if(e<0)throw new o("Assertion failed: `byteIndex` must be non-negative");var b,v=d.size["$"+r];if(!v)throw new o('Assertion failed: `type` must be one of "INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"');if(m)throw new i("SharedArrayBuffer is not supported by this implementation");b=a(new s(t,e),0,v);var E=arguments.length>5?arguments[5]:"little"===y,w=E?a(p([0,0,0,0,0,0,0,0],b),-v):a(p(b,[0,0,0,0,0,0,0,0]),0,v);return l(r,w,E)}},2491:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");return i(t,e)}},533:(t,e,r)=>{"use strict";t.exports=r(1412)},7881:t=>{"use strict";t.exports=function(t){return"BIGUINT64"===t||"BIGINT64"===t}},6966:(t,e,r)=>{"use strict";t.exports=r(9600)},4528:(t,e,r)=>{"use strict";var n=r(1376)("%Reflect.construct%",!0),i=r(893);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},8131:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(5701);t.exports=function(t){if(void 0===t)return!1;if(!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!i(t,"[[Value]]")&&!i(t,"[[Writable]]"))}},5910:(t,e,r)=>{"use strict";var n=r(9675),i=r(9511),o=r(9209)(),s=r(8075),a=r(4670),c=r(7070),u=s("SharedArrayBuffer.prototype.byteLength",!0);t.exports=function(t){var e=c(t);if(!a(t)&&!e)throw new n("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if(0===(e?u:i)(t))try{new r.g[o[0]](t)}catch(t){return!!t&&"TypeError"===t.name}return!1}},6575:(t,e,r)=>{"use strict";var n=r(9675),i=r(8075),o=i("%ArrayBuffer.prototype.resizable%",!0),s=i("%SharedArrayBuffer.prototype.growable%",!0),a=r(4670),c=r(7070);t.exports=function(t){var e=a(t),r=c(t);if(!e&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return e&&o?!o(t):!r||!s||!s(t)}},3400:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},5291:(t,e,r)=>{"use strict";var n=r(9675),i=r(5910),o=r(4742),s=r(9346),a=r(4372),c=r(2308),u=r(6058);t.exports=function(t){if(!s(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var e=t["[[Object]]"],r=t["[[CachedBufferByteLength]]"];if(i(a(e))&&"DETACHED"!==r)throw new n("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if("DETACHED"===r)return!0;var l,h=c(e),f=u(e);return l="AUTO"===f?r:h+f*o(e),h>r||l>r}},9373:t=>{"use strict";t.exports=function(t){return"UINT8"===t||"UINT8C"===t||"UINT16"===t||"UINT32"===t||"BIGUINT64"===t}},6681:(t,e,r)=>{"use strict";var n=r(9675),i=r(7149),o=r(5910),s=r(5680),a=r(4372);t.exports=function(t,e){if(!s(t))throw new n("Assertion failed: `obj` must be a Typed Array");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var r=a(t);return{"[[Object]]":t,"[[CachedBufferByteLength]]":o(r)?"DETACHED":i(r,e)}}},5015:(t,e,r)=>{"use strict";var n=r(9675),i=r(2491),o=r(3446),s=r(9887),a=r(3557),c=r(2475),u=r(7088),l=r(172),h=r(4770),f=r(6039),p=r(9308),d=r(2779),y=r(8894),g=r(4751),m=r(1189),b={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8},v={__proto__:null,INT8:u,UINT8:f,UINT8C:p,INT16:a,UINT16:l,INT32:c,UINT32:h,BIGINT64:o,BIGUINT64:s};t.exports=function(t,e,r){if("string"!=typeof t||!i(b,t))throw new n("Assertion failed: `type` must be a TypedArray element type: "+m(b));if("number"!=typeof e&&"bigint"!=typeof e)throw new n("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof r)throw new n("Assertion failed: `isLittleEndian` must be a Boolean");if("FLOAT32"===t)return d(e,r);if("FLOAT64"===t)return y(e,r);var o=b[t],s=(0,v[t])(e);return g(s,o,r)}},6167:(t,e,r)=>{"use strict";var n=r(453),i=r(8075),o=r(9290),s=r(8068),a=r(9675),c=n("%BigInt%",!0),u=r(2491),l=r(533),h=r(7881),f=r(9373),p=r(4915),d=r(8968),y=r(6570),g=r(4138),m=r(2158),b=i("Array.prototype.reverse"),v=i("Array.prototype.slice"),E=r(1189),w={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8};t.exports=function(t,e,r){if(!u(w,t))throw new a("Assertion failed: `type` must be a TypedArray element type: "+E(w));if(!l(e)||!g(e,m))throw new a("Assertion failed: `rawBytes` must be an Array of bytes");if("boolean"!=typeof r)throw new a("Assertion failed: `isLittleEndian` must be a Boolean");var n=w[t];if(e.length!==n)throw new o("Assertion failed: `rawBytes` must have a length of "+n+" for type "+t);var i=h(t);if(i&&!c)throw new s("this environment does not support BigInts");return e=v(e,0,n),r||b(e),"FLOAT32"===t?p(e):"FLOAT64"===t?d(e):y(e,n,f(t),i)}},2875:(t,e,r)=>{"use strict";var n=r(8756);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},2076:(t,e,r)=>{"use strict";var n=r(9675),i=r(3400),o=r(2875),s=r(7730),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof c)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},2138:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(1087),c=r(7881),u=r(5910),l=r(5015),h=r(4670),f=r(7070),p=r(9957),d=r(4097),y=r(5100),g=r(3795);t.exports=function(t,e,r,n,m,b){var v=f(t);if(!h(t)&&!v)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!a(e)||e<0)throw new o("Assertion failed: `byteIndex` must be a non-negative integer");if("string"!=typeof r||!p(d.size,"$"+r))throw new o("Assertion failed: `type` must be a Typed Array Element Type");if("number"!=typeof n&&"bigint"!=typeof n)throw new o("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof m)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==b&&"UNORDERED"!==b&&"INIT"!==b)throw new o('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: ArrayBuffer is detached");if(c(r)?"bigint"!=typeof n:"number"!=typeof n)throw new o("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var E=d.size["$"+r],w=l(r,n,arguments.length>6?arguments[6]:"little"===y);if(v)throw new i("SharedArrayBuffer is not supported by this implementation");var T=new s(t,e,E);g(w,(function(t,e){T[e]=t}))}},7732:(t,e,r)=>{"use strict";var n=r(453)("%Symbol.species%",!0),i=r(9675),o=r(4528),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var a=n?r[n]:void 0;if(null==a)return e;if(o(a))return a;throw new i("no constructor found")}},9693:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9675),o=r(8068);t.exports=function(t){if("string"!=typeof t)throw new i("`argument` must be a string");if(!n)throw new o("BigInts are not supported in this environment");try{return n(t)}catch(t){return}}},8679:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%RegExp%"),s=r(9675),a=n("%parseInt%"),c=r(8075),u=r(9721),l=c("String.prototype.slice"),h=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),y=r(214);t.exports=function t(e){if("string"!=typeof e)throw new s("Assertion failed: `argument` is not a String");if(h(e))return i(a(l(e,2),2));if(f(e))return i(a(l(e,2),8));if(d(e)||p(e))return NaN;var r=y(e);return r!==e?t(r):i(e)}},2964:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Number%"),s=r(9675),a=r(8068),c=r(9693),u=r(866);t.exports=function(t){if(!i)throw new a("BigInts are not supported in this environment");var e=u(t,o);if(null==e)throw new s("Cannot convert null or undefined to a BigInt");if("boolean"==typeof e)return i(e?1:0);if("number"==typeof e)throw new s("Cannot convert a Number value to a BigInt");if("string"==typeof e){var r=c(e);if(void 0===r)throw new s("Failed to parse String to BigInt");return r}if("symbol"==typeof e)throw new s("Cannot convert a Symbol value to a BigInt");if("bigint"!=typeof e)throw new a("Assertion failed: unknown primitive type");return e}},3446:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,31)),l=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t),r=c(a,e,l);return r>=u?r-l:r}},9887:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t);return c(a,e,u)}},4323:t=>{"use strict";t.exports=function(t){return!!t}},3557:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return a>=32768?a-65536:a}},2475:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046),a=4294967296;t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),c=n(r,a),u=c>=2147483648?c-a:c;return 0===u?0:u}},7088:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,256);return a>=128?a-256:a}},7196:(t,e,r)=>{"use strict";var n=r(8410),i=r(3384),o=r(8756),s=r(5046);t.exports=function(t){var e=n(t);return o(e)||0===e?0:s(e)?i(e):e}},8410:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Number%"),s=r(6600),a=r(866),c=r(8679);t.exports=function(t){var e=s(t)?t:a(t,o);if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):o(e)}},866:(t,e,r)=>{"use strict";var n=r(5437);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},259:(t,e,r)=>{"use strict";var n=r(9957),i=r(9675),o=r(7730),s=r(4323),a=r(6966);t.exports=function(t){if("Object"!==o(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!a(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},4810:(t,e,r)=>{"use strict";var n=r(453)("%String%"),i=r(9675);t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return n(t)}},172:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return 0===a?0:a}},4770:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,4294967296);return 0===a?0:a}},6039:(t,e,r)=>{"use strict";var n=r(5046),i=r(4224),o=r(8410),s=r(3384);t.exports=function(t){var e=o(t);if(!n(e)||0===e)return 0;var r=s(e);return i(r,256)}},9308:(t,e,r)=>{"use strict";var n=r(9719),i=r(8410),o=r(5986),s=r(8756);t.exports=function(t){var e=i(t);if(s(e))return 0;var r=n(e,0,255),a=o(r);return ra+.5?a+1:a%2==0?a:a+1}},7730:(t,e,r)=>{"use strict";var n=r(2439);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},9531:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(533),s=r(4528),a=r(5291),c=r(9271),u=r(1509),l=r(9209)();t.exports=function(t,e){if(!s(t))throw new i("Assertion failed: `constructor` must be a constructor");if(!o(e))throw new i("Assertion failed: `argumentList` must be a List");if(0===l.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r;r=0===e.length?new t:1===e.length?new t(e[0]):2===e.length?new t(e[0],e[1]):new t(e[0],e[1],e[2]);var h=u(r,"SEQ-CST");if(1===e.length&&"number"==typeof e[0]){if(a(h))throw new i("new Typed Array is out of bounds");if(c(h){"use strict";var n=r(8068),i=r(9675),o=r(1087),s=r(5767),a=r(4097);t.exports=function(t){var e=s(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=a.size["$"+a.name["$"+e]];if(!o(r)||r<0)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},6419:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(4097);t.exports=function(t){var e=o(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=s.name["$"+e];if("string"!=typeof r)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},9271:(t,e,r)=>{"use strict";var n=r(9675),i=r(5986),o=r(6575),s=r(5291),a=r(4742),c=r(9346),u=r(4372),l=r(2308),h=r(6058);t.exports=function(t){if(!c(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(s(t))throw new n("Assertion failed: `taRecord` is out of bounds");var e=t["[[Object]]"],r=h(e);if("AUTO"!==r)return r;if(o(u(e)))throw new n("Assertion failed: array buffer is not fixed length");var f=l(e),p=a(e),d=t["[[CachedBufferByteLength]]"];if("DETACHED"===d)throw new n("Assertion failed: typed array is detached");return i((d-f)/p)}},7057:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(9209)(),a=r(533),c=r(7732),u=r(9531),l=r(2697);t.exports=function(t,e){if(0===s.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r=o(t);if(!r)throw new i("Assertion failed: exemplar must be a TypedArray");if(!a(e))throw new i("Assertion failed: `argumentList` must be a List");var h=l(r);if("function"!=typeof h)throw new n("Assertion failed: `constructor` of `exemplar` ("+r+") must exist. Please report this!");var f=c(t,h);return u(f,e)}},1509:(t,e,r)=>{"use strict";var n=r(9675),i=r(5291),o=r(6681),s=r(7730),a=r(5680);t.exports=function(t,e){if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!a(t))throw new n("Assertion failed: `O` must be a Typed Array");var r=o(t,e);if(i(r))throw new n("`O` must be in-bounds and backed by a non-detached buffer");return r}},9719:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Math.max%"),s=n("%Math.min%");t.exports=function(t,e,r){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof r||!(e<=r))throw new i("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return s(o(e,t),r)}},5986:t=>{"use strict";var e=Math.floor;t.exports=function(t){return"bigint"==typeof t?t:e(t)}},4470:(t,e,r)=>{"use strict";var n=r(453);t.exports=n("%Math.max%")},1752:(t,e,r)=>{"use strict";var n=r(453);t.exports=n("%Math.min%")},4224:(t,e,r)=>{"use strict";var n=r(113);t.exports=function(t,e){return n(t,e)}},4097:t=>{"use strict";t.exports={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8}}},3384:(t,e,r)=>{"use strict";var n=r(5986),i=r(9675);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2439:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},1376:(t,e,r)=>{"use strict";t.exports=r(453)},4769:(t,e,r)=>{"use strict";var n=r(592),i=r(655),o=n.hasArrayLengthDefineBug(),s=o&&r(1412),a=r(8075)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,c,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(c in n&&a(n,c)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[c]=l,e(n[c],l)}return o&&"length"===c&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,c,r(u)),!0)}},1412:(t,e,r)=>{"use strict";var n=r(453)("%Array%"),i=!n.isArray&&r(8075)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4915:(t,e,r)=>{"use strict";var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[3]?-1:1,r=(127&t[3])<<1|t[2]>>7,i=(127&t[2])<<16|t[1]<<8|t[0];return 0===r&&0===i?1===e?0:-0:255===r&&0===i?1===e?1/0:-1/0:255===r&&0!==i?NaN:-127==(r-=127)?e*i*n(2,-149):e*(1+i*n(2,-23))*n(2,r)}},8968:(t,e,r)=>{"use strict";var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[7]?-1:1,r=(127&t[7])<<4|(240&t[6])>>4,i=281474976710656*(15&t[6])+1099511627776*t[5]+4294967296*t[4]+16777216*t[3]+65536*t[2]+256*t[1]+t[0];return 0===r&&0===i?0*e:2047===r&&0!==i?NaN:2047===r&&0===i?e*(1/0):-1023==(r-=1023)?e*i*5e-324:e*(1+i/4503599627370496)*n(2,r)}},6570:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.pow%"),o=n("%Number%"),s=n("%BigInt%",!0);t.exports=function(t,e,r,n){for(var a=n?s:o,c=a(0),u=0;u{"use strict";var n=r(453),i=n("%Uint8Array%",!0),o=n("%Uint32Array%",!0),s=r(4372),a=o&&new o([305419896]),c=a&&new i(s(a));t.exports=c?120===c[0]?"little":18===c[0]?"big":52===c[0]?"mixed":"unknown":"indeterminate"},4138:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";var e=1075;t.exports=function(t){var r="";if(0===t)return r;for(var n,i=e,o=0;o=1?(t=n-1,r+="1",i===e&&(i=o)):(t=n,r+="0"),1===n||o-i>54)return r;return r}},2997:t=>{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},6763:(t,e,r)=>{"use strict";var n=r(453)("%Object.getPrototypeOf%",!0),i=r(24)();t.exports=n||(i?function(t){return t.__proto__}:null)},8213:(t,e,r)=>{"use strict";var n=r(453)("%Math.floor%");t.exports=function(t){for(var e,r="";t>0;)r=(e=t/2)===(t=n(e))?"0"+r:"1"+r;return r}},4751:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%BigInt%",!0);t.exports=function(t,e,r){var n="bigint"==typeof t?o:i;t<0&&(t>>>=0);for(var s=[],a=0;a>=n(8);return s}},2158:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=0&&t<=255&&(0|t)===t}},5046:(t,e,r)=>{"use strict";var n=r(8756);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1087:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=r(8756),a=r(5046);t.exports=function(t){if("number"!=typeof t||s(t)||!a(t))return!1;var e=i(t);return o(e)===e}},8756:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},3508:t=>{"use strict";t.exports=function(t){return 0===t&&1/t==-1/0}},6600:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},113:t=>{"use strict";var e=Math.floor;t.exports=function(t,r){var n=t%r;return e(n>=0?n:n+r)}},122:t=>{"use strict";t.exports=function(t,e,r){var n=t(e,r);return n>=0?n:n+r}},5701:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(i(t,e)&&!o[e])return!1;var r=i(t,"[[Value]]")||i(t,"[[Writable]]"),s=i(t,"[[Get]]")||i(t,"[[Set]]");if(r&&s)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}},9346:(t,e,r)=>{"use strict";var n=r(9957),i=r(5680),o=r(1087);t.exports=function(t){return!!t&&"object"==typeof t&&n(t,"[[Object]]")&&n(t,"[[CachedBufferByteLength]]")&&(o(t["[[CachedBufferByteLength]]"])&&t["[[CachedBufferByteLength]]"]>=0||"DETACHED"===t["[[CachedBufferByteLength]]"])&&i(t["[[Object]]"])}},2697:(t,e,r)=>{"use strict";var n=r(453),i={__proto__:null,$Int8Array:n("%Int8Array%",!0),$Uint8Array:n("%Uint8Array%",!0),$Uint8ClampedArray:n("%Uint8ClampedArray%",!0),$Int16Array:n("%Int16Array%",!0),$Uint16Array:n("%Uint16Array%",!0),$Int32Array:n("%Int32Array%",!0),$Uint32Array:n("%Uint32Array%",!0),$BigInt64Array:n("%BigInt64Array%",!0),$BigUint64Array:n("%BigUint64Array%",!0),$Float32Array:n("%Float32Array%",!0),$Float64Array:n("%Float64Array%",!0)};t.exports=function(t){return i["$"+t]}},2779:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=n("%Math.pow%"),a=r(5046),c=r(8756),u=r(3508);t.exports=function(t,e){if(c(t))return e?[0,0,192,127]:[127,192,0,0];var r;if(0===t)return r=u(t)?128:0,e?[0,0,0,r]:[r,0,0,0];if(i(t)>34028234663852886e22||!a(t))return r=t<0?255:127,e?[0,0,128,r]:[r,128,0,0];var n=t<0?1:0;t=i(t);for(var l=0;t>=2;)l+=1,t/=2;for(;t<1;)l-=1,t*=2;var h=t-1;h*=s(2,23)+.5,l+=127;var f=n<<31|(l<<=23)|(h=o(h)),p=255&f,d=255&(f>>=8),y=255&(f>>=8),g=255&(f>>=8);return e?[p,d,y,g]:[g,y,d,p]}},8894:(t,e,r)=>{"use strict";var n=r(453),i=n("%parseInt%"),o=n("%Math.abs%"),s=n("%Math.floor%"),a=r(8075),c=a("String.prototype.indexOf"),u=a("String.prototype.slice"),l=r(9154),h=r(8213),f=r(3508),p="11111111111",d="00000000000",y=d+d+d+d+"0000000";t.exports=function(t,e){var r,n,a=t<0||f(t)?"1":"0";if(isNaN(t))r=p,n="1"+y;else if(isFinite(t))if(0===t)r=d,n="0"+y;else{t=o(t);var g,m=s(t),b=h(m),v=l(t-m);if(b)r=b.length-1;else{var E=c(v,"1");E>-1&&(g=E+1),r=-g}n=b+v,r<0?(r<=-1023&&(g=1022),n=u(n,g)):n=u(n,1),r=u(d+h(r+1023),-11),n=u(n+y+"0",0,52)}else r=p,n="0"+y;for(var w=a+r+n,T=[],A=0;A<8;A++)T[e?8-A-1:A]=i(u(w,8*A,8*(A+1)),2);return T}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{SearchIndex:()=>Q,UI:()=>Z});var t=r(1093),e=r(8508);const i=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),o=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],s=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),a=([t,e,r])=>{const{fields:n,values:i}=r.replace,o=()=>t.reduce(((t,e)=>[e,...t,...i[e]||[]]),[]);return i?n?n.includes(e)?Promise.resolve([o(),e,r]):Promise.resolve([t,e,r]):Promise.resolve([o(),e,r]):Promise.resolve([t,e,r])},c=([t,r,n])=>{let{fields:i,lengths:o,join:s=" "}=n.ngrams;return i||(i=[r]),o&&i.includes(r)?[(0,e.ngraminator)(t.filter((t=>null!==t)),o).map((t=>t.join(s))),r,n]:Promise.resolve([t,r,n])},u=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([e,r,n])=>{const i=t(e),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>[t.term[0],(t.positions.length/o).toFixed(2)])).sort(),r,n])},h={SPLIT:i,SKIP:o,LOWCASE:s,REPLACE:a,NGRAMS:c,STOPWORDS:u,SCORE_TERM_FREQUENCY:l,SPY:([t,e,r])=>(console.log("----------------"),console.log("field ->"),console.log(e),console.log("tokens ->"),console.log(t),console.log("----------------"),Promise.resolve([t,e,r]))},f=(t,e,r)=>i([t,e,r]).then(o).then(s).then(a).then(c).then(u).then(l).then((([t,e,r])=>t));var p=r(9148),d=r(7007),y=r(9901);function g(t,e){const r=t=>"string"==typeof t,n=async(r,n=t=>new Promise((e=>e(t))))=>new Promise((async(o,a)=>{const c=t=>void 0===t?o(void 0):t instanceof Promise?o(t):void 0;try{c(r),r=e.parse(r),r=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(r),c(r=await(e=>void 0===e?s(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?i(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(r)),c(r=await n(r))}catch(t){return a(t)}return Array.isArray(r)?o(r):o(s(r))})),i=async(t,e)=>Promise.all(t.map((t=>n(t,e)))).then((t=>{const e=t.flat(1/0).reduce(((t,e)=>(e&&t.set(e._id,[...t.get(e._id)||[],e._match]),t)),new Map);return{sumTokensMinusStopwords:t.filter((t=>t)).length,union:Array.from(e.keys()).map((t=>({_id:t,_match:e.get(t)})))}})),o=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(y.HI),["IDX",t,n]},s=t=>new Promise((e=>{if(void 0===t)return e(void 0);const r=new Map;Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0),limit:t.LIMIT,reverse:t.REVERSE}).then((t=>t.forEach((t=>t.value.forEach((e=>r.set(e,[...r.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})])))))))))).then((()=>e(Array.from(r.keys()).map((t=>({_id:t,_match:r.get(t)}))))))})),a=(t,e,r=!0)=>e?0===e.length?[]:(e=new Set(e.map((t=>t._id))),t.map((t=>Object.assign(t,{_id:[...new Set([...t._id].filter((t=>e.has(t))))]}))).filter((t=>!r||t._id.length))):t,c=t=>(t=e.parse(t),n(t).then((e=>({_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE,...t})))),u=e=>t.db.iterator(e).all().then((t=>t.map((([t,e])=>({key:t,value:e}))))),l=(t,r)=>s({...e.parse(t),LIMIT:1,REVERSE:r}).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),h=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>{let r=t.VALUE.LTE;void 0!==t.VALUE.LTE&&"number"!=typeof t.VALUE.LTE&&(r+="○");let n=t.VALUE.GTE;return t.VALUE.GTE&&"number"!=typeof t.VALUE.GTE&&(n+=" "),u({gte:o(e,n),lte:o(e,r,!0),keys:!0,values:!1}).then((t=>t.map((({key:t})=>({FIELD:t[1],VALUE:t[2][0]})))))}))).then((t=>t.flat()))),f=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0)}).then((t=>t.map((t=>({FIELD:t.key[1],VALUE:t.key[2][0],_id:t.value})))))))).then((t=>t.flat()))),p=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});return{AGGREGATE:({BUCKETS:t,FACETS:e,QUERY:r})=>Promise.all([t,e,r]).then((([t=[],e=[],r=[]])=>({BUCKETS:a(t.flat(),r),FACETS:a(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:a,BUCKET:c,BUCKETS:(...t)=>Promise.all(t.map(c)),CREATED:()=>t.db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(h):[h({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),EXIST:(...e)=>Promise.all(e.map((e=>t.db.get([t.docExistsSpace,e]).catch((t=>null))))).then((t=>t.reduce(((t,r,n)=>(null!=r&&t.push(e[n]),t)),[]))),EXPORT:u,FACETS:(...t)=>Promise.all(t.length?t.map(f):[f({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:()=>u({gte:["FIELD",y.LO],lte:["FIELD",y.HI]}).then((t=>t.map((t=>t.key[1])))),GET:n,INTERSECTION:(t,e)=>i(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t.db.get(["~LAST_UPDATED"]),MAX:t=>l(t,!0),MIN:l,OBJECT:e=>Promise.all(e.map((e=>t.db.get(["DOC",e._id]).catch((t=>null))))).then((t=>e.map(((e,r)=>(e._object=t[r],e))))),SET_SUBTRACTION:(t,e)=>Promise.all([r(t)?n(t):t,r(e)?n(e):e]).then((([t,e])=>t.filter((t=>-1===e.map((t=>t._id)).indexOf(t._id))))),SORT:t=>new Promise((e=>e(t.sort(((t,e)=>p.compare(t._id,e._id)))))),UNION:i}}y.LO=null,y.HI=void 0;var m=r(6623);const b=null,v=void 0;class E{availableFields=[];#t;constructor(t){this.#t=t}setAvailableFields=t=>{this.availableFields=t};#e=t=>{const e=t=>this.#t||"string"!=typeof t?t:t.toLowerCase();return{FIELD:t.FIELD.map(e),VALUE:{GTE:e(t.VALUE.GTE),LTE:e(t.VALUE.LTE)}}};parse(t){if(Array.isArray(t))throw new Error("token cannot be Array");if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return this.#e({FIELD:this.availableFields,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return this.#e({FIELD:[e],VALUE:{GTE:r.join(":"),LTE:r.join(":")}})}return"number"==typeof t&&(t={VALUE:{GTE:t,LTE:t}}),null===t.VALUE&&(t.VALUE={GTE:null,LTE:null}),"string"!=typeof t.VALUE&&"number"!=typeof t.VALUE||(t.VALUE={GTE:t.VALUE,LTE:t.VALUE}),void 0!==t.VALUE&&Object.keys(t.VALUE).length||(t.VALUE={GTE:b,LTE:v}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=b),void 0===t.VALUE.LTE&&(t.VALUE.LTE=v),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?this.#e({FIELD:this.availableFields,...t}):(t.FIELD=[t.FIELD].flat(),this.#e(t))}}class w{constructor(t={}){t={caseSensitive:!0,isLeaf:t=>"string"==typeof t||"number"==typeof t,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC",db:new t.Level(t.name,{keyEncoding:y,valueEncoding:"json"}),...t};const e=new E(t.caseSensitive),r=new d,n=g(t,e),i=function(t,e,r){let n=0;const i=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const n=[];return m(e._object).forEach((function(e){const i=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"!==i&&!r.doNotIndexField.filter((t=>i.startsWith(t))).length&&t.isLeaf(this.node)){if(!t.stopwords.includes(this.node)){const e=JSON.stringify([i,[this.node].flat(1/0).map((e=>"string"!=typeof e||t.caseSensitive?e:e.toLowerCase()))]);n.push(t.caseSensitive?e:e.toLowerCase())}this.update(this.node,!0)}})),{_id:e._id,keys:n}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(e,r,s,a,c)=>new Promise((u=>{e=e.map((t=>{var e;return t._id=void 0===(e=t._id)?++n:"string"==typeof e||"number"==typeof e?e:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),g(t).EXIST(...e.map((t=>t._id))).then((t=>((t,e,r)=>{const n=Object.keys(t);return Promise.all(n.map((t=>["IDX",...JSON.parse(t)])).map((t=>new Promise(((r,n)=>e.get(t).then(r).catch((t=>r([])))))))).then((e=>e.map(((e,i)=>{const o=new Set(e),s=new Set(t[n[i]]);if("put"===r)return{key:["IDX",...JSON.parse(n[i])],type:r,value:[...new Set([...o,...s])].sort()};if("del"===r){const t=[...new Set([...o].filter((t=>!s.has(t))))];return{key:["IDX",...JSON.parse(n[i])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>i(t,e))).reduce(o,{}))(e,c),r,s).then((n=>r.batch(n.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(e,s):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(n)),(r=>u(e.map((e=>{let r;return"put"===s?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===s&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:a,status:r}})))))))))})),a=()=>(new Date).toISOString(),c=e=>t.db.put(["~LAST_UPDATED"],a()).then((()=>e));return{DELETE:e=>g(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t.db,"del","DELETE",{}))).then(c),IMPORT:r=>t.db.clear().then((()=>t.db.batch(r.map((t=>Object.assign(t,{type:"put"})))))).then((()=>g(t).FIELDS())).then((t=>e.setAvailableFields(t))),PUT:(r,n={})=>s(r.map((t=>({_id:t._id,_object:t}))),t.db,"put","PUT",n).then(c).then((async r=>(e.setAvailableFields(await g(t).FIELDS()),r))),TIMESTAMP:()=>t.db.get(["~CREATED"]).then().catch((e=>t.db.put(["~CREATED"],a()).then(c).then((()=>r.emit("ready"))))),TIMESTAMP_LAST_UPDATED:c}}(t,e,r);i.TIMESTAMP(),this.AGGREGATION_FILTER=n.AGGREGATION_FILTER,this.AND=(t,e)=>n.INTERSECTION(t,e).then(this.flattenMatchArrayInResults),this.BUCKET=n.BUCKET,this.BUCKETS=n.BUCKETS,this.CREATED=n.CREATED,this.DELETE=i.DELETE,this.DISTINCT=n.DISTINCT,this.EVENTS=r,this.EXIST=n.EXIST,this.EXPORT=n.EXPORT,this.FACETS=n.FACETS,this.FIELDS=n.FIELDS,this.GET=(t,e)=>n.GET(t,e).then(this.flattenMatchArrayInResults),this.IMPORT=i.IMPORT,this.LAST_UPDATED=n.LAST_UPDATED,this.MAX=n.MAX,this.MIN=n.MIN,this.NOT=(...t)=>n.SET_SUBTRACTION(...t).then(this.flattenMatchArrayInResults),this.OBJECT=n.OBJECT,this.OR=(t,e)=>n.UNION(t,e).then((t=>t.union)).then(this.flattenMatchArrayInResults),this.PUT=i.PUT,this.SORT=n.SORT,this.STORE=t.db,this.TIMESTAMP_LAST_UPDATED=i.TIMESTAMP_LAST_UPDATED,this.TOKEN_PARSER=e}flattenMatchArrayInResults(t){return void 0===t?void 0:t.map((t=>(t._match=t._match.flat(1/0).map((t=>"string"==typeof t?JSON.parse(t):t)).sort(((t,e)=>t.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t)))}}class T{constructor(t={}){return new w({Level:p.Z,...t})}}var A=r(5606);const S="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,O=new Set,I="object"==typeof A&&A?A:{},_=(t,e,r,n)=>{"function"==typeof I.emitWarning?I.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)};let L=globalThis.AbortController,x=globalThis.AbortSignal;if(void 0===L){x=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},L=class{constructor(){e()}signal=new x;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==I.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,_("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const N=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),U=t=>N(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?C:null:null;class C extends Array{constructor(t){super(t),this.fill(0)}}class k{heap;length;static#r=!1;static create(t){const e=U(t);if(!e)return[];k.#r=!0;const r=new k(t,e);return k.#r=!1,r}constructor(t,e){if(!k.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class D{#n;#i;#o;#s;#a;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#l;#h;#f;#p;#d;#y;#g;#m;#b;#v;#E;#w;#T;#A;#S;#O;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#T,sizes:t.#E,keyMap:t.#h,keyList:t.#f,valList:t.#p,next:t.#d,prev:t.#y,get head(){return t.#g},get tail(){return t.#m},free:t.#b,isBackgroundFetch:e=>t.#I(e),backgroundFetch:(e,r,n,i)=>t.#_(e,r,n,i),moveToTail:e=>t.#L(e),indexes:e=>t.#x(e),rindexes:e=>t.#N(e),isStale:e=>t.#U(e)}}get max(){return this.#n}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#c}get dispose(){return this.#o}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:l,noUpdateTTL:h,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:d,fetchMethod:y,memoMethod:g,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=t;if(0!==e&&!N(e))throw new TypeError("max option must be a nonnegative integer");const T=e?U(e):Array;if(!T)throw new Error("invalid max value: "+e);if(this.#n=e,this.#i=f,this.maxEntrySize=p||this.#i,this.sizeCalculation=d,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("memoMethod must be a function if defined");if(this.#c=g,void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(this.#a=y,this.#S=!!y,this.#h=new Map,this.#f=new Array(e).fill(void 0),this.#p=new Array(e).fill(void 0),this.#d=new T(e),this.#y=new T(e),this.#g=0,this.#m=0,this.#b=k.create(e),this.#u=0,this.#l=0,"function"==typeof c&&(this.#o=c),"function"==typeof u?(this.#s=u,this.#v=[]):(this.#s=void 0,this.#v=void 0),this.#A=!!this.#o,this.#O=!!this.#s,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!N(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!N(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=N(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!N(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(0===this.#n&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!O.has(t))(t)&&(O.add(t),_("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,D))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#k(){const t=new C(this.#n),e=new C(this.#n);this.#T=t,this.#w=e,this.#D=(r,n,i=S.now())=>{if(e[r]=0!==n?i:0,t[r]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.#U(r)&&this.#R(this.#f[r],"expire")}),n+1);t.unref&&t.unref()}},this.#B=r=>{e[r]=0!==t[r]?S.now():0},this.#F=(i,o)=>{if(t[o]){const s=t[o],a=e[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const c=i.now-a;i.remainingTTL=s-c}};let r=0;const n=()=>{const t=S.now();if(this.ttlResolution>0){r=t;const e=setTimeout((()=>r=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const o=this.#h.get(i);if(void 0===o)return 0;const s=t[o],a=e[o];return s&&a?s-((r||n())-a):1/0},this.#U=i=>{const o=e[i],s=t[i];return!!s&&!!o&&(r||n())-o>s}}#B=()=>{};#F=()=>{};#D=()=>{};#U=()=>!1;#C(){const t=new C(this.#n);this.#l=0,this.#E=t,this.#P=e=>{this.#l-=t[e],t[e]=0},this.#j=(t,e,r,n)=>{if(this.#I(e))return 0;if(!N(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!N(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#M=(e,r,n)=>{if(t[e]=r,this.#i){const r=this.#i-t[e];for(;this.#l>r;)this.#V(!0)}this.#l+=t[e],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#P=t=>{};#M=(t,e,r)=>{};#j=(t,e,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#m;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#g);)e=this.#y[e]}*#N({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#g;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#m);)e=this.#d[e]}#$(t){return void 0!==t&&this.#h.get(this.#f[t])===t}*entries(){for(const t of this.#x())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*rentries(){for(const t of this.#N())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*keys(){for(const t of this.#x()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*rkeys(){for(const t of this.#N()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*values(){for(const t of this.#x())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}*rvalues(){for(const t of this.#N())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0!==i&&t(i,this.#f[r],this))return this.get(this.#f[r],e)}}forEach(t,e=this){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}rforEach(t,e=this){for(const r of this.#N()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}purgeStale(){let t=!1;for(const e of this.#N({allowStale:!0}))this.#U(e)&&(this.#R(this.#f[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const r=this.#p[e],n=this.#I(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#T&&this.#w){const t=this.#T[e],r=this.#w[e];if(t&&r){const e=t-(S.now()-r);i.ttl=e,i.start=Date.now()}}return this.#E&&(i.size=this.#E[e]),i}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const r=this.#f[e],n=this.#p[e],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const o={value:i};if(this.#T&&this.#w){o.ttl=this.#T[e];const t=S.now()-this.#w[e];o.start=Math.floor(Date.now()-t)}this.#E&&(o.size=this.#E[e]),t.unshift([r,o])}return t}load(t){this.clear();for(const[e,r]of t){if(r.start){const t=Date.now()-r.start;r.start=S.now()-t}this.set(e,r.value,r)}}set(t,e,r={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#j(t,e,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#R(t,"set"),this;let l=0===this.#u?void 0:this.#h.get(t);if(void 0===l)l=0===this.#u?this.#m:0!==this.#b.length?this.#b.pop():this.#u===this.#n?this.#V(!1):this.#u,this.#f[l]=t,this.#p[l]=e,this.#h.set(t,l),this.#d[this.#m]=l,this.#y[l]=this.#m,this.#m=l,this.#u++,this.#M(l,u,a),a&&(a.set="add"),c=!1;else{this.#L(l);const r=this.#p[l];if(e!==r){if(this.#S&&this.#I(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=r;void 0===e||o||(this.#A&&this.#o?.(e,t,"set"),this.#O&&this.#v?.push([e,t,"set"]))}else o||(this.#A&&this.#o?.(r,t,"set"),this.#O&&this.#v?.push([r,t,"set"]));if(this.#P(l),this.#M(l,u,a),this.#p[l]=e,a){a.set="replace";const t=r&&this.#I(r)?r.__staleWhileFetching:r;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#T||this.#k(),this.#T&&(c||this.#D(l,n,i),a&&this.#F(a,l)),!o&&this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#u;){const t=this.#p[this.#g];if(this.#V(!0),this.#I(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#V(t){const e=this.#g,r=this.#f[e],n=this.#p[e];return this.#S&&this.#I(n)?n.__abortController.abort(new Error("evicted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(n,r,"evict"),this.#O&&this.#v?.push([n,r,"evict"])),this.#P(e),t&&(this.#f[e]=void 0,this.#p[e]=void 0,this.#b.push(e)),1===this.#u?(this.#g=this.#m=0,this.#b.length=0):this.#g=this.#d[e],this.#h.delete(r),this.#u--,e}has(t,e={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=e,i=this.#h.get(t);if(void 0!==i){const t=this.#p[i];if(this.#I(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#U(i))return r&&this.#B(i),n&&(n.has="hit",this.#F(n,i)),!0;n&&(n.has="stale",this.#F(n,i))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:r=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!r&&this.#U(n))return;const i=this.#p[n];return this.#I(i)?i.__staleWhileFetching:i}#_(t,e,r,n){const i=void 0===e?void 0:this.#p[e];if(this.#I(i))return i;const o=new L,{signal:s}=r;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,c=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,c&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!c&&!i)return u(o.signal.reason);const h=l;return this.#p[e]===l&&(void 0===n?h.__staleWhileFetching?this.#p[e]=h.__staleWhileFetching:this.#R(t,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(t,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,u=l;if(this.#p[e]===l&&(c&&void 0!==u.__staleWhileFetching?s||(this.#p[e]=u.__staleWhileFetching):this.#R(t,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);const l=new Promise(((e,n)=>{const s=this.#a?.(t,i,a);s&&s instanceof Promise&&s.then((t=>e(void 0===t?void 0:t)),n),o.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(e(void 0),r.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=t),u(t)))),h=Object.assign(l,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,h,{...a.options,status:void 0}),e=this.#h.get(t)):this.#p[e]=h,h}#I(t){if(!this.#S)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof L}async fetch(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:y=!1,status:g,signal:m}=e;if(!this.#S)return g&&(g.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:m};let v=this.#h.get(t);if(void 0===v){g&&(g.fetch="miss");const e=this.#_(t,v,b,d);return e.__returned=e}{const e=this.#p[v];if(this.#I(e)){const t=r&&void 0!==e.__staleWhileFetching;return g&&(g.fetch="inflight",t&&(g.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#U(v);if(!y&&!i)return g&&(g.fetch="hit"),this.#L(v),n&&this.#B(v),g&&this.#F(g,v),e;const o=this.#_(t,v,b,d),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",s&&i&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(t,e={}){const r=await this.fetch(t,e);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(t,e={}){const r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=e,s=this.get(t,o);if(!i&&void 0!==s)return s;const a=r(t,s,{options:o,context:n});return this.set(t,a,o),a}get(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=e,s=this.#h.get(t);if(void 0!==s){const e=this.#p[s],a=this.#I(e);return o&&this.#F(o,s),this.#U(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==e.__staleWhileFetching&&(o.returnedStale=!0),r?e.__staleWhileFetching:void 0):(i||this.#R(t,"expire"),o&&r&&(o.returnedStale=!0),r?e:void 0)):(o&&(o.get="hit"),a?e.__staleWhileFetching:(this.#L(s),n&&this.#B(s),e))}o&&(o.get="miss")}#G(t,e){this.#y[e]=t,this.#d[t]=e}#L(t){t!==this.#m&&(t===this.#g?this.#g=this.#d[t]:this.#G(this.#y[t],this.#d[t]),this.#G(this.#m,t),this.#m=t)}delete(t){return this.#R(t,"delete")}#R(t,e){let r=!1;if(0!==this.#u){const n=this.#h.get(t);if(void 0!==n)if(r=!0,1===this.#u)this.#z(e);else{this.#P(n);const r=this.#p[n];if(this.#I(r)?r.__abortController.abort(new Error("deleted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(r,t,e),this.#O&&this.#v?.push([r,t,e])),this.#h.delete(t),this.#f[n]=void 0,this.#p[n]=void 0,n===this.#m)this.#m=this.#y[n];else if(n===this.#g)this.#g=this.#d[n];else{const t=this.#y[n];this.#d[t]=this.#d[n];const e=this.#d[n];this.#y[e]=this.#y[n]}this.#u--,this.#b.push(n)}}if(this.#O&&this.#v?.length){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return r}clear(){return this.#z("delete")}#z(t){for(const e of this.#N({allowStale:!0})){const r=this.#p[e];if(this.#I(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#f[e];this.#A&&this.#o?.(r,n,t),this.#O&&this.#v?.push([r,n,t])}}if(this.#h.clear(),this.#p.fill(void 0),this.#f.fill(void 0),this.#T&&this.#w&&(this.#T.fill(0),this.#w.fill(0)),this.#E&&this.#E.fill(0),this.#g=0,this.#m=0,this.#b.length=0,this.#l=0,this.#u=0,this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}class R{#W;#K;#q;constructor(t,e,r){this.#K=t.docExistsSpace,this.#q=r,this.#W=e}#H=(t,e={})=>{const r=t=>"string"==typeof t||"number"==typeof t?this.#q.GET(t,e.PIPELINE):t.FIELD||t.VALUE?this.#q.GET(t):t.AND?this.#q.AND(t.AND.map(r),e.PIPELINE):t.GET?this.#q.GET(t.GET,e.PIPELINE):t.NOT?this.#q.NOT(r(t.NOT.INCLUDE),r(t.NOT.EXCLUDE)):t.OR?this.#q.OR(t.OR.map(r),e.PIPELINE):t.ALL_DOCUMENTS?this.ALL_DOCUMENTS(t.ALL_DOCUMENTS):void 0;return r(t).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((t=>e.BUCKETS?this.#q.BUCKETS(...e.BUCKETS).then((e=>Object.assign(t,{BUCKETS:this.#q.AGGREGATION_FILTER(e,t.RESULT,!1)}))):t)).then((r=>e.FACETS?r.RESULT.length?t.ALL_DOCUMENTS?this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:t}))):this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:this.#q.AGGREGATION_FILTER(t,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>e.WEIGHT?Object.assign({RESULT:this.WEIGHT(t.RESULT,e.WEIGHT)},t):t)).then((t=>e.SCORE?this.SCORE(t.RESULT,e.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,e.SORT?{RESULT:this.SORT(t.RESULT,e.SORT)}:{}))).then((t=>{let r;return Object.assign(t,{RESULT:this.PAGE(t.RESULT,e.PAGE,(t=>{r=t}))},{PAGING:r})})).then((t=>e.DOCUMENTS?this.DOCUMENTS(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))};#Y=t=>this.DISTINCT(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"})))));#X=(...t)=>t.length?Promise.all(t.map((t=>this.#q.STORE.get([this.#K,t]).catch((t=>null))))):this.ALL_DOCUMENTS();#J=(t,e)=>this.#H({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e));ALL_DOCUMENTS=t=>this.#q.STORE.iterator({gte:[this.#K,null],lte:[this.#K,void 0],limit:t}).all().then((t=>t.map((([t,e])=>({_id:e._id,_doc:e})))));cachePipeline=(t,e,...r)=>{const n=JSON.stringify({funcLabel:e,params:r});return this.#W.has(n)?Promise.resolve(this.#W.get(n)):t(...r).then((t=>(this.#W.set(n,t),t)))};DICTIONARY=t=>this.cachePipeline(this.#Y,"#DICTIONARY",t);DISTINCT=(...t)=>this.#q.DISTINCT(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));DOCUMENTS=(...t)=>this.cachePipeline(this.#X,"#DOCUMENTS",...t);DOCUMENT_COUNT=()=>this.#q.STORE.get(["DOCUMENT_COUNT"]);DOCUMENT_VECTORS=(...t)=>Promise.all(t.map((t=>this.#q.STORE.get(["DOC",t]).catch((t=>null)))));FACETS=(...t)=>this.#q.FACETS(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));PAGE=(t,e={},r=()=>null)=>((e={NUMBER:0,SIZE:20,...e}).TOTAL=Math.ceil(t.length/e.SIZE),e.DOC_OFFSET=e.NUMBER*e.SIZE,r(e),t.slice(e.DOC_OFFSET,e.DOC_OFFSET+e.SIZE||void 0));QUERY=(t,e)=>this.cachePipeline(this.#H,"#parseJsonQuery",t,e);SCORE=(t,e={})=>{e=Object.assign({TYPE:"TFIDF"},e);const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD),n=t=>(t||[]).filter(r);return new Promise((i=>i("TFIDF"===e.TYPE?this.DOCUMENT_COUNT().then((e=>t.map(((t,n,i)=>{const o=Math.log((e+1)/i.length);return t._score=+(t._match||[]).filter(r).reduce(((t,e)=>t+o*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2)}))):"CONCAT"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.SCORE),"")}))):"SUM"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2)}))):"VALUE"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.VALUE),"")}))):null)))};SEARCH=(t,e)=>this.cachePipeline(this.#J,"#SEARCH",t,e);SORT=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION]));WEIGHT=(t,e)=>t.map((t=>(t._match=t._match.map((t=>(e.forEach((e=>{let r=!1;e.FIELD&&e.VALUE?e.FIELD===t.FIELD&&e.VALUE===t.VALUE&&(r=!0):e.FIELD?e.FIELD===t.FIELD&&(r=!0):e.VALUE&&e.VALUE===t.VALUE&&(r=!0),r&&(t.SCORE=(e.WEIGHT*+t.SCORE).toFixed(2))})),t))),t)))}var B=r(228);class F extends Error{constructor(t){super(t),this.name="TimeoutError"}}class P extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const j=t=>void 0===globalThis.DOMException?new P(t):new DOMException(t),M=t=>{const e=void 0===t.reason?j("This operation was aborted."):t.reason;return e instanceof Error?e:j(e)};class V{#Q=[];enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&this.#Q[this.size-1].priority>=e.priority)return void this.#Q.push(r);const n=function(t,e){let r=0,n=t.length;for(;n>0;){const o=Math.trunc(n/2);let s=r+o;i=t[s],e.priority-i.priority<=0?(r=++s,n-=o+1):n=o}var i;return r}(this.#Q,r);this.#Q.splice(n,0,r)}dequeue(){const t=this.#Q.shift();return t?.run}filter(t){return this.#Q.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this.#Q.length}}class $ extends B{#Z;#tt;#et=0;#rt;#nt;#it=0;#ot;#st;#Q;#at;#ct=0;#ut;#lt;#ht;timeout;constructor(t){if(super(),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:V,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#Z=t.carryoverConcurrencyCount,this.#tt=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this.#rt=t.intervalCap,this.#nt=t.interval,this.#Q=new t.queueClass,this.#at=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#ht=!0===t.throwOnTimeout,this.#lt=!1===t.autoStart}get#ft(){return this.#tt||this.#et{this.#yt()}),e)),!0;this.#et=this.#Z?this.#ct:0}return!1}#dt(){if(0===this.#Q.size)return this.#ot&&clearInterval(this.#ot),this.#ot=void 0,this.emit("empty"),0===this.#ct&&this.emit("idle"),!1;if(!this.#lt){const t=!this.#bt;if(this.#ft&&this.#pt){const e=this.#Q.dequeue();return!!e&&(this.emit("active"),e(),t&&this.#mt(),!0)}}return!1}#mt(){this.#tt||void 0!==this.#ot||(this.#ot=setInterval((()=>{this.#gt()}),this.#nt),this.#it=Date.now()+this.#nt)}#gt(){0===this.#et&&0===this.#ct&&this.#ot&&(clearInterval(this.#ot),this.#ot=void 0),this.#et=this.#Z?this.#ct:0,this.#vt()}#vt(){for(;this.#dt(););}get concurrency(){return this.#ut}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#ut=t,this.#vt()}async#Et(t){return new Promise(((e,r)=>{t.addEventListener("abort",(()=>{r(t.reason)}),{once:!0})}))}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:this.#ht,...e},new Promise(((r,n)=>{this.#Q.enqueue((async()=>{this.#ct++,this.#et++;try{e.signal?.throwIfAborted();let n=t({signal:e.signal});e.timeout&&(n=function(t,e){const{milliseconds:r,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e;let s;const a=new Promise(((a,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){const{signal:t}=e;t.aborted&&c(M(t)),t.addEventListener("abort",(()=>{c(M(t))}))}if(r===Number.POSITIVE_INFINITY)return void t.then(a,c);const u=new F;s=o.setTimeout.call(void 0,(()=>{if(n)try{a(n())}catch(t){c(t)}else"function"==typeof t.cancel&&t.cancel(),!1===i?a():i instanceof Error?c(i):(u.message=i??`Promise timed out after ${r} milliseconds`,c(u))}),r),(async()=>{try{a(await t)}catch(t){c(t)}})()})).finally((()=>{a.clear()}));return a.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},a}(Promise.resolve(n),{milliseconds:e.timeout})),e.signal&&(n=Promise.race([n,this.#Et(e.signal)]));const i=await n;r(i),this.emit("completed",i)}catch(t){if(t instanceof F&&!e.throwOnTimeout)return void r();n(t),this.emit("error",t)}finally{this.#d()}}),e),this.emit("add"),this.#dt()}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this.#lt?(this.#lt=!1,this.#vt(),this):this}pause(){this.#lt=!0}clear(){this.#Q=new this.#at}async onEmpty(){0!==this.#Q.size&&await this.#wt("empty")}async onSizeLessThan(t){this.#Q.sizethis.#Q.size{const n=()=>{e&&!e()||(this.off(t,n),r())};this.on(t,n)}))}get size(){return this.#Q.size}sizeBy(t){return this.#Q.filter(t).length}get pending(){return this.#ct}get isPaused(){return this.#lt}}class G{#W;#q;#Tt;#Q;constructor(t,e,r){this.#W=e,this.#q=r,this.#Tt=t,this.#Q=new $({concurrency:1}),this.#At(0)}#At=t=>this.#q.STORE.get(["DOCUMENT_COUNT"]).then((e=>this.#q.STORE.put(["DOCUMENT_COUNT"],+e+(+t||0)))).catch((t=>this.#q.STORE.put(["DOCUMENT_COUNT"],0)));#St=(t,e)=>{this.#W.clear();const r={...this.#Tt,...e};return((t,e)=>{const r=t=>"string"==typeof t||t instanceof String,n=(t,i)=>new Promise((async o=>{return null===t?o([null,"1.00"]):(s=t)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o([[],"1.00"]):Number.isInteger(t)?o([t,t]):r(t)?o(e.tokenizer(t,i,e)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(t)?o((a=t,new Promise((async t=>{const r={};for(const t in a)r[t]=await n(a[t],t,e);return t(r)})))):(t=>Array.isArray(t))(t)?o((c=t,Promise.all(c.map(n)))):o(t);var s,a,c}));return Promise.all(t.map((async t=>new Promise((async i=>{r(t)&&(t={body:t}),Object.prototype.hasOwnProperty.call(t,"_id")||(t._id=e.idGenerator.next().value);const o={};for(const e in t)o[e]="_id"!==e?await n(t[e],e):t[e];return i(o)})))))})(t,r).then((t=>this.#q.PUT(t,e))).then((e=>this.PUT_RAW(t,e.map((t=>t._id)),!r.storeRawDocs).then((()=>this.#At(e.filter((t=>"CREATED"===t.status)).length))).then((()=>e))))};#Ot=t=>this.#q.DELETE(t).then((e=>this.DELETE_RAW(...t).then((()=>this.#At(-e.filter((t=>"DELETED"===t.status)).length))).then((()=>this.#W.clear())).then((()=>e))));DELETE=(...t)=>this.#Ot(t);DELETE_RAW=(...t)=>Promise.all(t.map((t=>this.#q.STORE.del([this.#Tt.docExistsSpace,t]))));FLUSH=()=>this.#q.STORE.clear().then((()=>{this.#W.clear();const t=(new Date).toISOString();return this.#q.STORE.batch([{type:"put",key:["~CREATED"],value:t},{type:"put",key:["~LAST_UPDATED"],value:t},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0));IMPORT=t=>(this.#W.clear(),Promise.resolve(this.#q.IMPORT(t)));PUT=(t,e)=>this.#Q.add((()=>this.#St(t,e)));PUT_RAW=(t,e,r)=>Promise.all(t.map(((t,n)=>this.#q.STORE.put([this.#Tt.docExistsSpace,e[n]],r?{}:t)))).then((r=>(this.#W.clear(),t.map(((t,r)=>({_id:e[r],status:"OK",operation:"_PUT_RAW"}))))))}class z{constructor(t={}){var e;t={cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],name:"index",ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:f,...t},this.INDEX=new T({...t,isLeaf:t=>Array.isArray(t)&&2===t.length&&t.every((t=>"string"==typeof t||"number"==typeof t||null===t))}),this.EVENTS=this.INDEX.EVENTS,this._CACHE=new D({max:t.cacheLength}),this.r=new R(t,this._CACHE,this.INDEX),this.w=new G(t,this._CACHE,this.INDEX),e=this.INDEX,new Promise(((t,r)=>{const n=["CREATED_WITH"],i="search-index@5.0.0";return e.STORE.get(n).then((e=>i===e?t():r(new Error("This index was created with "+e+", you are running "+i)))).catch((r=>e.STORE.put(n,i).then(t)))}))}ALL_DOCUMENTS=t=>this.r.ALL_DOCUMENTS(t);BUCKETS=(...t)=>this.INDEX.BUCKETS(...t);CREATED=()=>this.INDEX.CREATED();DELETE=(...t)=>this.w.DELETE(...t);DELETE_RAW=(...t)=>this.w.DELETE_RAW(...t);DICTIONARY=t=>this.r.DICTIONARY(t);DISTINCT=(...t)=>this.r.DISTINCT(...t);DOCUMENTS=(...t)=>this.r.DOCUMENTS(...t);DOCUMENT_COUNT=()=>this.r.DOCUMENT_COUNT();DOCUMENT_VECTORS=(...t)=>this.r.DOCUMENT_VECTORS(...t);EXPORT=()=>this.INDEX.EXPORT();FACETS=(...t)=>this.r.FACETS(...t);FIELDS=()=>this.INDEX.FIELDS();FLUSH=()=>this.w.FLUSH();IMPORT=t=>this.INDEX.IMPORT(t);LAST_UPDATED=()=>this.INDEX.LAST_UPDATED();MAX=t=>this.INDEX.MAX(t);MIN=t=>this.INDEX.MIN(t);PUT=(t,e)=>this.w.PUT(t,e);PUT_RAW=(t,e,r)=>this.w.PUT_RAW(t,e,r);QUERY=(t,e)=>this.r.QUERY(t,e);SEARCH=(t,e)=>this.r.SEARCH(t,e);TOKENIZATION_PIPELINE_STAGES=h;_AND=(t,e)=>this.INDEX.AND(t,e);_BUCKET=t=>this.INDEX.BUCKET(t);_GET=(t,e)=>this.INDEX.GET(t,e);_NOT=(t,e)=>this.INDEX.NOT(t,e);_OR=(t,e)=>this.INDEX.OR(t,e);_PAGE=(t,e)=>this.r.PAGE(t,e);_SORT=(t,e)=>this.r.SORT(t,e)}class W{constructor({template:t=t=>`${t} hits`,elementId:e="count"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=this.template(t)}class K{constructor({template:t=t=>`

    ${JSON.stringify(t)}

    `,elementId:e="hits"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=t.map((({_doc:t})=>this.template(t))).join("\n")}class q{constructor({pageLinkTemplate:t=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,navLinkTemplate:e=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,elementId:r="paging"},n){this.pageLinkTemplate=t,this.navLinkTemplate=e,this.el=document.getElementById(r),this.search=n,this.page={NUMBER:0,SIZE:10}}template=t=>{let e=0,r=t.TOTAL;return t.TOTAL>7&&(e=t.NUMBER>3?t.NUMBER-3:0,r=7+e),r>t.TOTAL&&(e=t.TOTAL-6-1,r=t.TOTAL),`\n
      \n ${this.navLinkTemplate("First",0,0===t.NUMBER)}\n ${this.navLinkTemplate("‹",t.NUMBER-1,0===t.NUMBER)}\n ${(()=>{let n="";for(let i=e;i=t.TOTAL-1)}\n ${this.navLinkTemplate("Last",t.TOTAL-1,t.NUMBER>=t.TOTAL-1)}\n
    `};update=t=>{if(console.log(t),t.TOTAL<=1)return void(this.el.innerHTML="");this.el.innerHTML=this.template(t);const e=document.getElementsByClassName("page-link");for(let t=0;t{console.log("AYO!"),console.log(this.search()),this.page.NUMBER=+t.target.attributes["data-page"].value,this.search()}))}}class H{constructor({elementId:t="",facetOptionTemplate:e=(t,e)=>`\n \n \n
    `,field:r=null,mode:n="OR",sort:i=(t,e)=>{t.VALUE.localeCompare(e.VALUE)},title:o="

    "+r.toUpperCase()+"

    "},s){this.activeFilters=[],this.el=document.getElementById(t),this.elementId=t,this.facetOptionTemplate=e,this.field=r,this.mode=n,this.search=s,this.sort=i,this.title=o}getActiveFilters=()=>this.activeFilters.length?[{[this.mode]:this.activeFilters}]:[];update=(t,e)=>{if("facet"===e&&"OR"===this.mode)return;const r=t.filter((t=>t.FIELD===this.field));this.el.innerHTML=r.length?this.title+r.sort(this.sort).reduce(((t,e)=>t+this.facetOptionTemplate(e,this.activeFilters.includes(e.FIELD+":"+e.VALUE))),""):"",this.activeFilters.forEach((t=>{if(!document.getElementById(t)){const[e,r]=t.split(":");this.el.innerHTML+=this.facetOptionTemplate({FIELD:e,VALUE:r,_id:[]},!0)}}));for(const t of document.querySelectorAll("#"+this.elementId+" > .filter-select"))t.addEventListener("input",(t=>{console.log(this.elementId),console.log(this.mode);const e=t.target.attributes["data-field"].value+":"+t.target.attributes["data-value"].value;t.target.checked?this.activeFilters.push(e):this.activeFilters=this.activeFilters.filter((t=>t!==e)),this.search("facet")}))}}class Y{constructor(t,e,r={}){this.autoCompleteFunction=r.autoCompleteFunction,this.currentFocus=-1,this.searchboxEl=t,this.search=e,this.limit=r.limit||20,this.threshold=r.threshold||2,this.autocompleteListId=t.id+"-autocomplete-list",this.suggestionsElementId=r.elementId,t.addEventListener("input",this.searchBoxInputListener),t.addEventListener("keydown",this.searchBoxKeydownListener),document.addEventListener("click",(t=>{this.closeAllLists(t.target)}))}closeAllLists=t=>{for(const e of document.getElementsByClassName("autocomplete-items"))t!==e&&t!==this.searchboxEl&&e.parentNode.removeChild(e)};searchBoxKeydownListener=t=>{let e=document.getElementById(this.autocompleteListId);e&&(e=e.getElementsByTagName("div")),40===t.keyCode?(this.currentFocus++,this.addActive(e)):38===t.keyCode?(this.currentFocus--,this.addActive(e)):13===t.keyCode||9===t.keyCode?(t.preventDefault(),this.currentFocus>-1?e&&e[this.currentFocus].click():this.closeAllLists()):27===t.keyCode&&this.closeAllLists()};searchBoxInputListener=async t=>{const e=(await this.autoCompleteFunction(t.target.value)).slice(0,this.limit);let r;const n=t.target.value;if(this.closeAllLists(),!n)return!1;if(n.length{r=document.createElement("DIV"),r.innerHTML=""+t.substr(0,n.length)+"",r.innerHTML+=t.substr(n.length),r.innerHTML+="",r.addEventListener("click",(t=>{this.searchboxEl.value=t.target.getElementsByTagName("input")[0].value,this.closeAllLists(),this.search()})),i.appendChild(r)}))};addActive=t=>{if(!t)return!1;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1),t[this.currentFocus].classList.add("autocomplete-active")};removeActive=t=>{for(let e=0;e{n.page.NUMBER=0,r("searchInput")})),this.autocomplete=new Y(this.el,r,e)}}class J{constructor({index:t=null,count:e={},hits:r={},facets:n=[],searchInput:i={},paging:o={},suggestions:s={}}){this.index=t,this.count=new W(e),this.paging=new q(o,this.search),this.hits=new K(r),this.searchInput=new X({...i,suggestions:{autoCompleteFunction:this.index.DICTIONARY,...i.suggestions}},this.search,this.paging),this.facets=n.map((t=>new H(t,this.search))),this.search()}queryOptions=()=>({FACETS:this.facets.map((t=>({FIELD:t.field}))),DOCUMENTS:!0,PAGE:this.paging.page});emptySearchQuery=()=>[{ALL_DOCUMENTS:!0},this.queryOptions()];searchQuery=()=>[[...this.searchInput.el.value.split(/\s+/).filter((t=>t)),...this.facets.map((t=>t.getActiveFilters())).flat(1/0)],this.queryOptions()];search=t=>(this.searchInput.el.value.length+this.facets.map((t=>t.getActiveFilters())).flat(1/0).length?this.index.SEARCH(...this.searchQuery()):this.index.QUERY(...this.emptySearchQuery())).then((e=>{this.hits.update(e.RESULT),this.count.update(e.RESULT_LENGTH),this.facets.forEach((r=>r.update(e.FACETS,t))),this.paging.update(e.PAGING)}))}class Q{constructor(t={}){return new z({Level:p.Z,...t})}}class Z{constructor(t={}){return new J(t)}}})(),SearchIndex=n})(); \ No newline at end of file +/*! For license information please see search-index-5.1.1.js.LICENSE.txt */ +var SearchIndex;(()=>{var t={796:(t,e,r)=>{"use strict";const{fromCallback:n}=r(8100),i=r(266),{getCallback:o,getOptions:s}=r(1343),a=Symbol("promise"),c=Symbol("status"),u=Symbol("operations"),l=Symbol("finishClose"),h=Symbol("closeCallbacks");e.AbstractChainedBatch=class{constructor(t){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));this[u]=[],this[h]=[],this[c]="open",this[l]=this[l].bind(this),this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get length(){return this[u].length}put(t,e,r){if("open"!==this[c])throw new i("Batch is not open: cannot call put() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const n=this.db._checkKey(t)||this.db._checkValue(e);if(n)throw n;const o=r&&null!=r.sublevel?r.sublevel:this.db,s=r,a=o.keyEncoding(r&&r.keyEncoding),l=o.valueEncoding(r&&r.valueEncoding),h=a.format;r={...r,keyEncoding:h,valueEncoding:l.format},o!==this.db&&(r.sublevel=null);const f=o.prefixKey(a.encode(t),h),p=l.encode(e);return this._put(f,p,r),this[u].push({...s,type:"put",key:t,value:e}),this}_put(t,e,r){}del(t,e){if("open"!==this[c])throw new i("Batch is not open: cannot call del() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});const r=this.db._checkKey(t);if(r)throw r;const n=e&&null!=e.sublevel?e.sublevel:this.db,o=e,s=n.keyEncoding(e&&e.keyEncoding),a=s.format;return e={...e,keyEncoding:a},n!==this.db&&(e.sublevel=null),this._del(n.prefixKey(s.encode(t),a),e),this[u].push({...o,type:"del",key:t}),this}_del(t,e){}clear(){if("open"!==this[c])throw new i("Batch is not open: cannot call clear() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"});return this._clear(),this[u]=[],this}_clear(){}write(t,e){return e=o(t,e),e=n(e,a),t=s(t),"open"!==this[c]?this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"})):0===this.length?this.close(e):(this[c]="writing",this._write(t,(t=>{this[c]="closing",this[h].push((()=>e(t))),t||this.db.emit("batch",this[u]),this._close(this[l])}))),e[a]}_write(t,e){}close(t){return t=n(t,a),"closing"===this[c]?this[h].push(t):"closed"===this[c]?this.nextTick(t):(this[h].push(t),"writing"!==this[c]&&(this[c]="closing",this._close(this[l]))),t[a]}_close(t){this.nextTick(t)}[l](){this[c]="closed",this.db.detachResource(this);const t=this[h];this[h]=[];for(const e of t)e()}}},3527:(t,e,r)=>{"use strict";const{fromCallback:n}=r(8100),i=r(266),{getOptions:o,getCallback:s}=r(1343),a=Symbol("promise"),c=Symbol("callback"),u=Symbol("working"),l=Symbol("handleOne"),h=Symbol("handleMany"),f=Symbol("autoClose"),p=Symbol("finishWork"),d=Symbol("returnMany"),y=Symbol("closing"),g=Symbol("handleClose"),m=Symbol("closed"),b=Symbol("closeCallbacks"),v=Symbol("keyEncoding"),E=Symbol("valueEncoding"),w=Symbol("abortOnClose"),T=Symbol("legacy"),A=Symbol("keys"),S=Symbol("values"),O=Symbol("limit"),I=Symbol("count"),_=Object.freeze({}),L=()=>{};let x=!1;class N{constructor(t,e,r){if("object"!=typeof t||null===t)throw new TypeError("The first argument must be an abstract-level database, received "+(null===t?"null":typeof t));if("object"!=typeof e||null===e)throw new TypeError("The second argument must be an options object");this[m]=!1,this[b]=[],this[u]=!1,this[y]=!1,this[f]=!1,this[c]=null,this[l]=this[l].bind(this),this[h]=this[h].bind(this),this[g]=this[g].bind(this),this[v]=e[v],this[E]=e[E],this[T]=r,this[O]=Number.isInteger(e.limit)&&e.limit>=0?e.limit:1/0,this[I]=0,this[w]=!!e.abortOnClose,this.db=t,this.db.attachResource(this),this.nextTick=t.nextTick}get count(){return this[I]}get limit(){return this[O]}next(t){let e;if(void 0===t)e=new Promise(((e,r)=>{t=(t,n,i)=>{t?r(t):this[T]?void 0===n&&void 0===i?e():e([n,i]):e(n)}}));else if("function"!=typeof t)throw new TypeError("Callback must be a function");return this[y]?this.nextTick(t,new i("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(t,new i("Iterator is busy: cannot call next() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=t,this[I]>=this[O]?this.nextTick(this[l],null):this._next(this[l])),e}_next(t){this.nextTick(t)}nextv(t,e,r){return r=s(e,r),r=n(r,a),e=o(e,_),Number.isInteger(t)?(this[y]?this.nextTick(r,new i("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(r,new i("Iterator is busy: cannot call nextv() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(t<1&&(t=1),this[O]<1/0&&(t=Math.min(t,this[O]-this[I])),this[u]=!0,this[c]=r,t<=0?this.nextTick(this[h],null,[]):this._nextv(t,e,this[h])),r[a]):(this.nextTick(r,new TypeError("The first argument 'size' must be an integer")),r[a])}_nextv(t,e,r){const n=[],i=(e,o,s)=>e?r(e):(this[T]?void 0===o&&void 0===s:void 0===o)?r(null,n):(n.push(this[T]?[o,s]:o),void(n.length===t?r(null,n):this._next(i)));this._next(i)}all(t,e){return e=s(t,e),e=n(e,a),t=o(t,_),this[y]?this.nextTick(e,new i("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this[u]?this.nextTick(e,new i("Iterator is busy: cannot call all() until previous call has completed",{code:"LEVEL_ITERATOR_BUSY"})):(this[u]=!0,this[c]=e,this[f]=!0,this[I]>=this[O]?this.nextTick(this[h],null,[]):this._all(t,this[h])),e[a]}_all(t,e){let r=this[I];const n=[],i=()=>{const t=this[O]<1/0?Math.min(1e3,this[O]-r):1e3;t<=0?this.nextTick(e,null,n):this._nextv(t,_,o)},o=(t,o)=>{t?e(t):0===o.length?e(null,n):(n.push.apply(n,o),r+=o.length,i())};i()}[p](){const t=this[c];return this[w]&&null===t?L:(this[u]=!1,this[c]=null,this[y]&&this._close(this[g]),t)}[d](t,e,r){this[f]?this.close(t.bind(null,e,r)):t(e,r)}seek(t,e){if(e=o(e,_),this[y]);else{if(this[u])throw new i("Iterator is busy: cannot call seek() until next() has completed",{code:"LEVEL_ITERATOR_BUSY"});{const r=this.db.keyEncoding(e.keyEncoding||this[v]),n=r.format;e.keyEncoding!==n&&(e={...e,keyEncoding:n});const i=this.db.prefixKey(r.encode(t),n);this._seek(i,e)}}}_seek(t,e){throw new i("Iterator does not support seek()",{code:"LEVEL_NOT_SUPPORTED"})}close(t){return t=n(t,a),this[m]?this.nextTick(t):this[y]?this[b].push(t):(this[y]=!0,this[b].push(t),this[u]?this[w]&&this[p]()(new i("Aborted on iterator close()",{code:"LEVEL_ITERATOR_NOT_OPEN"})):this._close(this[g])),t[a]}_close(t){this.nextTick(t)}[g](){this[m]=!0,this.db.detachResource(this);const t=this[b];this[b]=[];for(const e of t)e()}async*[Symbol.asyncIterator](){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this[m]||await this.close()}}}class U extends N{constructor(t,e){super(t,e,!0),this[A]=!1!==e.keys,this[S]=!1!==e.values}[l](t,e,r){const n=this[p]();if(t)return n(t);try{e=this[A]&&void 0!==e?this[v].decode(e):void 0,r=this[S]&&void 0!==r?this[E].decode(r):void 0}catch(t){return n(new C("entry",t))}void 0===e&&void 0===r||this[I]++,n(null,e,r)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(const t of e){const e=t[0],r=t[1];t[0]=this[A]&&void 0!==e?this[v].decode(e):void 0,t[1]=this[S]&&void 0!==r?this[E].decode(r):void 0}}catch(t){return this[d](r,new C("entries",t))}this[I]+=e.length,this[d](r,null,e)}end(t){return x||"undefined"==typeof console||(x=!0,console.warn(new i("The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version",{code:"LEVEL_LEGACY"}))),this.close(t)}}class C extends i{constructor(t,e){super(`Iterator could not decode ${t}`,{code:"LEVEL_DECODE_ERROR",cause:e})}}for(const t of["_ended property","_nexting property","_end method"])Object.defineProperty(U.prototype,t.split(" ")[0],{get(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})},set(){throw new i(`The ${t} has been removed`,{code:"LEVEL_LEGACY"})}});U.keyEncoding=v,U.valueEncoding=E,e.AbstractIterator=U,e.AbstractKeyIterator=class extends N{constructor(t,e){super(t,e,!1)}[l](t,e){const r=this[p]();if(t)return r(t);try{e=void 0!==e?this[v].decode(e):void 0}catch(t){return r(new C("key",t))}void 0!==e&&this[I]++,r(null,e)}[h](t,e){const r=this[p]();if(t)return this[d](r,t);try{for(let t=0;t{"use strict";const{supports:n}=r(5356),{Transcoder:i}=r(6035),{EventEmitter:o}=r(7007),{fromCallback:s}=r(8100),a=r(266),{AbstractIterator:c}=r(3527),{DefaultKeyIterator:u,DefaultValueIterator:l}=r(5682),{DeferredIterator:h,DeferredKeyIterator:f,DeferredValueIterator:p}=r(4416),{DefaultChainedBatch:d}=r(4669),{getCallback:y,getOptions:g}=r(1343),m=r(386),b=Symbol("promise"),v=Symbol("landed"),E=Symbol("resources"),w=Symbol("closeResources"),T=Symbol("operations"),A=Symbol("undefer"),S=Symbol("deferOpen"),O=Symbol("options"),I=Symbol("status"),_=Symbol("defaultOptions"),L=Symbol("transcoder"),x=Symbol("keyEncoding"),N=Symbol("valueEncoding"),U=()=>{};class C extends o{constructor(t,e){if(super(),"object"!=typeof t||null===t)throw new TypeError("The first argument 'manifest' must be an object");e=g(e);const{keyEncoding:r,valueEncoding:o,passive:s,...a}=e;this[E]=new Set,this[T]=[],this[S]=!0,this[O]=a,this[I]="opening",this.supports=n(t,{status:!0,promises:!0,clear:!0,getMany:!0,deferredOpen:!0,snapshots:!1!==t.snapshots,permanence:!1!==t.permanence,keyIterator:!0,valueIterator:!0,iteratorNextv:!0,iteratorAll:!0,encodings:t.encodings||{},events:Object.assign({},t.events,{opening:!0,open:!0,closing:!0,closed:!0,put:!0,del:!0,batch:!0,clear:!0})}),this[L]=new i(R(this)),this[x]=this[L].encoding(r||"utf8"),this[N]=this[L].encoding(o||"utf8");for(const t of this[L].encodings())this.supports.encodings[t.commonName]||(this.supports.encodings[t.commonName]=!0);this[_]={empty:Object.freeze({}),entry:Object.freeze({keyEncoding:this[x].commonName,valueEncoding:this[N].commonName}),key:Object.freeze({keyEncoding:this[x].commonName})},this.nextTick((()=>{this[S]&&this.open({passive:!1},U)}))}get status(){return this[I]}keyEncoding(t){return this[L].encoding(null!=t?t:this[x])}valueEncoding(t){return this[L].encoding(null!=t?t:this[N])}open(t,e){e=y(t,e),e=s(e,b),(t={...this[O],...g(t)}).createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists;const r=t=>{"closing"===this[I]||"opening"===this[I]?this.once(v,t?()=>r(t):r):"open"!==this[I]?e(new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN",cause:t})):e()};return t.passive?"opening"===this[I]?this.once(v,r):this.nextTick(r):"closed"===this[I]||this[S]?(this[S]=!1,this[I]="opening",this.emit("opening"),this._open(t,(t=>{if(t)return this[I]="closed",this[w]((()=>{this.emit(v),r(t)})),void this[A]();this[I]="open",this[A](),this.emit(v),"open"===this[I]&&this.emit("open"),"open"===this[I]&&this.emit("ready"),r()}))):"open"===this[I]?this.nextTick(r):this.once(v,(()=>this.open(t,e))),e[b]}_open(t,e){this.nextTick(e)}close(t){t=s(t,b);const e=r=>{"opening"===this[I]||"closing"===this[I]?this.once(v,r?e(r):e):"closed"!==this[I]?t(new a("Database is not closed",{code:"LEVEL_DATABASE_NOT_CLOSED",cause:r})):t()};if("open"===this[I]){this[I]="closing",this.emit("closing");const t=t=>{this[I]="open",this[A](),this.emit(v),e(t)};this[w]((()=>{this._close((r=>{if(r)return t(r);this[I]="closed",this[A](),this.emit(v),"closed"===this[I]&&this.emit("closed"),e()}))}))}else"closed"===this[I]?this.nextTick(e):this.once(v,(()=>this.close(t)));return t[b]}[w](t){if(0===this[E].size)return this.nextTick(t);let e=this[E].size,r=!0;const n=()=>{0==--e&&(r?this.nextTick(t):t())};for(const t of this[E])t.close(n);r=!1,this[E].clear()}_close(t){this.nextTick(t)}get(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.get(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=this.valueEncoding(e.valueEncoding),c=i.format,u=o.format;return e.keyEncoding===c&&e.valueEncoding===u||(e=Object.assign({},e,{keyEncoding:c,valueEncoding:u})),this._get(this.prefixKey(i.encode(t),c),e,((t,e)=>{if(t)return("LEVEL_NOT_FOUND"===t.code||t.notFound||/NotFound/i.test(t))&&(t.code||(t.code="LEVEL_NOT_FOUND"),t.notFound||(t.notFound=!0),t.status||(t.status=404)),r(t);try{e=o.decode(e)}catch(t){return r(new a("Could not decode value",{code:"LEVEL_DECODE_ERROR",cause:t}))}r(null,e)})),r[b]}_get(t,e,r){this.nextTick(r,new Error("NotFound"))}getMany(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].entry),"opening"===this[I])return this.defer((()=>this.getMany(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'keys' must be an array")),r[b];if(0===t.length)return this.nextTick(r,null,[]),r[b];const n=this.keyEncoding(e.keyEncoding),i=this.valueEncoding(e.valueEncoding),o=n.format,c=i.format;e.keyEncoding===o&&e.valueEncoding===c||(e=Object.assign({},e,{keyEncoding:o,valueEncoding:c}));const u=new Array(t.length);for(let e=0;e{if(t)return r(t);try{for(let t=0;tthis.put(t,e,r,n))),n[b];if(D(this,n))return n[b];const i=this._checkKey(t)||this._checkValue(e);if(i)return this.nextTick(n,i),n[b];const o=this.keyEncoding(r.keyEncoding),a=this.valueEncoding(r.valueEncoding),c=o.format,u=a.format;r.keyEncoding===c&&r.valueEncoding===u||(r=Object.assign({},r,{keyEncoding:c,valueEncoding:u}));const l=this.prefixKey(o.encode(t),c),h=a.encode(e);return this._put(l,h,r,(r=>{if(r)return n(r);this.emit("put",t,e),n()})),n[b]}_put(t,e,r,n){this.nextTick(n)}del(t,e,r){if(r=y(e,r),r=s(r,b),e=g(e,this[_].key),"opening"===this[I])return this.defer((()=>this.del(t,e,r))),r[b];if(D(this,r))return r[b];const n=this._checkKey(t);if(n)return this.nextTick(r,n),r[b];const i=this.keyEncoding(e.keyEncoding),o=i.format;return e.keyEncoding!==o&&(e=Object.assign({},e,{keyEncoding:o})),this._del(this.prefixKey(i.encode(t),o),e,(e=>{if(e)return r(e);this.emit("del",t),r()})),r[b]}_del(t,e,r){this.nextTick(r)}batch(t,e,r){if(!arguments.length){if("opening"===this[I])return new d(this);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._chainedBatch()}if(r="function"==typeof t?t:y(e,r),r=s(r,b),e=g(e,this[_].empty),"opening"===this[I])return this.defer((()=>this.batch(t,e,r))),r[b];if(D(this,r))return r[b];if(!Array.isArray(t))return this.nextTick(r,new TypeError("The first argument 'operations' must be an array")),r[b];if(0===t.length)return this.nextTick(r),r[b];const n=new Array(t.length),{keyEncoding:i,valueEncoding:o,...c}=e;for(let e=0;e{if(e)return r(e);this.emit("batch",t),r()})),r[b]}_batch(t,e,r){this.nextTick(r)}sublevel(t,e){return this._sublevel(t,k.defaults(e))}_sublevel(t,e){return new k(this,t,e)}prefixKey(t,e){return t}clear(t,e){if(e=y(t,e),e=s(e,b),t=g(t,this[_].empty),"opening"===this[I])return this.defer((()=>this.clear(t,e))),e[b];if(D(this,e))return e[b];const r=t,n=this.keyEncoding(t.keyEncoding);return(t=m(t,n)).keyEncoding=n.format,0===t.limit?this.nextTick(e):this._clear(t,(t=>{if(t)return e(t);this.emit("clear",r),e()})),e[b]}_clear(t,e){this.nextTick(e)}iterator(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e)).keys=!1!==t.keys,t.values=!1!==t.values,t[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new h(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._iterator(t)}_iterator(t){return new c(this,t)}keys(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new f(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._keys(t)}_keys(t){return new u(this,t)}values(t){const e=this.keyEncoding(t&&t.keyEncoding),r=this.valueEncoding(t&&t.valueEncoding);if((t=m(t,e))[c.keyEncoding]=e,t[c.valueEncoding]=r,t.keyEncoding=e.format,t.valueEncoding=r.format,"opening"===this[I])return new p(this,t);if("open"!==this[I])throw new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"});return this._values(t)}_values(t){return new l(this,t)}defer(t){if("function"!=typeof t)throw new TypeError("The first argument must be a function");this[T].push(t)}[A](){if(0===this[T].length)return;const t=this[T];this[T]=[];for(const e of t)e()}attachResource(t){if("object"!=typeof t||null===t||"function"!=typeof t.close)throw new TypeError("The first argument must be a resource object");this[E].add(t)}detachResource(t){this[E].delete(t)}_chainedBatch(){return new d(this)}_checkKey(t){if(null==t)return new a("Key cannot be null or undefined",{code:"LEVEL_INVALID_KEY"})}_checkValue(t){if(null==t)return new a("Value cannot be null or undefined",{code:"LEVEL_INVALID_VALUE"})}}C.prototype.nextTick=r(28);const{AbstractSublevel:k}=r(9933)({AbstractLevel:C});e.AbstractLevel=C,e.AbstractSublevel=k;const D=function(t,e){return"open"!==t[I]&&(t.nextTick(e,new a("Database is not open",{code:"LEVEL_DATABASE_NOT_OPEN"})),!0)},R=function(t){return Object.keys(t.supports.encodings).filter((e=>!!t.supports.encodings[e]))}},5e3:(t,e,r)=>{"use strict";e.AbstractLevel=r(1983).AbstractLevel,e.AbstractSublevel=r(1983).AbstractSublevel,e.AbstractIterator=r(3527).AbstractIterator,e.AbstractKeyIterator=r(3527).AbstractKeyIterator,e.AbstractValueIterator=r(3527).AbstractValueIterator,e.AbstractChainedBatch=r(796).AbstractChainedBatch},4716:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=Symbol("unfix"),a=Symbol("iterator"),c=Symbol("handleOne"),u=Symbol("handleMany"),l=Symbol("callback");class h extends n{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e,r){const n=this[l];if(t)return n(t);void 0!==e&&(e=this[s](e)),n(t,e,r)}[u](t,e){const r=this[l];if(t)return r(t);for(const t of e){const e=t[0];void 0!==e&&(t[0]=this[s](e))}r(t,e)}}class f extends i{constructor(t,e,r,n){super(t,e),this[a]=r,this[s]=n,this[c]=this[c].bind(this),this[u]=this[u].bind(this),this[l]=null}[c](t,e){const r=this[l];if(t)return r(t);void 0!==e&&(e=this[s](e)),r(t,e)}[u](t,e){const r=this[l];if(t)return r(t);for(let t=0;t{"use strict";const n=r(266),{Buffer:i}=r(8287)||{},{AbstractSublevelIterator:o,AbstractSublevelKeyIterator:s,AbstractSublevelValueIterator:a}=r(4716),c=Symbol("prefix"),u=Symbol("upperBound"),l=Symbol("prefixRange"),h=Symbol("parent"),f=Symbol("unfix"),p=new TextEncoder,d={separator:"!"};t.exports=function({AbstractLevel:t}){class e extends t{static defaults(t){if("string"==typeof t)throw new n("The subleveldown string shorthand for { separator } has been removed",{code:"LEVEL_LEGACY"});if(t&&t.open)throw new n("The subleveldown open option has been removed",{code:"LEVEL_LEGACY"});return null==t?d:t.separator?t:{...t,separator:"!"}}constructor(t,r,i){const{separator:o,manifest:s,...a}=e.defaults(i);r=v(r,o);const l=o.charCodeAt(0)+1,d=t[h]||t;if(!p.encode(r).every((t=>t>l&&t<127)))throw new n(`Prefix must use bytes > ${l} < 127`,{code:"LEVEL_INVALID_PREFIX"});super(y(d,s),a);const g=(t.prefix||"")+o+r+o,E=g.slice(0,-1)+String.fromCharCode(l);this[h]=d,this[c]=new m(g),this[u]=new m(E),this[f]=new b,this.nextTick=d.nextTick}prefixKey(t,e){if("utf8"===e)return this[c].utf8+t;if(0===t.byteLength)return this[c][e];if("view"===e){const e=this[c].view,r=new Uint8Array(e.byteLength+t.byteLength);return r.set(e,0),r.set(t,e.byteLength),r}{const e=this[c].buffer;return i.concat([e,t],e.byteLength+t.byteLength)}}[l](t,e){void 0!==t.gte?t.gte=this.prefixKey(t.gte,e):void 0!==t.gt?t.gt=this.prefixKey(t.gt,e):t.gte=this[c][e],void 0!==t.lte?t.lte=this.prefixKey(t.lte,e):void 0!==t.lt?t.lt=this.prefixKey(t.lt,e):t.lte=this[u][e]}get prefix(){return this[c].utf8}get db(){return this[h]}_open(t,e){this[h].open({passive:!0},e)}_put(t,e,r,n){this[h].put(t,e,r,n)}_get(t,e,r){this[h].get(t,e,r)}_getMany(t,e,r){this[h].getMany(t,e,r)}_del(t,e,r){this[h].del(t,e,r)}_batch(t,e,r){this[h].batch(t,e,r)}_clear(t,e){this[l](t,t.keyEncoding),this[h].clear(t,e)}_iterator(t){this[l](t,t.keyEncoding);const e=this[h].iterator(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new o(this,t,e,r)}_keys(t){this[l](t,t.keyEncoding);const e=this[h].keys(t),r=this[f].get(this[c].utf8.length,t.keyEncoding);return new s(this,t,e,r)}_values(t){this[l](t,t.keyEncoding);const e=this[h].values(t);return new a(this,t,e)}}return{AbstractSublevel:e}};const y=function(t,e){return{...t.supports,createIfMissing:!1,errorIfExists:!1,events:{},additionalMethods:{},...e,encodings:{utf8:g(t,"utf8"),buffer:g(t,"buffer"),view:g(t,"view")}}},g=function(t,e){return!!t.supports.encodings[e]&&t.keyEncoding(e).name===e};class m{constructor(t){this.utf8=t,this.view=p.encode(t),this.buffer=i?i.from(this.view.buffer,0,this.view.byteLength):{}}}class b{constructor(){this.cache=new Map}get(t,e){let r=this.cache.get(e);return void 0===r&&(r="view"===e?function(t,e){return e.subarray(t)}.bind(null,t):function(t,e){return e.slice(t)}.bind(null,t),this.cache.set(e,r)),r}}const v=function(t,e){let r=0,n=t.length;for(;rr&&t[n-1]===e;)n--;return t.slice(r,n)}},1343:(t,e)=>{"use strict";e.getCallback=function(t,e){return"function"==typeof t?t:e},e.getOptions=function(t,e){return"object"==typeof t&&null!==t?t:void 0!==e?e:{}}},4669:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(796),i=r(266),o=Symbol("encoded");e.DefaultChainedBatch=class extends n{constructor(t){super(t),this[o]=[]}_put(t,e,r){this[o].push({...r,type:"put",key:t,value:e})}_del(t,e){this[o].push({...e,type:"del",key:t})}_clear(){this[o]=[]}_write(t,e){"opening"===this.db.status?this.db.defer((()=>this._write(t,e))):"open"===this.db.status?0===this[o].length?this.nextTick(e):this.db._batch(this[o],t,e):this.nextTick(e,new i("Batch is not open: cannot call write() after write() or close()",{code:"LEVEL_BATCH_NOT_OPEN"}))}}},5682:(t,e,r)=>{"use strict";const{AbstractKeyIterator:n,AbstractValueIterator:i}=r(3527),o=Symbol("iterator"),s=Symbol("callback"),a=Symbol("handleOne"),c=Symbol("handleMany");class u extends n{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!0,values:!1}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}class l extends i{constructor(t,e){super(t,e),this[o]=t.iterator({...e,keys:!1,values:!0}),this[a]=this[a].bind(this),this[c]=this[c].bind(this)}}for(const t of[u,l]){const e=t===u,r=e?t=>t[0]:t=>t[1];t.prototype._next=function(t){this[s]=t,this[o].next(this[a])},t.prototype[a]=function(t,r,n){const i=this[s];t?i(t):i(null,e?r:n)},t.prototype._nextv=function(t,e,r){this[s]=r,this[o].nextv(t,e,this[c])},t.prototype._all=function(t,e){this[s]=e,this[o].all(t,this[c])},t.prototype[c]=function(t,e){const n=this[s];t?n(t):n(null,e.map(r))},t.prototype._seek=function(t,e){this[o].seek(t,e)},t.prototype._close=function(t){this[o].close(t)}}e.DefaultKeyIterator=u,e.DefaultValueIterator=l},4416:(t,e,r)=>{"use strict";const{AbstractIterator:n,AbstractKeyIterator:i,AbstractValueIterator:o}=r(3527),s=r(266),a=Symbol("nut"),c=Symbol("undefer"),u=Symbol("factory");class l extends n{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.iterator(e),this.db.defer((()=>this[c]()))}}class h extends i{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.keys(e),this.db.defer((()=>this[c]()))}}class f extends o{constructor(t,e){super(t,e),this[a]=null,this[u]=()=>t.values(e),this.db.defer((()=>this[c]()))}}for(const t of[l,h,f])t.prototype[c]=function(){"open"===this.db.status&&(this[a]=this[u]())},t.prototype._next=function(t){null!==this[a]?this[a].next(t):"opening"===this.db.status?this.db.defer((()=>this._next(t))):this.nextTick(t,new s("Iterator is not open: cannot call next() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._nextv=function(t,e,r){null!==this[a]?this[a].nextv(t,e,r):"opening"===this.db.status?this.db.defer((()=>this._nextv(t,e,r))):this.nextTick(r,new s("Iterator is not open: cannot call nextv() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._all=function(t,e){null!==this[a]?this[a].all(e):"opening"===this.db.status?this.db.defer((()=>this._all(t,e))):this.nextTick(e,new s("Iterator is not open: cannot call all() after close()",{code:"LEVEL_ITERATOR_NOT_OPEN"}))},t.prototype._seek=function(t,e){null!==this[a]?this[a]._seek(t,e):"opening"===this.db.status&&this.db.defer((()=>this._seek(t,e)))},t.prototype._close=function(t){null!==this[a]?this[a].close(t):"opening"===this.db.status?this.db.defer((()=>this._close(t))):this.nextTick(t)};e.DeferredIterator=l,e.DeferredKeyIterator=h,e.DeferredValueIterator=f},28:(t,e,r)=>{"use strict";const n=r(9596);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},386:(t,e,r)=>{"use strict";const n=r(266),i=Object.prototype.hasOwnProperty,o=new Set(["lt","lte","gt","gte"]);t.exports=function(t,e){const r={};for(const s in t)if(i.call(t,s)&&"keyEncoding"!==s&&"valueEncoding"!==s){if("start"===s||"end"===s)throw new n(`The legacy range option '${s}' has been removed`,{code:"LEVEL_LEGACY"});if("encoding"===s)throw new n("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead",{code:"LEVEL_LEGACY"});o.has(s)?r[s]=e.encode(t[s]):r[s]=t[s]}return r.reverse=!!r.reverse,r.limit=Number.isInteger(r.limit)&&r.limit>=0?r.limit:-1,r}},9511:(t,e,r)=>{"use strict";var n=r(8075)("ArrayBuffer.prototype.byteLength",!0),i=r(4670);t.exports=function(t){return i(t)?n?n(t):t.byteLength:NaN}},7526:(t,e)=>{"use strict";e.byteLength=function(t){var e=a(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=a(t),s=o[0],c=o[1],u=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,c)),l=0,h=c>0?s-4:s;for(r=0;r>16&255,u[l++]=e>>8&255,u[l++]=255&e;return 2===c&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[l++]=255&e),1===c&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[l++]=e>>8&255,u[l++]=255&e),u},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=16383,a=0,u=n-i;au?u:a+s));return 1===i?(e=t[n-1],o.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function c(t,e,n){for(var i,o,s=[],a=e;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},9148:(t,e,r)=>{"use strict";const{AbstractLevel:n}=r(5e3),i=r(266),o=r(5372),{fromCallback:s}=r(8100),{Iterator:a}=r(6296),c=r(5222),u=r(3452),l=r(7766),h="level-js-",f=Symbol("idb"),p=Symbol("namePrefix"),d=Symbol("location"),y=Symbol("version"),g=Symbol("store"),m=Symbol("onComplete"),b=Symbol("promise");class v extends n{constructor(t,e,r){if("function"==typeof e||"function"==typeof r)throw new i("The levelup-style callback argument has been removed",{code:"LEVEL_LEGACY"});const{prefix:n,version:o,...s}=e||{};if(super({encodings:{view:!0},snapshots:!1,createIfMissing:!1,errorIfExists:!1,seek:!0},s),"string"!=typeof t)throw new Error("constructor requires a location string argument");this[d]=t,this[p]=null==n?h:n,this[y]=parseInt(o||1,10),this[f]=null}get location(){return this[d]}get namePrefix(){return this[p]}get version(){return this[y]}get db(){return this[f]}get type(){return"browser-level"}_open(t,e){const r=indexedDB.open(this[p]+this[d],this[y]);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this[f]=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this[d])||e.createObjectStore(this[d])}}[g](t){return this[f].transaction([this[d]],t).objectStore(this[d])}[m](t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}}_get(t,e,r){const n=this[g]("readonly");let o;try{o=n.get(t)}catch(t){return this.nextTick(r,t)}this[m](o,(function(t,e){return t?r(t):void 0===e?r(new i("Entry not found",{code:"LEVEL_NOT_FOUND"})):void r(null,c(e))}))}_getMany(t,e,r){const n=this[g]("readonly"),i=t.map((t=>e=>{let r;try{r=n.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:c(t))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(i,16,r)}_del(t,e,r){const n=this[g]("readwrite");let i;try{i=n.delete(t)}catch(t){return this.nextTick(r,t)}this[m](i,r)}_put(t,e,r,n){const i=this[g]("readwrite");let o;try{o=i.put(e,t)}catch(t){return this.nextTick(n,t)}this[m](o,n)}_iterator(t){return new a(this,this[d],t)}_batch(t,e,r){const n=this[g]("readwrite"),i=n.transaction;let o,s=0;i.onabort=function(){r(o||i.error||new Error("aborted by user"))},i.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let c;try{c="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return u(this,this[d],r,t,e);try{const t=this[g]("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this.nextTick(e,t)}this[m](n,e)}_close(t){this[f].close(),this.nextTick(t)}}v.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h),r=s(r,b);const n=indexedDB.deleteDatabase(e+t);return n.onsuccess=function(){r()},n.onerror=function(t){r(t)},r[b]},e.Z=v},6296:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(5e3),i=r(7766),o=r(5222),s=Symbol("cache"),a=Symbol("finished"),c=Symbol("options"),u=Symbol("currentOptions"),l=Symbol("position"),h=Symbol("location"),f=Symbol("first"),p={};function d(t){"function"==typeof t.commit&&t.commit()}e.Iterator=class extends n{constructor(t,e,r){super(t,r),this[s]=[],this[a]=0===this.limit,this[c]=r,this[u]={...r},this[l]=void 0,this[h]=e,this[f]=!0}_nextv(t,e,r){if(this[f]=!1,this[a])return this.nextTick(r,null,[]);if(this[s].length>0)return t=Math.min(t,this[s].length),this.nextTick(r,null,this[s].splice(0,t));let n;void 0!==this[l]&&(this[c].reverse?(this[u].lt=this[l],this[u].lte=void 0):(this[u].gt=this[l],this[u].gte=void 0));try{n=i(this[u])}catch(t){return this[a]=!0,this.nextTick(r,null,[])}const p=this.db.db.transaction([this[h]],"readonly"),y=p.objectStore(this[h]),g=[];if(this[c].reverse)y[!this[c].values&&y.openKeyCursor?"openKeyCursor":"openCursor"](n,"prev").onsuccess=e=>{const r=e.target.result;if(r){const{key:e,value:n}=r;this[l]=e,g.push([this[c].keys&&void 0!==e?o(e):void 0,this[c].values&&void 0!==n?o(n):void 0]),g.length{if(void 0===e||void 0===r)return;const n=Math.max(e.length,r.length);0===n||t===1/0?this[a]=!0:this[l]=e[n-1],g.length=n;for(let t=0;t{e=t.target.result,i()}:(e=[],this.nextTick(i)),this[c].values?y.getAll(n,t<1/0?t:void 0).onsuccess=t=>{r=t.target.result,i()}:(r=[],this.nextTick(i))}p.onabort=()=>{r(p.error||new Error("aborted by user")),r=null},p.oncomplete=()=>{r(null,g),r=null}}_next(t){if(this[s].length>0){const[e,r]=this[s].shift();this.nextTick(t,null,e,r)}else if(this[a])this.nextTick(t);else{let e=Math.min(100,this.limit-this.count);this[f]&&(this[f]=!1,e=1),this._nextv(e,p,((e,r)=>{if(e)return t(e);this[s]=r,this._next(t)}))}}_all(t,e){this[f]=!1;const r=this[s].splice(0,this[s].length),n=this.limit-this.count-r.length;if(n<=0)return this.nextTick(e,null,r);this._nextv(n,p,((t,n)=>{if(t)return e(t);r.length>0&&(n=r.concat(n)),e(null,n)}))}_seek(t,e){let r;this[f]=!0,this[s]=[],this[a]=!1,this[l]=void 0,this[u]={...this[c]};try{r=i(this[c])}catch(t){return void(this[a]=!0)}null===r||r.includes(t)?this[c].reverse?this[u].lte=t:this[u].gte=t:this[a]=!0}}},3452:t=>{"use strict";t.exports=function(t,e,r,n,i){if(0===n.limit)return t.nextTick(i);const o=t.db.transaction([e],"readwrite"),s=o.objectStore(e);let a=0;o.oncomplete=function(){i()},o.onabort=function(){i(o.error||new Error("aborted by user"))};const c=s.openKeyCursor?"openKeyCursor":"openCursor",u=n.reverse?"prev":"next";s[c](r,u).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const e=new TextEncoder;t.exports=function(t){return t instanceof Uint8Array?t:t instanceof ArrayBuffer?new Uint8Array(t):e.encode(t)}},7766:t=>{"use strict";t.exports=function(t){const e=void 0!==t.gte?t.gte:void 0!==t.gt?t.gt:void 0,r=void 0!==t.lte?t.lte:void 0!==t.lt?t.lt:void 0,n=void 0===t.gte,i=void 0===t.lte;return void 0!==e&&void 0!==r?IDBKeyRange.bound(e,r,n,i):void 0!==e?IDBKeyRange.lowerBound(e,n):void 0!==r?IDBKeyRange.upperBound(r,i):null}},8287:(t,e,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=function(t){return+t!=t&&(t=0),c.alloc(+t)},e.INSPECT_MAX_BYTES=50;const s=2147483647;function a(t){if(t>s)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,c.prototype),e}function c(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(Y(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(Y(t,SharedArrayBuffer)||t&&Y(t.buffer,SharedArrayBuffer)))return p(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return c.from(n,e,r);const i=function(t){if(c.isBuffer(t)){const e=0|d(t.length),r=a(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||X(t.length)?a(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return c.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function h(t){return l(t),a(t<0?0:0|d(t))}function f(t){const e=t.length<0?0:0|d(t.length),r=a(e);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|t}function y(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(t).length;default:if(i)return n?-1:K(t).length;e=(""+e).toLowerCase(),i=!0}}function g(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return N(this,e,r);case"utf8":case"utf-8":return I(this,e,r);case"ascii":return L(this,e,r);case"latin1":case"binary":return x(this,e,r);case"base64":return O(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function m(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),X(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){let o,s=1,a=t.length,c=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,c/=2,r/=2}function u(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=e.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function O(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function I(t,e,r){r=Math.min(t.length,r);const n=[];let i=e;for(;i239?4:e>223?3:e>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(c=(31&e)<<6|63&r,c>127&&(o=c));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(c=(15&e)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(t){const e=t.length;if(e<=_)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(c.isBuffer(e)||(e=c.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!c.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},c.byteLength=y,c.prototype._isBuffer=!0,c.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;er&&(t+=" ... "),""},o&&(c.prototype[o]=c.prototype.inspect),c.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(o,s),u=this.slice(n,i),l=t.slice(e,r);for(let t=0;t>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":case"latin1":case"binary":return T(this,t,e,r);case"base64":return A(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const _=4096;function L(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;in)&&(r=n);let i="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o,o>>=8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function R(t,e,r,n,i){$(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o>>=8,t[r+6]=o,o>>=8,t[r+5]=o,o>>=8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function B(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function P(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},c.prototype.readUint8=c.prototype.readUInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),this[t]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||C(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readBigUInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,i=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],i=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||C(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||C(t,e,this.length);let n=e,i=1,o=this[t+--n];for(;n>0&&(i*=256);)o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},c.prototype.readInt8=function(t,e){return t>>>=0,e||C(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt16BE=function(t,e){t>>>=0,e||C(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||C(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readBigInt64LE=Q((function(t){G(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||z(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||C(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||C(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||C(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUintLE=c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[e]=255&t;++o>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUint8=c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigUInt64LE=Q((function(t,e=0){return D(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeBigUInt64BE=Q((function(t,e=0){return R(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),c.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>>=0,!n){const n=Math.pow(2,8*r-1);k(this,t,e,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[e+i]=255&t;--i>=0&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o|0)-s&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeBigInt64LE=Q((function(t,e=0){return D(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeBigInt64BE=Q((function(t,e=0){return R(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),c.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return P(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return P(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function $(t,e,r,n,i,o){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new j.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){G(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||z(e,t.length-(r+1))}(n,i,o)}function G(t,e){if("number"!=typeof t)throw new j.ERR_INVALID_ARG_TYPE(e,"number",t)}function z(t,e,r){if(Math.floor(t)!==t)throw G(t,r),new j.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new j.ERR_BUFFER_OUT_OF_BOUNDS;throw new j.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}M("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),M("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),M("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=V(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=V(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(t,e){let r;e=e||1/0;const n=t.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function q(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function H(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function X(t){return t!=t}const J=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},8075:(t,e,r)=>{"use strict";var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&o(t,".prototype.")>-1?i(r):r}},487:(t,e,r)=>{"use strict";var n=r(6743),i=r(453),o=r(6897),s=r(9675),a=i("%Function.prototype.apply%"),c=i("%Function.prototype.call%"),u=i("%Reflect.apply%",!0)||n.call(c,a),l=r(655),h=i("%Math.max%");t.exports=function(t){if("function"!=typeof t)throw new s("a function is required");var e=u(n,c,arguments);return o(e,1+h(0,t.length-(arguments.length-1)),!0)};var f=function(){return u(n,a,arguments)};l?l(t.exports,"apply",{value:f}):t.exports.apply=f},8100:(t,e,r)=>{"use strict";var n=r(844);e.fromCallback=function(t,e){if(void 0===t){var r=new Promise((function(e,r){t=function(t,n){t?r(t):e(n)}}));t[void 0!==e?e:"promise"]=r}else if("function"!=typeof t)throw new TypeError("Callback must be a function");return t},e.fromPromise=function(t,e){if(void 0===e)return t;t.then((function(t){n((()=>e(null,t)))})).catch((function(t){n((()=>e(t)))}))}},844:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},9743:(t,e)=>{function r(t){for(var e="",r=0;r0?"F"+s:"D"+r(s)},e.decode=function(t){if("DaN"===t)return NaN;if("FF"===t)return 1/0;if("DD"===t)return-1/0;var e="D"===t[0],n=(e?r(t):t).slice(2).split("M");return Number((e?"-":"")+n[1]+"e"+String(Number(n[0])-500))}},3381:(t,e)=>{var r={"?":"?@","!":"??",'"':"?%"},n={"?@":"?","??":"!","?%":'"'};e.factory=function(t){return{encode:e,decode:function(e){if("A"===e)return null;if("K!"===e)return[];for(var r,i=e.split('"'),o=[[]],s=0,a=i.length,c=0;c{var n=r(9743),i=r(3381);e.flip=function(t){var e=t.toString(),r="";for(var n in e)r+="."==e[n]?".":9-+e[n];return r},e.number=n,e.string={encode:function(t){return/\x00|\x01/.test(t)?"J"+t.replace(/\x01/g,"").replace(/\x00/g,""):"J"+t},decode:function(t){if("J"===t[0])return t.substring(1)}},e.encode=function(t){return e[typeof t].encode(t)},e.decode=function(t){if(""===t)return t;if(!o[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return o[t[0]](t)},e.object=i.factory(e),e.boolean={encode:function(t){return t?"C":"B"},decode:function(t){return"C"===t}},e.undefined={encode:function(t){return"L"},decode:function(){}};var o={A:e.object.decode,B:e.boolean.decode,C:e.boolean.decode,D:e.number.decode,F:e.number.decode,J:e.string.decode,K:e.object.decode,L:e.undefined.decode};e.buffer=!1,e.type="charwise"},41:(t,e,r)=>{"use strict";var n=r(655),i=r(8068),o=r(9675),s=r(5795);t.exports=function(t,e,r){if(!t||"object"!=typeof t&&"function"!=typeof t)throw new o("`obj` must be an object or a function`");if("string"!=typeof e&&"symbol"!=typeof e)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,c=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,l=arguments.length>6&&arguments[6],h=!!s&&s(t,e);if(n)n(t,e,{configurable:null===u&&h?h.configurable:!u,enumerable:null===a&&h?h.enumerable:!a,value:r,writable:null===c&&h?h.writable:!c});else{if(!l&&(a||c||u))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");t[e]=r}}},8452:(t,e,r)=>{"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),c=r(592)(),u=function(t,e,r,n){if(e in t)if(!0===n){if(t[e]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;c?a(t,e,r,!0):a(t,e,r)},l=function(t,e){var r=arguments.length>2?arguments[2]:{},o=n(e);i&&(o=s.call(o,Object.getOwnPropertySymbols(e)));for(var a=0;a{"use strict";var n=r(453)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(t){n=!1}t.exports=n},1237:t=>{"use strict";t.exports=EvalError},9383:t=>{"use strict";t.exports=Error},9290:t=>{"use strict";t.exports=RangeError},9538:t=>{"use strict";t.exports=ReferenceError},8068:t=>{"use strict";t.exports=SyntaxError},9675:t=>{"use strict";t.exports=TypeError},5345:t=>{"use strict";t.exports=URIError},5388:(t,e,r)=>{"use strict";var n=r(9675);t.exports=function(t){if(null==t)throw new n(arguments.length>0&&arguments[1]||"Cannot call method on "+t);return t}},5437:(t,e,r)=>{"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator,i=r(162),o=r(9600),s=r(2120),a=r(3612);t.exports=function(t){if(i(t))return t;var e,r="default";if(arguments.length>1&&(arguments[1]===String?r="string":arguments[1]===Number&&(r="number")),n&&(Symbol.toPrimitive?e=function(t,e){var r=t[e];if(null!=r){if(!o(r))throw new TypeError(r+" returned for property "+e+" of object "+t+" is not a function");return r}}(t,Symbol.toPrimitive):a(t)&&(e=Symbol.prototype.valueOf)),void 0!==e){var c=e.call(t,r);if(i(c))return c;throw new TypeError("unable to convert exotic object to primitive")}return"default"===r&&(s(t)||a(t))&&(r="string"),function(t,e){if(null==t)throw new TypeError("Cannot call method on "+t);if("string"!=typeof e||"number"!==e&&"string"!==e)throw new TypeError('hint must be "string" or "number"');var r,n,s,a="string"===e?["toString","valueOf"]:["valueOf","toString"];for(s=0;s{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,r="~";function n(){}function i(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function o(t,e,n,o,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new i(n,o||t,s),c=r?r+e:e;return t._events[c]?t._events[c].fn?t._events[c]=[t._events[c],a]:t._events[c].push(a):(t._events[c]=a,t._eventsCount++),t}function s(t,e){0==--t._eventsCount?t._events=new n:delete t._events[e]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(r=!1)),a.prototype.eventNames=function(){var t,n,i=[];if(0===this._eventsCount)return i;for(n in t=this._events)e.call(t,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(t)):i},a.prototype.listeners=function(t){var e=r?r+t:t,n=this._events[e];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,o=n.length,s=new Array(o);i{"use strict";var e,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var i=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,n){function i(r){t.removeListener(e,o),n(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",i),r([].slice.call(arguments))}y(t,e,o,{once:!0}),"error"!==e&&function(t,e){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function c(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function u(t,e,r,n){var i,o,s,u;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,u=l,console&&console.warn&&console.warn(u)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=l.bind(n);return i.listener=r,n.wrapFn=i,i}function f(t,e,r){var n=t._events;if(void 0===n)return[];var i=n[e];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[t];if(void 0===c)return!1;if("function"==typeof c)n(c,this,e);else{var u=c.length,l=d(c,u);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},o.prototype.listeners=function(t){return f(this,t,!0)},o.prototype.rawListeners=function(t){return f(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},2682:(t,e,r)=>{"use strict";var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){if(!n(e))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=r),"[object Array]"===i.call(t)?function(t,e,r){for(var n=0,i=t.length;n{"use strict";var e=Object.prototype.toString,r=Math.max,n=function(t,e){for(var r=[],n=0;n{"use strict";var n=r(9353);t.exports=Function.prototype.bind||n},453:(t,e,r)=>{"use strict";var n,i=r(9383),o=r(1237),s=r(9290),a=r(9538),c=r(8068),u=r(9675),l=r(5345),h=Function,f=function(t){try{return h('"use strict"; return ('+t+").constructor;")()}catch(t){}},p=Object.getOwnPropertyDescriptor;if(p)try{p({},"")}catch(t){p=null}var d=function(){throw new u},y=p?function(){try{return d}catch(t){try{return p(arguments,"callee").get}catch(t){return d}}}():d,g=r(4039)(),m=r(24)(),b=Object.getPrototypeOf||(m?function(t){return t.__proto__}:null),v={},E="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,w={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":h,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":y,"%TypedArray%":E,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(t){var T=b(b(t));w["%Error.prototype%"]=T}var A=function t(e){var r;if("%AsyncFunction%"===e)r=f("async function () {}");else if("%GeneratorFunction%"===e)r=f("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=f("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return w[e]=r,r},S={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=r(6743),I=r(9957),_=O.call(Function.call,Array.prototype.concat),L=O.call(Function.apply,Array.prototype.splice),x=O.call(Function.call,String.prototype.replace),N=O.call(Function.call,String.prototype.slice),U=O.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,k=/\\(\\)?/g,D=function(t,e){var r,n=t;if(I(S,n)&&(n="%"+(r=S[n])[0]+"%"),I(w,n)){var i=w[n];if(i===v&&(i=A(n)),void 0===i&&!e)throw new u("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new u('"allowMissing" argument must be a boolean');if(null===U(/^%?[^%]*%?$/,t))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(t){var e=N(t,0,1),r=N(t,-1);if("%"===e&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return x(t,C,(function(t,e,r,i){n[n.length]=r?x(i,k,"$1"):e||t})),n}(t),n=r.length>0?r[0]:"",i=D("%"+n+"%",e),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],L(r,_([0,1],l)));for(var h=1,f=!0;h=r.length){var m=p(s,d);s=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:s[d]}else f=I(s,d),s=s[d];f&&!a&&(w[o]=s)}}return s}},5795:(t,e,r)=>{"use strict";var n=r(453)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},592:(t,e,r)=>{"use strict";var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(t){return!0}},t.exports=i},24:t=>{"use strict";var e={__proto__:null,foo:{}},r=Object;t.exports=function(){return{__proto__:e}.foo===e.foo&&!(e instanceof r)}},4039:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},1333:t=>{"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var t={},e=Symbol("test"),r=Object(e);if("string"==typeof e)return!1;if("[object Symbol]"!==Object.prototype.toString.call(e))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(e in t[e]=42,t)return!1;if("function"==typeof Object.keys&&0!==Object.keys(t).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(t).length)return!1;var n=Object.getOwnPropertySymbols(t);if(1!==n.length||n[0]!==e)return!1;if(!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var i=Object.getOwnPropertyDescriptor(t,e);if(42!==i.value||!0!==i.enumerable)return!1}return!0}},9092:(t,e,r)=>{"use strict";var n=r(1333);t.exports=function(){return n()&&!!Symbol.toStringTag}},9957:(t,e,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);t.exports=o.call(n,i)},251:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,c=(1<>1,l=-7,h=r?i-1:0,f=r?-1:1,p=t[e+h];for(h+=f,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+h],h+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+h],h+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-s))<1&&(s--,c*=2),(e+=s+h>=1?f/c:f*Math.pow(2,1-h))*c>=2&&(s++,c/=2),s+h>=l?(a=0,s=l):s+h>=1?(a=(e*c-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,u-=8);t[r+p-d]|=128*y}},4670:(t,e,r)=>{"use strict";var n=r(487),i=r(8075),o=r(453)("%ArrayBuffer%",!0),s=i("ArrayBuffer.prototype.byteLength",!0),a=i("Object.prototype.toString"),c=!!o&&!s&&new o(0).slice,u=!!c&&n(c);t.exports=s||u?function(t){if(!t||"object"!=typeof t)return!1;try{return s?s(t):u(t,0),!0}catch(t){return!1}}:o?function(t){return"[object ArrayBuffer]"===a(t)}:function(t){return!1}},9600:t=>{"use strict";var e,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i((function(){throw 42}),null,e)}catch(t){t!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(t){try{var e=n.call(t);return o.test(e)}catch(t){return!1}},a=function(t){try{return!s(t)&&(n.call(t),!0)}catch(t){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,l=!(0 in[,]),h=function(){return!1};if("object"==typeof document){var f=document.all;c.call(f)===c.call(document.all)&&(h=function(t){if((l||!t)&&(void 0===t||"object"==typeof t))try{var e=c.call(t);return("[object HTMLAllCollection]"===e||"[object HTML document.all class]"===e||"[object HTMLCollection]"===e||"[object Object]"===e)&&null==t("")}catch(t){}return!1})}t.exports=i?function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;try{i(t,null,e)}catch(t){if(t!==r)return!1}return!s(t)&&a(t)}:function(t){if(h(t))return!0;if(!t)return!1;if("function"!=typeof t&&"object"!=typeof t)return!1;if(u)return a(t);if(s(t))return!1;var e=c.call(t);return!("[object Function]"!==e&&"[object GeneratorFunction]"!==e&&!/^\[object HTML/.test(e))&&a(t)}},2120:(t,e,r)=>{"use strict";var n=Date.prototype.getDay,i=Object.prototype.toString,o=r(9092)();t.exports=function(t){return"object"==typeof t&&null!==t&&(o?function(t){try{return n.call(t),!0}catch(t){return!1}}(t):"[object Date]"===i.call(t))}},4035:(t,e,r)=>{"use strict";var n,i,o,s,a=r(8075),c=r(9092)();if(c){n=a("Object.prototype.hasOwnProperty"),i=a("RegExp.prototype.exec"),o={};var u=function(){throw o};s={toString:u,valueOf:u},"symbol"==typeof Symbol.toPrimitive&&(s[Symbol.toPrimitive]=u)}var l=a("Object.prototype.toString"),h=Object.getOwnPropertyDescriptor;t.exports=c?function(t){if(!t||"object"!=typeof t)return!1;var e=h(t,"lastIndex");if(!e||!n(e,"value"))return!1;try{i(t,s)}catch(t){return t===o}}:function(t){return!(!t||"object"!=typeof t&&"function"!=typeof t)&&"[object RegExp]"===l(t)}},7070:(t,e,r)=>{"use strict";var n=r(8075)("SharedArrayBuffer.prototype.byteLength",!0);t.exports=n?function(t){if(!t||"object"!=typeof t)return!1;try{return n(t),!0}catch(t){return!1}}:function(t){return!1}},3612:(t,e,r)=>{"use strict";var n=Object.prototype.toString;if(r(4039)()){var i=Symbol.prototype.toString,o=/^Symbol\(.*\)$/;t.exports=function(t){if("symbol"==typeof t)return!0;if("[object Symbol]"!==n.call(t))return!1;try{return function(t){return"symbol"==typeof t.valueOf()&&o.test(i.call(t))}(t)}catch(t){return!1}}}else t.exports=function(t){return!1}},5680:(t,e,r)=>{"use strict";var n=r(5767);t.exports=function(t){return!!n(t)}},4634:t=>{var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},5356:(t,e)=>{"use strict";e.supports=function(...t){const e=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(e,{snapshots:e.snapshots||!1,permanence:e.permanence||!1,seek:e.seek||!1,clear:e.clear||!1,getMany:e.getMany||!1,keyIterator:e.keyIterator||!1,valueIterator:e.valueIterator||!1,iteratorNextv:e.iteratorNextv||!1,iteratorAll:e.iteratorAll||!1,status:e.status||!1,createIfMissing:e.createIfMissing||!1,errorIfExists:e.errorIfExists||!1,deferredOpen:e.deferredOpen||!1,promises:e.promises||!1,streams:e.streams||!1,encodings:Object.assign({},e.encodings),events:Object.assign({},e.events),additionalMethods:Object.assign({},e.additionalMethods)})}},6035:(t,e,r)=>{"use strict";const n=r(266),i=r(4341),{Encoding:o}=r(8110),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=Symbol("formats"),l=Symbol("encodings"),h=new Set(["buffer","view","utf8"]);e.Transcoder=class{constructor(t){if(!Array.isArray(t))throw new TypeError("The first argument 'formats' must be an array");if(!t.every((t=>h.has(t))))throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'");this[l]=new Map,this[u]=new Set(t);for(const t in i)try{this.encoding(t)}catch(t){if("LEVEL_ENCODING_NOT_SUPPORTED"!==t.code)throw t}}encodings(){return Array.from(new Set(this[l].values()))}encoding(t){let e=this[l].get(t);if(void 0===e){if("string"==typeof t&&""!==t){if(e=p[t],!e)throw new n(`Encoding '${t}' is not found`,{code:"LEVEL_ENCODING_NOT_FOUND"})}else{if("object"!=typeof t||null===t)throw new TypeError("First argument 'encoding' must be a string or object");e=function(t){if(t instanceof o)return t;const e="type"in t&&"string"==typeof t.type?t.type:void 0,r=t.name||e||"anonymous-"+d++;switch(function(t){return"format"in t&&void 0!==t.format?t.format:"buffer"in t&&"boolean"==typeof t.buffer?t.buffer?"buffer":"utf8":"code"in t&&Number.isInteger(t.code)?"view":"buffer"}(t)){case"view":return new a({...t,name:r});case"utf8":return new c({...t,name:r});case"buffer":return new s({...t,name:r});default:throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'")}}(t)}const{name:r,format:i}=e;if(!this[u].has(i))if(this[u].has("view"))e=e.createViewTranscoder();else if(this[u].has("buffer"))e=e.createBufferTranscoder();else{if(!this[u].has("utf8"))throw new n(`Encoding '${r}' cannot be transcoded`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"});e=e.createUTF8Transcoder()}for(const n of[t,r,e.name,e.commonName])this[l].set(n,e)}return e}};const f={binary:i.buffer,"utf-8":i.utf8},p={...i,...f};let d=0},8110:(t,e,r)=>{"use strict";const n=r(266),i=new Set(["buffer","view","utf8"]);e.Encoding=class{constructor(t){if(this.encode=t.encode||this.encode,this.decode=t.decode||this.decode,this.name=t.name||this.name,this.format=t.format||this.format,"function"!=typeof this.encode)throw new TypeError("The 'encode' property must be a function");if("function"!=typeof this.decode)throw new TypeError("The 'decode' property must be a function");if(this.encode=this.encode.bind(this),this.decode=this.decode.bind(this),"string"!=typeof this.name||""===this.name)throw new TypeError("The 'name' property must be a string");if("string"!=typeof this.format||!i.has(this.format))throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'");t.createViewTranscoder&&(this.createViewTranscoder=t.createViewTranscoder),t.createBufferTranscoder&&(this.createBufferTranscoder=t.createBufferTranscoder),t.createUTF8Transcoder&&(this.createUTF8Transcoder=t.createUTF8Transcoder)}get commonName(){return this.name.split("+")[0]}createBufferTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'buffer'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createViewTranscoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'view'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}createUTF8Transcoder(){throw new n(`Encoding '${this.name}' cannot be transcoded to 'utf8'`,{code:"LEVEL_ENCODING_NOT_SUPPORTED"})}}},4341:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{Buffer:{isBuffer:()=>!1}},{textEncoder:i,textDecoder:o}=r(7200)(),{BufferFormat:s,ViewFormat:a,UTF8Format:c}=r(8343),u=t=>t;e.utf8=new c({encode:function(t){return n.isBuffer(t)?t.toString("utf8"):ArrayBuffer.isView(t)?o.decode(t):String(t)},decode:u,name:"utf8",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:function(t){return o.decode(t)},name:`${this.name}+view`})},createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:function(t){return t.toString("utf8")},name:`${this.name}+buffer`})}}),e.json=new c({encode:JSON.stringify,decode:JSON.parse,name:"json"}),e.buffer=new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:"buffer",createViewTranscoder(){return new a({encode:function(t){return ArrayBuffer.isView(t)?t:n.from(String(t),"utf8")},decode:function(t){return n.from(t.buffer,t.byteOffset,t.byteLength)},name:`${this.name}+view`})}}),e.view=new a({encode:function(t){return ArrayBuffer.isView(t)?t:i.encode(t)},decode:u,name:"view",createBufferTranscoder(){return new s({encode:function(t){return n.isBuffer(t)?t:ArrayBuffer.isView(t)?n.from(t.buffer,t.byteOffset,t.byteLength):n.from(String(t),"utf8")},decode:u,name:`${this.name}+buffer`})}}),e.hex=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"hex")},decode:function(t){return t.toString("hex")},name:"hex"}),e.base64=new s({encode:function(t){return n.isBuffer(t)?t:n.from(String(t),"base64")},decode:function(t){return t.toString("base64")},name:"base64"})},8343:(t,e,r)=>{"use strict";const{Buffer:n}=r(8287)||{},{Encoding:i}=r(8110),o=r(7200);class s extends i{constructor(t){super({...t,format:"buffer"})}createViewTranscoder(){return new a({encode:this.encode,decode:t=>this.decode(n.from(t.buffer,t.byteOffset,t.byteLength)),name:`${this.name}+view`})}createBufferTranscoder(){return this}}class a extends i{constructor(t){super({...t,format:"view"})}createBufferTranscoder(){return new s({encode:t=>{const e=this.encode(t);return n.from(e.buffer,e.byteOffset,e.byteLength)},decode:this.decode,name:`${this.name}+buffer`})}createViewTranscoder(){return this}}e.BufferFormat=s,e.ViewFormat=a,e.UTF8Format=class extends i{constructor(t){super({...t,format:"utf8"})}createBufferTranscoder(){return new s({encode:t=>n.from(this.encode(t),"utf8"),decode:t=>this.decode(t.toString("utf8")),name:`${this.name}+buffer`})}createViewTranscoder(){const{textEncoder:t,textDecoder:e}=o();return new a({encode:e=>t.encode(this.encode(e)),decode:t=>this.decode(e.decode(t)),name:`${this.name}+view`})}createUTF8Transcoder(){return this}}},7200:t=>{"use strict";let e=null;t.exports=function(){return null===e&&(e={textEncoder:new TextEncoder,textDecoder:new TextDecoder}),e}},266:t=>{"use strict";t.exports=class extends Error{constructor(t,e){super(t||""),"object"==typeof e&&null!==e&&(e.code&&(this.code=String(e.code)),e.expected&&(this.expected=!0),e.transient&&(this.transient=!0),e.cause&&(this.cause=e.cause)),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},8508:function(t,e){!function(t){"use strict";const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.ngraminator=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()},Object.defineProperty(t,"__esModule",{value:!0})}(e)},8859:(t,e,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,c=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=a&&c&&"function"==typeof c.get?c.get:null,l=a&&Set.prototype.forEach,h="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,d=Boolean.prototype.valueOf,y=Object.prototype.toString,g=Function.prototype.toString,m=String.prototype.match,b=String.prototype.slice,v=String.prototype.replace,E=String.prototype.toUpperCase,w=String.prototype.toLowerCase,T=RegExp.prototype.test,A=Array.prototype.concat,S=Array.prototype.join,O=Array.prototype.slice,I=Math.floor,_="function"==typeof BigInt?BigInt.prototype.valueOf:null,L=Object.getOwnPropertySymbols,x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,N="function"==typeof Symbol&&"object"==typeof Symbol.iterator,U="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,C=Object.prototype.propertyIsEnumerable,k=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function D(t,e){if(t===1/0||t===-1/0||t!=t||t&&t>-1e3&&t<1e3||T.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof t){var n=t<0?-I(-t):I(t);if(n!==t){var i=String(n),o=b.call(e,i.length+1);return v.call(i,r,"$&_")+"."+v.call(v.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return v.call(e,r,"$&_")}var R=r(2634),B=R.custom,F=$(B)?B:null;function P(t,e,r){var n="double"===(r.quoteStyle||e)?'"':"'";return n+t+n}function j(t){return v.call(String(t),/"/g,""")}function M(t){return!("[object Array]"!==W(t)||U&&"object"==typeof t&&U in t)}function V(t){return!("[object RegExp]"!==W(t)||U&&"object"==typeof t&&U in t)}function $(t){if(N)return t&&"object"==typeof t&&t instanceof Symbol;if("symbol"==typeof t)return!0;if(!t||"object"!=typeof t||!x)return!1;try{return x.call(t),!0}catch(t){}return!1}t.exports=function t(e,n,i,a){var c=n||{};if(z(c,"quoteStyle")&&"single"!==c.quoteStyle&&"double"!==c.quoteStyle)throw new TypeError('option "quoteStyle" must be "single" or "double"');if(z(c,"maxStringLength")&&("number"==typeof c.maxStringLength?c.maxStringLength<0&&c.maxStringLength!==1/0:null!==c.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var y=!z(c,"customInspect")||c.customInspect;if("boolean"!=typeof y&&"symbol"!==y)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(z(c,"indent")&&null!==c.indent&&"\t"!==c.indent&&!(parseInt(c.indent,10)===c.indent&&c.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(z(c,"numericSeparator")&&"boolean"!=typeof c.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var E=c.numericSeparator;if(void 0===e)return"undefined";if(null===e)return"null";if("boolean"==typeof e)return e?"true":"false";if("string"==typeof e)return q(e,c);if("number"==typeof e){if(0===e)return 1/0/e>0?"0":"-0";var T=String(e);return E?D(e,T):T}if("bigint"==typeof e){var I=String(e)+"n";return E?D(e,I):I}var L=void 0===c.depth?5:c.depth;if(void 0===i&&(i=0),i>=L&&L>0&&"object"==typeof e)return M(e)?"[Array]":"[Object]";var B,G=function(t,e){var r;if("\t"===t.indent)r="\t";else{if(!("number"==typeof t.indent&&t.indent>0))return null;r=S.call(Array(t.indent+1)," ")}return{base:r,prev:S.call(Array(e+1),r)}}(c,i);if(void 0===a)a=[];else if(K(a,e)>=0)return"[Circular]";function H(e,r,n){if(r&&(a=O.call(a)).push(r),n){var o={depth:c.depth};return z(c,"quoteStyle")&&(o.quoteStyle=c.quoteStyle),t(e,o,i+1,a)}return t(e,c,i+1,a)}if("function"==typeof e&&!V(e)){var tt=function(t){if(t.name)return t.name;var e=m.call(g.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}(e),et=Z(e,H);return"[Function"+(tt?": "+tt:" (anonymous)")+"]"+(et.length>0?" { "+S.call(et,", ")+" }":"")}if($(e)){var rt=N?v.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):x.call(e);return"object"!=typeof e||N?rt:Y(rt)}if((B=e)&&"object"==typeof B&&("undefined"!=typeof HTMLElement&&B instanceof HTMLElement||"string"==typeof B.nodeName&&"function"==typeof B.getAttribute)){for(var nt="<"+w.call(String(e.nodeName)),it=e.attributes||[],ot=0;ot"}if(M(e)){if(0===e.length)return"[]";var st=Z(e,H);return G&&!function(t){for(var e=0;e=0)return!1;return!0}(st)?"["+Q(st,G)+"]":"[ "+S.call(st,", ")+" ]"}if(function(t){return!("[object Error]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)){var at=Z(e,H);return"cause"in Error.prototype||!("cause"in e)||C.call(e,"cause")?0===at.length?"["+String(e)+"]":"{ ["+String(e)+"] "+S.call(at,", ")+" }":"{ ["+String(e)+"] "+S.call(A.call("[cause]: "+H(e.cause),at),", ")+" }"}if("object"==typeof e&&y){if(F&&"function"==typeof e[F]&&R)return R(e,{depth:L-i});if("symbol"!==y&&"function"==typeof e.inspect)return e.inspect()}if(function(t){if(!o||!t||"object"!=typeof t)return!1;try{o.call(t);try{u.call(t)}catch(t){return!0}return t instanceof Map}catch(t){}return!1}(e)){var ct=[];return s&&s.call(e,(function(t,r){ct.push(H(r,e,!0)+" => "+H(t,e))})),J("Map",o.call(e),ct,G)}if(function(t){if(!u||!t||"object"!=typeof t)return!1;try{u.call(t);try{o.call(t)}catch(t){return!0}return t instanceof Set}catch(t){}return!1}(e)){var ut=[];return l&&l.call(e,(function(t){ut.push(H(t,e))})),J("Set",u.call(e),ut,G)}if(function(t){if(!h||!t||"object"!=typeof t)return!1;try{h.call(t,h);try{f.call(t,f)}catch(t){return!0}return t instanceof WeakMap}catch(t){}return!1}(e))return X("WeakMap");if(function(t){if(!f||!t||"object"!=typeof t)return!1;try{f.call(t,f);try{h.call(t,h)}catch(t){return!0}return t instanceof WeakSet}catch(t){}return!1}(e))return X("WeakSet");if(function(t){if(!p||!t||"object"!=typeof t)return!1;try{return p.call(t),!0}catch(t){}return!1}(e))return X("WeakRef");if(function(t){return!("[object Number]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(Number(e)));if(function(t){if(!t||"object"!=typeof t||!_)return!1;try{return _.call(t),!0}catch(t){}return!1}(e))return Y(H(_.call(e)));if(function(t){return!("[object Boolean]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(d.call(e));if(function(t){return!("[object String]"!==W(t)||U&&"object"==typeof t&&U in t)}(e))return Y(H(String(e)));if("undefined"!=typeof window&&e===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&e===globalThis||void 0!==r.g&&e===r.g)return"{ [object globalThis] }";if(!function(t){return!("[object Date]"!==W(t)||U&&"object"==typeof t&&U in t)}(e)&&!V(e)){var lt=Z(e,H),ht=k?k(e)===Object.prototype:e instanceof Object||e.constructor===Object,ft=e instanceof Object?"":"null prototype",pt=!ht&&U&&Object(e)===e&&U in e?b.call(W(e),8,-1):ft?"Object":"",dt=(ht||"function"!=typeof e.constructor?"":e.constructor.name?e.constructor.name+" ":"")+(pt||ft?"["+S.call(A.call([],pt||[],ft||[]),": ")+"] ":"");return 0===lt.length?dt+"{}":G?dt+"{"+Q(lt,G)+"}":dt+"{ "+S.call(lt,", ")+" }"}return String(e)};var G=Object.prototype.hasOwnProperty||function(t){return t in this};function z(t,e){return G.call(t,e)}function W(t){return y.call(t)}function K(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return q(b.call(t,0,e.maxStringLength),e)+n}return P(v.call(v.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,H),"single",e)}function H(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+E.call(e.toString(16))}function Y(t){return"Object("+t+")"}function X(t){return t+" { ? }"}function J(t,e,r,n){return t+" ("+e+") {"+(n?Q(r,n):S.call(r,", "))+"}"}function Q(t,e){if(0===t.length)return"";var r="\n"+e.prev+e.base;return r+S.call(t,","+r)+"\n"+e.prev}function Z(t,e){var r=M(t),n=[];if(r){n.length=t.length;for(var i=0;i{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(3474),a=Object.prototype.propertyIsEnumerable,c=!a.call({toString:null},"toString"),u=a.call((function(){}),"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],h=function(t){var e=t.constructor;return e&&e.prototype===t},f={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if("undefined"==typeof window)return!1;for(var t in window)try{if(!f["$"+t]&&i.call(window,t)&&null!==window[t]&&"object"==typeof window[t])try{h(window[t])}catch(t){return!0}}catch(t){return!0}return!1}();n=function(t){var e=null!==t&&"object"==typeof t,r="[object Function]"===o.call(t),n=s(t),a=e&&"[object String]"===o.call(t),f=[];if(!e&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var d=u&&r;if(a&&t.length>0&&!i.call(t,0))for(var y=0;y0)for(var g=0;g{"use strict";var n=Array.prototype.slice,i=r(3474),o=Object.keys,s=o?function(t){return o(t)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var t=function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2);t||(Object.keys=function(t){return i(t)?a(n.call(t)):a(t)})}else Object.keys=s;return Object.keys||s},t.exports=s},3474:t=>{"use strict";var e=Object.prototype.toString;t.exports=function(t){var r=e.call(t),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Function]"===e.call(t.callee)),n}},6578:t=>{"use strict";t.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},5606:t=>{var e,r,n=t.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===i||!e)&&setTimeout)return e=setTimeout,setTimeout(t,0);try{return e(t,0)}catch(r){try{return e.call(null,t,0)}catch(r){return e.call(this,t,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:i}catch(t){e=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(t){r=o}}();var a,c=[],u=!1,l=-1;function h(){u&&a&&(u=!1,a.length?c=a.concat(c):l=-1,c.length&&f())}function f(){if(!u){var t=s(h);u=!0;for(var e=c.length;e;){for(a=c,c=[];++l1)for(var r=1;r{let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:r.g):t=>(n||(n=Promise.resolve())).then(t).catch((t=>setTimeout((()=>{throw t}),0)))},5372:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let i,o,s,a,c,u,l=!0;function h(t){function e(){r&&r(t,i),r=null}l?n(e):e()}function f(e,r,n){if(i[e]=n,r&&(c=!0),0==--s||r)h(r);else if(!c&&u{"use strict";var n=r(453)("%Array.prototype.concat%"),i=r(487),o=r(8075)("Array.prototype.slice"),s=r(1333)()&&Symbol.isConcatSpreadable,a=[],c=s?i.apply(n,a):null,u=s?r(4634):null;t.exports=s?function(t){for(var e=0;e{"use strict";var n=r(8075),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);t.exports=function(t){if(!i(t))throw new s("`regex` must be a RegExp");return function(e){return null!==o(t,e)}}},6897:(t,e,r)=>{"use strict";var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),c=n("%Math.floor%");t.exports=function(t,e){if("function"!=typeof t)throw new a("`fn` is not a function");if("number"!=typeof e||e<0||e>4294967295||c(e)!==e)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in t&&s){var l=s(t,"length");l&&!l.configurable&&(n=!1),l&&!l.writable&&(u=!1)}return(n||u||!r)&&(o?i(t,"length",e,!0,!0):i(t,"length",e)),t}},8206:(t,e,r)=>{"use strict";var n=r(5388),i=r(4810),o=r(8075)("String.prototype.replace"),s=/^\s$/.test("᠎"),a=s?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,c=s?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;t.exports=function(){var t=i(n(this));return o(o(t,a,""),c,"")}},214:(t,e,r)=>{"use strict";var n=r(487),i=r(8452),o=r(5388),s=r(8206),a=r(4895),c=r(9377),u=n(a()),l=function(t){return o(t),u(t)};i(l,{getPolyfill:a,implementation:s,shim:c}),t.exports=l},4895:(t,e,r)=>{"use strict";var n=r(8206);t.exports=function(){return String.prototype.trim&&"​"==="​".trim()&&"᠎"==="᠎".trim()&&"_᠎"==="_᠎".trim()&&"᠎_"==="᠎_".trim()?String.prototype.trim:n}},9377:(t,e,r)=>{"use strict";var n=r(8452),i=r(4895);t.exports=function(){var t=i();return n(String.prototype,{trim:t},{trim:function(){return String.prototype.trim!==t}}),t}},1093:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,i)=>(e.ngramLengths.forEach((e=>{var o=i.slice(n,n+e);o.length===e&&(r=JSON.stringify(o),t[r]=t[r]||[],t[r].push(n))})),t)),{});return Object.keys(r).map((t=>({term:JSON.parse(t),positions:r[t]}))).sort(((t,e)=>t.term[0]>e.term[0]))}},6623:(t,e,r)=>{"use strict";var n=r(5767),i=r(3432),o=r(5795);function s(t){return Object.prototype.toString.call(t)}var a=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function c(t,e){if(t.forEach)return t.forEach(e);for(var r=0;r2?arguments[2]:y,l=s.includeSymbols?f:u,h=!!s.immutable;return function t(u){var f=h?d(u,s):u,y={},g=!0,m={node:f,node_:u,path:[].concat(r),parent:n[n.length-1],parents:n,key:r[r.length-1],isRoot:0===r.length,level:r.length,circular:null,update:function(t,e){m.isRoot||(m.parent.node[m.key]=t),m.node=t,e&&(g=!1)},delete:function(t){delete m.parent.node[m.key],t&&(g=!1)},remove:function(t){a(m.parent.node)?m.parent.node.splice(m.key,1):delete m.parent.node[m.key],t&&(g=!1)},keys:null,before:function(t){y.before=t},after:function(t){y.after=t},pre:function(t){y.pre=t},post:function(t){y.post=t},stop:function(){i=!1},block:function(){g=!1}};if(!i)return m;function b(){if("object"==typeof m.node&&null!==m.node){m.keys&&m.node_===m.node||(m.keys=l(m.node)),m.isLeaf=0===m.keys.length;for(var t=0;t1?arguments[1]:y,this.value=t}function b(t){return new m(t,arguments.length>1?arguments[1]:y)}m.prototype.get=function(t){for(var e=this.value,r=0;e&&r{"use strict";var n=r(9675),i=r(8075)("TypedArray.prototype.buffer",!0),o=r(5680);t.exports=i||function(t){if(!o(t))throw new n("Not a Typed Array");return t.buffer}},2308:(t,e,r)=>{"use strict";var n=r(2682),i=r(487),o=r(9209)(),s={},a=r(24)(),c=r(5795),u=Object.defineProperty;if(c){var l=function(t){return t.byteOffset};n(o,(function(t){if("function"==typeof r.g[t]||"object"==typeof r.g[t]){var e=r.g[t].prototype,n=c(e,"byteOffset");if(!n&&a){var o=e.__proto__;n=c(o,"byteOffset")}if(n&&n.get)s[t]=i(n.get);else if(u){var h=new r.g[t](2);(n=c(h,"byteOffset"))&&n.configurable&&u(h,"length",{value:3}),2===h.length&&(s[t]=l)}}}))}var h=r(5680);t.exports=function(t){return!!h(t)&&function(t){var e;return n(s,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},6058:(t,e,r)=>{"use strict";var n=r(487),i=r(2682),o=r(5795),s=r(24)(),a=r(5680),c=r(6578),u={__proto__:null},l=Object.defineProperty;if(o){var h=function(t){return t.length};i(c,(function(t){var e=r.g[t];if("function"==typeof e||"object"==typeof e){var i=e.prototype,a=o(i,"length");if(!a&&s){var c=i.__proto__;a=o(c,"length")}if(a&&a.get)u["$"+t]=n(a.get);else if(l){var f=new r.g[t](2);(a=o(f,"length"))&&a.configurable&&l(f,"length",{value:3}),2===f.length&&(u["$"+t]=h)}}}))}t.exports=function(t){return!!a(t)&&function(t){var e;return i(u,(function(r){if("number"!=typeof e)try{var n=r(t);"number"==typeof n&&(e=n)}catch(t){}})),e}(t)}},8268:(t,e,r)=>{"use strict";var n=r(9675),i=r(280),o=r(2282),s=r(5910),a=r(4470),c=r(1752),u=r(2076),l=r(2138),h=r(7196),f=r(4810),p=r(4742),d=r(6419),y=r(7057),g=r(1509),m=r(4372),b=r(2308);t.exports=function(t,e){var r=this;g(r,"SEQ-CST");var v,E=r.length,w=h(t);v=w===-1/0?0:w<0?a(E+w,0):c(w,E);var T,A=void 0===e?E:h(e);T=A===-1/0?0:A<0?a(E+A,0):c(A,E);var S=a(T-v,0),O=y(r,[S]);if(S>0){if(s(m(r)))throw new n("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");if(d(r)===d(O))for(var I=m(r),_=m(O),L=p(r),x=v*L+b(r),N=b(O),U=N+S*L;N{"use strict";var n=r(8452),i=r(487),o=r(8268),s=r(2521),a=r(8599),c=i(s());n(c,{getPolyfill:s,implementation:o,shim:a}),t.exports=c},2521:(t,e,r)=>{"use strict";var n=r(8268);t.exports=function(){return"function"==typeof Uint8Array&&Uint8Array.prototype.slice||n}},8599:(t,e,r)=>{"use strict";var n=r(8452),i=r(6763),o=r(2521);t.exports=function(){if("function"==typeof Uint8Array){var t=o(),e=i(Uint8Array.prototype);n(e,{slice:t},{slice:function(){return e.slice!==t}})}return t}},5767:(t,e,r)=>{"use strict";var n=r(2682),i=r(9209),o=r(487),s=r(8075),a=r(5795),c=s("Object.prototype.toString"),u=r(9092)(),l="undefined"==typeof globalThis?r.g:globalThis,h=i(),f=s("String.prototype.slice"),p=Object.getPrototypeOf,d=s("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1?e:"Object"===e&&function(t){var e=!1;return n(y,(function(r,n){if(!e)try{r(t),e=f(n,1)}catch(t){}})),e}(t)}return a?function(t){var e=!1;return n(y,(function(r,n){if(!e)try{"$"+r(t)===n&&(e=f(n,1))}catch(t){}})),e}(t):null}},2634:()=>{},9209:(t,e,r)=>{"use strict";var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(9675),i=r(5910),o=r(4670),s=r(7070),a=r(9511);t.exports=function(t,e){var r=s(t);if(!o(t)&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(i(t))throw new n("Assertion failed: `arrayBuffer` must not be detached");return a(t)}},9969:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9290),o=r(9675),s=n&&n(0);t.exports=function(t,e){if("bigint"!=typeof t||"bigint"!=typeof e)throw new o("Assertion failed: `n` and `d` arguments must be BigInts");if(e===s)throw new i("Division by zero");return t===s?s:t%e}},893:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(4769),s=r(7030),a=r(8131),c=r(3400),u=r(2875),l=r(259),h=r(7730);t.exports=function(t,e,r){if("Object"!==h(t))throw new n("Assertion failed: Type(O) is not Object");if(!c(e))throw new n("Assertion failed: IsPropertyKey(P) is not true");var f=i(r)?r:l(r);if(!i(f))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return o(a,u,s,t,e,f)}},7030:(t,e,r)=>{"use strict";var n=r(9675),i=r(5701),o=r(2997);t.exports=function(t){if(void 0!==t&&!i(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return o(t)}},280:(t,e,r)=>{"use strict";var n=r(9675),i=r(8859),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: Type(O) is not Object");if(!o(e))throw new n("Assertion failed: IsPropertyKey(P) is not true, got "+i(e));return t[e]}},2282:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(8075)("Array.prototype.slice"),c=r(1087),u=r(5910),l=r(6167),h=r(4670),f=r(7070),p=r(4399),d=r(4097),y=r(5100);t.exports=function(t,e,r,n,g){var m=f(t);if(!h(t)&&!m)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!c(e))throw new o("Assertion failed: `byteIndex` must be an integer");if("string"!=typeof r||"number"!=typeof d.size["$"+r])throw new o("Assertion failed: `type` must be a Typed Array element type");if("boolean"!=typeof n)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==g&&"UNORDERED"!==g)throw new o("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&"boolean"!=typeof arguments[5])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: `arrayBuffer` is detached");if(e<0)throw new o("Assertion failed: `byteIndex` must be non-negative");var b,v=d.size["$"+r];if(!v)throw new o('Assertion failed: `type` must be one of "INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"');if(m)throw new i("SharedArrayBuffer is not supported by this implementation");b=a(new s(t,e),0,v);var E=arguments.length>5?arguments[5]:"little"===y,w=E?a(p([0,0,0,0,0,0,0,0],b),-v):a(p(b,[0,0,0,0,0,0,0,0]),0,v);return l(r,w,E)}},2491:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(3400),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!o(e))throw new n("Assertion failed: `P` must be a Property Key");return i(t,e)}},533:(t,e,r)=>{"use strict";t.exports=r(1412)},7881:t=>{"use strict";t.exports=function(t){return"BIGUINT64"===t||"BIGINT64"===t}},6966:(t,e,r)=>{"use strict";t.exports=r(9600)},4528:(t,e,r)=>{"use strict";var n=r(1376)("%Reflect.construct%",!0),i=r(893);try{i({},"",{"[[Get]]":function(){}})}catch(t){i=null}if(i&&n){var o={},s={};i(s,"length",{"[[Get]]":function(){throw o},"[[Enumerable]]":!0}),t.exports=function(t){try{n(t,s)}catch(t){return t===o}}}else t.exports=function(t){return"function"==typeof t&&!!t.prototype}},8131:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o=r(5701);t.exports=function(t){if(void 0===t)return!1;if(!o(t))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!i(t,"[[Value]]")&&!i(t,"[[Writable]]"))}},5910:(t,e,r)=>{"use strict";var n=r(9675),i=r(9511),o=r(9209)(),s=r(8075),a=r(4670),c=r(7070),u=s("SharedArrayBuffer.prototype.byteLength",!0);t.exports=function(t){var e=c(t);if(!a(t)&&!e)throw new n("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if(0===(e?u:i)(t))try{new r.g[o[0]](t)}catch(t){return!!t&&"TypeError"===t.name}return!1}},6575:(t,e,r)=>{"use strict";var n=r(9675),i=r(8075),o=i("%ArrayBuffer.prototype.resizable%",!0),s=i("%SharedArrayBuffer.prototype.growable%",!0),a=r(4670),c=r(7070);t.exports=function(t){var e=a(t),r=c(t);if(!e&&!r)throw new n("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return e&&o?!o(t):!r||!s||!s(t)}},3400:t=>{"use strict";t.exports=function(t){return"string"==typeof t||"symbol"==typeof t}},5291:(t,e,r)=>{"use strict";var n=r(9675),i=r(5910),o=r(4742),s=r(9346),a=r(4372),c=r(2308),u=r(6058);t.exports=function(t){if(!s(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var e=t["[[Object]]"],r=t["[[CachedBufferByteLength]]"];if(i(a(e))&&"DETACHED"!==r)throw new n("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if("DETACHED"===r)return!0;var l,h=c(e),f=u(e);return l="AUTO"===f?r:h+f*o(e),h>r||l>r}},9373:t=>{"use strict";t.exports=function(t){return"UINT8"===t||"UINT8C"===t||"UINT16"===t||"UINT32"===t||"BIGUINT64"===t}},6681:(t,e,r)=>{"use strict";var n=r(9675),i=r(7149),o=r(5910),s=r(5680),a=r(4372);t.exports=function(t,e){if(!s(t))throw new n("Assertion failed: `obj` must be a Typed Array");if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var r=a(t);return{"[[Object]]":t,"[[CachedBufferByteLength]]":o(r)?"DETACHED":i(r,e)}}},5015:(t,e,r)=>{"use strict";var n=r(9675),i=r(2491),o=r(3446),s=r(9887),a=r(3557),c=r(2475),u=r(7088),l=r(172),h=r(4770),f=r(6039),p=r(9308),d=r(2779),y=r(8894),g=r(4751),m=r(1189),b={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8},v={__proto__:null,INT8:u,UINT8:f,UINT8C:p,INT16:a,UINT16:l,INT32:c,UINT32:h,BIGINT64:o,BIGUINT64:s};t.exports=function(t,e,r){if("string"!=typeof t||!i(b,t))throw new n("Assertion failed: `type` must be a TypedArray element type: "+m(b));if("number"!=typeof e&&"bigint"!=typeof e)throw new n("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof r)throw new n("Assertion failed: `isLittleEndian` must be a Boolean");if("FLOAT32"===t)return d(e,r);if("FLOAT64"===t)return y(e,r);var o=b[t],s=(0,v[t])(e);return g(s,o,r)}},6167:(t,e,r)=>{"use strict";var n=r(453),i=r(8075),o=r(9290),s=r(8068),a=r(9675),c=n("%BigInt%",!0),u=r(2491),l=r(533),h=r(7881),f=r(9373),p=r(4915),d=r(8968),y=r(6570),g=r(4138),m=r(2158),b=i("Array.prototype.reverse"),v=i("Array.prototype.slice"),E=r(1189),w={__proto__:null,INT8:1,UINT8:1,UINT8C:1,INT16:2,UINT16:2,INT32:4,UINT32:4,BIGINT64:8,BIGUINT64:8,FLOAT32:4,FLOAT64:8};t.exports=function(t,e,r){if(!u(w,t))throw new a("Assertion failed: `type` must be a TypedArray element type: "+E(w));if(!l(e)||!g(e,m))throw new a("Assertion failed: `rawBytes` must be an Array of bytes");if("boolean"!=typeof r)throw new a("Assertion failed: `isLittleEndian` must be a Boolean");var n=w[t];if(e.length!==n)throw new o("Assertion failed: `rawBytes` must have a length of "+n+" for type "+t);var i=h(t);if(i&&!c)throw new s("this environment does not support BigInts");return e=v(e,0,n),r||b(e),"FLOAT32"===t?p(e):"FLOAT64"===t?d(e):y(e,n,f(t),i)}},2875:(t,e,r)=>{"use strict";var n=r(8756);t.exports=function(t,e){return t===e?0!==t||1/t==1/e:n(t)&&n(e)}},2076:(t,e,r)=>{"use strict";var n=r(9675),i=r(3400),o=r(2875),s=r(7730),a=function(){try{return delete[].length,!0}catch(t){return!1}}();t.exports=function(t,e,r,c){if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!i(e))throw new n("Assertion failed: `P` must be a Property Key");if("boolean"!=typeof c)throw new n("Assertion failed: `Throw` must be a Boolean");if(c){if(t[e]=r,a&&!o(t[e],r))throw new n("Attempted to assign to readonly property.");return!0}try{return t[e]=r,!a||o(t[e],r)}catch(t){return!1}}},2138:(t,e,r)=>{"use strict";var n=r(453),i=r(8068),o=r(9675),s=n("%Uint8Array%",!0),a=r(1087),c=r(7881),u=r(5910),l=r(5015),h=r(4670),f=r(7070),p=r(9957),d=r(4097),y=r(5100),g=r(3795);t.exports=function(t,e,r,n,m,b){var v=f(t);if(!h(t)&&!v)throw new o("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!a(e)||e<0)throw new o("Assertion failed: `byteIndex` must be a non-negative integer");if("string"!=typeof r||!p(d.size,"$"+r))throw new o("Assertion failed: `type` must be a Typed Array Element Type");if("number"!=typeof n&&"bigint"!=typeof n)throw new o("Assertion failed: `value` must be a Number or a BigInt");if("boolean"!=typeof m)throw new o("Assertion failed: `isTypedArray` must be a boolean");if("SEQ-CST"!==b&&"UNORDERED"!==b&&"INIT"!==b)throw new o('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("Assertion failed: `isLittleEndian` must be a boolean, if present");if(u(t))throw new o("Assertion failed: ArrayBuffer is detached");if(c(r)?"bigint"!=typeof n:"number"!=typeof n)throw new o("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var E=d.size["$"+r],w=l(r,n,arguments.length>6?arguments[6]:"little"===y);if(v)throw new i("SharedArrayBuffer is not supported by this implementation");var T=new s(t,e,E);g(w,(function(t,e){T[e]=t}))}},7732:(t,e,r)=>{"use strict";var n=r(453)("%Symbol.species%",!0),i=r(9675),o=r(4528),s=r(7730);t.exports=function(t,e){if("Object"!==s(t))throw new i("Assertion failed: Type(O) is not Object");var r=t.constructor;if(void 0===r)return e;if("Object"!==s(r))throw new i("O.constructor is not an Object");var a=n?r[n]:void 0;if(null==a)return e;if(o(a))return a;throw new i("no constructor found")}},9693:(t,e,r)=>{"use strict";var n=r(453)("%BigInt%",!0),i=r(9675),o=r(8068);t.exports=function(t){if("string"!=typeof t)throw new i("`argument` must be a string");if(!n)throw new o("BigInts are not supported in this environment");try{return n(t)}catch(t){return}}},8679:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%RegExp%"),s=r(9675),a=n("%parseInt%"),c=r(8075),u=r(9721),l=c("String.prototype.slice"),h=u(/^0b[01]+$/i),f=u(/^0o[0-7]+$/i),p=u(/^[-+]0x[0-9a-f]+$/i),d=u(new o("["+["…","​","￾"].join("")+"]","g")),y=r(214);t.exports=function t(e){if("string"!=typeof e)throw new s("Assertion failed: `argument` is not a String");if(h(e))return i(a(l(e,2),2));if(f(e))return i(a(l(e,2),8));if(d(e)||p(e))return NaN;var r=y(e);return r!==e?t(r):i(e)}},2964:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Number%"),s=r(9675),a=r(8068),c=r(9693),u=r(866);t.exports=function(t){if(!i)throw new a("BigInts are not supported in this environment");var e=u(t,o);if(null==e)throw new s("Cannot convert null or undefined to a BigInt");if("boolean"==typeof e)return i(e?1:0);if("number"==typeof e)throw new s("Cannot convert a Number value to a BigInt");if("string"==typeof e){var r=c(e);if(void 0===r)throw new s("Failed to parse String to BigInt");return r}if("symbol"==typeof e)throw new s("Cannot convert a Symbol value to a BigInt");if("bigint"!=typeof e)throw new a("Assertion failed: unknown primitive type");return e}},3446:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,31)),l=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t),r=c(a,e,l);return r>=u?r-l:r}},9887:(t,e,r)=>{"use strict";var n=r(453),i=n("%BigInt%",!0),o=n("%Math.pow%"),s=r(2964),a=r(9969),c=r(122),u=i&&BigInt(o(2,32))*BigInt(o(2,32));t.exports=function(t){var e=s(t);return c(a,e,u)}},4323:t=>{"use strict";t.exports=function(t){return!!t}},3557:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return a>=32768?a-65536:a}},2475:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046),a=4294967296;t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),c=n(r,a),u=c>=2147483648?c-a:c;return 0===u?0:u}},7088:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,256);return a>=128?a-256:a}},7196:(t,e,r)=>{"use strict";var n=r(8410),i=r(3384),o=r(8756),s=r(5046);t.exports=function(t){var e=n(t);return o(e)||0===e?0:s(e)?i(e):e}},8410:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Number%"),s=r(6600),a=r(866),c=r(8679);t.exports=function(t){var e=s(t)?t:a(t,o);if("symbol"==typeof e)throw new i("Cannot convert a Symbol value to a number");if("bigint"==typeof e)throw new i("Conversion from 'BigInt' to 'number' is not allowed.");return"string"==typeof e?c(e):o(e)}},866:(t,e,r)=>{"use strict";var n=r(5437);t.exports=function(t){return arguments.length>1?n(t,arguments[1]):n(t)}},259:(t,e,r)=>{"use strict";var n=r(9957),i=r(9675),o=r(7730),s=r(4323),a=r(6966);t.exports=function(t){if("Object"!==o(t))throw new i("ToPropertyDescriptor requires an object");var e={};if(n(t,"enumerable")&&(e["[[Enumerable]]"]=s(t.enumerable)),n(t,"configurable")&&(e["[[Configurable]]"]=s(t.configurable)),n(t,"value")&&(e["[[Value]]"]=t.value),n(t,"writable")&&(e["[[Writable]]"]=s(t.writable)),n(t,"get")){var r=t.get;if(void 0!==r&&!a(r))throw new i("getter must be a function");e["[[Get]]"]=r}if(n(t,"set")){var c=t.set;if(void 0!==c&&!a(c))throw new i("setter must be a function");e["[[Set]]"]=c}if((n(e,"[[Get]]")||n(e,"[[Set]]"))&&(n(e,"[[Value]]")||n(e,"[[Writable]]")))throw new i("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e}},4810:(t,e,r)=>{"use strict";var n=r(453)("%String%"),i=r(9675);t.exports=function(t){if("symbol"==typeof t)throw new i("Cannot convert a Symbol value to a string");return n(t)}},172:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,65536);return 0===a?0:a}},4770:(t,e,r)=>{"use strict";var n=r(4224),i=r(8410),o=r(3384),s=r(5046);t.exports=function(t){var e=i(t);if(!s(e)||0===e)return 0;var r=o(e),a=n(r,4294967296);return 0===a?0:a}},6039:(t,e,r)=>{"use strict";var n=r(5046),i=r(4224),o=r(8410),s=r(3384);t.exports=function(t){var e=o(t);if(!n(e)||0===e)return 0;var r=s(e);return i(r,256)}},9308:(t,e,r)=>{"use strict";var n=r(9719),i=r(8410),o=r(5986),s=r(8756);t.exports=function(t){var e=i(t);if(s(e))return 0;var r=n(e,0,255),a=o(r);return ra+.5?a+1:a%2==0?a:a+1}},7730:(t,e,r)=>{"use strict";var n=r(2439);t.exports=function(t){return"symbol"==typeof t?"Symbol":"bigint"==typeof t?"BigInt":n(t)}},9531:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(533),s=r(4528),a=r(5291),c=r(9271),u=r(1509),l=r(9209)();t.exports=function(t,e){if(!s(t))throw new i("Assertion failed: `constructor` must be a constructor");if(!o(e))throw new i("Assertion failed: `argumentList` must be a List");if(0===l.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r;r=0===e.length?new t:1===e.length?new t(e[0]):2===e.length?new t(e[0],e[1]):new t(e[0],e[1],e[2]);var h=u(r,"SEQ-CST");if(1===e.length&&"number"==typeof e[0]){if(a(h))throw new i("new Typed Array is out of bounds");if(c(h){"use strict";var n=r(8068),i=r(9675),o=r(1087),s=r(5767),a=r(4097);t.exports=function(t){var e=s(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=a.size["$"+a.name["$"+e]];if(!o(r)||r<0)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},6419:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(4097);t.exports=function(t){var e=o(t);if(!1===e)throw new i("Assertion failed: `O` must be a TypedArray");var r=s.name["$"+e];if("string"!=typeof r)throw new n("Assertion failed: Unknown TypedArray type `"+e+"`");return r}},9271:(t,e,r)=>{"use strict";var n=r(9675),i=r(5986),o=r(6575),s=r(5291),a=r(4742),c=r(9346),u=r(4372),l=r(2308),h=r(6058);t.exports=function(t){if(!c(t))throw new n("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(s(t))throw new n("Assertion failed: `taRecord` is out of bounds");var e=t["[[Object]]"],r=h(e);if("AUTO"!==r)return r;if(o(u(e)))throw new n("Assertion failed: array buffer is not fixed length");var f=l(e),p=a(e),d=t["[[CachedBufferByteLength]]"];if("DETACHED"===d)throw new n("Assertion failed: typed array is detached");return i((d-f)/p)}},7057:(t,e,r)=>{"use strict";var n=r(8068),i=r(9675),o=r(5767),s=r(9209)(),a=r(533),c=r(7732),u=r(9531),l=r(2697);t.exports=function(t,e){if(0===s.length)throw new n("Assertion failed: Typed Arrays are not supported in this environment");var r=o(t);if(!r)throw new i("Assertion failed: exemplar must be a TypedArray");if(!a(e))throw new i("Assertion failed: `argumentList` must be a List");var h=l(r);if("function"!=typeof h)throw new n("Assertion failed: `constructor` of `exemplar` ("+r+") must exist. Please report this!");var f=c(t,h);return u(f,e)}},1509:(t,e,r)=>{"use strict";var n=r(9675),i=r(5291),o=r(6681),s=r(7730),a=r(5680);t.exports=function(t,e){if("SEQ-CST"!==e&&"UNORDERED"!==e)throw new n("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if("Object"!==s(t))throw new n("Assertion failed: `O` must be an Object");if(!a(t))throw new n("Assertion failed: `O` must be a Typed Array");var r=o(t,e);if(i(r))throw new n("`O` must be in-bounds and backed by a non-detached buffer");return r}},9719:(t,e,r)=>{"use strict";var n=r(453),i=r(9675),o=n("%Math.max%"),s=n("%Math.min%");t.exports=function(t,e,r){if("number"!=typeof t||"number"!=typeof e||"number"!=typeof r||!(e<=r))throw new i("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return s(o(e,t),r)}},5986:t=>{"use strict";var e=Math.floor;t.exports=function(t){return"bigint"==typeof t?t:e(t)}},4470:(t,e,r)=>{"use strict";var n=r(453);t.exports=n("%Math.max%")},1752:(t,e,r)=>{"use strict";var n=r(453);t.exports=n("%Math.min%")},4224:(t,e,r)=>{"use strict";var n=r(113);t.exports=function(t,e){return n(t,e)}},4097:t=>{"use strict";t.exports={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8}}},3384:(t,e,r)=>{"use strict";var n=r(5986),i=r(9675);t.exports=function(t){if("number"!=typeof t&&"bigint"!=typeof t)throw new i("argument must be a Number or a BigInt");var e=t<0?-n(-t):n(t);return 0===e?0:e}},2439:t=>{"use strict";t.exports=function(t){return null===t?"Null":void 0===t?"Undefined":"function"==typeof t||"object"==typeof t?"Object":"number"==typeof t?"Number":"boolean"==typeof t?"Boolean":"string"==typeof t?"String":void 0}},1376:(t,e,r)=>{"use strict";t.exports=r(453)},4769:(t,e,r)=>{"use strict";var n=r(592),i=r(655),o=n.hasArrayLengthDefineBug(),s=o&&r(1412),a=r(8075)("Object.prototype.propertyIsEnumerable");t.exports=function(t,e,r,n,c,u){if(!i){if(!t(u))return!1;if(!u["[[Configurable]]"]||!u["[[Writable]]"])return!1;if(c in n&&a(n,c)!==!!u["[[Enumerable]]"])return!1;var l=u["[[Value]]"];return n[c]=l,e(n[c],l)}return o&&"length"===c&&"[[Value]]"in u&&s(n)&&n.length!==u["[[Value]]"]?(n.length=u["[[Value]]"],n.length===u["[[Value]]"]):(i(n,c,r(u)),!0)}},1412:(t,e,r)=>{"use strict";var n=r(453)("%Array%"),i=!n.isArray&&r(8075)("Object.prototype.toString");t.exports=n.isArray||function(t){return"[object Array]"===i(t)}},4915:(t,e,r)=>{"use strict";var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[3]?-1:1,r=(127&t[3])<<1|t[2]>>7,i=(127&t[2])<<16|t[1]<<8|t[0];return 0===r&&0===i?1===e?0:-0:255===r&&0===i?1===e?1/0:-1/0:255===r&&0!==i?NaN:-127==(r-=127)?e*i*n(2,-149):e*(1+i*n(2,-23))*n(2,r)}},8968:(t,e,r)=>{"use strict";var n=r(453)("%Math.pow%");t.exports=function(t){var e=128&t[7]?-1:1,r=(127&t[7])<<4|(240&t[6])>>4,i=281474976710656*(15&t[6])+1099511627776*t[5]+4294967296*t[4]+16777216*t[3]+65536*t[2]+256*t[1]+t[0];return 0===r&&0===i?0*e:2047===r&&0!==i?NaN:2047===r&&0===i?e*(1/0):-1023==(r-=1023)?e*i*5e-324:e*(1+i/4503599627370496)*n(2,r)}},6570:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.pow%"),o=n("%Number%"),s=n("%BigInt%",!0);t.exports=function(t,e,r,n){for(var a=n?s:o,c=a(0),u=0;u{"use strict";var n=r(453),i=n("%Uint8Array%",!0),o=n("%Uint32Array%",!0),s=r(4372),a=o&&new o([305419896]),c=a&&new i(s(a));t.exports=c?120===c[0]?"little":18===c[0]?"big":52===c[0]?"mixed":"unknown":"indeterminate"},4138:t=>{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";t.exports=function(t,e){for(var r=0;r{"use strict";var e=1075;t.exports=function(t){var r="";if(0===t)return r;for(var n,i=e,o=0;o=1?(t=n-1,r+="1",i===e&&(i=o)):(t=n,r+="0"),1===n||o-i>54)return r;return r}},2997:t=>{"use strict";t.exports=function(t){if(void 0===t)return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e}},6763:(t,e,r)=>{"use strict";var n=r(453)("%Object.getPrototypeOf%",!0),i=r(24)();t.exports=n||(i?function(t){return t.__proto__}:null)},8213:(t,e,r)=>{"use strict";var n=r(453)("%Math.floor%");t.exports=function(t){for(var e,r="";t>0;)r=(e=t/2)===(t=n(e))?"0"+r:"1"+r;return r}},4751:(t,e,r)=>{"use strict";var n=r(453),i=n("%Number%"),o=n("%BigInt%",!0);t.exports=function(t,e,r){var n="bigint"==typeof t?o:i;t<0&&(t>>>=0);for(var s=[],a=0;a>=n(8);return s}},2158:t=>{"use strict";t.exports=function(t){return"number"==typeof t&&t>=0&&t<=255&&(0|t)===t}},5046:(t,e,r)=>{"use strict";var n=r(8756);t.exports=function(t){return("number"==typeof t||"bigint"==typeof t)&&!n(t)&&t!==1/0&&t!==-1/0}},1087:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=r(8756),a=r(5046);t.exports=function(t){if("number"!=typeof t||s(t)||!a(t))return!1;var e=i(t);return o(e)===e}},8756:t=>{"use strict";t.exports=Number.isNaN||function(t){return t!=t}},3508:t=>{"use strict";t.exports=function(t){return 0===t&&1/t==-1/0}},6600:t=>{"use strict";t.exports=function(t){return null===t||"function"!=typeof t&&"object"!=typeof t}},113:t=>{"use strict";var e=Math.floor;t.exports=function(t,r){var n=t%r;return e(n>=0?n:n+r)}},122:t=>{"use strict";t.exports=function(t,e,r){var n=t(e,r);return n>=0?n:n+r}},5701:(t,e,r)=>{"use strict";var n=r(9675),i=r(9957),o={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};t.exports=function(t){if(!t||"object"!=typeof t)return!1;for(var e in t)if(i(t,e)&&!o[e])return!1;var r=i(t,"[[Value]]")||i(t,"[[Writable]]"),s=i(t,"[[Get]]")||i(t,"[[Set]]");if(r&&s)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0}},9346:(t,e,r)=>{"use strict";var n=r(9957),i=r(5680),o=r(1087);t.exports=function(t){return!!t&&"object"==typeof t&&n(t,"[[Object]]")&&n(t,"[[CachedBufferByteLength]]")&&(o(t["[[CachedBufferByteLength]]"])&&t["[[CachedBufferByteLength]]"]>=0||"DETACHED"===t["[[CachedBufferByteLength]]"])&&i(t["[[Object]]"])}},2697:(t,e,r)=>{"use strict";var n=r(453),i={__proto__:null,$Int8Array:n("%Int8Array%",!0),$Uint8Array:n("%Uint8Array%",!0),$Uint8ClampedArray:n("%Uint8ClampedArray%",!0),$Int16Array:n("%Int16Array%",!0),$Uint16Array:n("%Uint16Array%",!0),$Int32Array:n("%Int32Array%",!0),$Uint32Array:n("%Uint32Array%",!0),$BigInt64Array:n("%BigInt64Array%",!0),$BigUint64Array:n("%BigUint64Array%",!0),$Float32Array:n("%Float32Array%",!0),$Float64Array:n("%Float64Array%",!0)};t.exports=function(t){return i["$"+t]}},2779:(t,e,r)=>{"use strict";var n=r(453),i=n("%Math.abs%"),o=n("%Math.floor%"),s=n("%Math.pow%"),a=r(5046),c=r(8756),u=r(3508);t.exports=function(t,e){if(c(t))return e?[0,0,192,127]:[127,192,0,0];var r;if(0===t)return r=u(t)?128:0,e?[0,0,0,r]:[r,0,0,0];if(i(t)>34028234663852886e22||!a(t))return r=t<0?255:127,e?[0,0,128,r]:[r,128,0,0];var n=t<0?1:0;t=i(t);for(var l=0;t>=2;)l+=1,t/=2;for(;t<1;)l-=1,t*=2;var h=t-1;h*=s(2,23)+.5,l+=127;var f=n<<31|(l<<=23)|(h=o(h)),p=255&f,d=255&(f>>=8),y=255&(f>>=8),g=255&(f>>=8);return e?[p,d,y,g]:[g,y,d,p]}},8894:(t,e,r)=>{"use strict";var n=r(453),i=n("%parseInt%"),o=n("%Math.abs%"),s=n("%Math.floor%"),a=r(8075),c=a("String.prototype.indexOf"),u=a("String.prototype.slice"),l=r(9154),h=r(8213),f=r(3508),p="11111111111",d="00000000000",y=d+d+d+d+"0000000";t.exports=function(t,e){var r,n,a=t<0||f(t)?"1":"0";if(isNaN(t))r=p,n="1"+y;else if(isFinite(t))if(0===t)r=d,n="0"+y;else{t=o(t);var g,m=s(t),b=h(m),v=l(t-m);if(b)r=b.length-1;else{var E=c(v,"1");E>-1&&(g=E+1),r=-g}n=b+v,r<0?(r<=-1023&&(g=1022),n=u(n,g)):n=u(n,1),r=u(d+h(r+1023),-11),n=u(n+y+"0",0,52)}else r=p,n="0"+y;for(var w=a+r+n,T=[],A=0;A<8;A++)T[e?8-A-1:A]=i(u(w,8*A,8*(A+1)),2);return T}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var n={};(()=>{"use strict";r.r(n),r.d(n,{SearchIndex:()=>Q,UI:()=>Z});var t=r(1093),e=r(8508);const i=([t,e,r])=>Promise.resolve([t.match(r.tokenSplitRegex)||[],e,r]),o=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],s=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),a=([t,e,r])=>{const{fields:n,values:i}=r.replace,o=()=>t.reduce(((t,e)=>[e,...t,...i[e]||[]]),[]);return i?n?n.includes(e)?Promise.resolve([o(),e,r]):Promise.resolve([t,e,r]):Promise.resolve([o(),e,r]):Promise.resolve([t,e,r])},c=([t,r,n])=>{let{fields:i,lengths:o,join:s=" "}=n.ngrams;return i||(i=[r]),o&&i.includes(r)?[(0,e.ngraminator)(t.filter((t=>null!==t)),o).map((t=>t.join(s))),r,n]:Promise.resolve([t,r,n])},u=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],l=([e,r,n])=>{const i=t(e),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>[t.term[0],(t.positions.length/o).toFixed(2)])).sort(),r,n])},h={SPLIT:i,SKIP:o,LOWCASE:s,REPLACE:a,NGRAMS:c,STOPWORDS:u,SCORE_TERM_FREQUENCY:l,SPY:([t,e,r])=>(console.log("----------------"),console.log("field ->"),console.log(e),console.log("tokens ->"),console.log(t),console.log("----------------"),Promise.resolve([t,e,r]))},f=(t,e,r)=>i([t,e,r]).then(o).then(s).then(a).then(c).then(u).then(l).then((([t,e,r])=>t));var p=r(9148),d=r(7007),y=r(9901);function g(t,e){const r=t=>"string"==typeof t,n=async(r,n=t=>new Promise((e=>e(t))))=>new Promise((async(o,a)=>{const c=t=>void 0===t?o(void 0):t instanceof Promise?o(t):void 0;try{c(r),r=e.parse(r),r=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(r),c(r=await(e=>void 0===e?s(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?i(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(r)),c(r=await n(r))}catch(t){return a(t)}return Array.isArray(r)?o(r):o(s(r))})),i=async(t,e)=>Promise.all(t.map((t=>n(t,e)))).then((t=>{const e=t.flat(1/0).reduce(((t,e)=>(e&&t.set(e._id,[...t.get(e._id)||[],e._match]),t)),new Map);return{sumTokensMinusStopwords:t.filter((t=>t)).length,union:Array.from(e.keys()).map((t=>({_id:t,_match:e.get(t)})))}})),o=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(y.HI),["IDX",t,n]},s=t=>new Promise((e=>{if(void 0===t)return e(void 0);const r=new Map;Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0),limit:t.LIMIT,reverse:t.REVERSE}).then((t=>t.forEach((t=>t.value.forEach((e=>r.set(e,[...r.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})])))))))))).then((()=>e(Array.from(r.keys()).map((t=>({_id:t,_match:r.get(t)}))))))})),a=(t,e,r=!0)=>e?0===e.length?[]:(e=new Set(e.map((t=>t._id))),t.map((t=>Object.assign(t,{_id:[...new Set([...t._id].filter((t=>e.has(t))))]}))).filter((t=>!r||t._id.length))):t,c=t=>(t=e.parse(t),n(t).then((e=>({_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE,...t})))),u=e=>t.db.iterator(e).all().then((t=>t.map((([t,e])=>({key:t,value:e}))))),l=(t,r)=>s({...e.parse(t),LIMIT:1,REVERSE:r}).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),h=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>{let r=t.VALUE.LTE;void 0!==t.VALUE.LTE&&"number"!=typeof t.VALUE.LTE&&(r+="○");let n=t.VALUE.GTE;return t.VALUE.GTE&&"number"!=typeof t.VALUE.GTE&&(n+=" "),u({gte:o(e,n),lte:o(e,r,!0),keys:!0,values:!1}).then((t=>t.map((({key:t})=>({FIELD:t[1],VALUE:t[2][0]})))))}))).then((t=>t.flat()))),f=t=>(t=e.parse(t),Promise.all(t.FIELD.map((e=>u({gte:o(e,t.VALUE.GTE),lte:o(e,t.VALUE.LTE,!0)}).then((t=>t.map((t=>({FIELD:t.key[1],VALUE:t.key[2][0],_id:t.value})))))))).then((t=>t.flat()))),p=new Intl.Collator("en",{numeric:!0,sensitivity:"base"});return{AGGREGATE:({BUCKETS:t,FACETS:e,QUERY:r})=>Promise.all([t,e,r]).then((([t=[],e=[],r=[]])=>({BUCKETS:a(t.flat(),r),FACETS:a(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:a,BUCKET:c,BUCKETS:(...t)=>Promise.all(t.map(c)),CREATED:()=>t.db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(h):[h({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),EXIST:(...e)=>Promise.all(e.map((e=>t.db.get([t.docExistsSpace,e]).catch((t=>null))))).then((t=>t.reduce(((t,r,n)=>(null!=r&&t.push(e[n]),t)),[]))),EXPORT:u,FACETS:(...t)=>Promise.all(t.length?t.map(f):[f({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:()=>u({gte:["FIELD",y.LO],lte:["FIELD",y.HI]}).then((t=>t.map((t=>t.key[1])))),GET:n,INTERSECTION:(t,e)=>i(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t.db.get(["~LAST_UPDATED"]),MAX:t=>l(t,!0),MIN:l,OBJECT:e=>Promise.all(e.map((e=>t.db.get(["DOC",e._id]).catch((t=>null))))).then((t=>e.map(((e,r)=>(e._object=t[r],e))))),SET_SUBTRACTION:(t,e)=>Promise.all([r(t)?n(t):t,r(e)?n(e):e]).then((([t,e])=>t.filter((t=>-1===e.map((t=>t._id)).indexOf(t._id))))),SORT:t=>new Promise((e=>e(t.sort(((t,e)=>p.compare(t._id,e._id)))))),UNION:i}}y.LO=null,y.HI=void 0;var m=r(6623);const b=null,v=void 0;class E{availableFields=[];#t;constructor(t){this.#t=t}setAvailableFields=t=>{this.availableFields=t};#e=t=>{const e=t=>this.#t||"string"!=typeof t?t:t.toLowerCase();return{FIELD:t.FIELD.map(e),VALUE:{GTE:e(t.VALUE.GTE),LTE:e(t.VALUE.LTE)}}};parse(t){if(Array.isArray(t))throw new Error("token cannot be Array");if(void 0===t&&(t={}),"string"==typeof t){if(-1===t.indexOf(":"))return this.#e({FIELD:this.availableFields,VALUE:{GTE:t,LTE:t}});const[e,...r]=t.split(":");return this.#e({FIELD:[e],VALUE:{GTE:r.join(":"),LTE:r.join(":")}})}return"number"==typeof t&&(t={VALUE:{GTE:t,LTE:t}}),null===t.VALUE&&(t.VALUE={GTE:null,LTE:null}),"string"!=typeof t.VALUE&&"number"!=typeof t.VALUE||(t.VALUE={GTE:t.VALUE,LTE:t.VALUE}),void 0!==t.VALUE&&Object.keys(t.VALUE).length||(t.VALUE={GTE:b,LTE:v}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=b),void 0===t.VALUE.LTE&&(t.VALUE.LTE=v),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?this.#e({FIELD:this.availableFields,...t}):(t.FIELD=[t.FIELD].flat(),this.#e(t))}}class w{constructor(t={}){t={caseSensitive:!0,isLeaf:t=>"string"==typeof t||"number"==typeof t,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC",db:new t.Level(t.name,{keyEncoding:y,valueEncoding:"json"}),...t};const e=new E(t.caseSensitive),r=new d,n=g(t,e),i=function(t,e,r){let n=0;const i=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const n=[];return m(e._object).forEach((function(e){const i=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"!==i&&!r.doNotIndexField.filter((t=>i.startsWith(t))).length&&t.isLeaf(this.node)){if(!t.stopwords.includes(this.node)){const e=JSON.stringify([i,[this.node].flat(1/0).map((e=>"string"!=typeof e||t.caseSensitive?e:e.toLowerCase()))]);n.push(t.caseSensitive?e:e.toLowerCase())}this.update(this.node,!0)}})),{_id:e._id,keys:n}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(e,r,s,a,c)=>new Promise((u=>{e=e.map((t=>{var e;return t._id=void 0===(e=t._id)?++n:"string"==typeof e||"number"==typeof e?e:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),g(t).EXIST(...e.map((t=>t._id))).then((t=>((t,e,r)=>{const n=Object.keys(t);return Promise.all(n.map((t=>["IDX",...JSON.parse(t)])).map((t=>new Promise(((r,n)=>e.get(t).then(r).catch((t=>r([])))))))).then((e=>e.map(((e,i)=>{const o=new Set(e),s=new Set(t[n[i]]);if("put"===r)return{key:["IDX",...JSON.parse(n[i])],type:r,value:[...new Set([...o,...s])].sort()};if("del"===r){const t=[...new Set([...o].filter((t=>!s.has(t))))];return{key:["IDX",...JSON.parse(n[i])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>i(t,e))).reduce(o,{}))(e,c),r,s).then((n=>r.batch(n.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(e,s):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(n)),(r=>u(e.map((e=>{let r;return"put"===s?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===s&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:a,status:r}})))))))))})),a=()=>(new Date).toISOString(),c=e=>t.db.put(["~LAST_UPDATED"],a()).then((()=>e));return{DELETE:e=>g(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t.db,"del","DELETE",{}))).then(c),IMPORT:r=>t.db.clear().then((()=>t.db.batch(r.map((t=>Object.assign(t,{type:"put"})))))).then((()=>g(t).FIELDS())).then((t=>e.setAvailableFields(t))),PUT:(r,n={})=>s(r.map((t=>({_id:t._id,_object:t}))),t.db,"put","PUT",n).then(c).then((async r=>(e.setAvailableFields(await g(t).FIELDS()),r))),TIMESTAMP:()=>t.db.get(["~CREATED"]).then().catch((e=>t.db.put(["~CREATED"],a()).then(c).then((()=>r.emit("ready"))))),TIMESTAMP_LAST_UPDATED:c}}(t,e,r);i.TIMESTAMP(),this.AGGREGATION_FILTER=n.AGGREGATION_FILTER,this.AND=(t,e)=>n.INTERSECTION(t,e).then(this.flattenMatchArrayInResults),this.BUCKET=n.BUCKET,this.BUCKETS=n.BUCKETS,this.CREATED=n.CREATED,this.DELETE=i.DELETE,this.DISTINCT=n.DISTINCT,this.EVENTS=r,this.EXIST=n.EXIST,this.EXPORT=n.EXPORT,this.FACETS=n.FACETS,this.FIELDS=n.FIELDS,this.GET=(t,e)=>n.GET(t,e).then(this.flattenMatchArrayInResults),this.IMPORT=i.IMPORT,this.LAST_UPDATED=n.LAST_UPDATED,this.MAX=n.MAX,this.MIN=n.MIN,this.NOT=(...t)=>n.SET_SUBTRACTION(...t).then(this.flattenMatchArrayInResults),this.OBJECT=n.OBJECT,this.OR=(t,e)=>n.UNION(t,e).then((t=>t.union)).then(this.flattenMatchArrayInResults),this.PUT=i.PUT,this.SORT=n.SORT,this.STORE=t.db,this.TIMESTAMP_LAST_UPDATED=i.TIMESTAMP_LAST_UPDATED,this.TOKEN_PARSER=e}flattenMatchArrayInResults(t){return void 0===t?void 0:t.map((t=>(t._match=t._match.flat(1/0).map((t=>"string"==typeof t?JSON.parse(t):t)).sort(((t,e)=>t.FIELDe.FIELD?1:t.VALUEe.VALUE?1:t.SCOREe.SCORE?1:0)),t)))}}class T{constructor(t={}){return new w({Level:p.Z,...t})}}var A=r(5606);const S="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,O=new Set,I="object"==typeof A&&A?A:{},_=(t,e,r,n)=>{"function"==typeof I.emitWarning?I.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`)};let L=globalThis.AbortController,x=globalThis.AbortSignal;if(void 0===L){x=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(t,e){this._onabort.push(e)}},L=class{constructor(){e()}signal=new x;abort(t){if(!this.signal.aborted){this.signal.reason=t,this.signal.aborted=!0;for(const e of this.signal._onabort)e(t);this.signal.onabort?.(t)}}};let t="1"!==I.env?.LRU_CACHE_IGNORE_AC_WARNING;const e=()=>{t&&(t=!1,_("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}Symbol("type");const N=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),U=t=>N(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?C:null:null;class C extends Array{constructor(t){super(t),this.fill(0)}}class k{heap;length;static#r=!1;static create(t){const e=U(t);if(!e)return[];k.#r=!0;const r=new k(t,e);return k.#r=!1,r}constructor(t,e){if(!k.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new e(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class D{#n;#i;#o;#s;#a;#c;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#u;#l;#h;#f;#p;#d;#y;#g;#m;#b;#v;#E;#w;#T;#A;#S;#O;static unsafeExposeInternals(t){return{starts:t.#w,ttls:t.#T,sizes:t.#E,keyMap:t.#h,keyList:t.#f,valList:t.#p,next:t.#d,prev:t.#y,get head(){return t.#g},get tail(){return t.#m},free:t.#b,isBackgroundFetch:e=>t.#I(e),backgroundFetch:(e,r,n,i)=>t.#_(e,r,n,i),moveToTail:e=>t.#L(e),indexes:e=>t.#x(e),rindexes:e=>t.#N(e),isStale:e=>t.#U(e)}}get max(){return this.#n}get maxSize(){return this.#i}get calculatedSize(){return this.#l}get size(){return this.#u}get fetchMethod(){return this.#a}get memoMethod(){return this.#c}get dispose(){return this.#o}get disposeAfter(){return this.#s}constructor(t){const{max:e=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:s,allowStale:a,dispose:c,disposeAfter:u,noDisposeOnSet:l,noUpdateTTL:h,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:d,fetchMethod:y,memoMethod:g,noDeleteOnFetchRejection:m,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:E,ignoreFetchAbort:w}=t;if(0!==e&&!N(e))throw new TypeError("max option must be a nonnegative integer");const T=e?U(e):Array;if(!T)throw new Error("invalid max value: "+e);if(this.#n=e,this.#i=f,this.maxEntrySize=p||this.#i,this.sizeCalculation=d,this.sizeCalculation){if(!this.#i&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==g&&"function"!=typeof g)throw new TypeError("memoMethod must be a function if defined");if(this.#c=g,void 0!==y&&"function"!=typeof y)throw new TypeError("fetchMethod must be a function if specified");if(this.#a=y,this.#S=!!y,this.#h=new Map,this.#f=new Array(e).fill(void 0),this.#p=new Array(e).fill(void 0),this.#d=new T(e),this.#y=new T(e),this.#g=0,this.#m=0,this.#b=k.create(e),this.#u=0,this.#l=0,"function"==typeof c&&(this.#o=c),"function"==typeof u?(this.#s=u,this.#v=[]):(this.#s=void 0,this.#v=void 0),this.#A=!!this.#o,this.#O=!!this.#s,this.noDisposeOnSet=!!l,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!m,this.allowStaleOnFetchRejection=!!v,this.allowStaleOnFetchAbort=!!E,this.ignoreFetchAbort=!!w,0!==this.maxEntrySize){if(0!==this.#i&&!N(this.#i))throw new TypeError("maxSize must be a positive integer if specified");if(!N(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#C()}if(this.allowStale=!!a,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!s,this.ttlResolution=N(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!N(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k()}if(0===this.#n&&0===this.ttl&&0===this.#i)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#n&&!this.#i){const t="LRU_CACHE_UNBOUNDED";(t=>!O.has(t))(t)&&(O.add(t),_("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",t,D))}}getRemainingTTL(t){return this.#h.has(t)?1/0:0}#k(){const t=new C(this.#n),e=new C(this.#n);this.#T=t,this.#w=e,this.#D=(r,n,i=S.now())=>{if(e[r]=0!==n?i:0,t[r]=n,0!==n&&this.ttlAutopurge){const t=setTimeout((()=>{this.#U(r)&&this.#R(this.#f[r],"expire")}),n+1);t.unref&&t.unref()}},this.#B=r=>{e[r]=0!==t[r]?S.now():0},this.#F=(i,o)=>{if(t[o]){const s=t[o],a=e[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const c=i.now-a;i.remainingTTL=s-c}};let r=0;const n=()=>{const t=S.now();if(this.ttlResolution>0){r=t;const e=setTimeout((()=>r=0),this.ttlResolution);e.unref&&e.unref()}return t};this.getRemainingTTL=i=>{const o=this.#h.get(i);if(void 0===o)return 0;const s=t[o],a=e[o];return s&&a?s-((r||n())-a):1/0},this.#U=i=>{const o=e[i],s=t[i];return!!s&&!!o&&(r||n())-o>s}}#B=()=>{};#F=()=>{};#D=()=>{};#U=()=>!1;#C(){const t=new C(this.#n);this.#l=0,this.#E=t,this.#P=e=>{this.#l-=t[e],t[e]=0},this.#j=(t,e,r,n)=>{if(this.#I(e))return 0;if(!N(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(e,t),!N(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#M=(e,r,n)=>{if(t[e]=r,this.#i){const r=this.#i-t[e];for(;this.#l>r;)this.#V(!0)}this.#l+=t[e],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#P=t=>{};#M=(t,e,r)=>{};#j=(t,e,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#x({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#m;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#g);)e=this.#y[e]}*#N({allowStale:t=this.allowStale}={}){if(this.#u)for(let e=this.#g;this.#$(e)&&(!t&&this.#U(e)||(yield e),e!==this.#m);)e=this.#d[e]}#$(t){return void 0!==t&&this.#h.get(this.#f[t])===t}*entries(){for(const t of this.#x())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*rentries(){for(const t of this.#N())void 0===this.#p[t]||void 0===this.#f[t]||this.#I(this.#p[t])||(yield[this.#f[t],this.#p[t]])}*keys(){for(const t of this.#x()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*rkeys(){for(const t of this.#N()){const e=this.#f[t];void 0===e||this.#I(this.#p[t])||(yield e)}}*values(){for(const t of this.#x())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}*rvalues(){for(const t of this.#N())void 0===this.#p[t]||this.#I(this.#p[t])||(yield this.#p[t])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0!==i&&t(i,this.#f[r],this))return this.get(this.#f[r],e)}}forEach(t,e=this){for(const r of this.#x()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}rforEach(t,e=this){for(const r of this.#N()){const n=this.#p[r],i=this.#I(n)?n.__staleWhileFetching:n;void 0!==i&&t.call(e,i,this.#f[r],this)}}purgeStale(){let t=!1;for(const e of this.#N({allowStale:!0}))this.#U(e)&&(this.#R(this.#f[e],"expire"),t=!0);return t}info(t){const e=this.#h.get(t);if(void 0===e)return;const r=this.#p[e],n=this.#I(r)?r.__staleWhileFetching:r;if(void 0===n)return;const i={value:n};if(this.#T&&this.#w){const t=this.#T[e],r=this.#w[e];if(t&&r){const e=t-(S.now()-r);i.ttl=e,i.start=Date.now()}}return this.#E&&(i.size=this.#E[e]),i}dump(){const t=[];for(const e of this.#x({allowStale:!0})){const r=this.#f[e],n=this.#p[e],i=this.#I(n)?n.__staleWhileFetching:n;if(void 0===i||void 0===r)continue;const o={value:i};if(this.#T&&this.#w){o.ttl=this.#T[e];const t=S.now()-this.#w[e];o.start=Math.floor(Date.now()-t)}this.#E&&(o.size=this.#E[e]),t.unshift([r,o])}return t}load(t){this.clear();for(const[e,r]of t){if(r.start){const t=Date.now()-r.start;r.start=S.now()-t}this.set(e,r.value,r)}}set(t,e,r={}){if(void 0===e)return this.delete(t),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:c=this.noUpdateTTL}=r;const u=this.#j(t,e,r.size||0,s);if(this.maxEntrySize&&u>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#R(t,"set"),this;let l=0===this.#u?void 0:this.#h.get(t);if(void 0===l)l=0===this.#u?this.#m:0!==this.#b.length?this.#b.pop():this.#u===this.#n?this.#V(!1):this.#u,this.#f[l]=t,this.#p[l]=e,this.#h.set(t,l),this.#d[this.#m]=l,this.#y[l]=this.#m,this.#m=l,this.#u++,this.#M(l,u,a),a&&(a.set="add"),c=!1;else{this.#L(l);const r=this.#p[l];if(e!==r){if(this.#S&&this.#I(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=r;void 0===e||o||(this.#A&&this.#o?.(e,t,"set"),this.#O&&this.#v?.push([e,t,"set"]))}else o||(this.#A&&this.#o?.(r,t,"set"),this.#O&&this.#v?.push([r,t,"set"]));if(this.#P(l),this.#M(l,u,a),this.#p[l]=e,a){a.set="replace";const t=r&&this.#I(r)?r.__staleWhileFetching:r;void 0!==t&&(a.oldValue=t)}}else a&&(a.set="update")}if(0===n||this.#T||this.#k(),this.#T&&(c||this.#D(l,n,i),a&&this.#F(a,l)),!o&&this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return this}pop(){try{for(;this.#u;){const t=this.#p[this.#g];if(this.#V(!0),this.#I(t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(void 0!==t)return t}}finally{if(this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}#V(t){const e=this.#g,r=this.#f[e],n=this.#p[e];return this.#S&&this.#I(n)?n.__abortController.abort(new Error("evicted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(n,r,"evict"),this.#O&&this.#v?.push([n,r,"evict"])),this.#P(e),t&&(this.#f[e]=void 0,this.#p[e]=void 0,this.#b.push(e)),1===this.#u?(this.#g=this.#m=0,this.#b.length=0):this.#g=this.#d[e],this.#h.delete(r),this.#u--,e}has(t,e={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=e,i=this.#h.get(t);if(void 0!==i){const t=this.#p[i];if(this.#I(t)&&void 0===t.__staleWhileFetching)return!1;if(!this.#U(i))return r&&this.#B(i),n&&(n.has="hit",this.#F(n,i)),!0;n&&(n.has="stale",this.#F(n,i))}else n&&(n.has="miss");return!1}peek(t,e={}){const{allowStale:r=this.allowStale}=e,n=this.#h.get(t);if(void 0===n||!r&&this.#U(n))return;const i=this.#p[n];return this.#I(i)?i.__staleWhileFetching:i}#_(t,e,r,n){const i=void 0===e?void 0:this.#p[e];if(this.#I(i))return i;const o=new L,{signal:s}=r;s?.addEventListener("abort",(()=>o.abort(s.reason)),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,c=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,c&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!c&&!i)return u(o.signal.reason);const h=l;return this.#p[e]===l&&(void 0===n?h.__staleWhileFetching?this.#p[e]=h.__staleWhileFetching:this.#R(t,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(t,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,c=a||r.noDeleteOnFetchRejection,u=l;if(this.#p[e]===l&&(c&&void 0!==u.__staleWhileFetching?s||(this.#p[e]=u.__staleWhileFetching):this.#R(t,"fetch")),a)return r.status&&void 0!==u.__staleWhileFetching&&(r.status.returnedStale=!0),u.__staleWhileFetching;if(u.__returned===u)throw n};r.status&&(r.status.fetchDispatched=!0);const l=new Promise(((e,n)=>{const s=this.#a?.(t,i,a);s&&s instanceof Promise&&s.then((t=>e(void 0===t?void 0:t)),n),o.signal.addEventListener("abort",(()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(e(void 0),r.allowStaleOnFetchAbort&&(e=t=>c(t,!0)))}))})).then(c,(t=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=t),u(t)))),h=Object.assign(l,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===e?(this.set(t,h,{...a.options,status:void 0}),e=this.#h.get(t)):this.#p[e]=h,h}#I(t){if(!this.#S)return!1;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof L}async fetch(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:l=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:h=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:y=!1,status:g,signal:m}=e;if(!this.#S)return g&&(g.fetch="get"),this.get(t,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:g});const b={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:c,noUpdateTTL:u,noDeleteOnFetchRejection:l,allowStaleOnFetchRejection:h,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:g,signal:m};let v=this.#h.get(t);if(void 0===v){g&&(g.fetch="miss");const e=this.#_(t,v,b,d);return e.__returned=e}{const e=this.#p[v];if(this.#I(e)){const t=r&&void 0!==e.__staleWhileFetching;return g&&(g.fetch="inflight",t&&(g.returnedStale=!0)),t?e.__staleWhileFetching:e.__returned=e}const i=this.#U(v);if(!y&&!i)return g&&(g.fetch="hit"),this.#L(v),n&&this.#B(v),g&&this.#F(g,v),e;const o=this.#_(t,v,b,d),s=void 0!==o.__staleWhileFetching&&r;return g&&(g.fetch=i?"stale":"refresh",s&&i&&(g.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(t,e={}){const r=await this.fetch(t,e);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(t,e={}){const r=this.#c;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=e,s=this.get(t,o);if(!i&&void 0!==s)return s;const a=r(t,s,{options:o,context:n});return this.set(t,a,o),a}get(t,e={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=e,s=this.#h.get(t);if(void 0!==s){const e=this.#p[s],a=this.#I(e);return o&&this.#F(o,s),this.#U(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==e.__staleWhileFetching&&(o.returnedStale=!0),r?e.__staleWhileFetching:void 0):(i||this.#R(t,"expire"),o&&r&&(o.returnedStale=!0),r?e:void 0)):(o&&(o.get="hit"),a?e.__staleWhileFetching:(this.#L(s),n&&this.#B(s),e))}o&&(o.get="miss")}#G(t,e){this.#y[e]=t,this.#d[t]=e}#L(t){t!==this.#m&&(t===this.#g?this.#g=this.#d[t]:this.#G(this.#y[t],this.#d[t]),this.#G(this.#m,t),this.#m=t)}delete(t){return this.#R(t,"delete")}#R(t,e){let r=!1;if(0!==this.#u){const n=this.#h.get(t);if(void 0!==n)if(r=!0,1===this.#u)this.#z(e);else{this.#P(n);const r=this.#p[n];if(this.#I(r)?r.__abortController.abort(new Error("deleted")):(this.#A||this.#O)&&(this.#A&&this.#o?.(r,t,e),this.#O&&this.#v?.push([r,t,e])),this.#h.delete(t),this.#f[n]=void 0,this.#p[n]=void 0,n===this.#m)this.#m=this.#y[n];else if(n===this.#g)this.#g=this.#d[n];else{const t=this.#y[n];this.#d[t]=this.#d[n];const e=this.#d[n];this.#y[e]=this.#y[n]}this.#u--,this.#b.push(n)}}if(this.#O&&this.#v?.length){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}return r}clear(){return this.#z("delete")}#z(t){for(const e of this.#N({allowStale:!0})){const r=this.#p[e];if(this.#I(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#f[e];this.#A&&this.#o?.(r,n,t),this.#O&&this.#v?.push([r,n,t])}}if(this.#h.clear(),this.#p.fill(void 0),this.#f.fill(void 0),this.#T&&this.#w&&(this.#T.fill(0),this.#w.fill(0)),this.#E&&this.#E.fill(0),this.#g=0,this.#m=0,this.#b.length=0,this.#l=0,this.#u=0,this.#O&&this.#v){const t=this.#v;let e;for(;e=t?.shift();)this.#s?.(...e)}}}class R{#W;#K;#q;constructor(t,e,r){this.#K=t.docExistsSpace,this.#q=r,this.#W=e}#H=(t,e={})=>{const r=t=>"string"==typeof t||"number"==typeof t?this.#q.GET(t,e.PIPELINE):t.FIELD||t.VALUE?this.#q.GET(t):t.AND?this.#q.AND(t.AND.map(r),e.PIPELINE):t.GET?this.#q.GET(t.GET,e.PIPELINE):t.NOT?this.#q.NOT(r(t.NOT.INCLUDE),r(t.NOT.EXCLUDE)):t.OR?this.#q.OR(t.OR.map(r),e.PIPELINE):t.ALL_DOCUMENTS?this.ALL_DOCUMENTS(t.ALL_DOCUMENTS):void 0;return r(t).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((t=>e.BUCKETS?this.#q.BUCKETS(...e.BUCKETS).then((e=>Object.assign(t,{BUCKETS:this.#q.AGGREGATION_FILTER(e,t.RESULT,!1)}))):t)).then((r=>e.FACETS?r.RESULT.length?t.ALL_DOCUMENTS?this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:t}))):this.FACETS(...e.FACETS).then((t=>Object.assign(r,{FACETS:this.#q.AGGREGATION_FILTER(t,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>e.WEIGHT?Object.assign({RESULT:this.WEIGHT(t.RESULT,e.WEIGHT)},t):t)).then((t=>e.SCORE?this.SCORE(t.RESULT,e.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,e.SORT?{RESULT:this.SORT(t.RESULT,e.SORT)}:{}))).then((t=>{let r;return Object.assign(t,{RESULT:this.PAGE(t.RESULT,e.PAGE,(t=>{r=t}))},{PAGING:r})})).then((t=>e.DOCUMENTS?this.DOCUMENTS(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))};#Y=t=>this.DISTINCT(t).then((t=>Array.from(t.reduce(((t,e)=>t.add(e.VALUE)),new Set)).sort(((t,e)=>(t+"").localeCompare(e+"",void 0,{numeric:!0,sensitivity:"base"})))));#X=(...t)=>t.length?Promise.all(t.map((t=>this.#q.STORE.get([this.#K,t]).catch((t=>null))))):this.ALL_DOCUMENTS();#J=(t,e)=>this.#H({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e));ALL_DOCUMENTS=t=>this.#q.STORE.iterator({gte:[this.#K,null],lte:[this.#K,void 0],limit:t}).all().then((t=>t.map((([t,e])=>({_id:e._id,_doc:e})))));cachePipeline=(t,e,...r)=>{const n=JSON.stringify({funcLabel:e,params:r});return this.#W.has(n)?Promise.resolve(this.#W.get(n)):t(...r).then((t=>(this.#W.set(n,t),t)))};DICTIONARY=t=>this.cachePipeline(this.#Y,"#DICTIONARY",t);DISTINCT=(...t)=>this.#q.DISTINCT(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));DOCUMENTS=(...t)=>this.cachePipeline(this.#X,"#DOCUMENTS",...t);DOCUMENT_COUNT=()=>this.#q.STORE.get(["DOCUMENT_COUNT"]);DOCUMENT_VECTORS=(...t)=>Promise.all(t.map((t=>this.#q.STORE.get(["DOC",t]).catch((t=>null)))));FACETS=(...t)=>this.#q.FACETS(...t).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse)));PAGE=(t,e={},r=()=>null)=>((e={NUMBER:0,SIZE:20,...e}).TOTAL=Math.ceil(t.length/e.SIZE),e.DOC_OFFSET=e.NUMBER*e.SIZE,r(e),t.slice(e.DOC_OFFSET,e.DOC_OFFSET+e.SIZE||void 0));QUERY=(t,e)=>this.cachePipeline(this.#H,"#parseJsonQuery",t,e);SCORE=(t,e={})=>{e=Object.assign({TYPE:"TFIDF"},e);const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD),n=t=>(t||[]).filter(r);return new Promise((i=>i("TFIDF"===e.TYPE?this.DOCUMENT_COUNT().then((e=>t.map(((t,n,i)=>{const o=Math.log((e+1)/i.length);return t._score=+(t._match||[]).filter(r).reduce(((t,e)=>t+o*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2)}))):"CONCAT"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.SCORE),"")}))):"SUM"===e.TYPE?t.map((t=>({...t,_score:+n(t._match).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2)}))):"VALUE"===e.TYPE?t.map((t=>({...t,_score:n(t._match).reduce(((t,e)=>t+e.VALUE),"")}))):null)))};SEARCH=(t,e)=>this.cachePipeline(this.#J,"#SEARCH",t,e);SORT=(t,e)=>(e=Object.assign({DIRECTION:"DESCENDING",TYPE:"NUMERIC"},e||{}),t.sort(((t,e)=>t._ide._id?1:0)).sort({NUMERIC:{DESCENDING:(t,e)=>+e._score-+t._score,ASCENDING:(t,e)=>+t._score-+e._score},ALPHABETIC:{DESCENDING:(t,e)=>t._scoree._score?-1:0,ASCENDING:(t,e)=>t._scoree._score?1:0}}[e.TYPE][e.DIRECTION]));WEIGHT=(t,e)=>t.map((t=>(t._match=t._match.map((t=>(e.forEach((e=>{let r=!1;e.FIELD&&e.VALUE?e.FIELD===t.FIELD&&e.VALUE===t.VALUE&&(r=!0):e.FIELD?e.FIELD===t.FIELD&&(r=!0):e.VALUE&&e.VALUE===t.VALUE&&(r=!0),r&&(t.SCORE=(e.WEIGHT*+t.SCORE).toFixed(2))})),t))),t)))}var B=r(228);class F extends Error{constructor(t){super(t),this.name="TimeoutError"}}class P extends Error{constructor(t){super(),this.name="AbortError",this.message=t}}const j=t=>void 0===globalThis.DOMException?new P(t):new DOMException(t),M=t=>{const e=void 0===t.reason?j("This operation was aborted."):t.reason;return e instanceof Error?e:j(e)};class V{#Q=[];enqueue(t,e){const r={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&this.#Q[this.size-1].priority>=e.priority)return void this.#Q.push(r);const n=function(t,e){let r=0,n=t.length;for(;n>0;){const o=Math.trunc(n/2);let s=r+o;i=t[s],e.priority-i.priority<=0?(r=++s,n-=o+1):n=o}var i;return r}(this.#Q,r);this.#Q.splice(n,0,r)}dequeue(){const t=this.#Q.shift();return t?.run}filter(t){return this.#Q.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this.#Q.length}}class $ extends B{#Z;#tt;#et=0;#rt;#nt;#it=0;#ot;#st;#Q;#at;#ct=0;#ut;#lt;#ht;timeout;constructor(t){if(super(),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:V,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${t.intervalCap?.toString()??""}\` (${typeof t.intervalCap})`);if(void 0===t.interval||!(Number.isFinite(t.interval)&&t.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${t.interval?.toString()??""}\` (${typeof t.interval})`);this.#Z=t.carryoverConcurrencyCount,this.#tt=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this.#rt=t.intervalCap,this.#nt=t.interval,this.#Q=new t.queueClass,this.#at=t.queueClass,this.concurrency=t.concurrency,this.timeout=t.timeout,this.#ht=!0===t.throwOnTimeout,this.#lt=!1===t.autoStart}get#ft(){return this.#tt||this.#et{this.#yt()}),e)),!0;this.#et=this.#Z?this.#ct:0}return!1}#dt(){if(0===this.#Q.size)return this.#ot&&clearInterval(this.#ot),this.#ot=void 0,this.emit("empty"),0===this.#ct&&this.emit("idle"),!1;if(!this.#lt){const t=!this.#bt;if(this.#ft&&this.#pt){const e=this.#Q.dequeue();return!!e&&(this.emit("active"),e(),t&&this.#mt(),!0)}}return!1}#mt(){this.#tt||void 0!==this.#ot||(this.#ot=setInterval((()=>{this.#gt()}),this.#nt),this.#it=Date.now()+this.#nt)}#gt(){0===this.#et&&0===this.#ct&&this.#ot&&(clearInterval(this.#ot),this.#ot=void 0),this.#et=this.#Z?this.#ct:0,this.#vt()}#vt(){for(;this.#dt(););}get concurrency(){return this.#ut}set concurrency(t){if(!("number"==typeof t&&t>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${t}\` (${typeof t})`);this.#ut=t,this.#vt()}async#Et(t){return new Promise(((e,r)=>{t.addEventListener("abort",(()=>{r(t.reason)}),{once:!0})}))}async add(t,e={}){return e={timeout:this.timeout,throwOnTimeout:this.#ht,...e},new Promise(((r,n)=>{this.#Q.enqueue((async()=>{this.#ct++,this.#et++;try{e.signal?.throwIfAborted();let n=t({signal:e.signal});e.timeout&&(n=function(t,e){const{milliseconds:r,fallback:n,message:i,customTimers:o={setTimeout,clearTimeout}}=e;let s;const a=new Promise(((a,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(e.signal){const{signal:t}=e;t.aborted&&c(M(t)),t.addEventListener("abort",(()=>{c(M(t))}))}if(r===Number.POSITIVE_INFINITY)return void t.then(a,c);const u=new F;s=o.setTimeout.call(void 0,(()=>{if(n)try{a(n())}catch(t){c(t)}else"function"==typeof t.cancel&&t.cancel(),!1===i?a():i instanceof Error?c(i):(u.message=i??`Promise timed out after ${r} milliseconds`,c(u))}),r),(async()=>{try{a(await t)}catch(t){c(t)}})()})).finally((()=>{a.clear()}));return a.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},a}(Promise.resolve(n),{milliseconds:e.timeout})),e.signal&&(n=Promise.race([n,this.#Et(e.signal)]));const i=await n;r(i),this.emit("completed",i)}catch(t){if(t instanceof F&&!e.throwOnTimeout)return void r();n(t),this.emit("error",t)}finally{this.#d()}}),e),this.emit("add"),this.#dt()}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this.#lt?(this.#lt=!1,this.#vt(),this):this}pause(){this.#lt=!0}clear(){this.#Q=new this.#at}async onEmpty(){0!==this.#Q.size&&await this.#wt("empty")}async onSizeLessThan(t){this.#Q.sizethis.#Q.size{const n=()=>{e&&!e()||(this.off(t,n),r())};this.on(t,n)}))}get size(){return this.#Q.size}sizeBy(t){return this.#Q.filter(t).length}get pending(){return this.#ct}get isPaused(){return this.#lt}}class G{#W;#q;#Tt;#Q;constructor(t,e,r){this.#W=e,this.#q=r,this.#Tt=t,this.#Q=new $({concurrency:1}),this.#At(0)}#At=t=>this.#q.STORE.get(["DOCUMENT_COUNT"]).then((e=>this.#q.STORE.put(["DOCUMENT_COUNT"],+e+(+t||0)))).catch((t=>this.#q.STORE.put(["DOCUMENT_COUNT"],0)));#St=(t,e)=>{this.#W.clear();const r={...this.#Tt,...e};return((t,e)=>{const r=t=>"string"==typeof t||t instanceof String,n=(t,i)=>new Promise((async o=>{return null===t?o([null,"1.00"]):(s=t)&&0===Object.keys(s).length&&Object.getPrototypeOf(s)===Object.prototype?o([[],"1.00"]):Number.isInteger(t)?o([t,t]):r(t)?o(e.tokenizer(t,i,e)):(t=>"object"==typeof t&&null!==t&&!Array.isArray(t))(t)?o((a=t,new Promise((async t=>{const r={};for(const t in a)r[t]=await n(a[t],t,e);return t(r)})))):(t=>Array.isArray(t))(t)?o((c=t,Promise.all(c.map(n)))):o(t);var s,a,c}));return Promise.all(t.map((async t=>new Promise((async i=>{r(t)&&(t={body:t}),Object.prototype.hasOwnProperty.call(t,"_id")||(t._id=e.idGenerator.next().value);const o={};for(const e in t)o[e]="_id"!==e?await n(t[e],e):t[e];return i(o)})))))})(t,r).then((t=>this.#q.PUT(t,e))).then((e=>this.PUT_RAW(t,e.map((t=>t._id)),!r.storeRawDocs).then((()=>this.#At(e.filter((t=>"CREATED"===t.status)).length))).then((()=>e))))};#Ot=t=>this.#q.DELETE(t).then((e=>this.DELETE_RAW(...t).then((()=>this.#At(-e.filter((t=>"DELETED"===t.status)).length))).then((()=>this.#W.clear())).then((()=>e))));DELETE=(...t)=>this.#Ot(t);DELETE_RAW=(...t)=>Promise.all(t.map((t=>this.#q.STORE.del([this.#Tt.docExistsSpace,t]))));FLUSH=()=>this.#q.STORE.clear().then((()=>{this.#W.clear();const t=(new Date).toISOString();return this.#q.STORE.batch([{type:"put",key:["~CREATED"],value:t},{type:"put",key:["~LAST_UPDATED"],value:t},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0));IMPORT=t=>(this.#W.clear(),Promise.resolve(this.#q.IMPORT(t)));PUT=(t,e)=>this.#Q.add((()=>this.#St(t,e)));PUT_RAW=(t,e,r)=>Promise.all(t.map(((t,n)=>this.#q.STORE.put([this.#Tt.docExistsSpace,e[n]],r?{}:t)))).then((r=>(this.#W.clear(),t.map(((t,r)=>({_id:e[r],status:"OK",operation:"_PUT_RAW"}))))))}class z{constructor(t={}){var e;t={cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],name:"index",ngrams:{},replace:{},storeRawDocs:!0,stopwords:[],storeVectors:!0,tokenSplitRegex:/[\p{L}\d]+/gu,tokenizer:f,...t},this.INDEX=new T({...t,isLeaf:t=>Array.isArray(t)&&2===t.length&&t.every((t=>"string"==typeof t||"number"==typeof t||null===t))}),this.EVENTS=this.INDEX.EVENTS,this._CACHE=new D({max:t.cacheLength}),this.r=new R(t,this._CACHE,this.INDEX),this.w=new G(t,this._CACHE,this.INDEX),e=this.INDEX,new Promise(((t,r)=>{const n=["CREATED_WITH"],i="search-index@5.1.1";return e.STORE.get(n).then((e=>i===e?t():r(new Error("This index was created with "+e+", you are running "+i)))).catch((r=>e.STORE.put(n,i).then(t)))}))}ALL_DOCUMENTS=t=>this.r.ALL_DOCUMENTS(t);BUCKETS=(...t)=>this.INDEX.BUCKETS(...t);CREATED=()=>this.INDEX.CREATED();DELETE=(...t)=>this.w.DELETE(...t);DELETE_RAW=(...t)=>this.w.DELETE_RAW(...t);DICTIONARY=t=>this.r.DICTIONARY(t);DISTINCT=(...t)=>this.r.DISTINCT(...t);DOCUMENTS=(...t)=>this.r.DOCUMENTS(...t);DOCUMENT_COUNT=()=>this.r.DOCUMENT_COUNT();DOCUMENT_VECTORS=(...t)=>this.r.DOCUMENT_VECTORS(...t);EXPORT=()=>this.INDEX.EXPORT();FACETS=(...t)=>this.r.FACETS(...t);FIELDS=()=>this.INDEX.FIELDS();FLUSH=()=>this.w.FLUSH();IMPORT=t=>this.INDEX.IMPORT(t);LAST_UPDATED=()=>this.INDEX.LAST_UPDATED();MAX=t=>this.INDEX.MAX(t);MIN=t=>this.INDEX.MIN(t);PUT=(t,e)=>this.w.PUT(t,e);PUT_RAW=(t,e,r)=>this.w.PUT_RAW(t,e,r);QUERY=(t,e)=>this.r.QUERY(t,e);SEARCH=(t,e)=>this.r.SEARCH(t,e);TOKENIZATION_PIPELINE_STAGES=h;_AND=(t,e)=>this.INDEX.AND(t,e);_BUCKET=t=>this.INDEX.BUCKET(t);_GET=(t,e)=>this.INDEX.GET(t,e);_NOT=(t,e)=>this.INDEX.NOT(t,e);_OR=(t,e)=>this.INDEX.OR(t,e);_PAGE=(t,e)=>this.r.PAGE(t,e);_SORT=(t,e)=>this.r.SORT(t,e)}class W{constructor({template:t=t=>`${t} hits`,elementId:e="count"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=this.template(t)}class K{constructor({template:t=t=>`

    ${JSON.stringify(t)}

    `,elementId:e="hits"}){this.template=t,this.el=document.getElementById(e)}update=t=>this.el.innerHTML=t.map((({_doc:t})=>this.template(t))).join("\n")}class q{constructor({pageLinkTemplate:t=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,navLinkTemplate:e=(t,e,r)=>`\n
  • \n \n ${t}\n \n
  • `,elementId:r="paging"},n){this.pageLinkTemplate=t,this.navLinkTemplate=e,this.el=document.getElementById(r),this.search=n,this.page={NUMBER:0,SIZE:10}}template=t=>{let e=0,r=t.TOTAL;return t.TOTAL>7&&(e=t.NUMBER>3?t.NUMBER-3:0,r=7+e),r>t.TOTAL&&(e=t.TOTAL-6-1,r=t.TOTAL),`\n
      \n ${this.navLinkTemplate("First",0,0===t.NUMBER)}\n ${this.navLinkTemplate("‹",t.NUMBER-1,0===t.NUMBER)}\n ${(()=>{let n="";for(let i=e;i=t.TOTAL-1)}\n ${this.navLinkTemplate("Last",t.TOTAL-1,t.NUMBER>=t.TOTAL-1)}\n
    `};update=t=>{if(console.log(t),t.TOTAL<=1)return void(this.el.innerHTML="");this.el.innerHTML=this.template(t);const e=document.getElementsByClassName("page-link");for(let t=0;t{console.log("AYO!"),console.log(this.search()),this.page.NUMBER=+t.target.attributes["data-page"].value,this.search()}))}}class H{constructor({elementId:t="",facetOptionTemplate:e=(t,e)=>`\n \n \n
    `,field:r=null,mode:n="OR",sort:i=(t,e)=>{t.VALUE.localeCompare(e.VALUE)},title:o="

    "+r.toUpperCase()+"

    "},s){this.activeFilters=[],this.el=document.getElementById(t),this.elementId=t,this.facetOptionTemplate=e,this.field=r,this.mode=n,this.search=s,this.sort=i,this.title=o}getActiveFilters=()=>this.activeFilters.length?[{[this.mode]:this.activeFilters}]:[];update=(t,e)=>{if("facet"===e&&"OR"===this.mode)return;const r=t.filter((t=>t.FIELD===this.field));this.el.innerHTML=r.length?this.title+r.sort(this.sort).reduce(((t,e)=>t+this.facetOptionTemplate(e,this.activeFilters.includes(e.FIELD+":"+e.VALUE))),""):"",this.activeFilters.forEach((t=>{if(!document.getElementById(t)){const[e,r]=t.split(":");this.el.innerHTML+=this.facetOptionTemplate({FIELD:e,VALUE:r,_id:[]},!0)}}));for(const t of document.querySelectorAll("#"+this.elementId+" > .filter-select"))t.addEventListener("input",(t=>{console.log(this.elementId),console.log(this.mode);const e=t.target.attributes["data-field"].value+":"+t.target.attributes["data-value"].value;t.target.checked?this.activeFilters.push(e):this.activeFilters=this.activeFilters.filter((t=>t!==e)),this.search("facet")}))}}class Y{constructor(t,e,r={}){this.autoCompleteFunction=r.autoCompleteFunction,this.currentFocus=-1,this.searchboxEl=t,this.search=e,this.limit=r.limit||20,this.threshold=r.threshold||2,this.autocompleteListId=t.id+"-autocomplete-list",this.suggestionsElementId=r.elementId,t.addEventListener("input",this.searchBoxInputListener),t.addEventListener("keydown",this.searchBoxKeydownListener),document.addEventListener("click",(t=>{this.closeAllLists(t.target)}))}closeAllLists=t=>{for(const e of document.getElementsByClassName("autocomplete-items"))t!==e&&t!==this.searchboxEl&&e.parentNode.removeChild(e)};searchBoxKeydownListener=t=>{let e=document.getElementById(this.autocompleteListId);e&&(e=e.getElementsByTagName("div")),40===t.keyCode?(this.currentFocus++,this.addActive(e)):38===t.keyCode?(this.currentFocus--,this.addActive(e)):13===t.keyCode||9===t.keyCode?(t.preventDefault(),this.currentFocus>-1?e&&e[this.currentFocus].click():this.closeAllLists()):27===t.keyCode&&this.closeAllLists()};searchBoxInputListener=async t=>{const e=(await this.autoCompleteFunction(t.target.value)).slice(0,this.limit);let r;const n=t.target.value;if(this.closeAllLists(),!n)return!1;if(n.length{r=document.createElement("DIV"),r.innerHTML=""+t.substr(0,n.length)+"",r.innerHTML+=t.substr(n.length),r.innerHTML+="",r.addEventListener("click",(t=>{this.searchboxEl.value=t.target.getElementsByTagName("input")[0].value,this.closeAllLists(),this.search()})),i.appendChild(r)}))};addActive=t=>{if(!t)return!1;this.removeActive(t),this.currentFocus>=t.length&&(this.currentFocus=0),this.currentFocus<0&&(this.currentFocus=t.length-1),t[this.currentFocus].classList.add("autocomplete-active")};removeActive=t=>{for(let e=0;e{n.page.NUMBER=0,r("searchInput")})),this.autocomplete=new Y(this.el,r,e)}}class J{constructor({index:t=null,count:e={},hits:r={},facets:n=[],searchInput:i={},paging:o={},suggestions:s={}}){this.index=t,this.count=new W(e),this.paging=new q(o,this.search),this.hits=new K(r),this.searchInput=new X({...i,suggestions:{autoCompleteFunction:this.index.DICTIONARY,...i.suggestions}},this.search,this.paging),this.facets=n.map((t=>new H(t,this.search))),this.search()}queryOptions=()=>({FACETS:this.facets.map((t=>({FIELD:t.field}))),DOCUMENTS:!0,PAGE:this.paging.page});emptySearchQuery=()=>[{ALL_DOCUMENTS:!0},this.queryOptions()];searchQuery=()=>[[...this.searchInput.el.value.split(/\s+/).filter((t=>t)),...this.facets.map((t=>t.getActiveFilters())).flat(1/0)],this.queryOptions()];search=t=>(this.searchInput.el.value.length+this.facets.map((t=>t.getActiveFilters())).flat(1/0).length?this.index.SEARCH(...this.searchQuery()):this.index.QUERY(...this.emptySearchQuery())).then((e=>{this.hits.update(e.RESULT),this.count.update(e.RESULT_LENGTH),this.facets.forEach((r=>r.update(e.FACETS,t))),this.paging.update(e.PAGING)}))}class Q{constructor(t={}){return new z({Level:p.Z,...t})}}class Z{constructor(t={}){return new J(t)}}})(),SearchIndex=n})(); \ No newline at end of file diff --git a/package.json b/package.json index 5fa73ebb..5f4bcb95 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "search-index", - "version": "5.1.0", + "version": "5.1.1", "description": "A network resilient, persistent full-text search library for the browser and Node.js", "keywords": [ "search", diff --git a/src/version.js b/src/version.js index 3fbe89ed..71319951 100644 --- a/src/version.js +++ b/src/version.js @@ -1 +1 @@ -export const packageVersion = "5.0.0" +export const packageVersion = "5.1.1"