UNPKG

@queuedash/api

Version:

A stunning, sleek dashboard for Bull, BullMQ, and Bee-Queue

2 lines 52.4 kB
"use strict";var Pe=Object.defineProperty;var Ne=(i,e,t)=>e in i?Pe(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var te=(i,e,t)=>Ne(i,typeof e!="symbol"?e+"":e,t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const qe=require("./main-CBzBC-Kx.js"),oe={128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};for(const[i,e]of Object.entries(oe));function He(i,e="utf-8"){switch(e.toLowerCase()){case"utf-8":case"utf8":return typeof globalThis.TextDecoder<"u"?new globalThis.TextDecoder("utf-8").decode(i):_e(i);case"utf-16le":return Ve(i);case"ascii":return $e(i);case"latin1":case"iso-8859-1":return We(i);case"windows-1252":return Ze(i);default:throw new RangeError(`Encoding '${e}' not supported`)}}function _e(i){let e="",t=0;for(;t<i.length;){const r=i[t++];if(r<128)e+=String.fromCharCode(r);else if(r<224){const n=i[t++]&63;e+=String.fromCharCode((r&31)<<6|n)}else if(r<240){const n=i[t++]&63,s=i[t++]&63;e+=String.fromCharCode((r&15)<<12|n<<6|s)}else{const n=i[t++]&63,s=i[t++]&63,x=i[t++]&63;let l=(r&7)<<18|n<<12|s<<6|x;l-=65536,e+=String.fromCharCode(55296+(l>>10&1023),56320+(l&1023))}}return e}function Ve(i){let e="";for(let t=0;t<i.length;t+=2)e+=String.fromCharCode(i[t]|i[t+1]<<8);return e}function $e(i){return String.fromCharCode(...i.map(e=>e&127))}function We(i){return String.fromCharCode(...i)}function Ze(i){let e="";for(const t of i)t>=128&&t<=159&&oe[t]?e+=oe[t]:e+=String.fromCharCode(t);return e}function v(i){return new DataView(i.buffer,i.byteOffset)}const Ge={len:1,get(i,e){return v(i).getUint8(e)},put(i,e,t){return v(i).setUint8(e,t),e+1}},h={len:2,get(i,e){return v(i).getUint16(e,!0)},put(i,e,t){return v(i).setUint16(e,t,!0),e+2}},_={len:2,get(i,e){return v(i).getUint16(e)},put(i,e,t){return v(i).setUint16(e,t),e+2}},w={len:4,get(i,e){return v(i).getUint32(e,!0)},put(i,e,t){return v(i).setUint32(e,t,!0),e+4}},Qe={len:4,get(i,e){return v(i).getUint32(e)},put(i,e,t){return v(i).setUint32(e,t),e+4}},Je={len:4,get(i,e){return v(i).getInt32(e)},put(i,e,t){return v(i).setInt32(e,t),e+4}},Xe={len:8,get(i,e){return v(i).getBigUint64(e,!0)},put(i,e,t){return v(i).setBigUint64(e,t,!0),e+8}};class E{constructor(e,t){this.len=e,this.encoding=t}get(e,t=0){const r=e.subarray(t,t+this.len);return He(r,this.encoding)}}const Ke="End-Of-Stream";class S extends Error{constructor(){super(Ke),this.name="EndOfStreamError"}}class Ye extends Error{constructor(e="The operation was aborted"){super(e),this.name="AbortError"}}class ye{constructor(){this.endOfStream=!1,this.interrupted=!1,this.peekQueue=[]}async peek(e,t=!1){const r=await this.read(e,t);return this.peekQueue.push(e.subarray(0,r)),r}async read(e,t=!1){if(e.length===0)return 0;let r=this.readFromPeekBuffer(e);if(this.endOfStream||(r+=await this.readRemainderFromStream(e.subarray(r),t)),r===0&&!t)throw new S;return r}readFromPeekBuffer(e){let t=e.length,r=0;for(;this.peekQueue.length>0&&t>0;){const n=this.peekQueue.pop();if(!n)throw new Error("peekData should be defined");const s=Math.min(n.length,t);e.set(n.subarray(0,s),r),r+=s,t-=s,s<n.length&&this.peekQueue.push(n.subarray(s))}return r}async readRemainderFromStream(e,t){let r=0;for(;r<e.length&&!this.endOfStream;){if(this.interrupted)throw new Ye;const n=await this.readFromStream(e.subarray(r),t);if(n===0)break;r+=n}if(!t&&r<e.length)throw new S;return r}}class et extends ye{constructor(e){super(),this.reader=e}async abort(){return this.close()}async close(){this.reader.releaseLock()}}class tt extends et{async readFromStream(e,t){if(e.length===0)return 0;const r=await this.reader.read(new Uint8Array(e.length),{min:t?void 0:e.length});return r.done&&(this.endOfStream=r.done),r.value?(e.set(r.value),r.value.length):0}}class ke extends ye{constructor(e){super(),this.reader=e,this.buffer=null}writeChunk(e,t){const r=Math.min(t.length,e.length);return e.set(t.subarray(0,r)),r<t.length?this.buffer=t.subarray(r):this.buffer=null,r}async readFromStream(e,t){if(e.length===0)return 0;let r=0;for(this.buffer&&(r+=this.writeChunk(e,this.buffer));r<e.length&&!this.endOfStream;){const n=await this.reader.read();if(n.done){this.endOfStream=!0;break}n.value&&(r+=this.writeChunk(e.subarray(r),n.value))}if(!t&&r===0&&this.endOfStream)throw new S;return r}abort(){return this.interrupted=!0,this.reader.cancel()}async close(){await this.abort(),this.reader.releaseLock()}}function it(i){try{const e=i.getReader({mode:"byob"});return e instanceof ReadableStreamDefaultReader?new ke(e):new tt(e)}catch(e){if(e instanceof TypeError)return new ke(i.getReader());throw e}}class Se{constructor(e){this.numBuffer=new Uint8Array(8),this.position=0,this.onClose=e==null?void 0:e.onClose,e!=null&&e.abortSignal&&e.abortSignal.addEventListener("abort",()=>{this.abort()})}async readToken(e,t=this.position){const r=new Uint8Array(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new S;return e.get(r,0)}async peekToken(e,t=this.position){const r=new Uint8Array(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new S;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new S;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new S;return e.get(this.numBuffer,0)}async ignore(e){if(this.fileInfo.size!==void 0){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){var e;await this.abort(),await((e=this.onClose)==null?void 0:e.call(this))}normalizeOptions(e,t){if(!this.supportsRandomAccess()&&t&&t.position!==void 0&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return{mayBeLess:!1,offset:0,length:e.length,position:this.position,...t}}abort(){return Promise.resolve()}}const rt=256e3;class nt extends Se{constructor(e,t){super(t),this.streamReader=e,this.fileInfo=(t==null?void 0:t.fileInfo)??{}}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(r.length===0)return 0;const s=await this.streamReader.read(e.subarray(0,r.length),r.mayBeLess);if(this.position+=s,(!t||!t.mayBeLess)&&s<r.length)throw new S;return s}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const s=r.position-this.position;if(s>0){const x=new Uint8Array(r.length+s);return n=await this.peekBuffer(x,{mayBeLess:r.mayBeLess}),e.set(x.subarray(s)),n-s}if(s<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e.subarray(0,r.length),r.mayBeLess)}catch(s){if(t!=null&&t.mayBeLess&&s instanceof S)return 0;throw s}if(!r.mayBeLess&&n<r.length)throw new S}return n}async ignore(e){const t=Math.min(rt,e),r=new Uint8Array(t);let n=0;for(;n<e;){const s=e-n,x=await this.readBuffer(r,{length:Math.min(t,s)});if(x<0)return x;n+=x}return n}abort(){return this.streamReader.abort()}async close(){return this.streamReader.close()}supportsRandomAccess(){return!1}}class at extends Se{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo={...(t==null?void 0:t.fileInfo)??{},size:e.length}}async readBuffer(e,t){t!=null&&t.position&&(this.position=t.position);const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new S;return e.set(this.uint8Array.subarray(r.position,r.position+n)),n}close(){return super.close()}supportsRandomAccess(){return!0}setPosition(e){this.position=e}}function st(i,e){const t=it(i),r=e??{},n=r.onClose;return r.onClose=async()=>{if(await t.close(),n)return n()},new nt(t,r)}function ot(i,e){return new at(i,e)}var C=Uint8Array,P=Uint16Array,ct=Int32Array,Be=new C([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,0]),Ae=new C([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,0,0]),ft=new C([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ze=function(i,e){for(var t=new P(31),r=0;r<31;++r)t[r]=e+=1<<i[r-1];for(var n=new ct(t[30]),r=1;r<30;++r)for(var s=t[r];s<t[r+1];++s)n[s]=s-t[r]<<5|r;return{b:t,r:n}},De=ze(Be,2),Ee=De.b,xt=De.r;Ee[28]=258,xt[258]=28;var mt=ze(Ae,0),lt=mt.b,ce=new P(32768);for(var u=0;u<32768;++u){var L=(u&43690)>>1|(u&21845)<<1;L=(L&52428)>>2|(L&13107)<<2,L=(L&61680)>>4|(L&3855)<<4,ce[u]=((L&65280)>>8|(L&255)<<8)>>1}var V=function(i,e,t){for(var r=i.length,n=0,s=new P(e);n<r;++n)i[n]&&++s[i[n]-1];var x=new P(e);for(n=1;n<e;++n)x[n]=x[n-1]+s[n-1]<<1;var l;if(t){l=new P(1<<e);var f=15-e;for(n=0;n<r;++n)if(i[n])for(var m=n<<4|i[n],o=e-i[n],a=x[i[n]-1]++<<o,c=a|(1<<o)-1;a<=c;++a)l[ce[a]>>f]=m}else for(l=new P(r),n=0;n<r;++n)i[n]&&(l[n]=ce[x[i[n]-1]++]>>15-i[n]);return l},$=new C(288);for(var u=0;u<144;++u)$[u]=8;for(var u=144;u<256;++u)$[u]=9;for(var u=256;u<280;++u)$[u]=7;for(var u=280;u<288;++u)$[u]=8;var Te=new C(32);for(var u=0;u<32;++u)Te[u]=5;var pt=V($,9,1),ut=V(Te,5,1),ie=function(i){for(var e=i[0],t=1;t<i.length;++t)i[t]>e&&(e=i[t]);return e},A=function(i,e,t){var r=e/8|0;return(i[r]|i[r+1]<<8)>>(e&7)&t},re=function(i,e){var t=e/8|0;return(i[t]|i[t+1]<<8|i[t+2]<<16)>>(e&7)},ht=function(i){return(i+7)/8|0},dt=function(i,e,t){return(t==null||t>i.length)&&(t=i.length),new C(i.subarray(e,t))},gt=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],b=function(i,e,t){var r=new Error(e||gt[i]);if(r.code=i,Error.captureStackTrace&&Error.captureStackTrace(r,b),!t)throw r;return r},xe=function(i,e,t,r){var n=i.length,s=0;if(!n||e.f&&!e.l)return t||new C(0);var x=!t,l=x||e.i!=2,f=e.i;x&&(t=new C(n*3));var m=function(ge){var we=t.length;if(ge>we){var ve=new C(Math.max(we*2,ge));ve.set(t),t=ve}},o=e.f||0,a=e.p||0,c=e.b||0,p=e.l,k=e.d,d=e.m,g=e.n,B=n*8;do{if(!p){o=A(i,a,1);var T=A(i,a+1,3);if(a+=3,T)if(T==1)p=pt,k=ut,d=9,g=5;else if(T==2){var M=A(i,a,31)+257,Z=A(i,a+10,15)+4,q=M+A(i,a+5,31)+1;a+=14;for(var j=new C(q),X=new C(19),y=0;y<Z;++y)X[ft[y]]=A(i,a+y*3,7);a+=Z*3;for(var me=ie(X),Le=(1<<me)-1,Me=V(X,me,1),y=0;y<q;){var le=Me[A(i,a,Le)];a+=le&15;var F=le>>4;if(F<16)j[y++]=F;else{var U=0,G=0;for(F==16?(G=3+A(i,a,3),a+=2,U=j[y-1]):F==17?(G=3+A(i,a,7),a+=3):F==18&&(G=11+A(i,a,127),a+=7);G--;)j[y++]=U}}var pe=j.subarray(0,M),I=j.subarray(M);d=ie(pe),g=ie(I),p=V(pe,d,1),k=V(I,g,1)}else b(1);else{var F=ht(a)+4,O=i[F-4]|i[F-3]<<8,W=F+O;if(W>n){f&&b(0);break}l&&m(c+O),t.set(i.subarray(F,W),c),e.b=c+=O,e.p=a=W*8,e.f=o;continue}if(a>B){f&&b(0);break}}l&&m(c+131072);for(var je=(1<<d)-1,Ue=(1<<g)-1,K=a;;K=a){var U=p[re(i,a)&je],R=U>>4;if(a+=U&15,a>B){f&&b(0);break}if(U||b(2),R<256)t[c++]=R;else if(R==256){K=a,p=null;break}else{var ue=R-254;if(R>264){var y=R-257,H=Be[y];ue=A(i,a,(1<<H)-1)+Ee[y],a+=H}var Y=k[re(i,a)&Ue],ee=Y>>4;Y||b(3),a+=Y&15;var I=lt[ee];if(ee>3){var H=Ae[ee];I+=re(i,a)&(1<<H)-1,a+=H}if(a>B){f&&b(0);break}l&&m(c+131072);var he=c+ue;if(c<I){var de=s-I,Re=Math.min(I,he);for(de+c<0&&b(3);c<Re;++c)t[c]=r[de+c]}for(;c<he;++c)t[c]=t[c-I]}}e.l=p,e.p=K,e.b=c,e.f=o,p&&(o=1,e.m=d,e.d=k,e.n=g)}while(!o);return c!=t.length&&x?dt(t,0,c):t.subarray(0,c)},wt=new C(0),vt=function(i){(i[0]!=31||i[1]!=139||i[2]!=8)&&b(6,"invalid gzip data");var e=i[3],t=10;e&4&&(t+=(i[10]|i[11]<<8)+2);for(var r=(e>>3&1)+(e>>4&1);r>0;r-=!i[t++]);return t+(e&2)},kt=function(i){var e=i.length;return(i[e-4]|i[e-3]<<8|i[e-2]<<16|i[e-1]<<24)>>>0},bt=function(i,e){return((i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31)&&b(6,"invalid zlib data"),(i[1]>>5&1)==1&&b(6,"invalid zlib data: "+(i[1]&32?"need":"unexpected")+" dictionary"),(i[1]>>3&4)+2};function Ct(i,e){return xe(i,{i:2},e,e)}function Ft(i,e){var t=vt(i);return t+8>i.length&&b(6,"invalid gzip data"),xe(i.subarray(t,-8),{i:2},new C(kt(i)),e)}function yt(i,e){return xe(i.subarray(bt(i),-4),{i:2},e,e)}function St(i,e){return i[0]==31&&i[1]==139&&i[2]==8?Ft(i,e):(i[0]&15)!=8||i[0]>>4>7||(i[0]<<8|i[1])%31?Ct(i,e):yt(i,e)}var Bt=typeof TextDecoder<"u"&&new TextDecoder,At=0;try{Bt.decode(wt,{stream:!0}),At=1}catch{}var fe={exports:{}},ne,be;function zt(){if(be)return ne;be=1;var i=1e3,e=i*60,t=e*60,r=t*24,n=r*7,s=r*365.25;ne=function(o,a){a=a||{};var c=typeof o;if(c==="string"&&o.length>0)return x(o);if(c==="number"&&isFinite(o))return a.long?f(o):l(o);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(o))};function x(o){if(o=String(o),!(o.length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(o);if(a){var c=parseFloat(a[1]),p=(a[2]||"ms").toLowerCase();switch(p){case"years":case"year":case"yrs":case"yr":case"y":return c*s;case"weeks":case"week":case"w":return c*n;case"days":case"day":case"d":return c*r;case"hours":case"hour":case"hrs":case"hr":case"h":return c*t;case"minutes":case"minute":case"mins":case"min":case"m":return c*e;case"seconds":case"second":case"secs":case"sec":case"s":return c*i;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function l(o){var a=Math.abs(o);return a>=r?Math.round(o/r)+"d":a>=t?Math.round(o/t)+"h":a>=e?Math.round(o/e)+"m":a>=i?Math.round(o/i)+"s":o+"ms"}function f(o){var a=Math.abs(o);return a>=r?m(o,a,r,"day"):a>=t?m(o,a,t,"hour"):a>=e?m(o,a,e,"minute"):a>=i?m(o,a,i,"second"):o+" ms"}function m(o,a,c,p){var k=a>=c*1.5;return Math.round(o/c)+" "+p+(k?"s":"")}return ne}function Dt(i){t.debug=t,t.default=t,t.coerce=f,t.disable=x,t.enable=n,t.enabled=l,t.humanize=zt(),t.destroy=m,Object.keys(i).forEach(o=>{t[o]=i[o]}),t.names=[],t.skips=[],t.formatters={};function e(o){let a=0;for(let c=0;c<o.length;c++)a=(a<<5)-a+o.charCodeAt(c),a|=0;return t.colors[Math.abs(a)%t.colors.length]}t.selectColor=e;function t(o){let a,c=null,p,k;function d(...g){if(!d.enabled)return;const B=d,T=Number(new Date),F=T-(a||T);B.diff=F,B.prev=a,B.curr=T,a=T,g[0]=t.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let O=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(M,Z)=>{if(M==="%%")return"%";O++;const q=t.formatters[Z];if(typeof q=="function"){const j=g[O];M=q.call(B,j),g.splice(O,1),O--}return M}),t.formatArgs.call(B,g),(B.log||t.log).apply(B,g)}return d.namespace=o,d.useColors=t.useColors(),d.color=t.selectColor(o),d.extend=r,d.destroy=t.destroy,Object.defineProperty(d,"enabled",{enumerable:!0,configurable:!1,get:()=>c!==null?c:(p!==t.namespaces&&(p=t.namespaces,k=t.enabled(o)),k),set:g=>{c=g}}),typeof t.init=="function"&&t.init(d),d}function r(o,a){const c=t(this.namespace+(typeof a>"u"?":":a)+o);return c.log=this.log,c}function n(o){t.save(o),t.namespaces=o,t.names=[],t.skips=[];const a=(typeof o=="string"?o:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const c of a)c[0]==="-"?t.skips.push(c.slice(1)):t.names.push(c)}function s(o,a){let c=0,p=0,k=-1,d=0;for(;c<o.length;)if(p<a.length&&(a[p]===o[c]||a[p]==="*"))a[p]==="*"?(k=p,d=c,p++):(c++,p++);else if(k!==-1)p=k+1,d++,c=d;else return!1;for(;p<a.length&&a[p]==="*";)p++;return p===a.length}function x(){const o=[...t.names,...t.skips.map(a=>"-"+a)].join(",");return t.enable(""),o}function l(o){for(const a of t.skips)if(s(o,a))return!1;for(const a of t.names)if(s(o,a))return!0;return!1}function f(o){return o instanceof Error?o.stack||o.message:o}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}var Et=Dt;(function(i,e){e.formatArgs=r,e.save=n,e.load=s,e.useColors=t,e.storage=x(),e.destroy=(()=>{let f=!1;return()=>{f||(f=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let f;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(f=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(f[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function r(f){if(f[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+f[0]+(this.useColors?"%c ":" ")+"+"+i.exports.humanize(this.diff),!this.useColors)return;const m="color: "+this.color;f.splice(1,0,m,"color: inherit");let o=0,a=0;f[0].replace(/%[a-zA-Z%]/g,c=>{c!=="%%"&&(o++,c==="%c"&&(a=o))}),f.splice(a,0,m)}e.log=console.debug||console.log||(()=>{});function n(f){try{f?e.storage.setItem("debug",f):e.storage.removeItem("debug")}catch{}}function s(){let f;try{f=e.storage.getItem("debug")||e.storage.getItem("DEBUG")}catch{}return!f&&typeof process<"u"&&"env"in process&&(f=process.env.DEBUG),f}function x(){try{return localStorage}catch{}}i.exports=Et(e);const{formatters:l}=i.exports;l.j=function(f){try{return JSON.stringify(f)}catch(m){return"[UnexpectedJSONParseError]: "+m.message}}})(fe,fe.exports);var Tt=fe.exports;const Ot=qe.getDefaultExportFromCjs(Tt),N={LocalFileHeader:67324752,DataDescriptor:134695760,CentralFileHeader:33639248,EndOfCentralDirectory:101010256},Ce={get(i){return h.get(i,6),{signature:w.get(i,0),compressedSize:w.get(i,8),uncompressedSize:w.get(i,12)}},len:16},It={get(i){const e=h.get(i,6);return{signature:w.get(i,0),minVersion:h.get(i,4),dataDescriptor:!!(e&8),compressedMethod:h.get(i,8),compressedSize:w.get(i,18),uncompressedSize:w.get(i,22),filenameLength:h.get(i,26),extraFieldLength:h.get(i,28),filename:null}},len:30},Lt={get(i){return{signature:w.get(i,0),nrOfThisDisk:h.get(i,4),nrOfThisDiskWithTheStart:h.get(i,6),nrOfEntriesOnThisDisk:h.get(i,8),nrOfEntriesOfSize:h.get(i,10),sizeOfCd:w.get(i,12),offsetOfStartOfCd:w.get(i,16),zipFileCommentLength:h.get(i,20)}},len:22},Mt={get(i){const e=h.get(i,8);return{signature:w.get(i,0),minVersion:h.get(i,6),dataDescriptor:!!(e&8),compressedMethod:h.get(i,10),compressedSize:w.get(i,20),uncompressedSize:w.get(i,24),filenameLength:h.get(i,28),extraFieldLength:h.get(i,30),fileCommentLength:h.get(i,32),relativeOffsetOfLocalHeader:w.get(i,42),filename:null}},len:46};function Oe(i){const e=new Uint8Array(w.len);return w.put(e,0,i),e}const z=Ot("tokenizer:inflate"),ae=256*1024,jt=Oe(N.DataDescriptor),Q=Oe(N.EndOfCentralDirectory);class Ut{constructor(e){this.tokenizer=e,this.syncBuffer=new Uint8Array(ae)}async isZip(){return await this.peekSignature()===N.LocalFileHeader}peekSignature(){return this.tokenizer.peekToken(w)}async findEndOfCentralDirectoryLocator(){const e=this.tokenizer,t=Math.min(16*1024,e.fileInfo.size),r=this.syncBuffer.subarray(0,t);await this.tokenizer.readBuffer(r,{position:e.fileInfo.size-t});for(let n=r.length-4;n>=0;n--)if(r[n]===Q[0]&&r[n+1]===Q[1]&&r[n+2]===Q[2]&&r[n+3]===Q[3])return e.fileInfo.size-t+n;return-1}async readCentralDirectory(){if(!this.tokenizer.supportsRandomAccess()){z("Cannot reading central-directory without random-read support");return}z("Reading central-directory...");const e=this.tokenizer.position,t=await this.findEndOfCentralDirectoryLocator();if(t>0){z("Central-directory 32-bit signature found");const r=await this.tokenizer.readToken(Lt,t),n=[];this.tokenizer.setPosition(r.offsetOfStartOfCd);for(let s=0;s<r.nrOfEntriesOfSize;++s){const x=await this.tokenizer.readToken(Mt);if(x.signature!==N.CentralFileHeader)throw new Error("Expected Central-File-Header signature");x.filename=await this.tokenizer.readToken(new E(x.filenameLength,"utf-8")),await this.tokenizer.ignore(x.extraFieldLength),await this.tokenizer.ignore(x.fileCommentLength),n.push(x),z(`Add central-directory file-entry: n=${s+1}/${n.length}: filename=${n[s].filename}`)}return this.tokenizer.setPosition(e),n}this.tokenizer.setPosition(e)}async unzip(e){const t=await this.readCentralDirectory();if(t)return this.iterateOverCentralDirectory(t,e);let r=!1;do{const n=await this.readLocalFileHeader();if(!n)break;const s=e(n);r=!!s.stop;let x;if(await this.tokenizer.ignore(n.extraFieldLength),n.dataDescriptor&&n.compressedSize===0){const l=[];let f=ae;z("Compressed-file-size unknown, scanning for next data-descriptor-signature....");let m=-1;for(;m<0&&f===ae;){f=await this.tokenizer.peekBuffer(this.syncBuffer,{mayBeLess:!0}),m=Rt(this.syncBuffer.subarray(0,f),jt);const o=m>=0?m:f;if(s.handler){const a=new Uint8Array(o);await this.tokenizer.readBuffer(a),l.push(a)}else await this.tokenizer.ignore(o)}z(`Found data-descriptor-signature at pos=${this.tokenizer.position}`),s.handler&&await this.inflate(n,Pt(l),s.handler)}else s.handler?(z(`Reading compressed-file-data: ${n.compressedSize} bytes`),x=new Uint8Array(n.compressedSize),await this.tokenizer.readBuffer(x),await this.inflate(n,x,s.handler)):(z(`Ignoring compressed-file-data: ${n.compressedSize} bytes`),await this.tokenizer.ignore(n.compressedSize));if(z(`Reading data-descriptor at pos=${this.tokenizer.position}`),n.dataDescriptor&&(await this.tokenizer.readToken(Ce)).signature!==134695760)throw new Error(`Expected data-descriptor-signature at position ${this.tokenizer.position-Ce.len}`)}while(!r)}async iterateOverCentralDirectory(e,t){for(const r of e){const n=t(r);if(n.handler){this.tokenizer.setPosition(r.relativeOffsetOfLocalHeader);const s=await this.readLocalFileHeader();if(s){await this.tokenizer.ignore(s.extraFieldLength);const x=new Uint8Array(r.compressedSize);await this.tokenizer.readBuffer(x),await this.inflate(s,x,n.handler)}}if(n.stop)break}}inflate(e,t,r){if(e.compressedMethod===0)return r(t);z(`Decompress filename=${e.filename}, compressed-size=${t.length}`);const n=St(t);return r(n)}async readLocalFileHeader(){const e=await this.tokenizer.peekToken(w);if(e===N.LocalFileHeader){const t=await this.tokenizer.readToken(It);return t.filename=await this.tokenizer.readToken(new E(t.filenameLength,"utf-8")),t}if(e===N.CentralFileHeader)return!1;throw e===3759263696?new Error("Encrypted ZIP"):new Error("Unexpected signature")}}function Rt(i,e){const t=i.length,r=e.length;if(r>t)return-1;for(let n=0;n<=t-r;n++){let s=!0;for(let x=0;x<r;x++)if(i[n+x]!==e[x]){s=!1;break}if(s)return n}return-1}function Pt(i){const e=i.reduce((n,s)=>n+s.length,0),t=new Uint8Array(e);let r=0;for(const n of i)t.set(n,r),r+=n.length;return t}new globalThis.TextDecoder("utf8");new globalThis.TextEncoder;Array.from({length:256},(i,e)=>e.toString(16).padStart(2,"0"));function Fe(i){const{byteLength:e}=i;if(e===6)return i.getUint16(0)*2**32+i.getUint32(2);if(e===5)return i.getUint8(0)*2**32+i.getUint32(1);if(e===4)return i.getUint32(0);if(e===3)return i.getUint8(0)*2**16+i.getUint16(1);if(e===2)return i.getUint16(0);if(e===1)return i.getUint8(0)}function Nt(i){return[...i].map(e=>e.charCodeAt(0))}function qt(i,e=0){const t=Number.parseInt(new E(6).get(i,148).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(t))return!1;let r=8*32;for(let n=e;n<e+148;n++)r+=i[n];for(let n=e+156;n<e+512;n++)r+=i[n];return t===r}const Ht={get:(i,e)=>i[e+3]&127|i[e+2]<<7|i[e+1]<<14|i[e]<<21,len:4},_t=["jpg","png","apng","gif","webp","flif","xcf","cr2","cr3","orf","arw","dng","nef","rw2","raf","tif","bmp","icns","jxr","psd","indd","zip","tar","rar","gz","bz2","7z","dmg","mp4","mid","mkv","webm","mov","avi","mpg","mp2","mp3","m4a","oga","ogg","ogv","opus","flac","wav","spx","amr","pdf","epub","elf","macho","exe","swf","rtf","wasm","woff","woff2","eot","ttf","otf","ttc","ico","flv","ps","xz","sqlite","nes","crx","xpi","cab","deb","ar","rpm","Z","lz","cfb","mxf","mts","blend","bpg","docx","pptx","xlsx","3gp","3g2","j2c","jp2","jpm","jpx","mj2","aif","qcp","odt","ods","odp","xml","mobi","heic","cur","ktx","ape","wv","dcm","ics","glb","pcap","dsf","lnk","alias","voc","ac3","m4v","m4p","m4b","f4v","f4p","f4b","f4a","mie","asf","ogm","ogx","mpc","arrow","shp","aac","mp1","it","s3m","xm","skp","avif","eps","lzh","pgp","asar","stl","chm","3mf","zst","jxl","vcf","jls","pst","dwg","parquet","class","arj","cpio","ace","avro","icc","fbx","vsdx","vtt","apk","drc","lz4","potx","xltx","dotx","xltm","ott","ots","otp","odg","otg","xlsm","docm","dotm","potm","pptm","jar","rm","ppsm","ppsx"],Vt=["image/jpeg","image/png","image/gif","image/webp","image/flif","image/x-xcf","image/x-canon-cr2","image/x-canon-cr3","image/tiff","image/bmp","image/vnd.ms-photo","image/vnd.adobe.photoshop","application/x-indesign","application/epub+zip","application/x-xpinstall","application/vnd.ms-powerpoint.slideshow.macroenabled.12","application/vnd.oasis.opendocument.text","application/vnd.oasis.opendocument.spreadsheet","application/vnd.oasis.opendocument.presentation","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.openxmlformats-officedocument.presentationml.presentation","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.openxmlformats-officedocument.presentationml.slideshow","application/zip","application/x-tar","application/x-rar-compressed","application/gzip","application/x-bzip2","application/x-7z-compressed","application/x-apple-diskimage","application/vnd.apache.arrow.file","video/mp4","audio/midi","video/matroska","video/webm","video/quicktime","video/vnd.avi","audio/wav","audio/qcelp","audio/x-ms-asf","video/x-ms-asf","application/vnd.ms-asf","video/mpeg","video/3gpp","audio/mpeg","audio/mp4","video/ogg","audio/ogg","audio/ogg; codecs=opus","application/ogg","audio/flac","audio/ape","audio/wavpack","audio/amr","application/pdf","application/x-elf","application/x-mach-binary","application/x-msdownload","application/x-shockwave-flash","application/rtf","application/wasm","font/woff","font/woff2","application/vnd.ms-fontobject","font/ttf","font/otf","font/collection","image/x-icon","video/x-flv","application/postscript","application/eps","application/x-xz","application/x-sqlite3","application/x-nintendo-nes-rom","application/x-google-chrome-extension","application/vnd.ms-cab-compressed","application/x-deb","application/x-unix-archive","application/x-rpm","application/x-compress","application/x-lzip","application/x-cfb","application/x-mie","application/mxf","video/mp2t","application/x-blender","image/bpg","image/j2c","image/jp2","image/jpx","image/jpm","image/mj2","audio/aiff","application/xml","application/x-mobipocket-ebook","image/heif","image/heif-sequence","image/heic","image/heic-sequence","image/icns","image/ktx","application/dicom","audio/x-musepack","text/calendar","text/vcard","text/vtt","model/gltf-binary","application/vnd.tcpdump.pcap","audio/x-dsf","application/x.ms.shortcut","application/x.apple.alias","audio/x-voc","audio/vnd.dolby.dd-raw","audio/x-m4a","image/apng","image/x-olympus-orf","image/x-sony-arw","image/x-adobe-dng","image/x-nikon-nef","image/x-panasonic-rw2","image/x-fujifilm-raf","video/x-m4v","video/3gpp2","application/x-esri-shape","audio/aac","audio/x-it","audio/x-s3m","audio/x-xm","video/MP1S","video/MP2P","application/vnd.sketchup.skp","image/avif","application/x-lzh-compressed","application/pgp-encrypted","application/x-asar","model/stl","application/vnd.ms-htmlhelp","model/3mf","image/jxl","application/zstd","image/jls","application/vnd.ms-outlook","image/vnd.dwg","application/vnd.apache.parquet","application/java-vm","application/x-arj","application/x-cpio","application/x-ace-compressed","application/avro","application/vnd.iccprofile","application/x.autodesk.fbx","application/vnd.visio","application/vnd.android.package-archive","application/vnd.google.draco","application/x-lz4","application/vnd.openxmlformats-officedocument.presentationml.template","application/vnd.openxmlformats-officedocument.spreadsheetml.template","application/vnd.openxmlformats-officedocument.wordprocessingml.template","application/vnd.ms-excel.template.macroenabled.12","application/vnd.oasis.opendocument.text-template","application/vnd.oasis.opendocument.spreadsheet-template","application/vnd.oasis.opendocument.presentation-template","application/vnd.oasis.opendocument.graphics","application/vnd.oasis.opendocument.graphics-template","application/vnd.ms-excel.sheet.macroenabled.12","application/vnd.ms-word.document.macroenabled.12","application/vnd.ms-word.template.macroenabled.12","application/vnd.ms-powerpoint.template.macroenabled.12","application/vnd.ms-powerpoint.presentation.macroenabled.12","application/java-archive","application/vnd.rn-realmedia"],J=4100;async function $t(i,e){return new Ie(e).fromBlob(i)}function se(i){switch(i=i.toLowerCase(),i){case"application/epub+zip":return{ext:"epub",mime:i};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:i};case"application/vnd.oasis.opendocument.text-template":return{ext:"ott",mime:i};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:i};case"application/vnd.oasis.opendocument.spreadsheet-template":return{ext:"ots",mime:i};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:i};case"application/vnd.oasis.opendocument.presentation-template":return{ext:"otp",mime:i};case"application/vnd.oasis.opendocument.graphics":return{ext:"odg",mime:i};case"application/vnd.oasis.opendocument.graphics-template":return{ext:"otg",mime:i};case"application/vnd.openxmlformats-officedocument.presentationml.slideshow":return{ext:"ppsx",mime:i};case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return{ext:"xlsx",mime:i};case"application/vnd.ms-excel.sheet.macroenabled":return{ext:"xlsm",mime:"application/vnd.ms-excel.sheet.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.spreadsheetml.template":return{ext:"xltx",mime:i};case"application/vnd.ms-excel.template.macroenabled":return{ext:"xltm",mime:"application/vnd.ms-excel.template.macroenabled.12"};case"application/vnd.ms-powerpoint.slideshow.macroenabled":return{ext:"ppsm",mime:"application/vnd.ms-powerpoint.slideshow.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return{ext:"docx",mime:i};case"application/vnd.ms-word.document.macroenabled":return{ext:"docm",mime:"application/vnd.ms-word.document.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.wordprocessingml.template":return{ext:"dotx",mime:i};case"application/vnd.ms-word.template.macroenabledtemplate":return{ext:"dotm",mime:"application/vnd.ms-word.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.template":return{ext:"potx",mime:i};case"application/vnd.ms-powerpoint.template.macroenabled":return{ext:"potm",mime:"application/vnd.ms-powerpoint.template.macroenabled.12"};case"application/vnd.openxmlformats-officedocument.presentationml.presentation":return{ext:"pptx",mime:i};case"application/vnd.ms-powerpoint.presentation.macroenabled":return{ext:"pptm",mime:"application/vnd.ms-powerpoint.presentation.macroenabled.12"};case"application/vnd.ms-visio.drawing":return{ext:"vsdx",mime:"application/vnd.visio"};case"application/vnd.ms-package.3dmanufacturing-3dmodel+xml":return{ext:"3mf",mime:"model/3mf"}}}function D(i,e,t){t={offset:0,...t};for(const[r,n]of e.entries())if(t.mask){if(n!==(t.mask[r]&i[r+t.offset]))return!1}else if(n!==i[r+t.offset])return!1;return!0}class Ie{constructor(e){te(this,"detectConfident",async e=>{if(this.buffer=new Uint8Array(J),e.fileInfo.size===void 0&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([199,113]))return{ext:"cpio",mime:"application/x-cpio"};if(this.check([96,234]))return{ext:"arj",mime:"application/x-arj"};if(this.check([239,187,191]))return this.tokenizer.ignore(3),this.detectConfident(e);if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(Ht);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),this.fromTokenizer(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((this.buffer[0]===67||this.buffer[0]===70)&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.check([255,216,255]))return this.check([247],{offset:3})?{ext:"jls",mime:"image/jls"}:{ext:"jpg",mime:"image/jpeg"};if(this.check([79,98,106,1]))return{ext:"avro",mime:"application/avro"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){let t;return await new Ut(e).unzip(r=>{switch(r.filename){case"META-INF/mozilla.rsa":return t={ext:"xpi",mime:"application/x-xpinstall"},{stop:!0};case"META-INF/MANIFEST.MF":return t={ext:"jar",mime:"application/java-archive"},{stop:!0};case"mimetype":return{async handler(n){const s=new TextDecoder("utf-8").decode(n).trim();t=se(s)},stop:!0};case"[Content_Types].xml":return{async handler(n){let s=new TextDecoder("utf-8").decode(n);const x=s.indexOf('.main+xml"');if(x===-1){const l="application/vnd.ms-package.3dmanufacturing-3dmodel+xml";s.includes(`ContentType="${l}"`)&&(t=se(l))}else{s=s.slice(0,Math.max(0,x));const l=s.lastIndexOf('"'),f=s.slice(Math.max(0,l+1));t=se(f)}},stop:!0};default:return/classes\d*\.dex/.test(r.filename)?(t={ext:"apk",mime:"application/vnd.android.package-archive"},{stop:!0}):{}}}),t??{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const t=new Uint8Array(8);return await e.readBuffer(t),D(t,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/ogg; codecs=opus"}:D(t,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:D(t,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:D(t,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:D(t,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:D(t,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(this.buffer[2]===3||this.buffer[2]===5||this.buffer[2]===7)&&(this.buffer[3]===4||this.buffer[3]===6||this.buffer[3]===8))return{ext:"zip",mime:"application/zip"};if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF"))return{ext:"pdf",mime:"application/pdf"};if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const t=await this.readTiffHeader(!1);if(t)return t}if(this.check([77,77])){const t=await this.readTiffHeader(!0);if(t)return t}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function t(){const l=await e.peekNumber(Ge);let f=128,m=0;for(;!(l&f)&&f!==0;)++m,f>>=1;const o=new Uint8Array(m+1);return await e.readBuffer(o),o}async function r(){const l=await t(),f=await t();f[0]^=128>>f.length-1;const m=Math.min(6,f.length),o=new DataView(l.buffer),a=new DataView(f.buffer,f.length-m,m);return{id:Fe(o),len:Fe(a)}}async function n(l){for(;l>0;){const f=await r();if(f.id===17026)return(await e.readToken(new E(f.len))).replaceAll(/\00.*$/g,"");await e.ignore(f.len),--l}}const s=await r();switch(await n(s.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/matroska"};default:return}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([33,66,68,78]))return{ext:"pst",mime:"application/vnd.ms-outlook"};if(this.checkString("PAR1")||this.checkString("PARE"))return{ext:"parquet",mime:"application/vnd.apache.parquet"};if(this.checkString("ttcf"))return{ext:"ttc",mime:"font/collection"};if(this.check([207,250,237,254]))return{ext:"macho",mime:"application/x-mach-binary"};if(this.check([4,34,77,24]))return{ext:"lz4",mime:"application/x-lz4"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([202,254,186,190]))return{ext:"class",mime:"application/java-vm"};if(this.checkString(".RMF"))return{ext:"rm",mime:"application/vnd.rn-realmedia"};if(this.checkString("DRACO"))return{ext:"drc",mime:"application/vnd.google.draco"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(this.buffer[6]===0||this.buffer[6]===1))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("AC")){const t=new E(4,"latin1").get(this.buffer,2);if(t.match("^d*")&&t>=1e3&&t<=1050)return{ext:"dwg",mime:"image/vnd.dwg"}}if(this.checkString("070707"))return{ext:"cpio",mime:"application/x-cpio"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>"))return await e.ignore(8),await e.readToken(new E(13,"ascii"))==="debian-binary"?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"};if(this.checkString("WEBVTT")&&[` `,"\r"," "," ","\0"].some(t=>this.checkString(t,{offset:6})))return{ext:"vtt",mime:"text/vtt"};if(this.check([137,80,78,71,13,10,26,10])){await e.ignore(8);async function t(){return{length:await e.readToken(Je),type:await e.readToken(new E(4,"latin1"))}}do{const r=await t();if(r.length<0)return;switch(r.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(r.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/vnd.apache.arrow.file"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.checkString("ftyp",{offset:4})&&this.buffer[8]&96){const t=new E(4,"latin1").get(this.buffer,8).replace("\0"," ").trim();switch(t){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return t.startsWith("3g")?t.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.check([82,73,70,70])){if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/wav"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function t(){const r=new Uint8Array(16);return await e.readBuffer(r),{id:r,size:Number(await e.readToken(Xe))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const r=await t();let n=r.size-24;if(D(r.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const s=new Uint8Array(16);if(n-=await e.readBuffer(s),D(s,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(D(s,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(n)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([255,79,255,81]))return{ext:"j2c",mime:"image/j2c"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10]))switch(await e.ignore(20),await e.readToken(new E(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255]))return this.check([0,60,0,63,0,120,0,109,0,108],{offset:2})?{ext:"xml",mime:"application/xml"}:void 0;if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.check([97,99,115,112],{offset:36}))return{ext:"icc",mime:"application/vnd.iccprofile"};if(this.checkString("**ACE",{offset:7})&&this.checkString("**",{offset:12}))return{ext:"ace",mime:"application/x-ace-compressed"};if(this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const t=new DataView(this.buffer.buffer).getUint32(12,!0);if(t>12&&this.buffer.length>=t+16)try{const r=new TextDecoder().decode(this.buffer.subarray(16,t+16));if(JSON.parse(r).files)return{ext:"asar",mime:"application/x-asar"}}catch{}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.checkString("Kaydara FBX Binary \0"))return{ext:"fbx",mime:"application/x.autodesk.fbx"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),this.checkString("ustar",{offset:257})&&(this.checkString("\0",{offset:262})||this.checkString(" ",{offset:262}))||this.check([0,0,0,0,0,0],{offset:257})&&qt(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254]))return this.check([60,0,63,0,120,0,109,0,108,0],{offset:2})?{ext:"xml",mime:"application/xml"}:this.check([255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0],{offset:2})?{ext:"skp",mime:"application/vnd.sketchup.skp"}:void 0;if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"}});te(this,"detectImprecise",async e=>{if(this.buffer=new Uint8Array(J),await e.peekBuffer(this.buffer,{length:Math.min(8,e.fileInfo.size),mayBeLess:!0}),this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(await e.peekBuffer(this.buffer,{length:Math.min(2+this.options.mpegOffsetTolerance,e.fileInfo.size),mayBeLess:!0}),this.buffer.length>=2+this.options.mpegOffsetTolerance)for(let t=0;t<=this.options.mpegOffsetTolerance;++t){const r=this.scanMpeg(t);if(r)return r}});this.options={mpegOffsetTolerance:0,...e},this.detectors=[...(e==null?void 0:e.customDetectors)??[],{id:"core",detect:this.detectConfident},{id:"core.imprecise",detect:this.detectImprecise}],this.tokenizerOptions={abortSignal:e==null?void 0:e.signal}}async fromTokenizer(e){const t=e.position;for(const r of this.detectors){const n=await r.detect(e);if(n)return n;if(t!==e.position)return}}async fromBuffer