/*! For license information please see OCR.js.LICENSE.txt */ (()=>{var e={67526:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,i=u(e),a=i[0],s=i[1],c=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),l=0,f=s>0?a-4:a;for(r=0;r>16&255,c[l++]=t>>8&255,c[l++]=255&t;return 2===s&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[l++]=255&t),1===s&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[l++]=t>>8&255,c[l++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,o=n%3,i=[],a=16383,u=0,c=n-o;uc?c:u+a));return 1===o?(t=e[n-1],i.push(r[t>>2]+r[t<<4&63]+"==")):2===o&&(t=(e[n-2]<<8)+e[n-1],i.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),i.join("")};for(var r=[],n=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)r[a]=i[a],n[i.charCodeAt(a)]=a;function u(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(e,t,n){for(var o,i,a=[],u=t;u>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},48287:(e,t,r)=>{"use strict";const n=r(67526),o=r(251),i="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.INSPECT_MAX_BYTES=50;const a=2147483647;function u(e){if(e>a)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,s.prototype),t}function s(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|m(e,t);let n=u(r);const o=n.write(e,t);return o!==r&&(n=n.slice(0,o)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(q(e,Uint8Array)){const t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(q(e,ArrayBuffer)||e&&q(e.buffer,ArrayBuffer))return h(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(q(e,SharedArrayBuffer)||e&&q(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,r);const o=function(e){if(s.isBuffer(e)){const t=0|d(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||K(e.length)?u(0):p(e):"Buffer"===e.type&&Array.isArray(e.data)?p(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function l(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return l(e),u(e<0?0:0|d(e))}function p(e){const t=e.length<0?0:0|d(e.length),r=u(t);for(let n=0;n=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return 0|e}function m(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return W(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(o)return n?-1:W(e).length;t=(""+t).toLowerCase(),o=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return C(this,t,r);case"base64":return F(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,o){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),K(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:w(e,t,r,n,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):w(e,[t],r,n,o);throw new TypeError("val must be string, number or Buffer")}function w(e,t,r,n,o){let i,a=1,u=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,u/=2,s/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){let n=-1;for(i=r;iu&&(r=u-s),i=r;i>=0;i--){let r=!0;for(let n=0;no&&(n=o):n=o;const i=t.length;let a;for(n>i/2&&(n=i/2),a=0;a>8,o=r%256,i.push(o),i.push(n);return i}(t,e.length-r),e,r,n)}function F(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);const n=[];let o=t;for(;o239?4:t>223?3:t>191?2:1;if(o+a<=r){let r,n,u,s;switch(a){case 1:t<128&&(i=t);break;case 2:r=e[o+1],128==(192&r)&&(s=(31&t)<<6|63&r,s>127&&(i=s));break;case 3:r=e[o+1],n=e[o+2],128==(192&r)&&128==(192&n)&&(s=(15&t)<<12|(63&r)<<6|63&n,s>2047&&(s<55296||s>57343)&&(i=s));break;case 4:r=e[o+1],n=e[o+2],u=e[o+3],128==(192&r)&&128==(192&n)&&128==(192&u)&&(s=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&u,s>65535&&s<1114112&&(i=s))}}null===i?(i=65533,a=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=a}return function(e){const t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(s.isBuffer(t)||(t=s.from(t)),t.copy(n,o)):Uint8Array.prototype.set.call(n,t,o);else{if(!s.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,o)}o+=t.length}return n},s.byteLength=m,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},i&&(s.prototype[i]=s.prototype.inspect),s.prototype.compare=function(e,t,r,n,o){if(q(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),t<0||r>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&t>=r)return 0;if(n>=o)return-1;if(t>=r)return 1;if(this===e)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0);const u=Math.min(i,a),c=this.slice(n,o),l=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return B(this,e,t,r);case"ascii":case"latin1":case"binary":return x(this,e,t,r);case"base64":return A(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const I=4096;function T(e,t,r){let n="";r=Math.min(e.length,r);for(let o=t;on)&&(r=n);let o="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,o,i){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function _(e,t,r,n,o){G(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i,i>>=8,e[r++]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,r}function D(e,t,r,n,o){G(t,n,o,e,r,7);let i=Number(t&BigInt(4294967295));e[r+7]=i,i>>=8,e[r+6]=i,i>>=8,e[r+5]=i,i>>=8,e[r+4]=i;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=a,a>>=8,e[r+2]=a,a>>=8,e[r+1]=a,a>>=8,e[r]=a,r+8}function U(e,t,r,n,o,i){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,i){return t=+t,r>>>=0,i||U(e,0,r,4),o.write(e,t,r,n,23,4),r+4}function P(e,t,r,n,i){return t=+t,r>>>=0,i||U(e,0,r,8),o.write(e,t,r,n,52,8),r+8}s.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],o=1,i=0;for(;++i>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e+--t],o=1;for(;t>0&&(o*=256);)n+=this[e+--t]*o;return n},s.prototype.readUint8=s.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readBigUInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Y(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,o=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(o)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Y(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],o=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||O(e,t,this.length);let n=this[e],o=1,i=0;for(;++i=o&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);let n=t,o=1,i=this[e+--n];for(;n>0&&(o*=256);)i+=this[e+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*t)),i},s.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readBigInt64LE=X((function(e){z(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Y(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||Y(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||O(e,4,this.length),o.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),o.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),o.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),o.read(this,e,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let o=1,i=0;for(this[t]=255&e;++i>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let o=r-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigUInt64LE=X((function(e,t=0){return _(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeBigUInt64BE=X((function(e,t=0){return D(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),s.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let o=0,i=1,a=0;for(this[t]=255&e;++o>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let o=r-1,i=1,a=0;for(this[t+o]=255&e;--o>=0&&(i*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/i|0)-a&255;return t+r},s.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeBigInt64LE=X((function(e,t=0){return _(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeBigInt64BE=X((function(e,t=0){return D(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),s.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},s.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},s.prototype.writeDoubleLE=function(e,t,r){return P(this,e,t,!0,r)},s.prototype.writeDoubleBE=function(e,t,r){return P(this,e,t,!1,r)},s.prototype.copy=function(e,t,r,n){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=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),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function G(e,t,r,n,o,i){if(e>r||e3?0===t||t===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}`:`>= ${t}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",o,e)}!function(e,t,r){z(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||Y(t,e.length-(r+1))}(n,o,i)}function z(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function Y(e,t,r){if(Math.floor(e)!==e)throw z(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}j("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),j("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),j("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=$(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=$(o)),o+="n"),n+=` It must be ${t}. Received ${o}`,n}),RangeError);const H=/[^+/0-9A-Za-z-_]/g;function W(e,t){let r;t=t||1/0;const n=e.length;let o=null;const i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;i.push(r)}else if(r<2048){if((t-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function V(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(H,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let o;for(o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}const Z=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)t[n+o]=e[r]+e[o]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},251:(e,t)=>{t.read=function(e,t,r,n,o){var i,a,u=8*o-n-1,s=(1<>1,l=-7,f=r?o-1:0,p=r?-1:1,h=e[t+f];for(f+=p,i=h&(1<<-l)-1,h>>=-l,l+=u;l>0;i=256*i+e[t+f],f+=p,l-=8);for(a=i&(1<<-l)-1,i>>=-l,l+=n;l>0;a=256*a+e[t+f],f+=p,l-=8);if(0===i)i=1-c;else{if(i===s)return a?NaN:1/0*(h?-1:1);a+=Math.pow(2,n),i-=c}return(h?-1:1)*a*Math.pow(2,i-n)},t.write=function(e,t,r,n,o,i){var a,u,s,c=8*i-o-1,l=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,a=l):(a=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-a))<1&&(a--,s*=2),(t+=a+f>=1?p/s:p*Math.pow(2,1-f))*s>=2&&(a++,s/=2),a+f>=l?(u=0,a=l):a+f>=1?(u=(t*s-1)*Math.pow(2,o),a+=f):(u=t*Math.pow(2,f-1)*Math.pow(2,o),a=0));o>=8;e[r+h]=255&u,h+=d,u/=256,o-=8);for(a=a<0;e[r+h]=255&a,h+=d,a/=256,c-=8);e[r+h-d]|=128*m}},4866:(e,t,r)=>{var n=r(65606);e.exports=function(){return"undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||!(void 0===n||"object"!=typeof n.versions||!n.versions.electron)||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0}},73065:function(e,t,r){var n,o;!function(i,a){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],o={},i=null;function a(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function u(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(){for(var r=this.getLevel(),o=0;o=0&&t<=f.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?p+=":"+e:"symbol"==typeof e&&(p=void 0),f.name=e,f.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},f.methodFactory=r||l,f.getLevel=function(){return null!=c?c:null!=u?u:a},f.setLevel=function(e,r){return c=d(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&p){try{return void(window.localStorage[p]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(p)+"="+r+";"}catch(e){}}}(c),s.call(f)},f.setDefaultLevel=function(e){u=d(e),h()||f.setLevel(e,!1)},f.resetLevel=function(){c=null,function(){if(typeof window!==t&&p){try{window.localStorage.removeItem(p)}catch(e){}try{window.document.cookie=encodeURIComponent(p)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),s.call(f)},f.enableAll=function(e){f.setLevel(f.levels.TRACE,e)},f.disableAll=function(e){f.setLevel(f.levels.SILENT,e)},f.rebuild=function(){if(i!==f&&(a=d(i.getLevel())),s.call(f),i===f)for(var e in o)o[e].rebuild()},a=d(i?i.getLevel():"WARN");var m=h();null!=m&&(c=d(m)),s.call(f)}(i=new f).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=o[e];return t||(t=o[e]=new f(e,i.methodFactory)),t};var p=typeof window!==t?window.log:void 0;return i.noConflict=function(){return typeof window!==t&&window.log===i&&(window.log=p),i},i.getLoggers=function(){return o},i.default=i,i},void 0===(o=n.call(t,r,t,e))||(e.exports=o)}()},65606:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var u,s=[],c=!1,l=-1;function f(){c&&u&&(c=!1,u.length?s=u.concat(s):l=-1,s.length&&p())}function p(){if(!c){var e=a(f);c=!0;for(var t=s.length;t;){for(u=s,s=[];++l1)for(var r=1;r{var t=function(e){"use strict";var t,r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",u=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),u=new L(n||[]);return o(a,"_invoke",{value:k(e,r,u)}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var p="suspendedStart",h="suspendedYield",d="executing",m="completed",g={};function y(){}function v(){}function w(){}var b={};c(b,a,(function(){return this}));var B=Object.getPrototypeOf,x=B&&B(B(S([])));x&&x!==r&&n.call(x,a)&&(b=x);var A=w.prototype=y.prototype=Object.create(b);function E(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function F(e,t){function r(o,i,a,u){var s=f(e[o],e,i);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){c.value=e,a(c)}),(function(e){return r("throw",e,a,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function k(e,t,r){var n=p;return function(o,i){if(n===d)throw new Error("Generator is already running");if(n===m){if("throw"===o)throw i;return O()}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var u=I(a,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(n===p)throw n=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n=d;var s=f(e,t,r);if("normal"===s.type){if(n=r.done?m:h,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(n=m,r.method="throw",r.arg=s.arg)}}}function I(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),g;var i=f(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,g;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function S(e){if(e){var r=e[a];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--i){var a=this.tryEntries[i],u=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var s=n.call(a,"catchLoc"),c=n.call(a,"finallyLoc");if(s&&c){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:S(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}},77465:(e,t,r)=>{const n=r(12477);e.exports={recognize:async(e,t,r)=>{const o=await n(t,1,r);return o.recognize(e).finally((async()=>{await o.terminate()}))},detect:async(e,t)=>{const r=await n("osd",0,t);return r.detect(e).finally((async()=>{await r.terminate()}))}}},89742:e=>{e.exports={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3}},30949:e=>{e.exports={OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12",RAW_LINE:"13"}},84500:e=>{e.exports={workerBlobURL:!0,logger:()=>{}}},32646:e=>{e.exports={AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"}},19500:(e,t,r)=>{const n=r(1028);let o=0;e.exports=({id:e,action:t,payload:r={}})=>{let i=e;return void 0===i&&(i=n("Job",o),o+=1),{id:i,action:t,payload:r}}},18501:function(e,t,r){const n=r(19500),{log:o}=r(8787),i=r(1028);let a=0;e.exports=()=>{const e=i("Scheduler",a),t={},r={};let u=[];a+=1;const s=()=>Object.keys(t).length,c=()=>{if(0!==u.length){const e=Object.keys(t);for(let n=0;nnew Promise(((a,s)=>{const l=n({action:t,payload:i});u.push((async e=>{u.shift(),r[e.id]=l;try{a(await e[t].apply(this,[...i,l.id]))}catch(e){s(e)}finally{delete r[e.id],c()}})),o(`[${e}]: Add ${l.id} to JobQueue`),o(`[${e}]: JobQueue length=${u.length}`),c()}));return{addWorker:r=>(t[r.id]=r,o(`[${e}]: Add ${r.id}`),o(`[${e}]: Number of workers=${s()}`),c(),r.id),addJob:async(t,...r)=>{if(0===s())throw Error(`[${e}]: You need to have at least one worker before adding jobs`);return l(t,r)},terminate:async()=>{Object.keys(t).forEach((async e=>{await t[e].terminate()})),u=[]},getQueueLen:()=>u.length,getNumWorkers:s}}},12477:(e,t,r)=>{const n=r(65981),o=r(64760),i=r(19500),{log:a}=r(8787),u=r(1028),s=r(89742),{defaultOptions:c,spawnWorker:l,terminateWorker:f,onMessage:p,loadImage:h,send:d}=r(65321);let m=0;e.exports=async(e="eng",t=s.LSTM_ONLY,r={},g={})=>{const y=u("Worker",m),{logger:v,errorHandler:w,...b}=n({...c,...r}),B={},x={},A="string"==typeof e?e.split("+"):e;let E=t,F=g;const k=[s.DEFAULT,s.LSTM_ONLY].includes(t)&&!b.legacyCore;let I,T;const C=new Promise(((e,t)=>{T=e,I=t}));let L=l(b);L.onerror=e=>{I(e.message)},m+=1;const S=(e,t)=>{B[e]=t},O=(e,t)=>{x[e]=t},R=({id:e,action:t,payload:r})=>new Promise(((n,o)=>{a(`[${y}]: Start ${e}, action=${t}`);const i=`${t}-${e}`;S(i,n),O(i,o),d(L,{workerId:y,jobId:e,action:t,payload:r})})),_=(e,t)=>R(i({id:t,action:"loadLanguage",payload:{langs:e,options:{langPath:b.langPath,dataPath:b.dataPath,cachePath:b.cachePath,cacheMethod:b.cacheMethod,gzip:b.gzip,lstmOnly:[s.LSTM_ONLY,s.TESSERACT_LSTM_COMBINED].includes(E)&&!b.legacyLang}}})),D=(e,t,r,n)=>R(i({id:n,action:"initialize",payload:{langs:e,oem:t,config:r}}));p(L,(({workerId:e,jobId:t,status:r,action:n,data:i})=>{const u=`${n}-${t}`;if("resolve"===r){a(`[${e}]: Complete ${t}`);let r=i;"recognize"===n?r=o(i):"getPDF"===n&&(r=Array.from({...i,length:Object.keys(i).length})),B[u]({jobId:t,data:r})}else if("reject"===r){if(x[u](i),"load"===n&&I(i),!w)throw Error(i);w(i)}else"progress"===r&&v({...i,userJobId:t})}));const U={id:y,worker:L,setResolve:S,setReject:O,load:()=>console.warn("`load` is depreciated and should be removed from code (workers now come pre-loaded)"),writeText:(e,t,r)=>R(i({id:r,action:"FS",payload:{method:"writeFile",args:[e,t]}})),readText:(e,t)=>R(i({id:t,action:"FS",payload:{method:"readFile",args:[e,{encoding:"utf8"}]}})),removeFile:(e,t)=>R(i({id:t,action:"FS",payload:{method:"unlink",args:[e]}})),FS:(e,t,r)=>R(i({id:r,action:"FS",payload:{method:e,args:t}})),loadLanguage:()=>console.warn("`loadLanguage` is depreciated and should be removed from code (workers now come with language pre-loaded)"),initialize:()=>console.warn("`initialize` is depreciated and should be removed from code (workers now come pre-initialized)"),reinitialize:(e="eng",t,r,n)=>{if(k&&[s.TESSERACT_ONLY,s.TESSERACT_LSTM_COMBINED].includes(t))throw Error("Legacy model requested but code missing.");const o=t||E;E=o;const i=r||F;F=i;const a=("string"==typeof e?e.split("+"):e).filter((e=>!A.includes(e)));return A.push(...a),a.length>0?_(a,n).then((()=>D(e,o,i,n))):D(e,o,i,n)},setParameters:(e={},t)=>R(i({id:t,action:"setParameters",payload:{params:e}})),recognize:async(e,t={},r={blocks:!0,text:!0,hocr:!0,tsv:!0},n)=>R(i({id:n,action:"recognize",payload:{image:await h(e),options:t,output:r}})),getPDF:(e="Tesseract OCR Result",t=!1,r)=>(console.log("`getPDF` function is depreciated. `recognize` option `savePDF` should be used instead."),R(i({id:r,action:"getPDF",payload:{title:e,textonly:t}}))),detect:async(e,t)=>{if(k)throw Error("`worker.detect` requires Legacy model, which was not loaded.");return R(i({id:t,action:"detect",payload:{image:await h(e)}}))},terminate:async()=>(null!==L&&(f(L),L=null),Promise.resolve())};return R(i({id:undefined,action:"load",payload:{options:{lstmOnly:k,corePath:b.corePath,logging:b.logging}}})).then((()=>_(e))).then((()=>D(e,t,g))).then((()=>T(U))).catch((()=>{})),C}},34995:(e,t,r)=>{r(7452);const n=r(18501),o=r(12477),i=r(77465),a=r(32646),u=r(89742),s=r(30949),{setLogging:c}=r(8787);e.exports={languages:a,OEM:u,PSM:s,createScheduler:n,createWorker:o,setLogging:c,...i}},64760:e=>{e.exports=e=>{const t=[],r=[],n=[],o=[],i=[];return e.blocks&&e.blocks.forEach((a=>{a.paragraphs.forEach((t=>{t.lines.forEach((r=>{r.words.forEach((n=>{n.symbols.forEach((o=>{i.push({...o,page:e,block:a,paragraph:t,line:r,word:n})})),o.push({...n,page:e,block:a,paragraph:t,line:r})})),n.push({...r,page:e,block:a,paragraph:t})})),r.push({...t,page:e,block:a})})),t.push({...a,page:e})})),{...e,blocks:t,paragraphs:r,lines:n,words:o,symbols:i}}},3820:(e,t,r)=>{var n=r(65606);const o=r(4866);e.exports=e=>{const t={};return"undefined"!=typeof WorkerGlobalScope?t.type="webworker":o()?t.type="electron":"object"==typeof document?t.type="browser":"object"==typeof n&&(t.type="node"),void 0===e?t:t[e]}},1028:e=>{e.exports=(e,t)=>`${e}-${t}-${Math.random().toString(16).slice(3,8)}`},8787:function(e,t){let r=!1;t.logging=r,t.setLogging=e=>{r=e},t.log=(...e)=>r?console.log.apply(this,e):null},65981:(e,t,r)=>{const n="browser"===r(3820)("type")?e=>new URL(e,window.location.href).href:e=>e;e.exports=e=>{const t={...e};return["corePath","workerPath","langPath"].forEach((r=>{e[r]&&(t[r]=n(t[r]))})),t}},11848:(e,t,r)=>{const n=r(76125).rE,o=r(84500);e.exports={...o,workerPath:`https://cdn.jsdelivr.net/npm/tesseract.js@v${n}/dist/worker.min.js`}},65321:(e,t,r)=>{const n=r(11848),o=r(17456),i=r(69548),a=r(25381),u=r(35039),s=r(59996);e.exports={defaultOptions:n,spawnWorker:o,terminateWorker:i,onMessage:a,send:u,loadImage:s}},59996:e=>{const t=e=>new Promise(((t,r)=>{const n=new FileReader;n.onload=()=>{t(n.result)},n.onerror=({target:{error:{code:e}}})=>{r(Error(`File could not be read! Code=${e}`))},n.readAsArrayBuffer(e)})),r=async e=>{let n=e;if(void 0===e)return"undefined";if("string"==typeof e)if(/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(e))n=atob(e.split(",")[1]).split("").map((e=>e.charCodeAt(0)));else{const t=await fetch(e);n=await t.arrayBuffer()}else if("undefined"!=typeof HTMLElement&&e instanceof HTMLElement)"IMG"===e.tagName&&(n=await r(e.src)),"VIDEO"===e.tagName&&(n=await r(e.poster)),"CANVAS"===e.tagName&&await new Promise((r=>{e.toBlob((async e=>{n=await t(e),r()}))}));else if("undefined"!=typeof OffscreenCanvas&&e instanceof OffscreenCanvas){const r=await e.convertToBlob();n=await t(r)}else(e instanceof File||e instanceof Blob)&&(n=await t(e));return new Uint8Array(n)};e.exports=r},25381:e=>{e.exports=(e,t)=>{e.onmessage=({data:e})=>{t(e)}}},35039:e=>{e.exports=async(e,t)=>{e.postMessage(t)}},17456:e=>{e.exports=({workerPath:e,workerBlobURL:t})=>{let r;if(Blob&&URL&&t){const t=new Blob([`importScripts("${e}");`],{type:"application/javascript"});r=new Worker(URL.createObjectURL(t))}else r=new Worker(e);return r}},69548:e=>{e.exports=e=>{e.terminate()}},90031:(e,t)=>{!function(e){var t,r,n,o=String.fromCharCode;function i(e){for(var t,r,n=[],o=0,i=e.length;o=55296&&t<=56319&&o=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function u(e,t){return o(e>>t&63|128)}function s(e){if(!(4294967168&e))return o(e);var t="";return 4294965248&e?4294901760&e?4292870144&e||(t=o(e>>18&7|240),t+=u(e,12),t+=u(e,6)):(a(e),t=o(e>>12&15|224),t+=u(e,6)):t=o(e>>6&31|192),t+o(63&e|128)}function c(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function l(){var e,o;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,!(128&e))return e;if(192==(224&e)){if((o=(31&e)<<6|c())>=128)return o;throw Error("Invalid continuation byte")}if(224==(240&e)){if((o=(15&e)<<12|c()<<6|c())>=2048)return a(o),o;throw Error("Invalid continuation byte")}if(240==(248&e)&&(o=(7&e)<<18|c()<<12|c()<<6|c())>=65536&&o<=1114111)return o;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=i(e),r=t.length,n=-1,o="";++n65535&&(i+=o((t-=65536)>>>10&1023|55296),t=56320|1023&t),i+=o(t);return i}(u)}}(t)},4633:(e,t,r)=>{var n=r(73738).default;function o(){"use strict";e.exports=o=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},i=Object.prototype,a=i.hasOwnProperty,u=Object.defineProperty||function(e,t,r){e[t]=r.value},s="function"==typeof Symbol?Symbol:{},c=s.iterator||"@@iterator",l=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function p(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{p({},"")}catch(t){p=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,i=Object.create(o.prototype),a=new R(n||[]);return u(i,"_invoke",{value:C(e,r,a)}),i}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=h;var m="suspendedStart",g="suspendedYield",y="executing",v="completed",w={};function b(){}function B(){}function x(){}var A={};p(A,c,(function(){return this}));var E=Object.getPrototypeOf,F=E&&E(E(_([])));F&&F!==i&&a.call(F,c)&&(A=F);var k=x.prototype=b.prototype=Object.create(A);function I(e){["next","throw","return"].forEach((function(t){p(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(o,i,u,s){var c=d(e[o],e,i);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&a.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,u,s)}),(function(e){r("throw",e,u,s)})):t.resolve(f).then((function(e){l.value=e,u(l)}),(function(e){return r("throw",e,u,s)}))}s(c.arg)}var o;u(this,"_invoke",{value:function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}})}function C(e,r,n){var o=m;return function(i,a){if(o===y)throw Error("Generator is already running");if(o===v){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var u=n.delegate;if(u){var s=L(u,n);if(s){if(s===w)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===m)throw o=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=y;var c=d(e,r,n);if("normal"===c.type){if(o=n.done?v:g,c.arg===w)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(o=v,n.method="throw",n.arg=c.arg)}}}function L(e,r){var n=r.method,o=e.iterator[n];if(o===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,L(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),w;var i=d(o,e.iterator,r.arg);if("throw"===i.type)return r.method="throw",r.arg=i.arg,r.delegate=null,w;var a=i.arg;return a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,w):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,w)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function _(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function r(){for(;++o=0;--o){var i=this.tryEntries[o],u=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),c=a.call(i,"finallyLoc");if(s&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),O(r),w}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;O(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:_(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),w}},r}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},73738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756:(e,t,r)=>{var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},76125:e=>{"use strict";e.exports={rE:"5.1.0"}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if("string"==typeof e&&(e=U.strToArrayBuffer(e)),e instanceof ArrayBuffer&&(e=new Uint8Array(e)),64!==(t=U.expandAlphRange(t).join("")).length&&65!==t.length)throw new E(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,n,o,i,a,u,s,c="",l=0;l>2,a=(3&r)<<4|(n=e[l++])>>4,u=(15&n)<<2|(o=e[l++])>>6,s=63&o,isNaN(n)?u=s=64:isNaN(o)&&(s=64),c+=t.charAt(i)+t.charAt(a)+t.charAt(u)+t.charAt(s);return c}function k(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=U.expandAlphRange(t).join("")).length&&65!==t.length)throw new E(`Error: Base64 alphabet should be 64 characters long, or 65 with a padding character. Found ${t.length}: ${t}`);if(n){var i=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(i,"")}if(o){if(e.length%4==1)throw new E(`Error: Invalid Base64 input length (${e.length}). Cannot be 4n+1, even without padding chars.`);if(65===t.length){var a=t.charAt(64),u=e.indexOf(a);if(u>=0){if(u>2,l=(3&h)<<6|d,(s=f<<2|p>>4)>=0&&s<256&&m.push(s),c>=0&&c<256&&64!==h&&m.push(c),l>=0&&l<256&&64!==d&&m.push(l)}return"string"===r?U.byteArrayToUtf8(m):m}function I(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(r<1||Math.round(r)!==r)throw new E("Byte length must be a positive integer");if("None"!==t){var n="Auto"===t?/[^a-f\d]|0x/gi:U.regexRep(t);e=e.split(n)}else e=[e];for(var o=[],i=0;i1&&void 0!==arguments[1]?arguments[1]:"Auto";t=U.charRep(t);var r=[],n=e.split(t);""===n[n.length-1]&&(n=n.slice(0,n.length-1));for(var o=0;o1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(r<1||Math.round(r)!==r)throw new E("Byte length must be a positive integer");var n=U.regexRep(t);e=e.replace(n,"");for(var o=[],i=0;i65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),y(e).forEach((function(e,t){n[t]=e})),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(t="string"==typeof t?e.ord(t):t).toString(16).padStart(r,"0")}},{key:"bin",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(t="string"==typeof t?e.ord(t):t).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.replace(/[^\x20-\x7f]/g,"."):(e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),t||(e=e.replace(/[\x09-\x10\u2028\u2029]/g,".")),e)}},{key:"escapeWhitespace",value:function(e){return e.replace(/[\x09-\x10]/g,(function(e){return String.fromCharCode(57344+e.charCodeAt(0))}))}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([abfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,(function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"a":return String.fromCharCode(7);case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}}))}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(t){for(var r=[],n=0;n=0;o--)r=256*r+e[o];return r}},{key:"intToByteArray",value:function(e,t,r){var n=new Array(t);if("little"===r)for(var o=0;o>>=8;else for(var i=t-1;i>=0;i--)n[i]=255&e,e>>>=8;return n}},{key:"strToArrayBuffer",value:function(t){if(w().debug(`Converting string[${null==t?void 0:t.length}] to array buffer`),!t)return new ArrayBuffer;for(var r,n=new Uint8Array(t.length),o=t.length;o--;)if(r=t.charCodeAt(o),n[o]=r,r>255)return e.strToUtf8ArrayBuffer(t);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){if(w().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 array buffer`),!e)return new ArrayBuffer;var t=new TextEncoder("utf-8").encode(e);return e.length!==t.length&&(D()&&self&&"function"==typeof self.setOption?self.setOption("attemptHighlight",!1):_()&&(window.app.options.attemptHighlight=!1)),t.buffer}},{key:"strToByteArray",value:function(t){if(w().debug(`Converting string[${null==t?void 0:t.length}] to byte array`),!t)return[];for(var r,n=new Array(t.length),o=t.length;o--;)if(r=t.charCodeAt(o),n[o]=r,r>255)return e.strToUtf8ByteArray(t);return n}},{key:"strToUtf8ByteArray",value:function(t){if(w().debug(`Converting string[${null==t?void 0:t.length}] to UTF8 byte array`),!t)return[];var r=B().encode(t);return t.length!==r.length&&(D()?self.setOption("attemptHighlight",!1):_()&&(window.app.options.attemptHighlight=!1)),e.strToByteArray(r)}},{key:"strToCharcode",value:function(t){if(w().debug(`Converting string[${null==t?void 0:t.length}] to charcode`),!t)return[];for(var r=[],n=0;n=55296&&o<56320){var i=t[n+1].charCodeAt(0);i>=56320&&i<57344&&(o=e.ord(t[n]+t[++n]))}r.push(o)}return r}},{key:"byteArrayToUtf8",value:function(t){var r;if(w().debug(`Converting byte array[${null===(r=t)||void 0===r?void 0:r.length}] to UTF8`),!t||!t.length)return"";t instanceof Uint8Array||(t=new Uint8Array(t));try{var n=new TextDecoder("utf-8",{fatal:!0}).decode(t);return n.length!==t.length&&(D()?self.setOption("attemptHighlight",!1):_()&&(window.app.options.attemptHighlight=!1)),n}catch(r){return e.byteArrayToChars(t)}}},{key:"byteArrayToChars",value:function(e){if(w().debug(`Converting byte array[${null==e?void 0:e.length}] to chars`),!e||!e.length)return"";for(var t="",r=0;r1&&void 0!==arguments[1])||arguments[1];if(w().debug(`Converting array buffer[${null==t?void 0:t.byteLength}] to str`),!t||!t.byteLength)return"";var n=new Uint8Array(t);return r?e.byteArrayToUtf8(n):e.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t0&&r.push(n[t]/e.length);var o,i=0;for(t=0;t1&&void 0!==arguments[1]?arguments[1]:[","],o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],i=!1,a=!1,u="",s=[],c=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var l=0;l=0?(s.push(u),u=""):!a&&o.indexOf(t)>=0?(s.push(u),u="",c.push(s),s=[],o.indexOf(r)>=0&&r!==t&&l++):u+=t:a=!0;return s.length&&(s.push(u),c.push(s)),c}},{key:"stripHtmlTags",value:function(e){function t(e,r){var n=r.replace(e,"");return n.length===r.length?n:t(e,n)}return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=t(/]*>(\s|\S)*?<\/script[^>]*>/gi,e),e=t(/]*>(\s|\S)*?<\/style[^>]*>/gi,e)),t(/<[^>]+>/g,e)}},{key:"escapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\0":""};return e?e.replace(/[&<>"'`\u0000]/g,(function(e){return t[e]})):e}},{key:"unescapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`","":"\0"};return e.replace(/(&#?x?[a-z0-9]{2,4};|\ue000)/gi,(function(e){return t[e]||e}))}},{key:"toTitleCase",value:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,(function(e){return t[e]||e}))}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",o="",i="",a="";return e.forEach((function(e){n=e.op.replace(/ /g,"_"),o=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),i=e.disabled?"/disabled":"",a=e.breakpoint?"/breakpoint":"",r+=`${n}(${o}${i}${a})`,t&&(r+="\n")})),r}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,r;e=e.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,o=[];t=n.exec(e);){r="["+(r=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var i={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(i.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(i.breakpoint=!0),o.push(i)}return o}},{key:"displayFilesAsHTML",value:(t=i(g().mark((function t(r){var n,o,a,u,s;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=function(t){return`
\n
\n
\n ${e.escapeHtml(t.name)}\n
\n
\n
`},o=function(t,r){if(r.startsWith("image")){var n="data:";return n+=r+";",""}return`
${e.escapeHtml(e.arrayBufferToStr(t.buffer))}
`},a=function(){var t=i(g().mark((function t(r,n){var i,a,u,s;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.readFile(r);case 2:return i=t.sent,a=new Blob([i],{type:r.type||"octet/stream"}),u=URL.createObjectURL(a),s=`
\n
\n
\n \n \n ${r.size.toLocaleString()} bytes\n \n save\n \n \n open_in_browser\n \n \n
\n
\n
\n
\n ${o(i,r.type)}\n
\n
\n
`,t.abrupt("return",s);case 7:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}(),u=`
\n ${r.length} file(s) found\n
`,s=0;case 5:if(!(s=e.size)t(o);else{var r=e.slice(i,i+a);n.readAsArrayBuffer(r)}};n.onload=function(e){o.set(new Uint8Array(n.result),i),i+=a,u()},n.onerror=function(e){r(n.error.message)},u()}))}},{key:"readFileSync",value:function(e){if(!R())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(t,r){return r?e.gcd(r,t%r):t}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;re?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))});const M=function(e){function t(){var e;a(this,t);for(var r=arguments.length,n=new Array(r),o=0;o0||e===t?t:t-1}function X(e){for(var t,r,n=1,o=e.length,i=e[0]+"";nc^r?1:-1;for(u=(s=o.length)<(c=i.length)?s:c,a=0;ai[a]^r?1:-1;return s==c?0:s>c^r?1:-1}function ee(e,t,r,n){if(er||e!==G(e))throw Error(z+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function te(e){var t=e.c.length-1;return Z(e.e/W)==t&&e.c[t]%2!=0}function re(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function ne(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else tw?p.c=p.e=null:e.e=10;s/=10,u++);return void(u>w?p.c=p.e=null:(p.e=u,p.c=[e]))}f=String(e)}else{if(!j.test(f=String(e)))return o(p,f,c);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(u=f.indexOf("."))>-1&&(f=f.replace(".","")),(s=f.search(/e/i))>0?(u<0&&(u=s),u+=+f.slice(s+1),f=f.substring(0,s)):u<0&&(u=f.length)}else{if(ee(t,2,E.length,"Base"),10==t&&F)return L(p=new k(e),d+p.e+1,m);if(f=String(e),c="number"==typeof e){if(0*e!=0)return o(p,f,c,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,k.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(Y+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(r=E.slice(0,t),u=s=0,l=f.length;su){u=l;continue}}else if(!a&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){a=!0,s=-1,u=0;continue}return o(p,String(e),c,t)}c=!1,(u=(f=n(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):u=f.length}for(s=0;48===f.charCodeAt(s);s++);for(l=f.length;48===f.charCodeAt(--l););if(f=f.slice(s,++l)){if(l-=s,c&&k.DEBUG&&l>15&&(e>V||e!==G(e)))throw Error(Y+p.s*e);if((u=u-s-1)>w)p.c=p.e=null;else if(u=y)?re(s,a):ne(s,a,"0");else if(i=(e=L(new k(e),t,r)).e,u=(s=X(e.c)).length,1==n||2==n&&(t<=i||i<=g)){for(;uu){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=i-u)>0)for(i+1==u&&(s+=".");t--;s+="0");return e.s<0&&o?"-"+s:s}function T(e,t){for(var r,n,o=1,i=new k(e[0]);o=10;o/=10,n++);return(r=n+r*W-1)>w?e.c=e.e=null:r=10;u/=10,o++);if((i=t-o)<0)i+=W,a=t,s=f[c=0],l=G(s/p[o-a-1]%10);else if((c=$((i+1)/W))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));s=l=0,o=1,a=(i%=W)-W+1}else{for(s=u=f[c],o=1;u>=10;u/=10,o++);l=(a=(i%=W)-W+o)<0?0:G(s/p[o-a-1]%10)}if(n=n||t<0||null!=f[c+1]||(a<0?s:s%p[o-a-1]),n=r<4?(l||n)&&(0==r||r==(e.s<0?3:2)):l>5||5==l&&(4==r||n||6==r&&(i>0?a>0?s/p[o-a]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(W-t%W)%W],e.e=-t||0):f[0]=e.e=0,e;if(0==i?(f.length=c,u=1,c--):(f.length=c+1,u=p[W-i],f[c]=a>0?G(s/p[o-a]%p[a])*u:0),n)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=u,u=1;a>=10;a/=10,u++);i!=u&&(e.e++,f[0]==H&&(f[0]=1));break}if(f[c]+=u,f[c]!=H)break;f[c--]=0,u=1}for(i=f.length;0===f[--i];f.pop());}e.e>w?e.c=e.e=null:e.e=y?re(t,r):ne(t,r,"0"),e.s<0?"-"+t:t)}return k.clone=e,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(z+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(ee(r=e[t],0,K,t),d=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(ee(r=e[t],0,8,t),m=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(ee(r[0],-K,0,t),ee(r[1],0,K,t),g=r[0],y=r[1]):(ee(r,-K,K,t),g=-(y=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)ee(r[0],-K,-1,t),ee(r[1],1,K,t),v=r[0],w=r[1];else{if(ee(r,-K,K,t),!r)throw Error(z+t+" cannot be zero: "+r);v=-(w=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(z+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(z+"crypto unavailable");b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(ee(r=e[t],0,9,t),B=r),e.hasOwnProperty(t="POW_PRECISION")&&(ee(r=e[t],0,K,t),x=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(z+t+" not an object: "+r);A=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(z+t+" invalid: "+r);F="0123456789"==r.slice(0,10),E=r}}return{DECIMAL_PLACES:d,ROUNDING_MODE:m,EXPONENTIAL_AT:[g,y],RANGE:[v,w],CRYPTO:b,MODULO_MODE:B,POW_PRECISION:x,FORMAT:A,ALPHABET:E}},k.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!k.DEBUG)return!0;var t,r,n=e.c,o=e.e,i=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===i||-1===i)&&o>=-K&&o<=K&&o===G(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%W)<1&&(t+=W),String(n[0]).length==t){for(t=0;t=H||r!==G(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===i||1===i||-1===i))return!0;throw Error(z+"Invalid BigNumber: "+e)},k.maximum=k.max=function(){return T(arguments,-1)},k.minimum=k.min=function(){return T(arguments,1)},k.random=(i=9007199254740992,a=Math.random()*i&2097151?function(){return G(Math.random()*i)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,u=0,s=[],c=new k(h);if(null==e?e=d:ee(e,0,K),o=$(e/W),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));u>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[u]=r[0],t[u+1]=r[1]):(s.push(i%1e14),u+=2);u=o/2}else{if(!crypto.randomBytes)throw b=!1,Error(z+"crypto unavailable");for(t=crypto.randomBytes(o*=7);u=9e15?crypto.randomBytes(7).copy(t,u):(s.push(i%1e14),u+=7);u=o/7}if(!b)for(;u=10;i/=10,u++);ur-1&&(null==a[o+1]&&(a[o+1]=0),a[o+1]+=a[o]/r|0,a[o]%=r)}return a.reverse()}return function(n,o,i,a,u){var s,c,l,f,p,h,g,y,v=n.indexOf("."),w=d,b=m;for(v>=0&&(f=x,x=0,n=n.replace(".",""),h=(y=new k(o)).pow(n.length-v),x=f,y.c=t(ne(X(h.c),h.e,"0"),10,i,e),y.e=y.c.length),l=f=(g=t(n,o,i,u?(s=E,e):(s=e,E))).length;0==g[--f];g.pop());if(!g[0])return s.charAt(0);if(v<0?--l:(h.c=g,h.e=l,h.s=a,g=(h=r(h,y,w,b,i)).c,p=h.r,l=h.e),v=g[c=l+w+1],f=i/2,p=p||c<0||null!=g[c+1],p=b<4?(null!=v||p)&&(0==b||b==(h.s<0?3:2)):v>f||v==f&&(4==b||p||6==b&&1&g[c-1]||b==(h.s<0?8:7)),c<1||!g[0])n=p?ne(s.charAt(1),-w,s.charAt(0)):s.charAt(0);else{if(g.length=c,p)for(--i;++g[--c]>i;)g[c]=0,c||(++l,g=[1].concat(g));for(f=g.length;!g[--f];);for(v=0,n="";v<=f;n+=s.charAt(g[v++]));n=ne(n,l,s.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,o,i,a,u=0,s=e.length,c=t%q,l=t/q|0;for(e=e.slice();s--;)u=((o=c*(i=e[s]%q)+(n=l*i+(a=e[s]/q|0)*c)%q*q+u)/r|0)+(n/q|0)+l*a,e[s]=o%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var o,i;if(r!=n)i=r>n?1:-1;else for(o=i=0;ot[o]?1:-1;break}return i}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]1;e.splice(0,1));}return function(n,o,i,a,u){var s,c,l,f,p,h,d,m,g,y,v,w,b,B,x,A,E,F=n.s==o.s?1:-1,I=n.c,T=o.c;if(!(I&&I[0]&&T&&T[0]))return new k(n.s&&o.s&&(I?!T||I[0]!=T[0]:T)?I&&0==I[0]||!T?0*F:F/0:NaN);for(g=(m=new k(F)).c=[],F=i+(c=n.e-o.e)+1,u||(u=H,c=Z(n.e/W)-Z(o.e/W),F=F/W|0),l=0;T[l]==(I[l]||0);l++);if(T[l]>(I[l]||0)&&c--,F<0)g.push(1),f=!0;else{for(B=I.length,A=T.length,l=0,F+=2,(p=G(u/(T[0]+1)))>1&&(T=e(T,p,u),I=e(I,p,u),A=T.length,B=I.length),b=A,v=(y=I.slice(0,A)).length;v=u/2&&x++;do{if(p=0,(s=t(T,y,A,v))<0){if(w=y[0],A!=v&&(w=w*u+(y[1]||0)),(p=G(w/x))>1)for(p>=u&&(p=u-1),d=(h=e(T,p,u)).length,v=y.length;1==t(h,y,d,v);)p--,r(h,A=10;F/=10,l++);L(m,i+(m.e=l+c*W-1)+1,a,f)}else m.e=c,m.r=+f;return m}}(),u=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,f=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var o,i=r?t:t.replace(f,"");if(l.test(i))e.s=isNaN(i)?null:i<0?-1:1;else{if(!r&&(i=i.replace(u,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,i=i.replace(s,"$1").replace(c,"0.$1")),t!=i))return new k(i,o);if(k.DEBUG)throw Error(z+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},p.absoluteValue=p.abs=function(){var e=new k(this);return e.s<0&&(e.s=1),e},p.comparedTo=function(e,t){return Q(this,new k(e,t))},p.decimalPlaces=p.dp=function(e,t){var r,n,o,i=this;if(null!=e)return ee(e,0,K),null==t?t=m:ee(t,0,8),L(new k(i),e+i.e+1,t);if(!(r=i.c))return null;if(n=((o=r.length-1)-Z(this.e/W))*W,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},p.dividedBy=p.div=function(e,t){return r(this,new k(e,t),d,m)},p.dividedToIntegerBy=p.idiv=function(e,t){return r(this,new k(e,t),0,1)},p.exponentiatedBy=p.pow=function(e,t){var r,n,o,i,a,u,s,c,l=this;if((e=new k(e)).c&&!e.isInteger())throw Error(z+"Exponent not an integer: "+S(e));if(null!=t&&(t=new k(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return c=new k(Math.pow(+S(l),a?e.s*(2-te(e)):+S(e))),t?c.mod(t):c;if(u=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new k(NaN);(n=!u&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return i=l.s<0&&te(e)?-0:0,l.e>-1&&(i=1/i),new k(u?1/i:i);x&&(i=$(x/W+2))}for(a?(r=new k(.5),u&&(e.s=1),s=te(e)):s=(o=Math.abs(+S(e)))%2,c=new k(h);;){if(s){if(!(c=c.times(l)).c)break;i?c.c.length>i&&(c.c.length=i):n&&(c=c.mod(t))}if(o){if(0===(o=G(o/2)))break;s=o%2}else if(L(e=e.times(r),e.e+1,1),e.e>14)s=te(e);else{if(0==(o=+S(e)))break;s=o%2}l=l.times(l),i?l.c&&l.c.length>i&&(l.c.length=i):n&&(l=l.mod(t))}return n?c:(u&&(c=h.div(c)),t?c.mod(t):i?L(c,x,m,void 0):c)},p.integerValue=function(e){var t=new k(this);return null==e?e=m:ee(e,0,8),L(t,t.e+1,e)},p.isEqualTo=p.eq=function(e,t){return 0===Q(this,new k(e,t))},p.isFinite=function(){return!!this.c},p.isGreaterThan=p.gt=function(e,t){return Q(this,new k(e,t))>0},p.isGreaterThanOrEqualTo=p.gte=function(e,t){return 1===(t=Q(this,new k(e,t)))||0===t},p.isInteger=function(){return!!this.c&&Z(this.e/W)>this.c.length-2},p.isLessThan=p.lt=function(e,t){return Q(this,new k(e,t))<0},p.isLessThanOrEqualTo=p.lte=function(e,t){return-1===(t=Q(this,new k(e,t)))||0===t},p.isNaN=function(){return!this.s},p.isNegative=function(){return this.s<0},p.isPositive=function(){return this.s>0},p.isZero=function(){return!!this.c&&0==this.c[0]},p.minus=function(e,t){var r,n,o,i,a=this,u=a.s;if(t=(e=new k(e,t)).s,!u||!t)return new k(NaN);if(u!=t)return e.s=-t,a.plus(e);var s=a.e/W,c=e.e/W,l=a.c,f=e.c;if(!s||!c){if(!l||!f)return l?(e.s=-t,e):new k(f?a:NaN);if(!l[0]||!f[0])return f[0]?(e.s=-t,e):new k(l[0]?a:3==m?-0:0)}if(s=Z(s),c=Z(c),l=l.slice(),u=s-c){for((i=u<0)?(u=-u,o=l):(c=s,o=f),o.reverse(),t=u;t--;o.push(0));o.reverse()}else for(n=(i=(u=l.length)<(t=f.length))?u:t,u=t=0;t0)for(;t--;l[r++]=0);for(t=H-1;n>u;){if(l[--n]=0;){for(r=0,p=w[o]%g,h=w[o]/g|0,i=o+(a=s);i>o;)r=((c=p*(c=v[--a]%g)+(u=h*c+(l=v[a]/g|0)*p)%g*g+d[i]+r)/m|0)+(u/g|0)+h*l,d[i--]=c%m;d[i]=r}return r?++n:d.splice(0,1),C(e,d,n)},p.negated=function(){var e=new k(this);return e.s=-e.s||null,e},p.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new k(e,t)).s,!o||!t)return new k(NaN);if(o!=t)return e.s=-t,n.minus(e);var i=n.e/W,a=e.e/W,u=n.c,s=e.c;if(!i||!a){if(!u||!s)return new k(o/0);if(!u[0]||!s[0])return s[0]?e:new k(u[0]?n:0*o)}if(i=Z(i),a=Z(a),u=u.slice(),o=i-a){for(o>0?(a=i,r=s):(o=-o,r=u),r.reverse();o--;r.push(0));r.reverse()}for((o=u.length)-(t=s.length)<0&&(r=s,s=u,u=r,t=o),o=0;t;)o=(u[--t]=u[t]+s[t]+o)/H|0,u[t]=H===u[t]?0:u[t]%H;return o&&(u=[o].concat(u),++a),C(e,u,a)},p.precision=p.sd=function(e,t){var r,n,o,i=this;if(null!=e&&e!==!!e)return ee(e,1,K),null==t?t=m:ee(t,0,8),L(new k(i),e,t);if(!(r=i.c))return null;if(n=(o=r.length-1)*W+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&i.e+1>n&&(n=i.e+1),n},p.shiftedBy=function(e){return ee(e,-9007199254740991,V),this.times("1e"+e)},p.squareRoot=p.sqrt=function(){var e,t,n,o,i,a=this,u=a.c,s=a.s,c=a.e,l=d+4,f=new k("0.5");if(1!==s||!u||!u[0])return new k(!s||s<0&&(!u||u[0])?NaN:u?a:1/0);if(0==(s=Math.sqrt(+S(a)))||s==1/0?(((t=X(u)).length+c)%2==0&&(t+="0"),s=Math.sqrt(+t),c=Z((c+1)/2)-(c<0||c%2),n=new k(t=s==1/0?"5e"+c:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new k(s+""),n.c[0])for((s=(c=n.e)+l)<3&&(s=0);;)if(i=n,n=f.times(i.plus(r(a,i,l,1))),X(i.c).slice(0,s)===(t=X(n.c)).slice(0,s)){if(n.e0&&d>0){for(i=d%u||u,l=h.substr(0,i);i0&&(l+=c+h.slice(i)),p&&(l="-"+l)}n=f?l+(r.decimalSeparator||"")+((s=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+s+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):l}return(r.prefix||"")+n+(r.suffix||"")},p.toFraction=function(e){var t,n,o,i,a,u,s,c,l,f,p,d,g=this,y=g.c;if(null!=e&&(!(s=new k(e)).isInteger()&&(s.c||1!==s.s)||s.lt(h)))throw Error(z+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+S(s));if(!y)return new k(g);for(t=new k(h),l=n=new k(h),o=c=new k(h),d=X(y),a=t.e=d.length-g.e-1,t.c[0]=J[(u=a%W)<0?W+u:u],e=!e||s.comparedTo(t)>0?a>0?t:l:s,u=w,w=1/0,s=new k(d),c.c[0]=0;f=r(s,t,0,1),1!=(i=n.plus(f.times(o))).comparedTo(e);)n=o,o=i,l=c.plus(f.times(i=l)),c=i,t=s.minus(f.times(i=t)),s=i;return i=r(e.minus(n),o,0,1),c=c.plus(i.times(l)),n=n.plus(i.times(o)),c.s=l.s=g.s,p=r(l,o,a*=2,m).minus(g).abs().comparedTo(r(c,n,a,m).minus(g).abs())<1?[l,o]:[c,n],w=u,p},p.toNumber=function(){return+S(this)},p.toPrecision=function(e,t){return null!=e&&ee(e,1,K),I(this,e,t,2)},p.toString=function(e){var t,r=this,o=r.s,i=r.e;return null===i?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=i<=g||i>=y?re(X(r.c),i):ne(X(r.c),i,"0"):10===e&&F?t=ne(X((r=L(new k(r),d+i+1,m)).c),r.e,"0"):(ee(e,2,E.length,"Base"),t=n(ne(X(r.c),i,"0"),10,e,o,!0)),o<0&&r.c[0]&&(t="-"+t)),t},p.valueOf=p.toJSON=function(){return S(this)},p._isBigNumber=!0,p[Symbol.toStringTag]="BigNumber",p[Symbol.for("nodejs.util.inspect.custom")]=p.valueOf,null!=t&&k.set(t),k}();const ie=oe;var ae=function(){function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;a(this,e),this.bytes=t,this.length=this.bytes.length,this.position=r,this.bitPos=n}return l(e,[{key:"clone",value:function(){return new e(this.bytes,this.position,this.bitPos)}},{key:"getBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!(this.position>this.length)){var t=null!==e?this.position+e:this.length,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(this.position>this.length)){-1===e&&(e=this.length-this.position);for(var t="",r=this.position;r1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n=this.position;o--)r<<=8,r|=this.bytes[o];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r,n=0,o=0;for(n=this.bytes[this.position++]&(r=this.bitPos,"be"===t?(1<<8-r)-1:256-(1<>>=this.bitPos),o=8-this.bitPos,this.bitPos=0;oe){var i=o-e;"be"===t?n>>>=i:n&=(1<this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n,o=function(e,t){var r=new Array;return e.forEach((function(e,n){r[e]=t-n})),r}(e,t);this.position=0;i--)if(this.bytes[this.position-t+i]!==e[i]){n=!1,this.position+=o[e[i]];break}if(n){this.position-=t;break}}}else for(;++this.positionthis.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;return this.bitPos>0&&t++,this.bytes.slice(e,t)}}])}();function ue(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return se(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?se(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function se(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r>4],s=o[(15&a)>>2],c=(2&a)>>1;if("free"===u||"bad"===u||"reserved"===s){r.moveBackwardsBy(1);break}var l=Math.floor(144*u/s+c);if(r.position+l>r.length){r.moveTo(r.length);break}r.moveForwardsBy(l-3)}return r.carve()}},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new ae(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new ae(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");for(n++;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:le},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:le}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new ae(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var o=r.readInt(2,"le");r.moveForwardsBy(16);var i=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(i-2),r.moveForwardsBy(32);var a=r.readInt(4,"le"),u=r.readInt(4,"le");if(a>0)return r.moveTo(a+u),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(o-1)),r.moveForwardsBy(16);var s=r.readInt(4,"le"),c=r.readInt(4,"le");return r.moveTo(c+s),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new ae(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),o=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var i=n?r.readInt(4,o):r.readInt(8,o);r.moveForwardsBy(10);var a=r.readInt(2,o),u=r.readInt(2,o);return r.moveTo(i),r.moveForwardsBy(a*u),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:fe},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:fe},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:le},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){for(var r=new ae(e.slice(t)),n=function(){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join(""))return r.moveBackwardsBy(262),1;r.moveBackwardsBy(138);var e=0;r.getBytes(11).forEach((function(t,r){e+=(t-48).toString()})),e=512*Math.ceil(parseInt(e,8)/512),r.moveForwardsBy(e+377)};r.hasMore()&&!n(););return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new ae(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var o=r.readInt(2,"le");r.moveForwardsby(o)}return 8&n&&(r.continueUntil(0),r.moveForwardsBy(1)),16&n&&(r.continueUntil(0),r.moveForwardsBy(1)),2&n&&r.moveForwardsBy(2),ye(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new ae(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],o=0;o=2368&&r.moveForwardsBy(4);var u=r.readInt(1,"be");if(r.moveForwardsBy(u),64&a){var s=r.readInt(4,"be");r.moveForwardsBy(s)}for(r.moveForwardsBy(4);r.hasMore();){var c=r.readInt(4,"be");if(0===c)break;var l=r.readInt(4,"be"),f=c===l?o:o+n;r.moveForwardsBy(l+4*f)}return r.carve()}},{name:"Linux deb package",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:function(e,t){var r=new ae(e.slice(t));for(r.moveForwardsBy(8);r.hasMore();){r.moveForwardsBy(48);var n,o="",i=ue(r.getBytes(10));try{for(i.s();!(n=i.n()).done;){var a=n.value;o+=String.fromCharCode(a)}}catch(e){i.e(e)}finally{i.f()}o=parseInt(o.trim(),10),r.moveForwardsBy(2),r.moveForwardsBy(o)}return r.carve()}},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new ae(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var o=r.readInt(4);return r.moveTo(n*o),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new ae(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var o=r.readInt(4,"le");return r.moveForwardsBy(o-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new ae(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;for(r.moveForwardsBy(n);r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(112),r.moveTo(4096*(r.readInt(4,"le")+1)),r.carve()}},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(12),r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new ae(e.slice(t)),n=0;for(r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(20),r.moveForwardsBy(r.readInt(4)),r.carve()}},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4},{0:149,1:5,2:134,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:function(e,t){var r=new ae(e.slice(t));return r.moveTo(52),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function le(e,t){var r=new ae(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function fe(e,t){var r="207250237254",n=new ae(e.slice(t)),o=n.getBytes(4).join("");return n.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var o=e.readInt(4,r);return function(e,t,r,n){for(var o=0,i=0;i0&&e.moveForwardsBy(1)}var ve=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],we=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function be(e,t,r){for(var n,o=0;(n=xe(e,t))&&256!==n;){if(++o>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(ve[n-257],"le"),n=xe(e,r),e.readBits(we[n],"le"))}}function Be(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<>=1;for(var p=i<<16|s,h=c;h>>16;if(u>i)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${u}`);return e.moveBackwardsByBits(i-u),65535&a}function Ae(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var o=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[o]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[o])<0)return!1;break;case"function":if(!e[n](t[o]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}function Fe(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(ce);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var o in ce)t.includes(o)&&(n[o]=ce[o]);for(var i in n)n[i].forEach((function(t){Ae(t.signature,e)&&r.push(t)}));return r}const ke=function(){return l((function e(){a(this,e)}),null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){throw new Error("fromArrayBuffer has not been implemented")}}])}();function Ie(e,t,r){return t=p(t),f(e,Te()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function Te(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Te=function(){return!!e})()}const Ce=function(e){function t(){return a(this,t),Ie(this,t,arguments)}return d(t,e),l(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}])}(ke);function Le(e,t,r){return t=p(t),f(e,Se()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function Se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Se=function(){return!!e})()}const Oe=function(e){function t(){return a(this,t),Le(this,t,arguments)}return d(t,e),l(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=ie.isBigNumber(this.value)?U.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value);try{this.value=new ie(U.arrayBufferToStr(this.value))}catch(e){this.value=new ie(NaN)}}}])}(ke);function Re(e,t,r){return t=p(t),f(e,_e()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function _e(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(_e=function(){return!!e})()}const De=function(e){function t(){return a(this,t),Re(this,t,arguments)}return d(t,e),l(t,null,[{key:"toArrayBuffer",value:function(){var e=this;if(t.checkForValue(this.value),!R())return new Promise((function(t,r){U.readFile(e.value).then((function(t){return e.value=t.buffer})).then(t).catch(r)}));this.value=U.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=new File(this.value,"unknown")}}])}(ke);function Ue(e,t,r){return t=p(t),f(e,Ne()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function Ne(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ne=function(){return!!e})()}const Pe=function(e){function t(){return a(this,t),Ue(this,t,arguments)}return d(t,e),l(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?U.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?U.arrayBufferToStr(this.value):""}}])}(ke);function Me(e,t,r){return t=p(t),f(e,je()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function je(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(je=function(){return!!e})()}const $e=function(e){function t(){return a(this,t),Me(this,t,arguments)}return d(t,e),l(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=this.value?U.strToArrayBuffer(U.unescapeHtml(U.stripHtmlTags(this.value,!0))):new ArrayBuffer}}])}(Pe);function Ge(e,t,r){return t=p(t),f(e,ze()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ze=function(){return!!e})()}const Ye=function(e){function t(){return a(this,t),Ge(this,t,arguments)}return d(t,e),l(t,null,[{key:"toArrayBuffer",value:function(){t.checkForValue(this.value),this.value=void 0!==this.value?U.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=JSON.parse(U.arrayBufferToStr(this.value))}}])}(ke);function He(e,t,r){return t=p(t),f(e,We()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function We(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(We=function(){return!!e})()}const Ve=function(e){function t(){return a(this,t),He(this,t,arguments)}return d(t,e),l(t,null,[{key:"toArrayBuffer",value:(n=i(g().mark((function e(){return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.checkForValue(this.value),!R()){e.next=5;break}this.value=this.value.map((function(e){return Uint8Array.from(e.data)})),e.next=8;break;case 5:return e.next=7,t.concatenateTypedArraysWithTypedElements.apply(t,y(this.value));case 7:this.value=e.sent;case 8:case"end":return e.stop()}}),e,this)}))),function(){return n.apply(this,arguments)})},{key:"fromArrayBuffer",value:function(){t.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:(r=i(g().mark((function e(){var t,r,n,o,i,a,u,s,c,l,f,p,h,d=arguments;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0,r=d.length,n=new Array(r),o=0;o0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(a(this,e),this.value=new ArrayBuffer(0),this.type=e.ARRAY_BUFFER,t&&Object.prototype.hasOwnProperty.call(t,"value")&&Object.prototype.hasOwnProperty.call(t,"type"))this.set(t.value,t.type);else if(t&&null!==r)this.set(t,r);else if(t){var n=e.typeEnum(t.constructor.name);this.set(t,n)}}return l(e,[{key:"get",value:function(t){var r=this;return"string"==typeof t&&(t=e.typeEnum(t)),this.type!==t?R()?(this._translate(t),this.value):new Promise((function(e,n){r._translate(t).then((function(){e(r.value)})).catch(n)})):this.value}},{key:"set",value:function(t,r){if("string"==typeof r&&(r=e.typeEnum(r)),w().debug("Dish type: "+e.enumLookup(r)),this.value=t,this.type=r,!this.valid()){var n=U.truncate(JSON.stringify(this.value),25);throw new M(`Data is not a valid ${e.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){return this.clone().get(e)}},{key:"detectDishType",value:function(){var e=Fe(new Uint8Array(this.value.slice(0,2048)));return e.length&&e[0].mime&&"text/plain"===e[0].mime?e[0].mime:null}},{key:"getTitle",value:(t=i(g().mark((function t(r){var n,o;return g().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n="",t.t0=this.type,t.next=t.t0===e.FILE?4:t.t0===e.LIST_FILE?6:t.t0===e.JSON?8:t.t0===e.NUMBER||t.t0===e.BIG_NUMBER?10:t.t0===e.ARRAY_BUFFER||t.t0===e.BYTE_ARRAY?12:15;break;case 4:return n=this.value.name,t.abrupt("break",26);case 6:return n=`${this.value.length} file(s)`,t.abrupt("break",26);case 8:return n="application/json",t.abrupt("break",26);case 10:return n=this.value.toString(),t.abrupt("break",26);case 12:if(null===(n=this.detectDishType())){t.next=15;break}return t.abrupt("break",26);case 15:return t.prev=15,(o=this.clone()).value=o.value.slice(0,256),t.next=20,o.get(e.STRING);case 20:n=t.sent,t.next=26;break;case 23:t.prev=23,t.t1=t.catch(15),w().error(`${e.enumLookup(this.type)} cannot be sliced. ${t.t1}`);case 26:return t.abrupt("return",n.slice(0,r));case 27:case"end":return t.stop()}}),t,this,[[15,23]])}))),function(e){return t.apply(this,arguments)})},{key:"valid",value:function(){switch(this.type){case e.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var t=0;t255)return!1;return!0;case e.STRING:case e.HTML:return"string"==typeof this.value;case e.NUMBER:return"number"==typeof this.value;case e.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case e.BIG_NUMBER:if(ie.isBigNumber(this.value))return!0;if(Object.keys(this.value).sort().equals(["c","e","s"])){var r=new ie;return r.c=this.value.c,r.e=this.value.e,r.s=this.value.s,this.value=r,!0}return!1;case e.JSON:return!0;case e.FILE:return this.value instanceof File;case e.LIST_FILE:return this.value instanceof Array&&this.value.reduce((function(e,t){return e&&t instanceof File}),!0);default:return!1}}},{key:"size",get:function(){switch(this.type){case e.BYTE_ARRAY:case e.STRING:case e.HTML:return this.value.length;case e.NUMBER:case e.BIG_NUMBER:return this.value.toString().length;case e.ARRAY_BUFFER:return this.value.byteLength;case e.JSON:return JSON.stringify(this.value).length;case e.FILE:return this.value.size;case e.LIST_FILE:return this.value.reduce((function(e,t){return e+t.size}),0);default:return-1}}},{key:"clone",value:function(){var t=new e;switch(this.type){case e.STRING:case e.HTML:case e.NUMBER:case e.BIG_NUMBER:t.set(this.value,this.type);break;case e.BYTE_ARRAY:case e.JSON:t.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case e.ARRAY_BUFFER:t.set(this.value.slice(0),this.type);break;case e.FILE:t.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case e.LIST_FILE:t.set(this.value.map((function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})})),this.type);break;default:throw new M("Cannot clone Dish, unknown type")}return t}},{key:"_translate",value:function(t){var r=this;if(w().debug(`Translating Dish from ${e.enumLookup(this.type)} to ${e.enumLookup(t)}`),!R())return new Promise((function(n,o){r._toArrayBuffer().then((function(){return r.type=e.ARRAY_BUFFER})).then((function(){r._fromArrayBuffer(t),n()})).catch(o)}));this._toArrayBuffer(),this.type=e.ARRAY_BUFFER,this._fromArrayBuffer(t)}},{key:"_toArrayBuffer",value:function(){var t=this,r={browser:{[e.STRING]:function(){return Promise.resolve(Pe.toArrayBuffer.bind(t)())},[e.NUMBER]:function(){return Promise.resolve(Ke.toArrayBuffer.bind(t)())},[e.HTML]:function(){return Promise.resolve($e.toArrayBuffer.bind(t)())},[e.ARRAY_BUFFER]:function(){return Promise.resolve()},[e.BIG_NUMBER]:function(){return Promise.resolve(Oe.toArrayBuffer.bind(t)())},[e.JSON]:function(){return Promise.resolve(Ye.toArrayBuffer.bind(t)())},[e.FILE]:function(){return De.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return Promise.resolve(Ve.toArrayBuffer.bind(t)())},[e.BYTE_ARRAY]:function(){return Promise.resolve(Ce.toArrayBuffer.bind(t)())}},node:{[e.STRING]:function(){return Pe.toArrayBuffer.bind(t)()},[e.NUMBER]:function(){return Ke.toArrayBuffer.bind(t)()},[e.HTML]:function(){return $e.toArrayBuffer.bind(t)()},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return Oe.toArrayBuffer.bind(t)()},[e.JSON]:function(){return Ye.toArrayBuffer.bind(t)()},[e.FILE]:function(){return De.toArrayBuffer.bind(t)()},[e.LIST_FILE]:function(){return Ve.toArrayBuffer.bind(t)()},[e.BYTE_ARRAY]:function(){return Ce.toArrayBuffer.bind(t)()}}};try{return r[R()?"node":"browser"][this.type]()}catch(t){throw new M(`Error translating from ${e.enumLookup(this.type)} to ArrayBuffer: ${t}`)}}},{key:"_fromArrayBuffer",value:function(t){var r=this,n={[e.STRING]:function(){return Pe.fromArrayBuffer.bind(r)()},[e.NUMBER]:function(){return Ke.fromArrayBuffer.bind(r)()},[e.HTML]:function(){return $e.fromArrayBuffer.bind(r)()},[e.ARRAY_BUFFER]:function(){},[e.BIG_NUMBER]:function(){return Oe.fromArrayBuffer.bind(r)()},[e.JSON]:function(){return Ye.fromArrayBuffer.bind(r)()},[e.FILE]:function(){return De.fromArrayBuffer.bind(r)()},[e.LIST_FILE]:function(){return Ve.fromArrayBuffer.bind(r)()},[e.BYTE_ARRAY]:function(){return Ce.fromArrayBuffer.bind(r)()}};try{n[t](),this.type=t}catch(r){throw new M(`Error translating from ArrayBuffer to ${e.enumLookup(t)}: ${r}`)}}}],[{key:"typeEnum",value:function(t){switch(t.toLowerCase()){case"bytearray":case"byte array":return e.BYTE_ARRAY;case"string":return e.STRING;case"number":return e.NUMBER;case"html":return e.HTML;case"arraybuffer":case"array buffer":return e.ARRAY_BUFFER;case"bignumber":case"big number":return e.BIG_NUMBER;case"json":case"object":return e.JSON;case"file":return e.FILE;case"list":return e.LIST_FILE;default:throw new M("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(t){switch(t){case e.BYTE_ARRAY:return"byteArray";case e.STRING:return"string";case e.NUMBER:return"number";case e.HTML:return"html";case e.ARRAY_BUFFER:return"ArrayBuffer";case e.BIG_NUMBER:return"BigNumber";case e.JSON:return"JSON";case e.FILE:return"File";case e.LIST_FILE:return"List";default:throw new M("Invalid data type enum. No matching type.")}}}]);var t}();Ze.BYTE_ARRAY=0,Ze.STRING=1,Ze.NUMBER=2,Ze.HTML=3,Ze.ARRAY_BUFFER=4,Ze.BIG_NUMBER=5,Ze.JSON=6,Ze.FILE=7,Ze.LIST_FILE=8;const Xe=Ze,Qe=function(){function e(t){a(this,e),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.maxLength=null,this.min=null,this.max=null,this.step=1,t&&this._parseConfig(t)}return l(e,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.maxLength=e.maxLength||null,this.min=e.min,this.max=e.max,this.step=e.step}},{key:"config",get:function(){return this._value}},{key:"value",get:function(){return this._value},set:function(t){this._value=e.prepare(t,this.type)}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return U.parseEscapedChars(e);case"byteArray":return"string"==typeof e?I(e=e.replace(/\s+/g,"")):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+U.truncate(e.toString(),10);return r;default:return e}}}])}();var et=function(){return l((function e(){a(this,e),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}),[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"inputType",get:function(){return Xe.enumLookup(this._inputType)},set:function(e){this._inputType=Xe.typeEnum(e)}},{key:"outputType",get:function(){return Xe.enumLookup(this._outputType)},set:function(e){this._outputType=Xe.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)}},{key:"presentType",get:function(){return Xe.enumLookup(this._presentType)},set:function(e){this._presentType=Xe.typeEnum(e)}},{key:"args",get:function(){return this._ingList.map((function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),e.maxLength&&(t.maxLength=e.maxLength),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),t}))},set:function(e){var t=this;e.forEach((function(e){var r=new Qe(e);t.addIngredient(r)}))}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map((function(e){return e.config}))}}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"ingValues",get:function(){return this._ingList.map((function(e){return e.value}))},set:function(e){var t=this;e.forEach((function(e,r){t._ingList[r].value=e}))}},{key:"breakpoint",get:function(){return this._breakpoint},set:function(e){this._breakpoint=!!e}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=!!e}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}])}();const tt=et;var rt=r(34995);function nt(e,t,r){return t=p(t),f(e,ot()?Reflect.construct(t,r||[],p(e).constructor):t.apply(e,r))}function ot(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ot=function(){return!!e})()}var it=["Tesseract only","LSTM only","Tesseract/LSTM Combined"];const at=function(e){function t(){var e;return a(this,t),(e=nt(this,t)).name="Optical Character Recognition",e.module="OCR",e.description="Optical character recognition or optical character reader (OCR) is the mechanical or electronic conversion of images of typed, handwritten or printed text into machine-encoded text.

Supported image formats: png, jpg, bmp, pbm.",e.infoURL="https://wikipedia.org/wiki/Optical_character_recognition",e.inputType="ArrayBuffer",e.outputType="string",e.args=[{name:"Show confidence",type:"boolean",value:!0},{name:"OCR Engine Mode",type:"option",value:it,defaultIndex:1}],e}return d(t,e),l(t,[{key:"run",value:(r=i(g().mark((function e(t,r){var o,i,a,u,s,c,l,f,p;return g().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=n(r,2),i=o[0],a=o[1],D()){e.next=3;break}throw new E("This operation only works in a browser");case 3:if(u=function(e,t){var r=Fe(t);return!!r.length&&r.reduce((function(t,r){var n=!!r.mime.startsWith(e)&&r.mime;return t||n}),!1)}("image",t)){e.next=6;break}throw new E("Unsupported file type (supported: jpg,png,pbm,bmp) or no file provided");case 6:return s=`${self.docURL}/assets/`,c=it.indexOf(a),e.prev=8,self.sendStatusMessage("Spinning up Tesseract worker..."),l=`data:${u};base64,${F(t)}`,e.next=13,(0,rt.createWorker)("eng",c,{workerPath:`${s}tesseract/worker.min.js`,langPath:`${s}tesseract/lang-data`,corePath:`${s}tesseract/tesseract-core.wasm.js`,logger:function(e){D()&&self.sendStatusMessage(`Status: ${e.status}${"recognizing text"===e.status?` - ${(100*parseFloat(e.progress)).toFixed(2)}%`:""}`)}});case 13:return f=e.sent,self.sendStatusMessage("Finding text..."),e.next=17,f.recognize(l);case 17:if(p=e.sent,!i){e.next=22;break}return e.abrupt("return",`Confidence: ${p.data.confidence}%\n\n${p.data.text}`);case 22:return e.abrupt("return",p.data.text);case 23:e.next=28;break;case 25:throw e.prev=25,e.t0=e.catch(8),new E(`Error performing OCR on image. (${e.t0})`);case 28:case"end":return e.stop()}}),e,null,[[8,25]])}))),function(e,t){return r.apply(this,arguments)})}]);var r}(tt);("undefined"==typeof self?{}:self.OpModules||{}).OCR={"Optical Character Recognition":at}})()})();