diff --git a/dist/search-index-3.0.1.js b/dist/search-index-3.0.1.js new file mode 100644 index 00000000..a6276ea0 --- /dev/null +++ b/dist/search-index-3.0.1.js @@ -0,0 +1,2 @@ +/*! For license information please see search-index-3.0.1.js.LICENSE.txt */ +var SearchIndex;(()=>{var t={8508:(t,e,r)=>{"use strict";const n=Object.freeze({});function i(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(t,e,r){this._checkWritten();const i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},i.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},i.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},i.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},i.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},i.prototype._nextTick=r(7212),t.exports=i},3538:(t,e,r)=>{"use strict";function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,i){t?r(t):void 0===n&&void 0===i?e():e([n,i])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{"use strict";const n=r(1675),i=r(8738),o=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,l=Object.prototype.hasOwnProperty,f=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!l.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let i=e[n];d(n)&&(i=t._serializeKey(i)),r[n]=i}return r}function d(t){return-1!==f.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=o.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,o)=>t?i(t):void 0===o?r.end(e):void this._del(o,n,i)))};i()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):i(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{"use strict";e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},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,a=o.length;s0)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},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 f(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.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(H(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(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 u.from(n,e,r);const i=function(t){if(u.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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(t){return l(t),a(t<0?0:0|d(t))}function h(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(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(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 z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:z(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 k(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(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),Y(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=u.from(e,n)),u.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,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),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 A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(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,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}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<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),c=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 w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function R(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 C(t,e,r,n,i,o){if(!u.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 j(t,e,r,n,i){G(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 U(t,e,r,n,i){G(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 N(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 D(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.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||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(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||q(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||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(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||q(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(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||C(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return j(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return j(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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 G(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 M.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||q(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new M.ERR_INVALID_ARG_TYPE(e,"number",t)}function q(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("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 K=/[^+/0-9A-Za-z-_]/g;function z(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 $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=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")}},1924:(t,e,r)=>{"use strict";var n=r(210),i=r(5559),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}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},6957:(t,e,r)=>{"use strict";var n=r(886);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)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(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))}},2833:(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,u=0;u{var n=r(8840),i=r(2833);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"},7171:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(4012),i=Symbol("operations");t.exports=class extends n{constructor(t){super(t),this[i]=[]}_put(t,e,r){this[i].push({...r,type:"put",key:t,value:e})}_del(t,e){this[i].push({...e,type:"del",key:t})}_clear(){this[i]=[]}_write(t,e){this.db.batch(this[i],t,e)}}},2790:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(4012),i=r(5717),o=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function l(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}i(l,n),l.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},l.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=o(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},l.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},l.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=o(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])l.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=l},6944:(t,e,r)=>{"use strict";const{AbstractLevelDOWN:n}=r(4012),i=r(5717),o=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],l=Symbol("innerDb"),f=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[l]=t,this[f]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[l][r](...t);const e=a(t,h);return"opening"===this.status?this[f].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[l].iterator(t);if("opening"===this.status){const e=new o(this,t);return this[f].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}i(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[l]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[l].status)return e(t||new Error("Database is not open"));const r=this[f];this[f]=[];for(const t of r)t.iterator?t.iterator.setDb(this[l]):this[l][t.method](...t.args);if(this[f].length>0)throw new Error("Did not expect further operations");e()};"new"===this[l].status||"closed"===this[l].status?this[l].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[l].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=o},2502:(t,e)=>{"use strict";e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const i=new Promise(((e,i)=>{t.push(n=function(t,...n){t?i(t):e(r?r(...n):n[0])})}));n[e]=i}return n}},780:(t,e,r)=>{"use strict";const n=r(4012).AbstractLevelDOWN,i=r(4012).AbstractChainedBatch,o=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function l(t,e){if(!(this instanceof l))return new l(t,e);const r=t.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(i[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,i){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,i)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function f(t,e){o.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){i.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=l,s(l,n),l.prototype.type="encoding-down",l.prototype._serializeKey=l.prototype._serializeValue=function(t){return t},l.prototype._open=function(t,e){this.db.open(t,e)},l.prototype._close=function(t){this.db.close(t)},l.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},l.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},l.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const i=new Array(n.length);for(let o=0;o{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},f.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},f.prototype._end=function(t){this.it.end(t)},s(h,i),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729: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),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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,r){"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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;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=u(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,c=l,console&&console.warn&&console.warn(c)}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 f(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 h(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 u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,l=d(u,c);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 h(this,t,!0)},o.prototype.rawListeners=function(t){return h(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):[]}},9203:(t,e,r)=>{const n=r(7270),i=r(9558);t.exports=t=>n(Object.assign({db:i},t))},7270:(t,e,r)=>{const n=r(2483),i=r(780),o=r(4918),s=r(9563),a=r(8936),u=t=>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))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),o(i(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,i)=>n?r(n):e(Object.assign(t,{_db:i}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((i,o)=>{if(Array.isArray(t))return o(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){const e=t.split(":"),r=e.pop(),o=e.pop();return i(o?{FIELD:[o],VALUE:{GTE:r,LTE:r}}:{FIELD:n,VALUE:{GTE:r,LTE:r}})}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:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,r)=>{const n=r(6782),i=r(2483);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),o=async(e,n=(t=>new Promise((e=>e(t)))))=>new Promise((async(i,o)=>{const a=t=>void 0===t?i(void 0):t instanceof Promise?i(t):void 0;try{a(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return o(t)}return Array.isArray(e)?i(e):i(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>o(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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(i.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((i=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",i.LO],lte:["FIELD",i.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),l=(t,e)=>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))))]})))):t,f=async t=>r(t).then((t=>o(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const i=[];t._db.createReadStream(e).on("data",(t=>{i.push(t)})).on("end",(()=>r(i)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:l(t.flat(),r),FACETS:l(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:l,BUCKET:f,BUCKETS:(...t)=>Promise.all(t.map(f)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:o,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?o(t):t,e(r)?o(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),i=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return n(e._object).forEach((function(e){let n=!0;const o=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===o&&(n=!1),r.doNotIndexField.filter((t=>o.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([o,t])}catch(t){e=JSON.stringify([o,[this.node]])}i.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((l=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),i(t).EXIST(...n.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=>r(t,e))).reduce(o,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>l(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},9804:t=>{var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),l=[],f=0;f{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,f=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?h((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%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?h(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,O=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,T,(function(t,e,r,i){n[n.length]=r?_(i,A,"$1"):e||t})),n},x=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var r=O(t),n=r.length>0?r[0]:"",o=x("%"+n+"%",e),a=o.name,c=o.value,l=!1,f=o.alias;f&&(n=f[0],E(r,w([0,1],f)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!l&&(y[a]=c)}}return c}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419: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}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=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*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-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,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},8662:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{"use strict";var n=r(9804),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),l=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{"use strict";const n=r(964),i=new Set(["lt","gt","lte","gte"]);function o(t){if(!(this instanceof o))return new o(t);this.opts=t||{},this.encodings=n}t.exports=o,o.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},o.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},o.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},o.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},o.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},o.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},o.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},o.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},o.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=i.has(r)?this.encodeKey(t[r],t):t[r]}return e},o.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},o.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},o.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{"use strict";const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:o,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:o,buffer:!0,type:"binary"},e.none={encode:o,decode:o,buffer:!1,type:"id"},e.id=e.none;const i=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of i)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function o(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{"use strict";function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{"use strict";const n=r(5717),{Readable:i}=r(8473);function o(t,e){if(!(this instanceof o))return new o(t,e);e=e||{},i.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=o,n(o,i),o.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},o.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{"use strict";t.exports=p;const n=r(4012).AbstractLevelDOWN,i=r(5717),o=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),l=r(2854),f=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}i(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let i;try{i=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(i,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,i=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=i.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let i;try{i=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(i,r)},p.prototype._put=function(t,e,r,n){const i=this.store("readwrite");let o;try{o=i.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(o,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("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 u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return l(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function i(t){if(t)return s(t);e.next(o)}function o(t,e,o){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(o,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,i)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},i()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{"use strict";const n=r(5717),i=r(4012).AbstractIterator,o=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(i.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=o(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,i),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854: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 u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):i(t):t instanceof ArrayBuffer?e?n.from(t):o(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{"use strict";const n=r(2303),i=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,i),r=n.upperBound(t,i),o=n.lowerBoundExclusive(t,i),s=n.upperBoundExclusive(t,i);return e!==i&&r!==i?IDBKeyRange.bound(e,r,o,s):e!==i?IDBKeyRange.lowerBound(e,o):r!==i?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:i(String(t)):String(t)}},1228:(t,e,r)=>{"use strict";const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{"use strict";function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{"use strict";const n=r(6604).WriteError,i=r(6957),o=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=o(t,e),e=i.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{"use strict";const n=r(7187).EventEmitter,i=r(9539).inherits,o=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),l=r(6957),f=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let i;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(i=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,i);throw i}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,i(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=l.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=l.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=f(r,n),w(this,n=l.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=f(t,e),t=h(t),w(this,e=l.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{"use strict";const n=r(4411),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),u=Symbol("maxAge"),c=Symbol("dispose"),l=Symbol("noDisposeOnSet"),f=Symbol("lruList"),h=Symbol("cache"),p=Symbol("updateAgeOnGet"),d=()=>1,y=(t,e,r)=>{const n=t[h].get(e);if(n){const e=n.value;if(g(t,e)){if(m(t,n),!t[a])return}else r&&(t[p]&&(n.value.now=Date.now()),t[f].unshiftNode(n));return e.value}},g=(t,e)=>{if(!e||!e.maxAge&&!t[u])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[u]&&r>t[u]},b=t=>{if(t[o]>t[i])for(let e=t[f].tail;t[o]>t[i]&&null!==e;){const r=e.prev;m(t,e),e=r}},m=(t,e)=>{if(e){const r=e.value;t[c]&&t[c](r.key,r.value),t[o]-=r.length,t[h].delete(r.key),t[f].removeNode(e)}};class v{constructor(t,e,r,n,i){this.key=t,this.value=e,this.length=r,this.now=n,this.maxAge=i||0}}const w=(t,e,r,n)=>{let i=r.value;g(t,i)&&(m(t,r),t[a]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;const e=t.length||d;if(this[s]="function"!=typeof e?d:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[p]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[i]=t||1/0,b(this)}get max(){return this[i]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[u]=t,b(this)}get maxAge(){return this[u]}set lengthCalculator(t){"function"!=typeof t&&(t=d),t!==this[s]&&(this[s]=t,this[o]=0,this[f].forEach((t=>{t.length=this[s](t.value,t.key),this[o]+=t.length}))),b(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[f].length}rforEach(t,e){e=e||this;for(let r=this[f].tail;null!==r;){const n=r.prev;w(this,t,r,e),r=n}}forEach(t,e){e=e||this;for(let r=this[f].head;null!==r;){const n=r.next;w(this,t,r,e),r=n}}keys(){return this[f].toArray().map((t=>t.key))}values(){return this[f].toArray().map((t=>t.value))}reset(){this[c]&&this[f]&&this[f].length&&this[f].forEach((t=>this[c](t.key,t.value))),this[h]=new Map,this[f]=new n,this[o]=0}dump(){return this[f].map((t=>!g(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[f]}set(t,e,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](e,t);if(this[h].has(t)){if(a>this[i])return m(this,this[h].get(t)),!1;const s=this[h].get(t).value;return this[c]&&(this[l]||this[c](t,s.value)),s.now=n,s.maxAge=r,s.value=e,this[o]+=a-s.length,s.length=a,this.get(t),b(this),!0}const p=new v(t,e,a,n,r);return p.length>this[i]?(this[c]&&this[c](t,e),!1):(this[o]+=p.length,this[f].unshift(p),this[h].set(t,this[f].head),b(this),!0)}has(t){if(!this[h].has(t))return!1;const e=this[h].get(t).value;return!g(this,e)}get(t){return y(this,t,!0)}peek(t){return y(this,t,!1)}pop(){const t=this[f].tail;return t?(m(this,t),t.value):null}del(t){m(this,this[h].get(t))}load(t){this.reset();const e=Date.now();for(let r=t.length-1;r>=0;r--){const n=t[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const t=i-e;t>0&&this.set(n.k,n.v,t)}}}prune(){this[h].forEach(((t,e)=>y(this,e,!1)))}}},2303:(t,e,r)=>{var n=r(8764).Buffer;function i(t){return void 0!==t&&""!==t}function o(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!o(t,"gt")},l=e.upperBoundInclusive=function(t){return!o(t,"lt")},f=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!l(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?l(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):l(t)},e.toLtgt=function(t,r,n,i,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(i,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),o(r,"max")&&delete r.max,o(r,"min")&&delete r.min,o(r,"start")&&delete r.start,o(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var o=u(t);if(i(o)&&((s=n(r,o))<0||0===s&&f(t)))return!1;var s,a=d(t);return!i(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},9024:t=>{const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.exports=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()}},4155: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,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!c){var t=s(f);c=!0;for(var e=u.length;e;){for(a=u,u=[];++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)))},4281:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{"use strict";var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=r(9481),s=r(4229);r(5717)(l,o);for(var a=i(s.prototype),u=0;u{"use strict";t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{"use strict";var n,i=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},l=r(4616);o=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=r(2553).s),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?k(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,L(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):x(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):P(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(L,t))}function L(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(C,t,e))}function C(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){o("readable nexttick read 0"),t.read(0)}function N(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function M(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function V(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?M(this):k(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&M(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&M(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",f),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",c);var l=!1;function f(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==V(n.pipes,t))&&!l&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){o("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?k(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(j,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(j,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(N,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s{"use strict";t.exports=l;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,l=r.g.Uint8Array||function(){},f=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=f.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(L,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),L(t,e))}(t,r,n,e,o);else{var s=I(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),n?i.nextTick(x,t,r,s,o):x(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),L(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,O(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function k(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),L(t,e)}))}function L(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(k,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,c.isBuffer(n)||n instanceof l);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,L(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[f]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[l]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(o(e={},p,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,l,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[f]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[f]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[f]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[l]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{"use strict";var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function l(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(l)}},2457:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(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,u,c,l=!0;function f(t){function e(){r&&r(t,i),r=null}l?n(e):e()}function h(e,r,n){if(i[e]=n,r&&(u=!0),0==--s||r)f(r);else if(!u&&c{"use strict";var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=l,this.end=f,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971: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]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],l=!0;return function t(f){var h=r?i(f):f,p={},d=!0,y={node:h,node_:f,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){l=!1},block:function(){d=!1}};if(!l)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=a(Object.prototype.toString),f=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===l(t)}function m(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function E(t){return"[object ArrayBuffer]"===l(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===l(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===l(t)}function x(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function R(t){return g(t,f)}function I(t){return g(t,h)}function k(t){return g(t,p)}function L(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=I,e.isBooleanObject=k,e.isBigIntObject=L,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return R(t)||I(t)||k(t)||L(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function f(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,l="",f=!1,_=["{","}"];return y(r)&&(f=!0,_=["[","]"]),A(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(l=" "+RegExp.prototype.toString.call(r)),S(r)&&(l=" "+Date.prototype.toUTCString.call(r)),T(r)&&(l=" "+p(r)),0!==s.length||f&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=f?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,_)):_[0]+l+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",I(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(L&&t[L]){var e;if("function"!=typeof(e=t[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,L,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{"use strict";var n=r(9804),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),l=o("String.prototype.slice"),f={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}f[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(f,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):l(s(t),8,-1))}},9602:t=>{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},4411:(t,e,r)=>{"use strict";function n(t){var e=this;if(e instanceof n||(e=new n),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=t(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=t(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;null!==r;e++)t[e]=r.value,r=r.next;return t},n.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;null!==r;e++)t[e]=r.value,r=r.prev;return t},n.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var r=new n;if(ethis.length&&(e=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(e=this.length);for(var i=this.length,o=this.tail;null!==o&&i>e;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;null!==i&&n{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,i)=>new Promise((async o=>{return Number.isInteger(n)?o(JSON.stringify([n,n])):e(n)?o(t.tokenizer(n,i,t)):"object"!=typeof(a=n)||null===a||Array.isArray(a)?(t=>Array.isArray(t))(n)?o((u=n,Promise.all(u.map(r)))):o(null===n?JSON.stringify([null,"1.00"]):n):o((s=n,new Promise((async e=>{const n={};for(const e in s)n[e]=await r(s[e],e,t);return e(n)}))));var s,a,u})),n=async n=>new Promise((async i=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const o={};for(const t in n)o[t]="_id"!==t?await r(n[t],t):n[t];return i(o)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),i=r(7155),o=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new o(1e3),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),l=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:l.PAGE,_SCORE:l.SCORE,_SEARCH:l.SEARCH,_SORT:l.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:l.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:l.DICTIONARY,DISTINCT:l.DISTINCT,DOCUMENTS:l.DOCUMENTS,DOCUMENT_COUNT:l.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:l.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:l.QUERY,SEARCH:l.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,tokenizer:i.tokenizer,stopwords:[],storeVectors:!0,tokenAppend:"#"},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],i="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>i===t?e():r(new Error("This index was created with "+t+", you are running "+i)))).catch((r=>t.INDEX.STORE.put(n,i).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const i=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>i.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(i)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),i=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().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?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(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])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),l=(e,i={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,i.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),i.PIPELINE):e.GET?t.fii.GET(e.GET,i.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),i.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>i.BUCKETS?t.fii.BUCKETS(...i.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>i.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?o(...i.FACETS).then((t=>Object.assign(r,{FACETS:t}))):o(...i.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return i.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=i.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>i.SCORE?a(t.RESULT,i.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,i.SORT?{RESULT:u(t.RESULT,i.SORT)}:{}))).then((t=>Object.assign(t,i.PAGE?{RESULT:s(t.RESULT,i.PAGE)}:{}))).then((t=>i.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},f=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>f((t=>i(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"}))))))(t),{DICTIONARY:t||null}),DISTINCT:i,DOCUMENTS:(...t)=>f(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:o,PAGE:s,QUERY:(t,e)=>f(l(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>f(((t,e)=>l({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),i=r(9024),o=([t,e,r])=>Promise.resolve([t.match(/[\p{L}\d]+/gu),e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([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])},c=([t,e,r])=>{let{fields:n,lengths:o,join:s=" "}=r.ngrams;return n||(n=[e]),o&&n.includes(e)?[i(t.filter((t=>null!==t)),o).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},l=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],f=([t,e,r])=>{const i=n(t),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>JSON.stringify([t.term[0],(t.positions.length/o).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>o([t,e,r]).then(s).then(a).then(u).then(c).then(l).then(f).then((([t,e,r])=>t)),e.SPLIT=o,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=l,e.SCORE_TERM_FREQUENCY=f},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),o=(r,n,i)=>(e.reset(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],i?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.reset();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(i=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i))))]).then((()=>r));var i}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.reset();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.reset(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.reset(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([o(r,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:o,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>u});var n=r(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class o{constructor(){Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:[]})}enqueue(t,e){var r;const n={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&(null===(r=this._queue[this.size-1])||void 0===r?void 0:r.priority)>=e.priority)return void this._queue.push(n);const i=function(t,e,r){let n=0,i=t.length;for(;i>0;){const r=Math.trunc(i/2);let s=n+r;o=t[s],e.priority-o.priority<=0?(n=++s,i-=r+1):i=r}var o;return n}(this._queue,n);this._queue.splice(i,0,n)}dequeue(){const t=this._queue.shift();return null==t?void 0:t.run}filter(t){return this._queue.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this._queue.length}}const s=()=>{},a=new i;class u extends n{constructor(t){var e,r,n,i;if(super(),Object.defineProperty(this,"_carryoverConcurrencyCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isIntervalIgnored",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalCap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interval",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalEnd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queueClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pendingCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_concurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isPaused",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolveEmpty",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_resolveIdle",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_throwOnTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:o,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=!0===t.throwOnTimeout,this._isPaused=!1===t.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()}),e)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const e=this._queue.dequeue();return!!e&&(this.emit("active"),e(),t&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}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._concurrency=t,this._processQueue()}async add(t,e={}){return new Promise(((r,n)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const i=void 0===this._timeout&&void 0===e.timeout?t():function(t,e,r,n){let i;const o=new Promise(((o,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);e!==Number.POSITIVE_INFINITY?(n={customTimers:{setTimeout,clearTimeout},...n},i=n.customTimers.setTimeout.call(void 0,(()=>{try{o(r())}catch(t){s(t)}}),e),(async()=>{try{o(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()):o(t)}));return o.clear=()=>{clearTimeout(i),i=void 0},o}(Promise.resolve(t()),void 0===e.timeout?this._timeout:e.timeout,(()=>{(void 0===e.throwOnTimeout?this._throwOnTimeout:e.throwOnTimeout)&&n(a)})),o=await i;r(o),this.emit("completed",o)}catch(t){n(t),this.emit("error",t)}this._next()}),e),this._tryToStartAnother(),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((t=>{const e=this._resolveEmpty;this._resolveEmpty=()=>{e(),t()}}))}async onSizeLessThan(t){if(!(this._queue.size{const r=()=>{this._queue.size{const e=this._resolveIdle;this._resolveIdle=()=>{e(),t()}}))}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}}},4147:t=>{"use strict";t.exports=JSON.parse('{"name":"search-index","version":"3.0.1","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.1.0","fuzzyset":"1.0.5","http-server":"14.0.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^16.0.4","stemmer":"^1.0.5","stopword":"^1.0.11","stream-browserify":"^3.0.0","tape":"^5.4.1","tape-run":"^9.0.0","webpack":"^5.67.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.5","level-js":"^6.1.0","leveldown":"^6.1.0","lru-cache":"^6.0.0","ngraminator":"^2.0.6","p-queue":"^7.1.0","term-vector":"^1.0.0"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](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=r(2225);SearchIndex=n})(); \ No newline at end of file diff --git a/dist/search-index-3.0.1.js.LICENSE.txt b/dist/search-index-3.0.1.js.LICENSE.txt new file mode 100644 index 00000000..768a92b0 --- /dev/null +++ b/dist/search-index-3.0.1.js.LICENSE.txt @@ -0,0 +1,21 @@ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +/*! queue-microtask. MIT License. Feross Aboukhadijeh */ + +/*! run-parallel-limit. MIT License. Feross Aboukhadijeh */ + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ diff --git a/dist/search-index-esm-3.0.1.js b/dist/search-index-esm-3.0.1.js new file mode 100644 index 00000000..afc5b7a0 --- /dev/null +++ b/dist/search-index-esm-3.0.1.js @@ -0,0 +1,2 @@ +/*! For license information please see search-index-esm-3.0.1.js.LICENSE.txt */ +var t={8508:(t,e,r)=>{const n=Object.freeze({});function o(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}o.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},o.prototype.put=function(t,e,r){this._checkWritten();const o=this.db._checkKey(t)||this.db._checkValue(e);if(o)throw o;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},o.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},o.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},o.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},o.prototype.clear=function(){return this._checkWritten(),this._clear(),this},o.prototype._clear=function(){this._operations=[]},o.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},o.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},o.prototype._nextTick=r(7212),t.exports=o},3538:(t,e,r)=>{function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,o){t?r(t):void 0===n&&void 0===o?e():e([n,o])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{const n=r(1675),o=r(8738),i=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,l=Object.prototype.hasOwnProperty,f=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!l.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let o=e[n];d(n)&&(o=t._serializeKey(o)),r[n]=o}return r}function d(t){return-1!==f.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=i.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,i)=>t?o(t):void 0===i?r.end(e):void this._del(i,n,o)))};o()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):o(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,i=u(t),s=i[0],a=i[1],c=new o(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},e.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],s=16383,a=0,u=n-o;au?u:a+s));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=i.length;s0)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 o,i,s=[],a=e;a>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},8764:(t,e,r)=>{const n=r(9742),o=r(645),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 f(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|y(t,e);let n=a(r);const o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(H(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(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 u.from(n,e,r);const o=function(t){if(u.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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(t){return l(t),a(t<0?0:0|d(t))}function h(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(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(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 o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(o)return n?-1:z(t).length;e=(""+e).toLowerCase(),o=!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 k(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){let i,s=1,a=t.length,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){let n=-1;for(i=r;ia&&(r=a-u),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=e.length;let s;for(n>i/2&&(n=i/2),s=0;s>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o239?4:e>223?3:e>191?2:1;if(o+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(i=e);break;case 2:r=t[o+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(i=u));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=t[o+1],n=t[o+2],a=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(t){const e=t.length;if(e<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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+=" ... "),""},i&&(u.prototype[i]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,o){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0);const a=Math.min(i,s),c=this.slice(n,o),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 o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function R(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;on)&&(r=n);let o="";for(let n=e;nr)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}function j(t,e,r,n,o){G(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;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 U(t,e,r,n,o){G(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;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 N(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,i){return e=+e,r>>>=0,i||N(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,i){return e=+e,r>>>=0,i||N(t,0,r,8),o.write(t,e,r,n,52,8),r+8}u.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||P(t,e,this.length);let n=this[t],o=1,i=0;for(;++i>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(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||q(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||P(t,4,this.length),o.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),o.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),o.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),o.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[e]=255&t;++i>>=0,r>>>=0,n||C(this,t,e,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return j(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let o=0,i=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return j(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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(o=e;o=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function G(t,e,r,n,o,i){if(t>r||t3?0===e||e===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(i+1)}${n}`:`>= -(2${n} ** ${8*(i+1)-1}${n}) and < 2 ** ${8*(i+1)-1}${n}`:`>= ${e}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",o,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||q(e,t.length-(r+1))}(n,o,i)}function W(t,e){if("number"!=typeof t)throw new M.ERR_INVALID_ARG_TYPE(e,"number",t)}function q(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=V(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=V(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n}),RangeError);const K=/[^+/0-9A-Za-z-_]/g;function z(t,e){let r;e=e||1/0;const n=t.length;let o=null;const i=[];for(let s=0;s55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let o;for(o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function Q(t){return"undefined"==typeof BigInt?Z:t}function Z(){throw new Error("BigInt not supported")}},1924:(t,e,r)=>{var n=r(210),o=r(5559),i=o(n("String.prototype.indexOf"));t.exports=function(t,e){var r=n(t,!!e);return"function"==typeof r&&i(t,".prototype.")>-1?o(r):r}},5559:(t,e,r)=>{var n=r(8612),o=r(210),i=o("%Function.prototype.apply%"),s=o("%Function.prototype.call%"),a=o("%Reflect.apply%",!0)||n.call(s,i),u=o("%Object.getOwnPropertyDescriptor%",!0),c=o("%Object.defineProperty%",!0),l=o("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return a(n,i,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},6957:(t,e,r)=>{var n=r(886);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)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(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))}},2833:(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,o=e.split('"'),i=[[]],s=0,a=o.length,u=0;u{var n=r(8840),o=r(2833);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(!i[t[0]])throw new Error("no decoder for:"+JSON.stringify(t));return i[t[0]](t)},e.object=o.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 i={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"},7171:(t,e,r)=>{const{AbstractChainedBatch:n}=r(4012),o=Symbol("operations");t.exports=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){this.db.batch(this[o],t,e)}}},2790:(t,e,r)=>{const{AbstractIterator:n}=r(4012),o=r(5717),i=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function l(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}o(l,n),l.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},l.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=i(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},l.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},l.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=i(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])l.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=l},6944:(t,e,r)=>{const{AbstractLevelDOWN:n}=r(4012),o=r(5717),i=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],l=Symbol("innerDb"),f=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[l]=t,this[f]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[l][r](...t);const e=a(t,h);return"opening"===this.status?this[f].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[l].iterator(t);if("opening"===this.status){const e=new i(this,t);return this[f].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}o(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[l]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[l].status)return e(t||new Error("Database is not open"));const r=this[f];this[f]=[];for(const t of r)t.iterator?t.iterator.setDb(this[l]):this[l][t.method](...t.args);if(this[f].length>0)throw new Error("Did not expect further operations");e()};"new"===this[l].status||"closed"===this[l].status?this[l].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[l].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=i},2502:(t,e)=>{e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const o=new Promise(((e,o)=>{t.push(n=function(t,...n){t?o(t):e(r?r(...n):n[0])})}));n[e]=o}return n}},780:(t,e,r)=>{const n=r(4012).AbstractLevelDOWN,o=r(4012).AbstractChainedBatch,i=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function l(t,e){if(!(this instanceof l))return new l(t,e);const r=t.supports||{},o=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(o[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,o){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,o)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function f(t,e){i.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){o.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=l,s(l,n),l.prototype.type="encoding-down",l.prototype._serializeKey=l.prototype._serializeValue=function(t){return t},l.prototype._open=function(t,e){this.db.open(t,e)},l.prototype._close=function(t){this.db.close(t)},l.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},l.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},l.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const o=new Array(n.length);for(let i=0;i{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},f.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},f.prototype._end=function(t){this.it.end(t)},s(h,o),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729:t=>{var e=Object.prototype.hasOwnProperty,r="~";function n(){}function o(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function i(t,e,n,i,s){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new o(n,i||t,s),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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,o=[];if(0===this._eventsCount)return o;for(n in t=this._events)e.call(t,n)&&o.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?o.concat(Object.getOwnPropertySymbols(t)):o},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 o=0,i=n.length,s=new Array(i);o{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 o=Number.isNaN||function(t){return t!=t};function i(){i.init.call(this)}t.exports=i,t.exports.once=function(t,e){return new Promise((function(r,n){function o(r){t.removeListener(e,i),n(r)}function i(){"function"==typeof t.removeListener&&t.removeListener("error",o),r([].slice.call(arguments))}y(t,e,i,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&y(t,"error",e,{once:!0})}(t,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.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 u(t){return void 0===t._maxListeners?i.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var o,i,s,c;if(a(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),s=i[e]),void 0===s)s=i[e]=r,++t._eventsCount;else if("function"==typeof s?s=i[e]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(o=u(t))>0&&s.length>o&&!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,c=l,console&&console.warn&&console.warn(c)}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 f(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=l.bind(n);return o.listener=r,n.wrapFn=o,o}function h(t,e,r){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]: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 u=i[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,l=d(u,c);for(r=0;r=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},i.prototype.listeners=function(t){return h(this,t,!0)},i.prototype.rawListeners=function(t){return h(this,t,!1)},i.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9203:(t,e,r)=>{const n=r(7270),o=r(9558);t.exports=t=>n(Object.assign({db:o},t))},7270:(t,e,r)=>{const n=r(2483),o=r(780),i=r(4918),s=r(9563),a=r(8936),u=t=>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))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),i(o(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,o)=>n?r(n):e(Object.assign(t,{_db:o}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((o,i)=>{if(Array.isArray(t))return i(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){const e=t.split(":"),r=e.pop(),i=e.pop();return o(i?{FIELD:[i],VALUE:{GTE:r,LTE:r}}:{FIELD:n,VALUE:{GTE:r,LTE:r}})}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:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?o(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),o(t))}))},9563:(t,e,r)=>{const n=r(6782),o=r(2483);o.LO=null,o.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),i=async(e,n=(t=>new Promise((e=>e(t)))))=>new Promise((async(o,i)=>{const a=t=>void 0===t?o(void 0):t instanceof Promise?o(t):void 0;try{a(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return i(t)}return Array.isArray(e)?o(e):o(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>i(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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(o.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((o=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",o)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",o.LO],lte:["FIELD",o.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),l=(t,e)=>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))))]})))):t,f=async t=>r(t).then((t=>i(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const o=[];t._db.createReadStream(e).on("data",(t=>{o.push(t)})).on("end",(()=>r(o)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:l(t.flat(),r),FACETS:l(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:l,BUCKET:f,BUCKETS:(...t)=>Promise.all(t.map(f)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:i,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?i(t):t,e(r)?i(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),o=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const o=[];return n(e._object).forEach((function(e){let n=!0;const i=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===i&&(n=!1),r.doNotIndexField.filter((t=>i.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([i,t])}catch(t){e=JSON.stringify([i,[this.node]])}o.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:o}},i=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((l=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),o(t).EXIST(...n.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,o)=>{const i=new Set(e),s=new Set(t[n[o]]);if("put"===r)return{key:["IDX",...JSON.parse(n[o])],type:r,value:[...new Set([...i,...s])].sort()};if("del"===r){const t=[...new Set([...i].filter((t=>!s.has(t))))];return{key:["IDX",...JSON.parse(n[o])],type:0===t.length?"del":"put",value:t}}return e}))))})(((t,e)=>t.map((t=>r(t,e))).reduce(i,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>l(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>o(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},9804:t=>{var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,o){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var i=t.length;if(i===+i)for(var s=0;s{var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";t.exports=function(t){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(e+i);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=i.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return i.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,i.length-a.length),l=[],f=0;f{var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{var n,o=SyntaxError,i=Function,s=TypeError,a=function(t){try{return i('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,f=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?h((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%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?h(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var o=t("%AsyncGenerator%");o&&(r=h(o.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,O=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,T,(function(t,e,r,o){n[n.length]=r?_(o,A,"$1"):e||t})),n},x=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var i=y[n];if(i===p&&(i=g(n)),void 0===i&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var r=O(t),n=r.length>0?r[0]:"",i=x("%"+n+"%",e),a=i.name,c=i.value,l=!1,f=i.alias;f&&(n=f[0],E(r,w([0,1],f)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!l&&(y[a]=c)}}return c}},1405:(t,e,r)=>{var n="undefined"!=typeof Symbol&&Symbol,o=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},5419: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 o=Object.getOwnPropertyDescriptor(t,e);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},6410:(t,e,r)=>{var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<>1,l=-7,f=r?o-1:0,h=r?-1:1,p=t[e+f];for(f+=h,i=p&(1<<-l)-1,p>>=-l,l+=a;l>0;i=256*i+t[e+f],f+=h,l-=8);for(s=i&(1<<-l)-1,i>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,l=(1<>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-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*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,o),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{var n=r(6410)(),o=r(1924)("Object.prototype.toString"),i=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===o(t)},s=function(t){return!!i(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==o(t)&&"[object Function]"===o(t.callee)},a=function(){return i(arguments)}();i.isLegacyArguments=s,t.exports=a?i:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},8662:(t,e,r)=>{var n,o=Object.prototype.toString,i=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(i.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===o.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{var n=r(9804),o=r(3083),i=r(1924),s=i("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=o(),l=i("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{const n=r(964),o=new Set(["lt","gt","lte","gte"]);function i(t){if(!(this instanceof i))return new i(t);this.opts=t||{},this.encodings=n}t.exports=i,i.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},i.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},i.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},i.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},i.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},i.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},i.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},i.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},i.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=o.has(r)?this.encodeKey(t[r],t):t[r]}return e},i.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},i.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},i.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:i,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:i,buffer:!0,type:"binary"},e.none={encode:i,decode:i,buffer:!1,type:"id"},e.id=e.none;const o=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of o)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function i(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{const n=r(5717),{Readable:o}=r(8473);function i(t,e){if(!(this instanceof i))return new i(t,e);e=e||{},o.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=i,n(i,o),i.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},i.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{t.exports=p;const n=r(4012).AbstractLevelDOWN,o=r(5717),i=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),l=r(2854),f=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}o(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let o;try{o=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(o,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,o=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=o.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));i(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let o;try{o=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(o,r)},p.prototype._put=function(t,e,r,n){const o=this.store("readwrite");let i;try{i=o.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(i,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("readwrite"),o=n.transaction;let i,s=0;o.onabort=function(){r(i||o.error||new Error("aborted by user"))},o.oncomplete=function(){r()},function e(){const r=t[s++],a=r.key;let u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return i=t,void o.abort()}s=0)return l(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function o(t){if(t)return s(t);e.next(i)}function i(t,e,i){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(i,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,o)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},o()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{const n=r(5717),o=r(4012).AbstractIterator,i=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(o.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=i(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,o),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854:t=>{t.exports=function(t,e,r,n,o){if(0===n.limit)return t._nextTick(o);const i=t.db.transaction([e],"readwrite"),s=i.objectStore(e);let a=0;i.oncomplete=function(){o()},i.onabort=function(){o(i.error||new Error("aborted by user"))};const u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{const n=r(8764).Buffer,o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):o(t):t instanceof ArrayBuffer?e?n.from(t):i(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{const n=r(2303),o=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,o),r=n.upperBound(t,o),i=n.lowerBoundExclusive(t,o),s=n.upperBoundExclusive(t,o);return e!==o&&r!==o?IDBKeyRange.bound(e,r,i,s):e!==o?IDBKeyRange.lowerBound(e,i):r!==o?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{const n=r(8764).Buffer,o=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:o(String(t)):String(t)}},1228:(t,e,r)=>{const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{const n=r(6604).WriteError,o=r(6957),i=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=i(t,e),e=o.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{const n=r(7187).EventEmitter,o=r(9539).inherits,i=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),l=r(6957),f=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let o;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(o=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,o);throw o}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,o(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=l.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new i(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=l.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=f(r,n),w(this,n=l.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=f(t,e),t=h(t),w(this,e=l.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{const n=r(4411),o=Symbol("max"),i=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),u=Symbol("maxAge"),c=Symbol("dispose"),l=Symbol("noDisposeOnSet"),f=Symbol("lruList"),h=Symbol("cache"),p=Symbol("updateAgeOnGet"),d=()=>1,y=(t,e,r)=>{const n=t[h].get(e);if(n){const e=n.value;if(g(t,e)){if(m(t,n),!t[a])return}else r&&(t[p]&&(n.value.now=Date.now()),t[f].unshiftNode(n));return e.value}},g=(t,e)=>{if(!e||!e.maxAge&&!t[u])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[u]&&r>t[u]},b=t=>{if(t[i]>t[o])for(let e=t[f].tail;t[i]>t[o]&&null!==e;){const r=e.prev;m(t,e),e=r}},m=(t,e)=>{if(e){const r=e.value;t[c]&&t[c](r.key,r.value),t[i]-=r.length,t[h].delete(r.key),t[f].removeNode(e)}};class v{constructor(t,e,r,n,o){this.key=t,this.value=e,this.length=r,this.now=n,this.maxAge=o||0}}const w=(t,e,r,n)=>{let o=r.value;g(t,o)&&(m(t,r),t[a]||(o=void 0)),o&&e.call(n,o.value,o.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[o]=t.max||1/0;const e=t.length||d;if(this[s]="function"!=typeof e?d:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[p]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[o]=t||1/0,b(this)}get max(){return this[o]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[u]=t,b(this)}get maxAge(){return this[u]}set lengthCalculator(t){"function"!=typeof t&&(t=d),t!==this[s]&&(this[s]=t,this[i]=0,this[f].forEach((t=>{t.length=this[s](t.value,t.key),this[i]+=t.length}))),b(this)}get lengthCalculator(){return this[s]}get length(){return this[i]}get itemCount(){return this[f].length}rforEach(t,e){e=e||this;for(let r=this[f].tail;null!==r;){const n=r.prev;w(this,t,r,e),r=n}}forEach(t,e){e=e||this;for(let r=this[f].head;null!==r;){const n=r.next;w(this,t,r,e),r=n}}keys(){return this[f].toArray().map((t=>t.key))}values(){return this[f].toArray().map((t=>t.value))}reset(){this[c]&&this[f]&&this[f].length&&this[f].forEach((t=>this[c](t.key,t.value))),this[h]=new Map,this[f]=new n,this[i]=0}dump(){return this[f].map((t=>!g(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[f]}set(t,e,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](e,t);if(this[h].has(t)){if(a>this[o])return m(this,this[h].get(t)),!1;const s=this[h].get(t).value;return this[c]&&(this[l]||this[c](t,s.value)),s.now=n,s.maxAge=r,s.value=e,this[i]+=a-s.length,s.length=a,this.get(t),b(this),!0}const p=new v(t,e,a,n,r);return p.length>this[o]?(this[c]&&this[c](t,e),!1):(this[i]+=p.length,this[f].unshift(p),this[h].set(t,this[f].head),b(this),!0)}has(t){if(!this[h].has(t))return!1;const e=this[h].get(t).value;return!g(this,e)}get(t){return y(this,t,!0)}peek(t){return y(this,t,!1)}pop(){const t=this[f].tail;return t?(m(this,t),t.value):null}del(t){m(this,this[h].get(t))}load(t){this.reset();const e=Date.now();for(let r=t.length-1;r>=0;r--){const n=t[r],o=n.e||0;if(0===o)this.set(n.k,n.v);else{const t=o-e;t>0&&this.set(n.k,n.v,t)}}}prune(){this[h].forEach(((t,e)=>y(this,e,!1)))}}},2303:(t,e,r)=>{var n=r(8764).Buffer;function o(t){return void 0!==t&&""!==t}function i(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),o=0;oe?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!i(t,"gt")},l=e.upperBoundInclusive=function(t){return!i(t,"lt")},f=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!l(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?l(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):l(t)},e.toLtgt=function(t,r,n,o,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(o,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),i(r,"max")&&delete r.max,i(r,"min")&&delete r.min,i(r,"start")&&delete r.start,i(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var i=u(t);if(o(i)&&((s=n(r,i))<0||0===s&&f(t)))return!1;var s,a=d(t);return!o(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},9024:t=>{const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.exports=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()}},4155:t=>{var e,r,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function s(t){if(e===setTimeout)return setTimeout(t,0);if((e===o||!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:o}catch(t){e=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(t){r=i}}();var a,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!c){var t=s(f);c=!0;for(var e=u.length;e;){for(a=u,u=[];++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)))},4281:t=>{var e={};function r(t,r,n){n||(n=Error);var o=function(t){var e,n;function o(e,n,o){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,o))||this}return n=t,(e=o).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,o}(n);o.prototype.name=n.name,o.prototype.code=t,e[t]=o}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var o,i,s,a,u;if("string"==typeof e&&(i="not ",e.substr(0,i.length)===i)?(o="must not be",e=e.replace(/^not /,"")):o="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(o," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(o," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{var n=r(4155),o=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var i=r(9481),s=r(4229);r(5717)(l,i);for(var a=o(s.prototype),u=0;u{t.exports=o;var n=r(4605);function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}r(5717)(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{var n,o=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var i,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},l=r(4616);i=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,o){n=n||r(6753),t=t||{},"boolean"!=typeof o&&(o=e instanceof n),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",o),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=r(2553).s),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,o){i("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(i("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?k(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,L(t)))}}(t,a);else if(o||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):x(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):P(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;i("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(i("emitReadable",e.flowing),e.emittedReadable=!0,o.nextTick(L,t))}function L(t){var e=t._readableState;i("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function P(t,e){e.readingMore||(e.readingMore=!0,o.nextTick(C,t,e))}function C(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){i("readable nexttick read 0"),t.read(0)}function N(t,e){i("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(i("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function M(t){var e=t._readableState;i("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,o.nextTick(F,e,t))}function F(t,e){if(i("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function V(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return i("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?M(this):k(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&M(this),null;var n,o=e.needReadable;return i("need readable",o),(0===e.length||e.length-t0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&M(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===o.stdout||t===o.stderr?y:u;function u(){i("onend"),t.end()}n.endEmitted?o.nextTick(a):r.once("end",a),t.on("unpipe",(function e(o,s){i("onunpipe"),o===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,i("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",f),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",c);var l=!1;function f(e){i("ondata");var o=t.write(e);i("dest.write",o),!1===o&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==V(n.pipes,t))&&!l&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){i("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){i("onfinish"),t.removeListener("close",p),y()}function y(){i("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,o=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?k(this):n.reading||o.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&o.nextTick(j,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||o.nextTick(j,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(i("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,o.nextTick(N,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var o in t.on("end",(function(){if(i("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(o){i("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(n=!0,t.pause()))})),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var s=0;s{t.exports=l;var n=r(4281).q,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var o=this._readableState;o.reading=!1,(o.needReadable||o.length{var n,o=r(4155);function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var o=n.callback;e.pendingcb--,o(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,l=r.g.Uint8Array||function(){},f=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=f.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if("function"!=typeof i)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,i){--e.pendingcb,r?(o.nextTick(i,n),o.nextTick(L,t,e),t._writableState.errorEmitted=!0,_(t,n)):(i(n),t._writableState.errorEmitted=!0,_(t,n),L(t,e))}(t,r,n,e,i);else{var s=I(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),n?o.nextTick(x,t,r,s,i):x(t,r,s,i)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,o,i,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(o,e.onwrite):t._write(o,i,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),L(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,o=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,O(t,e,!0,e.length,o,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function k(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),L(t,e)}))}function L(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,o.nextTick(k,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,i=this._writableState,s=!1,a=!i.objectMode&&(n=t,c.isBuffer(n)||n instanceof l);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=i.defaultEncoding),"function"!=typeof r&&(r=S),i.ending?function(t,e){var r=new w;_(t,r),o.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var i;return null===r?i=new v:"string"==typeof r||e.objectMode||(i=new d("chunk",["string","Buffer"],r)),!i||(_(t,i),o.nextTick(n,i),!1)}(this,i,t,r))&&(i.pendingcb++,s=function(t,e,r,n,o,i){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,o);n!==s&&(r=!0,o="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,L(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{var n,o=r(4155);function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[f]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){o.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((i(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){o.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[l]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var i=this[p].read();if(null!==i)return Promise.resolve(d(i,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(i(e={},p,{value:t,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,u,{value:null,writable:!0}),i(e,c,{value:null,writable:!0}),i(e,l,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var n=r[p].read();n?(r[f]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[f]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[f]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[l]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,o=s.allocUnsafe(t>>>0),i=this.head,a=0;i;)e=i.data,r=o,n=a,s.prototype.copy.call(e,r,n),a+=i.data.length,i=i.next;return o}},{key:"consume",value:function(t,e){var r;return to.length?o.length:t;if(i===o.length?n+=o:n+=o.slice(0,t),0==(t-=i)){i===o.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var o=r.data,i=t>o.length?o.length:t;if(o.copy(e,e.length-t,0,i),0==(t-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{var n=r(4155);function o(t,e){s(t,e),i(t)}function i(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(i,r):(r._writableState.errorEmitted=!0,n.nextTick(o,r,t)):n.nextTick(o,r,t):e?(n.nextTick(i,r),e(t)):n.nextTick(i,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function o(){}t.exports=function t(e,r,i){if("function"==typeof r)return t(e,null,r);r||(r={}),i=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),o=0;o{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{var n,o=r(4281).q,i=o.ERR_MISSING_ARGS,s=o.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,o,i){i=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(i);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:o},(function(t){if(t)return i(t);a=!0,i()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void i(e||new s("pipe"))}}function c(t){t()}function l(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),i||(s.forEach(c),o(n))}))}));return e.reduce(l)}},2457:(t,e,r)=>{var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,o){var i=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,o,r);if(null!=i){if(!isFinite(i)||Math.floor(i)!==i||i<0)throw new n(o?r:"highWaterMark",i);return Math.floor(i)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(t,e,r)=>{t.exports=function(t,e,r){if("number"!=typeof e)throw new Error("second argument must be a Number");let o,i,s,a,u,c,l=!0;function f(t){function e(){r&&r(t,o),r=null}l?n(e):e()}function h(e,r,n){if(o[e]=n,r&&(u=!0),0==--s||r)f(r);else if(!u&&c{var n=r(396).Buffer,o=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===o||!o(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=l,this.end=f,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=i,i.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(o>0&&(t.lastNeed=o-1),o):--n=0?(o>0&&(t.lastNeed=o-2),o):--n=0?(o>0&&(2===o?o=0:t.lastNeed=o-3),o):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},i.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),o=n.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return o(t,e,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?t.exports=n:(i(n,e),e.Buffer=s),s.prototype=Object.create(o.prototype),i(o,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=o(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971:t=>{t.exports=function(t,e){e=Object.assign({},{ngramLengths:[1]},e);const r=t.reduce(((t,r,n,o)=>(e.ngramLengths.forEach((e=>{var i=o.slice(n,n+e);i.length===e&&(r=JSON.stringify(i),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]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],l=!0;return function t(f){var h=r?o(f):f,p={},d=!0,y={node:h,node_:f,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){l=!1},block:function(){d=!1}};if(!l)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=i(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{var n=r(2584),o=r(8662),i=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=a(Object.prototype.toString),f=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===l(t)}function m(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function E(t){return"[object ArrayBuffer]"===l(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===l(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=o,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===i(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===i(t)},e.isUint16Array=function(t){return"Uint16Array"===i(t)},e.isUint32Array=function(t){return"Uint32Array"===i(t)},e.isInt8Array=function(t){return"Int8Array"===i(t)},e.isInt16Array=function(t){return"Int16Array"===i(t)},e.isInt32Array=function(t){return"Int32Array"===i(t)},e.isFloat32Array=function(t){return"Float32Array"===i(t)},e.isFloat64Array=function(t){return"Float64Array"===i(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===i(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===i(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===l(t)}function x(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function R(t){return g(t,f)}function I(t){return g(t,h)}function k(t){return g(t,p)}function L(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=I,e.isBooleanObject=k,e.isBigIntObject=L,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return R(t)||I(t)||k(t)||L(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),o=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function f(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,t);return v(o)||(o=h(t,o,n)),o}var i=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(i)return i;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,l="",f=!1,_=["{","}"];return y(r)&&(f=!0,_=["[","]"]),A(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(l=" "+RegExp.prototype.toString.call(r)),S(r)&&(l=" "+Date.prototype.toUTCString.call(r)),T(r)&&(l=" "+p(r)),0!==s.length||f&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=f?function(t,e,r,n,o){for(var i=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,_)):_[0]+l+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,o,i){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,o)||{value:e[o]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),k(n,o)||(s="["+o+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=i?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(i&&o.match(/^\d+$/))return a;(s=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",I(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(L&&t[L]){var e;if("function"!=typeof(e=t[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,L,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),o=[],i=0;i{var n=r(9804),o=r(3083),i=r(1924),s=i("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=o(),l=i("String.prototype.slice"),f={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var o=p(r);n=h(o,Symbol.toStringTag)}f[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(f,(function(r,n){if(!e)try{var o=r.call(t);o===n&&(e=o)}catch(t){}})),e}(t):l(s(t),8,-1))}},9602:t=>{t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},4411:(t,e,r)=>{function n(t){var e=this;if(e instanceof n||(e=new n),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var r=0,o=arguments.length;r1)r=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var o=0;null!==n;o++)r=t(r,n.value,o),n=n.next;return r},n.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var o=this.length-1;null!==n;o--)r=t(r,n.value,o),n=n.prev;return r},n.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;null!==r;e++)t[e]=r.value,r=r.next;return t},n.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;null!==r;e++)t[e]=r.value,r=r.prev;return t},n.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var r=new n;if(ethis.length&&(e=this.length);for(var o=0,i=this.head;null!==i&&othis.length&&(e=this.length);for(var o=this.length,i=this.tail;null!==i&&o>e;o--)i=i.prev;for(;null!==i&&o>t;o--,i=i.prev)r.push(i.value);return r},n.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,o=this.head;null!==o&&n{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,o)=>new Promise((async i=>{return Number.isInteger(n)?i(JSON.stringify([n,n])):e(n)?i(t.tokenizer(n,o,t)):"object"!=typeof(a=n)||null===a||Array.isArray(a)?(t=>Array.isArray(t))(n)?i((u=n,Promise.all(u.map(r)))):i(null===n?JSON.stringify([null,"1.00"]):n):i((s=n,new Promise((async e=>{const n={};for(const e in s)n[e]=await r(s[e],e,t);return e(n)}))));var s,a,u})),n=async n=>new Promise((async o=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const i={};for(const t in n)i[t]="_id"!==t?await r(n[t],t):n[t];return o(i)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),o=r(7155),i=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new i(1e3),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),l=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:l.PAGE,_SCORE:l.SCORE,_SEARCH:l.SEARCH,_SORT:l.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:o,ALL_DOCUMENTS:l.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:l.DICTIONARY,DISTINCT:l.DISTINCT,DOCUMENTS:l.DOCUMENTS,DOCUMENT_COUNT:l.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:l.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:l.QUERY,SEARCH:l.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,tokenizer:o.tokenizer,stopwords:[],storeVectors:!0,tokenAppend:"#"},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],o="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>o===t?e():r(new Error("This index was created with "+t+", you are running "+o)))).catch((r=>t.INDEX.STORE.put(n,o).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const o=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>o.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(o)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),o=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),i=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().then((e=>t.map(((t,n,o)=>{const i=Math.log((e+1)/o.length);return t._score=+t._match.filter(r).reduce(((t,e)=>t+i*+e.SCORE),0).toFixed(2),t})))):"PRODUCT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(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])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),l=(e,o={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,o.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),o.PIPELINE):e.GET?t.fii.GET(e.GET,o.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),o.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>o.BUCKETS?t.fii.BUCKETS(...o.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>o.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?i(...o.FACETS).then((t=>Object.assign(r,{FACETS:t}))):i(...o.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return o.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=o.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>o.SCORE?a(t.RESULT,o.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,o.SORT?{RESULT:u(t.RESULT,o.SORT)}:{}))).then((t=>Object.assign(t,o.PAGE?{RESULT:s(t.RESULT,o.PAGE)}:{}))).then((t=>o.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},f=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>f((t=>o(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"}))))))(t),{DICTIONARY:t||null}),DISTINCT:o,DOCUMENTS:(...t)=>f(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:i,PAGE:s,QUERY:(t,e)=>f(l(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>f(((t,e)=>l({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),o=r(9024),i=([t,e,r])=>Promise.resolve([t.match(/[\p{L}\d]+/gu),e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([t,e,r])=>Promise.resolve([t.map((t=>r.caseSensitive?t:t.toLowerCase())),e,r]),u=([t,e,r])=>{const{fields:n,values:o}=r.replace,i=()=>t.reduce(((t,e)=>[e,...t,...o[e]||[]]),[]);return o?n?n.includes(e)?Promise.resolve([i(),e,r]):Promise.resolve([t,e,r]):Promise.resolve([i(),e,r]):Promise.resolve([t,e,r])},c=([t,e,r])=>{let{fields:n,lengths:i,join:s=" "}=r.ngrams;return n||(n=[e]),i&&n.includes(e)?[o(t.filter((t=>null!==t)),i).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},l=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],f=([t,e,r])=>{const o=n(t),i=o.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([o.map((t=>JSON.stringify([t.term[0],(t.positions.length/i).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>i([t,e,r]).then(s).then(a).then(u).then(c).then(l).then(f).then((([t,e,r])=>t)),e.SPLIT=i,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=l,e.SCORE_TERM_FREQUENCY=f},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const o=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),i=(r,n,o)=>(e.reset(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],o?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.reset();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(o=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-o))))]).then((()=>r));var o}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.reset();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.reset(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.reset(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([i(r,e.map((t=>t._id)),!t.storeRawDocs),o(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:i,_INCREMENT_DOC_COUNT:o}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{r.r(e),r.d(e,{default:()=>u});var n=r(6729);class o extends Error{constructor(t){super(t),this.name="TimeoutError"}}class i{constructor(){Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:[]})}enqueue(t,e){var r;const n={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&(null===(r=this._queue[this.size-1])||void 0===r?void 0:r.priority)>=e.priority)return void this._queue.push(n);const o=function(t,e,r){let n=0,o=t.length;for(;o>0;){const r=Math.trunc(o/2);let s=n+r;i=t[s],e.priority-i.priority<=0?(n=++s,o-=r+1):o=r}var i;return n}(this._queue,n);this._queue.splice(o,0,n)}dequeue(){const t=this._queue.shift();return null==t?void 0:t.run}filter(t){return this._queue.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this._queue.length}}const s=()=>{},a=new o;class u extends n{constructor(t){var e,r,n,o;if(super(),Object.defineProperty(this,"_carryoverConcurrencyCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isIntervalIgnored",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalCap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interval",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalEnd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queueClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pendingCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_concurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isPaused",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolveEmpty",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_resolveIdle",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_throwOnTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:i,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(o=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==o?o:""}\` (${typeof t.interval})`);this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=!0===t.throwOnTimeout,this._isPaused=!1===t.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()}),e)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const e=this._queue.dequeue();return!!e&&(this.emit("active"),e(),t&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}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._concurrency=t,this._processQueue()}async add(t,e={}){return new Promise(((r,n)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const o=void 0===this._timeout&&void 0===e.timeout?t():function(t,e,r,n){let o;const i=new Promise(((i,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);e!==Number.POSITIVE_INFINITY?(n={customTimers:{setTimeout,clearTimeout},...n},o=n.customTimers.setTimeout.call(void 0,(()=>{try{i(r())}catch(t){s(t)}}),e),(async()=>{try{i(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,o)}})()):i(t)}));return i.clear=()=>{clearTimeout(o),o=void 0},i}(Promise.resolve(t()),void 0===e.timeout?this._timeout:e.timeout,(()=>{(void 0===e.throwOnTimeout?this._throwOnTimeout:e.throwOnTimeout)&&n(a)})),i=await o;r(i),this.emit("completed",i)}catch(t){n(t),this.emit("error",t)}this._next()}),e),this._tryToStartAnother(),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((t=>{const e=this._resolveEmpty;this._resolveEmpty=()=>{e(),t()}}))}async onSizeLessThan(t){if(!(this._queue.size{const r=()=>{this._queue.size{const e=this._resolveIdle;this._resolveIdle=()=>{e(),t()}}))}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}}},4147:t=>{t.exports=JSON.parse('{"name":"search-index","version":"3.0.1","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.1.0","fuzzyset":"1.0.5","http-server":"14.0.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^16.0.4","stemmer":"^1.0.5","stopword":"^1.0.11","stream-browserify":"^3.0.0","tape":"^5.4.1","tape-run":"^9.0.0","webpack":"^5.67.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.5","level-js":"^6.1.0","leveldown":"^6.1.0","lru-cache":"^6.0.0","ngraminator":"^2.0.6","p-queue":"^7.1.0","term-vector":"^1.0.0"}}')}},e={};function r(n){var o=e[n];if(void 0!==o)return o.exports;var i=e[n]={exports:{}};return t[n](i,i.exports,r),i.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})},r(2225); \ No newline at end of file diff --git a/dist/search-index-esm-3.0.1.js.LICENSE.txt b/dist/search-index-esm-3.0.1.js.LICENSE.txt new file mode 100644 index 00000000..768a92b0 --- /dev/null +++ b/dist/search-index-esm-3.0.1.js.LICENSE.txt @@ -0,0 +1,21 @@ +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ + +/*! queue-microtask. MIT License. Feross Aboukhadijeh */ + +/*! run-parallel-limit. MIT License. Feross Aboukhadijeh */ + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ diff --git a/dist/search-index.js b/dist/search-index.js new file mode 100644 index 00000000..a6276ea0 --- /dev/null +++ b/dist/search-index.js @@ -0,0 +1,2 @@ +/*! For license information please see search-index-3.0.1.js.LICENSE.txt */ +var SearchIndex;(()=>{var t={8508:(t,e,r)=>{"use strict";const n=Object.freeze({});function i(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._operations=[],this._written=!1}i.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},i.prototype.put=function(t,e,r){this._checkWritten();const i=this.db._checkKey(t)||this.db._checkValue(e);if(i)throw i;return t=this.db._serializeKey(t),e=this.db._serializeValue(e),this._put(t,e,null!=r?r:n),this},i.prototype._put=function(t,e,r){this._operations.push({...r,type:"put",key:t,value:e})},i.prototype.del=function(t,e){this._checkWritten();const r=this.db._checkKey(t);if(r)throw r;return t=this.db._serializeKey(t),this._del(t,null!=e?e:n),this},i.prototype._del=function(t,e){this._operations.push({...e,type:"del",key:t})},i.prototype.clear=function(){return this._checkWritten(),this._clear(),this},i.prototype._clear=function(){this._operations=[]},i.prototype.write=function(t,e){if(this._checkWritten(),"function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("write() requires a callback argument");"object"==typeof t&&null!==t||(t={}),this._written=!0,this._write(t,e)},i.prototype._write=function(t,e){this.db._batch(this._operations,t,e)},i.prototype._nextTick=r(7212),t.exports=i},3538:(t,e,r)=>{"use strict";function n(t){if("object"!=typeof t||null===t)throw new TypeError("First argument must be an abstract-leveldown compliant store");this.db=t,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){let e=this;if(void 0===t)e=new Promise((function(e,r){t=function(t,n,i){t?r(t):void 0===n&&void 0===i?e():e([n,i])}}));else if("function"!=typeof t)throw new Error("next() requires a callback argument");return this._ended?(this._nextTick(t,new Error("cannot call next() after end()")),e):this._nexting?(this._nextTick(t,new Error("cannot call next() before previous next() has completed")),e):(this._nexting=!0,this._next(((e,...r)=>{this._nexting=!1,t(e,...r)})),e)},n.prototype._next=function(t){this._nextTick(t)},n.prototype.seek=function(t){if(this._ended)throw new Error("cannot call seek() after end()");if(this._nexting)throw new Error("cannot call seek() before next() has completed");t=this.db._serializeKey(t),this._seek(t)},n.prototype._seek=function(t){},n.prototype.end=function(t){let e;if(void 0===t)e=new Promise((function(e,r){t=function(t){t?r(t):e()}}));else if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?(this._nextTick(t,new Error("end() already called on iterator")),e):(this._ended=!0,this._end(t),e)},n.prototype._end=function(t){this._nextTick(t)},n.prototype[Symbol.asyncIterator]=async function*(){try{let t;for(;void 0!==(t=await this.next());)yield t}finally{this._ended||await this.end()}},n.prototype._nextTick=r(7212),t.exports=n},2554:(t,e,r)=>{"use strict";const n=r(1675),i=r(8738),o=r(6957),s=r(3538),a=r(8508),u=r(70).R,c=r(70).F,l=Object.prototype.hasOwnProperty,f=["lt","lte","gt","gte"];function h(t){this.status="new",this.supports=n(t,{status:!0})}function p(t,e){const r={};for(const n in e){if(!l.call(e,n))continue;if("start"===n||"end"===n)throw new Error('Legacy range options ("start" and "end") have been removed');let i=e[n];d(n)&&(i=t._serializeKey(i)),r[n]=i}return r}function d(t){return-1!==f.indexOf(t)}h.prototype.open=function(t,e){const r=this.status;if("function"==typeof t&&(e=t),"function"!=typeof e)throw new Error("open() requires a callback argument");"object"==typeof t&&null!==t||(t={}),t.createIfMissing=!1!==t.createIfMissing,t.errorIfExists=!!t.errorIfExists,this.status="opening",this._open(t,(t=>{if(t)return this.status=r,e(t);this.status="open",e()}))},h.prototype._open=function(t,e){this._nextTick(e)},h.prototype.close=function(t){const e=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close((r=>{if(r)return this.status=e,t(r);this.status="closed",t()}))},h.prototype._close=function(t){this._nextTick(t)},h.prototype.get=function(t,e,r){if("function"==typeof e&&(r=e),"function"!=typeof r)throw new Error("get() requires a callback argument");const n=this._checkKey(t);if(n)return this._nextTick(r,n);t=this._serializeKey(t),"object"==typeof e&&null!==e||(e={}),e.asBuffer=!1!==e.asBuffer,this._get(t,e,r)},h.prototype._get=function(t,e,r){this._nextTick((function(){r(new Error("NotFound"))}))},h.prototype.getMany=function(t,e,r){if(r=u(e,r),r=o.fromCallback(r),e=c(e),function(t,e){return!t.isOperational()&&(t._nextTick(e,new Error("Database is not open")),!0)}(this,r))return r.promise;if(!Array.isArray(t))return this._nextTick(r,new Error("getMany() requires an array argument")),r.promise;if(0===t.length)return this._nextTick(r,null,[]),r.promise;"boolean"!=typeof e.asBuffer&&(e={...e,asBuffer:!0});const n=new Array(t.length);for(let e=0;e{if(t)return r.end((function(){e(t)}));r.next(((t,o)=>t?i(t):void 0===o?r.end(e):void this._del(o,n,i)))};i()},h.prototype._setupIteratorOptions=function(t){return(t=p(this,t)).reverse=!!t.reverse,t.keys=!1!==t.keys,t.values=!1!==t.values,t.limit="limit"in t?t.limit:-1,t.keyAsBuffer=!1!==t.keyAsBuffer,t.valueAsBuffer=!1!==t.valueAsBuffer,t},h.prototype.iterator=function(t){return"object"==typeof t&&null!==t||(t={}),t=this._setupIteratorOptions(t),this._iterator(t)},h.prototype._iterator=function(t){return new s(this)},h.prototype._chainedBatch=function(){return new a(this)},h.prototype._serializeKey=function(t){return t},h.prototype._serializeValue=function(t){return t},h.prototype._checkKey=function(t){return null==t?new Error("key cannot be `null` or `undefined`"):i(t)&&0===t.length?new Error("key cannot be an empty Buffer"):""===t?new Error("key cannot be an empty String"):Array.isArray(t)&&0===t.length?new Error("key cannot be an empty Array"):void 0},h.prototype._checkValue=function(t){if(null==t)return new Error("value cannot be `null` or `undefined`")},h.prototype.isOperational=function(){return"open"===this.status||this._isOperational()},h.prototype._isOperational=function(){return!1},h.prototype._nextTick=r(7212),t.exports=h},4012:(t,e,r)=>{"use strict";e.AbstractLevelDOWN=r(2554),e.AbstractIterator=r(3538),e.AbstractChainedBatch=r(8508)},70:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},7212:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9742:(t,e)=>{"use strict";e.byteLength=function(t){var e=u(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,o=u(t),s=o[0],a=o[1],c=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,a)),l=0,f=a>0?s-4:s;for(r=0;r>16&255,c[l++]=e>>8&255,c[l++]=255&e;return 2===a&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,c[l++]=255&e),1===a&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,c[l++]=e>>8&255,c[l++]=255&e),c},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,a=o.length;s0)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},8764:(t,e,r)=>{"use strict";const n=r(9742),i=r(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=u,e.SlowBuffer=function(t){return+t!=t&&(t=0),u.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,u.prototype),e}function u(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 f(t)}return c(t,e,r)}function c(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!u.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(H(t,Uint8Array)){const e=new Uint8Array(t);return p(e.buffer,e.byteOffset,e.byteLength)}return h(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(H(t,ArrayBuffer)||t&&H(t.buffer,ArrayBuffer))return p(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(H(t,SharedArrayBuffer)||t&&H(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 u.from(n,e,r);const i=function(t){if(u.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||Y(t.length)?a(0):h(t):"Buffer"===t.type&&Array.isArray(t.data)?h(t.data):void 0}(t);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return u.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 f(t){return l(t),a(t<0?0:0|d(t))}function h(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(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||H(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 z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:z(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 k(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return R(this,e,r);case"latin1":case"binary":return I(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function b(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function m(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),Y(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=u.from(e,n)),u.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,u=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,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),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 A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function O(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,u;switch(s){case 1:e<128&&(o=e);break;case 2:r=t[i+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(o=u));break;case 3:r=t[i+1],n=t[i+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=t[i+1],n=t[i+2],a=t[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}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<=x)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn.length?(u.isBuffer(e)||(e=u.from(e)),e.copy(n,i)):Uint8Array.prototype.set.call(n,e,i);else{if(!u.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,i)}i+=e.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.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&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(t,e,r,n,i){if(H(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.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),c=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 w(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return S(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const x=4096;function R(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 C(t,e,r,n,i,o){if(!u.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 j(t,e,r,n,i){G(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 U(t,e,r,n,i){G(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 N(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 D(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return e=+e,r>>>=0,o||N(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.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||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o>>=0,e>>>=0,r||P(t,e,this.length);let n=this[t+--e],i=1;for(;e>0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),this[t]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||P(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readBigUInt64LE=Q((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(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||q(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||P(t,e,this.length);let n=this[t],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||P(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},u.prototype.readInt8=function(t,e){return t>>>=0,e||P(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||P(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||P(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readBigInt64LE=Q((function(t){W(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||q(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||q(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<>>=0,e||P(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||P(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||P(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||C(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||C(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},u.prototype.writeUint8=u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeBigUInt64LE=Q((function(t,e=0){return j(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(t,e=0){return U(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,t,e,r,n-1,-n)}let i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);C(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},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||C(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||C(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},u.prototype.writeBigInt64LE=Q((function(t,e=0){return j(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(t,e=0){return U(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.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 G(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 M.ERR_OUT_OF_RANGE("value",i,t)}!function(t,e,r){W(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||q(e,t.length-(r+1))}(n,i,o)}function W(t,e){if("number"!=typeof t)throw new M.ERR_INVALID_ARG_TYPE(e,"number",t)}function q(t,e,r){if(Math.floor(t)!==t)throw W(t,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",t);if(e<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`}),TypeError),F("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 K=/[^+/0-9A-Za-z-_]/g;function z(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 $(t){return n.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(K,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function J(t,e,r,n){let i;for(i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function H(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function Y(t){return t!=t}const X=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")}},1924:(t,e,r)=>{"use strict";var n=r(210),i=r(5559),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}},5559:(t,e,r)=>{"use strict";var n=r(8612),i=r(210),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),u=i("%Object.getOwnPropertyDescriptor%",!0),c=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(c)try{c({},"a",{value:1})}catch(t){c=null}t.exports=function(t){var e=a(n,s,arguments);if(u&&c){var r=u(e,"length");r.configurable&&c(e,"length",{value:1+l(0,t.length-(arguments.length-1))})}return e};var f=function(){return a(n,o,arguments)};c?c(t.exports,"apply",{value:f}):t.exports.apply=f},6957:(t,e,r)=>{"use strict";var n=r(886);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)))}))}},886:t=>{t.exports="function"==typeof queueMicrotask?queueMicrotask:t=>Promise.resolve().then(t)},8840:(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))}},2833:(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,u=0;u{var n=r(8840),i=r(2833);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"},7171:(t,e,r)=>{"use strict";const{AbstractChainedBatch:n}=r(4012),i=Symbol("operations");t.exports=class extends n{constructor(t){super(t),this[i]=[]}_put(t,e,r){this[i].push({...r,type:"put",key:t,value:e})}_del(t,e){this[i].push({...e,type:"del",key:t})}_clear(){this[i]=[]}_write(t,e){this.db.batch(this[i],t,e)}}},2790:(t,e,r)=>{"use strict";const{AbstractIterator:n}=r(4012),i=r(5717),o=r(2502).R,s=Symbol("options"),a=Symbol("iterator"),u=Symbol("operations"),c=Symbol("promise");function l(t,e){n.call(this,t),this[s]=e,this[a]=null,this[u]=[]}i(l,n),l.prototype.setDb=function(t){this[a]=t.iterator(this[s]);for(const t of this[u].splice(0,this[u].length))this[a][t.method](...t.args)},l.prototype.next=function(...t){if("open"===this.db.status)return this[a].next(...t);const e=o(t,c,(function(t,e){return void 0===t&&void 0===e?void 0:[t,e]}));return"opening"===this.db.status?this[u].push({method:"next",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this},l.prototype.seek=function(...t){if("open"===this.db.status)this[a].seek(...t);else{if("opening"!==this.db.status)throw new Error("Database is not open");this[u].push({method:"seek",args:t})}},l.prototype.end=function(...t){if("open"===this.db.status)return this[a].end(...t);const e=o(t,c);return"opening"===this.db.status?this[u].push({method:"end",args:t}):this._nextTick(e,new Error("Database is not open")),e[c]||this};for(const t of["next","seek","end"])l.prototype["_"+t]=function(){throw new Error("Did not expect private method to be called: "+t)};t.exports=l},6944:(t,e,r)=>{"use strict";const{AbstractLevelDOWN:n}=r(4012),i=r(5717),o=r(2790),s=r(7171),a=r(2502).R,u=["put","get","getMany","del","batch","clear"],c=["approximateSize","compactRange"],l=Symbol("innerDb"),f=Symbol("operations"),h=Symbol("promise");function p(t){n.call(this,t.supports||{});for(const e of c)"function"!=typeof t[e]||this.supports.additionalMethods[e]||(this.supports.additionalMethods[e]=!0);this[l]=t,this[f]=[],function(t){const e=Object.keys(t.supports.additionalMethods);for(const r of u.concat(e))t[r]=function(...t){if("batch"===r&&0===t.length)return new s(this);if("open"===this.status)return this[l][r](...t);const e=a(t,h);return"opening"===this.status?this[f].push({method:r,args:t}):this._nextTick(e,new Error("Database is not open")),e[h]};t.iterator=function(t){if("open"===this.status)return this[l].iterator(t);if("opening"===this.status){const e=new o(this,t);return this[f].push({iterator:e}),e}throw new Error("Database is not open")};for(const e of u.concat(["iterator"]))t["_"+e]=function(){throw new Error("Did not expect private method to be called: "+e)}}(this)}i(p,n),p.prototype.type="deferred-leveldown",Object.defineProperty(p.prototype,"_db",{enumerable:!0,get(){return this[l]}}),p.prototype._open=function(t,e){const r=t=>{if(t||"open"!==this[l].status)return e(t||new Error("Database is not open"));const r=this[f];this[f]=[];for(const t of r)t.iterator?t.iterator.setDb(this[l]):this[l][t.method](...t.args);if(this[f].length>0)throw new Error("Did not expect further operations");e()};"new"===this[l].status||"closed"===this[l].status?this[l].open(t,r):this._nextTick(r)},p.prototype._close=function(t){this[l].close(t)},p.prototype._isOperational=function(){return"opening"===this.status},t.exports=p,t.exports.DeferredIterator=o},2502:(t,e)=>{"use strict";e.R=function(t,e,r){let n=t[t.length-1];if("function"!=typeof n){const i=new Promise(((e,i)=>{t.push(n=function(t,...n){t?i(t):e(r?r(...n):n[0])})}));n[e]=i}return n}},780:(t,e,r)=>{"use strict";const n=r(4012).AbstractLevelDOWN,i=r(4012).AbstractChainedBatch,o=r(4012).AbstractIterator,s=r(5717),a=r(4124),u=r(6604).EncodingError,c=["approximateSize","compactRange"];function l(t,e){if(!(this instanceof l))return new l(t,e);const r=t.supports||{},i=r.additionalMethods||{};n.call(this,r),this.supports.encodings=!0,this.supports.additionalMethods={},c.forEach((function(e){const r="function"==typeof t[e];(i[e]||r)&&(this.supports.additionalMethods[e]=!0,this[e]=function(t,r,n,i){return t=this.codec.encodeKey(t,n),r=this.codec.encodeKey(r,n),this.db[e](t,r,n,i)})}),this),void 0===(e=e||{}).keyEncoding&&(e.keyEncoding="utf8"),void 0===e.valueEncoding&&(e.valueEncoding="utf8"),this.db=t,this.codec=new a(e)}function f(t,e){o.call(this,t),this.codec=t.codec,this.keys=e.keys,this.values=e.values,this.opts=this.codec.encodeLtgt(e),this.it=t.db.iterator(this.opts)}function h(t,e){i.call(this,t),this.codec=t.codec,this.batch=t.db.batch()}t.exports=l,s(l,n),l.prototype.type="encoding-down",l.prototype._serializeKey=l.prototype._serializeValue=function(t){return t},l.prototype._open=function(t,e){this.db.open(t,e)},l.prototype._close=function(t){this.db.close(t)},l.prototype._put=function(t,e,r,n){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.db.put(t,e,r,n)},l.prototype._get=function(t,e,r){t=this.codec.encodeKey(t,e),e.asBuffer=this.codec.valueAsBuffer(e),this.db.get(t,e,((t,n)=>{if(t)return r(t);try{n=this.codec.decodeValue(n,e)}catch(t){return r(new u(t))}r(null,n)}))},l.prototype._getMany=function(t,e,r){t=t.map((t=>this.codec.encodeKey(t,e))),e.asBuffer=this.codec.valueAsBuffer(e),this.db.getMany(t,e,((t,n)=>{if(t)return r(t);const i=new Array(n.length);for(let o=0;o{if(e)return t(e);try{r=this.keys&&void 0!==r?this.codec.decodeKey(r,this.opts):void 0,n=this.values&&void 0!==n?this.codec.decodeValue(n,this.opts):void 0}catch(e){return t(new u(e))}t(null,r,n)}))},f.prototype._seek=function(t){t=this.codec.encodeKey(t,this.opts),this.it.seek(t)},f.prototype._end=function(t){this.it.end(t)},s(h,i),h.prototype._put=function(t,e,r){t=this.codec.encodeKey(t,r),e=this.codec.encodeValue(e,r),this.batch.put(t,e)},h.prototype._del=function(t,e){t=this.codec.encodeKey(t,e),this.batch.del(t)},h.prototype._clear=function(){this.batch.clear()},h.prototype._write=function(t,e){this.batch.write(t,e)}},6729: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),u=r?r+e:e;return t._events[u]?t._events[u].fn?t._events[u]=[t._events[u],a]:t._events[u].push(a):(t._events[u]=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,r){"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 u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,c;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=u(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,c=l,console&&console.warn&&console.warn(c)}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 f(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 h(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 u=o[t];if(void 0===u)return!1;if("function"==typeof u)n(u,this,e);else{var c=u.length,l=d(u,c);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 h(this,t,!0)},o.prototype.rawListeners=function(t){return h(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):[]}},9203:(t,e,r)=>{const n=r(7270),i=r(9558);t.exports=t=>n(Object.assign({db:i},t))},7270:(t,e,r)=>{const n=r(2483),i=r(780),o=r(4918),s=r(9563),a=r(8936),u=t=>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))),c=t=>{const e=s(t),r=a(t);return r.TIMESTAMP_CREATED().then((()=>({AGGREGATION_FILTER:e.AGGREGATION_FILTER,AND:(t,r)=>e.INTERSECTION(t,r).then(u),BUCKET:e.BUCKET,BUCKETS:e.BUCKETS,CREATED:e.CREATED,DELETE:r.DELETE,DISTINCT:e.DISTINCT,EXIST:e.EXIST,EXPORT:e.EXPORT,FACETS:e.FACETS,FIELDS:e.FIELDS,GET:(t,r)=>e.GET(t,r).then(u),IMPORT:r.IMPORT,LAST_UPDATED:e.LAST_UPDATED,MAX:e.MAX,MIN:e.MIN,NOT:(...t)=>e.SET_SUBTRACTION(...t).then(u),OBJECT:e.OBJECT,OR:(t,r)=>e.UNION(t,r).then((t=>t.union)).then(u),PUT:r.PUT,SORT:e.SORT,STORE:t._db,TIMESTAMP_LAST_UPDATED:r.TIMESTAMP_LAST_UPDATED,parseToken:e.parseToken})))};t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({name:"fii",tokenAppend:"",caseSensitive:!0,stopwords:[],doNotIndexField:[],storeVectors:!0,docExistsSpace:"DOC"},t),o(i(t.db(t.name),{keyEncoding:n,valueEncoding:"json"}),((n,i)=>n?r(n):e(Object.assign(t,{_db:i}))))))))(t).then(c)},6782:t=>{const e=null,r=void 0;t.exports=(t,n)=>new Promise(((i,o)=>{if(Array.isArray(t))return o(new Error("token cannot be Array"));if(void 0===t&&(t={}),"string"==typeof t){const e=t.split(":"),r=e.pop(),o=e.pop();return i(o?{FIELD:[o],VALUE:{GTE:r,LTE:r}}:{FIELD:n,VALUE:{GTE:r,LTE:r}})}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:r}),void 0===t.VALUE.GTE&&(t.VALUE.GTE=e),void 0===t.VALUE.LTE&&(t.VALUE.LTE=r),t.VALUE=Object.assign(t.VALUE,{GTE:t.VALUE.GTE,LTE:t.VALUE.LTE}),void 0===t.FIELD?i(Object.assign(t,{FIELD:n})):(t.FIELD=[t.FIELD].flat(),i(t))}))},9563:(t,e,r)=>{const n=r(6782),i=r(2483);i.LO=null,i.HI=void 0,t.exports=t=>{const e=t=>"string"==typeof t,r=async t=>n(t,await c()),o=async(e,n=(t=>new Promise((e=>e(t)))))=>new Promise((async(i,o)=>{const a=t=>void 0===t?i(void 0):t instanceof Promise?i(t):void 0;try{a(e),e=await r(e),e=await(e=>{const r=e=>t.caseSensitive||"string"!=typeof e?e:e.toLowerCase();return{FIELD:e.FIELD.map(r),VALUE:{GTE:r(e.VALUE.GTE),LTE:r(e.VALUE.LTE)}}})(e),e=await(e=>e.VALUE.GTE===e.VALUE.LTE&&t.stopwords.includes(e.VALUE.GTE)?void 0:e)(e),a(e=await(e=>void 0===e?u(void 0):e.VALUE.GTE===e.VALUE.LTE&&t.queryReplace&&t.queryReplace[e.VALUE.GTE]?s(t.queryReplace[e.VALUE.GTE].map((t=>({FIELD:e.FIELD,VALUE:{GTE:t,LTE:t}})))).then((t=>t.union)):e)(e)),a(e=await n(e))}catch(t){return o(t)}return Array.isArray(e)?i(e):i(u(e))})),s=async(t,e)=>Promise.all(t.map((t=>o(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)})))}})),a=(t,e,r)=>{const n=[];return void 0===e&&"number"!=typeof e||n.push(e),r&&n.push(i.HI),["IDX",t,n]},u=e=>new Promise((r=>{if(void 0===e)return r(void 0);const n=new Map;return Promise.all(e.FIELD.map((r=>new Promise((i=>t._db.createReadStream({gte:a(r,e.VALUE.GTE),lte:a(r,e.VALUE.LTE,!0),limit:e.LIMIT,reverse:e.REVERSE}).on("data",(t=>t.value.forEach((e=>n.set(e,[...n.get(e)||[],JSON.stringify({FIELD:t.key[1],VALUE:t.key[2][0],SCORE:t.key[2][1]})]))))).on("end",i)))))).then((()=>r(Array.from(n.keys()).map((t=>({_id:t,_match:n.get(t)}))))))})),c=()=>new Promise((e=>{const r=[];t._db.createReadStream({gte:["FIELD",i.LO],lte:["FIELD",i.HI]}).on("data",(t=>r.push(t.value))).on("end",(()=>e(r)))})),l=(t,e)=>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))))]})))):t,f=async t=>r(t).then((t=>o(t).then((e=>Object.assign(t,{_id:[...e.reduce(((t,e)=>t.add(e._id)),new Set)].sort(),VALUE:t.VALUE}))))),h=e=>new Promise(((r,n)=>{const i=[];t._db.createReadStream(e).on("data",(t=>{i.push(t)})).on("end",(()=>r(i)))})),p=(t,e)=>r(t).then((t=>u(Object.assign(t,{LIMIT:1,REVERSE:e})))).then((t=>t.length?JSON.parse(t.pop()._match.pop()).VALUE:null)),d=t=>r(t).then((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+=" "),h({gte:a(e,n),lte:a(e,r,!0),keys:!0,values:!1}).then((t=>t.map((t=>({FIELD:t[1],VALUE:t[2][0]})))))}))))).then((t=>t.flat())),y=t=>r(t).then((t=>Promise.all(t.FIELD.map((e=>h({gte:a(e,t.VALUE.GTE),lte:a(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())),g=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:l(t.flat(),r),FACETS:l(e.flat(),r),RESULT:r}))),AGGREGATION_FILTER:l,BUCKET:f,BUCKETS:(...t)=>Promise.all(t.map(f)),CREATED:()=>t._db.get(["~CREATED"]),DISTINCT:(...t)=>Promise.all(t.length?t.map(d):[d({})]).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:h,FACETS:(...t)=>Promise.all(t.length?t.map(y):[y({})]).then((t=>[...t.flat().reduce(((t,e)=>t.add(JSON.stringify(e))),new Set)].map(JSON.parse))),FIELDS:c,GET:o,INTERSECTION:(t,e)=>s(t,e).then((t=>t.union.filter((e=>e._match.length===t.sumTokensMinusStopwords)))),LAST_UPDATED:()=>t._db.get(["~LAST_UPDATED"]),MAX:t=>p(t,!0),MIN:p,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,r)=>Promise.all([e(t)?o(t):t,e(r)?o(r):r]).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)=>g.compare(t._id,e._id)))))),UNION:s,parseToken:r}}},8936:(t,e,r)=>{const n=r(3692),i=r(9563);t.exports=t=>{let e=0;const r=(e,r)=>{if(null==e._object)return{_id:e._id,keys:[]};const i=[];return n(e._object).forEach((function(e){let n=!0;const o=this.path.filter((t=>!Number.isInteger(+t))).join(".");if("_id"===o&&(n=!1),r.doNotIndexField.filter((t=>o.startsWith(t))).length&&(n=!1),this.isLeaf&&t.stopwords.includes((this.node+"").split("#")[0])&&(n=!1),n&&this.isLeaf){let e;try{const t=JSON.parse(this.node);if(!Array.isArray(t))throw new Error;e=JSON.stringify([o,t])}catch(t){e=JSON.stringify([o,[this.node]])}i.push(t.caseSensitive?e:e.toLowerCase())}})),{_id:e._id,keys:i}},o=(t,e)=>(e.keys.forEach((r=>{t[r]=t[r]||[],t[r].push(e._id)})),t),s=(n,s,a,u,c)=>new Promise((l=>{n=n.map((t=>{var r;return t._id=void 0===(r=t._id)?++e:"string"==typeof r||"number"==typeof r?r:void 0,t._object&&(t._object._id=t._id),t})),c=Object.assign(t,c),i(t).EXIST(...n.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=>r(t,e))).reduce(o,{}))(n,c),s,a).then((e=>s.batch(e.concat(c.storeVectors?((t,e)=>t.map((t=>({key:["DOC",t._id],type:e,value:t._object}))))(n,a):[]).concat((t=>[...new Set(t.map((t=>t.key[1].split(":")[0])))].map((t=>({type:"put",key:["FIELD",t],value:t}))))(e)),(e=>l(n.map((e=>{let r;return"put"===a?r=t.includes(e._id)?"UPDATED":"CREATED":"del"===a&&(r=null===e._object?"FAILED":"DELETED"),{_id:e._id,operation:u,status:r}})))))))))})),a=e=>t._db.put(["~LAST_UPDATED"],Date.now()).then((()=>e));return{DELETE:e=>i(t).OBJECT(e.map((t=>({_id:t})))).then((e=>s(e,t._db,"del","DELETE",{}))).then(a),IMPORT:e=>t._db.clear().then((()=>t._db.batch(e.map((t=>Object.assign(t,{type:"put"})))))),PUT:(e,r={})=>s(e.map((t=>({_id:t._id,_object:t}))),t._db,"put","PUT",r).then(a),TIMESTAMP_CREATED:()=>t._db.get(["~CREATED"]).then().catch((e=>t._db.put(["~CREATED"],Date.now()).then(a))),TIMESTAMP_LAST_UPDATED:a}}},9804:t=>{var e=Object.prototype.hasOwnProperty,r=Object.prototype.toString;t.exports=function(t,n,i){if("[object Function]"!==r.call(n))throw new TypeError("iterator must be a function");var o=t.length;if(o===+o)for(var s=0;s{"use strict";var e="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,i="[object Function]";t.exports=function(t){var o=this;if("function"!=typeof o||n.call(o)!==i)throw new TypeError(e+o);for(var s,a=r.call(arguments,1),u=function(){if(this instanceof s){var e=o.apply(this,a.concat(r.call(arguments)));return Object(e)===e?e:this}return o.apply(t,a.concat(r.call(arguments)))},c=Math.max(0,o.length-a.length),l=[],f=0;f{"use strict";var n=r(7648);t.exports=Function.prototype.bind||n},210:(t,e,r)=>{"use strict";var n,i=SyntaxError,o=Function,s=TypeError,a=function(t){try{return o('"use strict"; return ('+t+").constructor;")()}catch(t){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(t){u=null}var c=function(){throw new s},l=u?function(){try{return c}catch(t){try{return u(arguments,"callee").get}catch(t){return c}}}():c,f=r(1405)(),h=Object.getPrototypeOf||function(t){return t.__proto__},p={},d="undefined"==typeof Uint8Array?n:h(Uint8Array),y={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":f?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?h((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%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?h(""[Symbol.iterator]()):n,"%Symbol%":f?Symbol:n,"%SyntaxError%":i,"%ThrowTypeError%":l,"%TypedArray%":d,"%TypeError%":s,"%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%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet},g=function t(e){var r;if("%AsyncFunction%"===e)r=a("async function () {}");else if("%GeneratorFunction%"===e)r=a("function* () {}");else if("%AsyncGeneratorFunction%"===e)r=a("async function* () {}");else if("%AsyncGenerator%"===e){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===e){var i=t("%AsyncGenerator%");i&&(r=h(i.prototype))}return y[e]=r,r},b={"%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"]},m=r(8612),v=r(7642),w=m.call(Function.call,Array.prototype.concat),E=m.call(Function.apply,Array.prototype.splice),_=m.call(Function.call,String.prototype.replace),S=m.call(Function.call,String.prototype.slice),T=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,A=/\\(\\)?/g,O=function(t){var e=S(t,0,1),r=S(t,-1);if("%"===e&&"%"!==r)throw new i("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==e)throw new i("invalid intrinsic syntax, expected opening `%`");var n=[];return _(t,T,(function(t,e,r,i){n[n.length]=r?_(i,A,"$1"):e||t})),n},x=function(t,e){var r,n=t;if(v(b,n)&&(n="%"+(r=b[n])[0]+"%"),v(y,n)){var o=y[n];if(o===p&&(o=g(n)),void 0===o&&!e)throw new s("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:o}}throw new i("intrinsic "+t+" does not exist!")};t.exports=function(t,e){if("string"!=typeof t||0===t.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof e)throw new s('"allowMissing" argument must be a boolean');var r=O(t),n=r.length>0?r[0]:"",o=x("%"+n+"%",e),a=o.name,c=o.value,l=!1,f=o.alias;f&&(n=f[0],E(r,w([0,1],f)));for(var h=1,p=!0;h=r.length){var m=u(c,d);c=(p=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:c[d]}else p=v(c,d),c=c[d];p&&!l&&(y[a]=c)}}return c}},1405:(t,e,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(5419);t.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},5419: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}},6410:(t,e,r)=>{"use strict";var n=r(5419);t.exports=function(){return n()&&!!Symbol.toStringTag}},7642:(t,e,r)=>{"use strict";var n=r(8612);t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},645:(t,e)=>{e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},e.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=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*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+f>=1?h/u:h*Math.pow(2,1-f))*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-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,c-=8);t[r+p-d]|=128*y}},5717:t=>{"function"==typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},2584:(t,e,r)=>{"use strict";var n=r(6410)(),i=r(1924)("Object.prototype.toString"),o=function(t){return!(n&&t&&"object"==typeof t&&Symbol.toStringTag in t)&&"[object Arguments]"===i(t)},s=function(t){return!!o(t)||null!==t&&"object"==typeof t&&"number"==typeof t.length&&t.length>=0&&"[object Array]"!==i(t)&&"[object Function]"===i(t.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},8738:t=>{t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},8662:(t,e,r)=>{"use strict";var n,i=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=r(6410)(),u=Object.getPrototypeOf;t.exports=function(t){if("function"!=typeof t)return!1;if(s.test(o.call(t)))return!0;if(!a)return"[object GeneratorFunction]"===i.call(t);if(!u)return!1;if(void 0===n){var e=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(t){}}();n=!!e&&u(e)}return u(t)===n}},5692:(t,e,r)=>{"use strict";var n=r(9804),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),l=o("Array.prototype.indexOf",!0)||function(t,e){for(var r=0;r-1}return!!p&&function(t){var e=!1;return n(h,(function(r,n){if(!e)try{e=r.call(t)===n}catch(t){}})),e}(t)}},4124:(t,e,r)=>{"use strict";const n=r(964),i=new Set(["lt","gt","lte","gte"]);function o(t){if(!(this instanceof o))return new o(t);this.opts=t||{},this.encodings=n}t.exports=o,o.prototype._encoding=function(t){return"string"==typeof t&&(t=n[t]),t||(t=n.id),t},o.prototype._keyEncoding=function(t,e){return this._encoding(e&&e.keyEncoding||t&&t.keyEncoding||this.opts.keyEncoding)},o.prototype._valueEncoding=function(t,e){return this._encoding(e&&(e.valueEncoding||e.encoding)||t&&(t.valueEncoding||t.encoding)||this.opts.valueEncoding||this.opts.encoding)},o.prototype.encodeKey=function(t,e,r){return this._keyEncoding(e,r).encode(t)},o.prototype.encodeValue=function(t,e,r){return this._valueEncoding(e,r).encode(t)},o.prototype.decodeKey=function(t,e){return this._keyEncoding(e).decode(t)},o.prototype.decodeValue=function(t,e){return this._valueEncoding(e).decode(t)},o.prototype.encodeBatch=function(t,e){return t.map((t=>{const r={type:t.type,key:this.encodeKey(t.key,e,t)};return this.keyAsBuffer(e,t)&&(r.keyEncoding="binary"),t.prefix&&(r.prefix=t.prefix),"value"in t&&(r.value=this.encodeValue(t.value,e,t),this.valueAsBuffer(e,t)&&(r.valueEncoding="binary")),r}))},o.prototype.encodeLtgt=function(t){const e={};for(const r of Object.keys(t)){if("start"===r||"end"===r)throw new Error('Legacy range options ("start" and "end") have been removed');e[r]=i.has(r)?this.encodeKey(t[r],t):t[r]}return e},o.prototype.createStreamDecoder=function(t){return t.keys&&t.values?(e,r)=>({key:this.decodeKey(e,t),value:this.decodeValue(r,t)}):t.keys?e=>this.decodeKey(e,t):t.values?(e,r)=>this.decodeValue(r,t):function(){}},o.prototype.keyAsBuffer=function(t){return this._keyEncoding(t).buffer},o.prototype.valueAsBuffer=function(t){return this._valueEncoding(t).buffer}},964:(t,e,r)=>{"use strict";const{Buffer:n}=r(8764);e.utf8=e["utf-8"]={encode:function(t){return s(t)?t:String(t)},decode:o,buffer:!1,type:"utf8"},e.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},e.binary={encode:function(t){return s(t)?t:n.from(t)},decode:o,buffer:!0,type:"binary"},e.none={encode:o,decode:o,buffer:!1,type:"id"},e.id=e.none;const i=["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"];for(const t of i)e[t]={encode:function(e){return s(e)?e:n.from(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t};function o(t){return t}function s(t){return null==t||n.isBuffer(t)}},6604:t=>{"use strict";function e(t,e){const r=function(e,n){if("object"==typeof e&&null!==e&&(n=n||e,e=e.message||e.name),e=e||"","object"==typeof(n=n||void 0)&&n.type===t&&n.message===e)return n;Object.defineProperty(this,"type",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"name",{value:t,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"cause",{value:n,enumerable:!1,writable:!0,configurable:!0}),Object.defineProperty(this,"message",{value:e,enumerable:!1,writable:!0,configurable:!0}),Error.call(this),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,r)};return r.prototype=new e,r}const r=e("LevelUPError",Error);t.exports={LevelUPError:r,InitializationError:e("InitializationError",r),OpenError:e("OpenError",r),ReadError:e("ReadError",r),WriteError:e("WriteError",r),NotFoundError:e("NotFoundError",r),EncodingError:e("EncodingError",r)},t.exports.NotFoundError.prototype.notFound=!0,t.exports.NotFoundError.prototype.status=404},3462:(t,e,r)=>{"use strict";const n=r(5717),{Readable:i}=r(8473);function o(t,e){if(!(this instanceof o))return new o(t,e);e=e||{},i.call(this,Object.assign({},e,{objectMode:!0})),this._iterator=t,this._options=e,this.on("end",this.destroy.bind(this,null,null))}t.exports=o,n(o,i),o.prototype._read=function(){this.destroyed||this._iterator.next(((t,e,r)=>{if(!this.destroyed)return t?this.destroy(t):void(void 0===e&&void 0===r?this.push(null):!1!==this._options.keys&&!1===this._options.values?this.push(e):!1===this._options.keys&&!1!==this._options.values?this.push(r):this.push({key:e,value:r}))}))},o.prototype._destroy=function(t,e){this._iterator.end((function(r){e(t||r)}))}},9558:(t,e,r)=>{"use strict";t.exports=p;const n=r(4012).AbstractLevelDOWN,i=r(5717),o=r(9967),s=r(3016),a=r(5568),u=r(8450),c=r(1228),l=r(2854),f=r(8950),h="level-js-";function p(t,e){if(!(this instanceof p))return new p(t,e);if(n.call(this,{bufferKeys:c.bufferKeys(indexedDB),snapshots:!0,permanence:!0,clear:!0,getMany:!0}),e=e||{},"string"!=typeof t)throw new Error("constructor requires a location string argument");this.location=t,this.prefix=null==e.prefix?h:e.prefix,this.version=parseInt(e.version||1,10)}i(p,n),p.prototype.type="level-js",p.prototype._open=function(t,e){const r=indexedDB.open(this.prefix+this.location,this.version);r.onerror=function(){e(r.error||new Error("unknown error"))},r.onsuccess=()=>{this.db=r.result,e()},r.onupgradeneeded=t=>{const e=t.target.result;e.objectStoreNames.contains(this.location)||e.createObjectStore(this.location)}},p.prototype.store=function(t){return this.db.transaction([this.location],t).objectStore(this.location)},p.prototype.await=function(t,e){const r=t.transaction;r.onabort=function(){e(r.error||new Error("aborted by user"))},r.oncomplete=function(){e(null,t.result)}},p.prototype._get=function(t,e,r){const n=this.store("readonly");let i;try{i=n.get(t)}catch(t){return this._nextTick(r,t)}this.await(i,(function(t,n){return t?r(t):void 0===n?r(new Error("NotFound")):void r(null,u(n,e.asBuffer))}))},p.prototype._getMany=function(t,e,r){const n=e.asBuffer,i=this.store("readonly"),s=t.map((t=>e=>{let r;try{r=i.get(t)}catch(t){return e(t)}r.onsuccess=()=>{const t=r.result;e(null,void 0===t?t:u(t,n))},r.onerror=t=>{t.stopPropagation(),e(r.error)}}));o(s,16,r)},p.prototype._del=function(t,e,r){const n=this.store("readwrite");let i;try{i=n.delete(t)}catch(t){return this._nextTick(r,t)}this.await(i,r)},p.prototype._put=function(t,e,r,n){const i=this.store("readwrite");let o;try{o=i.put(e,t)}catch(t){return this._nextTick(n,t)}this.await(o,n)},p.prototype._serializeKey=function(t){return a(t,this.supports.bufferKeys)},p.prototype._serializeValue=function(t){return a(t,!0)},p.prototype._iterator=function(t){return new s(this,this.location,t)},p.prototype._batch=function(t,e,r){if(0===t.length)return this._nextTick(r);const n=this.store("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 u;try{u="del"===r.type?n.delete(a):n.put(r.value,a)}catch(t){return o=t,void i.abort()}s=0)return l(this,this.location,r,t,e);try{const t=this.store("readwrite");n=r?t.delete(r):t.clear()}catch(t){return this._nextTick(e,t)}this.await(n,e)},p.prototype._close=function(t){this.db.close(),this._nextTick(t)},p.prototype.upgrade=function(t){if("open"!==this.status)return this._nextTick(t,new Error("cannot upgrade() before open()"));const e=this.iterator(),r={},n=this;function i(t){if(t)return s(t);e.next(o)}function o(t,e,o){if(t||void 0===e)return s(t);const a=n._serializeKey(u(e,!0)),c=n._serializeValue(u(o,!0));n._batch([{type:"del",key:e},{type:"put",key:a,value:c}],r,i)}function s(r){e.end((function(e){t(r||e)}))}e._deserializeKey=e._deserializeValue=function(t){return t},i()},p.destroy=function(t,e,r){"function"==typeof e&&(r=e,e=h);const n=indexedDB.deleteDatabase(e+t);n.onsuccess=function(){r()},n.onerror=function(t){r(t)}}},3016:(t,e,r)=>{"use strict";const n=r(5717),i=r(4012).AbstractIterator,o=r(8950),s=r(8450),a=function(){};function u(t,e,r){if(i.call(this,t),this._limit=r.limit,this._count=0,this._callback=null,this._cache=[],this._completed=!1,this._aborted=!1,this._error=null,this._transaction=null,this._keys=r.keys,this._values=r.values,this._keyAsBuffer=r.keyAsBuffer,this._valueAsBuffer=r.valueAsBuffer,0===this._limit)return void(this._completed=!0);let n;try{n=o(r)}catch(t){return void(this._completed=!0)}this.createIterator(e,n,r.reverse)}t.exports=u,n(u,i),u.prototype.createIterator=function(t,e,r){const n=this.db.db.transaction([t],"readonly");n.objectStore(t).openCursor(e,r?"prev":"next").onsuccess=t=>{const e=t.target.result;e&&this.onItem(e)},this._transaction=n,n.onabort=()=>{this.onAbort(this._transaction.error||new Error("aborted by user"))},n.oncomplete=()=>{this.onComplete()}},u.prototype.onItem=function(t){this._cache.push(t.key,t.value),(this._limit<=0||++this._count0){let e=this._cache.shift(),r=this._cache.shift();e=this._keys&&void 0!==e?this._deserializeKey(e,this._keyAsBuffer):void 0,r=this._values&&void 0!==r?this._deserializeValue(r,this._valueAsBuffer):void 0,this._nextTick(t,null,e,r)}else this._completed?this._nextTick(t):this._callback=t},u.prototype._deserializeKey=s,u.prototype._deserializeValue=s,u.prototype._end=function(t){if(this._aborted||this._completed)return this._nextTick(t,this._error);this.onItem=a,this.onAbort=t,this.onComplete=t}},2854: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 u=s.openKeyCursor?"openKeyCursor":"openCursor",c=n.reverse?"prev":"next";s[u](r,c).onsuccess=function(t){const e=t.target.result;e&&(s.delete(e.key).onsuccess=function(){(n.limit<=0||++a{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return s(t).toString()}}(),o=function(){if(r.g.TextDecoder){const t=new TextDecoder("utf-8");return t.decode.bind(t)}return function(t){return n.from(t).toString()}}();function s(t){const e=n.from(t.buffer);return t.byteLength===t.buffer.byteLength?e:e.slice(t.byteOffset,t.byteOffset+t.byteLength)}t.exports=function(t,e){return t instanceof Uint8Array?e?s(t):i(t):t instanceof ArrayBuffer?e?n.from(t):o(t):e?n.from(String(t)):String(t)}},8950:(t,e,r)=>{"use strict";const n=r(2303),i=Symbol("none");t.exports=function(t){const e=n.lowerBound(t,i),r=n.upperBound(t,i),o=n.lowerBoundExclusive(t,i),s=n.upperBoundExclusive(t,i);return e!==i&&r!==i?IDBKeyRange.bound(e,r,o,s):e!==i?IDBKeyRange.lowerBound(e,o):r!==i?IDBKeyRange.upperBound(r,s):null}},5568:(t,e,r)=>{"use strict";const n=r(8764).Buffer,i=function(){if(r.g.TextEncoder){const t=new TextEncoder("utf-8");return t.encode.bind(t)}return n.from}();t.exports=function(t,e){return e?n.isBuffer(t)?t:i(String(t)):String(t)}},1228:(t,e,r)=>{"use strict";const n=r(8764).Buffer;e.test=function(t){return function(e){try{return e.cmp(t,0),!0}catch(t){return!1}}},e.bufferKeys=e.test(n.alloc(0))},1675:t=>{"use strict";function e(t){return!!t&&Object.assign({},t)}t.exports=function(...t){const r=t.reduce(((t,e)=>Object.assign(t,e)),{});return Object.assign(r,{bufferKeys:r.bufferKeys||!1,snapshots:r.snapshots||!1,permanence:r.permanence||!1,seek:r.seek||!1,clear:r.clear||!1,getMany:r.getMany||!1,keyIterator:r.keyIterator||!1,valueIterator:r.valueIterator||!1,iteratorNextv:r.iteratorNextv||!1,iteratorAll:r.iteratorAll||!1,status:r.status||!1,idempotentOpen:r.idempotentOpen||!1,passiveOpen:r.passiveOpen||!1,serialize:r.serialize||!1,createIfMissing:r.createIfMissing||!1,errorIfExists:r.errorIfExists||!1,deferredOpen:r.deferredOpen||!1,openCallback:r.openCallback||!1,promises:r.promises||!1,streams:r.streams||!1,encodings:e(r.encodings),events:e(r.events),additionalMethods:Object.assign({},r.additionalMethods)})}},8133:(t,e,r)=>{"use strict";const n=r(6604).WriteError,i=r(6957),o=r(2369).R,s=r(2369).F;function a(t){this.db=t,this.batch=t.db.batch(),this.ops=[],this.length=0}a.prototype.put=function(t,e,r){try{this.batch.put(t,e,r)}catch(t){throw new n(t)}return this.ops.push({...r,type:"put",key:t,value:e}),this.length++,this},a.prototype.del=function(t,e){try{this.batch.del(t,e)}catch(t){throw new n(t)}return this.ops.push({...e,type:"del",key:t}),this.length++,this},a.prototype.clear=function(){try{this.batch.clear()}catch(t){throw new n(t)}return this.ops=[],this.length=0,this},a.prototype.write=function(t,e){const r=this.db,a=this.ops;e=o(t,e),e=i.fromCallback(e),t=s(t);try{this.batch.write(t,(function(t){if(t)return e(new n(t));r.emit("batch",a),e()}))}catch(t){throw new n(t)}return e.promise},t.exports=a},2369:(t,e)=>{"use strict";e.R=function(t,e){return"function"==typeof t?t:e},e.F=function(t){return"object"==typeof t&&null!==t?t:{}}},4918:(t,e,r)=>{"use strict";const n=r(7187).EventEmitter,i=r(9539).inherits,o=r(6944),s=r(3462),a=r(8133),u=r(6604),c=r(1675),l=r(6957),f=r(2369).R,h=r(2369).F,p=r(9350),d=u.WriteError,y=u.ReadError,g=u.NotFoundError,b=u.OpenError,m=u.InitializationError;function v(t,e,r){if(!(this instanceof v))return new v(t,e,r);let i;if(n.call(this),this.setMaxListeners(1/0),"function"==typeof e&&(r=e,e={}),e=e||{},!t||"object"!=typeof t){if(i=new m("First argument must be an abstract-leveldown compliant store"),"function"==typeof r)return p(r,i);throw i}if("string"!=typeof t.status)throw new Error(".status required, old abstract-leveldown");this.options=h(e),this._db=t,this.db=null,this.open(r||(t=>{t&&this.emit("error",t)})),this.supports=c(this.db.supports,{status:!0,deferredOpen:!0,openCallback:!0,promises:!0,streams:!0});for(const t of Object.keys(this.supports.additionalMethods))null==this[t]&&(this[t]=function(...e){return this.db[t](...e)})}function w(t,e){return!t.isOperational()&&(p(e,new y("Database is not open")),!0)}v.prototype.emit=n.prototype.emit,v.prototype.once=n.prototype.once,i(v,n),Object.defineProperty(v.prototype,"status",{enumerable:!0,get(){return this.db.status}}),v.prototype.isOperational=function(){return"open"===this.db.status||"opening"===this.db.status},v.prototype.open=function(t,e){return"function"==typeof t&&(e=t,t=null),e=l.fromCallback(e),t||(t=this.options),this.db&&this.isOpen()?(p(e,null,this),e.promise):this.db&&this._isOpening()?(this.once("open",(()=>{e(null,this)})),e.promise):(this.db=new o(this._db),this.emit("opening"),this.db.open(t,(t=>{if(t)return e(new b(t));this.db=this._db,e(null,this),this.emit("open"),this.emit("ready")})),e.promise)},v.prototype.close=function(t){return t=l.fromCallback(t),this.isOpen()?(this.db.close(((e,...r)=>{this.emit("closed"),t(e,...r)})),this.emit("closing")):this.isClosed()?p(t):"closing"===this.db.status?this.once("closed",t):this._isOpening()&&this.once("open",(()=>{this.close(t)})),t.promise},v.prototype.isOpen=function(){return"open"===this.db.status},v.prototype._isOpening=function(){return"opening"===this.db.status},v.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},v.prototype.get=function(t,e,r){return r=f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.get(t,e,(function(e,n){if(e)return e=/notfound/i.test(e)||e.notFound?new g("Key not found in database ["+t+"]",e):new y(e),r(e);r(null,n)}))),r.promise},v.prototype.getMany=function(t,e,r){return this.db.getMany(t,e,r)},v.prototype.put=function(t,e,r,n){return n=f(r,n),w(this,n=l.fromCallback(n))||(r=h(r),this.db.put(t,e,r,(r=>{if(r)return n(new d(r));this.emit("put",t,e),n()}))),n.promise},v.prototype.del=function(t,e,r){return r=f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.del(t,e,(e=>{if(e)return r(new d(e));this.emit("del",t),r()}))),r.promise},v.prototype.batch=function(t,e,r){return arguments.length?(r="function"==typeof t?t:f(e,r),w(this,r=l.fromCallback(r))||(e=h(e),this.db.batch(t,e,(e=>{if(e)return r(new d(e));this.emit("batch",t),r()}))),r.promise):new a(this)},v.prototype.iterator=function(t){return this.db.iterator(t)},v.prototype.clear=function(t,e){return e=f(t,e),t=h(t),w(this,e=l.fromCallback(e))||this.db.clear(t,(r=>{if(r)return e(new d(r));this.emit("clear",t),e()})),e.promise},v.prototype.readStream=v.prototype.createReadStream=function(t){return"number"!=typeof(t=Object.assign({keys:!0,values:!0},t)).limit&&(t.limit=-1),new s(this.db.iterator(t),t)},v.prototype.keyStream=v.prototype.createKeyStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!0,values:!1}))},v.prototype.valueStream=v.prototype.createValueStream=function(t){return this.createReadStream(Object.assign({},t,{keys:!1,values:!0}))},v.prototype.toString=function(){return"LevelUP"},v.prototype.type="levelup",v.prototype._nextTick=p,v.errors=u,t.exports=v},9350:(t,e,r)=>{"use strict";const n=r(4375);t.exports=function(t,...e){0===e.length?n(t):n((()=>t(...e)))}},9593:(t,e,r)=>{"use strict";const n=r(4411),i=Symbol("max"),o=Symbol("length"),s=Symbol("lengthCalculator"),a=Symbol("allowStale"),u=Symbol("maxAge"),c=Symbol("dispose"),l=Symbol("noDisposeOnSet"),f=Symbol("lruList"),h=Symbol("cache"),p=Symbol("updateAgeOnGet"),d=()=>1,y=(t,e,r)=>{const n=t[h].get(e);if(n){const e=n.value;if(g(t,e)){if(m(t,n),!t[a])return}else r&&(t[p]&&(n.value.now=Date.now()),t[f].unshiftNode(n));return e.value}},g=(t,e)=>{if(!e||!e.maxAge&&!t[u])return!1;const r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[u]&&r>t[u]},b=t=>{if(t[o]>t[i])for(let e=t[f].tail;t[o]>t[i]&&null!==e;){const r=e.prev;m(t,e),e=r}},m=(t,e)=>{if(e){const r=e.value;t[c]&&t[c](r.key,r.value),t[o]-=r.length,t[h].delete(r.key),t[f].removeNode(e)}};class v{constructor(t,e,r,n,i){this.key=t,this.value=e,this.length=r,this.now=n,this.maxAge=i||0}}const w=(t,e,r,n)=>{let i=r.value;g(t,i)&&(m(t,r),t[a]||(i=void 0)),i&&e.call(n,i.value,i.key,t)};t.exports=class{constructor(t){if("number"==typeof t&&(t={max:t}),t||(t={}),t.max&&("number"!=typeof t.max||t.max<0))throw new TypeError("max must be a non-negative number");this[i]=t.max||1/0;const e=t.length||d;if(this[s]="function"!=typeof e?d:e,this[a]=t.stale||!1,t.maxAge&&"number"!=typeof t.maxAge)throw new TypeError("maxAge must be a number");this[u]=t.maxAge||0,this[c]=t.dispose,this[l]=t.noDisposeOnSet||!1,this[p]=t.updateAgeOnGet||!1,this.reset()}set max(t){if("number"!=typeof t||t<0)throw new TypeError("max must be a non-negative number");this[i]=t||1/0,b(this)}get max(){return this[i]}set allowStale(t){this[a]=!!t}get allowStale(){return this[a]}set maxAge(t){if("number"!=typeof t)throw new TypeError("maxAge must be a non-negative number");this[u]=t,b(this)}get maxAge(){return this[u]}set lengthCalculator(t){"function"!=typeof t&&(t=d),t!==this[s]&&(this[s]=t,this[o]=0,this[f].forEach((t=>{t.length=this[s](t.value,t.key),this[o]+=t.length}))),b(this)}get lengthCalculator(){return this[s]}get length(){return this[o]}get itemCount(){return this[f].length}rforEach(t,e){e=e||this;for(let r=this[f].tail;null!==r;){const n=r.prev;w(this,t,r,e),r=n}}forEach(t,e){e=e||this;for(let r=this[f].head;null!==r;){const n=r.next;w(this,t,r,e),r=n}}keys(){return this[f].toArray().map((t=>t.key))}values(){return this[f].toArray().map((t=>t.value))}reset(){this[c]&&this[f]&&this[f].length&&this[f].forEach((t=>this[c](t.key,t.value))),this[h]=new Map,this[f]=new n,this[o]=0}dump(){return this[f].map((t=>!g(this,t)&&{k:t.key,v:t.value,e:t.now+(t.maxAge||0)})).toArray().filter((t=>t))}dumpLru(){return this[f]}set(t,e,r){if((r=r||this[u])&&"number"!=typeof r)throw new TypeError("maxAge must be a number");const n=r?Date.now():0,a=this[s](e,t);if(this[h].has(t)){if(a>this[i])return m(this,this[h].get(t)),!1;const s=this[h].get(t).value;return this[c]&&(this[l]||this[c](t,s.value)),s.now=n,s.maxAge=r,s.value=e,this[o]+=a-s.length,s.length=a,this.get(t),b(this),!0}const p=new v(t,e,a,n,r);return p.length>this[i]?(this[c]&&this[c](t,e),!1):(this[o]+=p.length,this[f].unshift(p),this[h].set(t,this[f].head),b(this),!0)}has(t){if(!this[h].has(t))return!1;const e=this[h].get(t).value;return!g(this,e)}get(t){return y(this,t,!0)}peek(t){return y(this,t,!1)}pop(){const t=this[f].tail;return t?(m(this,t),t.value):null}del(t){m(this,this[h].get(t))}load(t){this.reset();const e=Date.now();for(let r=t.length-1;r>=0;r--){const n=t[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{const t=i-e;t>0&&this.set(n.k,n.v,t)}}}prune(){this[h].forEach(((t,e)=>y(this,e,!1)))}}},2303:(t,e,r)=>{var n=r(8764).Buffer;function i(t){return void 0!==t&&""!==t}function o(t,e){return Object.hasOwnProperty.call(t,e)}function s(t,e){return Object.hasOwnProperty.call(t,e)&&e}e.compare=function(t,e){if(n.isBuffer(t)){for(var r=Math.min(t.length,e.length),i=0;ie?1:0};var a=e.lowerBoundKey=function(t){return s(t,"gt")||s(t,"gte")||s(t,"min")||(t.reverse?s(t,"end"):s(t,"start"))||void 0},u=e.lowerBound=function(t,e){var r=a(t);return r?t[r]:e},c=e.lowerBoundInclusive=function(t){return!o(t,"gt")},l=e.upperBoundInclusive=function(t){return!o(t,"lt")},f=e.lowerBoundExclusive=function(t){return!c(t)},h=e.upperBoundExclusive=function(t){return!l(t)},p=e.upperBoundKey=function(t){return s(t,"lt")||s(t,"lte")||s(t,"max")||(t.reverse?s(t,"start"):s(t,"end"))||void 0},d=e.upperBound=function(t,e){var r=p(t);return r?t[r]:e};function y(t){return t}e.start=function(t,e){return t.reverse?d(t,e):u(t,e)},e.end=function(t,e){return t.reverse?u(t,e):d(t,e)},e.startInclusive=function(t){return t.reverse?l(t):c(t)},e.endInclusive=function(t){return t.reverse?c(t):l(t)},e.toLtgt=function(t,r,n,i,s){r=r||{},n=n||y;var a=arguments.length>3,u=e.lowerBoundKey(t),c=e.upperBoundKey(t);return u?"gt"===u?r.gt=n(t.gt,!1):r.gte=n(t[u],!1):a&&(r.gte=n(i,!1)),c?"lt"===c?r.lt=n(t.lt,!0):r.lte=n(t[c],!0):a&&(r.lte=n(s,!0)),null!=t.reverse&&(r.reverse=!!t.reverse),o(r,"max")&&delete r.max,o(r,"min")&&delete r.min,o(r,"start")&&delete r.start,o(r,"end")&&delete r.end,r},e.contains=function(t,r,n){n=n||e.compare;var o=u(t);if(i(o)&&((s=n(r,o))<0||0===s&&f(t)))return!1;var s,a=d(t);return!i(a)||!((s=n(r,a))>0||0===s&&h(t))},e.filter=function(t,r){return function(n){return e.contains(t,n,r)}}},9024:t=>{const e=function(t,e){return t.slice(e-1).map(((r,n)=>t.slice(n,n+e)))};t.exports=function(t,r){return r.reduce(((r,n)=>[...e(t,n),...r]),[]).sort()}},4155: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,u=[],c=!1,l=-1;function f(){c&&a&&(c=!1,a.length?u=a.concat(u):l=-1,u.length&&h())}function h(){if(!c){var t=s(f);c=!0;for(var e=u.length;e;){for(a=u,u=[];++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)))},4281:t=>{"use strict";var e={};function r(t,r,n){n||(n=Error);var i=function(t){var e,n;function i(e,n,i){return t.call(this,function(t,e,n){return"string"==typeof r?r:r(t,e,n)}(e,n,i))||this}return n=t,(e=i).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=t,e[t]=i}function n(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}r("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,o,s,a,u;if("string"==typeof e&&(o="not ",e.substr(0,o.length)===o)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(n(e,"type"));else{var c=("number"!=typeof u&&(u=0),u+".".length>(a=t).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(t,'" ').concat(c," ").concat(i," ").concat(n(e,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.q=e},6753:(t,e,r)=>{"use strict";var n=r(4155),i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=l;var o=r(9481),s=r(4229);r(5717)(l,o);for(var a=i(s.prototype),u=0;u{"use strict";t.exports=i;var n=r(4605);function i(t){if(!(this instanceof i))return new i(t);n.call(this,t)}r(5717)(i,n),i.prototype._transform=function(t,e,r){r(null,t)}},9481:(t,e,r)=>{"use strict";var n,i=r(4155);t.exports=A,A.ReadableState=T,r(7187).EventEmitter;var o,s=function(t,e){return t.listeners(e).length},a=r(2503),u=r(8764).Buffer,c=r.g.Uint8Array||function(){},l=r(4616);o=l&&l.debuglog?l.debuglog("stream"):function(){};var f,h,p,d=r(7327),y=r(1195),g=r(2457).getHighWaterMark,b=r(4281).q,m=b.ERR_INVALID_ARG_TYPE,v=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(5717)(A,a);var _=y.errorOrDestroy,S=["error","close","destroy","pause","resume"];function T(t,e,i){n=n||r(6753),t=t||{},"boolean"!=typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(f||(f=r(2553).s),this.decoder=new f(t.encoding),this.encoding=t.encoding)}function A(t){if(n=n||r(6753),!(this instanceof A))return new A(t);var e=this instanceof n;this._readableState=new T(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function O(t,e,r,n,i){o("readableAddChunk",e);var s,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(o("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?k(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,L(t)))}}(t,a);else if(i||(s=function(t,e){var r,n;return n=e,u.isBuffer(n)||n instanceof c||"string"==typeof e||void 0===e||t.objectMode||(r=new m("chunk",["string","Buffer","Uint8Array"],e)),r}(a,e)),s)_(t,s);else if(a.objectMode||e&&e.length>0)if("string"==typeof e||a.objectMode||Object.getPrototypeOf(e)===u.prototype||(e=function(t){return u.from(t)}(e)),n)a.endEmitted?_(t,new E):x(t,a,e,!0);else if(a.ended)_(t,new v);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?x(t,a,e,!1):P(t,a)):x(t,a,e,!1)}else n||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=R?t=R:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function k(t){var e=t._readableState;o("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(o("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(L,t))}function L(t){var e=t._readableState;o("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,D(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(C,t,e))}function C(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function U(t){o("readable nexttick read 0"),t.read(0)}function N(t,e){o("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),D(t),e.flowing&&!e.reading&&t.read(0)}function D(t){var e=t._readableState;for(o("flow",e.flowing);e.flowing&&null!==t.read(););}function B(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function M(t){var e=t._readableState;o("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(F,e,t))}function F(t,e){if(o("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function V(t,e){for(var r=0,n=t.length;r=e.highWaterMark:e.length>0)||e.ended))return o("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?M(this):k(this),null;if(0===(t=I(t,e))&&e.ended)return 0===e.length&&M(this),null;var n,i=e.needReadable;return o("need readable",i),(0===e.length||e.length-t0?B(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&M(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(t){_(this,new w("_read()"))},A.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,e);var a=e&&!1===e.end||t===i.stdout||t===i.stderr?y:u;function u(){o("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",(function e(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),t.removeListener("close",p),t.removeListener("finish",d),t.removeListener("drain",c),t.removeListener("error",h),t.removeListener("unpipe",e),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",f),l=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}));var c=function(t){return function(){var e=t._readableState;o("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,D(t))}}(r);t.on("drain",c);var l=!1;function f(e){o("ondata");var i=t.write(e);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==V(n.pipes,t))&&!l&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(e){o("onerror",e),y(),t.removeListener("error",h),0===s(t,"error")&&_(t,e)}function p(){t.removeListener("finish",d),y()}function d(){o("onfinish"),t.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(t)}return r.on("data",f),function(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events.error?Array.isArray(t._events.error)?t._events.error.unshift(r):t._events.error=[r,t._events.error]:t.on(e,r)}(t,"error",h),t.once("close",p),t.once("finish",d),t.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),t},A.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?k(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(j,this),r},A.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(j,this),e},A.prototype.resume=function(){var t=this._readableState;return t.flowing||(o("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(N,t,e))}(this,t)),t.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var i in t.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(e.push(i)||(n=!0,t.pause()))})),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var s=0;s{"use strict";t.exports=l;var n=r(4281).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(6753);function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n,i=r(4155);function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(undefined),n=n.next}e.corkedRequestsFree.next=t}(e,t)}}t.exports=A,A.WritableState=T;var s,a={deprecate:r(4927)},u=r(2503),c=r(8764).Buffer,l=r.g.Uint8Array||function(){},f=r(1195),h=r(2457).getHighWaterMark,p=r(4281).q,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,b=p.ERR_STREAM_CANNOT_PIPE,m=p.ERR_STREAM_DESTROYED,v=p.ERR_STREAM_NULL_VALUES,w=p.ERR_STREAM_WRITE_AFTER_END,E=p.ERR_UNKNOWN_ENCODING,_=f.errorOrDestroy;function S(){}function T(t,e,s){n=n||r(6753),t=t||{},"boolean"!=typeof s&&(s=e instanceof n),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,n,o){--e.pendingcb,r?(i.nextTick(o,n),i.nextTick(L,t,e),t._writableState.errorEmitted=!0,_(t,n)):(o(n),t._writableState.errorEmitted=!0,_(t,n),L(t,e))}(t,r,n,e,o);else{var s=I(r)||t.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||R(t,r),n?i.nextTick(x,t,r,s,o):x(t,r,s,o)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(t){var e=this instanceof(n=n||r(6753));if(!e&&!s.call(A,this))return new A(t);this._writableState=new T(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),u.call(this)}function O(t,e,r,n,i,o,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new m("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function x(t,e,r,n){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,n(),L(t,e)}function R(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,O(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,l=r.encoding,f=r.callback;if(O(t,e,!1,e.objectMode?1:c.length,c,l,f),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function I(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function k(t,e){t._final((function(r){e.pendingcb--,r&&_(t,r),e.prefinished=!0,t.emit("prefinish"),L(t,e)}))}function L(t,e){var r=I(e);if(r&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,i.nextTick(k,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}r(5717)(A,u),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(t){return!!s.call(this,t)||this===A&&t&&t._writableState instanceof T}})):s=function(t){return t instanceof this},A.prototype.pipe=function(){_(this,new b)},A.prototype.write=function(t,e,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=t,c.isBuffer(n)||n instanceof l);return a&&!c.isBuffer(t)&&(t=function(t){return c.from(t)}(t)),"function"==typeof e&&(r=e,e=null),a?e="buffer":e||(e=o.defaultEncoding),"function"!=typeof r&&(r=S),o.ending?function(t,e){var r=new w;_(t,r),i.nextTick(e,r)}(this,r):(a||function(t,e,r,n){var o;return null===r?o=new v:"string"==typeof r||e.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(_(t,o),i.nextTick(n,o),!1)}(this,o,t,r))&&(o.pendingcb++,s=function(t,e,r,n,i,o){if(!r){var s=function(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=c.from(e,r)),e}(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(t,e,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,L(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),A.prototype.destroy=f.destroy,A.prototype._undestroy=f.undestroy,A.prototype._destroy=function(t,e){e(t)}},5850:(t,e,r)=>{"use strict";var n,i=r(4155);function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var s=r(8610),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),l=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(t,e){return{value:t,done:e}}function y(t){var e=t[a];if(null!==e){var r=t[p].read();null!==r&&(t[f]=null,t[a]=null,t[u]=null,e(d(r,!1)))}}function g(t){i.nextTick(y,t)}var b=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var t=this,e=this[c];if(null!==e)return Promise.reject(e);if(this[l])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(e,r){i.nextTick((function(){t[c]?r(t[c]):e(d(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(function(t,e){return function(r,n){t.then((function(){e[l]?r(d(void 0,!0)):e[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var t=this;return new Promise((function(e,r){t[p].destroy(null,(function(t){t?r(t):e(d(void 0,!0))}))}))})),n),b);t.exports=function(t){var e,r=Object.create(m,(o(e={},p,{value:t,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:null,writable:!0}),o(e,l,{value:t._readableState.endEmitted,writable:!0}),o(e,h,{value:function(t,e){var n=r[p].read();n?(r[f]=null,r[a]=null,r[u]=null,t(d(n,!1))):(r[a]=t,r[u]=e)},writable:!0}),e));return r[f]=null,s(t,(function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[u];return null!==e&&(r[f]=null,r[a]=null,r[u]=null,e(t)),void(r[c]=t)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[l]=!0})),t.on("readable",g.bind(null,r)),r}},7327:(t,e,r)=>{"use strict";function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o(t,e){for(var r=0;r0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return s.alloc(0);for(var e,r,n,i=s.allocUnsafe(t>>>0),o=this.head,a=0;o;)e=o.data,r=i,n=a,s.prototype.copy.call(e,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(t,e){var r;return ti.length?i.length:t;if(o===i.length?n+=i:n+=i.slice(0,t),0==(t-=o)){o===i.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=s.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var i=r.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),0==(t-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,e}},{key:u,value:function(t,e){return a(this,function(t){for(var e=1;e{"use strict";var n=r(4155);function i(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function s(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,t)):n.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,t)):n.nextTick(i,r,t):e?(n.nextTick(o,r),e(t)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}}},8610:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,r,o){if("function"==typeof r)return t(e,null,r);r||(r={}),o=function(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{t.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(t,e,r)=>{"use strict";var n,i=r(4281).q,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(t){if(t)throw t}function u(t,e,i,o){o=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=r(8610)),n(t,{readable:e,writable:i},(function(t){if(t)return o(t);a=!0,o()}));var u=!1;return function(e){if(!a&&!u)return u=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}function c(t){t()}function l(t,e){return t.pipe(e)}function f(t){return t.length?"function"!=typeof t[t.length-1]?a:t.pop():a}t.exports=function(){for(var t=arguments.length,e=new Array(t),r=0;r0,(function(t){n||(n=t),t&&s.forEach(c),o||(s.forEach(c),i(n))}))}));return e.reduce(l)}},2457:(t,e,r)=>{"use strict";var n=r(4281).q.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,r,i){var o=function(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}(e,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return t.objectMode?16:16384}}},2503:(t,e,r)=>{t.exports=r(7187).EventEmitter},8473:(t,e,r)=>{(e=t.exports=r(9481)).Stream=e,e.Readable=e,e.Writable=r(4229),e.Duplex=r(6753),e.Transform=r(4605),e.PassThrough=r(2725),e.finished=r(8610),e.pipeline=r(9946)},9967:(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,u,c,l=!0;function f(t){function e(){r&&r(t,i),r=null}l?n(e):e()}function h(e,r,n){if(i[e]=n,r&&(u=!0),0==--s||r)f(r);else if(!u&&c{"use strict";var n=r(396).Buffer,i=n.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(n.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=u,this.end=c,e=4;break;case"utf8":this.fillLast=a,e=4;break;case"base64":this.text=l,this.end=f,e=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function s(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function l(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function f(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function p(t){return t&&t.length?this.write(t):""}e.s=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},396:(t,e,r)=>{var n=r(8764),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},971: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]))}},3692:t=>{var e=t.exports=function(t){return new r(t)};function r(t){this.value=t}function n(t,e,r){var n=[],s=[],l=!0;return function t(f){var h=r?i(f):f,p={},d=!0,y={node:h,node_:f,path:[].concat(n),parent:s[s.length-1],parents:s,key:n.slice(-1)[0],isRoot:0===n.length,level:n.length,circular:null,update:function(t,e){y.isRoot||(y.parent.node[y.key]=t),y.node=t,e&&(d=!1)},delete:function(t){delete y.parent.node[y.key],t&&(d=!1)},remove:function(t){a(y.parent.node)?y.parent.node.splice(y.key,1):delete y.parent.node[y.key],t&&(d=!1)},keys:null,before:function(t){p.before=t},after:function(t){p.after=t},pre:function(t){p.pre=t},post:function(t){p.post=t},stop:function(){l=!1},block:function(){d=!1}};if(!l)return y;function g(){if("object"==typeof y.node&&null!==y.node){y.keys&&y.node_===y.node||(y.keys=o(y.node)),y.isLeaf=0==y.keys.length;for(var t=0;t{function n(t){try{if(!r.g.localStorage)return!1}catch(t){return!1}var e=r.g.localStorage[t];return null!=e&&"true"===String(e).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}},384:t=>{t.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},5955:(t,e,r)=>{"use strict";var n=r(2584),i=r(8662),o=r(6430),s=r(5692);function a(t){return t.call.bind(t)}var u="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,l=a(Object.prototype.toString),f=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),p=a(Boolean.prototype.valueOf);if(u)var d=a(BigInt.prototype.valueOf);if(c)var y=a(Symbol.prototype.valueOf);function g(t,e){if("object"!=typeof t)return!1;try{return e(t),!0}catch(t){return!1}}function b(t){return"[object Map]"===l(t)}function m(t){return"[object Set]"===l(t)}function v(t){return"[object WeakMap]"===l(t)}function w(t){return"[object WeakSet]"===l(t)}function E(t){return"[object ArrayBuffer]"===l(t)}function _(t){return"undefined"!=typeof ArrayBuffer&&(E.working?E(t):t instanceof ArrayBuffer)}function S(t){return"[object DataView]"===l(t)}function T(t){return"undefined"!=typeof DataView&&(S.working?S(t):t instanceof DataView)}e.isArgumentsObject=n,e.isGeneratorFunction=i,e.isTypedArray=s,e.isPromise=function(t){return"undefined"!=typeof Promise&&t instanceof Promise||null!==t&&"object"==typeof t&&"function"==typeof t.then&&"function"==typeof t.catch},e.isArrayBufferView=function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):s(t)||T(t)},e.isUint8Array=function(t){return"Uint8Array"===o(t)},e.isUint8ClampedArray=function(t){return"Uint8ClampedArray"===o(t)},e.isUint16Array=function(t){return"Uint16Array"===o(t)},e.isUint32Array=function(t){return"Uint32Array"===o(t)},e.isInt8Array=function(t){return"Int8Array"===o(t)},e.isInt16Array=function(t){return"Int16Array"===o(t)},e.isInt32Array=function(t){return"Int32Array"===o(t)},e.isFloat32Array=function(t){return"Float32Array"===o(t)},e.isFloat64Array=function(t){return"Float64Array"===o(t)},e.isBigInt64Array=function(t){return"BigInt64Array"===o(t)},e.isBigUint64Array=function(t){return"BigUint64Array"===o(t)},b.working="undefined"!=typeof Map&&b(new Map),e.isMap=function(t){return"undefined"!=typeof Map&&(b.working?b(t):t instanceof Map)},m.working="undefined"!=typeof Set&&m(new Set),e.isSet=function(t){return"undefined"!=typeof Set&&(m.working?m(t):t instanceof Set)},v.working="undefined"!=typeof WeakMap&&v(new WeakMap),e.isWeakMap=function(t){return"undefined"!=typeof WeakMap&&(v.working?v(t):t instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),e.isWeakSet=function(t){return w(t)},E.working="undefined"!=typeof ArrayBuffer&&E(new ArrayBuffer),e.isArrayBuffer=_,S.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&S(new DataView(new ArrayBuffer(1),0,1)),e.isDataView=T;var A="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function O(t){return"[object SharedArrayBuffer]"===l(t)}function x(t){return void 0!==A&&(void 0===O.working&&(O.working=O(new A)),O.working?O(t):t instanceof A)}function R(t){return g(t,f)}function I(t){return g(t,h)}function k(t){return g(t,p)}function L(t){return u&&g(t,d)}function P(t){return c&&g(t,y)}e.isSharedArrayBuffer=x,e.isAsyncFunction=function(t){return"[object AsyncFunction]"===l(t)},e.isMapIterator=function(t){return"[object Map Iterator]"===l(t)},e.isSetIterator=function(t){return"[object Set Iterator]"===l(t)},e.isGeneratorObject=function(t){return"[object Generator]"===l(t)},e.isWebAssemblyCompiledModule=function(t){return"[object WebAssembly.Module]"===l(t)},e.isNumberObject=R,e.isStringObject=I,e.isBooleanObject=k,e.isBigIntObject=L,e.isSymbolObject=P,e.isBoxedPrimitive=function(t){return R(t)||I(t)||k(t)||L(t)||P(t)},e.isAnyArrayBuffer=function(t){return"undefined"!=typeof Uint8Array&&(_(t)||x(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(t){Object.defineProperty(e,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})}))},9539:(t,e,r)=>{var n=r(4155),i=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}})),a=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&e._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,t,n.depth)}function l(t,e){var r=c.styles[e];return r?"["+c.colors[r][0]+"m"+t+"["+c.colors[r][1]+"m":t}function f(t,e){return t}function h(t,r,n){if(t.customInspect&&r&&A(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=h(t,i,n)),i}var o=function(t,e){if(w(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return m(e)?t.stylize(""+e,"number"):g(e)?t.stylize(""+e,"boolean"):b(e)?t.stylize("null","null"):void 0}(t,r);if(o)return o;var s=Object.keys(r),a=function(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(r)),T(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(r);if(0===s.length){if(A(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(E(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(S(r))return t.stylize(Date.prototype.toString.call(r),"date");if(T(r))return p(r)}var c,l="",f=!1,_=["{","}"];return y(r)&&(f=!0,_=["[","]"]),A(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),E(r)&&(l=" "+RegExp.prototype.toString.call(r)),S(r)&&(l=" "+Date.prototype.toUTCString.call(r)),T(r)&&(l=" "+p(r)),0!==s.length||f&&0!=r.length?n<0?E(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=f?function(t,e,r,n,i){for(var o=[],s=0,a=e.length;s60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}(c,l,_)):_[0]+l+_[1]}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?a=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(a=t.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(t.seen.indexOf(u.value)<0?(a=b(r)?h(t,u.value,null):h(t,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n")):a=t.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t){return Array.isArray(t)}function g(t){return"boolean"==typeof t}function b(t){return null===t}function m(t){return"number"==typeof t}function v(t){return"string"==typeof t}function w(t){return void 0===t}function E(t){return _(t)&&"[object RegExp]"===O(t)}function _(t){return"object"==typeof t&&null!==t}function S(t){return _(t)&&"[object Date]"===O(t)}function T(t){return _(t)&&("[object Error]"===O(t)||t instanceof Error)}function A(t){return"function"==typeof t}function O(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(t=t.toUpperCase(),!s[t])if(a.test(t)){var r=n.pid;s[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else s[t]=function(){};return s[t]},e.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.types=r(5955),e.isArray=y,e.isBoolean=g,e.isNull=b,e.isNullOrUndefined=function(t){return null==t},e.isNumber=m,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=w,e.isRegExp=E,e.types.isRegExp=E,e.isObject=_,e.isDate=S,e.types.isDate=S,e.isError=T,e.types.isNativeError=T,e.isFunction=A,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(384);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),R[t.getMonth()],e].join(" ")}function k(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",I(),e.format.apply(e,arguments))},e.inherits=r(5717),e._extend=function(t,e){if(!e||!_(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}e.promisify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');if(L&&t[L]){var e;if("function"!=typeof(e=t[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(e,L,{value:e,enumerable:!1,writable:!1,configurable:!0}),e}function e(){for(var e,r,n=new Promise((function(t,n){e=t,r=n})),i=[],o=0;o{"use strict";var n=r(9804),i=r(3083),o=r(1924),s=o("Object.prototype.toString"),a=r(6410)(),u="undefined"==typeof globalThis?r.g:globalThis,c=i(),l=o("String.prototype.slice"),f={},h=r(882),p=Object.getPrototypeOf;a&&h&&p&&n(c,(function(t){if("function"==typeof u[t]){var e=new u[t];if(Symbol.toStringTag in e){var r=p(e),n=h(r,Symbol.toStringTag);if(!n){var i=p(r);n=h(i,Symbol.toStringTag)}f[t]=n.get}}}));var d=r(5692);t.exports=function(t){return!!d(t)&&(a&&Symbol.toStringTag in t?function(t){var e=!1;return n(f,(function(r,n){if(!e)try{var i=r.call(t);i===n&&(e=i)}catch(t){}})),e}(t):l(s(t),8,-1))}},9602:t=>{"use strict";t.exports=function(t){t.prototype[Symbol.iterator]=function*(){for(let t=this.head;t;t=t.next)yield t.value}}},4411:(t,e,r)=>{"use strict";function n(t){var e=this;if(e instanceof n||(e=new n),e.tail=null,e.head=null,e.length=0,t&&"function"==typeof t.forEach)t.forEach((function(t){e.push(t)}));else if(arguments.length>0)for(var r=0,i=arguments.length;r1)r=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=t(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=t(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;null!==r;e++)t[e]=r.value,r=r.next;return t},n.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;null!==r;e++)t[e]=r.value,r=r.prev;return t},n.prototype.slice=function(t,e){(e=e||this.length)<0&&(e+=this.length),(t=t||0)<0&&(t+=this.length);var r=new n;if(ethis.length&&(e=this.length);for(var i=0,o=this.head;null!==o&&ithis.length&&(e=this.length);for(var i=this.length,o=this.tail;null!==o&&i>e;i--)o=o.prev;for(;null!==o&&i>t;i--,o=o.prev)r.push(o.value);return r},n.prototype.splice=function(t,e,...r){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);for(var n=0,i=this.head;null!==i&&n{t.exports=t=>{const e=t=>"string"==typeof t||t instanceof String,r=(n,i)=>new Promise((async o=>{return Number.isInteger(n)?o(JSON.stringify([n,n])):e(n)?o(t.tokenizer(n,i,t)):"object"!=typeof(a=n)||null===a||Array.isArray(a)?(t=>Array.isArray(t))(n)?o((u=n,Promise.all(u.map(r)))):o(null===n?JSON.stringify([null,"1.00"]):n):o((s=n,new Promise((async e=>{const n={};for(const e in s)n[e]=await r(s[e],e,t);return e(n)}))));var s,a,u})),n=async n=>new Promise((async i=>{e(n)&&(n={body:n}),Object.prototype.hasOwnProperty.call(n,"_id")||(n._id=t.idGenerator.next().value);const o={};for(const t in n)o[t]="_id"!==t?await r(n[t],t):n[t];return i(o)}));return{processDocuments:t=>Promise.all(t.map(n))}}},2225:(t,e,r)=>{const n=r(9203),i=r(7155),o=r(9593),s=r(6291),a=r(6761),u=r(4147),c=t=>new Promise((async e=>{const n=new o(1e3),u=new((await Promise.resolve().then(r.bind(r,5613))).default)({concurrency:1}),c=a(t,n,u),l=s(t,n);return c._INCREMENT_DOC_COUNT(0).then((()=>e({_AND:t.fii.AND,_BUCKET:t.fii.BUCKET,_GET:t.fii.GET,_NOT:t.fii.NOT,_OR:t.fii.OR,_CACHE:n,_PAGE:l.PAGE,_SCORE:l.SCORE,_SEARCH:l.SEARCH,_SORT:l.SORT,DELETE:c.DELETE,FLUSH:c.FLUSH,IMPORT:c.IMPORT,PUT:c.PUT,PUT_RAW:c.PUT_RAW,TOKENIZATION_PIPELINE_STAGES:i,ALL_DOCUMENTS:l.ALL_DOCUMENTS,BUCKETS:t.fii.BUCKETS,CREATED:t.fii.CREATED,DICTIONARY:l.DICTIONARY,DISTINCT:l.DISTINCT,DOCUMENTS:l.DOCUMENTS,DOCUMENT_COUNT:l.DOCUMENT_COUNT,EXPORT:t.fii.EXPORT,FACETS:l.FACETS,FIELDS:t.fii.FIELDS,INDEX:t.fii,LAST_UPDATED:t.fii.LAST_UPDATED,MAX:t.fii.MAX,MIN:t.fii.MIN,QUERY:l.QUERY,SEARCH:l.SEARCH})))}));t.exports=t=>((t={})=>new Promise(((e,r)=>(t=Object.assign({cacheLength:1e3,caseSensitive:!1,docExistsSpace:"DOC_RAW",idGenerator:function*(){let t=0;for(;;)yield Date.now()+"-"+t++}(),skipFields:[],ngrams:{},replace:{},storeRawDocs:!0,tokenizer:i.tokenizer,stopwords:[],storeVectors:!0,tokenAppend:"#"},t),n(t).then((r=>e(Object.assign({fii:r},t))))))))(t).then(c).then((t=>(t=>new Promise(((e,r)=>{const n=["CREATED_WITH"],i="search-index@"+u.version;return t.INDEX.STORE.get(n).then((t=>i===t?e():r(new Error("This index was created with "+t+", you are running "+i)))).catch((r=>t.INDEX.STORE.put(n,i).then(e)))})))(t).then((()=>t))))},6291:t=>{t.exports=(t,e)=>{const r=e=>new Promise(((r,n)=>{const i=[];t.fii.STORE.createReadStream({gte:["DOC_RAW",null],lte:["DOC_RAW",void 0],limit:e}).on("data",(t=>i.push({_id:t.value._id,_doc:t.value}))).on("end",(()=>r(i)))})),n=(...e)=>e.length?Promise.all(e.map((e=>t.fii.STORE.get(["DOC_RAW",e]).catch((t=>null))))):r(),i=(...e)=>t.fii.DISTINCT(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),o=(...e)=>t.fii.FACETS(...e).then((t=>[...t.reduce(((t,e)=>t.add(JSON.stringify(Object.assign(e,{VALUE:e.VALUE})))),new Set)].map(JSON.parse))),s=(t,e)=>{const r=(e=Object.assign({NUMBER:0,SIZE:20},e||{})).NUMBER*e.SIZE,n=r+e.SIZE||void 0;return t.slice(r,n)},a=(t,e={})=>{const r=t=>!e.FIELDS||e.FIELDS.includes(t.FIELD);return"TFIDF"===(e=Object.assign({TYPE:"TFIDF"},e)).TYPE?c().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?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t*+e.SCORE),1).toFixed(2),t)))))):"CONCAT"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.SCORE),""),t)))))):"SUM"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=+t._match.filter(r).reduce(((t,e)=>t+ +e.SCORE),0).toFixed(2),t)))))):"VALUE"===e.TYPE?new Promise((e=>e(t.map((t=>(t._score=t._match.filter(r).reduce(((t,e)=>t+e.VALUE),""),t)))))):void 0},u=(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])),c=()=>t.fii.STORE.get(["DOCUMENT_COUNT"]),l=(e,i={})=>{const c=e=>"string"==typeof e||"number"==typeof e?t.fii.GET(e,i.PIPELINE):e.FIELD||e.VALUE?t.fii.GET(e):e.AND?t.fii.AND(e.AND.map(c),i.PIPELINE):e.GET?t.fii.GET(e.GET,i.PIPELINE):e.NOT?t.fii.NOT(c(e.NOT.INCLUDE),c(e.NOT.EXCLUDE)):e.OR?t.fii.OR(e.OR.map(c),i.PIPELINE):e.ALL_DOCUMENTS?r(e.ALL_DOCUMENTS):void 0;return c(e).then((t=>t.RESULT?Object.assign(t,{RESULT_LENGTH:t.RESULT.length}):{RESULT:t,RESULT_LENGTH:t.length})).then((e=>i.BUCKETS?t.fii.BUCKETS(...i.BUCKETS).then((r=>Object.assign(e,{BUCKETS:t.fii.AGGREGATION_FILTER(r,e.RESULT)}))):e)).then((r=>i.FACETS?r.RESULT.length?e.ALL_DOCUMENTS?o(...i.FACETS).then((t=>Object.assign(r,{FACETS:t}))):o(...i.FACETS).then((e=>Object.assign(r,{FACETS:t.fii.AGGREGATION_FILTER(e,r.RESULT)}))):Object.assign(r,{FACETS:[]}):r)).then((t=>{return i.WEIGHT?Object.assign({RESULT:(e=t.RESULT,r=i.WEIGHT,e.map((t=>(t._match=t._match.map((t=>(r.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))))},t):t;var e,r})).then((t=>i.SCORE?a(t.RESULT,i.SCORE).then((e=>Object.assign(t,{RESULT:e}))):t)).then((t=>Object.assign(t,i.SORT?{RESULT:u(t.RESULT,i.SORT)}:{}))).then((t=>Object.assign(t,i.PAGE?{RESULT:s(t.RESULT,i.PAGE)}:{}))).then((t=>i.DOCUMENTS?n(...t.RESULT.map((t=>t._id))).then((e=>Object.assign(t,{RESULT:t.RESULT.map(((t,r)=>Object.assign(t,{_doc:e[r]})))}))):t))},f=(t,r)=>new Promise((n=>(r=JSON.stringify(r),e.has(r)?n(e.get(r)):t.then((t=>e.set(r,t))).then((()=>n(e.get(r)))))));return{ALL_DOCUMENTS:r,DICTIONARY:t=>f((t=>i(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"}))))))(t),{DICTIONARY:t||null}),DISTINCT:i,DOCUMENTS:(...t)=>f(n(...t),{DOCUMENTS:t}),DOCUMENT_COUNT:c,FACETS:o,PAGE:s,QUERY:(t,e)=>f(l(t,e),{QUERY:[t,e]}),SCORE:a,SEARCH:(t,e)=>f(((t,e)=>l({AND:[...t]},Object.assign({SCORE:{TYPE:"TFIDF"},SORT:!0},e)))(t,e),{SEARCH:[t,e]}),SORT:u}}},7155:(t,e,r)=>{const n=r(971),i=r(9024),o=([t,e,r])=>Promise.resolve([t.match(/[\p{L}\d]+/gu),e,r]),s=([t,e,r])=>[r.skipFields.includes(e)?[]:t,e,r],a=([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])},c=([t,e,r])=>{let{fields:n,lengths:o,join:s=" "}=r.ngrams;return n||(n=[e]),o&&n.includes(e)?[i(t.filter((t=>null!==t)),o).map((t=>t.join(s))),e,r]:Promise.resolve([t,e,r])},l=([t,e,r])=>[t.filter((t=>!r.stopwords.includes(t.toLowerCase()))),e,r],f=([t,e,r])=>{const i=n(t),o=i.reduce(((t,e)=>Math.max(e.positions.length,t)),0);return Promise.resolve([i.map((t=>JSON.stringify([t.term[0],(t.positions.length/o).toFixed(2)]))).sort(),e,r])};e.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])),e.tokenizer=(t,e,r)=>o([t,e,r]).then(s).then(a).then(u).then(c).then(l).then(f).then((([t,e,r])=>t)),e.SPLIT=o,e.SKIP=s,e.LOWACASE=a,e.REPLACE=u,e.NGRAMS=c,e.STOPWORDS=l,e.SCORE_TERM_FREQUENCY=f},6761:(t,e,r)=>{const n=r(1861);t.exports=(t,e,r)=>{const i=e=>t.fii.STORE.get(["DOCUMENT_COUNT"]).then((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],+r+e))).catch((r=>t.fii.STORE.put(["DOCUMENT_COUNT"],e))),o=(r,n,i)=>(e.reset(),Promise.all(r.map(((e,r)=>t.fii.STORE.put(["DOC_RAW",n[r]],i?{}:e)))).then((t=>r.map(((t,e)=>({_id:n[e],status:"OK",operation:"_PUT_RAW"}))))));return{DELETE:(...r)=>{return n=r,t.fii.DELETE(n).then((r=>{e.reset();const n=r.filter((t=>"DELETED"===t.status));return Promise.all([Promise.all(n.map((e=>t.fii.STORE.del(["DOC_RAW",e._id])))),(i=n.length,t.fii.STORE.get(["DOCUMENT_COUNT"]).then((e=>t.fii.STORE.put(["DOCUMENT_COUNT"],+e-i))))]).then((()=>r));var i}));var n},FLUSH:()=>t.fii.STORE.clear().then((()=>{e.reset();const r=Date.now();return t.fii.STORE.batch([{type:"put",key:["~CREATED"],value:r},{type:"put",key:["~LAST_UPDATED"],value:r},{type:"put",key:["DOCUMENT_COUNT"],value:0}])})).then((()=>!0)),IMPORT:r=>(e.reset(),Promise.resolve(t.fii.IMPORT(r))),PUT:(s,a)=>r.add((()=>((r,s)=>(e.reset(),s=Object.assign(t,s),n(t).processDocuments(r).then((e=>t.fii.PUT(e,s).then((e=>Promise.all([o(r,e.map((t=>t._id)),!t.storeRawDocs),i(e.filter((t=>"CREATED"===t.status)).length)]).then((()=>e))))))))(s,a))),PUT_RAW:o,_INCREMENT_DOC_COUNT:i}}},2361:()=>{},4616:()=>{},3083:(t,e,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],i="undefined"==typeof globalThis?r.g:globalThis;t.exports=function(){for(var t=[],e=0;e{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(t){n=null}t.exports=n},5613:(t,e,r)=>{"use strict";r.r(e),r.d(e,{default:()=>u});var n=r(6729);class i extends Error{constructor(t){super(t),this.name="TimeoutError"}}class o{constructor(){Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:[]})}enqueue(t,e){var r;const n={priority:(e={priority:0,...e}).priority,run:t};if(this.size&&(null===(r=this._queue[this.size-1])||void 0===r?void 0:r.priority)>=e.priority)return void this._queue.push(n);const i=function(t,e,r){let n=0,i=t.length;for(;i>0;){const r=Math.trunc(i/2);let s=n+r;o=t[s],e.priority-o.priority<=0?(n=++s,i-=r+1):i=r}var o;return n}(this._queue,n);this._queue.splice(i,0,n)}dequeue(){const t=this._queue.shift();return null==t?void 0:t.run}filter(t){return this._queue.filter((e=>e.priority===t.priority)).map((t=>t.run))}get size(){return this._queue.length}}const s=()=>{},a=new i;class u extends n{constructor(t){var e,r,n,i;if(super(),Object.defineProperty(this,"_carryoverConcurrencyCount",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isIntervalIgnored",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalCap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_interval",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_intervalEnd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_intervalId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_timeoutId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_queueClass",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pendingCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_concurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_isPaused",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_resolveEmpty",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_resolveIdle",{enumerable:!0,configurable:!0,writable:!0,value:s}),Object.defineProperty(this,"_timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_throwOnTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(t={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:o,...t}).intervalCap&&t.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(r=null===(e=t.intervalCap)||void 0===e?void 0:e.toString())&&void 0!==r?r:""}\` (${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 \`${null!==(i=null===(n=t.interval)||void 0===n?void 0:n.toString())&&void 0!==i?i:""}\` (${typeof t.interval})`);this._carryoverConcurrencyCount=t.carryoverConcurrencyCount,this._isIntervalIgnored=t.intervalCap===Number.POSITIVE_INFINITY||0===t.interval,this._intervalCap=t.intervalCap,this._interval=t.interval,this._queue=new t.queueClass,this._queueClass=t.queueClass,this.concurrency=t.concurrency,this._timeout=t.timeout,this._throwOnTimeout=!0===t.throwOnTimeout,this._isPaused=!1===t.autoStart}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()}),e)),!0;this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0}return!1}_tryToStartAnother(){if(0===this._queue.size)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const t=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const e=this._queue.dequeue();return!!e&&(this.emit("active"),e(),t&&this._initializeIntervalIfNeeded(),!0)}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||void 0!==this._intervalId||(this._intervalId=setInterval((()=>{this._onInterval()}),this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){0===this._intervalCount&&0===this._pendingCount&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}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._concurrency=t,this._processQueue()}async add(t,e={}){return new Promise(((r,n)=>{this._queue.enqueue((async()=>{this._pendingCount++,this._intervalCount++;try{const i=void 0===this._timeout&&void 0===e.timeout?t():function(t,e,r,n){let i;const o=new Promise(((o,s)=>{if("number"!=typeof e||1!==Math.sign(e))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${e}\``);e!==Number.POSITIVE_INFINITY?(n={customTimers:{setTimeout,clearTimeout},...n},i=n.customTimers.setTimeout.call(void 0,(()=>{try{o(r())}catch(t){s(t)}}),e),(async()=>{try{o(await t)}catch(t){s(t)}finally{n.customTimers.clearTimeout.call(void 0,i)}})()):o(t)}));return o.clear=()=>{clearTimeout(i),i=void 0},o}(Promise.resolve(t()),void 0===e.timeout?this._timeout:e.timeout,(()=>{(void 0===e.throwOnTimeout?this._throwOnTimeout:e.throwOnTimeout)&&n(a)})),o=await i;r(o),this.emit("completed",o)}catch(t){n(t),this.emit("error",t)}this._next()}),e),this._tryToStartAnother(),this.emit("add")}))}async addAll(t,e){return Promise.all(t.map((async t=>this.add(t,e))))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(0!==this._queue.size)return new Promise((t=>{const e=this._resolveEmpty;this._resolveEmpty=()=>{e(),t()}}))}async onSizeLessThan(t){if(!(this._queue.size{const r=()=>{this._queue.size{const e=this._resolveIdle;this._resolveIdle=()=>{e(),t()}}))}get size(){return this._queue.size}sizeBy(t){return this._queue.filter(t).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(t){this._timeout=t}}},4147:t=>{"use strict";t.exports=JSON.parse('{"name":"search-index","version":"3.0.1","description":"A network resilient, persistent full-text search library for the browser and Node.js","keywords":["search","elasticsearch","elastic","lunr.js","flexsearch","norch","solr"],"engines":{"node":">=12"},"main":"src/node.js","browser":"src/browser.js","files":["dist","src"],"directories":{"lib":"src"},"scripts":{"build":"npm run empty-sandbox && rm -rf ./dist/* && webpack && cp dist/search-index-$npm_package_version.js dist/search-index.js","demo-export":"node demo/generate-index/export.js","demo-fetch":"node demo/generate-index/fetch.js","demo-process":"node demo/generate-index/process.js","demo-rebuild":"npm run demo-fetch && npm run demo-process && npm run demo-export && npm run demo-link-lib","demo-start":"http-server -c-1 demo & open-cli http://127.0.0.1:8080","demo-link-lib":"cd demo/lib && ln -sf ../../dist/search-index.js && cd ../../","empty-sandbox":"rm -rf fii && rm -rf test/sandbox && mkdir test/sandbox","lint":"standard --fix test/src/* src/* demo/src/* demo/generate-index/*.js","test":"npm run empty-sandbox && npm run test-node && npm run test-browser && npm run lint","test-browser":"npm run build && cat test/sandbox/browser-tests.js | tape-run","test-node":"npm run empty-sandbox && tape test/src/*-test.js","toc":"doctoc docs/API.md --title \'# API Documentation for search-index\' && doctoc docs/FAQ.md --title \'# FAQ\'"},"repository":{"type":"git","url":"git+https://github.com/fergiemcdowall/search-index.git"},"author":"Fergus McDowall","license":"MIT","bugs":{"url":"https://github.com/fergiemcdowall/search-index/issues"},"homepage":"https://fergiemcdowall.github.io/search-index/","devDependencies":{"assert":"^2.0.0","doctoc":"^2.1.0","fuzzyset":"1.0.5","http-server":"14.0.0","level-out":"^1.0.1","memdown":"^6.1.1","open-cli":"^7.0.1","path":"^0.12.7","path-browserify":"^1.0.1","process":"^0.11.10","standard":"^16.0.4","stemmer":"^1.0.5","stopword":"^1.0.11","stream-browserify":"^3.0.0","tape":"^5.4.1","tape-run":"^9.0.0","webpack":"^5.67.0","webpack-cli":"^4.9.2","world-bank-dataset":"^1.0.0"},"dependencies":{"fergies-inverted-index":"10.0.5","level-js":"^6.1.0","leveldown":"^6.1.0","lru-cache":"^6.0.0","ngraminator":"^2.0.6","p-queue":"^7.1.0","term-vector":"^1.0.0"}}')}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](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=r(2225);SearchIndex=n})(); \ No newline at end of file